aws_sdk_ivs/types/
_rendition_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Object that describes which renditions should be recorded for a stream.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RenditionConfiguration {
7    /// <p>Indicates which set of renditions are recorded for a stream. For <code>BASIC</code> channels, the <code>CUSTOM</code> value has no effect. If <code>CUSTOM</code> is specified, a set of renditions must be specified in the <code>renditions</code> field. Default: <code>ALL</code>.</p>
8    pub rendition_selection: ::std::option::Option<crate::types::RenditionConfigurationRenditionSelection>,
9    /// <p>Indicates which renditions are recorded for a stream, if <code>renditionSelection</code> is <code>CUSTOM</code>; otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the resolution dimensions of each rendition, see <a href="https://docs.aws.amazon.com/ivs/latest/userguide/record-to-s3.html">Auto-Record to Amazon S3</a>.</p>
10    pub renditions: ::std::option::Option<::std::vec::Vec<crate::types::RenditionConfigurationRendition>>,
11}
12impl RenditionConfiguration {
13    /// <p>Indicates which set of renditions are recorded for a stream. For <code>BASIC</code> channels, the <code>CUSTOM</code> value has no effect. If <code>CUSTOM</code> is specified, a set of renditions must be specified in the <code>renditions</code> field. Default: <code>ALL</code>.</p>
14    pub fn rendition_selection(&self) -> ::std::option::Option<&crate::types::RenditionConfigurationRenditionSelection> {
15        self.rendition_selection.as_ref()
16    }
17    /// <p>Indicates which renditions are recorded for a stream, if <code>renditionSelection</code> is <code>CUSTOM</code>; otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the resolution dimensions of each rendition, see <a href="https://docs.aws.amazon.com/ivs/latest/userguide/record-to-s3.html">Auto-Record to Amazon S3</a>.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.renditions.is_none()`.
20    pub fn renditions(&self) -> &[crate::types::RenditionConfigurationRendition] {
21        self.renditions.as_deref().unwrap_or_default()
22    }
23}
24impl RenditionConfiguration {
25    /// Creates a new builder-style object to manufacture [`RenditionConfiguration`](crate::types::RenditionConfiguration).
26    pub fn builder() -> crate::types::builders::RenditionConfigurationBuilder {
27        crate::types::builders::RenditionConfigurationBuilder::default()
28    }
29}
30
31/// A builder for [`RenditionConfiguration`](crate::types::RenditionConfiguration).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct RenditionConfigurationBuilder {
35    pub(crate) rendition_selection: ::std::option::Option<crate::types::RenditionConfigurationRenditionSelection>,
36    pub(crate) renditions: ::std::option::Option<::std::vec::Vec<crate::types::RenditionConfigurationRendition>>,
37}
38impl RenditionConfigurationBuilder {
39    /// <p>Indicates which set of renditions are recorded for a stream. For <code>BASIC</code> channels, the <code>CUSTOM</code> value has no effect. If <code>CUSTOM</code> is specified, a set of renditions must be specified in the <code>renditions</code> field. Default: <code>ALL</code>.</p>
40    pub fn rendition_selection(mut self, input: crate::types::RenditionConfigurationRenditionSelection) -> Self {
41        self.rendition_selection = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>Indicates which set of renditions are recorded for a stream. For <code>BASIC</code> channels, the <code>CUSTOM</code> value has no effect. If <code>CUSTOM</code> is specified, a set of renditions must be specified in the <code>renditions</code> field. Default: <code>ALL</code>.</p>
45    pub fn set_rendition_selection(mut self, input: ::std::option::Option<crate::types::RenditionConfigurationRenditionSelection>) -> Self {
46        self.rendition_selection = input;
47        self
48    }
49    /// <p>Indicates which set of renditions are recorded for a stream. For <code>BASIC</code> channels, the <code>CUSTOM</code> value has no effect. If <code>CUSTOM</code> is specified, a set of renditions must be specified in the <code>renditions</code> field. Default: <code>ALL</code>.</p>
50    pub fn get_rendition_selection(&self) -> &::std::option::Option<crate::types::RenditionConfigurationRenditionSelection> {
51        &self.rendition_selection
52    }
53    /// Appends an item to `renditions`.
54    ///
55    /// To override the contents of this collection use [`set_renditions`](Self::set_renditions).
56    ///
57    /// <p>Indicates which renditions are recorded for a stream, if <code>renditionSelection</code> is <code>CUSTOM</code>; otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the resolution dimensions of each rendition, see <a href="https://docs.aws.amazon.com/ivs/latest/userguide/record-to-s3.html">Auto-Record to Amazon S3</a>.</p>
58    pub fn renditions(mut self, input: crate::types::RenditionConfigurationRendition) -> Self {
59        let mut v = self.renditions.unwrap_or_default();
60        v.push(input);
61        self.renditions = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>Indicates which renditions are recorded for a stream, if <code>renditionSelection</code> is <code>CUSTOM</code>; otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the resolution dimensions of each rendition, see <a href="https://docs.aws.amazon.com/ivs/latest/userguide/record-to-s3.html">Auto-Record to Amazon S3</a>.</p>
65    pub fn set_renditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RenditionConfigurationRendition>>) -> Self {
66        self.renditions = input;
67        self
68    }
69    /// <p>Indicates which renditions are recorded for a stream, if <code>renditionSelection</code> is <code>CUSTOM</code>; otherwise, this field is irrelevant. The selected renditions are recorded if they are available during the stream. If a selected rendition is unavailable, the best available rendition is recorded. For details on the resolution dimensions of each rendition, see <a href="https://docs.aws.amazon.com/ivs/latest/userguide/record-to-s3.html">Auto-Record to Amazon S3</a>.</p>
70    pub fn get_renditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RenditionConfigurationRendition>> {
71        &self.renditions
72    }
73    /// Consumes the builder and constructs a [`RenditionConfiguration`](crate::types::RenditionConfiguration).
74    pub fn build(self) -> crate::types::RenditionConfiguration {
75        crate::types::RenditionConfiguration {
76            rendition_selection: self.rendition_selection,
77            renditions: self.renditions,
78        }
79    }
80}