aws_sdk_mediapackagev2/operation/create_origin_endpoint/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_origin_endpoint::_create_origin_endpoint_output::CreateOriginEndpointOutputBuilder;
3
4pub use crate::operation::create_origin_endpoint::_create_origin_endpoint_input::CreateOriginEndpointInputBuilder;
5
6impl crate::operation::create_origin_endpoint::builders::CreateOriginEndpointInputBuilder {
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_origin_endpoint::CreateOriginEndpointOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_origin_endpoint::CreateOriginEndpointError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_origin_endpoint();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateOriginEndpoint`.
24///
25/// <p>The endpoint is attached to a channel, and represents the output of the live content. You can associate multiple endpoints to a single channel. Each endpoint gives players and downstream CDNs (such as Amazon CloudFront) access to the content for playback. Content can't be served from a channel until it has an endpoint. You can create only one endpoint with each request.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateOriginEndpointFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_origin_endpoint::builders::CreateOriginEndpointInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_origin_endpoint::CreateOriginEndpointOutput,
35        crate::operation::create_origin_endpoint::CreateOriginEndpointError,
36    > for CreateOriginEndpointFluentBuilder
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_origin_endpoint::CreateOriginEndpointOutput,
44            crate::operation::create_origin_endpoint::CreateOriginEndpointError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateOriginEndpointFluentBuilder {
51    /// Creates a new `CreateOriginEndpointFluentBuilder`.
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 CreateOriginEndpoint as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_origin_endpoint::builders::CreateOriginEndpointInputBuilder {
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_origin_endpoint::CreateOriginEndpointOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_origin_endpoint::CreateOriginEndpointError,
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_origin_endpoint::CreateOriginEndpoint::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_origin_endpoint::CreateOriginEndpoint::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_origin_endpoint::CreateOriginEndpointOutput,
97        crate::operation::create_origin_endpoint::CreateOriginEndpointError,
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.</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.</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.</p>
136    pub fn get_channel_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_channel_name()
138    }
139    /// <p>The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and must be unique for your account in the AWS Region and channel. You can't use spaces in the name. You can't change the name after you create the endpoint.</p>
140    pub fn origin_endpoint_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.origin_endpoint_name(input.into());
142        self
143    }
144    /// <p>The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and must be unique for your account in the AWS Region and channel. You can't use spaces in the name. You can't change the name after you create the endpoint.</p>
145    pub fn set_origin_endpoint_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_origin_endpoint_name(input);
147        self
148    }
149    /// <p>The name that describes the origin endpoint. The name is the primary identifier for the origin endpoint, and must be unique for your account in the AWS Region and channel. You can't use spaces in the name. You can't change the name after you create the endpoint.</p>
150    pub fn get_origin_endpoint_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_origin_endpoint_name()
152    }
153    /// <p>The type of container to attach to this origin endpoint. A container type is a file format that encapsulates one or more media streams, such as audio and video, into a single file. You can't change the container type after you create the endpoint.</p>
154    pub fn container_type(mut self, input: crate::types::ContainerType) -> Self {
155        self.inner = self.inner.container_type(input);
156        self
157    }
158    /// <p>The type of container to attach to this origin endpoint. A container type is a file format that encapsulates one or more media streams, such as audio and video, into a single file. You can't change the container type after you create the endpoint.</p>
159    pub fn set_container_type(mut self, input: ::std::option::Option<crate::types::ContainerType>) -> Self {
160        self.inner = self.inner.set_container_type(input);
161        self
162    }
163    /// <p>The type of container to attach to this origin endpoint. A container type is a file format that encapsulates one or more media streams, such as audio and video, into a single file. You can't change the container type after you create the endpoint.</p>
164    pub fn get_container_type(&self) -> &::std::option::Option<crate::types::ContainerType> {
165        self.inner.get_container_type()
166    }
167    /// <p>The segment configuration, including the segment name, duration, and other configuration values.</p>
168    pub fn segment(mut self, input: crate::types::Segment) -> Self {
169        self.inner = self.inner.segment(input);
170        self
171    }
172    /// <p>The segment configuration, including the segment name, duration, and other configuration values.</p>
173    pub fn set_segment(mut self, input: ::std::option::Option<crate::types::Segment>) -> Self {
174        self.inner = self.inner.set_segment(input);
175        self
176    }
177    /// <p>The segment configuration, including the segment name, duration, and other configuration values.</p>
178    pub fn get_segment(&self) -> &::std::option::Option<crate::types::Segment> {
179        self.inner.get_segment()
180    }
181    /// <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
182    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.client_token(input.into());
184        self
185    }
186    /// <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
187    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_client_token(input);
189        self
190    }
191    /// <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
192    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_client_token()
194    }
195    /// <p>Enter any descriptive text that helps you to identify the origin endpoint.</p>
196    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.description(input.into());
198        self
199    }
200    /// <p>Enter any descriptive text that helps you to identify the origin endpoint.</p>
201    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_description(input);
203        self
204    }
205    /// <p>Enter any descriptive text that helps you to identify the origin endpoint.</p>
206    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_description()
208    }
209    /// <p>The size of the window (in seconds) to create a window of the live stream that's available for on-demand viewing. Viewers can start-over or catch-up on content that falls within the window. The maximum startover window is 1,209,600 seconds (14 days).</p>
210    pub fn startover_window_seconds(mut self, input: i32) -> Self {
211        self.inner = self.inner.startover_window_seconds(input);
212        self
213    }
214    /// <p>The size of the window (in seconds) to create a window of the live stream that's available for on-demand viewing. Viewers can start-over or catch-up on content that falls within the window. The maximum startover window is 1,209,600 seconds (14 days).</p>
215    pub fn set_startover_window_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
216        self.inner = self.inner.set_startover_window_seconds(input);
217        self
218    }
219    /// <p>The size of the window (in seconds) to create a window of the live stream that's available for on-demand viewing. Viewers can start-over or catch-up on content that falls within the window. The maximum startover window is 1,209,600 seconds (14 days).</p>
220    pub fn get_startover_window_seconds(&self) -> &::std::option::Option<i32> {
221        self.inner.get_startover_window_seconds()
222    }
223    ///
224    /// Appends an item to `HlsManifests`.
225    ///
226    /// To override the contents of this collection use [`set_hls_manifests`](Self::set_hls_manifests).
227    ///
228    /// <p>An HTTP live streaming (HLS) manifest configuration.</p>
229    pub fn hls_manifests(mut self, input: crate::types::CreateHlsManifestConfiguration) -> Self {
230        self.inner = self.inner.hls_manifests(input);
231        self
232    }
233    /// <p>An HTTP live streaming (HLS) manifest configuration.</p>
234    pub fn set_hls_manifests(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateHlsManifestConfiguration>>) -> Self {
235        self.inner = self.inner.set_hls_manifests(input);
236        self
237    }
238    /// <p>An HTTP live streaming (HLS) manifest configuration.</p>
239    pub fn get_hls_manifests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateHlsManifestConfiguration>> {
240        self.inner.get_hls_manifests()
241    }
242    ///
243    /// Appends an item to `LowLatencyHlsManifests`.
244    ///
245    /// To override the contents of this collection use [`set_low_latency_hls_manifests`](Self::set_low_latency_hls_manifests).
246    ///
247    /// <p>A low-latency HLS manifest configuration.</p>
248    pub fn low_latency_hls_manifests(mut self, input: crate::types::CreateLowLatencyHlsManifestConfiguration) -> Self {
249        self.inner = self.inner.low_latency_hls_manifests(input);
250        self
251    }
252    /// <p>A low-latency HLS manifest configuration.</p>
253    pub fn set_low_latency_hls_manifests(
254        mut self,
255        input: ::std::option::Option<::std::vec::Vec<crate::types::CreateLowLatencyHlsManifestConfiguration>>,
256    ) -> Self {
257        self.inner = self.inner.set_low_latency_hls_manifests(input);
258        self
259    }
260    /// <p>A low-latency HLS manifest configuration.</p>
261    pub fn get_low_latency_hls_manifests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateLowLatencyHlsManifestConfiguration>> {
262        self.inner.get_low_latency_hls_manifests()
263    }
264    ///
265    /// Appends an item to `DashManifests`.
266    ///
267    /// To override the contents of this collection use [`set_dash_manifests`](Self::set_dash_manifests).
268    ///
269    /// <p>A DASH manifest configuration.</p>
270    pub fn dash_manifests(mut self, input: crate::types::CreateDashManifestConfiguration) -> Self {
271        self.inner = self.inner.dash_manifests(input);
272        self
273    }
274    /// <p>A DASH manifest configuration.</p>
275    pub fn set_dash_manifests(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateDashManifestConfiguration>>) -> Self {
276        self.inner = self.inner.set_dash_manifests(input);
277        self
278    }
279    /// <p>A DASH manifest configuration.</p>
280    pub fn get_dash_manifests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateDashManifestConfiguration>> {
281        self.inner.get_dash_manifests()
282    }
283    ///
284    /// Appends an item to `MssManifests`.
285    ///
286    /// To override the contents of this collection use [`set_mss_manifests`](Self::set_mss_manifests).
287    ///
288    /// <p>A list of Microsoft Smooth Streaming (MSS) manifest configurations for the origin endpoint. You can configure multiple MSS manifests to provide different streaming experiences or to support different client requirements.</p>
289    pub fn mss_manifests(mut self, input: crate::types::CreateMssManifestConfiguration) -> Self {
290        self.inner = self.inner.mss_manifests(input);
291        self
292    }
293    /// <p>A list of Microsoft Smooth Streaming (MSS) manifest configurations for the origin endpoint. You can configure multiple MSS manifests to provide different streaming experiences or to support different client requirements.</p>
294    pub fn set_mss_manifests(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CreateMssManifestConfiguration>>) -> Self {
295        self.inner = self.inner.set_mss_manifests(input);
296        self
297    }
298    /// <p>A list of Microsoft Smooth Streaming (MSS) manifest configurations for the origin endpoint. You can configure multiple MSS manifests to provide different streaming experiences or to support different client requirements.</p>
299    pub fn get_mss_manifests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateMssManifestConfiguration>> {
300        self.inner.get_mss_manifests()
301    }
302    /// <p>The failover settings for the endpoint.</p>
303    pub fn force_endpoint_error_configuration(mut self, input: crate::types::ForceEndpointErrorConfiguration) -> Self {
304        self.inner = self.inner.force_endpoint_error_configuration(input);
305        self
306    }
307    /// <p>The failover settings for the endpoint.</p>
308    pub fn set_force_endpoint_error_configuration(mut self, input: ::std::option::Option<crate::types::ForceEndpointErrorConfiguration>) -> Self {
309        self.inner = self.inner.set_force_endpoint_error_configuration(input);
310        self
311    }
312    /// <p>The failover settings for the endpoint.</p>
313    pub fn get_force_endpoint_error_configuration(&self) -> &::std::option::Option<crate::types::ForceEndpointErrorConfiguration> {
314        self.inner.get_force_endpoint_error_configuration()
315    }
316    ///
317    /// Adds a key-value pair to `Tags`.
318    ///
319    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
320    ///
321    /// <p>A comma-separated list of tag key:value pairs that you define. For example:</p>
322    /// <p><code>"Key1": "Value1",</code></p>
323    /// <p><code>"Key2": "Value2"</code></p>
324    pub fn 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.tags(k.into(), v.into());
326        self
327    }
328    /// <p>A comma-separated list of tag key:value pairs that you define. For example:</p>
329    /// <p><code>"Key1": "Value1",</code></p>
330    /// <p><code>"Key2": "Value2"</code></p>
331    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
332        self.inner = self.inner.set_tags(input);
333        self
334    }
335    /// <p>A comma-separated list of tag key:value pairs that you define. For example:</p>
336    /// <p><code>"Key1": "Value1",</code></p>
337    /// <p><code>"Key2": "Value2"</code></p>
338    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
339        self.inner.get_tags()
340    }
341}