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