aws_sdk_networkmanager/types/
_location.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a location.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct Location {
7    /// <p>The physical address.</p>
8    pub address: ::std::option::Option<::std::string::String>,
9    /// <p>The latitude.</p>
10    pub latitude: ::std::option::Option<::std::string::String>,
11    /// <p>The longitude.</p>
12    pub longitude: ::std::option::Option<::std::string::String>,
13}
14impl Location {
15    /// <p>The physical address.</p>
16    pub fn address(&self) -> ::std::option::Option<&str> {
17        self.address.as_deref()
18    }
19    /// <p>The latitude.</p>
20    pub fn latitude(&self) -> ::std::option::Option<&str> {
21        self.latitude.as_deref()
22    }
23    /// <p>The longitude.</p>
24    pub fn longitude(&self) -> ::std::option::Option<&str> {
25        self.longitude.as_deref()
26    }
27}
28impl ::std::fmt::Debug for Location {
29    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30        let mut formatter = f.debug_struct("Location");
31        formatter.field("address", &"*** Sensitive Data Redacted ***");
32        formatter.field("latitude", &"*** Sensitive Data Redacted ***");
33        formatter.field("longitude", &"*** Sensitive Data Redacted ***");
34        formatter.finish()
35    }
36}
37impl Location {
38    /// Creates a new builder-style object to manufacture [`Location`](crate::types::Location).
39    pub fn builder() -> crate::types::builders::LocationBuilder {
40        crate::types::builders::LocationBuilder::default()
41    }
42}
43
44/// A builder for [`Location`](crate::types::Location).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
46#[non_exhaustive]
47pub struct LocationBuilder {
48    pub(crate) address: ::std::option::Option<::std::string::String>,
49    pub(crate) latitude: ::std::option::Option<::std::string::String>,
50    pub(crate) longitude: ::std::option::Option<::std::string::String>,
51}
52impl LocationBuilder {
53    /// <p>The physical address.</p>
54    pub fn address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.address = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The physical address.</p>
59    pub fn set_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.address = input;
61        self
62    }
63    /// <p>The physical address.</p>
64    pub fn get_address(&self) -> &::std::option::Option<::std::string::String> {
65        &self.address
66    }
67    /// <p>The latitude.</p>
68    pub fn latitude(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.latitude = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The latitude.</p>
73    pub fn set_latitude(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.latitude = input;
75        self
76    }
77    /// <p>The latitude.</p>
78    pub fn get_latitude(&self) -> &::std::option::Option<::std::string::String> {
79        &self.latitude
80    }
81    /// <p>The longitude.</p>
82    pub fn longitude(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.longitude = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The longitude.</p>
87    pub fn set_longitude(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.longitude = input;
89        self
90    }
91    /// <p>The longitude.</p>
92    pub fn get_longitude(&self) -> &::std::option::Option<::std::string::String> {
93        &self.longitude
94    }
95    /// Consumes the builder and constructs a [`Location`](crate::types::Location).
96    pub fn build(self) -> crate::types::Location {
97        crate::types::Location {
98            address: self.address,
99            latitude: self.latitude,
100            longitude: self.longitude,
101        }
102    }
103}
104impl ::std::fmt::Debug for LocationBuilder {
105    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
106        let mut formatter = f.debug_struct("LocationBuilder");
107        formatter.field("address", &"*** Sensitive Data Redacted ***");
108        formatter.field("latitude", &"*** Sensitive Data Redacted ***");
109        formatter.field("longitude", &"*** Sensitive Data Redacted ***");
110        formatter.finish()
111    }
112}