aws_sdk_mediapackage/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/// Creates a new OriginEndpoint record.
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    /// CDN Authorization credentials
112    pub fn authorization(mut self, input: crate::types::Authorization) -> Self {
113        self.inner = self.inner.authorization(input);
114        self
115    }
116    /// CDN Authorization credentials
117    pub fn set_authorization(mut self, input: ::std::option::Option<crate::types::Authorization>) -> Self {
118        self.inner = self.inner.set_authorization(input);
119        self
120    }
121    /// CDN Authorization credentials
122    pub fn get_authorization(&self) -> &::std::option::Option<crate::types::Authorization> {
123        self.inner.get_authorization()
124    }
125    /// The ID of the Channel that the OriginEndpoint will be associated with. This cannot be changed after the OriginEndpoint is created.
126    pub fn channel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.channel_id(input.into());
128        self
129    }
130    /// The ID of the Channel that the OriginEndpoint will be associated with. This cannot be changed after the OriginEndpoint is created.
131    pub fn set_channel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_channel_id(input);
133        self
134    }
135    /// The ID of the Channel that the OriginEndpoint will be associated with. This cannot be changed after the OriginEndpoint is created.
136    pub fn get_channel_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_channel_id()
138    }
139    /// A Common Media Application Format (CMAF) packaging configuration.
140    pub fn cmaf_package(mut self, input: crate::types::CmafPackageCreateOrUpdateParameters) -> Self {
141        self.inner = self.inner.cmaf_package(input);
142        self
143    }
144    /// A Common Media Application Format (CMAF) packaging configuration.
145    pub fn set_cmaf_package(mut self, input: ::std::option::Option<crate::types::CmafPackageCreateOrUpdateParameters>) -> Self {
146        self.inner = self.inner.set_cmaf_package(input);
147        self
148    }
149    /// A Common Media Application Format (CMAF) packaging configuration.
150    pub fn get_cmaf_package(&self) -> &::std::option::Option<crate::types::CmafPackageCreateOrUpdateParameters> {
151        self.inner.get_cmaf_package()
152    }
153    /// A Dynamic Adaptive Streaming over HTTP (DASH) packaging configuration.
154    pub fn dash_package(mut self, input: crate::types::DashPackage) -> Self {
155        self.inner = self.inner.dash_package(input);
156        self
157    }
158    /// A Dynamic Adaptive Streaming over HTTP (DASH) packaging configuration.
159    pub fn set_dash_package(mut self, input: ::std::option::Option<crate::types::DashPackage>) -> Self {
160        self.inner = self.inner.set_dash_package(input);
161        self
162    }
163    /// A Dynamic Adaptive Streaming over HTTP (DASH) packaging configuration.
164    pub fn get_dash_package(&self) -> &::std::option::Option<crate::types::DashPackage> {
165        self.inner.get_dash_package()
166    }
167    /// A short text description of the OriginEndpoint.
168    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.description(input.into());
170        self
171    }
172    /// A short text description of the OriginEndpoint.
173    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_description(input);
175        self
176    }
177    /// A short text description of the OriginEndpoint.
178    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_description()
180    }
181    /// An HTTP Live Streaming (HLS) packaging configuration.
182    pub fn hls_package(mut self, input: crate::types::HlsPackage) -> Self {
183        self.inner = self.inner.hls_package(input);
184        self
185    }
186    /// An HTTP Live Streaming (HLS) packaging configuration.
187    pub fn set_hls_package(mut self, input: ::std::option::Option<crate::types::HlsPackage>) -> Self {
188        self.inner = self.inner.set_hls_package(input);
189        self
190    }
191    /// An HTTP Live Streaming (HLS) packaging configuration.
192    pub fn get_hls_package(&self) -> &::std::option::Option<crate::types::HlsPackage> {
193        self.inner.get_hls_package()
194    }
195    /// The ID of the OriginEndpoint. The ID must be unique within the region and it cannot be changed after the OriginEndpoint is created.
196    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.id(input.into());
198        self
199    }
200    /// The ID of the OriginEndpoint. The ID must be unique within the region and it cannot be changed after the OriginEndpoint is created.
201    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_id(input);
203        self
204    }
205    /// The ID of the OriginEndpoint. The ID must be unique within the region and it cannot be changed after the OriginEndpoint is created.
206    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_id()
208    }
209    /// A short string that will be used as the filename of the OriginEndpoint URL (defaults to "index").
210    pub fn manifest_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.inner = self.inner.manifest_name(input.into());
212        self
213    }
214    /// A short string that will be used as the filename of the OriginEndpoint URL (defaults to "index").
215    pub fn set_manifest_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_manifest_name(input);
217        self
218    }
219    /// A short string that will be used as the filename of the OriginEndpoint URL (defaults to "index").
220    pub fn get_manifest_name(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_manifest_name()
222    }
223    /// A Microsoft Smooth Streaming (MSS) packaging configuration.
224    pub fn mss_package(mut self, input: crate::types::MssPackage) -> Self {
225        self.inner = self.inner.mss_package(input);
226        self
227    }
228    /// A Microsoft Smooth Streaming (MSS) packaging configuration.
229    pub fn set_mss_package(mut self, input: ::std::option::Option<crate::types::MssPackage>) -> Self {
230        self.inner = self.inner.set_mss_package(input);
231        self
232    }
233    /// A Microsoft Smooth Streaming (MSS) packaging configuration.
234    pub fn get_mss_package(&self) -> &::std::option::Option<crate::types::MssPackage> {
235        self.inner.get_mss_package()
236    }
237    /// Control whether origination of video is allowed for this OriginEndpoint. If set to ALLOW, the OriginEndpoint may by requested, pursuant to any other form of access control. If set to DENY, the OriginEndpoint may not be requested. This can be helpful for Live to VOD harvesting, or for temporarily disabling origination
238    pub fn origination(mut self, input: crate::types::Origination) -> Self {
239        self.inner = self.inner.origination(input);
240        self
241    }
242    /// Control whether origination of video is allowed for this OriginEndpoint. If set to ALLOW, the OriginEndpoint may by requested, pursuant to any other form of access control. If set to DENY, the OriginEndpoint may not be requested. This can be helpful for Live to VOD harvesting, or for temporarily disabling origination
243    pub fn set_origination(mut self, input: ::std::option::Option<crate::types::Origination>) -> Self {
244        self.inner = self.inner.set_origination(input);
245        self
246    }
247    /// Control whether origination of video is allowed for this OriginEndpoint. If set to ALLOW, the OriginEndpoint may by requested, pursuant to any other form of access control. If set to DENY, the OriginEndpoint may not be requested. This can be helpful for Live to VOD harvesting, or for temporarily disabling origination
248    pub fn get_origination(&self) -> &::std::option::Option<crate::types::Origination> {
249        self.inner.get_origination()
250    }
251    /// Maximum duration (seconds) of content to retain for startover playback. If not specified, startover playback will be disabled for the OriginEndpoint.
252    pub fn startover_window_seconds(mut self, input: i32) -> Self {
253        self.inner = self.inner.startover_window_seconds(input);
254        self
255    }
256    /// Maximum duration (seconds) of content to retain for startover playback. If not specified, startover playback will be disabled for the OriginEndpoint.
257    pub fn set_startover_window_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
258        self.inner = self.inner.set_startover_window_seconds(input);
259        self
260    }
261    /// Maximum duration (seconds) of content to retain for startover playback. If not specified, startover playback will be disabled for the OriginEndpoint.
262    pub fn get_startover_window_seconds(&self) -> &::std::option::Option<i32> {
263        self.inner.get_startover_window_seconds()
264    }
265    ///
266    /// Adds a key-value pair to `Tags`.
267    ///
268    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
269    ///
270    /// A collection of tags associated with a resource
271    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
272        self.inner = self.inner.tags(k.into(), v.into());
273        self
274    }
275    /// A collection of tags associated with a resource
276    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
277        self.inner = self.inner.set_tags(input);
278        self
279    }
280    /// A collection of tags associated with a resource
281    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
282        self.inner.get_tags()
283    }
284    /// Amount of delay (seconds) to enforce on the playback of live content. If not specified, there will be no time delay in effect for the OriginEndpoint.
285    pub fn time_delay_seconds(mut self, input: i32) -> Self {
286        self.inner = self.inner.time_delay_seconds(input);
287        self
288    }
289    /// Amount of delay (seconds) to enforce on the playback of live content. If not specified, there will be no time delay in effect for the OriginEndpoint.
290    pub fn set_time_delay_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
291        self.inner = self.inner.set_time_delay_seconds(input);
292        self
293    }
294    /// Amount of delay (seconds) to enforce on the playback of live content. If not specified, there will be no time delay in effect for the OriginEndpoint.
295    pub fn get_time_delay_seconds(&self) -> &::std::option::Option<i32> {
296        self.inner.get_time_delay_seconds()
297    }
298    ///
299    /// Appends an item to `Whitelist`.
300    ///
301    /// To override the contents of this collection use [`set_whitelist`](Self::set_whitelist).
302    ///
303    /// A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint.
304    pub fn whitelist(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305        self.inner = self.inner.whitelist(input.into());
306        self
307    }
308    /// A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint.
309    pub fn set_whitelist(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
310        self.inner = self.inner.set_whitelist(input);
311        self
312    }
313    /// A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint.
314    pub fn get_whitelist(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
315        self.inner.get_whitelist()
316    }
317}