// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.appservice.outputs;

import com.pulumi.core.annotations.CustomType;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class LinuxWebAppBackupSchedule {
    /**
     * @return How often the backup should be executed (e.g. for weekly backup, this should be set to `7` and `frequency_unit` should be set to `Day`).
     * 
     * &gt; **NOTE:** Not all intervals are supported on all Linux Web App SKUs. Please refer to the official documentation for appropriate values.
     * 
     */
    private Integer frequencyInterval;
    /**
     * @return The unit of time for how often the backup should take place. Possible values include: `Day`, `Hour`
     * 
     */
    private String frequencyUnit;
    /**
     * @return Should the service keep at least one backup, regardless of the age of backup? Defaults to `false`.
     * 
     */
    private @Nullable Boolean keepAtLeastOneBackup;
    private @Nullable String lastExecutionTime;
    /**
     * @return After how many days backups should be deleted. Defaults to `30`.
     * 
     */
    private @Nullable Integer retentionPeriodDays;
    /**
     * @return When the schedule should start working in RFC-3339 format.
     * 
     */
    private @Nullable String startTime;

    private LinuxWebAppBackupSchedule() {}
    /**
     * @return How often the backup should be executed (e.g. for weekly backup, this should be set to `7` and `frequency_unit` should be set to `Day`).
     * 
     * &gt; **NOTE:** Not all intervals are supported on all Linux Web App SKUs. Please refer to the official documentation for appropriate values.
     * 
     */
    public Integer frequencyInterval() {
        return this.frequencyInterval;
    }
    /**
     * @return The unit of time for how often the backup should take place. Possible values include: `Day`, `Hour`
     * 
     */
    public String frequencyUnit() {
        return this.frequencyUnit;
    }
    /**
     * @return Should the service keep at least one backup, regardless of the age of backup? Defaults to `false`.
     * 
     */
    public Optional<Boolean> keepAtLeastOneBackup() {
        return Optional.ofNullable(this.keepAtLeastOneBackup);
    }
    public Optional<String> lastExecutionTime() {
        return Optional.ofNullable(this.lastExecutionTime);
    }
    /**
     * @return After how many days backups should be deleted. Defaults to `30`.
     * 
     */
    public Optional<Integer> retentionPeriodDays() {
        return Optional.ofNullable(this.retentionPeriodDays);
    }
    /**
     * @return When the schedule should start working in RFC-3339 format.
     * 
     */
    public Optional<String> startTime() {
        return Optional.ofNullable(this.startTime);
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(LinuxWebAppBackupSchedule defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private Integer frequencyInterval;
        private String frequencyUnit;
        private @Nullable Boolean keepAtLeastOneBackup;
        private @Nullable String lastExecutionTime;
        private @Nullable Integer retentionPeriodDays;
        private @Nullable String startTime;
        public Builder() {}
        public Builder(LinuxWebAppBackupSchedule defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.frequencyInterval = defaults.frequencyInterval;
    	      this.frequencyUnit = defaults.frequencyUnit;
    	      this.keepAtLeastOneBackup = defaults.keepAtLeastOneBackup;
    	      this.lastExecutionTime = defaults.lastExecutionTime;
    	      this.retentionPeriodDays = defaults.retentionPeriodDays;
    	      this.startTime = defaults.startTime;
        }

        @CustomType.Setter
        public Builder frequencyInterval(Integer frequencyInterval) {
            this.frequencyInterval = Objects.requireNonNull(frequencyInterval);
            return this;
        }
        @CustomType.Setter
        public Builder frequencyUnit(String frequencyUnit) {
            this.frequencyUnit = Objects.requireNonNull(frequencyUnit);
            return this;
        }
        @CustomType.Setter
        public Builder keepAtLeastOneBackup(@Nullable Boolean keepAtLeastOneBackup) {
            this.keepAtLeastOneBackup = keepAtLeastOneBackup;
            return this;
        }
        @CustomType.Setter
        public Builder lastExecutionTime(@Nullable String lastExecutionTime) {
            this.lastExecutionTime = lastExecutionTime;
            return this;
        }
        @CustomType.Setter
        public Builder retentionPeriodDays(@Nullable Integer retentionPeriodDays) {
            this.retentionPeriodDays = retentionPeriodDays;
            return this;
        }
        @CustomType.Setter
        public Builder startTime(@Nullable String startTime) {
            this.startTime = startTime;
            return this;
        }
        public LinuxWebAppBackupSchedule build() {
            final var o = new LinuxWebAppBackupSchedule();
            o.frequencyInterval = frequencyInterval;
            o.frequencyUnit = frequencyUnit;
            o.keepAtLeastOneBackup = keepAtLeastOneBackup;
            o.lastExecutionTime = lastExecutionTime;
            o.retentionPeriodDays = retentionPeriodDays;
            o.startTime = startTime;
            return o;
        }
    }
}
