aws_sdk_glue/operation/batch_delete_connection/
_batch_delete_connection_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct BatchDeleteConnectionOutput {
6    /// <p>A list of names of the connection definitions that were successfully deleted.</p>
7    pub succeeded: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>A map of the names of connections that were not successfully deleted to error details.</p>
9    pub errors: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ErrorDetail>>,
10    _request_id: Option<String>,
11}
12impl BatchDeleteConnectionOutput {
13    /// <p>A list of names of the connection definitions that were successfully deleted.</p>
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 `.succeeded.is_none()`.
16    pub fn succeeded(&self) -> &[::std::string::String] {
17        self.succeeded.as_deref().unwrap_or_default()
18    }
19    /// <p>A map of the names of connections that were not successfully deleted to error details.</p>
20    pub fn errors(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ErrorDetail>> {
21        self.errors.as_ref()
22    }
23}
24impl ::aws_types::request_id::RequestId for BatchDeleteConnectionOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl BatchDeleteConnectionOutput {
30    /// Creates a new builder-style object to manufacture [`BatchDeleteConnectionOutput`](crate::operation::batch_delete_connection::BatchDeleteConnectionOutput).
31    pub fn builder() -> crate::operation::batch_delete_connection::builders::BatchDeleteConnectionOutputBuilder {
32        crate::operation::batch_delete_connection::builders::BatchDeleteConnectionOutputBuilder::default()
33    }
34}
35
36/// A builder for [`BatchDeleteConnectionOutput`](crate::operation::batch_delete_connection::BatchDeleteConnectionOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct BatchDeleteConnectionOutputBuilder {
40    pub(crate) succeeded: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
41    pub(crate) errors: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ErrorDetail>>,
42    _request_id: Option<String>,
43}
44impl BatchDeleteConnectionOutputBuilder {
45    /// Appends an item to `succeeded`.
46    ///
47    /// To override the contents of this collection use [`set_succeeded`](Self::set_succeeded).
48    ///
49    /// <p>A list of names of the connection definitions that were successfully deleted.</p>
50    pub fn succeeded(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51        let mut v = self.succeeded.unwrap_or_default();
52        v.push(input.into());
53        self.succeeded = ::std::option::Option::Some(v);
54        self
55    }
56    /// <p>A list of names of the connection definitions that were successfully deleted.</p>
57    pub fn set_succeeded(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
58        self.succeeded = input;
59        self
60    }
61    /// <p>A list of names of the connection definitions that were successfully deleted.</p>
62    pub fn get_succeeded(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
63        &self.succeeded
64    }
65    /// Adds a key-value pair to `errors`.
66    ///
67    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
68    ///
69    /// <p>A map of the names of connections that were not successfully deleted to error details.</p>
70    pub fn errors(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ErrorDetail) -> Self {
71        let mut hash_map = self.errors.unwrap_or_default();
72        hash_map.insert(k.into(), v);
73        self.errors = ::std::option::Option::Some(hash_map);
74        self
75    }
76    /// <p>A map of the names of connections that were not successfully deleted to error details.</p>
77    pub fn set_errors(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ErrorDetail>>) -> Self {
78        self.errors = input;
79        self
80    }
81    /// <p>A map of the names of connections that were not successfully deleted to error details.</p>
82    pub fn get_errors(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ErrorDetail>> {
83        &self.errors
84    }
85    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
86        self._request_id = Some(request_id.into());
87        self
88    }
89
90    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
91        self._request_id = request_id;
92        self
93    }
94    /// Consumes the builder and constructs a [`BatchDeleteConnectionOutput`](crate::operation::batch_delete_connection::BatchDeleteConnectionOutput).
95    pub fn build(self) -> crate::operation::batch_delete_connection::BatchDeleteConnectionOutput {
96        crate::operation::batch_delete_connection::BatchDeleteConnectionOutput {
97            succeeded: self.succeeded,
98            errors: self.errors,
99            _request_id: self._request_id,
100        }
101    }
102}