aws_sdk_mediaconnect/operation/create_flow/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_flow::_create_flow_output::CreateFlowOutputBuilder;
3
4pub use crate::operation::create_flow::_create_flow_input::CreateFlowInputBuilder;
5
6impl crate::operation::create_flow::builders::CreateFlowInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_flow::CreateFlowOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_flow::CreateFlowError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_flow();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateFlow`.
24///
25/// <p>Creates a new flow. The request must include one source. The request optionally can include outputs (up to 50) and entitlements (up to 50).</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateFlowFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_flow::builders::CreateFlowInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_flow::CreateFlowOutput,
35        crate::operation::create_flow::CreateFlowError,
36    > for CreateFlowFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_flow::CreateFlowOutput,
44            crate::operation::create_flow::CreateFlowError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateFlowFluentBuilder {
51    /// Creates a new `CreateFlowFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateFlow as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_flow::builders::CreateFlowInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_flow::CreateFlowOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_flow::CreateFlowError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_flow::CreateFlow::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_flow::CreateFlow::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_flow::CreateFlowOutput,
97        crate::operation::create_flow::CreateFlowError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current Amazon Web Services Region.</p>
112    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.availability_zone(input.into());
114        self
115    }
116    /// <p>The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current Amazon Web Services Region.</p>
117    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_availability_zone(input);
119        self
120    }
121    /// <p>The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current Amazon Web Services Region.</p>
122    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_availability_zone()
124    }
125    ///
126    /// Appends an item to `Entitlements`.
127    ///
128    /// To override the contents of this collection use [`set_entitlements`](Self::set_entitlements).
129    ///
130    /// <p>The entitlements that you want to grant on a flow.</p>
131    pub fn entitlements(mut self, input: crate::types::GrantEntitlementRequest) -> Self {
132        self.inner = self.inner.entitlements(input);
133        self
134    }
135    /// <p>The entitlements that you want to grant on a flow.</p>
136    pub fn set_entitlements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GrantEntitlementRequest>>) -> Self {
137        self.inner = self.inner.set_entitlements(input);
138        self
139    }
140    /// <p>The entitlements that you want to grant on a flow.</p>
141    pub fn get_entitlements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GrantEntitlementRequest>> {
142        self.inner.get_entitlements()
143    }
144    ///
145    /// Appends an item to `MediaStreams`.
146    ///
147    /// To override the contents of this collection use [`set_media_streams`](Self::set_media_streams).
148    ///
149    /// <p>The media streams that you want to add to the flow. You can associate these media streams with sources and outputs on the flow.</p>
150    pub fn media_streams(mut self, input: crate::types::AddMediaStreamRequest) -> Self {
151        self.inner = self.inner.media_streams(input);
152        self
153    }
154    /// <p>The media streams that you want to add to the flow. You can associate these media streams with sources and outputs on the flow.</p>
155    pub fn set_media_streams(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AddMediaStreamRequest>>) -> Self {
156        self.inner = self.inner.set_media_streams(input);
157        self
158    }
159    /// <p>The media streams that you want to add to the flow. You can associate these media streams with sources and outputs on the flow.</p>
160    pub fn get_media_streams(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddMediaStreamRequest>> {
161        self.inner.get_media_streams()
162    }
163    /// <p>The name of the flow.</p>
164    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.name(input.into());
166        self
167    }
168    /// <p>The name of the flow.</p>
169    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_name(input);
171        self
172    }
173    /// <p>The name of the flow.</p>
174    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_name()
176    }
177    ///
178    /// Appends an item to `Outputs`.
179    ///
180    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
181    ///
182    /// <p>The outputs that you want to add to this flow.</p>
183    pub fn outputs(mut self, input: crate::types::AddOutputRequest) -> Self {
184        self.inner = self.inner.outputs(input);
185        self
186    }
187    /// <p>The outputs that you want to add to this flow.</p>
188    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AddOutputRequest>>) -> Self {
189        self.inner = self.inner.set_outputs(input);
190        self
191    }
192    /// <p>The outputs that you want to add to this flow.</p>
193    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddOutputRequest>> {
194        self.inner.get_outputs()
195    }
196    /// <p>The settings for the source that you want to use for the new flow.</p>
197    pub fn source(mut self, input: crate::types::SetSourceRequest) -> Self {
198        self.inner = self.inner.source(input);
199        self
200    }
201    /// <p>The settings for the source that you want to use for the new flow.</p>
202    pub fn set_source(mut self, input: ::std::option::Option<crate::types::SetSourceRequest>) -> Self {
203        self.inner = self.inner.set_source(input);
204        self
205    }
206    /// <p>The settings for the source that you want to use for the new flow.</p>
207    pub fn get_source(&self) -> &::std::option::Option<crate::types::SetSourceRequest> {
208        self.inner.get_source()
209    }
210    /// <p>The settings for source failover.</p>
211    pub fn source_failover_config(mut self, input: crate::types::FailoverConfig) -> Self {
212        self.inner = self.inner.source_failover_config(input);
213        self
214    }
215    /// <p>The settings for source failover.</p>
216    pub fn set_source_failover_config(mut self, input: ::std::option::Option<crate::types::FailoverConfig>) -> Self {
217        self.inner = self.inner.set_source_failover_config(input);
218        self
219    }
220    /// <p>The settings for source failover.</p>
221    pub fn get_source_failover_config(&self) -> &::std::option::Option<crate::types::FailoverConfig> {
222        self.inner.get_source_failover_config()
223    }
224    ///
225    /// Appends an item to `Sources`.
226    ///
227    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
228    ///
229    /// <p>The sources that are assigned to the flow.</p>
230    pub fn sources(mut self, input: crate::types::SetSourceRequest) -> Self {
231        self.inner = self.inner.sources(input);
232        self
233    }
234    /// <p>The sources that are assigned to the flow.</p>
235    pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SetSourceRequest>>) -> Self {
236        self.inner = self.inner.set_sources(input);
237        self
238    }
239    /// <p>The sources that are assigned to the flow.</p>
240    pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SetSourceRequest>> {
241        self.inner.get_sources()
242    }
243    ///
244    /// Appends an item to `VpcInterfaces`.
245    ///
246    /// To override the contents of this collection use [`set_vpc_interfaces`](Self::set_vpc_interfaces).
247    ///
248    /// <p>The VPC interfaces you want on the flow.</p>
249    pub fn vpc_interfaces(mut self, input: crate::types::VpcInterfaceRequest) -> Self {
250        self.inner = self.inner.vpc_interfaces(input);
251        self
252    }
253    /// <p>The VPC interfaces you want on the flow.</p>
254    pub fn set_vpc_interfaces(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VpcInterfaceRequest>>) -> Self {
255        self.inner = self.inner.set_vpc_interfaces(input);
256        self
257    }
258    /// <p>The VPC interfaces you want on the flow.</p>
259    pub fn get_vpc_interfaces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcInterfaceRequest>> {
260        self.inner.get_vpc_interfaces()
261    }
262    /// <p>The maintenance settings you want to use for the flow.</p>
263    pub fn maintenance(mut self, input: crate::types::AddMaintenance) -> Self {
264        self.inner = self.inner.maintenance(input);
265        self
266    }
267    /// <p>The maintenance settings you want to use for the flow.</p>
268    pub fn set_maintenance(mut self, input: ::std::option::Option<crate::types::AddMaintenance>) -> Self {
269        self.inner = self.inner.set_maintenance(input);
270        self
271    }
272    /// <p>The maintenance settings you want to use for the flow.</p>
273    pub fn get_maintenance(&self) -> &::std::option::Option<crate::types::AddMaintenance> {
274        self.inner.get_maintenance()
275    }
276    /// <p>The settings for source monitoring.</p>
277    pub fn source_monitoring_config(mut self, input: crate::types::MonitoringConfig) -> Self {
278        self.inner = self.inner.source_monitoring_config(input);
279        self
280    }
281    /// <p>The settings for source monitoring.</p>
282    pub fn set_source_monitoring_config(mut self, input: ::std::option::Option<crate::types::MonitoringConfig>) -> Self {
283        self.inner = self.inner.set_source_monitoring_config(input);
284        self
285    }
286    /// <p>The settings for source monitoring.</p>
287    pub fn get_source_monitoring_config(&self) -> &::std::option::Option<crate::types::MonitoringConfig> {
288        self.inner.get_source_monitoring_config()
289    }
290    /// <p>Determines the processing capacity and feature set of the flow. Set this optional parameter to <code>LARGE</code> if you want to enable NDI outputs on the flow.</p>
291    pub fn flow_size(mut self, input: crate::types::FlowSize) -> Self {
292        self.inner = self.inner.flow_size(input);
293        self
294    }
295    /// <p>Determines the processing capacity and feature set of the flow. Set this optional parameter to <code>LARGE</code> if you want to enable NDI outputs on the flow.</p>
296    pub fn set_flow_size(mut self, input: ::std::option::Option<crate::types::FlowSize>) -> Self {
297        self.inner = self.inner.set_flow_size(input);
298        self
299    }
300    /// <p>Determines the processing capacity and feature set of the flow. Set this optional parameter to <code>LARGE</code> if you want to enable NDI outputs on the flow.</p>
301    pub fn get_flow_size(&self) -> &::std::option::Option<crate::types::FlowSize> {
302        self.inner.get_flow_size()
303    }
304    /// <p>Specifies the configuration settings for NDI outputs. Required when the flow includes NDI outputs.</p>
305    pub fn ndi_config(mut self, input: crate::types::NdiConfig) -> Self {
306        self.inner = self.inner.ndi_config(input);
307        self
308    }
309    /// <p>Specifies the configuration settings for NDI outputs. Required when the flow includes NDI outputs.</p>
310    pub fn set_ndi_config(mut self, input: ::std::option::Option<crate::types::NdiConfig>) -> Self {
311        self.inner = self.inner.set_ndi_config(input);
312        self
313    }
314    /// <p>Specifies the configuration settings for NDI outputs. Required when the flow includes NDI outputs.</p>
315    pub fn get_ndi_config(&self) -> &::std::option::Option<crate::types::NdiConfig> {
316        self.inner.get_ndi_config()
317    }
318    ///
319    /// Adds a key-value pair to `FlowTags`.
320    ///
321    /// To override the contents of this collection use [`set_flow_tags`](Self::set_flow_tags).
322    ///
323    /// <p>The key-value pairs that can be used to tag and organize the flow.</p>
324    pub fn flow_tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
325        self.inner = self.inner.flow_tags(k.into(), v.into());
326        self
327    }
328    /// <p>The key-value pairs that can be used to tag and organize the flow.</p>
329    pub fn set_flow_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
330        self.inner = self.inner.set_flow_tags(input);
331        self
332    }
333    /// <p>The key-value pairs that can be used to tag and organize the flow.</p>
334    pub fn get_flow_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
335        self.inner.get_flow_tags()
336    }
337}