aws-sdk-mediaconnect 1.31.0

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

/// A Bridge is the connection between your datacenter's Instances and the AWS cloud. A bridge can be used to send video from the AWS cloud to your datacenter or from your datacenter to the AWS cloud.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Bridge {
    /// The Amazon Resource Number (ARN) of the bridge.
    pub bridge_arn: ::std::option::Option<::std::string::String>,
    #[allow(missing_docs)] // documentation missing in model
    pub bridge_messages: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>,
    #[allow(missing_docs)] // documentation missing in model
    pub bridge_state: ::std::option::Option<crate::types::BridgeState>,
    #[allow(missing_docs)] // documentation missing in model
    pub egress_gateway_bridge: ::std::option::Option<crate::types::EgressGatewayBridge>,
    #[allow(missing_docs)] // documentation missing in model
    pub ingress_gateway_bridge: ::std::option::Option<crate::types::IngressGatewayBridge>,
    /// The name of the bridge.
    pub name: ::std::option::Option<::std::string::String>,
    /// The outputs on this bridge.
    pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::BridgeOutput>>,
    /// The placement Amazon Resource Number (ARN) of the bridge.
    pub placement_arn: ::std::option::Option<::std::string::String>,
    /// The settings for source failover.
    pub source_failover_config: ::std::option::Option<crate::types::FailoverConfig>,
    /// The sources on this bridge.
    pub sources: ::std::option::Option<::std::vec::Vec<crate::types::BridgeSource>>,
}
impl Bridge {
    /// The Amazon Resource Number (ARN) of the bridge.
    pub fn bridge_arn(&self) -> ::std::option::Option<&str> {
        self.bridge_arn.as_deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.bridge_messages.is_none()`.
    pub fn bridge_messages(&self) -> &[crate::types::MessageDetail] {
        self.bridge_messages.as_deref().unwrap_or_default()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn bridge_state(&self) -> ::std::option::Option<&crate::types::BridgeState> {
        self.bridge_state.as_ref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn egress_gateway_bridge(&self) -> ::std::option::Option<&crate::types::EgressGatewayBridge> {
        self.egress_gateway_bridge.as_ref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn ingress_gateway_bridge(&self) -> ::std::option::Option<&crate::types::IngressGatewayBridge> {
        self.ingress_gateway_bridge.as_ref()
    }
    /// The name of the bridge.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The outputs on this bridge.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.outputs.is_none()`.
    pub fn outputs(&self) -> &[crate::types::BridgeOutput] {
        self.outputs.as_deref().unwrap_or_default()
    }
    /// The placement Amazon Resource Number (ARN) of the bridge.
    pub fn placement_arn(&self) -> ::std::option::Option<&str> {
        self.placement_arn.as_deref()
    }
    /// The settings for source failover.
    pub fn source_failover_config(&self) -> ::std::option::Option<&crate::types::FailoverConfig> {
        self.source_failover_config.as_ref()
    }
    /// The sources on this bridge.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sources.is_none()`.
    pub fn sources(&self) -> &[crate::types::BridgeSource] {
        self.sources.as_deref().unwrap_or_default()
    }
}
impl Bridge {
    /// Creates a new builder-style object to manufacture [`Bridge`](crate::types::Bridge).
    pub fn builder() -> crate::types::builders::BridgeBuilder {
        crate::types::builders::BridgeBuilder::default()
    }
}

/// A builder for [`Bridge`](crate::types::Bridge).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct BridgeBuilder {
    pub(crate) bridge_arn: ::std::option::Option<::std::string::String>,
    pub(crate) bridge_messages: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>,
    pub(crate) bridge_state: ::std::option::Option<crate::types::BridgeState>,
    pub(crate) egress_gateway_bridge: ::std::option::Option<crate::types::EgressGatewayBridge>,
    pub(crate) ingress_gateway_bridge: ::std::option::Option<crate::types::IngressGatewayBridge>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::BridgeOutput>>,
    pub(crate) placement_arn: ::std::option::Option<::std::string::String>,
    pub(crate) source_failover_config: ::std::option::Option<crate::types::FailoverConfig>,
    pub(crate) sources: ::std::option::Option<::std::vec::Vec<crate::types::BridgeSource>>,
}
impl BridgeBuilder {
    /// The Amazon Resource Number (ARN) of the bridge.
    /// This field is required.
    pub fn bridge_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bridge_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Number (ARN) of the bridge.
    pub fn set_bridge_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bridge_arn = input;
        self
    }
    /// The Amazon Resource Number (ARN) of the bridge.
    pub fn get_bridge_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.bridge_arn
    }
    /// Appends an item to `bridge_messages`.
    ///
    /// To override the contents of this collection use [`set_bridge_messages`](Self::set_bridge_messages).
    ///
    pub fn bridge_messages(mut self, input: crate::types::MessageDetail) -> Self {
        let mut v = self.bridge_messages.unwrap_or_default();
        v.push(input);
        self.bridge_messages = ::std::option::Option::Some(v);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_bridge_messages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>>) -> Self {
        self.bridge_messages = input;
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_bridge_messages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageDetail>> {
        &self.bridge_messages
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn bridge_state(mut self, input: crate::types::BridgeState) -> Self {
        self.bridge_state = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_bridge_state(mut self, input: ::std::option::Option<crate::types::BridgeState>) -> Self {
        self.bridge_state = input;
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_bridge_state(&self) -> &::std::option::Option<crate::types::BridgeState> {
        &self.bridge_state
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn egress_gateway_bridge(mut self, input: crate::types::EgressGatewayBridge) -> Self {
        self.egress_gateway_bridge = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_egress_gateway_bridge(mut self, input: ::std::option::Option<crate::types::EgressGatewayBridge>) -> Self {
        self.egress_gateway_bridge = input;
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_egress_gateway_bridge(&self) -> &::std::option::Option<crate::types::EgressGatewayBridge> {
        &self.egress_gateway_bridge
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn ingress_gateway_bridge(mut self, input: crate::types::IngressGatewayBridge) -> Self {
        self.ingress_gateway_bridge = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_ingress_gateway_bridge(mut self, input: ::std::option::Option<crate::types::IngressGatewayBridge>) -> Self {
        self.ingress_gateway_bridge = input;
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_ingress_gateway_bridge(&self) -> &::std::option::Option<crate::types::IngressGatewayBridge> {
        &self.ingress_gateway_bridge
    }
    /// The name of the bridge.
    /// 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
    }
    /// The name of the bridge.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The name of the bridge.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `outputs`.
    ///
    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
    ///
    /// The outputs on this bridge.
    pub fn outputs(mut self, input: crate::types::BridgeOutput) -> Self {
        let mut v = self.outputs.unwrap_or_default();
        v.push(input);
        self.outputs = ::std::option::Option::Some(v);
        self
    }
    /// The outputs on this bridge.
    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BridgeOutput>>) -> Self {
        self.outputs = input;
        self
    }
    /// The outputs on this bridge.
    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BridgeOutput>> {
        &self.outputs
    }
    /// The placement Amazon Resource Number (ARN) of the bridge.
    /// This field is required.
    pub fn placement_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.placement_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The placement Amazon Resource Number (ARN) of the bridge.
    pub fn set_placement_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.placement_arn = input;
        self
    }
    /// The placement Amazon Resource Number (ARN) of the bridge.
    pub fn get_placement_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.placement_arn
    }
    /// The settings for source failover.
    pub fn source_failover_config(mut self, input: crate::types::FailoverConfig) -> Self {
        self.source_failover_config = ::std::option::Option::Some(input);
        self
    }
    /// The settings for source failover.
    pub fn set_source_failover_config(mut self, input: ::std::option::Option<crate::types::FailoverConfig>) -> Self {
        self.source_failover_config = input;
        self
    }
    /// The settings for source failover.
    pub fn get_source_failover_config(&self) -> &::std::option::Option<crate::types::FailoverConfig> {
        &self.source_failover_config
    }
    /// Appends an item to `sources`.
    ///
    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
    ///
    /// The sources on this bridge.
    pub fn sources(mut self, input: crate::types::BridgeSource) -> Self {
        let mut v = self.sources.unwrap_or_default();
        v.push(input);
        self.sources = ::std::option::Option::Some(v);
        self
    }
    /// The sources on this bridge.
    pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BridgeSource>>) -> Self {
        self.sources = input;
        self
    }
    /// The sources on this bridge.
    pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BridgeSource>> {
        &self.sources
    }
    /// Consumes the builder and constructs a [`Bridge`](crate::types::Bridge).
    pub fn build(self) -> crate::types::Bridge {
        crate::types::Bridge {
            bridge_arn: self.bridge_arn,
            bridge_messages: self.bridge_messages,
            bridge_state: self.bridge_state,
            egress_gateway_bridge: self.egress_gateway_bridge,
            ingress_gateway_bridge: self.ingress_gateway_bridge,
            name: self.name,
            outputs: self.outputs,
            placement_arn: self.placement_arn,
            source_failover_config: self.source_failover_config,
            sources: self.sources,
        }
    }
}