aws-sdk-amp 1.110.0

AWS SDK for Amazon Prometheus Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateScraperOutput {
    /// <p>The ID of the updated scraper.</p>
    pub scraper_id: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
    pub arn: ::std::string::String,
    /// <p>A structure that displays the current status of the scraper.</p>
    pub status: ::std::option::Option<crate::types::ScraperStatus>,
    /// <p>The list of tag keys and values that are associated with the scraper.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl UpdateScraperOutput {
    /// <p>The ID of the updated scraper.</p>
    pub fn scraper_id(&self) -> &str {
        use std::ops::Deref;
        self.scraper_id.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>A structure that displays the current status of the scraper.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::ScraperStatus> {
        self.status.as_ref()
    }
    /// <p>The list of tag keys and values that are associated with the scraper.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateScraperOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateScraperOutput {
    /// Creates a new builder-style object to manufacture [`UpdateScraperOutput`](crate::operation::update_scraper::UpdateScraperOutput).
    pub fn builder() -> crate::operation::update_scraper::builders::UpdateScraperOutputBuilder {
        crate::operation::update_scraper::builders::UpdateScraperOutputBuilder::default()
    }
}

/// A builder for [`UpdateScraperOutput`](crate::operation::update_scraper::UpdateScraperOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateScraperOutputBuilder {
    pub(crate) scraper_id: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ScraperStatus>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl UpdateScraperOutputBuilder {
    /// <p>The ID of the updated scraper.</p>
    /// This field is required.
    pub fn scraper_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.scraper_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the updated scraper.</p>
    pub fn set_scraper_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.scraper_id = input;
        self
    }
    /// <p>The ID of the updated scraper.</p>
    pub fn get_scraper_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.scraper_id
    }
    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the updated scraper.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>A structure that displays the current status of the scraper.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ScraperStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>A structure that displays the current status of the scraper.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ScraperStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>A structure that displays the current status of the scraper.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ScraperStatus> {
        &self.status
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The list of tag keys and values that are associated with the scraper.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The list of tag keys and values that are associated with the scraper.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The list of tag keys and values that are associated with the scraper.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`UpdateScraperOutput`](crate::operation::update_scraper::UpdateScraperOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`scraper_id`](crate::operation::update_scraper::builders::UpdateScraperOutputBuilder::scraper_id)
    /// - [`arn`](crate::operation::update_scraper::builders::UpdateScraperOutputBuilder::arn)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_scraper::UpdateScraperOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_scraper::UpdateScraperOutput {
            scraper_id: self.scraper_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "scraper_id",
                    "scraper_id was not specified but it is required when building UpdateScraperOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building UpdateScraperOutput",
                )
            })?,
            status: self.status,
            tags: self.tags,
            _request_id: self._request_id,
        })
    }
}