Skip to main content

aws_sdk_cloudwatch/types/
_partial_failure.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>This array is empty if the API operation was successful for all the rules specified in the request. If the operation could not process one of the rules, the following data is returned for each of those rules.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PartialFailure {
7    /// <p>The specified rule that could not be deleted.</p>
8    pub failure_resource: ::std::option::Option<::std::string::String>,
9    /// <p>The type of error.</p>
10    pub exception_type: ::std::option::Option<::std::string::String>,
11    /// <p>The code of the error.</p>
12    pub failure_code: ::std::option::Option<::std::string::String>,
13    /// <p>A description of the error.</p>
14    pub failure_description: ::std::option::Option<::std::string::String>,
15}
16impl PartialFailure {
17    /// <p>The specified rule that could not be deleted.</p>
18    pub fn failure_resource(&self) -> ::std::option::Option<&str> {
19        self.failure_resource.as_deref()
20    }
21    /// <p>The type of error.</p>
22    pub fn exception_type(&self) -> ::std::option::Option<&str> {
23        self.exception_type.as_deref()
24    }
25    /// <p>The code of the error.</p>
26    pub fn failure_code(&self) -> ::std::option::Option<&str> {
27        self.failure_code.as_deref()
28    }
29    /// <p>A description of the error.</p>
30    pub fn failure_description(&self) -> ::std::option::Option<&str> {
31        self.failure_description.as_deref()
32    }
33}
34impl PartialFailure {
35    /// Creates a new builder-style object to manufacture [`PartialFailure`](crate::types::PartialFailure).
36    pub fn builder() -> crate::types::builders::PartialFailureBuilder {
37        crate::types::builders::PartialFailureBuilder::default()
38    }
39}
40
41/// A builder for [`PartialFailure`](crate::types::PartialFailure).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct PartialFailureBuilder {
45    pub(crate) failure_resource: ::std::option::Option<::std::string::String>,
46    pub(crate) exception_type: ::std::option::Option<::std::string::String>,
47    pub(crate) failure_code: ::std::option::Option<::std::string::String>,
48    pub(crate) failure_description: ::std::option::Option<::std::string::String>,
49}
50impl PartialFailureBuilder {
51    /// <p>The specified rule that could not be deleted.</p>
52    pub fn failure_resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.failure_resource = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The specified rule that could not be deleted.</p>
57    pub fn set_failure_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.failure_resource = input;
59        self
60    }
61    /// <p>The specified rule that could not be deleted.</p>
62    pub fn get_failure_resource(&self) -> &::std::option::Option<::std::string::String> {
63        &self.failure_resource
64    }
65    /// <p>The type of error.</p>
66    pub fn exception_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.exception_type = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The type of error.</p>
71    pub fn set_exception_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.exception_type = input;
73        self
74    }
75    /// <p>The type of error.</p>
76    pub fn get_exception_type(&self) -> &::std::option::Option<::std::string::String> {
77        &self.exception_type
78    }
79    /// <p>The code of the error.</p>
80    pub fn failure_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.failure_code = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The code of the error.</p>
85    pub fn set_failure_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.failure_code = input;
87        self
88    }
89    /// <p>The code of the error.</p>
90    pub fn get_failure_code(&self) -> &::std::option::Option<::std::string::String> {
91        &self.failure_code
92    }
93    /// <p>A description of the error.</p>
94    pub fn failure_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.failure_description = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>A description of the error.</p>
99    pub fn set_failure_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.failure_description = input;
101        self
102    }
103    /// <p>A description of the error.</p>
104    pub fn get_failure_description(&self) -> &::std::option::Option<::std::string::String> {
105        &self.failure_description
106    }
107    /// Consumes the builder and constructs a [`PartialFailure`](crate::types::PartialFailure).
108    pub fn build(self) -> crate::types::PartialFailure {
109        crate::types::PartialFailure {
110            failure_resource: self.failure_resource,
111            exception_type: self.exception_type,
112            failure_code: self.failure_code,
113            failure_description: self.failure_description,
114        }
115    }
116}