aws-sdk-lightsail 1.105.0

AWS SDK for Amazon Lightsail
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::register_container_image::_register_container_image_input::RegisterContainerImageInputBuilder;

pub use crate::operation::register_container_image::_register_container_image_output::RegisterContainerImageOutputBuilder;

impl crate::operation::register_container_image::builders::RegisterContainerImageInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::register_container_image::RegisterContainerImageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::register_container_image::RegisterContainerImageError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.register_container_image();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `RegisterContainerImage`.
///
/// <p>Registers a container image to your Amazon Lightsail container service.</p><note>
/// <p>This action is not required if you install and use the Lightsail Control (lightsailctl) plugin to push container images to your Lightsail container service. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-pushing-container-images">Pushing and managing container images on your Amazon Lightsail container services</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct RegisterContainerImageFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::register_container_image::builders::RegisterContainerImageInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::register_container_image::RegisterContainerImageOutput,
        crate::operation::register_container_image::RegisterContainerImageError,
    > for RegisterContainerImageFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::register_container_image::RegisterContainerImageOutput,
            crate::operation::register_container_image::RegisterContainerImageError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl RegisterContainerImageFluentBuilder {
    /// Creates a new `RegisterContainerImageFluentBuilder`.
    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 RegisterContainerImage as a reference.
    pub fn as_input(&self) -> &crate::operation::register_container_image::builders::RegisterContainerImageInputBuilder {
        &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::register_container_image::RegisterContainerImageOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::register_container_image::RegisterContainerImageError,
            ::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::register_container_image::RegisterContainerImage::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::register_container_image::RegisterContainerImage::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::register_container_image::RegisterContainerImageOutput,
        crate::operation::register_container_image::RegisterContainerImageError,
        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 container service for which to register a container image.</p>
    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.service_name(input.into());
        self
    }
    /// <p>The name of the container service for which to register a container image.</p>
    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_service_name(input);
        self
    }
    /// <p>The name of the container service for which to register a container image.</p>
    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_service_name()
    }
    /// <p>The label for the container image when it's registered to the container service.</p>
    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
    /// <ul>
    /// <li>
    /// <p><code>:container-service-1.<imagelabel>
    /// .1
    /// </imagelabel></code></p></li>
    /// </ul>
    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.label(input.into());
        self
    }
    /// <p>The label for the container image when it's registered to the container service.</p>
    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
    /// <ul>
    /// <li>
    /// <p><code>:container-service-1.<imagelabel>
    /// .1
    /// </imagelabel></code></p></li>
    /// </ul>
    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
    pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_label(input);
        self
    }
    /// <p>The label for the container image when it's registered to the container service.</p>
    /// <p>Use a descriptive label that you can use to track the different versions of your registered container images.</p>
    /// <p>Use the <code>GetContainerImages</code> action to return the container images registered to a Lightsail container service. The label is the <code><imagelabel></imagelabel></code> portion of the following image name example:</p>
    /// <ul>
    /// <li>
    /// <p><code>:container-service-1.<imagelabel>
    /// .1
    /// </imagelabel></code></p></li>
    /// </ul>
    /// <p>If the name of your container service is <code>mycontainerservice</code>, and the label that you specify is <code>mystaticwebsite</code>, then the name of the registered container image will be <code>:mycontainerservice.mystaticwebsite.1</code>.</p>
    /// <p>The number at the end of these image name examples represents the version of the registered container image. If you push and register another container image to the same Lightsail container service, with the same label, then the version number for the new registered container image will be <code>2</code>. If you push and register another container image, the version number will be <code>3</code>, and so on.</p>
    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_label()
    }
    /// <p>The digest of the container image to be registered.</p>
    pub fn digest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.digest(input.into());
        self
    }
    /// <p>The digest of the container image to be registered.</p>
    pub fn set_digest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_digest(input);
        self
    }
    /// <p>The digest of the container image to be registered.</p>
    pub fn get_digest(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_digest()
    }
}