Skip to main content

aws_sdk_directconnect/operation/list_virtual_interface_test_history/
_list_virtual_interface_test_history_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ListVirtualInterfaceTestHistoryInput {
6    /// <p>The ID of the virtual interface failover test.</p>
7    pub test_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the virtual interface that was tested.</p>
9    pub virtual_interface_id: ::std::option::Option<::std::string::String>,
10    /// <p>The BGP peers that were placed in the DOWN state during the virtual interface failover test.</p>
11    pub bgp_peers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The status of the virtual interface failover test.</p>
13    pub status: ::std::option::Option<::std::string::String>,
14    /// <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
15    /// <p>If <code>MaxResults</code> is given a value larger than 100, only 100 results are returned.</p>
16    pub max_results: ::std::option::Option<i32>,
17    /// <p>The token for the next page of results.</p>
18    pub next_token: ::std::option::Option<::std::string::String>,
19}
20impl ListVirtualInterfaceTestHistoryInput {
21    /// <p>The ID of the virtual interface failover test.</p>
22    pub fn test_id(&self) -> ::std::option::Option<&str> {
23        self.test_id.as_deref()
24    }
25    /// <p>The ID of the virtual interface that was tested.</p>
26    pub fn virtual_interface_id(&self) -> ::std::option::Option<&str> {
27        self.virtual_interface_id.as_deref()
28    }
29    /// <p>The BGP peers that were placed in the DOWN state during the virtual interface failover test.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.bgp_peers.is_none()`.
32    pub fn bgp_peers(&self) -> &[::std::string::String] {
33        self.bgp_peers.as_deref().unwrap_or_default()
34    }
35    /// <p>The status of the virtual interface failover test.</p>
36    pub fn status(&self) -> ::std::option::Option<&str> {
37        self.status.as_deref()
38    }
39    /// <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
40    /// <p>If <code>MaxResults</code> is given a value larger than 100, only 100 results are returned.</p>
41    pub fn max_results(&self) -> ::std::option::Option<i32> {
42        self.max_results
43    }
44    /// <p>The token for the next page of results.</p>
45    pub fn next_token(&self) -> ::std::option::Option<&str> {
46        self.next_token.as_deref()
47    }
48}
49impl ListVirtualInterfaceTestHistoryInput {
50    /// Creates a new builder-style object to manufacture [`ListVirtualInterfaceTestHistoryInput`](crate::operation::list_virtual_interface_test_history::ListVirtualInterfaceTestHistoryInput).
51    pub fn builder() -> crate::operation::list_virtual_interface_test_history::builders::ListVirtualInterfaceTestHistoryInputBuilder {
52        crate::operation::list_virtual_interface_test_history::builders::ListVirtualInterfaceTestHistoryInputBuilder::default()
53    }
54}
55
56/// A builder for [`ListVirtualInterfaceTestHistoryInput`](crate::operation::list_virtual_interface_test_history::ListVirtualInterfaceTestHistoryInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct ListVirtualInterfaceTestHistoryInputBuilder {
60    pub(crate) test_id: ::std::option::Option<::std::string::String>,
61    pub(crate) virtual_interface_id: ::std::option::Option<::std::string::String>,
62    pub(crate) bgp_peers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
63    pub(crate) status: ::std::option::Option<::std::string::String>,
64    pub(crate) max_results: ::std::option::Option<i32>,
65    pub(crate) next_token: ::std::option::Option<::std::string::String>,
66}
67impl ListVirtualInterfaceTestHistoryInputBuilder {
68    /// <p>The ID of the virtual interface failover test.</p>
69    pub fn test_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.test_id = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The ID of the virtual interface failover test.</p>
74    pub fn set_test_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.test_id = input;
76        self
77    }
78    /// <p>The ID of the virtual interface failover test.</p>
79    pub fn get_test_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.test_id
81    }
82    /// <p>The ID of the virtual interface that was tested.</p>
83    pub fn virtual_interface_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.virtual_interface_id = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The ID of the virtual interface that was tested.</p>
88    pub fn set_virtual_interface_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.virtual_interface_id = input;
90        self
91    }
92    /// <p>The ID of the virtual interface that was tested.</p>
93    pub fn get_virtual_interface_id(&self) -> &::std::option::Option<::std::string::String> {
94        &self.virtual_interface_id
95    }
96    /// Appends an item to `bgp_peers`.
97    ///
98    /// To override the contents of this collection use [`set_bgp_peers`](Self::set_bgp_peers).
99    ///
100    /// <p>The BGP peers that were placed in the DOWN state during the virtual interface failover test.</p>
101    pub fn bgp_peers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        let mut v = self.bgp_peers.unwrap_or_default();
103        v.push(input.into());
104        self.bgp_peers = ::std::option::Option::Some(v);
105        self
106    }
107    /// <p>The BGP peers that were placed in the DOWN state during the virtual interface failover test.</p>
108    pub fn set_bgp_peers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
109        self.bgp_peers = input;
110        self
111    }
112    /// <p>The BGP peers that were placed in the DOWN state during the virtual interface failover test.</p>
113    pub fn get_bgp_peers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
114        &self.bgp_peers
115    }
116    /// <p>The status of the virtual interface failover test.</p>
117    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.status = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The status of the virtual interface failover test.</p>
122    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.status = input;
124        self
125    }
126    /// <p>The status of the virtual interface failover test.</p>
127    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
128        &self.status
129    }
130    /// <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
131    /// <p>If <code>MaxResults</code> is given a value larger than 100, only 100 results are returned.</p>
132    pub fn max_results(mut self, input: i32) -> Self {
133        self.max_results = ::std::option::Option::Some(input);
134        self
135    }
136    /// <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
137    /// <p>If <code>MaxResults</code> is given a value larger than 100, only 100 results are returned.</p>
138    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
139        self.max_results = input;
140        self
141    }
142    /// <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
143    /// <p>If <code>MaxResults</code> is given a value larger than 100, only 100 results are returned.</p>
144    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
145        &self.max_results
146    }
147    /// <p>The token for the next page of results.</p>
148    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.next_token = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The token for the next page of results.</p>
153    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.next_token = input;
155        self
156    }
157    /// <p>The token for the next page of results.</p>
158    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
159        &self.next_token
160    }
161    /// Consumes the builder and constructs a [`ListVirtualInterfaceTestHistoryInput`](crate::operation::list_virtual_interface_test_history::ListVirtualInterfaceTestHistoryInput).
162    pub fn build(
163        self,
164    ) -> ::std::result::Result<
165        crate::operation::list_virtual_interface_test_history::ListVirtualInterfaceTestHistoryInput,
166        ::aws_smithy_types::error::operation::BuildError,
167    > {
168        ::std::result::Result::Ok(
169            crate::operation::list_virtual_interface_test_history::ListVirtualInterfaceTestHistoryInput {
170                test_id: self.test_id,
171                virtual_interface_id: self.virtual_interface_id,
172                bgp_peers: self.bgp_peers,
173                status: self.status,
174                max_results: self.max_results,
175                next_token: self.next_token,
176            },
177        )
178    }
179}