aws-sdk-iotfleetwise 1.108.0

AWS SDK for AWS IoT FleetWise
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_vehicle::_update_vehicle_input::UpdateVehicleInputBuilder;

pub use crate::operation::update_vehicle::_update_vehicle_output::UpdateVehicleOutputBuilder;

impl crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_vehicle::UpdateVehicleOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_vehicle::UpdateVehicleError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_vehicle();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateVehicle`.
///
/// <p>Updates a vehicle.</p><important>
/// <p>Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see <a href="https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html">Amazon Web Services Region and feature availability</a> in the <i>Amazon Web Services IoT FleetWise Developer Guide</i>.</p>
/// </important>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateVehicleFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_vehicle::UpdateVehicleOutput,
        crate::operation::update_vehicle::UpdateVehicleError,
    > for UpdateVehicleFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_vehicle::UpdateVehicleOutput,
            crate::operation::update_vehicle::UpdateVehicleError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateVehicleFluentBuilder {
    /// Creates a new `UpdateVehicleFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the UpdateVehicle as a reference.
    pub fn as_input(&self) -> &crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_vehicle::UpdateVehicleOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_vehicle::UpdateVehicleError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::update_vehicle::UpdateVehicle::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_vehicle::UpdateVehicle::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::update_vehicle::UpdateVehicleOutput,
        crate::operation::update_vehicle::UpdateVehicleError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The unique ID of the vehicle to update.</p>
    pub fn vehicle_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.vehicle_name(input.into());
        self
    }
    /// <p>The unique ID of the vehicle to update.</p>
    pub fn set_vehicle_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_vehicle_name(input);
        self
    }
    /// <p>The unique ID of the vehicle to update.</p>
    pub fn get_vehicle_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_vehicle_name()
    }
    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
    pub fn model_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.model_manifest_arn(input.into());
        self
    }
    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
    pub fn set_model_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_model_manifest_arn(input);
        self
    }
    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
    pub fn get_model_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_model_manifest_arn()
    }
    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
    pub fn decoder_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.decoder_manifest_arn(input.into());
        self
    }
    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
    pub fn set_decoder_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_decoder_manifest_arn(input);
        self
    }
    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
    pub fn get_decoder_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_decoder_manifest_arn()
    }
    ///
    /// Adds a key-value pair to `attributes`.
    ///
    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
    ///
    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.attributes(k.into(), v.into());
        self
    }
    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_attributes(input);
        self
    }
    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_attributes()
    }
    /// <p>The method the specified attributes will update the existing attributes on the vehicle. Use<code>Overwite</code> to replace the vehicle attributes with the specified attributes. Or use <code>Merge</code> to combine all attributes.</p>
    /// <p>This is required if attributes are present in the input.</p>
    pub fn attribute_update_mode(mut self, input: crate::types::UpdateMode) -> Self {
        self.inner = self.inner.attribute_update_mode(input);
        self
    }
    /// <p>The method the specified attributes will update the existing attributes on the vehicle. Use<code>Overwite</code> to replace the vehicle attributes with the specified attributes. Or use <code>Merge</code> to combine all attributes.</p>
    /// <p>This is required if attributes are present in the input.</p>
    pub fn set_attribute_update_mode(mut self, input: ::std::option::Option<crate::types::UpdateMode>) -> Self {
        self.inner = self.inner.set_attribute_update_mode(input);
        self
    }
    /// <p>The method the specified attributes will update the existing attributes on the vehicle. Use<code>Overwite</code> to replace the vehicle attributes with the specified attributes. Or use <code>Merge</code> to combine all attributes.</p>
    /// <p>This is required if attributes are present in the input.</p>
    pub fn get_attribute_update_mode(&self) -> &::std::option::Option<crate::types::UpdateMode> {
        self.inner.get_attribute_update_mode()
    }
    ///
    /// Appends an item to `stateTemplatesToAdd`.
    ///
    /// To override the contents of this collection use [`set_state_templates_to_add`](Self::set_state_templates_to_add).
    ///
    /// <p>Associate state templates with the vehicle.</p>
    pub fn state_templates_to_add(mut self, input: crate::types::StateTemplateAssociation) -> Self {
        self.inner = self.inner.state_templates_to_add(input);
        self
    }
    /// <p>Associate state templates with the vehicle.</p>
    pub fn set_state_templates_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>) -> Self {
        self.inner = self.inner.set_state_templates_to_add(input);
        self
    }
    /// <p>Associate state templates with the vehicle.</p>
    pub fn get_state_templates_to_add(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>> {
        self.inner.get_state_templates_to_add()
    }
    ///
    /// Appends an item to `stateTemplatesToRemove`.
    ///
    /// To override the contents of this collection use [`set_state_templates_to_remove`](Self::set_state_templates_to_remove).
    ///
    /// <p>Remove state templates from the vehicle.</p>
    pub fn state_templates_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.state_templates_to_remove(input.into());
        self
    }
    /// <p>Remove state templates from the vehicle.</p>
    pub fn set_state_templates_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_state_templates_to_remove(input);
        self
    }
    /// <p>Remove state templates from the vehicle.</p>
    pub fn get_state_templates_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_state_templates_to_remove()
    }
    ///
    /// Appends an item to `stateTemplatesToUpdate`.
    ///
    /// To override the contents of this collection use [`set_state_templates_to_update`](Self::set_state_templates_to_update).
    ///
    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
    pub fn state_templates_to_update(mut self, input: crate::types::StateTemplateAssociation) -> Self {
        self.inner = self.inner.state_templates_to_update(input);
        self
    }
    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
    pub fn set_state_templates_to_update(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>) -> Self {
        self.inner = self.inner.set_state_templates_to_update(input);
        self
    }
    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
    pub fn get_state_templates_to_update(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>> {
        self.inner.get_state_templates_to_update()
    }
}