# AutomationManager

    @MainActor
    protocol AutomationManager : Sendable

A protocol for handling `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html` objects. This protocol will support the various
CRUD operations that can be performed on an automation including lifecycle and management.
- `


  ### [createAutomation(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/AutomationManager#/s:13GoogleHomeSDK17AutomationManagerP06createD0yAA0D0_pAA04BaseD0_pYaKF)


  ` Executes a create automation command, expecting a result.

  #### Declaration

  Swift

      @MainActor
      func createAutomation(_ automation: any https://developers.home.google.com/reference/swift/GoogleHomeSDK/GoogleHomeSDK.html#/s:13GoogleHomeSDK15DraftAutomationa) async throws -> any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html

  #### Parameters

  |---|---|
  | ` automation ` | The `https://developers.home.google.com/reference/swift/GoogleHomeSDK/GoogleHomeSDK.html#/s:13GoogleHomeSDK15DraftAutomationa` object. |

  #### Return Value

  An `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html` object.
- `


  ### [deleteAutomation(id:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/AutomationManager#/s:13GoogleHomeSDK17AutomationManagerP06deleteD02idySS_tYaKF)


  ` Delete an automation instance by its ID.

  #### Declaration

  Swift

      @MainActor
      func deleteAutomation(id: String) async throws

- `


  ### [deleteAutomation(_:)](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/AutomationManager#/s:13GoogleHomeSDK17AutomationManagerP06deleteD0yyAA0D0_pYaKF)


  ` Delete an automation object.

  #### Declaration

  Swift

      @MainActor
      func deleteAutomation(_ automation: any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html) async throws

  #### Parameters

  |---|---|
  | ` automation ` | The `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html` object to be deleted. |

- `


  ### [listAutomations()](https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/AutomationManager#/s:13GoogleHomeSDK17AutomationManagerP15listAutomationsSayAA0D0_pGyYaKF)


  ` List automation instances by id.

  #### Declaration

  Swift

      @MainActor
      func listAutomations() async throws -> [any https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html]

  #### Return Value

  If success, an array of `https://developers.home.google.com/reference/swift/GoogleHomeSDK/Protocols/Automation.html` objects, else an empty array.