aws_sdk_neptunegraph/operation/get_query/
_get_query_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 GetQueryOutput {
6    /// <p>The ID of the query in question.</p>
7    pub id: ::std::option::Option<::std::string::String>,
8    /// <p>The query in question.</p>
9    pub query_string: ::std::option::Option<::std::string::String>,
10    /// <p>Indicates how long the query waited, in milliseconds.</p>
11    pub waited: ::std::option::Option<i32>,
12    /// <p>The number of milliseconds the query has been running.</p>
13    pub elapsed: ::std::option::Option<i32>,
14    /// <p>State of the query.</p>
15    pub state: ::std::option::Option<crate::types::QueryState>,
16    _request_id: Option<String>,
17}
18impl GetQueryOutput {
19    /// <p>The ID of the query in question.</p>
20    pub fn id(&self) -> ::std::option::Option<&str> {
21        self.id.as_deref()
22    }
23    /// <p>The query in question.</p>
24    pub fn query_string(&self) -> ::std::option::Option<&str> {
25        self.query_string.as_deref()
26    }
27    /// <p>Indicates how long the query waited, in milliseconds.</p>
28    pub fn waited(&self) -> ::std::option::Option<i32> {
29        self.waited
30    }
31    /// <p>The number of milliseconds the query has been running.</p>
32    pub fn elapsed(&self) -> ::std::option::Option<i32> {
33        self.elapsed
34    }
35    /// <p>State of the query.</p>
36    pub fn state(&self) -> ::std::option::Option<&crate::types::QueryState> {
37        self.state.as_ref()
38    }
39}
40impl ::aws_types::request_id::RequestId for GetQueryOutput {
41    fn request_id(&self) -> Option<&str> {
42        self._request_id.as_deref()
43    }
44}
45impl GetQueryOutput {
46    /// Creates a new builder-style object to manufacture [`GetQueryOutput`](crate::operation::get_query::GetQueryOutput).
47    pub fn builder() -> crate::operation::get_query::builders::GetQueryOutputBuilder {
48        crate::operation::get_query::builders::GetQueryOutputBuilder::default()
49    }
50}
51
52/// A builder for [`GetQueryOutput`](crate::operation::get_query::GetQueryOutput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct GetQueryOutputBuilder {
56    pub(crate) id: ::std::option::Option<::std::string::String>,
57    pub(crate) query_string: ::std::option::Option<::std::string::String>,
58    pub(crate) waited: ::std::option::Option<i32>,
59    pub(crate) elapsed: ::std::option::Option<i32>,
60    pub(crate) state: ::std::option::Option<crate::types::QueryState>,
61    _request_id: Option<String>,
62}
63impl GetQueryOutputBuilder {
64    /// <p>The ID of the query in question.</p>
65    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The ID of the query in question.</p>
70    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.id = input;
72        self
73    }
74    /// <p>The ID of the query in question.</p>
75    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.id
77    }
78    /// <p>The query in question.</p>
79    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        self.query_string = ::std::option::Option::Some(input.into());
81        self
82    }
83    /// <p>The query in question.</p>
84    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.query_string = input;
86        self
87    }
88    /// <p>The query in question.</p>
89    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
90        &self.query_string
91    }
92    /// <p>Indicates how long the query waited, in milliseconds.</p>
93    pub fn waited(mut self, input: i32) -> Self {
94        self.waited = ::std::option::Option::Some(input);
95        self
96    }
97    /// <p>Indicates how long the query waited, in milliseconds.</p>
98    pub fn set_waited(mut self, input: ::std::option::Option<i32>) -> Self {
99        self.waited = input;
100        self
101    }
102    /// <p>Indicates how long the query waited, in milliseconds.</p>
103    pub fn get_waited(&self) -> &::std::option::Option<i32> {
104        &self.waited
105    }
106    /// <p>The number of milliseconds the query has been running.</p>
107    pub fn elapsed(mut self, input: i32) -> Self {
108        self.elapsed = ::std::option::Option::Some(input);
109        self
110    }
111    /// <p>The number of milliseconds the query has been running.</p>
112    pub fn set_elapsed(mut self, input: ::std::option::Option<i32>) -> Self {
113        self.elapsed = input;
114        self
115    }
116    /// <p>The number of milliseconds the query has been running.</p>
117    pub fn get_elapsed(&self) -> &::std::option::Option<i32> {
118        &self.elapsed
119    }
120    /// <p>State of the query.</p>
121    pub fn state(mut self, input: crate::types::QueryState) -> Self {
122        self.state = ::std::option::Option::Some(input);
123        self
124    }
125    /// <p>State of the query.</p>
126    pub fn set_state(mut self, input: ::std::option::Option<crate::types::QueryState>) -> Self {
127        self.state = input;
128        self
129    }
130    /// <p>State of the query.</p>
131    pub fn get_state(&self) -> &::std::option::Option<crate::types::QueryState> {
132        &self.state
133    }
134    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
135        self._request_id = Some(request_id.into());
136        self
137    }
138
139    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
140        self._request_id = request_id;
141        self
142    }
143    /// Consumes the builder and constructs a [`GetQueryOutput`](crate::operation::get_query::GetQueryOutput).
144    pub fn build(self) -> crate::operation::get_query::GetQueryOutput {
145        crate::operation::get_query::GetQueryOutput {
146            id: self.id,
147            query_string: self.query_string,
148            waited: self.waited,
149            elapsed: self.elapsed,
150            state: self.state,
151            _request_id: self._request_id,
152        }
153    }
154}