remove encode, decode method since actionType already handled by default encode behavior
This commit is contained in:
parent
a2c73d9d7d
commit
5b97fbfac0
@ -18,26 +18,4 @@ import UIKit
|
|||||||
public var analyticsData: JSONValueDictionary?
|
public var analyticsData: JSONValueDictionary?
|
||||||
|
|
||||||
public var title: String?
|
public var title: String?
|
||||||
|
|
||||||
public enum CodingKeys: String, CodingKey {
|
|
||||||
case actionType
|
|
||||||
case title
|
|
||||||
case extraParameters
|
|
||||||
case analyticsData
|
|
||||||
}
|
|
||||||
|
|
||||||
public required init(from decoder: Decoder) throws {
|
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
|
||||||
title = try typeContainer.decodeIfPresent(String.self, forKey: .title)
|
|
||||||
extraParameters = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .extraParameters)
|
|
||||||
analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
|
||||||
var encoderContainer = encoder.container(keyedBy: CodingKeys.self)
|
|
||||||
try encoderContainer.encodeIfPresent(actionType, forKey: .actionType)
|
|
||||||
try encoderContainer.encodeIfPresent(title, forKey: .title)
|
|
||||||
try encoderContainer.encodeIfPresent(extraParameters, forKey: .extraParameters)
|
|
||||||
try encoderContainer.encodeIfPresent(analyticsData, forKey: .analyticsData)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,31 +21,4 @@ import Foundation
|
|||||||
public init(pageType: String) {
|
public init(pageType: String) {
|
||||||
self.pageType = pageType
|
self.pageType = pageType
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CodingKeys: String, CodingKey {
|
|
||||||
case actionType
|
|
||||||
case pageType
|
|
||||||
case title
|
|
||||||
case extraParameters
|
|
||||||
case analyticsData
|
|
||||||
}
|
|
||||||
|
|
||||||
public required init(from decoder: Decoder) throws {
|
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
|
||||||
pageType = try typeContainer.decode(String.self, forKey: .pageType)
|
|
||||||
title = try typeContainer.decodeIfPresent(String.self, forKey: .title)
|
|
||||||
extraParameters = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .extraParameters)
|
|
||||||
analyticsData = try typeContainer.decodeIfPresent(JSONValueDictionary.self, forKey: .analyticsData)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
|
||||||
var encoderContainer = encoder.container(keyedBy: CodingKeys.self)
|
|
||||||
try encoderContainer.encodeIfPresent(actionType, forKey: .actionType)
|
|
||||||
try encoderContainer.encode(pageType, forKey: .pageType)
|
|
||||||
try encoderContainer.encodeIfPresent(title, forKey: .title)
|
|
||||||
try encoderContainer.encodeIfPresent(extraParameters, forKey: .extraParameters)
|
|
||||||
try encoderContainer.encodeIfPresent(analyticsData, forKey: .analyticsData)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user