aws_sdk_mediaconnect/operation/create_bridge/
_create_bridge_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateBridgeInput {
6    /// <p>An egress bridge is a cloud-to-ground bridge. The content comes from an existing MediaConnect flow and is delivered to your premises.</p>
7    pub egress_gateway_bridge: ::std::option::Option<crate::types::AddEgressGatewayBridgeRequest>,
8    /// <p>An ingress bridge is a ground-to-cloud bridge. The content originates at your premises and is delivered to the cloud.</p>
9    pub ingress_gateway_bridge: ::std::option::Option<crate::types::AddIngressGatewayBridgeRequest>,
10    /// <p>The name of the bridge. This name can not be modified after the bridge is created.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The outputs that you want to add to this bridge.</p>
13    pub outputs: ::std::option::Option<::std::vec::Vec<crate::types::AddBridgeOutputRequest>>,
14    /// <p>The bridge placement Amazon Resource Number (ARN).</p>
15    pub placement_arn: ::std::option::Option<::std::string::String>,
16    /// <p>The settings for source failover.</p>
17    pub source_failover_config: ::std::option::Option<crate::types::FailoverConfig>,
18    /// <p>The sources that you want to add to this bridge.</p>
19    pub sources: ::std::option::Option<::std::vec::Vec<crate::types::AddBridgeSourceRequest>>,
20}
21impl CreateBridgeInput {
22    /// <p>An egress bridge is a cloud-to-ground bridge. The content comes from an existing MediaConnect flow and is delivered to your premises.</p>
23    pub fn egress_gateway_bridge(&self) -> ::std::option::Option<&crate::types::AddEgressGatewayBridgeRequest> {
24        self.egress_gateway_bridge.as_ref()
25    }
26    /// <p>An ingress bridge is a ground-to-cloud bridge. The content originates at your premises and is delivered to the cloud.</p>
27    pub fn ingress_gateway_bridge(&self) -> ::std::option::Option<&crate::types::AddIngressGatewayBridgeRequest> {
28        self.ingress_gateway_bridge.as_ref()
29    }
30    /// <p>The name of the bridge. This name can not be modified after the bridge is created.</p>
31    pub fn name(&self) -> ::std::option::Option<&str> {
32        self.name.as_deref()
33    }
34    /// <p>The outputs that you want to add to this bridge.</p>
35    ///
36    /// 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()`.
37    pub fn outputs(&self) -> &[crate::types::AddBridgeOutputRequest] {
38        self.outputs.as_deref().unwrap_or_default()
39    }
40    /// <p>The bridge placement Amazon Resource Number (ARN).</p>
41    pub fn placement_arn(&self) -> ::std::option::Option<&str> {
42        self.placement_arn.as_deref()
43    }
44    /// <p>The settings for source failover.</p>
45    pub fn source_failover_config(&self) -> ::std::option::Option<&crate::types::FailoverConfig> {
46        self.source_failover_config.as_ref()
47    }
48    /// <p>The sources that you want to add to this bridge.</p>
49    ///
50    /// 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()`.
51    pub fn sources(&self) -> &[crate::types::AddBridgeSourceRequest] {
52        self.sources.as_deref().unwrap_or_default()
53    }
54}
55impl CreateBridgeInput {
56    /// Creates a new builder-style object to manufacture [`CreateBridgeInput`](crate::operation::create_bridge::CreateBridgeInput).
57    pub fn builder() -> crate::operation::create_bridge::builders::CreateBridgeInputBuilder {
58        crate::operation::create_bridge::builders::CreateBridgeInputBuilder::default()
59    }
60}
61
62/// A builder for [`CreateBridgeInput`](crate::operation::create_bridge::CreateBridgeInput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct CreateBridgeInputBuilder {
66    pub(crate) egress_gateway_bridge: ::std::option::Option<crate::types::AddEgressGatewayBridgeRequest>,
67    pub(crate) ingress_gateway_bridge: ::std::option::Option<crate::types::AddIngressGatewayBridgeRequest>,
68    pub(crate) name: ::std::option::Option<::std::string::String>,
69    pub(crate) outputs: ::std::option::Option<::std::vec::Vec<crate::types::AddBridgeOutputRequest>>,
70    pub(crate) placement_arn: ::std::option::Option<::std::string::String>,
71    pub(crate) source_failover_config: ::std::option::Option<crate::types::FailoverConfig>,
72    pub(crate) sources: ::std::option::Option<::std::vec::Vec<crate::types::AddBridgeSourceRequest>>,
73}
74impl CreateBridgeInputBuilder {
75    /// <p>An egress bridge is a cloud-to-ground bridge. The content comes from an existing MediaConnect flow and is delivered to your premises.</p>
76    pub fn egress_gateway_bridge(mut self, input: crate::types::AddEgressGatewayBridgeRequest) -> Self {
77        self.egress_gateway_bridge = ::std::option::Option::Some(input);
78        self
79    }
80    /// <p>An egress bridge is a cloud-to-ground bridge. The content comes from an existing MediaConnect flow and is delivered to your premises.</p>
81    pub fn set_egress_gateway_bridge(mut self, input: ::std::option::Option<crate::types::AddEgressGatewayBridgeRequest>) -> Self {
82        self.egress_gateway_bridge = input;
83        self
84    }
85    /// <p>An egress bridge is a cloud-to-ground bridge. The content comes from an existing MediaConnect flow and is delivered to your premises.</p>
86    pub fn get_egress_gateway_bridge(&self) -> &::std::option::Option<crate::types::AddEgressGatewayBridgeRequest> {
87        &self.egress_gateway_bridge
88    }
89    /// <p>An ingress bridge is a ground-to-cloud bridge. The content originates at your premises and is delivered to the cloud.</p>
90    pub fn ingress_gateway_bridge(mut self, input: crate::types::AddIngressGatewayBridgeRequest) -> Self {
91        self.ingress_gateway_bridge = ::std::option::Option::Some(input);
92        self
93    }
94    /// <p>An ingress bridge is a ground-to-cloud bridge. The content originates at your premises and is delivered to the cloud.</p>
95    pub fn set_ingress_gateway_bridge(mut self, input: ::std::option::Option<crate::types::AddIngressGatewayBridgeRequest>) -> Self {
96        self.ingress_gateway_bridge = input;
97        self
98    }
99    /// <p>An ingress bridge is a ground-to-cloud bridge. The content originates at your premises and is delivered to the cloud.</p>
100    pub fn get_ingress_gateway_bridge(&self) -> &::std::option::Option<crate::types::AddIngressGatewayBridgeRequest> {
101        &self.ingress_gateway_bridge
102    }
103    /// <p>The name of the bridge. This name can not be modified after the bridge is created.</p>
104    /// This field is required.
105    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.name = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The name of the bridge. This name can not be modified after the bridge is created.</p>
110    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.name = input;
112        self
113    }
114    /// <p>The name of the bridge. This name can not be modified after the bridge is created.</p>
115    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
116        &self.name
117    }
118    /// Appends an item to `outputs`.
119    ///
120    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
121    ///
122    /// <p>The outputs that you want to add to this bridge.</p>
123    pub fn outputs(mut self, input: crate::types::AddBridgeOutputRequest) -> Self {
124        let mut v = self.outputs.unwrap_or_default();
125        v.push(input);
126        self.outputs = ::std::option::Option::Some(v);
127        self
128    }
129    /// <p>The outputs that you want to add to this bridge.</p>
130    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AddBridgeOutputRequest>>) -> Self {
131        self.outputs = input;
132        self
133    }
134    /// <p>The outputs that you want to add to this bridge.</p>
135    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddBridgeOutputRequest>> {
136        &self.outputs
137    }
138    /// <p>The bridge placement Amazon Resource Number (ARN).</p>
139    /// This field is required.
140    pub fn placement_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.placement_arn = ::std::option::Option::Some(input.into());
142        self
143    }
144    /// <p>The bridge placement Amazon Resource Number (ARN).</p>
145    pub fn set_placement_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.placement_arn = input;
147        self
148    }
149    /// <p>The bridge placement Amazon Resource Number (ARN).</p>
150    pub fn get_placement_arn(&self) -> &::std::option::Option<::std::string::String> {
151        &self.placement_arn
152    }
153    /// <p>The settings for source failover.</p>
154    pub fn source_failover_config(mut self, input: crate::types::FailoverConfig) -> Self {
155        self.source_failover_config = ::std::option::Option::Some(input);
156        self
157    }
158    /// <p>The settings for source failover.</p>
159    pub fn set_source_failover_config(mut self, input: ::std::option::Option<crate::types::FailoverConfig>) -> Self {
160        self.source_failover_config = input;
161        self
162    }
163    /// <p>The settings for source failover.</p>
164    pub fn get_source_failover_config(&self) -> &::std::option::Option<crate::types::FailoverConfig> {
165        &self.source_failover_config
166    }
167    /// Appends an item to `sources`.
168    ///
169    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
170    ///
171    /// <p>The sources that you want to add to this bridge.</p>
172    pub fn sources(mut self, input: crate::types::AddBridgeSourceRequest) -> Self {
173        let mut v = self.sources.unwrap_or_default();
174        v.push(input);
175        self.sources = ::std::option::Option::Some(v);
176        self
177    }
178    /// <p>The sources that you want to add to this bridge.</p>
179    pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AddBridgeSourceRequest>>) -> Self {
180        self.sources = input;
181        self
182    }
183    /// <p>The sources that you want to add to this bridge.</p>
184    pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddBridgeSourceRequest>> {
185        &self.sources
186    }
187    /// Consumes the builder and constructs a [`CreateBridgeInput`](crate::operation::create_bridge::CreateBridgeInput).
188    pub fn build(
189        self,
190    ) -> ::std::result::Result<crate::operation::create_bridge::CreateBridgeInput, ::aws_smithy_types::error::operation::BuildError> {
191        ::std::result::Result::Ok(crate::operation::create_bridge::CreateBridgeInput {
192            egress_gateway_bridge: self.egress_gateway_bridge,
193            ingress_gateway_bridge: self.ingress_gateway_bridge,
194            name: self.name,
195            outputs: self.outputs,
196            placement_arn: self.placement_arn,
197            source_failover_config: self.source_failover_config,
198            sources: self.sources,
199        })
200    }
201}