aws-sdk-mediaconnect 0.27.0

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

/// A request to add sources to the specified bridge.
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AddBridgeSourcesInput {
    /// The ARN of the bridge that you want to update.
    #[doc(hidden)]
    pub bridge_arn: std::option::Option<std::string::String>,
    /// The sources that you want to add to this bridge.
    #[doc(hidden)]
    pub sources: std::option::Option<std::vec::Vec<crate::types::AddBridgeSourceRequest>>,
}
impl AddBridgeSourcesInput {
    /// The ARN of the bridge that you want to update.
    pub fn bridge_arn(&self) -> std::option::Option<&str> {
        self.bridge_arn.as_deref()
    }
    /// The sources that you want to add to this bridge.
    pub fn sources(&self) -> std::option::Option<&[crate::types::AddBridgeSourceRequest]> {
        self.sources.as_deref()
    }
}
impl AddBridgeSourcesInput {
    /// Creates a new builder-style object to manufacture [`AddBridgeSourcesInput`](crate::operation::add_bridge_sources::AddBridgeSourcesInput).
    pub fn builder() -> crate::operation::add_bridge_sources::builders::AddBridgeSourcesInputBuilder
    {
        crate::operation::add_bridge_sources::builders::AddBridgeSourcesInputBuilder::default()
    }
}

/// A builder for [`AddBridgeSourcesInput`](crate::operation::add_bridge_sources::AddBridgeSourcesInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct AddBridgeSourcesInputBuilder {
    pub(crate) bridge_arn: std::option::Option<std::string::String>,
    pub(crate) sources: std::option::Option<std::vec::Vec<crate::types::AddBridgeSourceRequest>>,
}
impl AddBridgeSourcesInputBuilder {
    /// The ARN of the bridge that you want to update.
    pub fn bridge_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.bridge_arn = Some(input.into());
        self
    }
    /// The ARN of the bridge that you want to update.
    pub fn set_bridge_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.bridge_arn = input;
        self
    }
    /// Appends an item to `sources`.
    ///
    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
    ///
    /// The sources that you want to add to this bridge.
    pub fn sources(mut self, input: crate::types::AddBridgeSourceRequest) -> Self {
        let mut v = self.sources.unwrap_or_default();
        v.push(input);
        self.sources = Some(v);
        self
    }
    /// The sources that you want to add to this bridge.
    pub fn set_sources(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::AddBridgeSourceRequest>>,
    ) -> Self {
        self.sources = input;
        self
    }
    /// Consumes the builder and constructs a [`AddBridgeSourcesInput`](crate::operation::add_bridge_sources::AddBridgeSourcesInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::add_bridge_sources::AddBridgeSourcesInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::add_bridge_sources::AddBridgeSourcesInput {
                bridge_arn: self.bridge_arn,
                sources: self.sources,
            },
        )
    }
}