aws_sdk_ivsrealtime/operation/start_composition/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_composition::_start_composition_output::StartCompositionOutputBuilder;
3
4pub use crate::operation::start_composition::_start_composition_input::StartCompositionInputBuilder;
5
6impl crate::operation::start_composition::builders::StartCompositionInputBuilder {
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::start_composition::StartCompositionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_composition::StartCompositionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_composition();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartComposition`.
24///
25/// <p>Starts a Composition from a stage based on the configuration provided in the request.</p>
26/// <p>A Composition is an ephemeral resource that exists after this operation returns successfully. Composition stops and the resource is deleted:</p>
27/// <ul>
28/// <li>
29/// <p>When <code>StopComposition</code> is called.</p></li>
30/// <li>
31/// <p>After a 1-minute timeout, when all participants are disconnected from the stage.</p></li>
32/// <li>
33/// <p>After a 1-minute timeout, if there are no participants in the stage when StartComposition is called.</p></li>
34/// <li>
35/// <p>When broadcasting to the IVS channel fails and all retries are exhausted.</p></li>
36/// <li>
37/// <p>When broadcasting is disconnected and all attempts to reconnect are exhausted.</p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct StartCompositionFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::start_composition::builders::StartCompositionInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::start_composition::StartCompositionOutput,
48        crate::operation::start_composition::StartCompositionError,
49    > for StartCompositionFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::start_composition::StartCompositionOutput,
57            crate::operation::start_composition::StartCompositionError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl StartCompositionFluentBuilder {
64    /// Creates a new `StartCompositionFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the StartComposition as a reference.
73    pub fn as_input(&self) -> &crate::operation::start_composition::builders::StartCompositionInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::start_composition::StartCompositionOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::start_composition::StartCompositionError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::start_composition::StartComposition::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::start_composition::StartComposition::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::start_composition::StartCompositionOutput,
110        crate::operation::start_composition::StartCompositionError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>ARN of the stage to be used for compositing.</p>
125    pub fn stage_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.stage_arn(input.into());
127        self
128    }
129    /// <p>ARN of the stage to be used for compositing.</p>
130    pub fn set_stage_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_stage_arn(input);
132        self
133    }
134    /// <p>ARN of the stage to be used for compositing.</p>
135    pub fn get_stage_arn(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_stage_arn()
137    }
138    /// <p>Idempotency token.</p>
139    pub fn idempotency_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.idempotency_token(input.into());
141        self
142    }
143    /// <p>Idempotency token.</p>
144    pub fn set_idempotency_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_idempotency_token(input);
146        self
147    }
148    /// <p>Idempotency token.</p>
149    pub fn get_idempotency_token(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_idempotency_token()
151    }
152    /// <p>Layout object to configure composition parameters.</p>
153    pub fn layout(mut self, input: crate::types::LayoutConfiguration) -> Self {
154        self.inner = self.inner.layout(input);
155        self
156    }
157    /// <p>Layout object to configure composition parameters.</p>
158    pub fn set_layout(mut self, input: ::std::option::Option<crate::types::LayoutConfiguration>) -> Self {
159        self.inner = self.inner.set_layout(input);
160        self
161    }
162    /// <p>Layout object to configure composition parameters.</p>
163    pub fn get_layout(&self) -> &::std::option::Option<crate::types::LayoutConfiguration> {
164        self.inner.get_layout()
165    }
166    ///
167    /// Appends an item to `destinations`.
168    ///
169    /// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
170    ///
171    /// <p>Array of destination configuration.</p>
172    pub fn destinations(mut self, input: crate::types::DestinationConfiguration) -> Self {
173        self.inner = self.inner.destinations(input);
174        self
175    }
176    /// <p>Array of destination configuration.</p>
177    pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DestinationConfiguration>>) -> Self {
178        self.inner = self.inner.set_destinations(input);
179        self
180    }
181    /// <p>Array of destination configuration.</p>
182    pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DestinationConfiguration>> {
183        self.inner.get_destinations()
184    }
185    ///
186    /// Adds a key-value pair to `tags`.
187    ///
188    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
189    ///
190    /// <p>Tags attached to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging AWS Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no constraints on tags beyond what is documented there.</p>
191    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.tags(k.into(), v.into());
193        self
194    }
195    /// <p>Tags attached to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging AWS Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no constraints on tags beyond what is documented there.</p>
196    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
197        self.inner = self.inner.set_tags(input);
198        self
199    }
200    /// <p>Tags attached to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging AWS Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no constraints on tags beyond what is documented there.</p>
201    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
202        self.inner.get_tags()
203    }
204}