aws_sdk_s3control/types/
_async_error_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Error details for the failed asynchronous operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AsyncErrorDetails {
7    /// <p>A string that uniquely identifies the error condition.</p>
8    pub code: ::std::option::Option<::std::string::String>,
9    /// <p>A generic description of the error condition in English.</p>
10    pub message: ::std::option::Option<::std::string::String>,
11    /// <p>The identifier of the resource associated with the error.</p>
12    pub resource: ::std::option::Option<::std::string::String>,
13    /// <p>The ID of the request associated with the error.</p>
14    pub request_id: ::std::option::Option<::std::string::String>,
15}
16impl AsyncErrorDetails {
17    /// <p>A string that uniquely identifies the error condition.</p>
18    pub fn code(&self) -> ::std::option::Option<&str> {
19        self.code.as_deref()
20    }
21    /// <p>A generic description of the error condition in English.</p>
22    pub fn message(&self) -> ::std::option::Option<&str> {
23        self.message.as_deref()
24    }
25    /// <p>The identifier of the resource associated with the error.</p>
26    pub fn resource(&self) -> ::std::option::Option<&str> {
27        self.resource.as_deref()
28    }
29    /// <p>The ID of the request associated with the error.</p>
30    pub fn request_id(&self) -> ::std::option::Option<&str> {
31        self.request_id.as_deref()
32    }
33}
34impl AsyncErrorDetails {
35    /// Creates a new builder-style object to manufacture [`AsyncErrorDetails`](crate::types::AsyncErrorDetails).
36    pub fn builder() -> crate::types::builders::AsyncErrorDetailsBuilder {
37        crate::types::builders::AsyncErrorDetailsBuilder::default()
38    }
39}
40
41/// A builder for [`AsyncErrorDetails`](crate::types::AsyncErrorDetails).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct AsyncErrorDetailsBuilder {
45    pub(crate) code: ::std::option::Option<::std::string::String>,
46    pub(crate) message: ::std::option::Option<::std::string::String>,
47    pub(crate) resource: ::std::option::Option<::std::string::String>,
48    pub(crate) request_id: ::std::option::Option<::std::string::String>,
49}
50impl AsyncErrorDetailsBuilder {
51    /// <p>A string that uniquely identifies the error condition.</p>
52    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.code = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>A string that uniquely identifies the error condition.</p>
57    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.code = input;
59        self
60    }
61    /// <p>A string that uniquely identifies the error condition.</p>
62    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
63        &self.code
64    }
65    /// <p>A generic description of the error condition in English.</p>
66    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.message = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>A generic description of the error condition in English.</p>
71    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.message = input;
73        self
74    }
75    /// <p>A generic description of the error condition in English.</p>
76    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
77        &self.message
78    }
79    /// <p>The identifier of the resource associated with the error.</p>
80    pub fn resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.resource = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The identifier of the resource associated with the error.</p>
85    pub fn set_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.resource = input;
87        self
88    }
89    /// <p>The identifier of the resource associated with the error.</p>
90    pub fn get_resource(&self) -> &::std::option::Option<::std::string::String> {
91        &self.resource
92    }
93    /// <p>The ID of the request associated with the error.</p>
94    pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.request_id = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The ID of the request associated with the error.</p>
99    pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.request_id = input;
101        self
102    }
103    /// <p>The ID of the request associated with the error.</p>
104    pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
105        &self.request_id
106    }
107    /// Consumes the builder and constructs a [`AsyncErrorDetails`](crate::types::AsyncErrorDetails).
108    pub fn build(self) -> crate::types::AsyncErrorDetails {
109        crate::types::AsyncErrorDetails {
110            code: self.code,
111            message: self.message,
112            resource: self.resource,
113            request_id: self.request_id,
114        }
115    }
116}