You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: config.rs
    path of file: ./repos/vector/src/sinks/prometheus/remote_write
    
    the code of the file until where you have to start completion: use http::Uri;
use snafu::prelude::*;

use crate::{
    http::HttpClient,
    sinks::{
        prelude::*,
        prometheus::PrometheusRemoteWriteAuth,
        util::{auth::Auth, http::http_response_retry_logic},
        UriParseSnafu,
    },
};

use super::{
    service::{build_request, RemoteWriteService},
    sink::{PrometheusRemoteWriteDefaultBatchSettings, RemoteWriteSink},
};

#[cfg(feature = "aws-core")]
use super::Errors;

/// The batch config for remote write.
#[configurable_component]
#[derive(Clone, Copy, Debug, Derivative)]
#[derivative(Default)]
pub struct RemoteWriteBatchConfig {
    #[configurable(derived)]
    #[serde(flatten)]
    pub batch_settings: BatchConfig<PrometheusRemoteWriteDefaultBatchSettings>,

    /// Whether or not to aggregate metrics within a batch.
    #[serde(default = "crate::serde::default_true")]
    #[derivative(Default(value = "true"))]
    pub aggregate: bool,
}

/// Configuration for the `prometheus_remote_write` sink.
#[configurable_component(sink(
    "prometheus_remote_write",
    "Deliver metric data to a Prometheus remote write endpoint."
))]
#[derive(Clone, Debug, Derivative)]
#[derivative(Default)]
#[serde(deny_unknown_fields)]
pub struct RemoteWriteConfig {
    /// The endpoint to send data to.
    ///
    /// The endpoint should include the scheme and the path to write to.
    #[configurable(metadata(docs::examples = "https://localhost:8087/api/v1/write"))]
    pub endpoint: String,

    /// The default namespace for any metrics sent.
    ///
    /// This namespace is only used if a metric has no existing namespace. When a namespace is
    /// present, it is used as a prefix to the metric name, and separated with an underscore (`_`).
    ///
    /// It should follow the Prometheus [naming conventions][prom_naming_docs].
    ///
    /// [prom_naming_docs]: https://prometheus.io/
    
    async fn build(&self, cx: SinkContext) -> crate::Result<(VectorSink, Healthcheck)> {
        let endpoint = self.endpoint.parse::<Uri>().context(UriParseSnafu)?;
        let tls_settings = TlsSettings::from_options(&self.tls)?;
        let request_settings = self.request.into_settings();
        let buckets = self.buckets.clone();
        let quantiles = self.quantiles.clone();
        let default_namespace = self.default_namespace.clone();

        let client = HttpClient::new(tls_settings, cx.proxy())?;

        let auth = match &self.auth {
            Some(PrometheusRemoteWriteAuth::Basic { user, password }) => {
                Some(Auth::Basic(crate::http::Auth::Basic {
                    user: user.clone(),
                    password: password.clone().into(),
                }))
            }
            Some(PrometheusRemoteWriteAuth::Bearer { token }) => {
                Some(Auth::Basic(crate::http::Auth::Bearer {
                    token: token.clone(),
                }))
            }
            #[cfg(feature = "aws-core")]
            Some(PrometheusRemoteWriteAuth::Aws(aws_auth)) => {
                let region = self
                    .aws
                    .as_ref()
                    .map(|config| config.region())
                    .ok_or(Errors::AwsRegionRequired)?
                    .ok_or(Errors::AwsRegionRequired)?;
                Some(Auth::Aws {
                    credentials_provider: aws_auth
                        .credentials_provider(region.clone(), cx.proxy(), &self.tls)
                        .await?,
                    region,
                })
            }
            None => None,
        };

        let healthcheck = healthcheck(
            client.clone(),
            endpoint.clone(),
            self.compression,
            auth.clone(),
        )
        .boxed();

        let service = RemoteWriteService {
            endpoint,
            client,
            auth,
            compression: self.compression,
        };
        let service = ServiceBuilder::new()
            .settings(request_settings, http_response_retry_logic())
            .service(service);

        let sink = RemoteWriteSink {
            tenant_id: self.tenant_id.clone(),
            compression: self.compression,
            aggregate: self.batch.aggregate,
            batch_settings: self
                .batch
                .batch_settings
                .validate()?
                .into_batcher_settings()?,
            buckets,
            quantiles,
            default_namespace,
            service,
        };

        Ok((VectorSink::from_event_streamsink(sink), healthcheck))
    }