aws_sdk_ec2/types/
_route_table_association_state.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the state of an association between a route table and a subnet or gateway.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RouteTableAssociationState {
7    /// <p>The state of the association.</p>
8    pub state: ::std::option::Option<crate::types::RouteTableAssociationStateCode>,
9    /// <p>The status message, if applicable.</p>
10    pub status_message: ::std::option::Option<::std::string::String>,
11}
12impl RouteTableAssociationState {
13    /// <p>The state of the association.</p>
14    pub fn state(&self) -> ::std::option::Option<&crate::types::RouteTableAssociationStateCode> {
15        self.state.as_ref()
16    }
17    /// <p>The status message, if applicable.</p>
18    pub fn status_message(&self) -> ::std::option::Option<&str> {
19        self.status_message.as_deref()
20    }
21}
22impl RouteTableAssociationState {
23    /// Creates a new builder-style object to manufacture [`RouteTableAssociationState`](crate::types::RouteTableAssociationState).
24    pub fn builder() -> crate::types::builders::RouteTableAssociationStateBuilder {
25        crate::types::builders::RouteTableAssociationStateBuilder::default()
26    }
27}
28
29/// A builder for [`RouteTableAssociationState`](crate::types::RouteTableAssociationState).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct RouteTableAssociationStateBuilder {
33    pub(crate) state: ::std::option::Option<crate::types::RouteTableAssociationStateCode>,
34    pub(crate) status_message: ::std::option::Option<::std::string::String>,
35}
36impl RouteTableAssociationStateBuilder {
37    /// <p>The state of the association.</p>
38    pub fn state(mut self, input: crate::types::RouteTableAssociationStateCode) -> Self {
39        self.state = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The state of the association.</p>
43    pub fn set_state(mut self, input: ::std::option::Option<crate::types::RouteTableAssociationStateCode>) -> Self {
44        self.state = input;
45        self
46    }
47    /// <p>The state of the association.</p>
48    pub fn get_state(&self) -> &::std::option::Option<crate::types::RouteTableAssociationStateCode> {
49        &self.state
50    }
51    /// <p>The status message, if applicable.</p>
52    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.status_message = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The status message, if applicable.</p>
57    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.status_message = input;
59        self
60    }
61    /// <p>The status message, if applicable.</p>
62    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
63        &self.status_message
64    }
65    /// Consumes the builder and constructs a [`RouteTableAssociationState`](crate::types::RouteTableAssociationState).
66    pub fn build(self) -> crate::types::RouteTableAssociationState {
67        crate::types::RouteTableAssociationState {
68            state: self.state,
69            status_message: self.status_message,
70        }
71    }
72}