aws_sdk_medialive/operation/batch_delete/
_batch_delete_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Placeholder documentation for BatchDeleteResponse
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BatchDeleteOutput {
7    /// List of failed operations
8    pub failed: ::std::option::Option<::std::vec::Vec<crate::types::BatchFailedResultModel>>,
9    /// List of successful operations
10    pub successful: ::std::option::Option<::std::vec::Vec<crate::types::BatchSuccessfulResultModel>>,
11    _request_id: Option<String>,
12}
13impl BatchDeleteOutput {
14    /// List of failed operations
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.failed.is_none()`.
17    pub fn failed(&self) -> &[crate::types::BatchFailedResultModel] {
18        self.failed.as_deref().unwrap_or_default()
19    }
20    /// List of successful operations
21    ///
22    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.successful.is_none()`.
23    pub fn successful(&self) -> &[crate::types::BatchSuccessfulResultModel] {
24        self.successful.as_deref().unwrap_or_default()
25    }
26}
27impl ::aws_types::request_id::RequestId for BatchDeleteOutput {
28    fn request_id(&self) -> Option<&str> {
29        self._request_id.as_deref()
30    }
31}
32impl BatchDeleteOutput {
33    /// Creates a new builder-style object to manufacture [`BatchDeleteOutput`](crate::operation::batch_delete::BatchDeleteOutput).
34    pub fn builder() -> crate::operation::batch_delete::builders::BatchDeleteOutputBuilder {
35        crate::operation::batch_delete::builders::BatchDeleteOutputBuilder::default()
36    }
37}
38
39/// A builder for [`BatchDeleteOutput`](crate::operation::batch_delete::BatchDeleteOutput).
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct BatchDeleteOutputBuilder {
43    pub(crate) failed: ::std::option::Option<::std::vec::Vec<crate::types::BatchFailedResultModel>>,
44    pub(crate) successful: ::std::option::Option<::std::vec::Vec<crate::types::BatchSuccessfulResultModel>>,
45    _request_id: Option<String>,
46}
47impl BatchDeleteOutputBuilder {
48    /// Appends an item to `failed`.
49    ///
50    /// To override the contents of this collection use [`set_failed`](Self::set_failed).
51    ///
52    /// List of failed operations
53    pub fn failed(mut self, input: crate::types::BatchFailedResultModel) -> Self {
54        let mut v = self.failed.unwrap_or_default();
55        v.push(input);
56        self.failed = ::std::option::Option::Some(v);
57        self
58    }
59    /// List of failed operations
60    pub fn set_failed(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchFailedResultModel>>) -> Self {
61        self.failed = input;
62        self
63    }
64    /// List of failed operations
65    pub fn get_failed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchFailedResultModel>> {
66        &self.failed
67    }
68    /// Appends an item to `successful`.
69    ///
70    /// To override the contents of this collection use [`set_successful`](Self::set_successful).
71    ///
72    /// List of successful operations
73    pub fn successful(mut self, input: crate::types::BatchSuccessfulResultModel) -> Self {
74        let mut v = self.successful.unwrap_or_default();
75        v.push(input);
76        self.successful = ::std::option::Option::Some(v);
77        self
78    }
79    /// List of successful operations
80    pub fn set_successful(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchSuccessfulResultModel>>) -> Self {
81        self.successful = input;
82        self
83    }
84    /// List of successful operations
85    pub fn get_successful(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchSuccessfulResultModel>> {
86        &self.successful
87    }
88    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
89        self._request_id = Some(request_id.into());
90        self
91    }
92
93    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
94        self._request_id = request_id;
95        self
96    }
97    /// Consumes the builder and constructs a [`BatchDeleteOutput`](crate::operation::batch_delete::BatchDeleteOutput).
98    pub fn build(self) -> crate::operation::batch_delete::BatchDeleteOutput {
99        crate::operation::batch_delete::BatchDeleteOutput {
100            failed: self.failed,
101            successful: self.successful,
102            _request_id: self._request_id,
103        }
104    }
105}