#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Location {
pub path: ::std::vec::Vec<crate::types::PathElement>,
pub span: ::std::option::Option<crate::types::Span>,
}
impl Location {
pub fn path(&self) -> &[crate::types::PathElement] {
use std::ops::Deref;
self.path.deref()
}
pub fn span(&self) -> ::std::option::Option<&crate::types::Span> {
self.span.as_ref()
}
}
impl Location {
pub fn builder() -> crate::types::builders::LocationBuilder {
crate::types::builders::LocationBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LocationBuilder {
pub(crate) path: ::std::option::Option<::std::vec::Vec<crate::types::PathElement>>,
pub(crate) span: ::std::option::Option<crate::types::Span>,
}
impl LocationBuilder {
pub fn path(mut self, input: crate::types::PathElement) -> Self {
let mut v = self.path.unwrap_or_default();
v.push(input);
self.path = ::std::option::Option::Some(v);
self
}
pub fn set_path(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PathElement>>) -> Self {
self.path = input;
self
}
pub fn get_path(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PathElement>> {
&self.path
}
pub fn span(mut self, input: crate::types::Span) -> Self {
self.span = ::std::option::Option::Some(input);
self
}
pub fn set_span(mut self, input: ::std::option::Option<crate::types::Span>) -> Self {
self.span = input;
self
}
pub fn get_span(&self) -> &::std::option::Option<crate::types::Span> {
&self.span
}
pub fn build(self) -> ::std::result::Result<crate::types::Location, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Location {
path: self.path.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"path",
"path was not specified but it is required when building Location",
)
})?,
span: self.span,
})
}
}