Class BackupSchedule

java.lang.Object
com.azure.resourcemanager.appservice.models.BackupSchedule
All Implemented Interfaces:
com.azure.json.JsonSerializable<BackupSchedule>

public final class BackupSchedule extends Object implements com.azure.json.JsonSerializable<BackupSchedule>
Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of BackupSchedule class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the frequencyInterval property: How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day).
    Get the frequencyUnit property: The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7).
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of BackupSchedule from the JsonReader.
    boolean
    Get the keepAtLeastOneBackup property: True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise.
    Get the lastExecutionTime property: Last time when this schedule was triggered.
    int
    Get the retentionPeriodInDays property: After how many days backups should be deleted.
    Get the startTime property: When the schedule should start working.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withFrequencyInterval(int frequencyInterval)
    Set the frequencyInterval property: How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day).
    Set the frequencyUnit property: The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7).
    withKeepAtLeastOneBackup(boolean keepAtLeastOneBackup)
    Set the keepAtLeastOneBackup property: True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise.
    withRetentionPeriodInDays(int retentionPeriodInDays)
    Set the retentionPeriodInDays property: After how many days backups should be deleted.
    Set the startTime property: When the schedule should start working.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • BackupSchedule

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

    • frequencyInterval

      public int frequencyInterval()
      Get the frequencyInterval property: How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day).
      Returns:
      the frequencyInterval value.
    • withFrequencyInterval

      public BackupSchedule withFrequencyInterval(int frequencyInterval)
      Set the frequencyInterval property: How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day).
      Parameters:
      frequencyInterval - the frequencyInterval value to set.
      Returns:
      the BackupSchedule object itself.
    • frequencyUnit

      public FrequencyUnit frequencyUnit()
      Get the frequencyUnit property: The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7).
      Returns:
      the frequencyUnit value.
    • withFrequencyUnit

      public BackupSchedule withFrequencyUnit(FrequencyUnit frequencyUnit)
      Set the frequencyUnit property: The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7).
      Parameters:
      frequencyUnit - the frequencyUnit value to set.
      Returns:
      the BackupSchedule object itself.
    • keepAtLeastOneBackup

      public boolean keepAtLeastOneBackup()
      Get the keepAtLeastOneBackup property: True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise.
      Returns:
      the keepAtLeastOneBackup value.
    • withKeepAtLeastOneBackup

      public BackupSchedule withKeepAtLeastOneBackup(boolean keepAtLeastOneBackup)
      Set the keepAtLeastOneBackup property: True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise.
      Parameters:
      keepAtLeastOneBackup - the keepAtLeastOneBackup value to set.
      Returns:
      the BackupSchedule object itself.
    • retentionPeriodInDays

      public int retentionPeriodInDays()
      Get the retentionPeriodInDays property: After how many days backups should be deleted.
      Returns:
      the retentionPeriodInDays value.
    • withRetentionPeriodInDays

      public BackupSchedule withRetentionPeriodInDays(int retentionPeriodInDays)
      Set the retentionPeriodInDays property: After how many days backups should be deleted.
      Parameters:
      retentionPeriodInDays - the retentionPeriodInDays value to set.
      Returns:
      the BackupSchedule object itself.
    • startTime

      public OffsetDateTime startTime()
      Get the startTime property: When the schedule should start working.
      Returns:
      the startTime value.
    • withStartTime

      public BackupSchedule withStartTime(OffsetDateTime startTime)
      Set the startTime property: When the schedule should start working.
      Parameters:
      startTime - the startTime value to set.
      Returns:
      the BackupSchedule object itself.
    • lastExecutionTime

      public OffsetDateTime lastExecutionTime()
      Get the lastExecutionTime property: Last time when this schedule was triggered.
      Returns:
      the lastExecutionTime value.
    • validate

      public void validate()
      Validates the instance.
      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<BackupSchedule>
      Throws:
      IOException
    • fromJson

      public static BackupSchedule fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of BackupSchedule from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of BackupSchedule 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 BackupSchedule.