2 // KenzoDockMapper.swift
5 // Created by Hori,Masaki on 2017/02/25.
6 // Copyright © 2017年 Hori,Masaki. All rights reserved.
11 final class KenzoDockMapper: JSONMapper {
13 let apiResponse: APIResponse
14 let configuration: MappingConfiguration<KenzoDock>
16 required init(_ apiResponse: APIResponse) {
18 self.apiResponse = apiResponse
19 self.configuration = MappingConfiguration(entity: KenzoDock.entity,
20 dataKeys: KenzoDockMapper.dataKeys(apiResponse),
21 editorStore: ServerDataStore.oneTimeEditor())
24 private class func dataKeys(_ apiResponse: APIResponse) -> [String] {
26 switch apiResponse.api.endpoint {
28 case .getShip, .requireInfo: return ["api_data", "api_kdock"]
30 case .kdock: return ["api_data"]
34 Logger.shared.log("Missing API: \(apiResponse.api)")