aws_sdk_mediatailor/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>Creates a channel. For information about MediaTailor channels, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-channels.html">Working with channels</a> in the <i>MediaTailor User Guide</i>.</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 of the channel.</p>
112    pub fn channel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.channel_name(input.into());
114        self
115    }
116    /// <p>The name of the channel.</p>
117    pub fn set_channel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_channel_name(input);
119        self
120    }
121    /// <p>The name of the channel.</p>
122    pub fn get_channel_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_channel_name()
124    }
125    /// <p>The slate used to fill gaps between programs in the schedule. You must configure filler slate if your channel uses the <code>LINEAR</code> <code>PlaybackMode</code>. MediaTailor doesn't support filler slate for channels using the <code>LOOP</code> <code>PlaybackMode</code>.</p>
126    pub fn filler_slate(mut self, input: crate::types::SlateSource) -> Self {
127        self.inner = self.inner.filler_slate(input);
128        self
129    }
130    /// <p>The slate used to fill gaps between programs in the schedule. You must configure filler slate if your channel uses the <code>LINEAR</code> <code>PlaybackMode</code>. MediaTailor doesn't support filler slate for channels using the <code>LOOP</code> <code>PlaybackMode</code>.</p>
131    pub fn set_filler_slate(mut self, input: ::std::option::Option<crate::types::SlateSource>) -> Self {
132        self.inner = self.inner.set_filler_slate(input);
133        self
134    }
135    /// <p>The slate used to fill gaps between programs in the schedule. You must configure filler slate if your channel uses the <code>LINEAR</code> <code>PlaybackMode</code>. MediaTailor doesn't support filler slate for channels using the <code>LOOP</code> <code>PlaybackMode</code>.</p>
136    pub fn get_filler_slate(&self) -> &::std::option::Option<crate::types::SlateSource> {
137        self.inner.get_filler_slate()
138    }
139    ///
140    /// Appends an item to `Outputs`.
141    ///
142    /// To override the contents of this collection use [`set_outputs`](Self::set_outputs).
143    ///
144    /// <p>The channel's output properties.</p>
145    pub fn outputs(mut self, input: crate::types::RequestOutputItem) -> Self {
146        self.inner = self.inner.outputs(input);
147        self
148    }
149    /// <p>The channel's output properties.</p>
150    pub fn set_outputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequestOutputItem>>) -> Self {
151        self.inner = self.inner.set_outputs(input);
152        self
153    }
154    /// <p>The channel's output properties.</p>
155    pub fn get_outputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequestOutputItem>> {
156        self.inner.get_outputs()
157    }
158    /// <p>The type of playback mode to use for this channel.</p>
159    /// <p><code>LINEAR</code> - The programs in the schedule play once back-to-back in the schedule.</p>
160    /// <p><code>LOOP</code> - The programs in the schedule play back-to-back in an endless loop. When the last program in the schedule stops playing, playback loops back to the first program in the schedule.</p>
161    pub fn playback_mode(mut self, input: crate::types::PlaybackMode) -> Self {
162        self.inner = self.inner.playback_mode(input);
163        self
164    }
165    /// <p>The type of playback mode to use for this channel.</p>
166    /// <p><code>LINEAR</code> - The programs in the schedule play once back-to-back in the schedule.</p>
167    /// <p><code>LOOP</code> - The programs in the schedule play back-to-back in an endless loop. When the last program in the schedule stops playing, playback loops back to the first program in the schedule.</p>
168    pub fn set_playback_mode(mut self, input: ::std::option::Option<crate::types::PlaybackMode>) -> Self {
169        self.inner = self.inner.set_playback_mode(input);
170        self
171    }
172    /// <p>The type of playback mode to use for this channel.</p>
173    /// <p><code>LINEAR</code> - The programs in the schedule play once back-to-back in the schedule.</p>
174    /// <p><code>LOOP</code> - The programs in the schedule play back-to-back in an endless loop. When the last program in the schedule stops playing, playback loops back to the first program in the schedule.</p>
175    pub fn get_playback_mode(&self) -> &::std::option::Option<crate::types::PlaybackMode> {
176        self.inner.get_playback_mode()
177    }
178    ///
179    /// Adds a key-value pair to `Tags`.
180    ///
181    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
182    ///
183    /// <p>The tags to assign to the channel. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html">Tagging AWS Elemental MediaTailor Resources</a>.</p>
184    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.tags(k.into(), v.into());
186        self
187    }
188    /// <p>The tags to assign to the channel. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html">Tagging AWS Elemental MediaTailor Resources</a>.</p>
189    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
190        self.inner = self.inner.set_tags(input);
191        self
192    }
193    /// <p>The tags to assign to the channel. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see <a href="https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html">Tagging AWS Elemental MediaTailor Resources</a>.</p>
194    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
195        self.inner.get_tags()
196    }
197    /// <p>The tier of the channel.</p>
198    pub fn tier(mut self, input: crate::types::Tier) -> Self {
199        self.inner = self.inner.tier(input);
200        self
201    }
202    /// <p>The tier of the channel.</p>
203    pub fn set_tier(mut self, input: ::std::option::Option<crate::types::Tier>) -> Self {
204        self.inner = self.inner.set_tier(input);
205        self
206    }
207    /// <p>The tier of the channel.</p>
208    pub fn get_tier(&self) -> &::std::option::Option<crate::types::Tier> {
209        self.inner.get_tier()
210    }
211    /// <p>The time-shifted viewing configuration you want to associate to the channel.</p>
212    pub fn time_shift_configuration(mut self, input: crate::types::TimeShiftConfiguration) -> Self {
213        self.inner = self.inner.time_shift_configuration(input);
214        self
215    }
216    /// <p>The time-shifted viewing configuration you want to associate to the channel.</p>
217    pub fn set_time_shift_configuration(mut self, input: ::std::option::Option<crate::types::TimeShiftConfiguration>) -> Self {
218        self.inner = self.inner.set_time_shift_configuration(input);
219        self
220    }
221    /// <p>The time-shifted viewing configuration you want to associate to the channel.</p>
222    pub fn get_time_shift_configuration(&self) -> &::std::option::Option<crate::types::TimeShiftConfiguration> {
223        self.inner.get_time_shift_configuration()
224    }
225    ///
226    /// Appends an item to `Audiences`.
227    ///
228    /// To override the contents of this collection use [`set_audiences`](Self::set_audiences).
229    ///
230    /// <p>The list of audiences defined in channel.</p>
231    pub fn audiences(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.audiences(input.into());
233        self
234    }
235    /// <p>The list of audiences defined in channel.</p>
236    pub fn set_audiences(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
237        self.inner = self.inner.set_audiences(input);
238        self
239    }
240    /// <p>The list of audiences defined in channel.</p>
241    pub fn get_audiences(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
242        self.inner.get_audiences()
243    }
244}