#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateVehicleInput {
#[doc(hidden)]
pub vehicle_name: ::std::option::Option<::std::string::String>,
#[doc(hidden)]
pub model_manifest_arn: ::std::option::Option<::std::string::String>,
#[doc(hidden)]
pub decoder_manifest_arn: ::std::option::Option<::std::string::String>,
#[doc(hidden)]
pub attributes: ::std::option::Option<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
#[doc(hidden)]
pub association_behavior: ::std::option::Option<crate::types::VehicleAssociationBehavior>,
#[doc(hidden)]
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateVehicleInput {
pub fn vehicle_name(&self) -> ::std::option::Option<&str> {
self.vehicle_name.as_deref()
}
pub fn model_manifest_arn(&self) -> ::std::option::Option<&str> {
self.model_manifest_arn.as_deref()
}
pub fn decoder_manifest_arn(&self) -> ::std::option::Option<&str> {
self.decoder_manifest_arn.as_deref()
}
pub fn attributes(
&self,
) -> ::std::option::Option<
&::std::collections::HashMap<::std::string::String, ::std::string::String>,
> {
self.attributes.as_ref()
}
pub fn association_behavior(
&self,
) -> ::std::option::Option<&crate::types::VehicleAssociationBehavior> {
self.association_behavior.as_ref()
}
pub fn tags(&self) -> ::std::option::Option<&[crate::types::Tag]> {
self.tags.as_deref()
}
}
impl CreateVehicleInput {
pub fn builder() -> crate::operation::create_vehicle::builders::CreateVehicleInputBuilder {
crate::operation::create_vehicle::builders::CreateVehicleInputBuilder::default()
}
}
#[non_exhaustive]
#[derive(
::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
)]
pub struct CreateVehicleInputBuilder {
pub(crate) vehicle_name: ::std::option::Option<::std::string::String>,
pub(crate) model_manifest_arn: ::std::option::Option<::std::string::String>,
pub(crate) decoder_manifest_arn: ::std::option::Option<::std::string::String>,
pub(crate) attributes: ::std::option::Option<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
pub(crate) association_behavior:
::std::option::Option<crate::types::VehicleAssociationBehavior>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateVehicleInputBuilder {
pub fn vehicle_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.vehicle_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_vehicle_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.vehicle_name = input;
self
}
pub fn model_manifest_arn(
mut self,
input: impl ::std::convert::Into<::std::string::String>,
) -> Self {
self.model_manifest_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_model_manifest_arn(
mut self,
input: ::std::option::Option<::std::string::String>,
) -> Self {
self.model_manifest_arn = input;
self
}
pub fn decoder_manifest_arn(
mut self,
input: impl ::std::convert::Into<::std::string::String>,
) -> Self {
self.decoder_manifest_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_decoder_manifest_arn(
mut self,
input: ::std::option::Option<::std::string::String>,
) -> Self {
self.decoder_manifest_arn = input;
self
}
pub fn attributes(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.attributes.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.attributes = ::std::option::Option::Some(hash_map);
self
}
pub fn set_attributes(
mut self,
input: ::std::option::Option<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
) -> Self {
self.attributes = input;
self
}
pub fn association_behavior(mut self, input: crate::types::VehicleAssociationBehavior) -> Self {
self.association_behavior = ::std::option::Option::Some(input);
self
}
pub fn set_association_behavior(
mut self,
input: ::std::option::Option<crate::types::VehicleAssociationBehavior>,
) -> Self {
self.association_behavior = input;
self
}
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
pub fn set_tags(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::create_vehicle::CreateVehicleInput,
::aws_smithy_http::operation::error::BuildError,
> {
::std::result::Result::Ok(crate::operation::create_vehicle::CreateVehicleInput {
vehicle_name: self.vehicle_name,
model_manifest_arn: self.model_manifest_arn,
decoder_manifest_arn: self.decoder_manifest_arn,
attributes: self.attributes,
association_behavior: self.association_behavior,
tags: self.tags,
})
}
}