aws-sdk-iotfleetwise 1.106.0

AWS SDK for AWS IoT FleetWise
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchCreateVehicleInput {
    /// <p>A list of information about each vehicle to create. For more information, see the API data type.</p>
    pub vehicles: ::std::option::Option<::std::vec::Vec<crate::types::CreateVehicleRequestItem>>,
}
impl BatchCreateVehicleInput {
    /// <p>A list of information about each vehicle to create. For more information, see the API data type.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.vehicles.is_none()`.
    pub fn vehicles(&self) -> &[crate::types::CreateVehicleRequestItem] {
        self.vehicles.as_deref().unwrap_or_default()
    }
}
impl BatchCreateVehicleInput {
    /// Creates a new builder-style object to manufacture [`BatchCreateVehicleInput`](crate::operation::batch_create_vehicle::BatchCreateVehicleInput).
    pub fn builder() -> crate::operation::batch_create_vehicle::builders::BatchCreateVehicleInputBuilder {
        crate::operation::batch_create_vehicle::builders::BatchCreateVehicleInputBuilder::default()
    }
}

/// A builder for [`BatchCreateVehicleInput`](crate::operation::batch_create_vehicle::BatchCreateVehicleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchCreateVehicleInputBuilder {
    pub(crate) vehicles: ::std::option::Option<::std::vec::Vec<crate::types::CreateVehicleRequestItem>>,
}
impl BatchCreateVehicleInputBuilder {
    /// Appends an item to `vehicles`.
    ///
    /// To override the contents of this collection use [`set_vehicles`](Self::set_vehicles).
    ///
    /// <p>A list of information about each vehicle to create. For more information, see the API data type.</p>
    pub fn vehicles(mut self, input: crate::types::CreateVehicleRequestItem) -> Self {
        let mut v = self.vehicles.unwrap_or_default();
        v.push(input);
        self.vehicles = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of information about each vehicle to create. For more information, see the API data type.</p>
    pub fn set_vehicles(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateVehicleRequestItem>>) -> Self {
        self.vehicles = input;
        self
    }
    /// <p>A list of information about each vehicle to create. For more information, see the API data type.</p>
    pub fn get_vehicles(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateVehicleRequestItem>> {
        &self.vehicles
    }
    /// Consumes the builder and constructs a [`BatchCreateVehicleInput`](crate::operation::batch_create_vehicle::BatchCreateVehicleInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::batch_create_vehicle::BatchCreateVehicleInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::batch_create_vehicle::BatchCreateVehicleInput { vehicles: self.vehicles })
    }
}