44 lines
1.5 KiB
Swift
44 lines
1.5 KiB
Swift
//
|
|
// ActionCollapseNotificationModel.swift
|
|
// MVMCore
|
|
//
|
|
// Created by Ryan on 3/17/20.
|
|
// Copyright © 2020 myverizon. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
@objcMembers public class ActionCollapseNotificationModel: ActionModelProtocol {
|
|
public static var identifier: String = "collapseNotification"
|
|
|
|
public var actionType: String?
|
|
|
|
public var extraParameters: JSONValueDictionary?
|
|
|
|
public var analyticsData: JSONValueDictionary?
|
|
|
|
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)
|
|
}
|
|
}
|