aws_sdk_lookoutvision/operation/detect_anomalies/
_detect_anomalies_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::fmt::Debug)]
5pub struct DetectAnomaliesInput {
6    /// <p>The name of the project that contains the model version that you want to use.</p>
7    pub project_name: ::std::option::Option<::std::string::String>,
8    /// <p>The version of the model that you want to use.</p>
9    pub model_version: ::std::option::Option<::std::string::String>,
10    /// <p>The unencrypted image bytes that you want to analyze.</p>
11    pub body: ::aws_smithy_types::byte_stream::ByteStream,
12    /// <p>The type of the image passed in <code>Body</code>. Valid values are <code>image/png</code> (PNG format images) and <code>image/jpeg</code> (JPG format images).</p>
13    pub content_type: ::std::option::Option<::std::string::String>,
14}
15impl DetectAnomaliesInput {
16    /// <p>The name of the project that contains the model version that you want to use.</p>
17    pub fn project_name(&self) -> ::std::option::Option<&str> {
18        self.project_name.as_deref()
19    }
20    /// <p>The version of the model that you want to use.</p>
21    pub fn model_version(&self) -> ::std::option::Option<&str> {
22        self.model_version.as_deref()
23    }
24    /// <p>The unencrypted image bytes that you want to analyze.</p>
25    pub fn body(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
26        &self.body
27    }
28    /// <p>The type of the image passed in <code>Body</code>. Valid values are <code>image/png</code> (PNG format images) and <code>image/jpeg</code> (JPG format images).</p>
29    pub fn content_type(&self) -> ::std::option::Option<&str> {
30        self.content_type.as_deref()
31    }
32}
33impl DetectAnomaliesInput {
34    /// Creates a new builder-style object to manufacture [`DetectAnomaliesInput`](crate::operation::detect_anomalies::DetectAnomaliesInput).
35    pub fn builder() -> crate::operation::detect_anomalies::builders::DetectAnomaliesInputBuilder {
36        crate::operation::detect_anomalies::builders::DetectAnomaliesInputBuilder::default()
37    }
38}
39
40/// A builder for [`DetectAnomaliesInput`](crate::operation::detect_anomalies::DetectAnomaliesInput).
41#[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    /// <p>The name of the project that contains the model version that you want to use.</p>
51    /// This field is required.
52    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    /// <p>The name of the project that contains the model version that you want to use.</p>
57    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.project_name = input;
59        self
60    }
61    /// <p>The name of the project that contains the model version that you want to use.</p>
62    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.project_name
64    }
65    /// <p>The version of the model that you want to use.</p>
66    /// This field is required.
67    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    /// <p>The version of the model that you want to use.</p>
72    pub fn set_model_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.model_version = input;
74        self
75    }
76    /// <p>The version of the model that you want to use.</p>
77    pub fn get_model_version(&self) -> &::std::option::Option<::std::string::String> {
78        &self.model_version
79    }
80    /// <p>The unencrypted image bytes that you want to analyze.</p>
81    /// This field is required.
82    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    /// <p>The unencrypted image bytes that you want to analyze.</p>
87    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    /// <p>The unencrypted image bytes that you want to analyze.</p>
92    pub fn get_body(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
93        &self.body
94    }
95    /// <p>The type of the image passed in <code>Body</code>. Valid values are <code>image/png</code> (PNG format images) and <code>image/jpeg</code> (JPG format images).</p>
96    /// This field is required.
97    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    /// <p>The type of the image passed in <code>Body</code>. Valid values are <code>image/png</code> (PNG format images) and <code>image/jpeg</code> (JPG format images).</p>
102    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.content_type = input;
104        self
105    }
106    /// <p>The type of the image passed in <code>Body</code>. Valid values are <code>image/png</code> (PNG format images) and <code>image/jpeg</code> (JPG format images).</p>
107    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
108        &self.content_type
109    }
110    /// Consumes the builder and constructs a [`DetectAnomaliesInput`](crate::operation::detect_anomalies::DetectAnomaliesInput).
111    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}