Skip to content
Snippets Groups Projects
Select Git revision
  • cfafee099680b350b23d78fb71ab36a12b4e9b4e
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

MessengerStartBackup.swift

Blame
  • GroupReport.swift 624 B
    import Foundation
    
    public struct GroupReport: Equatable {
      public init(
        id: Data,
        rounds: [Int],
        status: Int
      ) {
        self.id = id
        self.rounds = rounds
        self.status = status
      }
    
      public var id: Data
      public var rounds: [Int]
      public var status: Int
    }
    
    extension GroupReport: Codable {
      enum CodingKeys: String, CodingKey {
        case id = "Id"
        case rounds = "Rounds"
        case status = "Status"
      }
    
      public static func decode(_ data: Data) throws -> Self {
        try JSONDecoder().decode(Self.self, from: data)
      }
    
      public func encode() throws -> Data {
        try JSONEncoder().encode(self)
      }
    }