Skip to main content

aws_sdk_entityresolution/types/
_error_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object containing an error message, if there was an error.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ErrorDetails {
7    /// <p>The error message from the job, if there is one.</p>
8    pub error_message: ::std::option::Option<::std::string::String>,
9}
10impl ErrorDetails {
11    /// <p>The error message from the job, if there is one.</p>
12    pub fn error_message(&self) -> ::std::option::Option<&str> {
13        self.error_message.as_deref()
14    }
15}
16impl ErrorDetails {
17    /// Creates a new builder-style object to manufacture [`ErrorDetails`](crate::types::ErrorDetails).
18    pub fn builder() -> crate::types::builders::ErrorDetailsBuilder {
19        crate::types::builders::ErrorDetailsBuilder::default()
20    }
21}
22
23/// A builder for [`ErrorDetails`](crate::types::ErrorDetails).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct ErrorDetailsBuilder {
27    pub(crate) error_message: ::std::option::Option<::std::string::String>,
28}
29impl ErrorDetailsBuilder {
30    /// <p>The error message from the job, if there is one.</p>
31    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
32        self.error_message = ::std::option::Option::Some(input.into());
33        self
34    }
35    /// <p>The error message from the job, if there is one.</p>
36    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
37        self.error_message = input;
38        self
39    }
40    /// <p>The error message from the job, if there is one.</p>
41    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
42        &self.error_message
43    }
44    /// Consumes the builder and constructs a [`ErrorDetails`](crate::types::ErrorDetails).
45    pub fn build(self) -> crate::types::ErrorDetails {
46        crate::types::ErrorDetails {
47            error_message: self.error_message,
48        }
49    }
50}