AuthModel.swift 1.55 KB
//
//  AuthModel.swift
//  InterQR-Internship
//
//  Created by Дмитрий Тимофеев on 25.06.2022.
//

import Foundation
struct InterQR: Decodable {
    var Auth: Auth
}

struct Auth: Decodable {
    var initialize: Init
    var start: Start
    var verify: Verify
    var login: Login
    
    enum CodingKeys: String, CodingKey {
        case initialize = "init"
        case start = "start 2fa"
        case verify = "verify 2fa"
        case login
    }
}

struct Initialize : Decodable {
    var message: Init
    
    enum CodingKeys: String, CodingKey {
        case message = "message"
    }
}

struct Init: Decodable {
    var deviceID: String
    var manufacturer: String
    var model: String
    var platform: String
    var osVersion: String
    var appVersion: String
    
    enum CodingKeys: String, CodingKey {
        case deviceID = "device_uuid"
        case manufacturer, model, platform
        case osVersion = "os_version"
        case appVersion = "app_version"
    }
}

struct Start: Decodable {
    var emailOrNumber: String
    
    enum CodingKeys: String, CodingKey {
        case emailOrNumber = "email_or_number"
    }
}

struct Verify: Decodable {
    var emailOrNumber: String
    var code: String
    var secondAuthToken: String
    
    enum CodingKeys: String, CodingKey {
        case emailOrNumber = "email_or_number"
        case code
        case secondAuthToken = "second_auth_token"
    }
}

struct Login: Decodable {
    var deviceID: String
    
    enum CodingKeys: String, CodingKey {
        case deviceID = "device_uuid"
    }
}