// Code generated by user config generator. DO NOT EDIT.

package serviceintegrationendpoint

import (
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

	"github.com/aiven/terraform-provider-aiven/internal/sdkprovider/userconfig/diff"
)

func externalKafkaUserConfig() *schema.Schema {
	return &schema.Schema{
		Description:      "ExternalKafka user configurable settings. **Warning:** There's no way to reset advanced configuration options to default. Options that you add cannot be removed later",
		DiffSuppressFunc: diff.SuppressUnchanged,
		Elem: &schema.Resource{Schema: map[string]*schema.Schema{
			"bootstrap_servers": {
				Description: "Bootstrap servers. Example: `10.0.0.1:9092,10.0.0.2:9092`.",
				Required:    true,
				Type:        schema.TypeString,
			},
			"sasl_mechanism": {
				Description:  "Enum: `PLAIN`, `SCRAM-SHA-256`, `SCRAM-SHA-512`. SASL mechanism used for connections to the Kafka server.",
				Optional:     true,
				Type:         schema.TypeString,
				ValidateFunc: validation.StringInSlice([]string{"PLAIN", "SCRAM-SHA-256", "SCRAM-SHA-512"}, false),
			},
			"sasl_plain_password": {
				Description: "Password for SASL PLAIN mechanism in the Kafka server. Example: `admin`.",
				Optional:    true,
				Sensitive:   true,
				Type:        schema.TypeString,
			},
			"sasl_plain_username": {
				Description: "Username for SASL PLAIN mechanism in the Kafka server. Example: `admin`.",
				Optional:    true,
				Type:        schema.TypeString,
			},
			"security_protocol": {
				Description:  "Enum: `PLAINTEXT`, `SASL_PLAINTEXT`, `SASL_SSL`, `SSL`. Security protocol.",
				Required:     true,
				Type:         schema.TypeString,
				ValidateFunc: validation.StringInSlice([]string{"PLAINTEXT", "SASL_PLAINTEXT", "SASL_SSL", "SSL"}, false),
			},
			"ssl_ca_cert": {
				Description: "PEM-encoded CA certificate. Example: `-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n`.",
				Optional:    true,
				Type:        schema.TypeString,
			},
			"ssl_client_cert": {
				Description: "PEM-encoded client certificate. Example: `-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n`.",
				Optional:    true,
				Type:        schema.TypeString,
			},
			"ssl_client_key": {
				Description: "PEM-encoded client key. Example: `-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n`.",
				Optional:    true,
				Sensitive:   true,
				Type:        schema.TypeString,
			},
			"ssl_endpoint_identification_algorithm": {
				Description:  "Enum: `https`. The endpoint identification algorithm to validate server hostname using server certificate.",
				Optional:     true,
				Type:         schema.TypeString,
				ValidateFunc: validation.StringInSlice([]string{"https"}, false),
			},
		}},
		MaxItems: 1,
		Optional: true,
		Type:     schema.TypeList,
	}
}
