metatext-app-ios-iphone-ipad/Mastodon/Sources/Mastodon/Entities/PushSubscription.swift

31 lines
875 B
Swift
Raw Normal View History

2020-08-31 01:33:11 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
public struct PushSubscription: Codable {
public struct Alerts: Codable, Hashable {
public var follow: Bool
public var favourite: Bool
public var reblog: Bool
public var mention: Bool
2021-01-29 04:15:06 +01:00
@DecodableDefault.True public var followRequest: Bool
2020-08-31 01:33:11 +02:00
@DecodableDefault.True public var poll: Bool
@DecodableDefault.True public var status: Bool
2020-08-31 01:33:11 +02:00
}
2021-03-29 08:04:14 +02:00
public let endpoint: UnicodeURL
2020-08-31 01:33:11 +02:00
public let alerts: Alerts
public let serverKey: String
}
public extension PushSubscription.Alerts {
static let initial: Self = Self(
follow: true,
favourite: true,
reblog: true,
mention: true,
2021-01-29 04:15:06 +01:00
followRequest: DecodableDefault.True(),
poll: DecodableDefault.True(),
status: DecodableDefault.True())
2020-08-31 01:33:11 +02:00
}