aws-sdk-licensemanager 1.95.0

AWS SDK for AWS License Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::checkout_borrow_license::_checkout_borrow_license_output::CheckoutBorrowLicenseOutputBuilder;

pub use crate::operation::checkout_borrow_license::_checkout_borrow_license_input::CheckoutBorrowLicenseInputBuilder;

impl crate::operation::checkout_borrow_license::builders::CheckoutBorrowLicenseInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::checkout_borrow_license::CheckoutBorrowLicenseOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::checkout_borrow_license::CheckoutBorrowLicenseError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.checkout_borrow_license();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CheckoutBorrowLicense`.
///
/// <p>Checks out the specified license for offline use.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CheckoutBorrowLicenseFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::checkout_borrow_license::builders::CheckoutBorrowLicenseInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::checkout_borrow_license::CheckoutBorrowLicenseOutput,
        crate::operation::checkout_borrow_license::CheckoutBorrowLicenseError,
    > for CheckoutBorrowLicenseFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::checkout_borrow_license::CheckoutBorrowLicenseOutput,
            crate::operation::checkout_borrow_license::CheckoutBorrowLicenseError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CheckoutBorrowLicenseFluentBuilder {
    /// Creates a new `CheckoutBorrowLicenseFluentBuilder`.
    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 CheckoutBorrowLicense as a reference.
    pub fn as_input(&self) -> &crate::operation::checkout_borrow_license::builders::CheckoutBorrowLicenseInputBuilder {
        &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::checkout_borrow_license::CheckoutBorrowLicenseOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::checkout_borrow_license::CheckoutBorrowLicenseError,
            ::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::checkout_borrow_license::CheckoutBorrowLicense::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::checkout_borrow_license::CheckoutBorrowLicense::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::checkout_borrow_license::CheckoutBorrowLicenseOutput,
        crate::operation::checkout_borrow_license::CheckoutBorrowLicenseError,
        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>Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration.</p>
    pub fn license_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.license_arn(input.into());
        self
    }
    /// <p>Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration.</p>
    pub fn set_license_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_license_arn(input);
        self
    }
    /// <p>Amazon Resource Name (ARN) of the license. The license must use the borrow consumption configuration.</p>
    pub fn get_license_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_license_arn()
    }
    ///
    /// Appends an item to `Entitlements`.
    ///
    /// To override the contents of this collection use [`set_entitlements`](Self::set_entitlements).
    ///
    /// <p>License entitlements. Partial checkouts are not supported.</p>
    pub fn entitlements(mut self, input: crate::types::EntitlementData) -> Self {
        self.inner = self.inner.entitlements(input);
        self
    }
    /// <p>License entitlements. Partial checkouts are not supported.</p>
    pub fn set_entitlements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>>) -> Self {
        self.inner = self.inner.set_entitlements(input);
        self
    }
    /// <p>License entitlements. Partial checkouts are not supported.</p>
    pub fn get_entitlements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>> {
        self.inner.get_entitlements()
    }
    /// <p>Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, see <a href="https://tools.ietf.org/html/rfc7518#section-3.5">RFC 7518 Digital Signature with RSASSA-PSS</a>.</p>
    pub fn digital_signature_method(mut self, input: crate::types::DigitalSignatureMethod) -> Self {
        self.inner = self.inner.digital_signature_method(input);
        self
    }
    /// <p>Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, see <a href="https://tools.ietf.org/html/rfc7518#section-3.5">RFC 7518 Digital Signature with RSASSA-PSS</a>.</p>
    pub fn set_digital_signature_method(mut self, input: ::std::option::Option<crate::types::DigitalSignatureMethod>) -> Self {
        self.inner = self.inner.set_digital_signature_method(input);
        self
    }
    /// <p>Digital signature method. The possible value is JSON Web Signature (JWS) algorithm PS384. For more information, see <a href="https://tools.ietf.org/html/rfc7518#section-3.5">RFC 7518 Digital Signature with RSASSA-PSS</a>.</p>
    pub fn get_digital_signature_method(&self) -> &::std::option::Option<crate::types::DigitalSignatureMethod> {
        self.inner.get_digital_signature_method()
    }
    /// <p>Node ID.</p>
    pub fn node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.node_id(input.into());
        self
    }
    /// <p>Node ID.</p>
    pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_node_id(input);
        self
    }
    /// <p>Node ID.</p>
    pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_node_id()
    }
    ///
    /// Appends an item to `CheckoutMetadata`.
    ///
    /// To override the contents of this collection use [`set_checkout_metadata`](Self::set_checkout_metadata).
    ///
    /// <p>Information about constraints.</p>
    pub fn checkout_metadata(mut self, input: crate::types::Metadata) -> Self {
        self.inner = self.inner.checkout_metadata(input);
        self
    }
    /// <p>Information about constraints.</p>
    pub fn set_checkout_metadata(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>) -> Self {
        self.inner = self.inner.set_checkout_metadata(input);
        self
    }
    /// <p>Information about constraints.</p>
    pub fn get_checkout_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Metadata>> {
        self.inner.get_checkout_metadata()
    }
    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</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 that you provide to ensure the idempotency of the request.</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 that you provide to ensure the idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
}