aws-sdk-greengrass 0.26.0

AWS SDK for AWS Greengrass
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_software_update_job::_create_software_update_job_output::CreateSoftwareUpdateJobOutputBuilder;

pub use crate::operation::create_software_update_job::_create_software_update_job_input::CreateSoftwareUpdateJobInputBuilder;

/// Fluent builder constructing a request to `CreateSoftwareUpdateJob`.
///
/// Creates a software update for a core or group of cores (specified as an IoT thing group.) Use this to update the OTA Agent as well as the Greengrass core software. It makes use of the IoT Jobs feature which provides additional commands to manage a Greengrass core software update job.
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct CreateSoftwareUpdateJobFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner:
        crate::operation::create_software_update_job::builders::CreateSoftwareUpdateJobInputBuilder,
}
impl CreateSoftwareUpdateJobFluentBuilder {
    /// Creates a new `CreateSoftwareUpdateJob`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }

    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::create_software_update_job::CreateSoftwareUpdateJob,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
        >,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// 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::create_software_update_job::CreateSoftwareUpdateJobOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
        >,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// A client token used to correlate requests and responses.
    pub fn amzn_client_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.amzn_client_token(input.into());
        self
    }
    /// A client token used to correlate requests and responses.
    pub fn set_amzn_client_token(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.inner = self.inner.set_amzn_client_token(input);
        self
    }
    /// The IAM Role that Greengrass will use to create pre-signed URLs pointing towards the update artifact.
    pub fn s3_url_signer_role(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.s3_url_signer_role(input.into());
        self
    }
    /// The IAM Role that Greengrass will use to create pre-signed URLs pointing towards the update artifact.
    pub fn set_s3_url_signer_role(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.inner = self.inner.set_s3_url_signer_role(input);
        self
    }
    /// The piece of software on the Greengrass core that will be updated.
    pub fn software_to_update(mut self, input: crate::types::SoftwareToUpdate) -> Self {
        self.inner = self.inner.software_to_update(input);
        self
    }
    /// The piece of software on the Greengrass core that will be updated.
    pub fn set_software_to_update(
        mut self,
        input: std::option::Option<crate::types::SoftwareToUpdate>,
    ) -> Self {
        self.inner = self.inner.set_software_to_update(input);
        self
    }
    /// The minimum level of log statements that should be logged by the OTA Agent during an update.
    pub fn update_agent_log_level(mut self, input: crate::types::UpdateAgentLogLevel) -> Self {
        self.inner = self.inner.update_agent_log_level(input);
        self
    }
    /// The minimum level of log statements that should be logged by the OTA Agent during an update.
    pub fn set_update_agent_log_level(
        mut self,
        input: std::option::Option<crate::types::UpdateAgentLogLevel>,
    ) -> Self {
        self.inner = self.inner.set_update_agent_log_level(input);
        self
    }
    /// Appends an item to `UpdateTargets`.
    ///
    /// To override the contents of this collection use [`set_update_targets`](Self::set_update_targets).
    ///
    /// The ARNs of the targets (IoT things or IoT thing groups) that this update will be applied to.
    pub fn update_targets(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.update_targets(input.into());
        self
    }
    /// The ARNs of the targets (IoT things or IoT thing groups) that this update will be applied to.
    pub fn set_update_targets(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.inner = self.inner.set_update_targets(input);
        self
    }
    /// The architecture of the cores which are the targets of an update.
    pub fn update_targets_architecture(
        mut self,
        input: crate::types::UpdateTargetsArchitecture,
    ) -> Self {
        self.inner = self.inner.update_targets_architecture(input);
        self
    }
    /// The architecture of the cores which are the targets of an update.
    pub fn set_update_targets_architecture(
        mut self,
        input: std::option::Option<crate::types::UpdateTargetsArchitecture>,
    ) -> Self {
        self.inner = self.inner.set_update_targets_architecture(input);
        self
    }
    /// The operating system of the cores which are the targets of an update.
    pub fn update_targets_operating_system(
        mut self,
        input: crate::types::UpdateTargetsOperatingSystem,
    ) -> Self {
        self.inner = self.inner.update_targets_operating_system(input);
        self
    }
    /// The operating system of the cores which are the targets of an update.
    pub fn set_update_targets_operating_system(
        mut self,
        input: std::option::Option<crate::types::UpdateTargetsOperatingSystem>,
    ) -> Self {
        self.inner = self.inner.set_update_targets_operating_system(input);
        self
    }
}