FormCreateResponse.swift 1.54 KB
Newer Older
Grigor Aghabalyan's avatar
Grigor Aghabalyan committed
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
//
//  FormCreateResponse.swift
//  App16
//
//  Created by Grigor Aghabalyan on 3/25/20.
//  Copyright © 2020 X-TECH. All rights reserved.
//

import ObjectMapper

class FormCreateResponse: Mappable {
    
    var deviceToken: String?
    var firstName: String?
    var lastName: String?
    var middleName: String?
    var outAddress: String?
    var outLatitude: Double?
    var outLongitude: Double?
    var outDatetime: String?
    var visitingAddressAndName: String?
    var visitingLatitude: Double?
    var visitingLongitude: Double?
    var visitingReason: String?
    var plannedReturnDatetime: String?
Grigor Aghabalyan's avatar
Grigor Aghabalyan committed
26
27
    var createdAt: String?
    
Grigor Aghabalyan's avatar
Grigor Aghabalyan committed
28
29
30
31
32
    required init?(map: Map) { }
    init() { }
    
    func mapping(map: Map) {
        
Grigor Aghabalyan's avatar
Grigor Aghabalyan committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
        deviceToken <- map["device_token"]
        firstName <- map["first_name"]
        lastName <- map["last_name"]
        middleName <- map["middle_name"]
        outAddress <- map["out_address"]
        outLatitude <- map["out_latitude"]
        outLongitude <- map["out_longitude"]
        outDatetime <- map["out_datetime"]
        visitingAddressAndName <- map["visiting_address_and_name"]
        visitingLatitude <- map["visiting_latitude"]
        visitingLongitude <- map["visiting_longitude"]
        visitingReason <- map["visiting_reason"]
        plannedReturnDatetime <- map["planned_return_datetime"]
        createdAt <- map["created_at"]
Grigor Aghabalyan's avatar
Grigor Aghabalyan committed
47
48
49
50
51
52
53
54
55
56
    }
}

enum FormCreateResponseData<FormCreateResponse> {
    
    case success(result: FormCreateResponse)
    case base(response: BaseResponse)
    case conflict
    case isOffline
}