aws_sdk_timestreamquery/operation/prepare_query/
_prepare_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)]
5pub struct PrepareQueryInput {
6    /// <p>The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string <code>@</code> character followed by an identifier.</p>
7    pub query_string: ::std::option::Option<::std::string::String>,
8    /// <p>By setting this value to <code>true</code>, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.</p>
9    pub validate_only: ::std::option::Option<bool>,
10}
11impl PrepareQueryInput {
12    /// <p>The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string <code>@</code> character followed by an identifier.</p>
13    pub fn query_string(&self) -> ::std::option::Option<&str> {
14        self.query_string.as_deref()
15    }
16    /// <p>By setting this value to <code>true</code>, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.</p>
17    pub fn validate_only(&self) -> ::std::option::Option<bool> {
18        self.validate_only
19    }
20}
21impl ::std::fmt::Debug for PrepareQueryInput {
22    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23        let mut formatter = f.debug_struct("PrepareQueryInput");
24        formatter.field("query_string", &"*** Sensitive Data Redacted ***");
25        formatter.field("validate_only", &self.validate_only);
26        formatter.finish()
27    }
28}
29impl PrepareQueryInput {
30    /// Creates a new builder-style object to manufacture [`PrepareQueryInput`](crate::operation::prepare_query::PrepareQueryInput).
31    pub fn builder() -> crate::operation::prepare_query::builders::PrepareQueryInputBuilder {
32        crate::operation::prepare_query::builders::PrepareQueryInputBuilder::default()
33    }
34}
35
36/// A builder for [`PrepareQueryInput`](crate::operation::prepare_query::PrepareQueryInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
38#[non_exhaustive]
39pub struct PrepareQueryInputBuilder {
40    pub(crate) query_string: ::std::option::Option<::std::string::String>,
41    pub(crate) validate_only: ::std::option::Option<bool>,
42}
43impl PrepareQueryInputBuilder {
44    /// <p>The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string <code>@</code> character followed by an identifier.</p>
45    /// This field is required.
46    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.query_string = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string <code>@</code> character followed by an identifier.</p>
51    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.query_string = input;
53        self
54    }
55    /// <p>The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string <code>@</code> character followed by an identifier.</p>
56    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
57        &self.query_string
58    }
59    /// <p>By setting this value to <code>true</code>, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.</p>
60    pub fn validate_only(mut self, input: bool) -> Self {
61        self.validate_only = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>By setting this value to <code>true</code>, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.</p>
65    pub fn set_validate_only(mut self, input: ::std::option::Option<bool>) -> Self {
66        self.validate_only = input;
67        self
68    }
69    /// <p>By setting this value to <code>true</code>, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.</p>
70    pub fn get_validate_only(&self) -> &::std::option::Option<bool> {
71        &self.validate_only
72    }
73    /// Consumes the builder and constructs a [`PrepareQueryInput`](crate::operation::prepare_query::PrepareQueryInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<crate::operation::prepare_query::PrepareQueryInput, ::aws_smithy_types::error::operation::BuildError> {
77        ::std::result::Result::Ok(crate::operation::prepare_query::PrepareQueryInput {
78            query_string: self.query_string,
79            validate_only: self.validate_only,
80        })
81    }
82}
83impl ::std::fmt::Debug for PrepareQueryInputBuilder {
84    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
85        let mut formatter = f.debug_struct("PrepareQueryInputBuilder");
86        formatter.field("query_string", &"*** Sensitive Data Redacted ***");
87        formatter.field("validate_only", &self.validate_only);
88        formatter.finish()
89    }
90}