aws-sdk-imagebuilder 1.111.0

AWS SDK for EC2 Image Builder
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::import_disk_image::_import_disk_image_input::ImportDiskImageInputBuilder;

pub use crate::operation::import_disk_image::_import_disk_image_output::ImportDiskImageOutputBuilder;

impl crate::operation::import_disk_image::builders::ImportDiskImageInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::import_disk_image::ImportDiskImageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::import_disk_image::ImportDiskImageError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.import_disk_image();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ImportDiskImage`.
///
/// <p>Import a Windows operating system image from a verified Microsoft ISO disk file. The following disk images are supported:</p>
/// <ul>
/// <li>
/// <p>Windows 11 Enterprise</p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ImportDiskImageFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::import_disk_image::builders::ImportDiskImageInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::import_disk_image::ImportDiskImageOutput,
        crate::operation::import_disk_image::ImportDiskImageError,
    > for ImportDiskImageFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::import_disk_image::ImportDiskImageOutput,
            crate::operation::import_disk_image::ImportDiskImageError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ImportDiskImageFluentBuilder {
    /// Creates a new `ImportDiskImageFluentBuilder`.
    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 ImportDiskImage as a reference.
    pub fn as_input(&self) -> &crate::operation::import_disk_image::builders::ImportDiskImageInputBuilder {
        &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::import_disk_image::ImportDiskImageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::import_disk_image::ImportDiskImageError,
            ::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::import_disk_image::ImportDiskImage::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::import_disk_image::ImportDiskImage::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::import_disk_image::ImportDiskImageOutput,
        crate::operation::import_disk_image::ImportDiskImageError,
        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 name of the image resource that's created from the import.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>The name of the image resource that's created from the import.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>The name of the image resource that's created from the import.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The semantic version to attach to the image that's created during the import process. This version follows the semantic version syntax.</p>
    pub fn semantic_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.semantic_version(input.into());
        self
    }
    /// <p>The semantic version to attach to the image that's created during the import process. This version follows the semantic version syntax.</p>
    pub fn set_semantic_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_semantic_version(input);
        self
    }
    /// <p>The semantic version to attach to the image that's created during the import process. This version follows the semantic version syntax.</p>
    pub fn get_semantic_version(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_semantic_version()
    }
    /// <p>The description for your disk image import.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>The description for your disk image import.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>The description for your disk image import.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>The operating system platform for the imported image. Allowed values include the following: <code>Windows</code>.</p>
    pub fn platform(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.platform(input.into());
        self
    }
    /// <p>The operating system platform for the imported image. Allowed values include the following: <code>Windows</code>.</p>
    pub fn set_platform(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_platform(input);
        self
    }
    /// <p>The operating system platform for the imported image. Allowed values include the following: <code>Windows</code>.</p>
    pub fn get_platform(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_platform()
    }
    /// <p>The operating system version for the imported image. Allowed values include the following: <code>Microsoft Windows 11</code>.</p>
    pub fn os_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.os_version(input.into());
        self
    }
    /// <p>The operating system version for the imported image. Allowed values include the following: <code>Microsoft Windows 11</code>.</p>
    pub fn set_os_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_os_version(input);
        self
    }
    /// <p>The operating system version for the imported image. Allowed values include the following: <code>Microsoft Windows 11</code>.</p>
    pub fn get_os_version(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_os_version()
    }
    /// <p>The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions to import an image from a Microsoft ISO file.</p>
    pub fn execution_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.execution_role(input.into());
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions to import an image from a Microsoft ISO file.</p>
    pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_execution_role(input);
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) for the IAM role you create that grants Image Builder access to perform workflow actions to import an image from a Microsoft ISO file.</p>
    pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_execution_role()
    }
    /// <p>The Amazon Resource Name (ARN) of the infrastructure configuration resource that's used for launching the EC2 instance on which the ISO image is built.</p>
    pub fn infrastructure_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.infrastructure_configuration_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the infrastructure configuration resource that's used for launching the EC2 instance on which the ISO image is built.</p>
    pub fn set_infrastructure_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_infrastructure_configuration_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the infrastructure configuration resource that's used for launching the EC2 instance on which the ISO image is built.</p>
    pub fn get_infrastructure_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_infrastructure_configuration_arn()
    }
    /// <p>The <code>uri</code> of the ISO disk file that's stored in Amazon S3.</p>
    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.uri(input.into());
        self
    }
    /// <p>The <code>uri</code> of the ISO disk file that's stored in Amazon S3.</p>
    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_uri(input);
        self
    }
    /// <p>The <code>uri</code> of the ISO disk file that's stored in Amazon S3.</p>
    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_uri()
    }
    /// <p>Define logging configuration for the image build process.</p>
    pub fn logging_configuration(mut self, input: crate::types::ImageLoggingConfiguration) -> Self {
        self.inner = self.inner.logging_configuration(input);
        self
    }
    /// <p>Define logging configuration for the image build process.</p>
    pub fn set_logging_configuration(mut self, input: ::std::option::Option<crate::types::ImageLoggingConfiguration>) -> Self {
        self.inner = self.inner.set_logging_configuration(input);
        self
    }
    /// <p>Define logging configuration for the image build process.</p>
    pub fn get_logging_configuration(&self) -> &::std::option::Option<crate::types::ImageLoggingConfiguration> {
        self.inner.get_logging_configuration()
    }
    ///
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags that are attached to image resources created from the import.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p>Tags that are attached to image resources created from the import.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>Tags that are attached to image resources created from the import.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    /// <p>Configures Secure Boot and UEFI settings for the imported image.</p>
    pub fn register_image_options(mut self, input: crate::types::RegisterImageOptions) -> Self {
        self.inner = self.inner.register_image_options(input);
        self
    }
    /// <p>Configures Secure Boot and UEFI settings for the imported image.</p>
    pub fn set_register_image_options(mut self, input: ::std::option::Option<crate::types::RegisterImageOptions>) -> Self {
        self.inner = self.inner.set_register_image_options(input);
        self
    }
    /// <p>Configures Secure Boot and UEFI settings for the imported image.</p>
    pub fn get_register_image_options(&self) -> &::std::option::Option<crate::types::RegisterImageOptions> {
        self.inner.get_register_image_options()
    }
    /// <p>Specifies Windows settings for ISO imports.</p>
    pub fn windows_configuration(mut self, input: crate::types::WindowsConfiguration) -> Self {
        self.inner = self.inner.windows_configuration(input);
        self
    }
    /// <p>Specifies Windows settings for ISO imports.</p>
    pub fn set_windows_configuration(mut self, input: ::std::option::Option<crate::types::WindowsConfiguration>) -> Self {
        self.inner = self.inner.set_windows_configuration(input);
        self
    }
    /// <p>Specifies Windows settings for ISO imports.</p>
    pub fn get_windows_configuration(&self) -> &::std::option::Option<crate::types::WindowsConfiguration> {
        self.inner.get_windows_configuration()
    }
    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
}