aws_sdk_lookoutvision/operation/detect_anomalies/
_detect_anomalies_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub struct DetectAnomaliesInput {
6 pub project_name: ::std::option::Option<::std::string::String>,
8 pub model_version: ::std::option::Option<::std::string::String>,
10 pub body: ::aws_smithy_types::byte_stream::ByteStream,
12 pub content_type: ::std::option::Option<::std::string::String>,
14}
15impl DetectAnomaliesInput {
16 pub fn project_name(&self) -> ::std::option::Option<&str> {
18 self.project_name.as_deref()
19 }
20 pub fn model_version(&self) -> ::std::option::Option<&str> {
22 self.model_version.as_deref()
23 }
24 pub fn body(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
26 &self.body
27 }
28 pub fn content_type(&self) -> ::std::option::Option<&str> {
30 self.content_type.as_deref()
31 }
32}
33impl DetectAnomaliesInput {
34 pub fn builder() -> crate::operation::detect_anomalies::builders::DetectAnomaliesInputBuilder {
36 crate::operation::detect_anomalies::builders::DetectAnomaliesInputBuilder::default()
37 }
38}
39
40#[derive(::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct DetectAnomaliesInputBuilder {
44 pub(crate) project_name: ::std::option::Option<::std::string::String>,
45 pub(crate) model_version: ::std::option::Option<::std::string::String>,
46 pub(crate) body: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
47 pub(crate) content_type: ::std::option::Option<::std::string::String>,
48}
49impl DetectAnomaliesInputBuilder {
50 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53 self.project_name = ::std::option::Option::Some(input.into());
54 self
55 }
56 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.project_name = input;
59 self
60 }
61 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
63 &self.project_name
64 }
65 pub fn model_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.model_version = ::std::option::Option::Some(input.into());
69 self
70 }
71 pub fn set_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73 self.model_version = input;
74 self
75 }
76 pub fn get_model_version(&self) -> &::std::option::Option<::std::string::String> {
78 &self.model_version
79 }
80 pub fn body(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
83 self.body = ::std::option::Option::Some(input);
84 self
85 }
86 pub fn set_body(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
88 self.body = input;
89 self
90 }
91 pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
93 &self.body
94 }
95 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98 self.content_type = ::std::option::Option::Some(input.into());
99 self
100 }
101 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.content_type = input;
104 self
105 }
106 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
108 &self.content_type
109 }
110 pub fn build(
112 self,
113 ) -> ::std::result::Result<crate::operation::detect_anomalies::DetectAnomaliesInput, ::aws_smithy_types::error::operation::BuildError> {
114 ::std::result::Result::Ok(crate::operation::detect_anomalies::DetectAnomaliesInput {
115 project_name: self.project_name,
116 model_version: self.model_version,
117 body: self.body.unwrap_or_default(),
118 content_type: self.content_type,
119 })
120 }
121}