aws-sdk-ivs 1.63.0

AWS SDK for Amazon Interactive Video Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchGetChannelOutput {
    /// <p></p>
    pub channels: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>,
    /// <p>Each error object is related to a specific ARN in the request.</p>
    pub errors: ::std::option::Option<::std::vec::Vec<crate::types::BatchError>>,
    _request_id: Option<String>,
}
impl BatchGetChannelOutput {
    /// <p></p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.channels.is_none()`.
    pub fn channels(&self) -> &[crate::types::Channel] {
        self.channels.as_deref().unwrap_or_default()
    }
    /// <p>Each error object is related to a specific ARN in the request.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.errors.is_none()`.
    pub fn errors(&self) -> &[crate::types::BatchError] {
        self.errors.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for BatchGetChannelOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl BatchGetChannelOutput {
    /// Creates a new builder-style object to manufacture [`BatchGetChannelOutput`](crate::operation::batch_get_channel::BatchGetChannelOutput).
    pub fn builder() -> crate::operation::batch_get_channel::builders::BatchGetChannelOutputBuilder {
        crate::operation::batch_get_channel::builders::BatchGetChannelOutputBuilder::default()
    }
}

/// A builder for [`BatchGetChannelOutput`](crate::operation::batch_get_channel::BatchGetChannelOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchGetChannelOutputBuilder {
    pub(crate) channels: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>,
    pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::BatchError>>,
    _request_id: Option<String>,
}
impl BatchGetChannelOutputBuilder {
    /// Appends an item to `channels`.
    ///
    /// To override the contents of this collection use [`set_channels`](Self::set_channels).
    ///
    /// <p></p>
    pub fn channels(mut self, input: crate::types::Channel) -> Self {
        let mut v = self.channels.unwrap_or_default();
        v.push(input);
        self.channels = ::std::option::Option::Some(v);
        self
    }
    /// <p></p>
    pub fn set_channels(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Channel>>) -> Self {
        self.channels = input;
        self
    }
    /// <p></p>
    pub fn get_channels(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Channel>> {
        &self.channels
    }
    /// Appends an item to `errors`.
    ///
    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
    ///
    /// <p>Each error object is related to a specific ARN in the request.</p>
    pub fn errors(mut self, input: crate::types::BatchError) -> Self {
        let mut v = self.errors.unwrap_or_default();
        v.push(input);
        self.errors = ::std::option::Option::Some(v);
        self
    }
    /// <p>Each error object is related to a specific ARN in the request.</p>
    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchError>>) -> Self {
        self.errors = input;
        self
    }
    /// <p>Each error object is related to a specific ARN in the request.</p>
    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchError>> {
        &self.errors
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`BatchGetChannelOutput`](crate::operation::batch_get_channel::BatchGetChannelOutput).
    pub fn build(self) -> crate::operation::batch_get_channel::BatchGetChannelOutput {
        crate::operation::batch_get_channel::BatchGetChannelOutput {
            channels: self.channels,
            errors: self.errors,
            _request_id: self._request_id,
        }
    }
}