aws-sdk-dataexchange 1.102.0

AWS SDK for AWS Data Exchange
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 CreateDataGrantInput {
    /// <p>The name of the data grant.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The distribution scope of the data grant.</p>
    pub grant_distribution_scope: ::std::option::Option<crate::types::GrantDistributionScope>,
    /// <p>The Amazon Web Services account ID of the data grant receiver.</p>
    pub receiver_principal: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the data set used to create the data grant.</p>
    pub source_data_set_id: ::std::option::Option<::std::string::String>,
    /// <p>The timestamp of when access to the associated data set ends.</p>
    pub ends_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The description of the data grant.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The tags to add to the data grant. A tag is a key-value pair.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateDataGrantInput {
    /// <p>The name of the data grant.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The distribution scope of the data grant.</p>
    pub fn grant_distribution_scope(&self) -> ::std::option::Option<&crate::types::GrantDistributionScope> {
        self.grant_distribution_scope.as_ref()
    }
    /// <p>The Amazon Web Services account ID of the data grant receiver.</p>
    pub fn receiver_principal(&self) -> ::std::option::Option<&str> {
        self.receiver_principal.as_deref()
    }
    /// <p>The ID of the data set used to create the data grant.</p>
    pub fn source_data_set_id(&self) -> ::std::option::Option<&str> {
        self.source_data_set_id.as_deref()
    }
    /// <p>The timestamp of when access to the associated data set ends.</p>
    pub fn ends_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.ends_at.as_ref()
    }
    /// <p>The description of the data grant.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The tags to add to the data grant. A tag is a key-value pair.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateDataGrantInput {
    /// Creates a new builder-style object to manufacture [`CreateDataGrantInput`](crate::operation::create_data_grant::CreateDataGrantInput).
    pub fn builder() -> crate::operation::create_data_grant::builders::CreateDataGrantInputBuilder {
        crate::operation::create_data_grant::builders::CreateDataGrantInputBuilder::default()
    }
}

/// A builder for [`CreateDataGrantInput`](crate::operation::create_data_grant::CreateDataGrantInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDataGrantInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) grant_distribution_scope: ::std::option::Option<crate::types::GrantDistributionScope>,
    pub(crate) receiver_principal: ::std::option::Option<::std::string::String>,
    pub(crate) source_data_set_id: ::std::option::Option<::std::string::String>,
    pub(crate) ends_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateDataGrantInputBuilder {
    /// <p>The name of the data grant.</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 of the data grant.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the data grant.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The distribution scope of the data grant.</p>
    /// This field is required.
    pub fn grant_distribution_scope(mut self, input: crate::types::GrantDistributionScope) -> Self {
        self.grant_distribution_scope = ::std::option::Option::Some(input);
        self
    }
    /// <p>The distribution scope of the data grant.</p>
    pub fn set_grant_distribution_scope(mut self, input: ::std::option::Option<crate::types::GrantDistributionScope>) -> Self {
        self.grant_distribution_scope = input;
        self
    }
    /// <p>The distribution scope of the data grant.</p>
    pub fn get_grant_distribution_scope(&self) -> &::std::option::Option<crate::types::GrantDistributionScope> {
        &self.grant_distribution_scope
    }
    /// <p>The Amazon Web Services account ID of the data grant receiver.</p>
    /// This field is required.
    pub fn receiver_principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.receiver_principal = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services account ID of the data grant receiver.</p>
    pub fn set_receiver_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.receiver_principal = input;
        self
    }
    /// <p>The Amazon Web Services account ID of the data grant receiver.</p>
    pub fn get_receiver_principal(&self) -> &::std::option::Option<::std::string::String> {
        &self.receiver_principal
    }
    /// <p>The ID of the data set used to create the data grant.</p>
    /// This field is required.
    pub fn source_data_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_data_set_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the data set used to create the data grant.</p>
    pub fn set_source_data_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_data_set_id = input;
        self
    }
    /// <p>The ID of the data set used to create the data grant.</p>
    pub fn get_source_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_data_set_id
    }
    /// <p>The timestamp of when access to the associated data set ends.</p>
    pub fn ends_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.ends_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of when access to the associated data set ends.</p>
    pub fn set_ends_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.ends_at = input;
        self
    }
    /// <p>The timestamp of when access to the associated data set ends.</p>
    pub fn get_ends_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.ends_at
    }
    /// <p>The description of the data grant.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the data grant.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the data grant.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to add to the data grant. A tag is a key-value pair.</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 to add to the data grant. A tag is a key-value pair.</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 to add to the data grant. A tag is a key-value pair.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateDataGrantInput`](crate::operation::create_data_grant::CreateDataGrantInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_data_grant::CreateDataGrantInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_data_grant::CreateDataGrantInput {
            name: self.name,
            grant_distribution_scope: self.grant_distribution_scope,
            receiver_principal: self.receiver_principal,
            source_data_set_id: self.source_data_set_id,
            ends_at: self.ends_at,
            description: self.description,
            tags: self.tags,
        })
    }
}