aws-sdk-mediaconvert 1.102.0

AWS SDK for AWS Elemental MediaConvert
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// The container of your media file. This information helps you understand the overall structure and details of your media, including format, duration, and track layout.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Container {
    /// The total duration of your media file, in seconds.
    pub duration: ::std::option::Option<f64>,
    /// The format of your media file. For example: MP4, QuickTime (MOV), Matroska (MKV), WebM or MXF. Note that this will be blank if your media file has a format that the MediaConvert Probe operation does not recognize.
    pub format: ::std::option::Option<crate::types::Format>,
    /// Details about each track (video, audio, or data) in the media file.
    pub tracks: ::std::option::Option<::std::vec::Vec<crate::types::Track>>,
}
impl Container {
    /// The total duration of your media file, in seconds.
    pub fn duration(&self) -> ::std::option::Option<f64> {
        self.duration
    }
    /// The format of your media file. For example: MP4, QuickTime (MOV), Matroska (MKV), WebM or MXF. Note that this will be blank if your media file has a format that the MediaConvert Probe operation does not recognize.
    pub fn format(&self) -> ::std::option::Option<&crate::types::Format> {
        self.format.as_ref()
    }
    /// Details about each track (video, audio, or data) in the media file.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tracks.is_none()`.
    pub fn tracks(&self) -> &[crate::types::Track] {
        self.tracks.as_deref().unwrap_or_default()
    }
}
impl Container {
    /// Creates a new builder-style object to manufacture [`Container`](crate::types::Container).
    pub fn builder() -> crate::types::builders::ContainerBuilder {
        crate::types::builders::ContainerBuilder::default()
    }
}

/// A builder for [`Container`](crate::types::Container).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ContainerBuilder {
    pub(crate) duration: ::std::option::Option<f64>,
    pub(crate) format: ::std::option::Option<crate::types::Format>,
    pub(crate) tracks: ::std::option::Option<::std::vec::Vec<crate::types::Track>>,
}
impl ContainerBuilder {
    /// The total duration of your media file, in seconds.
    pub fn duration(mut self, input: f64) -> Self {
        self.duration = ::std::option::Option::Some(input);
        self
    }
    /// The total duration of your media file, in seconds.
    pub fn set_duration(mut self, input: ::std::option::Option<f64>) -> Self {
        self.duration = input;
        self
    }
    /// The total duration of your media file, in seconds.
    pub fn get_duration(&self) -> &::std::option::Option<f64> {
        &self.duration
    }
    /// The format of your media file. For example: MP4, QuickTime (MOV), Matroska (MKV), WebM or MXF. Note that this will be blank if your media file has a format that the MediaConvert Probe operation does not recognize.
    pub fn format(mut self, input: crate::types::Format) -> Self {
        self.format = ::std::option::Option::Some(input);
        self
    }
    /// The format of your media file. For example: MP4, QuickTime (MOV), Matroska (MKV), WebM or MXF. Note that this will be blank if your media file has a format that the MediaConvert Probe operation does not recognize.
    pub fn set_format(mut self, input: ::std::option::Option<crate::types::Format>) -> Self {
        self.format = input;
        self
    }
    /// The format of your media file. For example: MP4, QuickTime (MOV), Matroska (MKV), WebM or MXF. Note that this will be blank if your media file has a format that the MediaConvert Probe operation does not recognize.
    pub fn get_format(&self) -> &::std::option::Option<crate::types::Format> {
        &self.format
    }
    /// Appends an item to `tracks`.
    ///
    /// To override the contents of this collection use [`set_tracks`](Self::set_tracks).
    ///
    /// Details about each track (video, audio, or data) in the media file.
    pub fn tracks(mut self, input: crate::types::Track) -> Self {
        let mut v = self.tracks.unwrap_or_default();
        v.push(input);
        self.tracks = ::std::option::Option::Some(v);
        self
    }
    /// Details about each track (video, audio, or data) in the media file.
    pub fn set_tracks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Track>>) -> Self {
        self.tracks = input;
        self
    }
    /// Details about each track (video, audio, or data) in the media file.
    pub fn get_tracks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Track>> {
        &self.tracks
    }
    /// Consumes the builder and constructs a [`Container`](crate::types::Container).
    pub fn build(self) -> crate::types::Container {
        crate::types::Container {
            duration: self.duration,
            format: self.format,
            tracks: self.tracks,
        }
    }
}