//
// MessageIn.swift
//
// Generated by swagger-codegen
// https://github.com/swagger-api/swagger-codegen
//

import Foundation


/** Message sent to a WebSocket */
public class MessageIn: JSONEncodable {
    /** Message Payload. */
    public var data: [String:AnyObject]?
    /** Confirmation ID. */
    public var cid: String?
    /** Destination Device ID. */
    public var ddid: String?
    /** Source Device ID. */
    public var sdid: String?
    /** Timestamp (past, present or future). Defaults to current time if not provided. */
    public var ts: Int64?
    /** Type. */
    public var type: String?

    public init() {}

    // MARK: JSONEncodable
    func encodeToJSON() -> AnyObject {
        var nillableDictionary = [String:AnyObject?]()
        nillableDictionary["data"] = self.data?.encodeToJSON()
        nillableDictionary["cid"] = self.cid
        nillableDictionary["ddid"] = self.ddid
        nillableDictionary["sdid"] = self.sdid
        nillableDictionary["ts"] = self.ts?.encodeToJSON()
        nillableDictionary["type"] = self.type
        let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:]
        return dictionary
    }
}
