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

package serviceintegration

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 kafkaMirrormakerUserConfig() *schema.Schema {
	return &schema.Schema{
		Description:      "KafkaMirrormaker 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{
			"cluster_alias": {
				Description: "The alias under which the Kafka cluster is known to MirrorMaker. Can contain the following symbols: ASCII alphanumerics, `.`, `_`, and `-`. Example: `kafka-abc`.",
				Optional:    true,
				Type:        schema.TypeString,
			},
			"kafka_mirrormaker": {
				Description: "Kafka MirrorMaker configuration values",
				Elem: &schema.Resource{Schema: map[string]*schema.Schema{
					"consumer_auto_offset_reset": {
						Description:  "Enum: `earliest`, `latest`. Set where consumer starts to consume data. Value `earliest`: Start replication from the earliest offset. Value `latest`: Start replication from the latest offset. Default is `earliest`.",
						Optional:     true,
						Type:         schema.TypeString,
						ValidateFunc: validation.StringInSlice([]string{"earliest", "latest"}, false),
					},
					"consumer_fetch_min_bytes": {
						Description: "The minimum amount of data the server should return for a fetch request. Example: `1024`.",
						Optional:    true,
						Type:        schema.TypeInt,
					},
					"consumer_max_poll_records": {
						Description: "Set consumer max.poll.records. The default is 500. Example: `500`.",
						Optional:    true,
						Type:        schema.TypeInt,
					},
					"producer_batch_size": {
						Description: "The batch size in bytes producer will attempt to collect before publishing to broker. Example: `1024`.",
						Optional:    true,
						Type:        schema.TypeInt,
					},
					"producer_buffer_memory": {
						Description: "The amount of bytes producer can use for buffering data before publishing to broker.",
						Optional:    true,
						Type:        schema.TypeInt,
					},
					"producer_compression_type": {
						Description:  "Enum: `gzip`, `lz4`, `none`, `snappy`, `zstd`. Specify the default compression type for producers. This configuration accepts the standard compression codecs (`gzip`, `snappy`, `lz4`, `zstd`). It additionally accepts `none` which is the default and equivalent to no compression.",
						Optional:     true,
						Type:         schema.TypeString,
						ValidateFunc: validation.StringInSlice([]string{"gzip", "lz4", "none", "snappy", "zstd"}, false),
					},
					"producer_linger_ms": {
						Description: "The linger time (ms) for waiting new data to arrive for publishing. Example: `100`.",
						Optional:    true,
						Type:        schema.TypeInt,
					},
					"producer_max_request_size": {
						Description: "The maximum request size in bytes.",
						Optional:    true,
						Type:        schema.TypeInt,
					},
				}},
				MaxItems: 1,
				Optional: true,
				Type:     schema.TypeList,
			},
		}},
		MaxItems: 1,
		Optional: true,
		Type:     schema.TypeList,
	}
}
