AuthModel.swift
1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// 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"
}
}