Gemini/GeminiIntents/GetStatusIntentHandler.swift
2021-10-09 10:17:49 -04:00

23 lines
644 B
Swift

//
// GetStatusIntentHandler.swift
// GeminiIntents
//
// Created by Shadowfacts on 10/1/21.
//
import Intents
class GetStatusIntentHandler: NSObject, GetStatusIntentHandling {
func handle(intent: GetStatusIntent, completion: @escaping (GetStatusIntentResponse) -> Void) {
guard let response = intent.response else {
completion(GetStatusIntentResponse(code: .failure, userActivity: nil))
return
}
let intentResp = GetStatusIntentResponse(code: .success, userActivity: nil)
intentResp.status = response.status.rawValue as NSNumber
completion(intentResp)
}
}