#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct VirtualRouterData {
pub mesh_name: ::std::string::String,
pub virtual_router_name: ::std::string::String,
pub spec: ::std::option::Option<crate::types::VirtualRouterSpec>,
pub metadata: ::std::option::Option<crate::types::ResourceMetadata>,
pub status: ::std::option::Option<crate::types::VirtualRouterStatus>,
}
impl VirtualRouterData {
pub fn mesh_name(&self) -> &str {
use std::ops::Deref;
self.mesh_name.deref()
}
pub fn virtual_router_name(&self) -> &str {
use std::ops::Deref;
self.virtual_router_name.deref()
}
pub fn spec(&self) -> ::std::option::Option<&crate::types::VirtualRouterSpec> {
self.spec.as_ref()
}
pub fn metadata(&self) -> ::std::option::Option<&crate::types::ResourceMetadata> {
self.metadata.as_ref()
}
pub fn status(&self) -> ::std::option::Option<&crate::types::VirtualRouterStatus> {
self.status.as_ref()
}
}
impl VirtualRouterData {
pub fn builder() -> crate::types::builders::VirtualRouterDataBuilder {
crate::types::builders::VirtualRouterDataBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VirtualRouterDataBuilder {
pub(crate) mesh_name: ::std::option::Option<::std::string::String>,
pub(crate) virtual_router_name: ::std::option::Option<::std::string::String>,
pub(crate) spec: ::std::option::Option<crate::types::VirtualRouterSpec>,
pub(crate) metadata: ::std::option::Option<crate::types::ResourceMetadata>,
pub(crate) status: ::std::option::Option<crate::types::VirtualRouterStatus>,
}
impl VirtualRouterDataBuilder {
pub fn mesh_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.mesh_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_mesh_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.mesh_name = input;
self
}
pub fn get_mesh_name(&self) -> &::std::option::Option<::std::string::String> {
&self.mesh_name
}
pub fn virtual_router_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.virtual_router_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_virtual_router_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.virtual_router_name = input;
self
}
pub fn get_virtual_router_name(&self) -> &::std::option::Option<::std::string::String> {
&self.virtual_router_name
}
pub fn spec(mut self, input: crate::types::VirtualRouterSpec) -> Self {
self.spec = ::std::option::Option::Some(input);
self
}
pub fn set_spec(mut self, input: ::std::option::Option<crate::types::VirtualRouterSpec>) -> Self {
self.spec = input;
self
}
pub fn get_spec(&self) -> &::std::option::Option<crate::types::VirtualRouterSpec> {
&self.spec
}
pub fn metadata(mut self, input: crate::types::ResourceMetadata) -> Self {
self.metadata = ::std::option::Option::Some(input);
self
}
pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::ResourceMetadata>) -> Self {
self.metadata = input;
self
}
pub fn get_metadata(&self) -> &::std::option::Option<crate::types::ResourceMetadata> {
&self.metadata
}
pub fn status(mut self, input: crate::types::VirtualRouterStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::VirtualRouterStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::VirtualRouterStatus> {
&self.status
}
pub fn build(self) -> ::std::result::Result<crate::types::VirtualRouterData, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::VirtualRouterData {
mesh_name: self.mesh_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"mesh_name",
"mesh_name was not specified but it is required when building VirtualRouterData",
)
})?,
virtual_router_name: self.virtual_router_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"virtual_router_name",
"virtual_router_name was not specified but it is required when building VirtualRouterData",
)
})?,
spec: self.spec,
metadata: self.metadata,
status: self.status,
})
}
}