aws_sdk_appsync/types/
_error_detail.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the list of errors generated. When using JavaScript, this will apply to the request or response function evaluation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ErrorDetail {
7    /// <p>The error payload.</p>
8    pub message: ::std::option::Option<::std::string::String>,
9}
10impl ErrorDetail {
11    /// <p>The error payload.</p>
12    pub fn message(&self) -> ::std::option::Option<&str> {
13        self.message.as_deref()
14    }
15}
16impl ErrorDetail {
17    /// Creates a new builder-style object to manufacture [`ErrorDetail`](crate::types::ErrorDetail).
18    pub fn builder() -> crate::types::builders::ErrorDetailBuilder {
19        crate::types::builders::ErrorDetailBuilder::default()
20    }
21}
22
23/// A builder for [`ErrorDetail`](crate::types::ErrorDetail).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct ErrorDetailBuilder {
27    pub(crate) message: ::std::option::Option<::std::string::String>,
28}
29impl ErrorDetailBuilder {
30    /// <p>The error payload.</p>
31    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
32        self.message = ::std::option::Option::Some(input.into());
33        self
34    }
35    /// <p>The error payload.</p>
36    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
37        self.message = input;
38        self
39    }
40    /// <p>The error payload.</p>
41    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
42        &self.message
43    }
44    /// Consumes the builder and constructs a [`ErrorDetail`](crate::types::ErrorDetail).
45    pub fn build(self) -> crate::types::ErrorDetail {
46        crate::types::ErrorDetail { message: self.message }
47    }
48}