Skip to main content

aws_sdk_athena/operation/create_prepared_statement/
_create_prepared_statement_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 CreatePreparedStatementInput {
6    /// <p>The name of the prepared statement.</p>
7    pub statement_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the workgroup to which the prepared statement belongs.</p>
9    pub work_group: ::std::option::Option<::std::string::String>,
10    /// <p>The query string for the prepared statement.</p>
11    pub query_statement: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the prepared statement.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14}
15impl CreatePreparedStatementInput {
16    /// <p>The name of the prepared statement.</p>
17    pub fn statement_name(&self) -> ::std::option::Option<&str> {
18        self.statement_name.as_deref()
19    }
20    /// <p>The name of the workgroup to which the prepared statement belongs.</p>
21    pub fn work_group(&self) -> ::std::option::Option<&str> {
22        self.work_group.as_deref()
23    }
24    /// <p>The query string for the prepared statement.</p>
25    pub fn query_statement(&self) -> ::std::option::Option<&str> {
26        self.query_statement.as_deref()
27    }
28    /// <p>The description of the prepared statement.</p>
29    pub fn description(&self) -> ::std::option::Option<&str> {
30        self.description.as_deref()
31    }
32}
33impl CreatePreparedStatementInput {
34    /// Creates a new builder-style object to manufacture [`CreatePreparedStatementInput`](crate::operation::create_prepared_statement::CreatePreparedStatementInput).
35    pub fn builder() -> crate::operation::create_prepared_statement::builders::CreatePreparedStatementInputBuilder {
36        crate::operation::create_prepared_statement::builders::CreatePreparedStatementInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreatePreparedStatementInput`](crate::operation::create_prepared_statement::CreatePreparedStatementInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreatePreparedStatementInputBuilder {
44    pub(crate) statement_name: ::std::option::Option<::std::string::String>,
45    pub(crate) work_group: ::std::option::Option<::std::string::String>,
46    pub(crate) query_statement: ::std::option::Option<::std::string::String>,
47    pub(crate) description: ::std::option::Option<::std::string::String>,
48}
49impl CreatePreparedStatementInputBuilder {
50    /// <p>The name of the prepared statement.</p>
51    /// This field is required.
52    pub fn statement_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.statement_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the prepared statement.</p>
57    pub fn set_statement_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.statement_name = input;
59        self
60    }
61    /// <p>The name of the prepared statement.</p>
62    pub fn get_statement_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.statement_name
64    }
65    /// <p>The name of the workgroup to which the prepared statement belongs.</p>
66    /// This field is required.
67    pub fn work_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.work_group = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The name of the workgroup to which the prepared statement belongs.</p>
72    pub fn set_work_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.work_group = input;
74        self
75    }
76    /// <p>The name of the workgroup to which the prepared statement belongs.</p>
77    pub fn get_work_group(&self) -> &::std::option::Option<::std::string::String> {
78        &self.work_group
79    }
80    /// <p>The query string for the prepared statement.</p>
81    /// This field is required.
82    pub fn query_statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.query_statement = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The query string for the prepared statement.</p>
87    pub fn set_query_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.query_statement = input;
89        self
90    }
91    /// <p>The query string for the prepared statement.</p>
92    pub fn get_query_statement(&self) -> &::std::option::Option<::std::string::String> {
93        &self.query_statement
94    }
95    /// <p>The description of the prepared statement.</p>
96    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.description = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The description of the prepared statement.</p>
101    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.description = input;
103        self
104    }
105    /// <p>The description of the prepared statement.</p>
106    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
107        &self.description
108    }
109    /// Consumes the builder and constructs a [`CreatePreparedStatementInput`](crate::operation::create_prepared_statement::CreatePreparedStatementInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<
113        crate::operation::create_prepared_statement::CreatePreparedStatementInput,
114        ::aws_smithy_types::error::operation::BuildError,
115    > {
116        ::std::result::Result::Ok(crate::operation::create_prepared_statement::CreatePreparedStatementInput {
117            statement_name: self.statement_name,
118            work_group: self.work_group,
119            query_statement: self.query_statement,
120            description: self.description,
121        })
122    }
123}