UAAutomation

@interface UAAutomation : UAComponent

Manager class for scheduling actions.

  • Schedules actions.

    Declaration

    Objective-C

    - (void)scheduleActions:(nonnull UAActionScheduleInfo *)scheduleInfo
          completionHandler:
              (nullable void (^)(UASchedule *_Nullable))completionHandler;

    Swift

    func scheduleActions(_ scheduleInfo: UAActionScheduleInfo, completionHandler: ((UASchedule?) -> Void)? = nil)

    Parameters

    scheduleInfo

    The schedule information.

    completionHandler

    The completion handler when the action is scheduled. If the schedule info is invalid, the action schedule will be nil.

  • Schedules actions with metadata.

    Declaration

    Objective-C

    - (void)scheduleActions:(nonnull UAActionScheduleInfo *)scheduleInfo
                   metadata:(nonnull NSDictionary *)metadata
          completionHandler:
              (nullable void (^)(UASchedule *_Nullable))completionHandler;

    Swift

    func scheduleActions(_ scheduleInfo: UAActionScheduleInfo, metadata: [AnyHashable : Any], completionHandler: ((UASchedule?) -> Void)? = nil)

    Parameters

    scheduleInfo

    The schedule information.

    metadata

    The schedule’s metadata.

    completionHandler

    The completion handler when the action is scheduled. If the schedule info is invalid, the action schedule will be nil.

  • Cancels a schedule with the given identifier.

    Declaration

    Objective-C

    - (void)cancelScheduleWithID:(nonnull NSString *)identifier;

    Swift

    func cancelSchedule(withID identifier: String)

    Parameters

    identifier

    A schedule identifier.

  • Cancels all schedules of the given group.

    Declaration

    Objective-C

    - (void)cancelSchedulesWithGroup:(nonnull NSString *)group;

    Swift

    func cancelSchedules(withGroup group: String)

    Parameters

    group

    A schedule group.

  • Cancels all schedules.

    Declaration

    Objective-C

    - (void)cancelAll;

    Swift

    func cancelAll()
  • Gets the schedule with the given identifier.

    Declaration

    Objective-C

    - (void)getScheduleWithID:(nonnull NSString *)identifier
            completionHandler:
                (nonnull void (^)(UASchedule *_Nullable))completionHandler;

    Swift

    func getScheduleWithID(_ identifier: String, completionHandler: @escaping (UASchedule?) -> Void)

    Parameters

    identifier

    A schedule identifier.

    completionHandler

    The completion handler with the result.

  • Gets all schedules.

    Declaration

    Objective-C

    - (void)getSchedules:
        (nonnull void (^)(NSArray<UASchedule *> *_Nonnull))completionHandler;

    Swift

    func getSchedules(_ completionHandler: @escaping ([UASchedule]) -> Void)

    Parameters

    completionHandler

    The completion handler with the result.

  • Gets all schedules of the given group.

    Declaration

    Objective-C

    - (void)getSchedulesWithGroup:(nonnull NSString *)group
                completionHandler:
                    (nonnull void (^)(NSArray<UASchedule *> *_Nonnull))
                        completionHandler;

    Swift

    func getSchedulesWithGroup(_ group: String, completionHandler: @escaping ([UASchedule]) -> Void)

    Parameters

    group

    The schedule group.

    completionHandler

    The completion handler with the result.

  • Edits a schedule.

    Declaration

    Objective-C

    - (void)editScheduleWithID:(nonnull NSString *)identifier
                         edits:(nonnull UAActionScheduleEdits *)edits
             completionHandler:
                 (nonnull void (^)(UASchedule *_Nullable))completionHandler;

    Swift

    func editSchedule(withID identifier: String, edits: UAActionScheduleEdits, completionHandler: @escaping (UASchedule?) -> Void)

    Parameters

    identifier

    A schedule identifier.

    edits

    The edits to apply.

    completionHandler

    The completion handler with the result.