From ae03a375a8a31b8e58641e7d627d3f256dfca481 Mon Sep 17 00:00:00 2001 From: Philippe Weidmann Date: Fri, 20 Oct 2023 13:34:03 +0200 Subject: [PATCH] feat: Cursored APIResponse --- Sources/InfomaniakCore/Networking/ApiResponse.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/InfomaniakCore/Networking/ApiResponse.swift b/Sources/InfomaniakCore/Networking/ApiResponse.swift index 0f9724c..393630b 100644 --- a/Sources/InfomaniakCore/Networking/ApiResponse.swift +++ b/Sources/InfomaniakCore/Networking/ApiResponse.swift @@ -36,6 +36,7 @@ open class ApiResponse: Decodable { public let page: Int? public let itemsPerPage: Int? public let responseAt: Int? + public let cursor: String? enum CodingKeys: String, CodingKey { case result @@ -46,6 +47,7 @@ open class ApiResponse: Decodable { case page case itemsPerPage = "items_per_page" case responseAt = "response_at" + case cursor } public required init(from decoder: Decoder) throws { @@ -64,5 +66,6 @@ open class ApiResponse: Decodable { page = try container.decodeIfPresent(Int.self, forKey: .page) itemsPerPage = try container.decodeIfPresent(Int.self, forKey: .itemsPerPage) responseAt = try container.decodeIfPresent(Int.self, forKey: .responseAt) + cursor = try container.decodeIfPresent(String.self, forKey: .cursor) } }