aws-sdk-workspaces 1.116.0

AWS SDK for Amazon WorkSpaces
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::import_custom_workspace_image::_import_custom_workspace_image_input::ImportCustomWorkspaceImageInputBuilder;

pub use crate::operation::import_custom_workspace_image::_import_custom_workspace_image_output::ImportCustomWorkspaceImageOutputBuilder;

impl crate::operation::import_custom_workspace_image::builders::ImportCustomWorkspaceImageInputBuilder {
    /// 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_custom_workspace_image::ImportCustomWorkspaceImageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImageError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.import_custom_workspace_image();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ImportCustomWorkspaceImage`.
///
/// <p>Imports the specified Windows 10 or 11 Bring Your Own License (BYOL) image into Amazon WorkSpaces using EC2 Image Builder. The image must be an already licensed image that is in your Amazon Web Services account, and you must own the image. For more information about creating BYOL images, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html"> Bring Your Own Windows Desktop Licenses</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ImportCustomWorkspaceImageFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::import_custom_workspace_image::builders::ImportCustomWorkspaceImageInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImageOutput,
        crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImageError,
    > for ImportCustomWorkspaceImageFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImageOutput,
            crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImageError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ImportCustomWorkspaceImageFluentBuilder {
    /// Creates a new `ImportCustomWorkspaceImageFluentBuilder`.
    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 ImportCustomWorkspaceImage as a reference.
    pub fn as_input(&self) -> &crate::operation::import_custom_workspace_image::builders::ImportCustomWorkspaceImageInputBuilder {
        &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_custom_workspace_image::ImportCustomWorkspaceImageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImageError,
            ::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_custom_workspace_image::ImportCustomWorkspaceImage::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImage::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_custom_workspace_image::ImportCustomWorkspaceImageOutput,
        crate::operation::import_custom_workspace_image::ImportCustomWorkspaceImageError,
        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 WorkSpace image.</p>
    pub fn image_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.image_name(input.into());
        self
    }
    /// <p>The name of the WorkSpace image.</p>
    pub fn set_image_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_image_name(input);
        self
    }
    /// <p>The name of the WorkSpace image.</p>
    pub fn get_image_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_image_name()
    }
    /// <p>The description of the WorkSpace image.</p>
    pub fn image_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.image_description(input.into());
        self
    }
    /// <p>The description of the WorkSpace image.</p>
    pub fn set_image_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_image_description(input);
        self
    }
    /// <p>The description of the WorkSpace image.</p>
    pub fn get_image_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_image_description()
    }
    /// <p>The supported compute type for the WorkSpace image.</p>
    pub fn compute_type(mut self, input: crate::types::ImageComputeType) -> Self {
        self.inner = self.inner.compute_type(input);
        self
    }
    /// <p>The supported compute type for the WorkSpace image.</p>
    pub fn set_compute_type(mut self, input: ::std::option::Option<crate::types::ImageComputeType>) -> Self {
        self.inner = self.inner.set_compute_type(input);
        self
    }
    /// <p>The supported compute type for the WorkSpace image.</p>
    pub fn get_compute_type(&self) -> &::std::option::Option<crate::types::ImageComputeType> {
        self.inner.get_compute_type()
    }
    /// <p>The supported protocol for the WorkSpace image. Windows 11 does not support PCOIP protocol.</p>
    pub fn protocol(mut self, input: crate::types::CustomImageProtocol) -> Self {
        self.inner = self.inner.protocol(input);
        self
    }
    /// <p>The supported protocol for the WorkSpace image. Windows 11 does not support PCOIP protocol.</p>
    pub fn set_protocol(mut self, input: ::std::option::Option<crate::types::CustomImageProtocol>) -> Self {
        self.inner = self.inner.set_protocol(input);
        self
    }
    /// <p>The supported protocol for the WorkSpace image. Windows 11 does not support PCOIP protocol.</p>
    pub fn get_protocol(&self) -> &::std::option::Option<crate::types::CustomImageProtocol> {
        self.inner.get_protocol()
    }
    /// <p>The options for image import source.</p>
    pub fn image_source(mut self, input: crate::types::ImageSourceIdentifier) -> Self {
        self.inner = self.inner.image_source(input);
        self
    }
    /// <p>The options for image import source.</p>
    pub fn set_image_source(mut self, input: ::std::option::Option<crate::types::ImageSourceIdentifier>) -> Self {
        self.inner = self.inner.set_image_source(input);
        self
    }
    /// <p>The options for image import source.</p>
    pub fn get_image_source(&self) -> &::std::option::Option<crate::types::ImageSourceIdentifier> {
        self.inner.get_image_source()
    }
    /// <p>The infrastructure configuration ARN that specifies how the WorkSpace 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 infrastructure configuration ARN that specifies how the WorkSpace 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 infrastructure configuration ARN that specifies how the WorkSpace 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 platform for the WorkSpace image source.</p>
    pub fn platform(mut self, input: crate::types::Platform) -> Self {
        self.inner = self.inner.platform(input);
        self
    }
    /// <p>The platform for the WorkSpace image source.</p>
    pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
        self.inner = self.inner.set_platform(input);
        self
    }
    /// <p>The platform for the WorkSpace image source.</p>
    pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
        self.inner.get_platform()
    }
    /// <p>The OS version for the WorkSpace image source.</p>
    pub fn os_version(mut self, input: crate::types::OsVersion) -> Self {
        self.inner = self.inner.os_version(input);
        self
    }
    /// <p>The OS version for the WorkSpace image source.</p>
    pub fn set_os_version(mut self, input: ::std::option::Option<crate::types::OsVersion>) -> Self {
        self.inner = self.inner.set_os_version(input);
        self
    }
    /// <p>The OS version for the WorkSpace image source.</p>
    pub fn get_os_version(&self) -> &::std::option::Option<crate::types::OsVersion> {
        self.inner.get_os_version()
    }
    ///
    /// Appends an item to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The resource tags. Each WorkSpaces resource can have a maximum of 50 tags.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The resource tags. Each WorkSpaces resource can have a maximum of 50 tags.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>The resource tags. Each WorkSpaces resource can have a maximum of 50 tags.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
}