@@ -6,6 +6,7 @@ struct AirtableTree: Decodable {
66 let species : String
77 let notes : String ?
88 let coordinates : String ?
9+ let what3words : String ?
910 let imageMd5 : String ?
1011 let createDate : Date ?
1112 let uploadDate : Date ?
@@ -18,19 +19,21 @@ struct AirtableTree: Decodable {
1819 case species = " Species "
1920 case notes = " Notes "
2021 case coordinates = " Coordinates "
22+ case what3words = " What3Words "
2123 case image = " Image "
2224 case imageMd5 = " ImageSignature "
2325 case createDate = " CreatedDate "
2426 case uploadDate = " UploadedDate "
2527 case fields
2628 }
2729
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 ? ) {
2931 self . id = id
3032 self . supervisor = supervisor
3133 self . species = species
3234 self . notes = notes
3335 self . coordinates = coordinates
36+ self . what3words = what3words
3437 self . imageUrl = imageUrl
3538 self . thumbnailUrl = thumbnailUrl
3639 self . imageMd5 = imageMd5
@@ -47,6 +50,7 @@ struct AirtableTree: Decodable {
4750 species = try container. decode ( String . self, forKey: . species)
4851 notes = try container. decodeIfPresent ( String . self, forKey: . notes)
4952 coordinates = try container. decodeIfPresent ( String . self, forKey: . coordinates)
53+ what3words = try container. decodeIfPresent ( String . self, forKey: . what3words)
5054 imageMd5 = try container. decodeIfPresent ( String . self, forKey: . imageMd5)
5155 uploadDate = try container. decodeIfPresent ( Date . self, forKey: . uploadDate)
5256 createDate = try container. decodeIfPresent ( Date . self, forKey: . createDate)
@@ -63,7 +67,7 @@ struct AirtableTree: Decodable {
6367 }
6468
6569 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)
6771 }
6872}
6973
@@ -131,6 +135,7 @@ struct AirtableTreeEncodable: Encodable {
131135 let species : String
132136 let notes : String ?
133137 let coordinates : String ?
138+ let what3words : String ?
134139 let imageMd5 : String ?
135140 let createDate : Date ?
136141 let uploadDate : Date ?
@@ -141,18 +146,20 @@ struct AirtableTreeEncodable: Encodable {
141146 case species = " Species "
142147 case notes = " Notes "
143148 case coordinates = " Coordinates "
149+ case what3words = " What3Words "
144150 case image = " Image "
145151 case imageMd5 = " ImageSignature "
146152 case createDate = " CreatedDate "
147153 case uploadDate = " UploadedDate "
148154 case fields
149155 }
150156
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 ? ) {
152158 self . supervisor = supervisor
153159 self . species = species
154160 self . notes = notes
155161 self . coordinates = coordinates
162+ self . what3words = what3words
156163 self . imageUrl = imageUrl
157164 self . imageMd5 = imageMd5
158165 self . uploadDate = uploadDate
@@ -167,6 +174,7 @@ struct AirtableTreeEncodable: Encodable {
167174 try container. encode ( species, forKey: . species)
168175 try container. encode ( notes, forKey: . notes)
169176 try container. encode ( coordinates, forKey: . coordinates)
177+ try container. encode ( what3words, forKey: . what3words)
170178 try container. encode ( imageMd5, forKey: . imageMd5)
171179 try container. encode ( imageUrl. map { AirtableImage ( url: $0, thumbnailUrl: nil ) } , forKey: . image)
172180 try container. encode ( uploadDate, forKey: . uploadDate)
0 commit comments