aws-sdk-devicefarm 1.98.0

AWS SDK for AWS Device Farm
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents a latitude and longitude pair, expressed in geographic coordinate system degrees (for example, 47.6204, -122.3491).</p>
/// <p>Elevation is currently not supported.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Location {
    /// <p>The latitude.</p>
    pub latitude: f64,
    /// <p>The longitude.</p>
    pub longitude: f64,
}
impl Location {
    /// <p>The latitude.</p>
    pub fn latitude(&self) -> f64 {
        self.latitude
    }
    /// <p>The longitude.</p>
    pub fn longitude(&self) -> f64 {
        self.longitude
    }
}
impl Location {
    /// Creates a new builder-style object to manufacture [`Location`](crate::types::Location).
    pub fn builder() -> crate::types::builders::LocationBuilder {
        crate::types::builders::LocationBuilder::default()
    }
}

/// A builder for [`Location`](crate::types::Location).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LocationBuilder {
    pub(crate) latitude: ::std::option::Option<f64>,
    pub(crate) longitude: ::std::option::Option<f64>,
}
impl LocationBuilder {
    /// <p>The latitude.</p>
    /// This field is required.
    pub fn latitude(mut self, input: f64) -> Self {
        self.latitude = ::std::option::Option::Some(input);
        self
    }
    /// <p>The latitude.</p>
    pub fn set_latitude(mut self, input: ::std::option::Option<f64>) -> Self {
        self.latitude = input;
        self
    }
    /// <p>The latitude.</p>
    pub fn get_latitude(&self) -> &::std::option::Option<f64> {
        &self.latitude
    }
    /// <p>The longitude.</p>
    /// This field is required.
    pub fn longitude(mut self, input: f64) -> Self {
        self.longitude = ::std::option::Option::Some(input);
        self
    }
    /// <p>The longitude.</p>
    pub fn set_longitude(mut self, input: ::std::option::Option<f64>) -> Self {
        self.longitude = input;
        self
    }
    /// <p>The longitude.</p>
    pub fn get_longitude(&self) -> &::std::option::Option<f64> {
        &self.longitude
    }
    /// Consumes the builder and constructs a [`Location`](crate::types::Location).
    /// This method will fail if any of the following fields are not set:
    /// - [`latitude`](crate::types::builders::LocationBuilder::latitude)
    /// - [`longitude`](crate::types::builders::LocationBuilder::longitude)
    pub fn build(self) -> ::std::result::Result<crate::types::Location, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Location {
            latitude: self.latitude.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "latitude",
                    "latitude was not specified but it is required when building Location",
                )
            })?,
            longitude: self.longitude.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "longitude",
                    "longitude was not specified but it is required when building Location",
                )
            })?,
        })
    }
}