// *** 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.gcp.sql.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsActiveDirectoryConfig;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsAdvancedMachineFeatures;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsBackupConfiguration;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsDataCacheConfig;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsDatabaseFlag;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsDenyMaintenancePeriod;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsInsightsConfig;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsIpConfiguration;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsLocationPreference;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsMaintenanceWindow;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsPasswordValidationPolicy;
import com.pulumi.gcp.sql.outputs.DatabaseInstanceSettingsSqlServerAuditConfig;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class DatabaseInstanceSettings {
    /**
     * @return This specifies when the instance should be
     * active. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
     * 
     */
    private @Nullable String activationPolicy;
    private @Nullable DatabaseInstanceSettingsActiveDirectoryConfig activeDirectoryConfig;
    private @Nullable DatabaseInstanceSettingsAdvancedMachineFeatures advancedMachineFeatures;
    /**
     * @return The availability type of the Cloud SQL
     * instance, high availability (`REGIONAL`) or single zone (`ZONAL`).&#39; For all instances, ensure that
     * `settings.backup_configuration.enabled` is set to `true`.
     * For MySQL instances, ensure that `settings.backup_configuration.binary_log_enabled` is set to `true`.
     * For Postgres and SQL Server instances, ensure that `settings.backup_configuration.point_in_time_recovery_enabled`
     * is set to `true`. Defaults to `ZONAL`.
     * 
     */
    private @Nullable String availabilityType;
    private @Nullable DatabaseInstanceSettingsBackupConfiguration backupConfiguration;
    /**
     * @return The name of server instance collation.
     * 
     */
    private @Nullable String collation;
    /**
     * @return Specifies if connections must use Cloud SQL connectors.
     * 
     */
    private @Nullable String connectorEnforcement;
    private @Nullable DatabaseInstanceSettingsDataCacheConfig dataCacheConfig;
    private @Nullable List<DatabaseInstanceSettingsDatabaseFlag> databaseFlags;
    private @Nullable Boolean deletionProtectionEnabled;
    private @Nullable DatabaseInstanceSettingsDenyMaintenancePeriod denyMaintenancePeriod;
    /**
     * @return Enables auto-resizing of the storage size. Defaults to `true`.
     * 
     */
    private @Nullable Boolean diskAutoresize;
    /**
     * @return The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit.
     * 
     */
    private @Nullable Integer diskAutoresizeLimit;
    /**
     * @return The size of data disk, in GB. Size of a running instance cannot be reduced but can be increased. The minimum value is 10GB.
     * 
     */
    private @Nullable Integer diskSize;
    /**
     * @return The type of data disk: PD_SSD or PD_HDD. Defaults to `PD_SSD`.
     * 
     */
    private @Nullable String diskType;
    /**
     * @return The edition of the instance, can be `ENTERPRISE` or `ENTERPRISE_PLUS`.
     * 
     */
    private @Nullable String edition;
    private @Nullable DatabaseInstanceSettingsInsightsConfig insightsConfig;
    private @Nullable DatabaseInstanceSettingsIpConfiguration ipConfiguration;
    private @Nullable DatabaseInstanceSettingsLocationPreference locationPreference;
    private @Nullable DatabaseInstanceSettingsMaintenanceWindow maintenanceWindow;
    private @Nullable DatabaseInstanceSettingsPasswordValidationPolicy passwordValidationPolicy;
    /**
     * @return Pricing plan for this instance, can only be `PER_USE`.
     * 
     */
    private @Nullable String pricingPlan;
    private @Nullable DatabaseInstanceSettingsSqlServerAuditConfig sqlServerAuditConfig;
    /**
     * @return The machine type to use. See [tiers](https://cloud.google.com/sql/docs/admin-api/v1beta4/tiers)
     * for more details and supported versions. Postgres supports only shared-core machine types,
     * and custom machine types such as `db-custom-2-13312`. See the [Custom Machine Type Documentation](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#create) to learn about specifying custom machine types.
     * 
     */
    private String tier;
    /**
     * @return The time_zone to be used by the database engine (supported only for SQL Server), in SQL Server timezone format.
     * 
     */
    private @Nullable String timeZone;
    /**
     * @return A set of key/value user label pairs to assign to the instance.
     * 
     */
    private @Nullable Map<String,String> userLabels;
    private @Nullable Integer version;

    private DatabaseInstanceSettings() {}
    /**
     * @return This specifies when the instance should be
     * active. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
     * 
     */
    public Optional<String> activationPolicy() {
        return Optional.ofNullable(this.activationPolicy);
    }
    public Optional<DatabaseInstanceSettingsActiveDirectoryConfig> activeDirectoryConfig() {
        return Optional.ofNullable(this.activeDirectoryConfig);
    }
    public Optional<DatabaseInstanceSettingsAdvancedMachineFeatures> advancedMachineFeatures() {
        return Optional.ofNullable(this.advancedMachineFeatures);
    }
    /**
     * @return The availability type of the Cloud SQL
     * instance, high availability (`REGIONAL`) or single zone (`ZONAL`).&#39; For all instances, ensure that
     * `settings.backup_configuration.enabled` is set to `true`.
     * For MySQL instances, ensure that `settings.backup_configuration.binary_log_enabled` is set to `true`.
     * For Postgres and SQL Server instances, ensure that `settings.backup_configuration.point_in_time_recovery_enabled`
     * is set to `true`. Defaults to `ZONAL`.
     * 
     */
    public Optional<String> availabilityType() {
        return Optional.ofNullable(this.availabilityType);
    }
    public Optional<DatabaseInstanceSettingsBackupConfiguration> backupConfiguration() {
        return Optional.ofNullable(this.backupConfiguration);
    }
    /**
     * @return The name of server instance collation.
     * 
     */
    public Optional<String> collation() {
        return Optional.ofNullable(this.collation);
    }
    /**
     * @return Specifies if connections must use Cloud SQL connectors.
     * 
     */
    public Optional<String> connectorEnforcement() {
        return Optional.ofNullable(this.connectorEnforcement);
    }
    public Optional<DatabaseInstanceSettingsDataCacheConfig> dataCacheConfig() {
        return Optional.ofNullable(this.dataCacheConfig);
    }
    public List<DatabaseInstanceSettingsDatabaseFlag> databaseFlags() {
        return this.databaseFlags == null ? List.of() : this.databaseFlags;
    }
    public Optional<Boolean> deletionProtectionEnabled() {
        return Optional.ofNullable(this.deletionProtectionEnabled);
    }
    public Optional<DatabaseInstanceSettingsDenyMaintenancePeriod> denyMaintenancePeriod() {
        return Optional.ofNullable(this.denyMaintenancePeriod);
    }
    /**
     * @return Enables auto-resizing of the storage size. Defaults to `true`.
     * 
     */
    public Optional<Boolean> diskAutoresize() {
        return Optional.ofNullable(this.diskAutoresize);
    }
    /**
     * @return The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit.
     * 
     */
    public Optional<Integer> diskAutoresizeLimit() {
        return Optional.ofNullable(this.diskAutoresizeLimit);
    }
    /**
     * @return The size of data disk, in GB. Size of a running instance cannot be reduced but can be increased. The minimum value is 10GB.
     * 
     */
    public Optional<Integer> diskSize() {
        return Optional.ofNullable(this.diskSize);
    }
    /**
     * @return The type of data disk: PD_SSD or PD_HDD. Defaults to `PD_SSD`.
     * 
     */
    public Optional<String> diskType() {
        return Optional.ofNullable(this.diskType);
    }
    /**
     * @return The edition of the instance, can be `ENTERPRISE` or `ENTERPRISE_PLUS`.
     * 
     */
    public Optional<String> edition() {
        return Optional.ofNullable(this.edition);
    }
    public Optional<DatabaseInstanceSettingsInsightsConfig> insightsConfig() {
        return Optional.ofNullable(this.insightsConfig);
    }
    public Optional<DatabaseInstanceSettingsIpConfiguration> ipConfiguration() {
        return Optional.ofNullable(this.ipConfiguration);
    }
    public Optional<DatabaseInstanceSettingsLocationPreference> locationPreference() {
        return Optional.ofNullable(this.locationPreference);
    }
    public Optional<DatabaseInstanceSettingsMaintenanceWindow> maintenanceWindow() {
        return Optional.ofNullable(this.maintenanceWindow);
    }
    public Optional<DatabaseInstanceSettingsPasswordValidationPolicy> passwordValidationPolicy() {
        return Optional.ofNullable(this.passwordValidationPolicy);
    }
    /**
     * @return Pricing plan for this instance, can only be `PER_USE`.
     * 
     */
    public Optional<String> pricingPlan() {
        return Optional.ofNullable(this.pricingPlan);
    }
    public Optional<DatabaseInstanceSettingsSqlServerAuditConfig> sqlServerAuditConfig() {
        return Optional.ofNullable(this.sqlServerAuditConfig);
    }
    /**
     * @return The machine type to use. See [tiers](https://cloud.google.com/sql/docs/admin-api/v1beta4/tiers)
     * for more details and supported versions. Postgres supports only shared-core machine types,
     * and custom machine types such as `db-custom-2-13312`. See the [Custom Machine Type Documentation](https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#create) to learn about specifying custom machine types.
     * 
     */
    public String tier() {
        return this.tier;
    }
    /**
     * @return The time_zone to be used by the database engine (supported only for SQL Server), in SQL Server timezone format.
     * 
     */
    public Optional<String> timeZone() {
        return Optional.ofNullable(this.timeZone);
    }
    /**
     * @return A set of key/value user label pairs to assign to the instance.
     * 
     */
    public Map<String,String> userLabels() {
        return this.userLabels == null ? Map.of() : this.userLabels;
    }
    public Optional<Integer> version() {
        return Optional.ofNullable(this.version);
    }

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

    public static Builder builder(DatabaseInstanceSettings defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String activationPolicy;
        private @Nullable DatabaseInstanceSettingsActiveDirectoryConfig activeDirectoryConfig;
        private @Nullable DatabaseInstanceSettingsAdvancedMachineFeatures advancedMachineFeatures;
        private @Nullable String availabilityType;
        private @Nullable DatabaseInstanceSettingsBackupConfiguration backupConfiguration;
        private @Nullable String collation;
        private @Nullable String connectorEnforcement;
        private @Nullable DatabaseInstanceSettingsDataCacheConfig dataCacheConfig;
        private @Nullable List<DatabaseInstanceSettingsDatabaseFlag> databaseFlags;
        private @Nullable Boolean deletionProtectionEnabled;
        private @Nullable DatabaseInstanceSettingsDenyMaintenancePeriod denyMaintenancePeriod;
        private @Nullable Boolean diskAutoresize;
        private @Nullable Integer diskAutoresizeLimit;
        private @Nullable Integer diskSize;
        private @Nullable String diskType;
        private @Nullable String edition;
        private @Nullable DatabaseInstanceSettingsInsightsConfig insightsConfig;
        private @Nullable DatabaseInstanceSettingsIpConfiguration ipConfiguration;
        private @Nullable DatabaseInstanceSettingsLocationPreference locationPreference;
        private @Nullable DatabaseInstanceSettingsMaintenanceWindow maintenanceWindow;
        private @Nullable DatabaseInstanceSettingsPasswordValidationPolicy passwordValidationPolicy;
        private @Nullable String pricingPlan;
        private @Nullable DatabaseInstanceSettingsSqlServerAuditConfig sqlServerAuditConfig;
        private String tier;
        private @Nullable String timeZone;
        private @Nullable Map<String,String> userLabels;
        private @Nullable Integer version;
        public Builder() {}
        public Builder(DatabaseInstanceSettings defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.activationPolicy = defaults.activationPolicy;
    	      this.activeDirectoryConfig = defaults.activeDirectoryConfig;
    	      this.advancedMachineFeatures = defaults.advancedMachineFeatures;
    	      this.availabilityType = defaults.availabilityType;
    	      this.backupConfiguration = defaults.backupConfiguration;
    	      this.collation = defaults.collation;
    	      this.connectorEnforcement = defaults.connectorEnforcement;
    	      this.dataCacheConfig = defaults.dataCacheConfig;
    	      this.databaseFlags = defaults.databaseFlags;
    	      this.deletionProtectionEnabled = defaults.deletionProtectionEnabled;
    	      this.denyMaintenancePeriod = defaults.denyMaintenancePeriod;
    	      this.diskAutoresize = defaults.diskAutoresize;
    	      this.diskAutoresizeLimit = defaults.diskAutoresizeLimit;
    	      this.diskSize = defaults.diskSize;
    	      this.diskType = defaults.diskType;
    	      this.edition = defaults.edition;
    	      this.insightsConfig = defaults.insightsConfig;
    	      this.ipConfiguration = defaults.ipConfiguration;
    	      this.locationPreference = defaults.locationPreference;
    	      this.maintenanceWindow = defaults.maintenanceWindow;
    	      this.passwordValidationPolicy = defaults.passwordValidationPolicy;
    	      this.pricingPlan = defaults.pricingPlan;
    	      this.sqlServerAuditConfig = defaults.sqlServerAuditConfig;
    	      this.tier = defaults.tier;
    	      this.timeZone = defaults.timeZone;
    	      this.userLabels = defaults.userLabels;
    	      this.version = defaults.version;
        }

        @CustomType.Setter
        public Builder activationPolicy(@Nullable String activationPolicy) {
            this.activationPolicy = activationPolicy;
            return this;
        }
        @CustomType.Setter
        public Builder activeDirectoryConfig(@Nullable DatabaseInstanceSettingsActiveDirectoryConfig activeDirectoryConfig) {
            this.activeDirectoryConfig = activeDirectoryConfig;
            return this;
        }
        @CustomType.Setter
        public Builder advancedMachineFeatures(@Nullable DatabaseInstanceSettingsAdvancedMachineFeatures advancedMachineFeatures) {
            this.advancedMachineFeatures = advancedMachineFeatures;
            return this;
        }
        @CustomType.Setter
        public Builder availabilityType(@Nullable String availabilityType) {
            this.availabilityType = availabilityType;
            return this;
        }
        @CustomType.Setter
        public Builder backupConfiguration(@Nullable DatabaseInstanceSettingsBackupConfiguration backupConfiguration) {
            this.backupConfiguration = backupConfiguration;
            return this;
        }
        @CustomType.Setter
        public Builder collation(@Nullable String collation) {
            this.collation = collation;
            return this;
        }
        @CustomType.Setter
        public Builder connectorEnforcement(@Nullable String connectorEnforcement) {
            this.connectorEnforcement = connectorEnforcement;
            return this;
        }
        @CustomType.Setter
        public Builder dataCacheConfig(@Nullable DatabaseInstanceSettingsDataCacheConfig dataCacheConfig) {
            this.dataCacheConfig = dataCacheConfig;
            return this;
        }
        @CustomType.Setter
        public Builder databaseFlags(@Nullable List<DatabaseInstanceSettingsDatabaseFlag> databaseFlags) {
            this.databaseFlags = databaseFlags;
            return this;
        }
        public Builder databaseFlags(DatabaseInstanceSettingsDatabaseFlag... databaseFlags) {
            return databaseFlags(List.of(databaseFlags));
        }
        @CustomType.Setter
        public Builder deletionProtectionEnabled(@Nullable Boolean deletionProtectionEnabled) {
            this.deletionProtectionEnabled = deletionProtectionEnabled;
            return this;
        }
        @CustomType.Setter
        public Builder denyMaintenancePeriod(@Nullable DatabaseInstanceSettingsDenyMaintenancePeriod denyMaintenancePeriod) {
            this.denyMaintenancePeriod = denyMaintenancePeriod;
            return this;
        }
        @CustomType.Setter
        public Builder diskAutoresize(@Nullable Boolean diskAutoresize) {
            this.diskAutoresize = diskAutoresize;
            return this;
        }
        @CustomType.Setter
        public Builder diskAutoresizeLimit(@Nullable Integer diskAutoresizeLimit) {
            this.diskAutoresizeLimit = diskAutoresizeLimit;
            return this;
        }
        @CustomType.Setter
        public Builder diskSize(@Nullable Integer diskSize) {
            this.diskSize = diskSize;
            return this;
        }
        @CustomType.Setter
        public Builder diskType(@Nullable String diskType) {
            this.diskType = diskType;
            return this;
        }
        @CustomType.Setter
        public Builder edition(@Nullable String edition) {
            this.edition = edition;
            return this;
        }
        @CustomType.Setter
        public Builder insightsConfig(@Nullable DatabaseInstanceSettingsInsightsConfig insightsConfig) {
            this.insightsConfig = insightsConfig;
            return this;
        }
        @CustomType.Setter
        public Builder ipConfiguration(@Nullable DatabaseInstanceSettingsIpConfiguration ipConfiguration) {
            this.ipConfiguration = ipConfiguration;
            return this;
        }
        @CustomType.Setter
        public Builder locationPreference(@Nullable DatabaseInstanceSettingsLocationPreference locationPreference) {
            this.locationPreference = locationPreference;
            return this;
        }
        @CustomType.Setter
        public Builder maintenanceWindow(@Nullable DatabaseInstanceSettingsMaintenanceWindow maintenanceWindow) {
            this.maintenanceWindow = maintenanceWindow;
            return this;
        }
        @CustomType.Setter
        public Builder passwordValidationPolicy(@Nullable DatabaseInstanceSettingsPasswordValidationPolicy passwordValidationPolicy) {
            this.passwordValidationPolicy = passwordValidationPolicy;
            return this;
        }
        @CustomType.Setter
        public Builder pricingPlan(@Nullable String pricingPlan) {
            this.pricingPlan = pricingPlan;
            return this;
        }
        @CustomType.Setter
        public Builder sqlServerAuditConfig(@Nullable DatabaseInstanceSettingsSqlServerAuditConfig sqlServerAuditConfig) {
            this.sqlServerAuditConfig = sqlServerAuditConfig;
            return this;
        }
        @CustomType.Setter
        public Builder tier(String tier) {
            this.tier = Objects.requireNonNull(tier);
            return this;
        }
        @CustomType.Setter
        public Builder timeZone(@Nullable String timeZone) {
            this.timeZone = timeZone;
            return this;
        }
        @CustomType.Setter
        public Builder userLabels(@Nullable Map<String,String> userLabels) {
            this.userLabels = userLabels;
            return this;
        }
        @CustomType.Setter
        public Builder version(@Nullable Integer version) {
            this.version = version;
            return this;
        }
        public DatabaseInstanceSettings build() {
            final var o = new DatabaseInstanceSettings();
            o.activationPolicy = activationPolicy;
            o.activeDirectoryConfig = activeDirectoryConfig;
            o.advancedMachineFeatures = advancedMachineFeatures;
            o.availabilityType = availabilityType;
            o.backupConfiguration = backupConfiguration;
            o.collation = collation;
            o.connectorEnforcement = connectorEnforcement;
            o.dataCacheConfig = dataCacheConfig;
            o.databaseFlags = databaseFlags;
            o.deletionProtectionEnabled = deletionProtectionEnabled;
            o.denyMaintenancePeriod = denyMaintenancePeriod;
            o.diskAutoresize = diskAutoresize;
            o.diskAutoresizeLimit = diskAutoresizeLimit;
            o.diskSize = diskSize;
            o.diskType = diskType;
            o.edition = edition;
            o.insightsConfig = insightsConfig;
            o.ipConfiguration = ipConfiguration;
            o.locationPreference = locationPreference;
            o.maintenanceWindow = maintenanceWindow;
            o.passwordValidationPolicy = passwordValidationPolicy;
            o.pricingPlan = pricingPlan;
            o.sqlServerAuditConfig = sqlServerAuditConfig;
            o.tier = tier;
            o.timeZone = timeZone;
            o.userLabels = userLabels;
            o.version = version;
            return o;
        }
    }
}
