aws_sdk_iot/operation/get_percentiles/
_get_percentiles_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetPercentilesInput {
6 pub index_name: ::std::option::Option<::std::string::String>,
8 pub query_string: ::std::option::Option<::std::string::String>,
10 pub aggregation_field: ::std::option::Option<::std::string::String>,
12 pub query_version: ::std::option::Option<::std::string::String>,
14 pub percents: ::std::option::Option<::std::vec::Vec<f64>>,
16}
17impl GetPercentilesInput {
18 pub fn index_name(&self) -> ::std::option::Option<&str> {
20 self.index_name.as_deref()
21 }
22 pub fn query_string(&self) -> ::std::option::Option<&str> {
24 self.query_string.as_deref()
25 }
26 pub fn aggregation_field(&self) -> ::std::option::Option<&str> {
28 self.aggregation_field.as_deref()
29 }
30 pub fn query_version(&self) -> ::std::option::Option<&str> {
32 self.query_version.as_deref()
33 }
34 pub fn percents(&self) -> &[f64] {
38 self.percents.as_deref().unwrap_or_default()
39 }
40}
41impl GetPercentilesInput {
42 pub fn builder() -> crate::operation::get_percentiles::builders::GetPercentilesInputBuilder {
44 crate::operation::get_percentiles::builders::GetPercentilesInputBuilder::default()
45 }
46}
47
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct GetPercentilesInputBuilder {
52 pub(crate) index_name: ::std::option::Option<::std::string::String>,
53 pub(crate) query_string: ::std::option::Option<::std::string::String>,
54 pub(crate) aggregation_field: ::std::option::Option<::std::string::String>,
55 pub(crate) query_version: ::std::option::Option<::std::string::String>,
56 pub(crate) percents: ::std::option::Option<::std::vec::Vec<f64>>,
57}
58impl GetPercentilesInputBuilder {
59 pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.index_name = ::std::option::Option::Some(input.into());
62 self
63 }
64 pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.index_name = input;
67 self
68 }
69 pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
71 &self.index_name
72 }
73 pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.query_string = ::std::option::Option::Some(input.into());
77 self
78 }
79 pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.query_string = input;
82 self
83 }
84 pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
86 &self.query_string
87 }
88 pub fn aggregation_field(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.aggregation_field = ::std::option::Option::Some(input.into());
91 self
92 }
93 pub fn set_aggregation_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.aggregation_field = input;
96 self
97 }
98 pub fn get_aggregation_field(&self) -> &::std::option::Option<::std::string::String> {
100 &self.aggregation_field
101 }
102 pub fn query_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.query_version = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_query_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.query_version = input;
110 self
111 }
112 pub fn get_query_version(&self) -> &::std::option::Option<::std::string::String> {
114 &self.query_version
115 }
116 pub fn percents(mut self, input: f64) -> Self {
122 let mut v = self.percents.unwrap_or_default();
123 v.push(input);
124 self.percents = ::std::option::Option::Some(v);
125 self
126 }
127 pub fn set_percents(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
129 self.percents = input;
130 self
131 }
132 pub fn get_percents(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
134 &self.percents
135 }
136 pub fn build(
138 self,
139 ) -> ::std::result::Result<crate::operation::get_percentiles::GetPercentilesInput, ::aws_smithy_types::error::operation::BuildError> {
140 ::std::result::Result::Ok(crate::operation::get_percentiles::GetPercentilesInput {
141 index_name: self.index_name,
142 query_string: self.query_string,
143 aggregation_field: self.aggregation_field,
144 query_version: self.query_version,
145 percents: self.percents,
146 })
147 }
148}