#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AcceptDataGrantOutput {
pub name: ::std::string::String,
pub sender_principal: ::std::option::Option<::std::string::String>,
pub receiver_principal: ::std::string::String,
pub description: ::std::option::Option<::std::string::String>,
pub acceptance_state: crate::types::DataGrantAcceptanceState,
pub accepted_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub ends_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub grant_distribution_scope: crate::types::GrantDistributionScope,
pub data_set_id: ::std::string::String,
pub id: ::std::string::String,
pub arn: ::std::string::String,
pub created_at: ::aws_smithy_types::DateTime,
pub updated_at: ::aws_smithy_types::DateTime,
_request_id: Option<String>,
}
impl AcceptDataGrantOutput {
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn sender_principal(&self) -> ::std::option::Option<&str> {
self.sender_principal.as_deref()
}
pub fn receiver_principal(&self) -> &str {
use std::ops::Deref;
self.receiver_principal.deref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn acceptance_state(&self) -> &crate::types::DataGrantAcceptanceState {
&self.acceptance_state
}
pub fn accepted_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.accepted_at.as_ref()
}
pub fn ends_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.ends_at.as_ref()
}
pub fn grant_distribution_scope(&self) -> &crate::types::GrantDistributionScope {
&self.grant_distribution_scope
}
pub fn data_set_id(&self) -> &str {
use std::ops::Deref;
self.data_set_id.deref()
}
pub fn id(&self) -> &str {
use std::ops::Deref;
self.id.deref()
}
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
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 {
pub fn builder() -> crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder {
crate::operation::accept_data_grant::builders::AcceptDataGrantOutputBuilder::default()
}
}
#[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 {
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
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
}
pub fn set_sender_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.sender_principal = input;
self
}
pub fn get_sender_principal(&self) -> &::std::option::Option<::std::string::String> {
&self.sender_principal
}
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
}
pub fn set_receiver_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.receiver_principal = input;
self
}
pub fn get_receiver_principal(&self) -> &::std::option::Option<::std::string::String> {
&self.receiver_principal
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn acceptance_state(mut self, input: crate::types::DataGrantAcceptanceState) -> Self {
self.acceptance_state = ::std::option::Option::Some(input);
self
}
pub fn set_acceptance_state(mut self, input: ::std::option::Option<crate::types::DataGrantAcceptanceState>) -> Self {
self.acceptance_state = input;
self
}
pub fn get_acceptance_state(&self) -> &::std::option::Option<crate::types::DataGrantAcceptanceState> {
&self.acceptance_state
}
pub fn accepted_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.accepted_at = ::std::option::Option::Some(input);
self
}
pub fn set_accepted_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.accepted_at = input;
self
}
pub fn get_accepted_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.accepted_at
}
pub fn ends_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.ends_at = ::std::option::Option::Some(input);
self
}
pub fn set_ends_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.ends_at = input;
self
}
pub fn get_ends_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.ends_at
}
pub fn grant_distribution_scope(mut self, input: crate::types::GrantDistributionScope) -> Self {
self.grant_distribution_scope = ::std::option::Option::Some(input);
self
}
pub fn set_grant_distribution_scope(mut self, input: ::std::option::Option<crate::types::GrantDistributionScope>) -> Self {
self.grant_distribution_scope = input;
self
}
pub fn get_grant_distribution_scope(&self) -> &::std::option::Option<crate::types::GrantDistributionScope> {
&self.grant_distribution_scope
}
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
}
pub fn set_data_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.data_set_id = input;
self
}
pub fn get_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
&self.data_set_id
}
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
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
}
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,
})
}
}