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

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

/// ConsulUpstream represents a Consul Connect upstream jobspec block.
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct ConsulUpstream {
    #[serde(
        rename = "local_bind_socket_mode",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_bind_socket_mode: Option<String>,

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

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

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

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

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

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

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

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

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

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

    #[serde(rename = "mesh_gateway", skip_serializing_if = "Option::is_none")]
    pub mesh_gateway: Option<super::ConsulMeshGateway>,
}
