aws_sdk_qldbsession/operation/send_command/
_send_command_input.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 SendCommandInput {
6    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
7    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
8    pub session_token: ::std::option::Option<::std::string::String>,
9    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
10    pub start_session: ::std::option::Option<crate::types::StartSessionRequest>,
11    /// <p>Command to start a new transaction.</p>
12    pub start_transaction: ::std::option::Option<crate::types::StartTransactionRequest>,
13    /// <p>Command to end the current session.</p>
14    pub end_session: ::std::option::Option<crate::types::EndSessionRequest>,
15    /// <p>Command to commit the specified transaction.</p>
16    pub commit_transaction: ::std::option::Option<crate::types::CommitTransactionRequest>,
17    /// <p>Command to abort the current transaction.</p>
18    pub abort_transaction: ::std::option::Option<crate::types::AbortTransactionRequest>,
19    /// <p>Command to execute a statement in the specified transaction.</p>
20    pub execute_statement: ::std::option::Option<crate::types::ExecuteStatementRequest>,
21    /// <p>Command to fetch a page.</p>
22    pub fetch_page: ::std::option::Option<crate::types::FetchPageRequest>,
23}
24impl SendCommandInput {
25    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
26    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
27    pub fn session_token(&self) -> ::std::option::Option<&str> {
28        self.session_token.as_deref()
29    }
30    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
31    pub fn start_session(&self) -> ::std::option::Option<&crate::types::StartSessionRequest> {
32        self.start_session.as_ref()
33    }
34    /// <p>Command to start a new transaction.</p>
35    pub fn start_transaction(&self) -> ::std::option::Option<&crate::types::StartTransactionRequest> {
36        self.start_transaction.as_ref()
37    }
38    /// <p>Command to end the current session.</p>
39    pub fn end_session(&self) -> ::std::option::Option<&crate::types::EndSessionRequest> {
40        self.end_session.as_ref()
41    }
42    /// <p>Command to commit the specified transaction.</p>
43    pub fn commit_transaction(&self) -> ::std::option::Option<&crate::types::CommitTransactionRequest> {
44        self.commit_transaction.as_ref()
45    }
46    /// <p>Command to abort the current transaction.</p>
47    pub fn abort_transaction(&self) -> ::std::option::Option<&crate::types::AbortTransactionRequest> {
48        self.abort_transaction.as_ref()
49    }
50    /// <p>Command to execute a statement in the specified transaction.</p>
51    pub fn execute_statement(&self) -> ::std::option::Option<&crate::types::ExecuteStatementRequest> {
52        self.execute_statement.as_ref()
53    }
54    /// <p>Command to fetch a page.</p>
55    pub fn fetch_page(&self) -> ::std::option::Option<&crate::types::FetchPageRequest> {
56        self.fetch_page.as_ref()
57    }
58}
59impl SendCommandInput {
60    /// Creates a new builder-style object to manufacture [`SendCommandInput`](crate::operation::send_command::SendCommandInput).
61    pub fn builder() -> crate::operation::send_command::builders::SendCommandInputBuilder {
62        crate::operation::send_command::builders::SendCommandInputBuilder::default()
63    }
64}
65
66/// A builder for [`SendCommandInput`](crate::operation::send_command::SendCommandInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct SendCommandInputBuilder {
70    pub(crate) session_token: ::std::option::Option<::std::string::String>,
71    pub(crate) start_session: ::std::option::Option<crate::types::StartSessionRequest>,
72    pub(crate) start_transaction: ::std::option::Option<crate::types::StartTransactionRequest>,
73    pub(crate) end_session: ::std::option::Option<crate::types::EndSessionRequest>,
74    pub(crate) commit_transaction: ::std::option::Option<crate::types::CommitTransactionRequest>,
75    pub(crate) abort_transaction: ::std::option::Option<crate::types::AbortTransactionRequest>,
76    pub(crate) execute_statement: ::std::option::Option<crate::types::ExecuteStatementRequest>,
77    pub(crate) fetch_page: ::std::option::Option<crate::types::FetchPageRequest>,
78}
79impl SendCommandInputBuilder {
80    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
81    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
82    pub fn session_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.session_token = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
87    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
88    pub fn set_session_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.session_token = input;
90        self
91    }
92    /// <p>Specifies the session token for the current command. A session token is constant throughout the life of the session.</p>
93    /// <p>To obtain a session token, run the <code>StartSession</code> command. This <code>SessionToken</code> is required for every subsequent command that is issued during the current session.</p>
94    pub fn get_session_token(&self) -> &::std::option::Option<::std::string::String> {
95        &self.session_token
96    }
97    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
98    pub fn start_session(mut self, input: crate::types::StartSessionRequest) -> Self {
99        self.start_session = ::std::option::Option::Some(input);
100        self
101    }
102    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
103    pub fn set_start_session(mut self, input: ::std::option::Option<crate::types::StartSessionRequest>) -> Self {
104        self.start_session = input;
105        self
106    }
107    /// <p>Command to start a new session. A session token is obtained as part of the response.</p>
108    pub fn get_start_session(&self) -> &::std::option::Option<crate::types::StartSessionRequest> {
109        &self.start_session
110    }
111    /// <p>Command to start a new transaction.</p>
112    pub fn start_transaction(mut self, input: crate::types::StartTransactionRequest) -> Self {
113        self.start_transaction = ::std::option::Option::Some(input);
114        self
115    }
116    /// <p>Command to start a new transaction.</p>
117    pub fn set_start_transaction(mut self, input: ::std::option::Option<crate::types::StartTransactionRequest>) -> Self {
118        self.start_transaction = input;
119        self
120    }
121    /// <p>Command to start a new transaction.</p>
122    pub fn get_start_transaction(&self) -> &::std::option::Option<crate::types::StartTransactionRequest> {
123        &self.start_transaction
124    }
125    /// <p>Command to end the current session.</p>
126    pub fn end_session(mut self, input: crate::types::EndSessionRequest) -> Self {
127        self.end_session = ::std::option::Option::Some(input);
128        self
129    }
130    /// <p>Command to end the current session.</p>
131    pub fn set_end_session(mut self, input: ::std::option::Option<crate::types::EndSessionRequest>) -> Self {
132        self.end_session = input;
133        self
134    }
135    /// <p>Command to end the current session.</p>
136    pub fn get_end_session(&self) -> &::std::option::Option<crate::types::EndSessionRequest> {
137        &self.end_session
138    }
139    /// <p>Command to commit the specified transaction.</p>
140    pub fn commit_transaction(mut self, input: crate::types::CommitTransactionRequest) -> Self {
141        self.commit_transaction = ::std::option::Option::Some(input);
142        self
143    }
144    /// <p>Command to commit the specified transaction.</p>
145    pub fn set_commit_transaction(mut self, input: ::std::option::Option<crate::types::CommitTransactionRequest>) -> Self {
146        self.commit_transaction = input;
147        self
148    }
149    /// <p>Command to commit the specified transaction.</p>
150    pub fn get_commit_transaction(&self) -> &::std::option::Option<crate::types::CommitTransactionRequest> {
151        &self.commit_transaction
152    }
153    /// <p>Command to abort the current transaction.</p>
154    pub fn abort_transaction(mut self, input: crate::types::AbortTransactionRequest) -> Self {
155        self.abort_transaction = ::std::option::Option::Some(input);
156        self
157    }
158    /// <p>Command to abort the current transaction.</p>
159    pub fn set_abort_transaction(mut self, input: ::std::option::Option<crate::types::AbortTransactionRequest>) -> Self {
160        self.abort_transaction = input;
161        self
162    }
163    /// <p>Command to abort the current transaction.</p>
164    pub fn get_abort_transaction(&self) -> &::std::option::Option<crate::types::AbortTransactionRequest> {
165        &self.abort_transaction
166    }
167    /// <p>Command to execute a statement in the specified transaction.</p>
168    pub fn execute_statement(mut self, input: crate::types::ExecuteStatementRequest) -> Self {
169        self.execute_statement = ::std::option::Option::Some(input);
170        self
171    }
172    /// <p>Command to execute a statement in the specified transaction.</p>
173    pub fn set_execute_statement(mut self, input: ::std::option::Option<crate::types::ExecuteStatementRequest>) -> Self {
174        self.execute_statement = input;
175        self
176    }
177    /// <p>Command to execute a statement in the specified transaction.</p>
178    pub fn get_execute_statement(&self) -> &::std::option::Option<crate::types::ExecuteStatementRequest> {
179        &self.execute_statement
180    }
181    /// <p>Command to fetch a page.</p>
182    pub fn fetch_page(mut self, input: crate::types::FetchPageRequest) -> Self {
183        self.fetch_page = ::std::option::Option::Some(input);
184        self
185    }
186    /// <p>Command to fetch a page.</p>
187    pub fn set_fetch_page(mut self, input: ::std::option::Option<crate::types::FetchPageRequest>) -> Self {
188        self.fetch_page = input;
189        self
190    }
191    /// <p>Command to fetch a page.</p>
192    pub fn get_fetch_page(&self) -> &::std::option::Option<crate::types::FetchPageRequest> {
193        &self.fetch_page
194    }
195    /// Consumes the builder and constructs a [`SendCommandInput`](crate::operation::send_command::SendCommandInput).
196    pub fn build(self) -> ::std::result::Result<crate::operation::send_command::SendCommandInput, ::aws_smithy_types::error::operation::BuildError> {
197        ::std::result::Result::Ok(crate::operation::send_command::SendCommandInput {
198            session_token: self.session_token,
199            start_session: self.start_session,
200            start_transaction: self.start_transaction,
201            end_session: self.end_session,
202            commit_transaction: self.commit_transaction,
203            abort_transaction: self.abort_transaction,
204            execute_statement: self.execute_statement,
205            fetch_page: self.fetch_page,
206        })
207    }
208}