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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The policies for a load balancer.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Policies {
/// <p>The stickiness policies created using <code>CreateAppCookieStickinessPolicy</code>.</p>
pub app_cookie_stickiness_policies: ::std::option::Option<::std::vec::Vec<crate::types::AppCookieStickinessPolicy>>,
/// <p>The stickiness policies created using <code>CreateLBCookieStickinessPolicy</code>.</p>
pub lb_cookie_stickiness_policies: ::std::option::Option<::std::vec::Vec<crate::types::LbCookieStickinessPolicy>>,
/// <p>The policies other than the stickiness policies.</p>
pub other_policies: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Policies {
/// <p>The stickiness policies created using <code>CreateAppCookieStickinessPolicy</code>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.app_cookie_stickiness_policies.is_none()`.
pub fn app_cookie_stickiness_policies(&self) -> &[crate::types::AppCookieStickinessPolicy] {
self.app_cookie_stickiness_policies.as_deref().unwrap_or_default()
}
/// <p>The stickiness policies created using <code>CreateLBCookieStickinessPolicy</code>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.lb_cookie_stickiness_policies.is_none()`.
pub fn lb_cookie_stickiness_policies(&self) -> &[crate::types::LbCookieStickinessPolicy] {
self.lb_cookie_stickiness_policies.as_deref().unwrap_or_default()
}
/// <p>The policies other than the stickiness policies.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.other_policies.is_none()`.
pub fn other_policies(&self) -> &[::std::string::String] {
self.other_policies.as_deref().unwrap_or_default()
}
}
impl Policies {
/// Creates a new builder-style object to manufacture [`Policies`](crate::types::Policies).
pub fn builder() -> crate::types::builders::PoliciesBuilder {
crate::types::builders::PoliciesBuilder::default()
}
}
/// A builder for [`Policies`](crate::types::Policies).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PoliciesBuilder {
pub(crate) app_cookie_stickiness_policies: ::std::option::Option<::std::vec::Vec<crate::types::AppCookieStickinessPolicy>>,
pub(crate) lb_cookie_stickiness_policies: ::std::option::Option<::std::vec::Vec<crate::types::LbCookieStickinessPolicy>>,
pub(crate) other_policies: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl PoliciesBuilder {
/// Appends an item to `app_cookie_stickiness_policies`.
///
/// To override the contents of this collection use [`set_app_cookie_stickiness_policies`](Self::set_app_cookie_stickiness_policies).
///
/// <p>The stickiness policies created using <code>CreateAppCookieStickinessPolicy</code>.</p>
pub fn app_cookie_stickiness_policies(mut self, input: crate::types::AppCookieStickinessPolicy) -> Self {
let mut v = self.app_cookie_stickiness_policies.unwrap_or_default();
v.push(input);
self.app_cookie_stickiness_policies = ::std::option::Option::Some(v);
self
}
/// <p>The stickiness policies created using <code>CreateAppCookieStickinessPolicy</code>.</p>
pub fn set_app_cookie_stickiness_policies(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::AppCookieStickinessPolicy>>,
) -> Self {
self.app_cookie_stickiness_policies = input;
self
}
/// <p>The stickiness policies created using <code>CreateAppCookieStickinessPolicy</code>.</p>
pub fn get_app_cookie_stickiness_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AppCookieStickinessPolicy>> {
&self.app_cookie_stickiness_policies
}
/// Appends an item to `lb_cookie_stickiness_policies`.
///
/// To override the contents of this collection use [`set_lb_cookie_stickiness_policies`](Self::set_lb_cookie_stickiness_policies).
///
/// <p>The stickiness policies created using <code>CreateLBCookieStickinessPolicy</code>.</p>
pub fn lb_cookie_stickiness_policies(mut self, input: crate::types::LbCookieStickinessPolicy) -> Self {
let mut v = self.lb_cookie_stickiness_policies.unwrap_or_default();
v.push(input);
self.lb_cookie_stickiness_policies = ::std::option::Option::Some(v);
self
}
/// <p>The stickiness policies created using <code>CreateLBCookieStickinessPolicy</code>.</p>
pub fn set_lb_cookie_stickiness_policies(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::LbCookieStickinessPolicy>>,
) -> Self {
self.lb_cookie_stickiness_policies = input;
self
}
/// <p>The stickiness policies created using <code>CreateLBCookieStickinessPolicy</code>.</p>
pub fn get_lb_cookie_stickiness_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LbCookieStickinessPolicy>> {
&self.lb_cookie_stickiness_policies
}
/// Appends an item to `other_policies`.
///
/// To override the contents of this collection use [`set_other_policies`](Self::set_other_policies).
///
/// <p>The policies other than the stickiness policies.</p>
pub fn other_policies(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.other_policies.unwrap_or_default();
v.push(input.into());
self.other_policies = ::std::option::Option::Some(v);
self
}
/// <p>The policies other than the stickiness policies.</p>
pub fn set_other_policies(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.other_policies = input;
self
}
/// <p>The policies other than the stickiness policies.</p>
pub fn get_other_policies(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.other_policies
}
/// Consumes the builder and constructs a [`Policies`](crate::types::Policies).
pub fn build(self) -> crate::types::Policies {
crate::types::Policies {
app_cookie_stickiness_policies: self.app_cookie_stickiness_policies,
lb_cookie_stickiness_policies: self.lb_cookie_stickiness_policies,
other_policies: self.other_policies,
}
}
}