com.pulumi.azure.backup.outputs.PolicyVMRetentionYearly Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** 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.backup.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class PolicyVMRetentionYearly {
/**
* @return The number of yearly backups to keep. Must be between `1` and `9999`
*
*/
private Integer count;
/**
* @return The days of the month to retain backups of. Must be between `1` and `31`.
*
*/
private @Nullable List days;
/**
* @return Including the last day of the month, default to `false`.
*
* > **NOTE:**: Either `weekdays` and `weeks` or `days` and `include_last_days` must be specified.
*
*/
private @Nullable Boolean includeLastDays;
/**
* @return The months of the year to retain backups of. Must be one of `January`, `February`, `March`, `April`, `May`, `June`, `July`, `August`, `September`, `October`, `November` and `December`.
*
*/
private List months;
/**
* @return The weekday backups to retain . Must be one of `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday` or `Saturday`.
*
*/
private @Nullable List weekdays;
/**
* @return The weeks of the month to retain backups of. Must be one of `First`, `Second`, `Third`, `Fourth`, `Last`.
*
*/
private @Nullable List weeks;
private PolicyVMRetentionYearly() {}
/**
* @return The number of yearly backups to keep. Must be between `1` and `9999`
*
*/
public Integer count() {
return this.count;
}
/**
* @return The days of the month to retain backups of. Must be between `1` and `31`.
*
*/
public List days() {
return this.days == null ? List.of() : this.days;
}
/**
* @return Including the last day of the month, default to `false`.
*
* > **NOTE:**: Either `weekdays` and `weeks` or `days` and `include_last_days` must be specified.
*
*/
public Optional includeLastDays() {
return Optional.ofNullable(this.includeLastDays);
}
/**
* @return The months of the year to retain backups of. Must be one of `January`, `February`, `March`, `April`, `May`, `June`, `July`, `August`, `September`, `October`, `November` and `December`.
*
*/
public List months() {
return this.months;
}
/**
* @return The weekday backups to retain . Must be one of `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday` or `Saturday`.
*
*/
public List weekdays() {
return this.weekdays == null ? List.of() : this.weekdays;
}
/**
* @return The weeks of the month to retain backups of. Must be one of `First`, `Second`, `Third`, `Fourth`, `Last`.
*
*/
public List weeks() {
return this.weeks == null ? List.of() : this.weeks;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(PolicyVMRetentionYearly defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private Integer count;
private @Nullable List days;
private @Nullable Boolean includeLastDays;
private List months;
private @Nullable List weekdays;
private @Nullable List weeks;
public Builder() {}
public Builder(PolicyVMRetentionYearly defaults) {
Objects.requireNonNull(defaults);
this.count = defaults.count;
this.days = defaults.days;
this.includeLastDays = defaults.includeLastDays;
this.months = defaults.months;
this.weekdays = defaults.weekdays;
this.weeks = defaults.weeks;
}
@CustomType.Setter
public Builder count(Integer count) {
if (count == null) {
throw new MissingRequiredPropertyException("PolicyVMRetentionYearly", "count");
}
this.count = count;
return this;
}
@CustomType.Setter
public Builder days(@Nullable List days) {
this.days = days;
return this;
}
public Builder days(Integer... days) {
return days(List.of(days));
}
@CustomType.Setter
public Builder includeLastDays(@Nullable Boolean includeLastDays) {
this.includeLastDays = includeLastDays;
return this;
}
@CustomType.Setter
public Builder months(List months) {
if (months == null) {
throw new MissingRequiredPropertyException("PolicyVMRetentionYearly", "months");
}
this.months = months;
return this;
}
public Builder months(String... months) {
return months(List.of(months));
}
@CustomType.Setter
public Builder weekdays(@Nullable List weekdays) {
this.weekdays = weekdays;
return this;
}
public Builder weekdays(String... weekdays) {
return weekdays(List.of(weekdays));
}
@CustomType.Setter
public Builder weeks(@Nullable List weeks) {
this.weeks = weeks;
return this;
}
public Builder weeks(String... weeks) {
return weeks(List.of(weeks));
}
public PolicyVMRetentionYearly build() {
final var _resultValue = new PolicyVMRetentionYearly();
_resultValue.count = count;
_resultValue.days = days;
_resultValue.includeLastDays = includeLastDays;
_resultValue.months = months;
_resultValue.weekdays = weekdays;
_resultValue.weeks = weeks;
return _resultValue;
}
}
}