aws-sdk-location 0.26.0

AWS SDK for Amazon Location Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_map_style_descriptor::_get_map_style_descriptor_output::GetMapStyleDescriptorOutputBuilder;

pub use crate::operation::get_map_style_descriptor::_get_map_style_descriptor_input::GetMapStyleDescriptorInputBuilder;

/// Fluent builder constructing a request to `GetMapStyleDescriptor`.
///
/// <p>Retrieves the map style descriptor from a map resource. </p>
/// <p>The style descriptor contains specifications on how features render on a map. For example, what data to display, what order to display the data in, and the style for the data. Style descriptors follow the Mapbox Style Specification.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct GetMapStyleDescriptorFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_map_style_descriptor::builders::GetMapStyleDescriptorInputBuilder,
}
impl GetMapStyleDescriptorFluentBuilder {
    /// Creates a new `GetMapStyleDescriptor`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }

    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::get_map_style_descriptor::GetMapStyleDescriptor,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::get_map_style_descriptor::GetMapStyleDescriptorError,
        >,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// 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::get_map_style_descriptor::GetMapStyleDescriptorOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::get_map_style_descriptor::GetMapStyleDescriptorError,
        >,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <p>The map resource to retrieve the style descriptor from.</p>
    pub fn map_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.map_name(input.into());
        self
    }
    /// <p>The map resource to retrieve the style descriptor from.</p>
    pub fn set_map_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_map_name(input);
        self
    }
    /// <p>The optional <a href="https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
    pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.key(input.into());
        self
    }
    /// <p>The optional <a href="https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
    pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_key(input);
        self
    }
}