@@ -6,6 +6,7 @@ struct AirtableTree: Decodable {
6
6
let species : String
7
7
let notes : String ?
8
8
let coordinates : String ?
9
+ let what3words : String ?
9
10
let imageMd5 : String ?
10
11
let createDate : Date ?
11
12
let uploadDate : Date ?
@@ -18,19 +19,21 @@ struct AirtableTree: Decodable {
18
19
case species = " Species "
19
20
case notes = " Notes "
20
21
case coordinates = " Coordinates "
22
+ case what3words = " What3Words "
21
23
case image = " Image "
22
24
case imageMd5 = " ImageSignature "
23
25
case createDate = " CreatedDate "
24
26
case uploadDate = " UploadedDate "
25
27
case fields
26
28
}
27
29
28
- init ( id: Int , supervisor: String , species: String , notes: String ? , coordinates: String ? , imageUrl: String ? , thumbnailUrl: String ? , imageMd5: String ? , uploadDate: Date ? , createDate: Date ? ) {
30
+ init ( id: Int , supervisor: String , species: String , notes: String ? , coordinates: String ? , what3words : String ? , imageUrl: String ? , thumbnailUrl: String ? , imageMd5: String ? , uploadDate: Date ? , createDate: Date ? ) {
29
31
self . id = id
30
32
self . supervisor = supervisor
31
33
self . species = species
32
34
self . notes = notes
33
35
self . coordinates = coordinates
36
+ self . what3words = what3words
34
37
self . imageUrl = imageUrl
35
38
self . thumbnailUrl = thumbnailUrl
36
39
self . imageMd5 = imageMd5
@@ -47,6 +50,7 @@ struct AirtableTree: Decodable {
47
50
species = try container. decode ( String . self, forKey: . species)
48
51
notes = try container. decodeIfPresent ( String . self, forKey: . notes)
49
52
coordinates = try container. decodeIfPresent ( String . self, forKey: . coordinates)
53
+ what3words = try container. decodeIfPresent ( String . self, forKey: . what3words)
50
54
imageMd5 = try container. decodeIfPresent ( String . self, forKey: . imageMd5)
51
55
uploadDate = try container. decodeIfPresent ( Date . self, forKey: . uploadDate)
52
56
createDate = try container. decodeIfPresent ( Date . self, forKey: . createDate)
@@ -63,7 +67,7 @@ struct AirtableTree: Decodable {
63
67
}
64
68
65
69
func toRemoteTree( ) -> RemoteTree {
66
- return RemoteTree ( id: id, supervisor: supervisor, species: species, notes: notes, coordinates: coordinates, imageUrl: imageUrl, thumbnailUrl: thumbnailUrl, imageMd5: imageMd5, createDate: createDate, uploadDate: uploadDate)
70
+ return RemoteTree ( id: id, supervisor: supervisor, species: species, notes: notes, coordinates: coordinates, what3words : what3words , imageUrl: imageUrl, thumbnailUrl: thumbnailUrl, imageMd5: imageMd5, createDate: createDate, uploadDate: uploadDate)
67
71
}
68
72
}
69
73
@@ -131,6 +135,7 @@ struct AirtableTreeEncodable: Encodable {
131
135
let species : String
132
136
let notes : String ?
133
137
let coordinates : String ?
138
+ let what3words : String ?
134
139
let imageMd5 : String ?
135
140
let createDate : Date ?
136
141
let uploadDate : Date ?
@@ -141,18 +146,20 @@ struct AirtableTreeEncodable: Encodable {
141
146
case species = " Species "
142
147
case notes = " Notes "
143
148
case coordinates = " Coordinates "
149
+ case what3words = " What3Words "
144
150
case image = " Image "
145
151
case imageMd5 = " ImageSignature "
146
152
case createDate = " CreatedDate "
147
153
case uploadDate = " UploadedDate "
148
154
case fields
149
155
}
150
156
151
- init ( supervisor: String , species: String , notes: String ? , coordinates: String ? , imageUrl: String ? , imageMd5: String ? , uploadDate: Date ? , createDate: Date ? ) {
157
+ init ( supervisor: String , species: String , notes: String ? , coordinates: String ? , what3words : String ? , imageUrl: String ? , imageMd5: String ? , uploadDate: Date ? , createDate: Date ? ) {
152
158
self . supervisor = supervisor
153
159
self . species = species
154
160
self . notes = notes
155
161
self . coordinates = coordinates
162
+ self . what3words = what3words
156
163
self . imageUrl = imageUrl
157
164
self . imageMd5 = imageMd5
158
165
self . uploadDate = uploadDate
@@ -167,6 +174,7 @@ struct AirtableTreeEncodable: Encodable {
167
174
try container. encode ( species, forKey: . species)
168
175
try container. encode ( notes, forKey: . notes)
169
176
try container. encode ( coordinates, forKey: . coordinates)
177
+ try container. encode ( what3words, forKey: . what3words)
170
178
try container. encode ( imageMd5, forKey: . imageMd5)
171
179
try container. encode ( imageUrl. map { AirtableImage ( url: $0, thumbnailUrl: nil ) } , forKey: . image)
172
180
try container. encode ( uploadDate, forKey: . uploadDate)
0 commit comments