aws_sdk_medialive/types/
_audio_channel_mapping.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Audio Channel Mapping
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AudioChannelMapping {
7    /// Indices and gain values for each input channel that should be remixed into this output channel.
8    pub input_channel_levels: ::std::option::Option<::std::vec::Vec<crate::types::InputChannelLevel>>,
9    /// The index of the output channel being produced.
10    pub output_channel: ::std::option::Option<i32>,
11}
12impl AudioChannelMapping {
13    /// Indices and gain values for each input channel that should be remixed into this output channel.
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.input_channel_levels.is_none()`.
16    pub fn input_channel_levels(&self) -> &[crate::types::InputChannelLevel] {
17        self.input_channel_levels.as_deref().unwrap_or_default()
18    }
19    /// The index of the output channel being produced.
20    pub fn output_channel(&self) -> ::std::option::Option<i32> {
21        self.output_channel
22    }
23}
24impl AudioChannelMapping {
25    /// Creates a new builder-style object to manufacture [`AudioChannelMapping`](crate::types::AudioChannelMapping).
26    pub fn builder() -> crate::types::builders::AudioChannelMappingBuilder {
27        crate::types::builders::AudioChannelMappingBuilder::default()
28    }
29}
30
31/// A builder for [`AudioChannelMapping`](crate::types::AudioChannelMapping).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct AudioChannelMappingBuilder {
35    pub(crate) input_channel_levels: ::std::option::Option<::std::vec::Vec<crate::types::InputChannelLevel>>,
36    pub(crate) output_channel: ::std::option::Option<i32>,
37}
38impl AudioChannelMappingBuilder {
39    /// Appends an item to `input_channel_levels`.
40    ///
41    /// To override the contents of this collection use [`set_input_channel_levels`](Self::set_input_channel_levels).
42    ///
43    /// Indices and gain values for each input channel that should be remixed into this output channel.
44    pub fn input_channel_levels(mut self, input: crate::types::InputChannelLevel) -> Self {
45        let mut v = self.input_channel_levels.unwrap_or_default();
46        v.push(input);
47        self.input_channel_levels = ::std::option::Option::Some(v);
48        self
49    }
50    /// Indices and gain values for each input channel that should be remixed into this output channel.
51    pub fn set_input_channel_levels(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InputChannelLevel>>) -> Self {
52        self.input_channel_levels = input;
53        self
54    }
55    /// Indices and gain values for each input channel that should be remixed into this output channel.
56    pub fn get_input_channel_levels(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InputChannelLevel>> {
57        &self.input_channel_levels
58    }
59    /// The index of the output channel being produced.
60    /// This field is required.
61    pub fn output_channel(mut self, input: i32) -> Self {
62        self.output_channel = ::std::option::Option::Some(input);
63        self
64    }
65    /// The index of the output channel being produced.
66    pub fn set_output_channel(mut self, input: ::std::option::Option<i32>) -> Self {
67        self.output_channel = input;
68        self
69    }
70    /// The index of the output channel being produced.
71    pub fn get_output_channel(&self) -> &::std::option::Option<i32> {
72        &self.output_channel
73    }
74    /// Consumes the builder and constructs a [`AudioChannelMapping`](crate::types::AudioChannelMapping).
75    pub fn build(self) -> crate::types::AudioChannelMapping {
76        crate::types::AudioChannelMapping {
77            input_channel_levels: self.input_channel_levels,
78            output_channel: self.output_channel,
79        }
80    }
81}