AuthModel.swift
1.64 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
78
79
80
81
82
83
84
85
//
// AuthModel.swift
// InterQR-Internship
//
// Created by Дмитрий Тимофеев on 25.06.2022.
//
import Foundation
//MARK: - Init collection
struct InitRequestModel: Codable {
var deviceUUID: String
var manufacturer: String
var model: String
var platform: String
var osVersion: String
var appVersion: String
}
struct InitResponseModel: Decodable {
var message: String
}
//MARK: - Start2fa collection
struct StartRequestModel: Codable {
var emailOrNumber: String
enum CodingKeys: String, CodingKey {
case emailOrNumber = "email_or_number"
}
}
struct StartResponseModel: Decodable {
var message: String
}
//MARK: - Verify2fa collection
struct VerifyRequestModel: Codable {
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 VerifyResponseModel: Decodable {
var data: VerifyData
var message: String
}
struct VerifyData: Decodable {
var token: String
var uuid: String
}
//MARK: - Login collection
struct LoginRequestModel: Codable {
var deviceUUID: String
enum CodingKeys: String, CodingKey {
case deviceUUID = "device_uuid"
}
}
struct LoginResponseModel: Decodable {
var message: String?
}
//MARK: - Logout collection
struct LogoutRequestModel: Codable {
var deviceUUID: String
enum CodingKeys: String, CodingKey {
case deviceUUID = "device_uuid"
}
}
struct LogoutResponseModel: Decodable {
var message: String?
}