Files
Morgan Pretty 5e384eb7fb Moved and renamed remaining API definitions
• Cleaned up API structures to be more consistent
• Moved OpenGroupAPI into SessionNetworkingKit
• Moved PushNotificationAPI into SessionNetworkingKit
• Renamed to OpenGroupAPI to SOGSAPI
2025-09-15 14:22:39 +10:00

35 lines
1.2 KiB
Swift

// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
import Foundation
extension Network.SnodeAPI {
/// This is the legacy unauthenticated message retrieval request
struct LegacyGetMessagesRequest: Encodable {
enum CodingKeys: String, CodingKey {
case pubkey
case lastHash = "last_hash"
case namespace
case maxCount = "max_count"
case maxSize = "max_size"
}
let pubkey: String
let lastHash: String
let namespace: Network.SnodeAPI.Namespace?
let maxCount: Int64?
let maxSize: Int64?
// MARK: - Coding
public func encode(to encoder: Encoder) throws {
var container: KeyedEncodingContainer<CodingKeys> = encoder.container(keyedBy: CodingKeys.self)
try container.encode(pubkey, forKey: .pubkey)
try container.encode(lastHash, forKey: .lastHash)
try container.encodeIfPresent(namespace, forKey: .namespace)
try container.encodeIfPresent(maxCount, forKey: .maxCount)
try container.encodeIfPresent(maxSize, forKey: .maxSize)
}
}
}