aws_sdk_networkmanager/types/
_relationship.rs

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