Files
iOS/Sources/Shared/API/WebSocket/SubscribeEvents.swift
Zac West 640cca884b Add SwiftFormat to project (#1463)
Adds new fastlane lanes:
- `fastlane lint` which checks the linters
- `fastlane autocorrect` which applies the linters which can autocorrect (Rubocop, SwiftFormat)

Adds a build step to the Codegen abstract target which runs SwiftFormat in lint mode, pointing out what it's going to change when run.

Applies SwiftFormat to nearly all code -- exempts a few externally-sourced files and generated code.
2021-02-05 22:06:25 -08:00

30 lines
836 B
Swift

import Foundation
class SubscribeEvents: WebSocketMessage {
public var EventType: String = ""
private enum CodingKeys: String, CodingKey {
case EventType = "event_type"
}
init(eventType: String) {
super.init("subscribe_events")
self.EventType = eventType
}
required init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
let superdecoder = try values.superDecoder()
try super.init(from: superdecoder)
EventType = try values.decode(String.self, forKey: .EventType)
}
override public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(EventType, forKey: .EventType)
try super.encode(to: encoder)
}
}