// *** 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 java.lang.Boolean;
import java.lang.Integer;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class DatabaseInstanceSettingsInsightsConfig {
    /**
     * @return True if Query Insights feature is enabled.
     * 
     */
    private @Nullable Boolean queryInsightsEnabled;
    /**
     * @return Number of query execution plans captured by Insights per minute for all queries combined. Between 0 and 20. Default to 5.
     * 
     * The optional `settings.password_validation_policy` subblock for instances declares [Password Validation Policy](https://cloud.google.com/sql/docs/postgres/built-in-authentication) configuration. It contains:
     * 
     */
    private @Nullable Integer queryPlansPerMinute;
    /**
     * @return Maximum query length stored in bytes. Between 256 and 4500. Default to 1024. Higher query lengths are more useful for analytical queries, but they also require more memory. Changing the query length requires you to restart the instance. You can still add tags to queries that exceed the length limit.
     * 
     */
    private @Nullable Integer queryStringLength;
    /**
     * @return True if Query Insights will record application tags from query when enabled.
     * 
     */
    private @Nullable Boolean recordApplicationTags;
    /**
     * @return True if Query Insights will record client address when enabled.
     * 
     */
    private @Nullable Boolean recordClientAddress;

    private DatabaseInstanceSettingsInsightsConfig() {}
    /**
     * @return True if Query Insights feature is enabled.
     * 
     */
    public Optional<Boolean> queryInsightsEnabled() {
        return Optional.ofNullable(this.queryInsightsEnabled);
    }
    /**
     * @return Number of query execution plans captured by Insights per minute for all queries combined. Between 0 and 20. Default to 5.
     * 
     * The optional `settings.password_validation_policy` subblock for instances declares [Password Validation Policy](https://cloud.google.com/sql/docs/postgres/built-in-authentication) configuration. It contains:
     * 
     */
    public Optional<Integer> queryPlansPerMinute() {
        return Optional.ofNullable(this.queryPlansPerMinute);
    }
    /**
     * @return Maximum query length stored in bytes. Between 256 and 4500. Default to 1024. Higher query lengths are more useful for analytical queries, but they also require more memory. Changing the query length requires you to restart the instance. You can still add tags to queries that exceed the length limit.
     * 
     */
    public Optional<Integer> queryStringLength() {
        return Optional.ofNullable(this.queryStringLength);
    }
    /**
     * @return True if Query Insights will record application tags from query when enabled.
     * 
     */
    public Optional<Boolean> recordApplicationTags() {
        return Optional.ofNullable(this.recordApplicationTags);
    }
    /**
     * @return True if Query Insights will record client address when enabled.
     * 
     */
    public Optional<Boolean> recordClientAddress() {
        return Optional.ofNullable(this.recordClientAddress);
    }

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

    public static Builder builder(DatabaseInstanceSettingsInsightsConfig defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Boolean queryInsightsEnabled;
        private @Nullable Integer queryPlansPerMinute;
        private @Nullable Integer queryStringLength;
        private @Nullable Boolean recordApplicationTags;
        private @Nullable Boolean recordClientAddress;
        public Builder() {}
        public Builder(DatabaseInstanceSettingsInsightsConfig defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.queryInsightsEnabled = defaults.queryInsightsEnabled;
    	      this.queryPlansPerMinute = defaults.queryPlansPerMinute;
    	      this.queryStringLength = defaults.queryStringLength;
    	      this.recordApplicationTags = defaults.recordApplicationTags;
    	      this.recordClientAddress = defaults.recordClientAddress;
        }

        @CustomType.Setter
        public Builder queryInsightsEnabled(@Nullable Boolean queryInsightsEnabled) {
            this.queryInsightsEnabled = queryInsightsEnabled;
            return this;
        }
        @CustomType.Setter
        public Builder queryPlansPerMinute(@Nullable Integer queryPlansPerMinute) {
            this.queryPlansPerMinute = queryPlansPerMinute;
            return this;
        }
        @CustomType.Setter
        public Builder queryStringLength(@Nullable Integer queryStringLength) {
            this.queryStringLength = queryStringLength;
            return this;
        }
        @CustomType.Setter
        public Builder recordApplicationTags(@Nullable Boolean recordApplicationTags) {
            this.recordApplicationTags = recordApplicationTags;
            return this;
        }
        @CustomType.Setter
        public Builder recordClientAddress(@Nullable Boolean recordClientAddress) {
            this.recordClientAddress = recordClientAddress;
            return this;
        }
        public DatabaseInstanceSettingsInsightsConfig build() {
            final var o = new DatabaseInstanceSettingsInsightsConfig();
            o.queryInsightsEnabled = queryInsightsEnabled;
            o.queryPlansPerMinute = queryPlansPerMinute;
            o.queryStringLength = queryStringLength;
            o.recordApplicationTags = recordApplicationTags;
            o.recordClientAddress = recordClientAddress;
            return o;
        }
    }
}
