aws_sdk_elasticloadbalancingv2/types/
_host_header_condition_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about a host header condition.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct HostHeaderConditionConfig {
7    /// <p>The host names. The maximum length of each string is 128 characters. The comparison is case insensitive. The following wildcard characters are supported: * (matches 0 or more characters) and ? (matches exactly 1 character). You must include at least one "." character. You can include only alphabetical characters after the final "." character.</p>
8    /// <p>If you specify multiple strings, the condition is satisfied if one of the strings matches the host name.</p>
9    pub values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <p>The regular expressions to compare against the host header. The maximum length of each string is 128 characters.</p>
11    pub regex_values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12}
13impl HostHeaderConditionConfig {
14    /// <p>The host names. The maximum length of each string is 128 characters. The comparison is case insensitive. The following wildcard characters are supported: * (matches 0 or more characters) and ? (matches exactly 1 character). You must include at least one "." character. You can include only alphabetical characters after the final "." character.</p>
15    /// <p>If you specify multiple strings, the condition is satisfied if one of the strings matches the host name.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.values.is_none()`.
18    pub fn values(&self) -> &[::std::string::String] {
19        self.values.as_deref().unwrap_or_default()
20    }
21    /// <p>The regular expressions to compare against the host header. The maximum length of each string is 128 characters.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.regex_values.is_none()`.
24    pub fn regex_values(&self) -> &[::std::string::String] {
25        self.regex_values.as_deref().unwrap_or_default()
26    }
27}
28impl HostHeaderConditionConfig {
29    /// Creates a new builder-style object to manufacture [`HostHeaderConditionConfig`](crate::types::HostHeaderConditionConfig).
30    pub fn builder() -> crate::types::builders::HostHeaderConditionConfigBuilder {
31        crate::types::builders::HostHeaderConditionConfigBuilder::default()
32    }
33}
34
35/// A builder for [`HostHeaderConditionConfig`](crate::types::HostHeaderConditionConfig).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct HostHeaderConditionConfigBuilder {
39    pub(crate) values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
40    pub(crate) regex_values: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
41}
42impl HostHeaderConditionConfigBuilder {
43    /// Appends an item to `values`.
44    ///
45    /// To override the contents of this collection use [`set_values`](Self::set_values).
46    ///
47    /// <p>The host names. The maximum length of each string is 128 characters. The comparison is case insensitive. The following wildcard characters are supported: * (matches 0 or more characters) and ? (matches exactly 1 character). You must include at least one "." character. You can include only alphabetical characters after the final "." character.</p>
48    /// <p>If you specify multiple strings, the condition is satisfied if one of the strings matches the host name.</p>
49    pub fn values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        let mut v = self.values.unwrap_or_default();
51        v.push(input.into());
52        self.values = ::std::option::Option::Some(v);
53        self
54    }
55    /// <p>The host names. The maximum length of each string is 128 characters. The comparison is case insensitive. The following wildcard characters are supported: * (matches 0 or more characters) and ? (matches exactly 1 character). You must include at least one "." character. You can include only alphabetical characters after the final "." character.</p>
56    /// <p>If you specify multiple strings, the condition is satisfied if one of the strings matches the host name.</p>
57    pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
58        self.values = input;
59        self
60    }
61    /// <p>The host names. The maximum length of each string is 128 characters. The comparison is case insensitive. The following wildcard characters are supported: * (matches 0 or more characters) and ? (matches exactly 1 character). You must include at least one "." character. You can include only alphabetical characters after the final "." character.</p>
62    /// <p>If you specify multiple strings, the condition is satisfied if one of the strings matches the host name.</p>
63    pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
64        &self.values
65    }
66    /// Appends an item to `regex_values`.
67    ///
68    /// To override the contents of this collection use [`set_regex_values`](Self::set_regex_values).
69    ///
70    /// <p>The regular expressions to compare against the host header. The maximum length of each string is 128 characters.</p>
71    pub fn regex_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        let mut v = self.regex_values.unwrap_or_default();
73        v.push(input.into());
74        self.regex_values = ::std::option::Option::Some(v);
75        self
76    }
77    /// <p>The regular expressions to compare against the host header. The maximum length of each string is 128 characters.</p>
78    pub fn set_regex_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
79        self.regex_values = input;
80        self
81    }
82    /// <p>The regular expressions to compare against the host header. The maximum length of each string is 128 characters.</p>
83    pub fn get_regex_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
84        &self.regex_values
85    }
86    /// Consumes the builder and constructs a [`HostHeaderConditionConfig`](crate::types::HostHeaderConditionConfig).
87    pub fn build(self) -> crate::types::HostHeaderConditionConfig {
88        crate::types::HostHeaderConditionConfig {
89            values: self.values,
90            regex_values: self.regex_values,
91        }
92    }
93}