aws_sdk_qconnect/operation/put_feedback/
_put_feedback_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutFeedbackOutput {
6 pub assistant_id: ::std::string::String,
8 pub assistant_arn: ::std::string::String,
10 pub target_id: ::std::string::String,
12 pub target_type: crate::types::TargetType,
14 pub content_feedback: ::std::option::Option<crate::types::ContentFeedbackData>,
16 _request_id: Option<String>,
17}
18impl PutFeedbackOutput {
19 pub fn assistant_id(&self) -> &str {
21 use std::ops::Deref;
22 self.assistant_id.deref()
23 }
24 pub fn assistant_arn(&self) -> &str {
26 use std::ops::Deref;
27 self.assistant_arn.deref()
28 }
29 pub fn target_id(&self) -> &str {
31 use std::ops::Deref;
32 self.target_id.deref()
33 }
34 pub fn target_type(&self) -> &crate::types::TargetType {
36 &self.target_type
37 }
38 pub fn content_feedback(&self) -> ::std::option::Option<&crate::types::ContentFeedbackData> {
40 self.content_feedback.as_ref()
41 }
42}
43impl ::aws_types::request_id::RequestId for PutFeedbackOutput {
44 fn request_id(&self) -> Option<&str> {
45 self._request_id.as_deref()
46 }
47}
48impl PutFeedbackOutput {
49 pub fn builder() -> crate::operation::put_feedback::builders::PutFeedbackOutputBuilder {
51 crate::operation::put_feedback::builders::PutFeedbackOutputBuilder::default()
52 }
53}
54
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct PutFeedbackOutputBuilder {
59 pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
60 pub(crate) assistant_arn: ::std::option::Option<::std::string::String>,
61 pub(crate) target_id: ::std::option::Option<::std::string::String>,
62 pub(crate) target_type: ::std::option::Option<crate::types::TargetType>,
63 pub(crate) content_feedback: ::std::option::Option<crate::types::ContentFeedbackData>,
64 _request_id: Option<String>,
65}
66impl PutFeedbackOutputBuilder {
67 pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.assistant_id = ::std::option::Option::Some(input.into());
71 self
72 }
73 pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.assistant_id = input;
76 self
77 }
78 pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
80 &self.assistant_id
81 }
82 pub fn assistant_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85 self.assistant_arn = ::std::option::Option::Some(input.into());
86 self
87 }
88 pub fn set_assistant_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.assistant_arn = input;
91 self
92 }
93 pub fn get_assistant_arn(&self) -> &::std::option::Option<::std::string::String> {
95 &self.assistant_arn
96 }
97 pub fn target_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100 self.target_id = ::std::option::Option::Some(input.into());
101 self
102 }
103 pub fn set_target_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105 self.target_id = input;
106 self
107 }
108 pub fn get_target_id(&self) -> &::std::option::Option<::std::string::String> {
110 &self.target_id
111 }
112 pub fn target_type(mut self, input: crate::types::TargetType) -> Self {
115 self.target_type = ::std::option::Option::Some(input);
116 self
117 }
118 pub fn set_target_type(mut self, input: ::std::option::Option<crate::types::TargetType>) -> Self {
120 self.target_type = input;
121 self
122 }
123 pub fn get_target_type(&self) -> &::std::option::Option<crate::types::TargetType> {
125 &self.target_type
126 }
127 pub fn content_feedback(mut self, input: crate::types::ContentFeedbackData) -> Self {
130 self.content_feedback = ::std::option::Option::Some(input);
131 self
132 }
133 pub fn set_content_feedback(mut self, input: ::std::option::Option<crate::types::ContentFeedbackData>) -> Self {
135 self.content_feedback = input;
136 self
137 }
138 pub fn get_content_feedback(&self) -> &::std::option::Option<crate::types::ContentFeedbackData> {
140 &self.content_feedback
141 }
142 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
143 self._request_id = Some(request_id.into());
144 self
145 }
146
147 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
148 self._request_id = request_id;
149 self
150 }
151 pub fn build(self) -> ::std::result::Result<crate::operation::put_feedback::PutFeedbackOutput, ::aws_smithy_types::error::operation::BuildError> {
158 ::std::result::Result::Ok(crate::operation::put_feedback::PutFeedbackOutput {
159 assistant_id: self.assistant_id.ok_or_else(|| {
160 ::aws_smithy_types::error::operation::BuildError::missing_field(
161 "assistant_id",
162 "assistant_id was not specified but it is required when building PutFeedbackOutput",
163 )
164 })?,
165 assistant_arn: self.assistant_arn.ok_or_else(|| {
166 ::aws_smithy_types::error::operation::BuildError::missing_field(
167 "assistant_arn",
168 "assistant_arn was not specified but it is required when building PutFeedbackOutput",
169 )
170 })?,
171 target_id: self.target_id.ok_or_else(|| {
172 ::aws_smithy_types::error::operation::BuildError::missing_field(
173 "target_id",
174 "target_id was not specified but it is required when building PutFeedbackOutput",
175 )
176 })?,
177 target_type: self.target_type.ok_or_else(|| {
178 ::aws_smithy_types::error::operation::BuildError::missing_field(
179 "target_type",
180 "target_type was not specified but it is required when building PutFeedbackOutput",
181 )
182 })?,
183 content_feedback: self.content_feedback,
184 _request_id: self._request_id,
185 })
186 }
187}