aws-sdk-mediaconnect 0.25.0

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

/// The settings for the source of the flow.
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Source {
    /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
    #[doc(hidden)]
    pub data_transfer_subscriber_fee_percent: i32,
    /// The type of encryption that is used on the content ingested from this source.
    #[doc(hidden)]
    pub decryption: std::option::Option<crate::types::Encryption>,
    /// A description for the source. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
    #[doc(hidden)]
    pub description: std::option::Option<std::string::String>,
    /// The ARN of the entitlement that allows you to subscribe to content that comes from another AWS account. The entitlement is set by the content originator and the ARN is generated as part of the originator's flow.
    #[doc(hidden)]
    pub entitlement_arn: std::option::Option<std::string::String>,
    /// The IP address that the flow will be listening on for incoming content.
    #[doc(hidden)]
    pub ingest_ip: std::option::Option<std::string::String>,
    /// The port that the flow will be listening on for incoming content.
    #[doc(hidden)]
    pub ingest_port: i32,
    /// The media streams that are associated with the source, and the parameters for those associations.
    #[doc(hidden)]
    pub media_stream_source_configurations:
        std::option::Option<std::vec::Vec<crate::types::MediaStreamSourceConfiguration>>,
    /// The name of the source.
    #[doc(hidden)]
    pub name: std::option::Option<std::string::String>,
    /// The port that the flow uses to send outbound requests to initiate connection with the sender.
    #[doc(hidden)]
    pub sender_control_port: i32,
    /// The IP address that the flow communicates with to initiate connection with the sender.
    #[doc(hidden)]
    pub sender_ip_address: std::option::Option<std::string::String>,
    /// The ARN of the source.
    #[doc(hidden)]
    pub source_arn: std::option::Option<std::string::String>,
    /// Attributes related to the transport stream that are used in the source.
    #[doc(hidden)]
    pub transport: std::option::Option<crate::types::Transport>,
    /// The name of the VPC interface that is used for this source.
    #[doc(hidden)]
    pub vpc_interface_name: std::option::Option<std::string::String>,
    /// The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
    #[doc(hidden)]
    pub whitelist_cidr: std::option::Option<std::string::String>,
}
impl Source {
    /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
    pub fn data_transfer_subscriber_fee_percent(&self) -> i32 {
        self.data_transfer_subscriber_fee_percent
    }
    /// The type of encryption that is used on the content ingested from this source.
    pub fn decryption(&self) -> std::option::Option<&crate::types::Encryption> {
        self.decryption.as_ref()
    }
    /// A description for the source. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
    pub fn description(&self) -> std::option::Option<&str> {
        self.description.as_deref()
    }
    /// The ARN of the entitlement that allows you to subscribe to content that comes from another AWS account. The entitlement is set by the content originator and the ARN is generated as part of the originator's flow.
    pub fn entitlement_arn(&self) -> std::option::Option<&str> {
        self.entitlement_arn.as_deref()
    }
    /// The IP address that the flow will be listening on for incoming content.
    pub fn ingest_ip(&self) -> std::option::Option<&str> {
        self.ingest_ip.as_deref()
    }
    /// The port that the flow will be listening on for incoming content.
    pub fn ingest_port(&self) -> i32 {
        self.ingest_port
    }
    /// The media streams that are associated with the source, and the parameters for those associations.
    pub fn media_stream_source_configurations(
        &self,
    ) -> std::option::Option<&[crate::types::MediaStreamSourceConfiguration]> {
        self.media_stream_source_configurations.as_deref()
    }
    /// The name of the source.
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The port that the flow uses to send outbound requests to initiate connection with the sender.
    pub fn sender_control_port(&self) -> i32 {
        self.sender_control_port
    }
    /// The IP address that the flow communicates with to initiate connection with the sender.
    pub fn sender_ip_address(&self) -> std::option::Option<&str> {
        self.sender_ip_address.as_deref()
    }
    /// The ARN of the source.
    pub fn source_arn(&self) -> std::option::Option<&str> {
        self.source_arn.as_deref()
    }
    /// Attributes related to the transport stream that are used in the source.
    pub fn transport(&self) -> std::option::Option<&crate::types::Transport> {
        self.transport.as_ref()
    }
    /// The name of the VPC interface that is used for this source.
    pub fn vpc_interface_name(&self) -> std::option::Option<&str> {
        self.vpc_interface_name.as_deref()
    }
    /// The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
    pub fn whitelist_cidr(&self) -> std::option::Option<&str> {
        self.whitelist_cidr.as_deref()
    }
}
impl Source {
    /// Creates a new builder-style object to manufacture [`Source`](crate::types::Source).
    pub fn builder() -> crate::types::builders::SourceBuilder {
        crate::types::builders::SourceBuilder::default()
    }
}

/// A builder for [`Source`](crate::types::Source).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct SourceBuilder {
    pub(crate) data_transfer_subscriber_fee_percent: std::option::Option<i32>,
    pub(crate) decryption: std::option::Option<crate::types::Encryption>,
    pub(crate) description: std::option::Option<std::string::String>,
    pub(crate) entitlement_arn: std::option::Option<std::string::String>,
    pub(crate) ingest_ip: std::option::Option<std::string::String>,
    pub(crate) ingest_port: std::option::Option<i32>,
    pub(crate) media_stream_source_configurations:
        std::option::Option<std::vec::Vec<crate::types::MediaStreamSourceConfiguration>>,
    pub(crate) name: std::option::Option<std::string::String>,
    pub(crate) sender_control_port: std::option::Option<i32>,
    pub(crate) sender_ip_address: std::option::Option<std::string::String>,
    pub(crate) source_arn: std::option::Option<std::string::String>,
    pub(crate) transport: std::option::Option<crate::types::Transport>,
    pub(crate) vpc_interface_name: std::option::Option<std::string::String>,
    pub(crate) whitelist_cidr: std::option::Option<std::string::String>,
}
impl SourceBuilder {
    /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
    pub fn data_transfer_subscriber_fee_percent(mut self, input: i32) -> Self {
        self.data_transfer_subscriber_fee_percent = Some(input);
        self
    }
    /// Percentage from 0-100 of the data transfer cost to be billed to the subscriber.
    pub fn set_data_transfer_subscriber_fee_percent(
        mut self,
        input: std::option::Option<i32>,
    ) -> Self {
        self.data_transfer_subscriber_fee_percent = input;
        self
    }
    /// The type of encryption that is used on the content ingested from this source.
    pub fn decryption(mut self, input: crate::types::Encryption) -> Self {
        self.decryption = Some(input);
        self
    }
    /// The type of encryption that is used on the content ingested from this source.
    pub fn set_decryption(mut self, input: std::option::Option<crate::types::Encryption>) -> Self {
        self.decryption = input;
        self
    }
    /// A description for the source. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
    pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
        self.description = Some(input.into());
        self
    }
    /// A description for the source. This value is not used or seen outside of the current AWS Elemental MediaConnect account.
    pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// The ARN of the entitlement that allows you to subscribe to content that comes from another AWS account. The entitlement is set by the content originator and the ARN is generated as part of the originator's flow.
    pub fn entitlement_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.entitlement_arn = Some(input.into());
        self
    }
    /// The ARN of the entitlement that allows you to subscribe to content that comes from another AWS account. The entitlement is set by the content originator and the ARN is generated as part of the originator's flow.
    pub fn set_entitlement_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.entitlement_arn = input;
        self
    }
    /// The IP address that the flow will be listening on for incoming content.
    pub fn ingest_ip(mut self, input: impl Into<std::string::String>) -> Self {
        self.ingest_ip = Some(input.into());
        self
    }
    /// The IP address that the flow will be listening on for incoming content.
    pub fn set_ingest_ip(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.ingest_ip = input;
        self
    }
    /// The port that the flow will be listening on for incoming content.
    pub fn ingest_port(mut self, input: i32) -> Self {
        self.ingest_port = Some(input);
        self
    }
    /// The port that the flow will be listening on for incoming content.
    pub fn set_ingest_port(mut self, input: std::option::Option<i32>) -> Self {
        self.ingest_port = input;
        self
    }
    /// Appends an item to `media_stream_source_configurations`.
    ///
    /// To override the contents of this collection use [`set_media_stream_source_configurations`](Self::set_media_stream_source_configurations).
    ///
    /// The media streams that are associated with the source, and the parameters for those associations.
    pub fn media_stream_source_configurations(
        mut self,
        input: crate::types::MediaStreamSourceConfiguration,
    ) -> Self {
        let mut v = self.media_stream_source_configurations.unwrap_or_default();
        v.push(input);
        self.media_stream_source_configurations = Some(v);
        self
    }
    /// The media streams that are associated with the source, and the parameters for those associations.
    pub fn set_media_stream_source_configurations(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::MediaStreamSourceConfiguration>>,
    ) -> Self {
        self.media_stream_source_configurations = input;
        self
    }
    /// The name of the source.
    pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
        self.name = Some(input.into());
        self
    }
    /// The name of the source.
    pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The port that the flow uses to send outbound requests to initiate connection with the sender.
    pub fn sender_control_port(mut self, input: i32) -> Self {
        self.sender_control_port = Some(input);
        self
    }
    /// The port that the flow uses to send outbound requests to initiate connection with the sender.
    pub fn set_sender_control_port(mut self, input: std::option::Option<i32>) -> Self {
        self.sender_control_port = input;
        self
    }
    /// The IP address that the flow communicates with to initiate connection with the sender.
    pub fn sender_ip_address(mut self, input: impl Into<std::string::String>) -> Self {
        self.sender_ip_address = Some(input.into());
        self
    }
    /// The IP address that the flow communicates with to initiate connection with the sender.
    pub fn set_sender_ip_address(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.sender_ip_address = input;
        self
    }
    /// The ARN of the source.
    pub fn source_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.source_arn = Some(input.into());
        self
    }
    /// The ARN of the source.
    pub fn set_source_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.source_arn = input;
        self
    }
    /// Attributes related to the transport stream that are used in the source.
    pub fn transport(mut self, input: crate::types::Transport) -> Self {
        self.transport = Some(input);
        self
    }
    /// Attributes related to the transport stream that are used in the source.
    pub fn set_transport(mut self, input: std::option::Option<crate::types::Transport>) -> Self {
        self.transport = input;
        self
    }
    /// The name of the VPC interface that is used for this source.
    pub fn vpc_interface_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.vpc_interface_name = Some(input.into());
        self
    }
    /// The name of the VPC interface that is used for this source.
    pub fn set_vpc_interface_name(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.vpc_interface_name = input;
        self
    }
    /// The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
    pub fn whitelist_cidr(mut self, input: impl Into<std::string::String>) -> Self {
        self.whitelist_cidr = Some(input.into());
        self
    }
    /// The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
    pub fn set_whitelist_cidr(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.whitelist_cidr = input;
        self
    }
    /// Consumes the builder and constructs a [`Source`](crate::types::Source).
    pub fn build(self) -> crate::types::Source {
        crate::types::Source {
            data_transfer_subscriber_fee_percent: self
                .data_transfer_subscriber_fee_percent
                .unwrap_or_default(),
            decryption: self.decryption,
            description: self.description,
            entitlement_arn: self.entitlement_arn,
            ingest_ip: self.ingest_ip,
            ingest_port: self.ingest_port.unwrap_or_default(),
            media_stream_source_configurations: self.media_stream_source_configurations,
            name: self.name,
            sender_control_port: self.sender_control_port.unwrap_or_default(),
            sender_ip_address: self.sender_ip_address,
            source_arn: self.source_arn,
            transport: self.transport,
            vpc_interface_name: self.vpc_interface_name,
            whitelist_cidr: self.whitelist_cidr,
        }
    }
}