aws_sdk_mediapackagev2/operation/create_channel/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_channel::_create_channel_output::CreateChannelOutputBuilder;
3
4pub use crate::operation::create_channel::_create_channel_input::CreateChannelInputBuilder;
5
6impl crate::operation::create_channel::builders::CreateChannelInputBuilder {
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_channel::CreateChannelOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_channel::CreateChannelError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_channel();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateChannel`.
24///
25/// <p>Create a channel to start receiving content streams. The channel represents the input to MediaPackage for incoming live content from an encoder such as AWS Elemental MediaLive. The channel receives content, and after packaging it, outputs it through an origin endpoint to downstream devices (such as video players or CDNs) that request the content. You can create only one channel with each request. We recommend that you spread out channels between channel groups, such as putting redundant channels in the same AWS Region in different channel groups.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateChannelFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_channel::builders::CreateChannelInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_channel::CreateChannelOutput,
35        crate::operation::create_channel::CreateChannelError,
36    > for CreateChannelFluentBuilder
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_channel::CreateChannelOutput,
44            crate::operation::create_channel::CreateChannelError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateChannelFluentBuilder {
51    /// Creates a new `CreateChannelFluentBuilder`.
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 CreateChannel as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_channel::builders::CreateChannelInputBuilder {
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_channel::CreateChannelOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_channel::CreateChannelError,
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_channel::CreateChannel::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_channel::CreateChannel::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_channel::CreateChannelOutput,
97        crate::operation::create_channel::CreateChannelError,
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 name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.</p>
112    pub fn channel_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.channel_group_name(input.into());
114        self
115    }
116    /// <p>The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.</p>
117    pub fn set_channel_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_channel_group_name(input);
119        self
120    }
121    /// <p>The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region.</p>
122    pub fn get_channel_group_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_channel_group_name()
124    }
125    /// <p>The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group. You can't change the name after you create the channel.</p>
126    pub fn channel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.channel_name(input.into());
128        self
129    }
130    /// <p>The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group. You can't change the name after you create the channel.</p>
131    pub fn set_channel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_channel_name(input);
133        self
134    }
135    /// <p>The name that describes the channel. The name is the primary identifier for the channel, and must be unique for your account in the AWS Region and channel group. You can't change the name after you create the channel.</p>
136    pub fn get_channel_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_channel_name()
138    }
139    /// <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
140    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.client_token(input.into());
142        self
143    }
144    /// <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
145    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_client_token(input);
147        self
148    }
149    /// <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
150    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_client_token()
152    }
153    /// <p>The input type will be an immutable field which will be used to define whether the channel will allow CMAF ingest or HLS ingest. If unprovided, it will default to HLS to preserve current behavior.</p>
154    /// <p>The allowed values are:</p>
155    /// <ul>
156    /// <li>
157    /// <p><code>HLS</code> - The HLS streaming specification (which defines M3U8 manifests and TS segments).</p></li>
158    /// <li>
159    /// <p><code>CMAF</code> - The DASH-IF CMAF Ingest specification (which defines CMAF segments with optional DASH manifests).</p></li>
160    /// </ul>
161    pub fn input_type(mut self, input: crate::types::InputType) -> Self {
162        self.inner = self.inner.input_type(input);
163        self
164    }
165    /// <p>The input type will be an immutable field which will be used to define whether the channel will allow CMAF ingest or HLS ingest. If unprovided, it will default to HLS to preserve current behavior.</p>
166    /// <p>The allowed values are:</p>
167    /// <ul>
168    /// <li>
169    /// <p><code>HLS</code> - The HLS streaming specification (which defines M3U8 manifests and TS segments).</p></li>
170    /// <li>
171    /// <p><code>CMAF</code> - The DASH-IF CMAF Ingest specification (which defines CMAF segments with optional DASH manifests).</p></li>
172    /// </ul>
173    pub fn set_input_type(mut self, input: ::std::option::Option<crate::types::InputType>) -> Self {
174        self.inner = self.inner.set_input_type(input);
175        self
176    }
177    /// <p>The input type will be an immutable field which will be used to define whether the channel will allow CMAF ingest or HLS ingest. If unprovided, it will default to HLS to preserve current behavior.</p>
178    /// <p>The allowed values are:</p>
179    /// <ul>
180    /// <li>
181    /// <p><code>HLS</code> - The HLS streaming specification (which defines M3U8 manifests and TS segments).</p></li>
182    /// <li>
183    /// <p><code>CMAF</code> - The DASH-IF CMAF Ingest specification (which defines CMAF segments with optional DASH manifests).</p></li>
184    /// </ul>
185    pub fn get_input_type(&self) -> &::std::option::Option<crate::types::InputType> {
186        self.inner.get_input_type()
187    }
188    /// <p>Enter any descriptive text that helps you to identify the channel.</p>
189    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.inner = self.inner.description(input.into());
191        self
192    }
193    /// <p>Enter any descriptive text that helps you to identify the channel.</p>
194    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.inner = self.inner.set_description(input);
196        self
197    }
198    /// <p>Enter any descriptive text that helps you to identify the channel.</p>
199    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
200        self.inner.get_description()
201    }
202    /// <p>The configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive. This setting is valid only when <code>InputType</code> is <code>CMAF</code>.</p>
203    pub fn input_switch_configuration(mut self, input: crate::types::InputSwitchConfiguration) -> Self {
204        self.inner = self.inner.input_switch_configuration(input);
205        self
206    }
207    /// <p>The configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive. This setting is valid only when <code>InputType</code> is <code>CMAF</code>.</p>
208    pub fn set_input_switch_configuration(mut self, input: ::std::option::Option<crate::types::InputSwitchConfiguration>) -> Self {
209        self.inner = self.inner.set_input_switch_configuration(input);
210        self
211    }
212    /// <p>The configuration for input switching based on the media quality confidence score (MQCS) as provided from AWS Elemental MediaLive. This setting is valid only when <code>InputType</code> is <code>CMAF</code>.</p>
213    pub fn get_input_switch_configuration(&self) -> &::std::option::Option<crate::types::InputSwitchConfiguration> {
214        self.inner.get_input_switch_configuration()
215    }
216    /// <p>The settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN. This setting is valid only when <code>InputType</code> is <code>CMAF</code>.</p>
217    pub fn output_header_configuration(mut self, input: crate::types::OutputHeaderConfiguration) -> Self {
218        self.inner = self.inner.output_header_configuration(input);
219        self
220    }
221    /// <p>The settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN. This setting is valid only when <code>InputType</code> is <code>CMAF</code>.</p>
222    pub fn set_output_header_configuration(mut self, input: ::std::option::Option<crate::types::OutputHeaderConfiguration>) -> Self {
223        self.inner = self.inner.set_output_header_configuration(input);
224        self
225    }
226    /// <p>The settings for what common media server data (CMSD) headers AWS Elemental MediaPackage includes in responses to the CDN. This setting is valid only when <code>InputType</code> is <code>CMAF</code>.</p>
227    pub fn get_output_header_configuration(&self) -> &::std::option::Option<crate::types::OutputHeaderConfiguration> {
228        self.inner.get_output_header_configuration()
229    }
230    ///
231    /// Adds a key-value pair to `Tags`.
232    ///
233    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
234    ///
235    /// <p>A comma-separated list of tag key:value pairs that you define. For example:</p>
236    /// <p><code>"Key1": "Value1",</code></p>
237    /// <p><code>"Key2": "Value2"</code></p>
238    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.inner = self.inner.tags(k.into(), v.into());
240        self
241    }
242    /// <p>A comma-separated list of tag key:value pairs that you define. For example:</p>
243    /// <p><code>"Key1": "Value1",</code></p>
244    /// <p><code>"Key2": "Value2"</code></p>
245    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
246        self.inner = self.inner.set_tags(input);
247        self
248    }
249    /// <p>A comma-separated list of tag key:value pairs that you define. For example:</p>
250    /// <p><code>"Key1": "Value1",</code></p>
251    /// <p><code>"Key2": "Value2"</code></p>
252    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
253        self.inner.get_tags()
254    }
255}