aws-sdk-mediaconnect 1.80.0

AWS SDK for AWS MediaConnect
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The settings for a flow entitlement.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Entitlement {
    /// <p>Percentage from 0-100 of the data transfer cost to be billed to the subscriber.</p>
    pub data_transfer_subscriber_fee_percent: ::std::option::Option<i32>,
    /// <p>A description of the entitlement.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The type of encryption that will be used on the output that is associated with this entitlement.</p>
    pub encryption: ::std::option::Option<crate::types::Encryption>,
    /// <p>The ARN of the entitlement.</p>
    pub entitlement_arn: ::std::option::Option<::std::string::String>,
    /// <p>An indication of whether the entitlement is enabled.</p>
    pub entitlement_status: ::std::option::Option<crate::types::EntitlementStatus>,
    /// <p>The name of the entitlement.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Web Services account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flow using your content as the source.</p>
    pub subscribers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Entitlement {
    /// <p>Percentage from 0-100 of the data transfer cost to be billed to the subscriber.</p>
    pub fn data_transfer_subscriber_fee_percent(&self) -> ::std::option::Option<i32> {
        self.data_transfer_subscriber_fee_percent
    }
    /// <p>A description of the entitlement.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The type of encryption that will be used on the output that is associated with this entitlement.</p>
    pub fn encryption(&self) -> ::std::option::Option<&crate::types::Encryption> {
        self.encryption.as_ref()
    }
    /// <p>The ARN of the entitlement.</p>
    pub fn entitlement_arn(&self) -> ::std::option::Option<&str> {
        self.entitlement_arn.as_deref()
    }
    /// <p>An indication of whether the entitlement is enabled.</p>
    pub fn entitlement_status(&self) -> ::std::option::Option<&crate::types::EntitlementStatus> {
        self.entitlement_status.as_ref()
    }
    /// <p>The name of the entitlement.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The Amazon Web Services account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flow using your content as the source.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subscribers.is_none()`.
    pub fn subscribers(&self) -> &[::std::string::String] {
        self.subscribers.as_deref().unwrap_or_default()
    }
}
impl Entitlement {
    /// Creates a new builder-style object to manufacture [`Entitlement`](crate::types::Entitlement).
    pub fn builder() -> crate::types::builders::EntitlementBuilder {
        crate::types::builders::EntitlementBuilder::default()
    }
}

/// A builder for [`Entitlement`](crate::types::Entitlement).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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 {
    /// <p>Percentage from 0-100 of the data transfer cost to be billed to the subscriber.</p>
    pub fn data_transfer_subscriber_fee_percent(mut self, input: i32) -> Self {
        self.data_transfer_subscriber_fee_percent = ::std::option::Option::Some(input);
        self
    }
    /// <p>Percentage from 0-100 of the data transfer cost to be billed to the subscriber.</p>
    pub fn set_data_transfer_subscriber_fee_percent(mut self, input: ::std::option::Option<i32>) -> Self {
        self.data_transfer_subscriber_fee_percent = input;
        self
    }
    /// <p>Percentage from 0-100 of the data transfer cost to be billed to the subscriber.</p>
    pub fn get_data_transfer_subscriber_fee_percent(&self) -> &::std::option::Option<i32> {
        &self.data_transfer_subscriber_fee_percent
    }
    /// <p>A description of the entitlement.</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>A description of the entitlement.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the entitlement.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The type of encryption that will be used on the output that is associated with this entitlement.</p>
    pub fn encryption(mut self, input: crate::types::Encryption) -> Self {
        self.encryption = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of encryption that will be used on the output that is associated with this entitlement.</p>
    pub fn set_encryption(mut self, input: ::std::option::Option<crate::types::Encryption>) -> Self {
        self.encryption = input;
        self
    }
    /// <p>The type of encryption that will be used on the output that is associated with this entitlement.</p>
    pub fn get_encryption(&self) -> &::std::option::Option<crate::types::Encryption> {
        &self.encryption
    }
    /// <p>The ARN of the entitlement.</p>
    /// This field is required.
    pub fn entitlement_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.entitlement_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the entitlement.</p>
    pub fn set_entitlement_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.entitlement_arn = input;
        self
    }
    /// <p>The ARN of the entitlement.</p>
    pub fn get_entitlement_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.entitlement_arn
    }
    /// <p>An indication of whether the entitlement is enabled.</p>
    pub fn entitlement_status(mut self, input: crate::types::EntitlementStatus) -> Self {
        self.entitlement_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>An indication of whether the entitlement is enabled.</p>
    pub fn set_entitlement_status(mut self, input: ::std::option::Option<crate::types::EntitlementStatus>) -> Self {
        self.entitlement_status = input;
        self
    }
    /// <p>An indication of whether the entitlement is enabled.</p>
    pub fn get_entitlement_status(&self) -> &::std::option::Option<crate::types::EntitlementStatus> {
        &self.entitlement_status
    }
    /// <p>The name of the entitlement.</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 entitlement.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the entitlement.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `subscribers`.
    ///
    /// To override the contents of this collection use [`set_subscribers`](Self::set_subscribers).
    ///
    /// <p>The Amazon Web Services account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flow using your content as the source.</p>
    pub fn subscribers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.subscribers.unwrap_or_default();
        v.push(input.into());
        self.subscribers = ::std::option::Option::Some(v);
        self
    }
    /// <p>The Amazon Web Services account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flow using your content as the source.</p>
    pub fn set_subscribers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.subscribers = input;
        self
    }
    /// <p>The Amazon Web Services account IDs that you want to share your content with. The receiving accounts (subscribers) will be allowed to create their own flow using your content as the source.</p>
    pub fn get_subscribers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.subscribers
    }
    /// Consumes the builder and constructs a [`Entitlement`](crate::types::Entitlement).
    pub fn build(self) -> crate::types::Entitlement {
        crate::types::Entitlement {
            data_transfer_subscriber_fee_percent: self.data_transfer_subscriber_fee_percent,
            description: self.description,
            encryption: self.encryption,
            entitlement_arn: self.entitlement_arn,
            entitlement_status: self.entitlement_status,
            name: self.name,
            subscribers: self.subscribers,
        }
    }
}