// *** 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.redis.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 CacheRedisConfiguration {
    /**
     * @return Enable or disable AOF persistence for this Redis Cache. Defaults to `false`.
     * 
     */
    private @Nullable Boolean aofBackupEnabled;
    /**
     * @return First Storage Account connection string for AOF persistence.
     * 
     */
    private @Nullable String aofStorageConnectionString0;
    /**
     * @return Second Storage Account connection string for AOF persistence.
     * 
     * Example usage:
     * ```java
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     * 
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     * 
     *     public static void stack(Context ctx) {
     *     }
     * }
     * ```
     * 
     */
    private @Nullable String aofStorageConnectionString1;
    /**
     * @return If set to `false`, the Redis instance will be accessible without authentication. Defaults to `true`.
     * 
     * &gt; **NOTE:** `enable_authentication` can only be set to `false` if a `subnet_id` is specified; and only works if there aren&#39;t existing instances within the subnet with `enable_authentication` set to `true`.
     * 
     */
    private @Nullable Boolean enableAuthentication;
    /**
     * @return Returns the max number of connected clients at the same time.
     * 
     */
    private @Nullable Integer maxclients;
    /**
     * @return Value in megabytes reserved to accommodate for memory fragmentation. Defaults are shown below.
     * 
     */
    private @Nullable Integer maxfragmentationmemoryReserved;
    /**
     * @return The max-memory delta for this Redis instance. Defaults are shown below.
     * 
     */
    private @Nullable Integer maxmemoryDelta;
    /**
     * @return How Redis will select what to remove when `maxmemory` is reached. Defaults are shown below. Defaults to `volatile-lru`.
     * 
     */
    private @Nullable String maxmemoryPolicy;
    /**
     * @return Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below.
     * 
     */
    private @Nullable Integer maxmemoryReserved;
    /**
     * @return Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration)
     * ```java
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     * 
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     * 
     *     public static void stack(Context ctx) {
     *     }
     * }
     * ```
     * 
     */
    private @Nullable String notifyKeyspaceEvents;
    /**
     * @return Is Backup Enabled? Only supported on Premium SKUs. Defaults to `false`.
     * 
     * &gt; **NOTE:** If `rdb_backup_enabled` set to `true`, `rdb_storage_connection_string` must also be set.
     * 
     */
    private @Nullable Boolean rdbBackupEnabled;
    /**
     * @return The Backup Frequency in Minutes. Only supported on Premium SKUs. Possible values are: `15`, `30`, `60`, `360`, `720` and `1440`.
     * 
     */
    private @Nullable Integer rdbBackupFrequency;
    /**
     * @return The maximum number of snapshots to create as a backup. Only supported for Premium SKUs.
     * 
     */
    private @Nullable Integer rdbBackupMaxSnapshotCount;
    /**
     * @return The Connection String to the Storage Account. Only supported for Premium SKUs. In the format: `DefaultEndpointsProtocol=https;BlobEndpoint=${azurerm_storage_account.example.primary_blob_endpoint};AccountName=${azurerm_storage_account.example.name};AccountKey=${azurerm_storage_account.example.primary_access_key}`.
     * 
     * &gt; **NOTE:** There&#39;s a bug in the Redis API where the original storage connection string isn&#39;t being returned, which [is being tracked in this issue](https://github.com/Azure/azure-rest-api-specs/issues/3037). In the interim you can use [the `ignoreChanges` attribute to ignore changes to this field](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) e.g.:
     * 
     * ```java
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.redis.Cache;
     * import com.pulumi.azure.redis.CacheArgs;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     * 
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     * 
     *     public static void stack(Context ctx) {
     *         var example = new Cache(&#34;example&#34;, CacheArgs.builder()        
     *             .ignoreChanges(redis_configuration[0].rdb_storage_connection_string())
     *             .build());
     * 
     *     }
     * }
     * ```
     * 
     */
    private @Nullable String rdbStorageConnectionString;

    private CacheRedisConfiguration() {}
    /**
     * @return Enable or disable AOF persistence for this Redis Cache. Defaults to `false`.
     * 
     */
    public Optional<Boolean> aofBackupEnabled() {
        return Optional.ofNullable(this.aofBackupEnabled);
    }
    /**
     * @return First Storage Account connection string for AOF persistence.
     * 
     */
    public Optional<String> aofStorageConnectionString0() {
        return Optional.ofNullable(this.aofStorageConnectionString0);
    }
    /**
     * @return Second Storage Account connection string for AOF persistence.
     * 
     * Example usage:
     * ```java
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     * 
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     * 
     *     public static void stack(Context ctx) {
     *     }
     * }
     * ```
     * 
     */
    public Optional<String> aofStorageConnectionString1() {
        return Optional.ofNullable(this.aofStorageConnectionString1);
    }
    /**
     * @return If set to `false`, the Redis instance will be accessible without authentication. Defaults to `true`.
     * 
     * &gt; **NOTE:** `enable_authentication` can only be set to `false` if a `subnet_id` is specified; and only works if there aren&#39;t existing instances within the subnet with `enable_authentication` set to `true`.
     * 
     */
    public Optional<Boolean> enableAuthentication() {
        return Optional.ofNullable(this.enableAuthentication);
    }
    /**
     * @return Returns the max number of connected clients at the same time.
     * 
     */
    public Optional<Integer> maxclients() {
        return Optional.ofNullable(this.maxclients);
    }
    /**
     * @return Value in megabytes reserved to accommodate for memory fragmentation. Defaults are shown below.
     * 
     */
    public Optional<Integer> maxfragmentationmemoryReserved() {
        return Optional.ofNullable(this.maxfragmentationmemoryReserved);
    }
    /**
     * @return The max-memory delta for this Redis instance. Defaults are shown below.
     * 
     */
    public Optional<Integer> maxmemoryDelta() {
        return Optional.ofNullable(this.maxmemoryDelta);
    }
    /**
     * @return How Redis will select what to remove when `maxmemory` is reached. Defaults are shown below. Defaults to `volatile-lru`.
     * 
     */
    public Optional<String> maxmemoryPolicy() {
        return Optional.ofNullable(this.maxmemoryPolicy);
    }
    /**
     * @return Value in megabytes reserved for non-cache usage e.g. failover. Defaults are shown below.
     * 
     */
    public Optional<Integer> maxmemoryReserved() {
        return Optional.ofNullable(this.maxmemoryReserved);
    }
    /**
     * @return Keyspace notifications allows clients to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way. [Reference](https://redis.io/topics/notifications#configuration)
     * ```java
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     * 
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     * 
     *     public static void stack(Context ctx) {
     *     }
     * }
     * ```
     * 
     */
    public Optional<String> notifyKeyspaceEvents() {
        return Optional.ofNullable(this.notifyKeyspaceEvents);
    }
    /**
     * @return Is Backup Enabled? Only supported on Premium SKUs. Defaults to `false`.
     * 
     * &gt; **NOTE:** If `rdb_backup_enabled` set to `true`, `rdb_storage_connection_string` must also be set.
     * 
     */
    public Optional<Boolean> rdbBackupEnabled() {
        return Optional.ofNullable(this.rdbBackupEnabled);
    }
    /**
     * @return The Backup Frequency in Minutes. Only supported on Premium SKUs. Possible values are: `15`, `30`, `60`, `360`, `720` and `1440`.
     * 
     */
    public Optional<Integer> rdbBackupFrequency() {
        return Optional.ofNullable(this.rdbBackupFrequency);
    }
    /**
     * @return The maximum number of snapshots to create as a backup. Only supported for Premium SKUs.
     * 
     */
    public Optional<Integer> rdbBackupMaxSnapshotCount() {
        return Optional.ofNullable(this.rdbBackupMaxSnapshotCount);
    }
    /**
     * @return The Connection String to the Storage Account. Only supported for Premium SKUs. In the format: `DefaultEndpointsProtocol=https;BlobEndpoint=${azurerm_storage_account.example.primary_blob_endpoint};AccountName=${azurerm_storage_account.example.name};AccountKey=${azurerm_storage_account.example.primary_access_key}`.
     * 
     * &gt; **NOTE:** There&#39;s a bug in the Redis API where the original storage connection string isn&#39;t being returned, which [is being tracked in this issue](https://github.com/Azure/azure-rest-api-specs/issues/3037). In the interim you can use [the `ignoreChanges` attribute to ignore changes to this field](https://www.pulumi.com/docs/intro/concepts/programming-model/#ignorechanges) e.g.:
     * 
     * ```java
     * package generated_program;
     * 
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.redis.Cache;
     * import com.pulumi.azure.redis.CacheArgs;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     * 
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     * 
     *     public static void stack(Context ctx) {
     *         var example = new Cache(&#34;example&#34;, CacheArgs.builder()        
     *             .ignoreChanges(redis_configuration[0].rdb_storage_connection_string())
     *             .build());
     * 
     *     }
     * }
     * ```
     * 
     */
    public Optional<String> rdbStorageConnectionString() {
        return Optional.ofNullable(this.rdbStorageConnectionString);
    }

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

    public static Builder builder(CacheRedisConfiguration defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Boolean aofBackupEnabled;
        private @Nullable String aofStorageConnectionString0;
        private @Nullable String aofStorageConnectionString1;
        private @Nullable Boolean enableAuthentication;
        private @Nullable Integer maxclients;
        private @Nullable Integer maxfragmentationmemoryReserved;
        private @Nullable Integer maxmemoryDelta;
        private @Nullable String maxmemoryPolicy;
        private @Nullable Integer maxmemoryReserved;
        private @Nullable String notifyKeyspaceEvents;
        private @Nullable Boolean rdbBackupEnabled;
        private @Nullable Integer rdbBackupFrequency;
        private @Nullable Integer rdbBackupMaxSnapshotCount;
        private @Nullable String rdbStorageConnectionString;
        public Builder() {}
        public Builder(CacheRedisConfiguration defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.aofBackupEnabled = defaults.aofBackupEnabled;
    	      this.aofStorageConnectionString0 = defaults.aofStorageConnectionString0;
    	      this.aofStorageConnectionString1 = defaults.aofStorageConnectionString1;
    	      this.enableAuthentication = defaults.enableAuthentication;
    	      this.maxclients = defaults.maxclients;
    	      this.maxfragmentationmemoryReserved = defaults.maxfragmentationmemoryReserved;
    	      this.maxmemoryDelta = defaults.maxmemoryDelta;
    	      this.maxmemoryPolicy = defaults.maxmemoryPolicy;
    	      this.maxmemoryReserved = defaults.maxmemoryReserved;
    	      this.notifyKeyspaceEvents = defaults.notifyKeyspaceEvents;
    	      this.rdbBackupEnabled = defaults.rdbBackupEnabled;
    	      this.rdbBackupFrequency = defaults.rdbBackupFrequency;
    	      this.rdbBackupMaxSnapshotCount = defaults.rdbBackupMaxSnapshotCount;
    	      this.rdbStorageConnectionString = defaults.rdbStorageConnectionString;
        }

        @CustomType.Setter
        public Builder aofBackupEnabled(@Nullable Boolean aofBackupEnabled) {
            this.aofBackupEnabled = aofBackupEnabled;
            return this;
        }
        @CustomType.Setter
        public Builder aofStorageConnectionString0(@Nullable String aofStorageConnectionString0) {
            this.aofStorageConnectionString0 = aofStorageConnectionString0;
            return this;
        }
        @CustomType.Setter
        public Builder aofStorageConnectionString1(@Nullable String aofStorageConnectionString1) {
            this.aofStorageConnectionString1 = aofStorageConnectionString1;
            return this;
        }
        @CustomType.Setter
        public Builder enableAuthentication(@Nullable Boolean enableAuthentication) {
            this.enableAuthentication = enableAuthentication;
            return this;
        }
        @CustomType.Setter
        public Builder maxclients(@Nullable Integer maxclients) {
            this.maxclients = maxclients;
            return this;
        }
        @CustomType.Setter
        public Builder maxfragmentationmemoryReserved(@Nullable Integer maxfragmentationmemoryReserved) {
            this.maxfragmentationmemoryReserved = maxfragmentationmemoryReserved;
            return this;
        }
        @CustomType.Setter
        public Builder maxmemoryDelta(@Nullable Integer maxmemoryDelta) {
            this.maxmemoryDelta = maxmemoryDelta;
            return this;
        }
        @CustomType.Setter
        public Builder maxmemoryPolicy(@Nullable String maxmemoryPolicy) {
            this.maxmemoryPolicy = maxmemoryPolicy;
            return this;
        }
        @CustomType.Setter
        public Builder maxmemoryReserved(@Nullable Integer maxmemoryReserved) {
            this.maxmemoryReserved = maxmemoryReserved;
            return this;
        }
        @CustomType.Setter
        public Builder notifyKeyspaceEvents(@Nullable String notifyKeyspaceEvents) {
            this.notifyKeyspaceEvents = notifyKeyspaceEvents;
            return this;
        }
        @CustomType.Setter
        public Builder rdbBackupEnabled(@Nullable Boolean rdbBackupEnabled) {
            this.rdbBackupEnabled = rdbBackupEnabled;
            return this;
        }
        @CustomType.Setter
        public Builder rdbBackupFrequency(@Nullable Integer rdbBackupFrequency) {
            this.rdbBackupFrequency = rdbBackupFrequency;
            return this;
        }
        @CustomType.Setter
        public Builder rdbBackupMaxSnapshotCount(@Nullable Integer rdbBackupMaxSnapshotCount) {
            this.rdbBackupMaxSnapshotCount = rdbBackupMaxSnapshotCount;
            return this;
        }
        @CustomType.Setter
        public Builder rdbStorageConnectionString(@Nullable String rdbStorageConnectionString) {
            this.rdbStorageConnectionString = rdbStorageConnectionString;
            return this;
        }
        public CacheRedisConfiguration build() {
            final var o = new CacheRedisConfiguration();
            o.aofBackupEnabled = aofBackupEnabled;
            o.aofStorageConnectionString0 = aofStorageConnectionString0;
            o.aofStorageConnectionString1 = aofStorageConnectionString1;
            o.enableAuthentication = enableAuthentication;
            o.maxclients = maxclients;
            o.maxfragmentationmemoryReserved = maxfragmentationmemoryReserved;
            o.maxmemoryDelta = maxmemoryDelta;
            o.maxmemoryPolicy = maxmemoryPolicy;
            o.maxmemoryReserved = maxmemoryReserved;
            o.notifyKeyspaceEvents = notifyKeyspaceEvents;
            o.rdbBackupEnabled = rdbBackupEnabled;
            o.rdbBackupFrequency = rdbBackupFrequency;
            o.rdbBackupMaxSnapshotCount = rdbBackupMaxSnapshotCount;
            o.rdbStorageConnectionString = rdbStorageConnectionString;
            return o;
        }
    }
}
