aws_sdk_resiliencehub/types/
_update_recommendation_status_request_entry.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Defines the operational recommendation item that is to be included or excluded.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateRecommendationStatusRequestEntry {
7    /// <p>An identifier for an entry in this batch that is used to communicate the result.</p><note>
8    /// <p>The <code>entryId</code>s of a batch request need to be unique within a request.</p>
9    /// </note>
10    pub entry_id: ::std::string::String,
11    /// <p>Reference identifier of the operational recommendation item.</p>
12    pub reference_id: ::std::string::String,
13    /// <p>The operational recommendation item.</p>
14    pub item: ::std::option::Option<crate::types::UpdateRecommendationStatusItem>,
15    /// <p>Indicates if the operational recommendation needs to be excluded. If set to True, the operational recommendation will be excluded.</p>
16    pub excluded: bool,
17    /// <p>Indicates the identifier of the AppComponent.</p>
18    pub app_component_id: ::std::option::Option<::std::string::String>,
19    /// <p>Indicates the reason for excluding an operational recommendation.</p>
20    pub exclude_reason: ::std::option::Option<crate::types::ExcludeRecommendationReason>,
21}
22impl UpdateRecommendationStatusRequestEntry {
23    /// <p>An identifier for an entry in this batch that is used to communicate the result.</p><note>
24    /// <p>The <code>entryId</code>s of a batch request need to be unique within a request.</p>
25    /// </note>
26    pub fn entry_id(&self) -> &str {
27        use std::ops::Deref;
28        self.entry_id.deref()
29    }
30    /// <p>Reference identifier of the operational recommendation item.</p>
31    pub fn reference_id(&self) -> &str {
32        use std::ops::Deref;
33        self.reference_id.deref()
34    }
35    /// <p>The operational recommendation item.</p>
36    pub fn item(&self) -> ::std::option::Option<&crate::types::UpdateRecommendationStatusItem> {
37        self.item.as_ref()
38    }
39    /// <p>Indicates if the operational recommendation needs to be excluded. If set to True, the operational recommendation will be excluded.</p>
40    pub fn excluded(&self) -> bool {
41        self.excluded
42    }
43    /// <p>Indicates the identifier of the AppComponent.</p>
44    pub fn app_component_id(&self) -> ::std::option::Option<&str> {
45        self.app_component_id.as_deref()
46    }
47    /// <p>Indicates the reason for excluding an operational recommendation.</p>
48    pub fn exclude_reason(&self) -> ::std::option::Option<&crate::types::ExcludeRecommendationReason> {
49        self.exclude_reason.as_ref()
50    }
51}
52impl UpdateRecommendationStatusRequestEntry {
53    /// Creates a new builder-style object to manufacture [`UpdateRecommendationStatusRequestEntry`](crate::types::UpdateRecommendationStatusRequestEntry).
54    pub fn builder() -> crate::types::builders::UpdateRecommendationStatusRequestEntryBuilder {
55        crate::types::builders::UpdateRecommendationStatusRequestEntryBuilder::default()
56    }
57}
58
59/// A builder for [`UpdateRecommendationStatusRequestEntry`](crate::types::UpdateRecommendationStatusRequestEntry).
60#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
61#[non_exhaustive]
62pub struct UpdateRecommendationStatusRequestEntryBuilder {
63    pub(crate) entry_id: ::std::option::Option<::std::string::String>,
64    pub(crate) reference_id: ::std::option::Option<::std::string::String>,
65    pub(crate) item: ::std::option::Option<crate::types::UpdateRecommendationStatusItem>,
66    pub(crate) excluded: ::std::option::Option<bool>,
67    pub(crate) app_component_id: ::std::option::Option<::std::string::String>,
68    pub(crate) exclude_reason: ::std::option::Option<crate::types::ExcludeRecommendationReason>,
69}
70impl UpdateRecommendationStatusRequestEntryBuilder {
71    /// <p>An identifier for an entry in this batch that is used to communicate the result.</p><note>
72    /// <p>The <code>entryId</code>s of a batch request need to be unique within a request.</p>
73    /// </note>
74    /// This field is required.
75    pub fn entry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.entry_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>An identifier for an entry in this batch that is used to communicate the result.</p><note>
80    /// <p>The <code>entryId</code>s of a batch request need to be unique within a request.</p>
81    /// </note>
82    pub fn set_entry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.entry_id = input;
84        self
85    }
86    /// <p>An identifier for an entry in this batch that is used to communicate the result.</p><note>
87    /// <p>The <code>entryId</code>s of a batch request need to be unique within a request.</p>
88    /// </note>
89    pub fn get_entry_id(&self) -> &::std::option::Option<::std::string::String> {
90        &self.entry_id
91    }
92    /// <p>Reference identifier of the operational recommendation item.</p>
93    /// This field is required.
94    pub fn reference_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.reference_id = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>Reference identifier of the operational recommendation item.</p>
99    pub fn set_reference_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.reference_id = input;
101        self
102    }
103    /// <p>Reference identifier of the operational recommendation item.</p>
104    pub fn get_reference_id(&self) -> &::std::option::Option<::std::string::String> {
105        &self.reference_id
106    }
107    /// <p>The operational recommendation item.</p>
108    pub fn item(mut self, input: crate::types::UpdateRecommendationStatusItem) -> Self {
109        self.item = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>The operational recommendation item.</p>
113    pub fn set_item(mut self, input: ::std::option::Option<crate::types::UpdateRecommendationStatusItem>) -> Self {
114        self.item = input;
115        self
116    }
117    /// <p>The operational recommendation item.</p>
118    pub fn get_item(&self) -> &::std::option::Option<crate::types::UpdateRecommendationStatusItem> {
119        &self.item
120    }
121    /// <p>Indicates if the operational recommendation needs to be excluded. If set to True, the operational recommendation will be excluded.</p>
122    /// This field is required.
123    pub fn excluded(mut self, input: bool) -> Self {
124        self.excluded = ::std::option::Option::Some(input);
125        self
126    }
127    /// <p>Indicates if the operational recommendation needs to be excluded. If set to True, the operational recommendation will be excluded.</p>
128    pub fn set_excluded(mut self, input: ::std::option::Option<bool>) -> Self {
129        self.excluded = input;
130        self
131    }
132    /// <p>Indicates if the operational recommendation needs to be excluded. If set to True, the operational recommendation will be excluded.</p>
133    pub fn get_excluded(&self) -> &::std::option::Option<bool> {
134        &self.excluded
135    }
136    /// <p>Indicates the identifier of the AppComponent.</p>
137    pub fn app_component_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.app_component_id = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>Indicates the identifier of the AppComponent.</p>
142    pub fn set_app_component_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.app_component_id = input;
144        self
145    }
146    /// <p>Indicates the identifier of the AppComponent.</p>
147    pub fn get_app_component_id(&self) -> &::std::option::Option<::std::string::String> {
148        &self.app_component_id
149    }
150    /// <p>Indicates the reason for excluding an operational recommendation.</p>
151    pub fn exclude_reason(mut self, input: crate::types::ExcludeRecommendationReason) -> Self {
152        self.exclude_reason = ::std::option::Option::Some(input);
153        self
154    }
155    /// <p>Indicates the reason for excluding an operational recommendation.</p>
156    pub fn set_exclude_reason(mut self, input: ::std::option::Option<crate::types::ExcludeRecommendationReason>) -> Self {
157        self.exclude_reason = input;
158        self
159    }
160    /// <p>Indicates the reason for excluding an operational recommendation.</p>
161    pub fn get_exclude_reason(&self) -> &::std::option::Option<crate::types::ExcludeRecommendationReason> {
162        &self.exclude_reason
163    }
164    /// Consumes the builder and constructs a [`UpdateRecommendationStatusRequestEntry`](crate::types::UpdateRecommendationStatusRequestEntry).
165    /// This method will fail if any of the following fields are not set:
166    /// - [`entry_id`](crate::types::builders::UpdateRecommendationStatusRequestEntryBuilder::entry_id)
167    /// - [`reference_id`](crate::types::builders::UpdateRecommendationStatusRequestEntryBuilder::reference_id)
168    /// - [`excluded`](crate::types::builders::UpdateRecommendationStatusRequestEntryBuilder::excluded)
169    pub fn build(
170        self,
171    ) -> ::std::result::Result<crate::types::UpdateRecommendationStatusRequestEntry, ::aws_smithy_types::error::operation::BuildError> {
172        ::std::result::Result::Ok(crate::types::UpdateRecommendationStatusRequestEntry {
173            entry_id: self.entry_id.ok_or_else(|| {
174                ::aws_smithy_types::error::operation::BuildError::missing_field(
175                    "entry_id",
176                    "entry_id was not specified but it is required when building UpdateRecommendationStatusRequestEntry",
177                )
178            })?,
179            reference_id: self.reference_id.ok_or_else(|| {
180                ::aws_smithy_types::error::operation::BuildError::missing_field(
181                    "reference_id",
182                    "reference_id was not specified but it is required when building UpdateRecommendationStatusRequestEntry",
183                )
184            })?,
185            item: self.item,
186            excluded: self.excluded.ok_or_else(|| {
187                ::aws_smithy_types::error::operation::BuildError::missing_field(
188                    "excluded",
189                    "excluded was not specified but it is required when building UpdateRecommendationStatusRequestEntry",
190                )
191            })?,
192            app_component_id: self.app_component_id,
193            exclude_reason: self.exclude_reason,
194        })
195    }
196}