aws-sdk-personalize 1.104.0

AWS SDK for Amazon Personalize
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 CreateDatasetInput {
    /// <p>The name for the dataset.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
    pub schema_arn: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
    pub dataset_group_arn: ::std::option::Option<::std::string::String>,
    /// <p>The type of dataset.</p>
    /// <p>One of the following (case insensitive) values:</p>
    /// <ul>
    /// <li>
    /// <p>Interactions</p></li>
    /// <li>
    /// <p>Items</p></li>
    /// <li>
    /// <p>Users</p></li>
    /// <li>
    /// <p>Actions</p></li>
    /// <li>
    /// <p>Action_Interactions</p></li>
    /// </ul>
    pub dataset_type: ::std::option::Option<::std::string::String>,
    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateDatasetInput {
    /// <p>The name for the dataset.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
    pub fn schema_arn(&self) -> ::std::option::Option<&str> {
        self.schema_arn.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
    pub fn dataset_group_arn(&self) -> ::std::option::Option<&str> {
        self.dataset_group_arn.as_deref()
    }
    /// <p>The type of dataset.</p>
    /// <p>One of the following (case insensitive) values:</p>
    /// <ul>
    /// <li>
    /// <p>Interactions</p></li>
    /// <li>
    /// <p>Items</p></li>
    /// <li>
    /// <p>Users</p></li>
    /// <li>
    /// <p>Actions</p></li>
    /// <li>
    /// <p>Action_Interactions</p></li>
    /// </ul>
    pub fn dataset_type(&self) -> ::std::option::Option<&str> {
        self.dataset_type.as_deref()
    }
    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl CreateDatasetInput {
    /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
    pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
        crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
    }
}

/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDatasetInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) schema_arn: ::std::option::Option<::std::string::String>,
    pub(crate) dataset_group_arn: ::std::option::Option<::std::string::String>,
    pub(crate) dataset_type: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateDatasetInputBuilder {
    /// <p>The name for the dataset.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name for the dataset.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name for the dataset.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
    /// This field is required.
    pub fn schema_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.schema_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
    pub fn set_schema_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.schema_arn = input;
        self
    }
    /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
    pub fn get_schema_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.schema_arn
    }
    /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
    /// This field is required.
    pub fn dataset_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.dataset_group_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
    pub fn set_dataset_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.dataset_group_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
    pub fn get_dataset_group_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.dataset_group_arn
    }
    /// <p>The type of dataset.</p>
    /// <p>One of the following (case insensitive) values:</p>
    /// <ul>
    /// <li>
    /// <p>Interactions</p></li>
    /// <li>
    /// <p>Items</p></li>
    /// <li>
    /// <p>Users</p></li>
    /// <li>
    /// <p>Actions</p></li>
    /// <li>
    /// <p>Action_Interactions</p></li>
    /// </ul>
    /// This field is required.
    pub fn dataset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.dataset_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of dataset.</p>
    /// <p>One of the following (case insensitive) values:</p>
    /// <ul>
    /// <li>
    /// <p>Interactions</p></li>
    /// <li>
    /// <p>Items</p></li>
    /// <li>
    /// <p>Users</p></li>
    /// <li>
    /// <p>Actions</p></li>
    /// <li>
    /// <p>Action_Interactions</p></li>
    /// </ul>
    pub fn set_dataset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.dataset_type = input;
        self
    }
    /// <p>The type of dataset.</p>
    /// <p>One of the following (case insensitive) values:</p>
    /// <ul>
    /// <li>
    /// <p>Interactions</p></li>
    /// <li>
    /// <p>Items</p></li>
    /// <li>
    /// <p>Users</p></li>
    /// <li>
    /// <p>Actions</p></li>
    /// <li>
    /// <p>Action_Interactions</p></li>
    /// </ul>
    pub fn get_dataset_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.dataset_type
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
            name: self.name,
            schema_arn: self.schema_arn,
            dataset_group_arn: self.dataset_group_arn,
            dataset_type: self.dataset_type,
            tags: self.tags,
        })
    }
}