ListTempPresetsIntent.swift 760 B

1234567891011121314151617181920212223242526
  1. import AppIntents
  2. import Foundation
  3. @available(iOS 16.0, *) struct ListTempPresetsIntent: AppIntent {
  4. // Title of the action in the Shortcuts app
  5. static var title: LocalizedStringResource = "Choose Temporary Presets"
  6. // Description of the action in the Shortcuts app
  7. static var description = IntentDescription(
  8. "Allow to list and choose a specific temporary Preset.",
  9. categoryName: "Navigation"
  10. )
  11. @Parameter(title: "Preset") var preset: TempPreset?
  12. static var parameterSummary: some ParameterSummary {
  13. Summary("Choose the Temp Target preset \(\.$preset)")
  14. }
  15. @MainActor func perform() async throws -> some ReturnsValue<TempPreset> {
  16. .result(
  17. value: preset!
  18. )
  19. }
  20. }