iOS/Sources/Shared/API/Webhook/Networking/WebhookResponseHandler.swift
Zac West b80c874917
Add code coverage reporting to tests (#1412)
Adds code coverage reports to pull requests. Enabling code coverage gathering appears to be about a 25% increase in build time, unfortunately, so just enabling it for the App/Shared targets and doing it in a separate scheme so it doesn't impact local build times.
2021-01-24 10:53:43 -08:00

26 lines
709 B
Swift

import Foundation
import PromiseKit
import UserNotifications
public struct WebhookResponseIdentifier: RawRepresentable, Hashable, Codable {
public let rawValue: String
public init(rawValue: String) {
self.rawValue = rawValue
}
}
public struct WebhookResponseHandlerResult {
static var `default`: Self { .init() }
public var notification: UNNotificationRequest?
}
public protocol WebhookResponseHandler {
static func shouldReplace(request current: WebhookRequest, with proposed: WebhookRequest) -> Bool
init(api: HomeAssistantAPI)
func handle(
request: Promise<WebhookRequest>,
result: Promise<Any>
) -> Guarantee<WebhookResponseHandlerResult>
}