1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A complex type for an endpoint. Specifies information about the endpoint to remove from the endpoint group.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EndpointIdentifier {
    /// <p>An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID.</p>
    /// <p>An Application Load Balancer can be either internal or internet-facing.</p>
    pub endpoint_id: ::std::string::String,
    /// <p>Indicates whether client IP address preservation is enabled for an endpoint. The value is true or false.</p>
    /// <p>If the value is set to true, the client's IP address is preserved in the <code>X-Forwarded-For</code> request header as traffic travels to applications on the endpoint fronted by the accelerator.</p>
    pub client_ip_preservation_enabled: ::std::option::Option<bool>,
}
impl EndpointIdentifier {
    /// <p>An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID.</p>
    /// <p>An Application Load Balancer can be either internal or internet-facing.</p>
    pub fn endpoint_id(&self) -> &str {
        use std::ops::Deref;
        self.endpoint_id.deref()
    }
    /// <p>Indicates whether client IP address preservation is enabled for an endpoint. The value is true or false.</p>
    /// <p>If the value is set to true, the client's IP address is preserved in the <code>X-Forwarded-For</code> request header as traffic travels to applications on the endpoint fronted by the accelerator.</p>
    pub fn client_ip_preservation_enabled(&self) -> ::std::option::Option<bool> {
        self.client_ip_preservation_enabled
    }
}
impl EndpointIdentifier {
    /// Creates a new builder-style object to manufacture [`EndpointIdentifier`](crate::types::EndpointIdentifier).
    pub fn builder() -> crate::types::builders::EndpointIdentifierBuilder {
        crate::types::builders::EndpointIdentifierBuilder::default()
    }
}

/// A builder for [`EndpointIdentifier`](crate::types::EndpointIdentifier).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EndpointIdentifierBuilder {
    pub(crate) endpoint_id: ::std::option::Option<::std::string::String>,
    pub(crate) client_ip_preservation_enabled: ::std::option::Option<bool>,
}
impl EndpointIdentifierBuilder {
    /// <p>An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID.</p>
    /// <p>An Application Load Balancer can be either internal or internet-facing.</p>
    /// This field is required.
    pub fn endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.endpoint_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID.</p>
    /// <p>An Application Load Balancer can be either internal or internet-facing.</p>
    pub fn set_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.endpoint_id = input;
        self
    }
    /// <p>An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID. For Amazon EC2 instances, this is the EC2 instance ID.</p>
    /// <p>An Application Load Balancer can be either internal or internet-facing.</p>
    pub fn get_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.endpoint_id
    }
    /// <p>Indicates whether client IP address preservation is enabled for an endpoint. The value is true or false.</p>
    /// <p>If the value is set to true, the client's IP address is preserved in the <code>X-Forwarded-For</code> request header as traffic travels to applications on the endpoint fronted by the accelerator.</p>
    pub fn client_ip_preservation_enabled(mut self, input: bool) -> Self {
        self.client_ip_preservation_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether client IP address preservation is enabled for an endpoint. The value is true or false.</p>
    /// <p>If the value is set to true, the client's IP address is preserved in the <code>X-Forwarded-For</code> request header as traffic travels to applications on the endpoint fronted by the accelerator.</p>
    pub fn set_client_ip_preservation_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.client_ip_preservation_enabled = input;
        self
    }
    /// <p>Indicates whether client IP address preservation is enabled for an endpoint. The value is true or false.</p>
    /// <p>If the value is set to true, the client's IP address is preserved in the <code>X-Forwarded-For</code> request header as traffic travels to applications on the endpoint fronted by the accelerator.</p>
    pub fn get_client_ip_preservation_enabled(&self) -> &::std::option::Option<bool> {
        &self.client_ip_preservation_enabled
    }
    /// Consumes the builder and constructs a [`EndpointIdentifier`](crate::types::EndpointIdentifier).
    /// This method will fail if any of the following fields are not set:
    /// - [`endpoint_id`](crate::types::builders::EndpointIdentifierBuilder::endpoint_id)
    pub fn build(self) -> ::std::result::Result<crate::types::EndpointIdentifier, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::EndpointIdentifier {
            endpoint_id: self.endpoint_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "endpoint_id",
                    "endpoint_id was not specified but it is required when building EndpointIdentifier",
                )
            })?,
            client_ip_preservation_enabled: self.client_ip_preservation_enabled,
        })
    }
}