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 AcceptDataGrantOutput {
    /// <p>The name of the accepted data grant.</p>
    pub name: ::std::string::String,
    /// <p>The Amazon Web Services account ID of the data grant sender.</p>
    pub sender_principal: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Web Services account ID of the data grant receiver.</p>
    pub receiver_principal: ::std::string::String,
    /// <p>The description of the accepted data grant.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The acceptance state of the data grant.</p>
    pub acceptance_state: crate::types::DataGrantAcceptanceState,
    /// <p>The timestamp of when the data grant was accepted.</p>
    pub accepted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <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 distribution scope for the data grant.</p>
    pub grant_distribution_scope: crate::types::GrantDistributionScope,
    /// <p>The ID of the data set associated to the data grant.</p>
    pub data_set_id: ::std::string::String,
    /// <p>The ID of the data grant.</p>
    pub id: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the accepted data grant.</p>
    pub arn: ::std::string::String,
    /// <p>The timestamp of when the data grant was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The timestamp of when the data grant was last updated.</p>
    pub updated_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl AcceptDataGrantOutput {
    /// <p>The name of the accepted data grant.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The Amazon Web Services account ID of the data grant sender.</p>
    pub fn sender_principal(&self) -> ::std::option::Option<&str> {
        self.sender_principal.as_deref()
    }
    /// <p>The Amazon Web Services account ID of the data grant receiver.</p>
    pub fn receiver_principal(&self) -> &str {
        use std::ops::Deref;
        self.receiver_principal.deref()
    }
    /// <p>The description of the accepted data grant.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The acceptance state of the data grant.</p>
    pub fn acceptance_state(&self) -> &crate::types::DataGrantAcceptanceState {
        &self.acceptance_state
    }
    /// <p>The timestamp of when the data grant was accepted.</p>
    pub fn accepted_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.accepted_at.as_ref()
    }
    /// <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 distribution scope for the data grant.</p>
    pub fn grant_distribution_scope(&self) -> &crate::types::GrantDistributionScope {
        &self.grant_distribution_scope
    }
    /// <p>The ID of the data set associated to the data grant.</p>
    pub fn data_set_id(&self) -> &str {
        use std::ops::Deref;
        self.data_set_id.deref()
    }
    /// <p>The ID of the data grant.</p>
    pub fn id(&self) -> &str {
        use std::ops::Deref;
        self.id.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the accepted data grant.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The timestamp of when the data grant was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The timestamp of when the data grant was last updated.</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
}
impl ::aws_types::request_id::RequestId for AcceptDataGrantOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl AcceptDataGrantOutput {
    /// Creates a new builder-style object to manufacture [`AcceptDataGrantOutput`](crate::operation::accept_data_grant::AcceptDataGrantOutput).
    pub fn builder() -> crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder {
        crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::default()
    }
}

/// A builder for [`AcceptDataGrantOutput`](crate::operation::accept_data_grant::AcceptDataGrantOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AcceptDataGrantOutputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) sender_principal: ::std::option::Option<::std::string::String>,
    pub(crate) receiver_principal: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) acceptance_state: ::std::option::Option<crate::types::DataGrantAcceptanceState>,
    pub(crate) accepted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) ends_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) grant_distribution_scope: ::std::option::Option<crate::types::GrantDistributionScope>,
    pub(crate) data_set_id: ::std::option::Option<::std::string::String>,
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl AcceptDataGrantOutputBuilder {
    /// <p>The name of the accepted 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 accepted 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 accepted data grant.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The Amazon Web Services account ID of the data grant sender.</p>
    pub fn sender_principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.sender_principal = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services account ID of the data grant sender.</p>
    pub fn set_sender_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.sender_principal = input;
        self
    }
    /// <p>The Amazon Web Services account ID of the data grant sender.</p>
    pub fn get_sender_principal(&self) -> &::std::option::Option<::std::string::String> {
        &self.sender_principal
    }
    /// <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 description of the accepted 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 accepted 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 accepted data grant.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The acceptance state of the data grant.</p>
    /// This field is required.
    pub fn acceptance_state(mut self, input: crate::types::DataGrantAcceptanceState) -> Self {
        self.acceptance_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The acceptance state of the data grant.</p>
    pub fn set_acceptance_state(mut self, input: ::std::option::Option<crate::types::DataGrantAcceptanceState>) -> Self {
        self.acceptance_state = input;
        self
    }
    /// <p>The acceptance state of the data grant.</p>
    pub fn get_acceptance_state(&self) -> &::std::option::Option<crate::types::DataGrantAcceptanceState> {
        &self.acceptance_state
    }
    /// <p>The timestamp of when the data grant was accepted.</p>
    pub fn accepted_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.accepted_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of when the data grant was accepted.</p>
    pub fn set_accepted_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.accepted_at = input;
        self
    }
    /// <p>The timestamp of when the data grant was accepted.</p>
    pub fn get_accepted_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.accepted_at
    }
    /// <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 distribution scope for 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 for 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 for the data grant.</p>
    pub fn get_grant_distribution_scope(&self) -> &::std::option::Option<crate::types::GrantDistributionScope> {
        &self.grant_distribution_scope
    }
    /// <p>The ID of the data set associated to the data grant.</p>
    /// This field is required.
    pub fn data_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.data_set_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the data set associated to the data grant.</p>
    pub fn set_data_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.data_set_id = input;
        self
    }
    /// <p>The ID of the data set associated to the data grant.</p>
    pub fn get_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.data_set_id
    }
    /// <p>The ID of the data grant.</p>
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the data grant.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The ID of the data grant.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The Amazon Resource Name (ARN) of the accepted data grant.</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 accepted data grant.</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 accepted data grant.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The timestamp of when the data grant 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 data grant 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 data grant was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The timestamp of when the data grant was last updated.</p>
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of when the data grant was last updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The timestamp of when the data grant was last updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    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 [`AcceptDataGrantOutput`](crate::operation::accept_data_grant::AcceptDataGrantOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::name)
    /// - [`receiver_principal`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::receiver_principal)
    /// - [`acceptance_state`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::acceptance_state)
    /// - [`grant_distribution_scope`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::grant_distribution_scope)
    /// - [`data_set_id`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::data_set_id)
    /// - [`id`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::id)
    /// - [`arn`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::arn)
    /// - [`created_at`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::updated_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::accept_data_grant::AcceptDataGrantOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::accept_data_grant::AcceptDataGrantOutput {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building AcceptDataGrantOutput",
                )
            })?,
            sender_principal: self.sender_principal,
            receiver_principal: self.receiver_principal.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "receiver_principal",
                    "receiver_principal was not specified but it is required when building AcceptDataGrantOutput",
                )
            })?,
            description: self.description,
            acceptance_state: self.acceptance_state.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "acceptance_state",
                    "acceptance_state was not specified but it is required when building AcceptDataGrantOutput",
                )
            })?,
            accepted_at: self.accepted_at,
            ends_at: self.ends_at,
            grant_distribution_scope: self.grant_distribution_scope.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "grant_distribution_scope",
                    "grant_distribution_scope was not specified but it is required when building AcceptDataGrantOutput",
                )
            })?,
            data_set_id: self.data_set_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "data_set_id",
                    "data_set_id was not specified but it is required when building AcceptDataGrantOutput",
                )
            })?,
            id: self.id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "id",
                    "id was not specified but it is required when building AcceptDataGrantOutput",
                )
            })?,
            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 AcceptDataGrantOutput",
                )
            })?,
            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 AcceptDataGrantOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building AcceptDataGrantOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}