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 GetRecommenderSchemaOutput {
    /// <p>The name of the recommender schema.</p>
    pub recommender_schema_name: ::std::string::String,
    /// <p>A map of dataset type to column definitions included in the schema.</p>
    pub fields: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::RecommenderSchemaField>>,
    /// <p>The timestamp of when the recommender schema was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The status of the recommender schema.</p>
    pub status: crate::types::RecommenderSchemaStatus,
    _request_id: Option<String>,
}
impl GetRecommenderSchemaOutput {
    /// <p>The name of the recommender schema.</p>
    pub fn recommender_schema_name(&self) -> &str {
        use std::ops::Deref;
        self.recommender_schema_name.deref()
    }
    /// <p>A map of dataset type to column definitions included in the schema.</p>
    pub fn fields(&self) -> &::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::RecommenderSchemaField>> {
        &self.fields
    }
    /// <p>The timestamp of when the recommender schema was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The status of the recommender schema.</p>
    pub fn status(&self) -> &crate::types::RecommenderSchemaStatus {
        &self.status
    }
}
impl ::aws_types::request_id::RequestId for GetRecommenderSchemaOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetRecommenderSchemaOutput {
    /// Creates a new builder-style object to manufacture [`GetRecommenderSchemaOutput`](crate::operation::get_recommender_schema::GetRecommenderSchemaOutput).
    pub fn builder() -> crate::operation::get_recommender_schema::builders::GetRecommenderSchemaOutputBuilder {
        crate::operation::get_recommender_schema::builders::GetRecommenderSchemaOutputBuilder::default()
    }
}

/// A builder for [`GetRecommenderSchemaOutput`](crate::operation::get_recommender_schema::GetRecommenderSchemaOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRecommenderSchemaOutputBuilder {
    pub(crate) recommender_schema_name: ::std::option::Option<::std::string::String>,
    pub(crate) fields:
        ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::RecommenderSchemaField>>>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) status: ::std::option::Option<crate::types::RecommenderSchemaStatus>,
    _request_id: Option<String>,
}
impl GetRecommenderSchemaOutputBuilder {
    /// <p>The name of the recommender schema.</p>
    /// This field is required.
    pub fn recommender_schema_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.recommender_schema_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the recommender schema.</p>
    pub fn set_recommender_schema_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.recommender_schema_name = input;
        self
    }
    /// <p>The name of the recommender schema.</p>
    pub fn get_recommender_schema_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.recommender_schema_name
    }
    /// Adds a key-value pair to `fields`.
    ///
    /// To override the contents of this collection use [`set_fields`](Self::set_fields).
    ///
    /// <p>A map of dataset type to column definitions included in the schema.</p>
    pub fn fields(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<crate::types::RecommenderSchemaField>) -> Self {
        let mut hash_map = self.fields.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.fields = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A map of dataset type to column definitions included in the schema.</p>
    pub fn set_fields(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::RecommenderSchemaField>>>,
    ) -> Self {
        self.fields = input;
        self
    }
    /// <p>A map of dataset type to column definitions included in the schema.</p>
    pub fn get_fields(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::RecommenderSchemaField>>> {
        &self.fields
    }
    /// <p>The timestamp of when the recommender schema was created.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of when the recommender schema was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The timestamp of when the recommender schema was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The status of the recommender schema.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::RecommenderSchemaStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the recommender schema.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RecommenderSchemaStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the recommender schema.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::RecommenderSchemaStatus> {
        &self.status
    }
    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 [`GetRecommenderSchemaOutput`](crate::operation::get_recommender_schema::GetRecommenderSchemaOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`recommender_schema_name`](crate::operation::get_recommender_schema::builders::GetRecommenderSchemaOutputBuilder::recommender_schema_name)
    /// - [`fields`](crate::operation::get_recommender_schema::builders::GetRecommenderSchemaOutputBuilder::fields)
    /// - [`created_at`](crate::operation::get_recommender_schema::builders::GetRecommenderSchemaOutputBuilder::created_at)
    /// - [`status`](crate::operation::get_recommender_schema::builders::GetRecommenderSchemaOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_recommender_schema::GetRecommenderSchemaOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_recommender_schema::GetRecommenderSchemaOutput {
            recommender_schema_name: self.recommender_schema_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "recommender_schema_name",
                    "recommender_schema_name was not specified but it is required when building GetRecommenderSchemaOutput",
                )
            })?,
            fields: self.fields.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "fields",
                    "fields was not specified but it is required when building GetRecommenderSchemaOutput",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetRecommenderSchemaOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetRecommenderSchemaOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}