aws-sdk-greengrass 1.8.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;

impl CreateSoftwareUpdateJobInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_software_update_job::CreateSoftwareUpdateJobOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_software_update_job();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// 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,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_software_update_job::CreateSoftwareUpdateJobOutput,
        crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
    > for CreateSoftwareUpdateJobFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_software_update_job::CreateSoftwareUpdateJobOutput,
            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateSoftwareUpdateJobFluentBuilder {
    /// Creates a new `CreateSoftwareUpdateJob`.
    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 CreateSoftwareUpdateJob as a reference.
    pub fn as_input(&self) -> &crate::operation::create_software_update_job::builders::CreateSoftwareUpdateJobInputBuilder {
        &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::create_software_update_job::CreateSoftwareUpdateJobOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
            ::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::create_software_update_job::CreateSoftwareUpdateJob::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_software_update_job::CreateSoftwareUpdateJob::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::create_software_update_job::CreateSoftwareUpdateJobOutput,
        crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl Into<crate::config::Builder>) -> Self {
        self.set_config_override(Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// A client token used to correlate requests and responses.
    pub fn amzn_client_token(mut self, input: impl ::std::convert::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
    }
    /// A client token used to correlate requests and responses.
    pub fn get_amzn_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_amzn_client_token()
    }
    /// 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 ::std::convert::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 IAM Role that Greengrass will use to create pre-signed URLs pointing towards the update artifact.
    pub fn get_s3_url_signer_role(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_s3_url_signer_role()
    }
    /// 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 piece of software on the Greengrass core that will be updated.
    pub fn get_software_to_update(&self) -> &::std::option::Option<crate::types::SoftwareToUpdate> {
        self.inner.get_software_to_update()
    }
    /// 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
    }
    /// The minimum level of log statements that should be logged by the OTA Agent during an update.
    pub fn get_update_agent_log_level(&self) -> &::std::option::Option<crate::types::UpdateAgentLogLevel> {
        self.inner.get_update_agent_log_level()
    }
    /// 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 ::std::convert::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 ARNs of the targets (IoT things or IoT thing groups) that this update will be applied to.
    pub fn get_update_targets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_update_targets()
    }
    /// 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 architecture of the cores which are the targets of an update.
    pub fn get_update_targets_architecture(&self) -> &::std::option::Option<crate::types::UpdateTargetsArchitecture> {
        self.inner.get_update_targets_architecture()
    }
    /// 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
    }
    /// The operating system of the cores which are the targets of an update.
    pub fn get_update_targets_operating_system(&self) -> &::std::option::Option<crate::types::UpdateTargetsOperatingSystem> {
        self.inner.get_update_targets_operating_system()
    }
}