aws_sdk_dynamodb/operation/execute_transaction/
_execute_transaction_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 ExecuteTransactionOutput  {
6    /// <p>The response to a PartiQL transaction.</p>
7    pub responses: ::std::option::Option<::std::vec::Vec::<crate::types::ItemResponse>>,
8    /// <p>The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.</p>
9    pub consumed_capacity: ::std::option::Option<::std::vec::Vec::<crate::types::ConsumedCapacity>>,
10    _request_id: Option<String>,
11}
12impl  ExecuteTransactionOutput  {
13    /// <p>The response to a PartiQL transaction.</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 `.responses.is_none()`.
16    pub fn responses(&self) -> &[crate::types::ItemResponse] {
17        self.responses.as_deref()
18        .unwrap_or_default()
19    }
20    /// <p>The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.</p>
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 `.consumed_capacity.is_none()`.
23    pub fn consumed_capacity(&self) -> &[crate::types::ConsumedCapacity] {
24        self.consumed_capacity.as_deref()
25        .unwrap_or_default()
26    }
27}
28impl ::aws_types::request_id::RequestId for ExecuteTransactionOutput {
29                                    fn request_id(&self) -> Option<&str> {
30                                        self._request_id.as_deref()
31                                    }
32                                }
33impl ExecuteTransactionOutput {
34    /// Creates a new builder-style object to manufacture [`ExecuteTransactionOutput`](crate::operation::execute_transaction::ExecuteTransactionOutput).
35    pub fn builder() -> crate::operation::execute_transaction::builders::ExecuteTransactionOutputBuilder {
36        crate::operation::execute_transaction::builders::ExecuteTransactionOutputBuilder::default()
37    }
38}
39
40/// A builder for [`ExecuteTransactionOutput`](crate::operation::execute_transaction::ExecuteTransactionOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct ExecuteTransactionOutputBuilder {
44    pub(crate) responses: ::std::option::Option<::std::vec::Vec::<crate::types::ItemResponse>>,
45    pub(crate) consumed_capacity: ::std::option::Option<::std::vec::Vec::<crate::types::ConsumedCapacity>>,
46    _request_id: Option<String>,
47}
48impl ExecuteTransactionOutputBuilder {
49    /// Appends an item to `responses`.
50    ///
51    /// To override the contents of this collection use [`set_responses`](Self::set_responses).
52    ///
53    /// <p>The response to a PartiQL transaction.</p>
54    pub fn responses(mut self, input: crate::types::ItemResponse) -> Self {
55        let mut v = self.responses.unwrap_or_default();
56                        v.push(input);
57                        self.responses = ::std::option::Option::Some(v);
58                        self
59    }
60    /// <p>The response to a PartiQL transaction.</p>
61    pub fn set_responses(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ItemResponse>>) -> Self {
62        self.responses = input; self
63    }
64    /// <p>The response to a PartiQL transaction.</p>
65    pub fn get_responses(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ItemResponse>> {
66        &self.responses
67    }
68    /// Appends an item to `consumed_capacity`.
69    ///
70    /// To override the contents of this collection use [`set_consumed_capacity`](Self::set_consumed_capacity).
71    ///
72    /// <p>The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.</p>
73    pub fn consumed_capacity(mut self, input: crate::types::ConsumedCapacity) -> Self {
74        let mut v = self.consumed_capacity.unwrap_or_default();
75                        v.push(input);
76                        self.consumed_capacity = ::std::option::Option::Some(v);
77                        self
78    }
79    /// <p>The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.</p>
80    pub fn set_consumed_capacity(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ConsumedCapacity>>) -> Self {
81        self.consumed_capacity = input; self
82    }
83    /// <p>The capacity units consumed by the entire operation. The values of the list are ordered according to the ordering of the statements.</p>
84    pub fn get_consumed_capacity(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ConsumedCapacity>> {
85        &self.consumed_capacity
86    }
87    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
88                                        self._request_id = Some(request_id.into());
89                                        self
90                                    }
91    
92                                    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
93                                        self._request_id = request_id;
94                                        self
95                                    }
96    /// Consumes the builder and constructs a [`ExecuteTransactionOutput`](crate::operation::execute_transaction::ExecuteTransactionOutput).
97    pub fn build(self) -> crate::operation::execute_transaction::ExecuteTransactionOutput {
98        crate::operation::execute_transaction::ExecuteTransactionOutput {
99            responses: self.responses
100            ,
101            consumed_capacity: self.consumed_capacity
102            ,
103            _request_id: self._request_id,
104        }
105    }
106}
107