#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReplicaGlobalSecondaryIndex {
pub index_name: ::std::string::String,
pub provisioned_throughput_override: ::std::option::Option<crate::types::ProvisionedThroughputOverride>,
pub on_demand_throughput_override: ::std::option::Option<crate::types::OnDemandThroughputOverride>,
}
impl ReplicaGlobalSecondaryIndex {
pub fn index_name(&self) -> &str {
use std::ops::Deref;
self.index_name.deref()
}
pub fn provisioned_throughput_override(&self) -> ::std::option::Option<&crate::types::ProvisionedThroughputOverride> {
self.provisioned_throughput_override.as_ref()
}
pub fn on_demand_throughput_override(&self) -> ::std::option::Option<&crate::types::OnDemandThroughputOverride> {
self.on_demand_throughput_override.as_ref()
}
}
impl ReplicaGlobalSecondaryIndex {
pub fn builder() -> crate::types::builders::ReplicaGlobalSecondaryIndexBuilder {
crate::types::builders::ReplicaGlobalSecondaryIndexBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ReplicaGlobalSecondaryIndexBuilder {
pub(crate) index_name: ::std::option::Option<::std::string::String>,
pub(crate) provisioned_throughput_override: ::std::option::Option<crate::types::ProvisionedThroughputOverride>,
pub(crate) on_demand_throughput_override: ::std::option::Option<crate::types::OnDemandThroughputOverride>,
}
impl ReplicaGlobalSecondaryIndexBuilder {
pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.index_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.index_name = input;
self
}
pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
&self.index_name
}
pub fn provisioned_throughput_override(mut self, input: crate::types::ProvisionedThroughputOverride) -> Self {
self.provisioned_throughput_override = ::std::option::Option::Some(input);
self
}
pub fn set_provisioned_throughput_override(mut self, input: ::std::option::Option<crate::types::ProvisionedThroughputOverride>) -> Self {
self.provisioned_throughput_override = input;
self
}
pub fn get_provisioned_throughput_override(&self) -> &::std::option::Option<crate::types::ProvisionedThroughputOverride> {
&self.provisioned_throughput_override
}
pub fn on_demand_throughput_override(mut self, input: crate::types::OnDemandThroughputOverride) -> Self {
self.on_demand_throughput_override = ::std::option::Option::Some(input);
self
}
pub fn set_on_demand_throughput_override(mut self, input: ::std::option::Option<crate::types::OnDemandThroughputOverride>) -> Self {
self.on_demand_throughput_override = input;
self
}
pub fn get_on_demand_throughput_override(&self) -> &::std::option::Option<crate::types::OnDemandThroughputOverride> {
&self.on_demand_throughput_override
}
pub fn build(self) -> ::std::result::Result<crate::types::ReplicaGlobalSecondaryIndex, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::ReplicaGlobalSecondaryIndex {
index_name: self.index_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"index_name",
"index_name was not specified but it is required when building ReplicaGlobalSecondaryIndex",
)
})?,
provisioned_throughput_override: self.provisioned_throughput_override,
on_demand_throughput_override: self.on_demand_throughput_override,
})
}
}