/*
 * This is an auto-generated file.
 * Any manual changes may be overwritten without notice!
 */

use derive_builder::Builder;
use serde::{Deserialize, Serialize};

/// ConsulGatewayProxy is used to tune parameters of the proxy instance acting as
/// one of the forms of Connect gateways that Consul supports.
///
/// https://www.consul.io/docs/connect/proxies/envoy#gateway-options
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct ConsulGatewayProxy {
    #[serde(
        rename = "connect_timeout",
        skip_serializing_if = "Option::is_none",
        serialize_with = "crate::serialize_duration_option",
        deserialize_with = "crate::deserialize_duration_option",
        default
    )]
    pub connect_timeout: Option<chrono::TimeDelta>,

    #[serde(
        rename = "envoy_gateway_bind_tagged_addresses",
        skip_serializing_if = "Option::is_none"
    )]
    pub envoy_gateway_bind_tagged_addresses: Option<bool>,

    #[serde(
        rename = "envoy_gateway_bind_addresses",
        skip_serializing_if = "Option::is_none"
    )]
    pub envoy_gateway_bind_addresses:
        Option<std::collections::HashMap<String, super::ConsulGatewayBindAddress>>,

    #[serde(
        rename = "envoy_gateway_no_default_bind",
        skip_serializing_if = "Option::is_none"
    )]
    pub envoy_gateway_no_default_bind: Option<bool>,

    #[serde(
        rename = "envoy_dns_discovery_type",
        skip_serializing_if = "Option::is_none"
    )]
    pub envoy_dns_discovery_type: Option<String>,

    #[serde(rename = "Config")]
    pub config: std::collections::HashMap<String, serde_json::Value>,
}
