aws_sdk_qconnect/operation/put_feedback/
_put_feedback_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutFeedbackOutput {
6    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
7    pub assistant_id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.</p>
9    pub assistant_arn: ::std::string::String,
10    /// <p>The identifier of the feedback target.</p>
11    pub target_id: ::std::string::String,
12    /// <p>The type of the feedback target.</p>
13    pub target_type: crate::types::TargetType,
14    /// <p>Information about the feedback provided.</p>
15    pub content_feedback: ::std::option::Option<crate::types::ContentFeedbackData>,
16    _request_id: Option<String>,
17}
18impl PutFeedbackOutput {
19    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
20    pub fn assistant_id(&self) -> &str {
21        use std::ops::Deref;
22        self.assistant_id.deref()
23    }
24    /// <p>The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.</p>
25    pub fn assistant_arn(&self) -> &str {
26        use std::ops::Deref;
27        self.assistant_arn.deref()
28    }
29    /// <p>The identifier of the feedback target.</p>
30    pub fn target_id(&self) -> &str {
31        use std::ops::Deref;
32        self.target_id.deref()
33    }
34    /// <p>The type of the feedback target.</p>
35    pub fn target_type(&self) -> &crate::types::TargetType {
36        &self.target_type
37    }
38    /// <p>Information about the feedback provided.</p>
39    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    /// Creates a new builder-style object to manufacture [`PutFeedbackOutput`](crate::operation::put_feedback::PutFeedbackOutput).
50    pub fn builder() -> crate::operation::put_feedback::builders::PutFeedbackOutputBuilder {
51        crate::operation::put_feedback::builders::PutFeedbackOutputBuilder::default()
52    }
53}
54
55/// A builder for [`PutFeedbackOutput`](crate::operation::put_feedback::PutFeedbackOutput).
56#[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    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
68    /// This field is required.
69    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    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
74    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.assistant_id = input;
76        self
77    }
78    /// <p>The identifier of the Amazon Q in Connect assistant.</p>
79    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.assistant_id
81    }
82    /// <p>The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.</p>
83    /// This field is required.
84    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    /// <p>The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.</p>
89    pub fn set_assistant_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.assistant_arn = input;
91        self
92    }
93    /// <p>The Amazon Resource Name (ARN) of the Amazon Q in Connect assistant.</p>
94    pub fn get_assistant_arn(&self) -> &::std::option::Option<::std::string::String> {
95        &self.assistant_arn
96    }
97    /// <p>The identifier of the feedback target.</p>
98    /// This field is required.
99    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    /// <p>The identifier of the feedback target.</p>
104    pub fn set_target_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.target_id = input;
106        self
107    }
108    /// <p>The identifier of the feedback target.</p>
109    pub fn get_target_id(&self) -> &::std::option::Option<::std::string::String> {
110        &self.target_id
111    }
112    /// <p>The type of the feedback target.</p>
113    /// This field is required.
114    pub fn target_type(mut self, input: crate::types::TargetType) -> Self {
115        self.target_type = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>The type of the feedback target.</p>
119    pub fn set_target_type(mut self, input: ::std::option::Option<crate::types::TargetType>) -> Self {
120        self.target_type = input;
121        self
122    }
123    /// <p>The type of the feedback target.</p>
124    pub fn get_target_type(&self) -> &::std::option::Option<crate::types::TargetType> {
125        &self.target_type
126    }
127    /// <p>Information about the feedback provided.</p>
128    /// This field is required.
129    pub fn content_feedback(mut self, input: crate::types::ContentFeedbackData) -> Self {
130        self.content_feedback = ::std::option::Option::Some(input);
131        self
132    }
133    /// <p>Information about the feedback provided.</p>
134    pub fn set_content_feedback(mut self, input: ::std::option::Option<crate::types::ContentFeedbackData>) -> Self {
135        self.content_feedback = input;
136        self
137    }
138    /// <p>Information about the feedback provided.</p>
139    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    /// Consumes the builder and constructs a [`PutFeedbackOutput`](crate::operation::put_feedback::PutFeedbackOutput).
152    /// This method will fail if any of the following fields are not set:
153    /// - [`assistant_id`](crate::operation::put_feedback::builders::PutFeedbackOutputBuilder::assistant_id)
154    /// - [`assistant_arn`](crate::operation::put_feedback::builders::PutFeedbackOutputBuilder::assistant_arn)
155    /// - [`target_id`](crate::operation::put_feedback::builders::PutFeedbackOutputBuilder::target_id)
156    /// - [`target_type`](crate::operation::put_feedback::builders::PutFeedbackOutputBuilder::target_type)
157    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}