CancelTempPresetIntent.swift 582 B

123456789101112131415161718
  1. import AppIntents
  2. import Foundation
  3. struct CancelTempPresetIntent: AppIntent {
  4. // Title of the action in the Shortcuts app
  5. static var title: LocalizedStringResource = "Cancel a Temporary Target"
  6. // Description of the action in the Shortcuts app
  7. static var description = IntentDescription("Cancel Temporary Target.")
  8. @MainActor func perform() async throws -> some ProvidesDialog {
  9. await TempPresetsIntentRequest().cancelTempTarget()
  10. return .result(
  11. dialog: IntentDialog(stringLiteral: "Temporary Target canceled")
  12. )
  13. }
  14. }