#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Entitlement {
#[doc(hidden)]
pub data_transfer_subscriber_fee_percent: i32,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub encryption: std::option::Option<crate::types::Encryption>,
#[doc(hidden)]
pub entitlement_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub entitlement_status: std::option::Option<crate::types::EntitlementStatus>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub subscribers: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Entitlement {
pub fn data_transfer_subscriber_fee_percent(&self) -> i32 {
self.data_transfer_subscriber_fee_percent
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn encryption(&self) -> std::option::Option<&crate::types::Encryption> {
self.encryption.as_ref()
}
pub fn entitlement_arn(&self) -> std::option::Option<&str> {
self.entitlement_arn.as_deref()
}
pub fn entitlement_status(&self) -> std::option::Option<&crate::types::EntitlementStatus> {
self.entitlement_status.as_ref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn subscribers(&self) -> std::option::Option<&[std::string::String]> {
self.subscribers.as_deref()
}
}
impl Entitlement {
pub fn builder() -> crate::types::builders::EntitlementBuilder {
crate::types::builders::EntitlementBuilder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct EntitlementBuilder {
pub(crate) data_transfer_subscriber_fee_percent: std::option::Option<i32>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) encryption: std::option::Option<crate::types::Encryption>,
pub(crate) entitlement_arn: std::option::Option<std::string::String>,
pub(crate) entitlement_status: std::option::Option<crate::types::EntitlementStatus>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) subscribers: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl EntitlementBuilder {
pub fn data_transfer_subscriber_fee_percent(mut self, input: i32) -> Self {
self.data_transfer_subscriber_fee_percent = Some(input);
self
}
pub fn set_data_transfer_subscriber_fee_percent(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.data_transfer_subscriber_fee_percent = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn encryption(mut self, input: crate::types::Encryption) -> Self {
self.encryption = Some(input);
self
}
pub fn set_encryption(mut self, input: std::option::Option<crate::types::Encryption>) -> Self {
self.encryption = input;
self
}
pub fn entitlement_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.entitlement_arn = Some(input.into());
self
}
pub fn set_entitlement_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.entitlement_arn = input;
self
}
pub fn entitlement_status(mut self, input: crate::types::EntitlementStatus) -> Self {
self.entitlement_status = Some(input);
self
}
pub fn set_entitlement_status(
mut self,
input: std::option::Option<crate::types::EntitlementStatus>,
) -> Self {
self.entitlement_status = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn subscribers(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.subscribers.unwrap_or_default();
v.push(input.into());
self.subscribers = Some(v);
self
}
pub fn set_subscribers(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.subscribers = input;
self
}
pub fn build(self) -> crate::types::Entitlement {
crate::types::Entitlement {
data_transfer_subscriber_fee_percent: self
.data_transfer_subscriber_fee_percent
.unwrap_or_default(),
description: self.description,
encryption: self.encryption,
entitlement_arn: self.entitlement_arn,
entitlement_status: self.entitlement_status,
name: self.name,
subscribers: self.subscribers,
}
}
}