aws-sdk-customerprofiles 1.119.0

AWS SDK for Amazon Connect Customer Profiles
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 CreateRecommenderOutput {
    /// <p>The ARN of the recommender</p>
    pub recommender_arn: ::std::string::String,
    /// <p>The tags used to organize, track, or control access for this resource.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl CreateRecommenderOutput {
    /// <p>The ARN of the recommender</p>
    pub fn recommender_arn(&self) -> &str {
        use std::ops::Deref;
        self.recommender_arn.deref()
    }
    /// <p>The tags used to organize, track, or control access for this resource.</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 CreateRecommenderOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateRecommenderOutput {
    /// Creates a new builder-style object to manufacture [`CreateRecommenderOutput`](crate::operation::create_recommender::CreateRecommenderOutput).
    pub fn builder() -> crate::operation::create_recommender::builders::CreateRecommenderOutputBuilder {
        crate::operation::create_recommender::builders::CreateRecommenderOutputBuilder::default()
    }
}

/// A builder for [`CreateRecommenderOutput`](crate::operation::create_recommender::CreateRecommenderOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateRecommenderOutputBuilder {
    pub(crate) recommender_arn: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl CreateRecommenderOutputBuilder {
    /// <p>The ARN of the recommender</p>
    /// This field is required.
    pub fn recommender_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.recommender_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the recommender</p>
    pub fn set_recommender_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.recommender_arn = input;
        self
    }
    /// <p>The ARN of the recommender</p>
    pub fn get_recommender_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.recommender_arn
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags used to organize, track, or control access for this resource.</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 tags used to organize, track, or control access for this resource.</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 tags used to organize, track, or control access for this resource.</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 [`CreateRecommenderOutput`](crate::operation::create_recommender::CreateRecommenderOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`recommender_arn`](crate::operation::create_recommender::builders::CreateRecommenderOutputBuilder::recommender_arn)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_recommender::CreateRecommenderOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_recommender::CreateRecommenderOutput {
            recommender_arn: self.recommender_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "recommender_arn",
                    "recommender_arn was not specified but it is required when building CreateRecommenderOutput",
                )
            })?,
            tags: self.tags,
            _request_id: self._request_id,
        })
    }
}