Skip to main content

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