java.lang.Object
com.azure.resourcemanager.machinelearning.models.TriggerBase
com.azure.resourcemanager.machinelearning.models.CronTrigger
All Implemented Interfaces:
com.azure.json.JsonSerializable<TriggerBase>

public final class CronTrigger extends TriggerBase
The CronTrigger model.
  • Constructor Details

    • CronTrigger

      public CronTrigger()
      Creates an instance of CronTrigger class.
  • Method Details

    • triggerType

      public TriggerType triggerType()
      Get the triggerType property: [Required].
      Overrides:
      triggerType in class TriggerBase
      Returns:
      the triggerType value.
    • expression

      public String expression()
      Get the expression property: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format.
      Returns:
      the expression value.
    • withExpression

      public CronTrigger withExpression(String expression)
      Set the expression property: [Required] Specifies cron expression of schedule. The expression should follow NCronTab format.
      Parameters:
      expression - the expression value to set.
      Returns:
      the CronTrigger object itself.
    • withEndTime

      public CronTrigger withEndTime(String endTime)
      Set the endTime property: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer https://en.wikipedia.org/wiki/ISO_8601. Recommented format would be "2022-06-01T00:00:01" If not present, the schedule will run indefinitely.
      Overrides:
      withEndTime in class TriggerBase
      Parameters:
      endTime - the endTime value to set.
      Returns:
      the TriggerBase object itself.
    • withStartTime

      public CronTrigger withStartTime(String startTime)
      Set the startTime property: Specifies start time of schedule in ISO 8601 format, but without a UTC offset.
      Overrides:
      withStartTime in class TriggerBase
      Parameters:
      startTime - the startTime value to set.
      Returns:
      the TriggerBase object itself.
    • withTimeZone

      public CronTrigger withTimeZone(String timeZone)
      Set the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11.
      Overrides:
      withTimeZone in class TriggerBase
      Parameters:
      timeZone - the timeZone value to set.
      Returns:
      the TriggerBase object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class TriggerBase
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<TriggerBase>
      Overrides:
      toJson in class TriggerBase
      Throws:
      IOException
    • fromJson

      public static CronTrigger fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of CronTrigger from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of CronTrigger if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the CronTrigger.