aws_sdk_bedrock/operation/get_guardrail/
_get_guardrail_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)]
5pub struct GetGuardrailOutput {
6    /// <p>The name of the guardrail.</p>
7    pub name: ::std::string::String,
8    /// <p>The description of the guardrail.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The unique identifier of the guardrail.</p>
11    pub guardrail_id: ::std::string::String,
12    /// <p>The ARN of the guardrail.</p>
13    pub guardrail_arn: ::std::string::String,
14    /// <p>The version of the guardrail.</p>
15    pub version: ::std::string::String,
16    /// <p>The status of the guardrail.</p>
17    pub status: crate::types::GuardrailStatus,
18    /// <p>The topic policy that was configured for the guardrail.</p>
19    pub topic_policy: ::std::option::Option<crate::types::GuardrailTopicPolicy>,
20    /// <p>The content policy that was configured for the guardrail.</p>
21    pub content_policy: ::std::option::Option<crate::types::GuardrailContentPolicy>,
22    /// <p>The word policy that was configured for the guardrail.</p>
23    pub word_policy: ::std::option::Option<crate::types::GuardrailWordPolicy>,
24    /// <p>The sensitive information policy that was configured for the guardrail.</p>
25    pub sensitive_information_policy: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicy>,
26    /// <p>The contextual grounding policy used in the guardrail.</p>
27    pub contextual_grounding_policy: ::std::option::Option<crate::types::GuardrailContextualGroundingPolicy>,
28    /// <p>The current Automated Reasoning policy configuration for the guardrail, if any is configured.</p>
29    pub automated_reasoning_policy: ::std::option::Option<crate::types::GuardrailAutomatedReasoningPolicy>,
30    /// <p>Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).</p>
31    pub cross_region_details: ::std::option::Option<crate::types::GuardrailCrossRegionDetails>,
32    /// <p>The date and time at which the guardrail was created.</p>
33    pub created_at: ::aws_smithy_types::DateTime,
34    /// <p>The date and time at which the guardrail was updated.</p>
35    pub updated_at: ::aws_smithy_types::DateTime,
36    /// <p>Appears if the <code>status</code> is <code>FAILED</code>. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.</p>
37    pub status_reasons: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
38    /// <p>Appears if the <code>status</code> of the guardrail is <code>FAILED</code>. A list of recommendations to carry out before retrying the request.</p>
39    pub failure_recommendations: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
40    /// <p>The message that the guardrail returns when it blocks a prompt.</p>
41    pub blocked_input_messaging: ::std::string::String,
42    /// <p>The message that the guardrail returns when it blocks a model response.</p>
43    pub blocked_outputs_messaging: ::std::string::String,
44    /// <p>The ARN of the KMS key that encrypts the guardrail.</p>
45    pub kms_key_arn: ::std::option::Option<::std::string::String>,
46    _request_id: Option<String>,
47}
48impl GetGuardrailOutput {
49    /// <p>The name of the guardrail.</p>
50    pub fn name(&self) -> &str {
51        use std::ops::Deref;
52        self.name.deref()
53    }
54    /// <p>The description of the guardrail.</p>
55    pub fn description(&self) -> ::std::option::Option<&str> {
56        self.description.as_deref()
57    }
58    /// <p>The unique identifier of the guardrail.</p>
59    pub fn guardrail_id(&self) -> &str {
60        use std::ops::Deref;
61        self.guardrail_id.deref()
62    }
63    /// <p>The ARN of the guardrail.</p>
64    pub fn guardrail_arn(&self) -> &str {
65        use std::ops::Deref;
66        self.guardrail_arn.deref()
67    }
68    /// <p>The version of the guardrail.</p>
69    pub fn version(&self) -> &str {
70        use std::ops::Deref;
71        self.version.deref()
72    }
73    /// <p>The status of the guardrail.</p>
74    pub fn status(&self) -> &crate::types::GuardrailStatus {
75        &self.status
76    }
77    /// <p>The topic policy that was configured for the guardrail.</p>
78    pub fn topic_policy(&self) -> ::std::option::Option<&crate::types::GuardrailTopicPolicy> {
79        self.topic_policy.as_ref()
80    }
81    /// <p>The content policy that was configured for the guardrail.</p>
82    pub fn content_policy(&self) -> ::std::option::Option<&crate::types::GuardrailContentPolicy> {
83        self.content_policy.as_ref()
84    }
85    /// <p>The word policy that was configured for the guardrail.</p>
86    pub fn word_policy(&self) -> ::std::option::Option<&crate::types::GuardrailWordPolicy> {
87        self.word_policy.as_ref()
88    }
89    /// <p>The sensitive information policy that was configured for the guardrail.</p>
90    pub fn sensitive_information_policy(&self) -> ::std::option::Option<&crate::types::GuardrailSensitiveInformationPolicy> {
91        self.sensitive_information_policy.as_ref()
92    }
93    /// <p>The contextual grounding policy used in the guardrail.</p>
94    pub fn contextual_grounding_policy(&self) -> ::std::option::Option<&crate::types::GuardrailContextualGroundingPolicy> {
95        self.contextual_grounding_policy.as_ref()
96    }
97    /// <p>The current Automated Reasoning policy configuration for the guardrail, if any is configured.</p>
98    pub fn automated_reasoning_policy(&self) -> ::std::option::Option<&crate::types::GuardrailAutomatedReasoningPolicy> {
99        self.automated_reasoning_policy.as_ref()
100    }
101    /// <p>Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).</p>
102    pub fn cross_region_details(&self) -> ::std::option::Option<&crate::types::GuardrailCrossRegionDetails> {
103        self.cross_region_details.as_ref()
104    }
105    /// <p>The date and time at which the guardrail was created.</p>
106    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
107        &self.created_at
108    }
109    /// <p>The date and time at which the guardrail was updated.</p>
110    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
111        &self.updated_at
112    }
113    /// <p>Appears if the <code>status</code> is <code>FAILED</code>. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.</p>
114    ///
115    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.status_reasons.is_none()`.
116    pub fn status_reasons(&self) -> &[::std::string::String] {
117        self.status_reasons.as_deref().unwrap_or_default()
118    }
119    /// <p>Appears if the <code>status</code> of the guardrail is <code>FAILED</code>. A list of recommendations to carry out before retrying the request.</p>
120    ///
121    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.failure_recommendations.is_none()`.
122    pub fn failure_recommendations(&self) -> &[::std::string::String] {
123        self.failure_recommendations.as_deref().unwrap_or_default()
124    }
125    /// <p>The message that the guardrail returns when it blocks a prompt.</p>
126    pub fn blocked_input_messaging(&self) -> &str {
127        use std::ops::Deref;
128        self.blocked_input_messaging.deref()
129    }
130    /// <p>The message that the guardrail returns when it blocks a model response.</p>
131    pub fn blocked_outputs_messaging(&self) -> &str {
132        use std::ops::Deref;
133        self.blocked_outputs_messaging.deref()
134    }
135    /// <p>The ARN of the KMS key that encrypts the guardrail.</p>
136    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
137        self.kms_key_arn.as_deref()
138    }
139}
140impl ::std::fmt::Debug for GetGuardrailOutput {
141    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
142        let mut formatter = f.debug_struct("GetGuardrailOutput");
143        formatter.field("name", &"*** Sensitive Data Redacted ***");
144        formatter.field("description", &"*** Sensitive Data Redacted ***");
145        formatter.field("guardrail_id", &self.guardrail_id);
146        formatter.field("guardrail_arn", &self.guardrail_arn);
147        formatter.field("version", &self.version);
148        formatter.field("status", &self.status);
149        formatter.field("topic_policy", &self.topic_policy);
150        formatter.field("content_policy", &self.content_policy);
151        formatter.field("word_policy", &self.word_policy);
152        formatter.field("sensitive_information_policy", &self.sensitive_information_policy);
153        formatter.field("contextual_grounding_policy", &self.contextual_grounding_policy);
154        formatter.field("automated_reasoning_policy", &self.automated_reasoning_policy);
155        formatter.field("cross_region_details", &self.cross_region_details);
156        formatter.field("created_at", &self.created_at);
157        formatter.field("updated_at", &self.updated_at);
158        formatter.field("status_reasons", &"*** Sensitive Data Redacted ***");
159        formatter.field("failure_recommendations", &"*** Sensitive Data Redacted ***");
160        formatter.field("blocked_input_messaging", &"*** Sensitive Data Redacted ***");
161        formatter.field("blocked_outputs_messaging", &"*** Sensitive Data Redacted ***");
162        formatter.field("kms_key_arn", &self.kms_key_arn);
163        formatter.field("_request_id", &self._request_id);
164        formatter.finish()
165    }
166}
167impl ::aws_types::request_id::RequestId for GetGuardrailOutput {
168    fn request_id(&self) -> Option<&str> {
169        self._request_id.as_deref()
170    }
171}
172impl GetGuardrailOutput {
173    /// Creates a new builder-style object to manufacture [`GetGuardrailOutput`](crate::operation::get_guardrail::GetGuardrailOutput).
174    pub fn builder() -> crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder {
175        crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::default()
176    }
177}
178
179/// A builder for [`GetGuardrailOutput`](crate::operation::get_guardrail::GetGuardrailOutput).
180#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
181#[non_exhaustive]
182pub struct GetGuardrailOutputBuilder {
183    pub(crate) name: ::std::option::Option<::std::string::String>,
184    pub(crate) description: ::std::option::Option<::std::string::String>,
185    pub(crate) guardrail_id: ::std::option::Option<::std::string::String>,
186    pub(crate) guardrail_arn: ::std::option::Option<::std::string::String>,
187    pub(crate) version: ::std::option::Option<::std::string::String>,
188    pub(crate) status: ::std::option::Option<crate::types::GuardrailStatus>,
189    pub(crate) topic_policy: ::std::option::Option<crate::types::GuardrailTopicPolicy>,
190    pub(crate) content_policy: ::std::option::Option<crate::types::GuardrailContentPolicy>,
191    pub(crate) word_policy: ::std::option::Option<crate::types::GuardrailWordPolicy>,
192    pub(crate) sensitive_information_policy: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicy>,
193    pub(crate) contextual_grounding_policy: ::std::option::Option<crate::types::GuardrailContextualGroundingPolicy>,
194    pub(crate) automated_reasoning_policy: ::std::option::Option<crate::types::GuardrailAutomatedReasoningPolicy>,
195    pub(crate) cross_region_details: ::std::option::Option<crate::types::GuardrailCrossRegionDetails>,
196    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
197    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
198    pub(crate) status_reasons: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
199    pub(crate) failure_recommendations: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
200    pub(crate) blocked_input_messaging: ::std::option::Option<::std::string::String>,
201    pub(crate) blocked_outputs_messaging: ::std::option::Option<::std::string::String>,
202    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
203    _request_id: Option<String>,
204}
205impl GetGuardrailOutputBuilder {
206    /// <p>The name of the guardrail.</p>
207    /// This field is required.
208    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.name = ::std::option::Option::Some(input.into());
210        self
211    }
212    /// <p>The name of the guardrail.</p>
213    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.name = input;
215        self
216    }
217    /// <p>The name of the guardrail.</p>
218    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
219        &self.name
220    }
221    /// <p>The description of the guardrail.</p>
222    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.description = ::std::option::Option::Some(input.into());
224        self
225    }
226    /// <p>The description of the guardrail.</p>
227    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.description = input;
229        self
230    }
231    /// <p>The description of the guardrail.</p>
232    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
233        &self.description
234    }
235    /// <p>The unique identifier of the guardrail.</p>
236    /// This field is required.
237    pub fn guardrail_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.guardrail_id = ::std::option::Option::Some(input.into());
239        self
240    }
241    /// <p>The unique identifier of the guardrail.</p>
242    pub fn set_guardrail_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.guardrail_id = input;
244        self
245    }
246    /// <p>The unique identifier of the guardrail.</p>
247    pub fn get_guardrail_id(&self) -> &::std::option::Option<::std::string::String> {
248        &self.guardrail_id
249    }
250    /// <p>The ARN of the guardrail.</p>
251    /// This field is required.
252    pub fn guardrail_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253        self.guardrail_arn = ::std::option::Option::Some(input.into());
254        self
255    }
256    /// <p>The ARN of the guardrail.</p>
257    pub fn set_guardrail_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258        self.guardrail_arn = input;
259        self
260    }
261    /// <p>The ARN of the guardrail.</p>
262    pub fn get_guardrail_arn(&self) -> &::std::option::Option<::std::string::String> {
263        &self.guardrail_arn
264    }
265    /// <p>The version of the guardrail.</p>
266    /// This field is required.
267    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.version = ::std::option::Option::Some(input.into());
269        self
270    }
271    /// <p>The version of the guardrail.</p>
272    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
273        self.version = input;
274        self
275    }
276    /// <p>The version of the guardrail.</p>
277    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
278        &self.version
279    }
280    /// <p>The status of the guardrail.</p>
281    /// This field is required.
282    pub fn status(mut self, input: crate::types::GuardrailStatus) -> Self {
283        self.status = ::std::option::Option::Some(input);
284        self
285    }
286    /// <p>The status of the guardrail.</p>
287    pub fn set_status(mut self, input: ::std::option::Option<crate::types::GuardrailStatus>) -> Self {
288        self.status = input;
289        self
290    }
291    /// <p>The status of the guardrail.</p>
292    pub fn get_status(&self) -> &::std::option::Option<crate::types::GuardrailStatus> {
293        &self.status
294    }
295    /// <p>The topic policy that was configured for the guardrail.</p>
296    pub fn topic_policy(mut self, input: crate::types::GuardrailTopicPolicy) -> Self {
297        self.topic_policy = ::std::option::Option::Some(input);
298        self
299    }
300    /// <p>The topic policy that was configured for the guardrail.</p>
301    pub fn set_topic_policy(mut self, input: ::std::option::Option<crate::types::GuardrailTopicPolicy>) -> Self {
302        self.topic_policy = input;
303        self
304    }
305    /// <p>The topic policy that was configured for the guardrail.</p>
306    pub fn get_topic_policy(&self) -> &::std::option::Option<crate::types::GuardrailTopicPolicy> {
307        &self.topic_policy
308    }
309    /// <p>The content policy that was configured for the guardrail.</p>
310    pub fn content_policy(mut self, input: crate::types::GuardrailContentPolicy) -> Self {
311        self.content_policy = ::std::option::Option::Some(input);
312        self
313    }
314    /// <p>The content policy that was configured for the guardrail.</p>
315    pub fn set_content_policy(mut self, input: ::std::option::Option<crate::types::GuardrailContentPolicy>) -> Self {
316        self.content_policy = input;
317        self
318    }
319    /// <p>The content policy that was configured for the guardrail.</p>
320    pub fn get_content_policy(&self) -> &::std::option::Option<crate::types::GuardrailContentPolicy> {
321        &self.content_policy
322    }
323    /// <p>The word policy that was configured for the guardrail.</p>
324    pub fn word_policy(mut self, input: crate::types::GuardrailWordPolicy) -> Self {
325        self.word_policy = ::std::option::Option::Some(input);
326        self
327    }
328    /// <p>The word policy that was configured for the guardrail.</p>
329    pub fn set_word_policy(mut self, input: ::std::option::Option<crate::types::GuardrailWordPolicy>) -> Self {
330        self.word_policy = input;
331        self
332    }
333    /// <p>The word policy that was configured for the guardrail.</p>
334    pub fn get_word_policy(&self) -> &::std::option::Option<crate::types::GuardrailWordPolicy> {
335        &self.word_policy
336    }
337    /// <p>The sensitive information policy that was configured for the guardrail.</p>
338    pub fn sensitive_information_policy(mut self, input: crate::types::GuardrailSensitiveInformationPolicy) -> Self {
339        self.sensitive_information_policy = ::std::option::Option::Some(input);
340        self
341    }
342    /// <p>The sensitive information policy that was configured for the guardrail.</p>
343    pub fn set_sensitive_information_policy(mut self, input: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicy>) -> Self {
344        self.sensitive_information_policy = input;
345        self
346    }
347    /// <p>The sensitive information policy that was configured for the guardrail.</p>
348    pub fn get_sensitive_information_policy(&self) -> &::std::option::Option<crate::types::GuardrailSensitiveInformationPolicy> {
349        &self.sensitive_information_policy
350    }
351    /// <p>The contextual grounding policy used in the guardrail.</p>
352    pub fn contextual_grounding_policy(mut self, input: crate::types::GuardrailContextualGroundingPolicy) -> Self {
353        self.contextual_grounding_policy = ::std::option::Option::Some(input);
354        self
355    }
356    /// <p>The contextual grounding policy used in the guardrail.</p>
357    pub fn set_contextual_grounding_policy(mut self, input: ::std::option::Option<crate::types::GuardrailContextualGroundingPolicy>) -> Self {
358        self.contextual_grounding_policy = input;
359        self
360    }
361    /// <p>The contextual grounding policy used in the guardrail.</p>
362    pub fn get_contextual_grounding_policy(&self) -> &::std::option::Option<crate::types::GuardrailContextualGroundingPolicy> {
363        &self.contextual_grounding_policy
364    }
365    /// <p>The current Automated Reasoning policy configuration for the guardrail, if any is configured.</p>
366    pub fn automated_reasoning_policy(mut self, input: crate::types::GuardrailAutomatedReasoningPolicy) -> Self {
367        self.automated_reasoning_policy = ::std::option::Option::Some(input);
368        self
369    }
370    /// <p>The current Automated Reasoning policy configuration for the guardrail, if any is configured.</p>
371    pub fn set_automated_reasoning_policy(mut self, input: ::std::option::Option<crate::types::GuardrailAutomatedReasoningPolicy>) -> Self {
372        self.automated_reasoning_policy = input;
373        self
374    }
375    /// <p>The current Automated Reasoning policy configuration for the guardrail, if any is configured.</p>
376    pub fn get_automated_reasoning_policy(&self) -> &::std::option::Option<crate::types::GuardrailAutomatedReasoningPolicy> {
377        &self.automated_reasoning_policy
378    }
379    /// <p>Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).</p>
380    pub fn cross_region_details(mut self, input: crate::types::GuardrailCrossRegionDetails) -> Self {
381        self.cross_region_details = ::std::option::Option::Some(input);
382        self
383    }
384    /// <p>Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).</p>
385    pub fn set_cross_region_details(mut self, input: ::std::option::Option<crate::types::GuardrailCrossRegionDetails>) -> Self {
386        self.cross_region_details = input;
387        self
388    }
389    /// <p>Details about the system-defined guardrail profile that you're using with your guardrail, including the guardrail profile ID and Amazon Resource Name (ARN).</p>
390    pub fn get_cross_region_details(&self) -> &::std::option::Option<crate::types::GuardrailCrossRegionDetails> {
391        &self.cross_region_details
392    }
393    /// <p>The date and time at which the guardrail was created.</p>
394    /// This field is required.
395    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
396        self.created_at = ::std::option::Option::Some(input);
397        self
398    }
399    /// <p>The date and time at which the guardrail was created.</p>
400    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
401        self.created_at = input;
402        self
403    }
404    /// <p>The date and time at which the guardrail was created.</p>
405    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
406        &self.created_at
407    }
408    /// <p>The date and time at which the guardrail was updated.</p>
409    /// This field is required.
410    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
411        self.updated_at = ::std::option::Option::Some(input);
412        self
413    }
414    /// <p>The date and time at which the guardrail was updated.</p>
415    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
416        self.updated_at = input;
417        self
418    }
419    /// <p>The date and time at which the guardrail was updated.</p>
420    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
421        &self.updated_at
422    }
423    /// Appends an item to `status_reasons`.
424    ///
425    /// To override the contents of this collection use [`set_status_reasons`](Self::set_status_reasons).
426    ///
427    /// <p>Appears if the <code>status</code> is <code>FAILED</code>. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.</p>
428    pub fn status_reasons(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
429        let mut v = self.status_reasons.unwrap_or_default();
430        v.push(input.into());
431        self.status_reasons = ::std::option::Option::Some(v);
432        self
433    }
434    /// <p>Appears if the <code>status</code> is <code>FAILED</code>. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.</p>
435    pub fn set_status_reasons(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
436        self.status_reasons = input;
437        self
438    }
439    /// <p>Appears if the <code>status</code> is <code>FAILED</code>. A list of reasons for why the guardrail failed to be created, updated, versioned, or deleted.</p>
440    pub fn get_status_reasons(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
441        &self.status_reasons
442    }
443    /// Appends an item to `failure_recommendations`.
444    ///
445    /// To override the contents of this collection use [`set_failure_recommendations`](Self::set_failure_recommendations).
446    ///
447    /// <p>Appears if the <code>status</code> of the guardrail is <code>FAILED</code>. A list of recommendations to carry out before retrying the request.</p>
448    pub fn failure_recommendations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
449        let mut v = self.failure_recommendations.unwrap_or_default();
450        v.push(input.into());
451        self.failure_recommendations = ::std::option::Option::Some(v);
452        self
453    }
454    /// <p>Appears if the <code>status</code> of the guardrail is <code>FAILED</code>. A list of recommendations to carry out before retrying the request.</p>
455    pub fn set_failure_recommendations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
456        self.failure_recommendations = input;
457        self
458    }
459    /// <p>Appears if the <code>status</code> of the guardrail is <code>FAILED</code>. A list of recommendations to carry out before retrying the request.</p>
460    pub fn get_failure_recommendations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
461        &self.failure_recommendations
462    }
463    /// <p>The message that the guardrail returns when it blocks a prompt.</p>
464    /// This field is required.
465    pub fn blocked_input_messaging(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
466        self.blocked_input_messaging = ::std::option::Option::Some(input.into());
467        self
468    }
469    /// <p>The message that the guardrail returns when it blocks a prompt.</p>
470    pub fn set_blocked_input_messaging(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
471        self.blocked_input_messaging = input;
472        self
473    }
474    /// <p>The message that the guardrail returns when it blocks a prompt.</p>
475    pub fn get_blocked_input_messaging(&self) -> &::std::option::Option<::std::string::String> {
476        &self.blocked_input_messaging
477    }
478    /// <p>The message that the guardrail returns when it blocks a model response.</p>
479    /// This field is required.
480    pub fn blocked_outputs_messaging(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
481        self.blocked_outputs_messaging = ::std::option::Option::Some(input.into());
482        self
483    }
484    /// <p>The message that the guardrail returns when it blocks a model response.</p>
485    pub fn set_blocked_outputs_messaging(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
486        self.blocked_outputs_messaging = input;
487        self
488    }
489    /// <p>The message that the guardrail returns when it blocks a model response.</p>
490    pub fn get_blocked_outputs_messaging(&self) -> &::std::option::Option<::std::string::String> {
491        &self.blocked_outputs_messaging
492    }
493    /// <p>The ARN of the KMS key that encrypts the guardrail.</p>
494    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
495        self.kms_key_arn = ::std::option::Option::Some(input.into());
496        self
497    }
498    /// <p>The ARN of the KMS key that encrypts the guardrail.</p>
499    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
500        self.kms_key_arn = input;
501        self
502    }
503    /// <p>The ARN of the KMS key that encrypts the guardrail.</p>
504    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
505        &self.kms_key_arn
506    }
507    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
508        self._request_id = Some(request_id.into());
509        self
510    }
511
512    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
513        self._request_id = request_id;
514        self
515    }
516    /// Consumes the builder and constructs a [`GetGuardrailOutput`](crate::operation::get_guardrail::GetGuardrailOutput).
517    /// This method will fail if any of the following fields are not set:
518    /// - [`name`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::name)
519    /// - [`guardrail_id`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::guardrail_id)
520    /// - [`guardrail_arn`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::guardrail_arn)
521    /// - [`version`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::version)
522    /// - [`status`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::status)
523    /// - [`created_at`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::created_at)
524    /// - [`updated_at`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::updated_at)
525    /// - [`blocked_input_messaging`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::blocked_input_messaging)
526    /// - [`blocked_outputs_messaging`](crate::operation::get_guardrail::builders::GetGuardrailOutputBuilder::blocked_outputs_messaging)
527    pub fn build(
528        self,
529    ) -> ::std::result::Result<crate::operation::get_guardrail::GetGuardrailOutput, ::aws_smithy_types::error::operation::BuildError> {
530        ::std::result::Result::Ok(crate::operation::get_guardrail::GetGuardrailOutput {
531            name: self.name.ok_or_else(|| {
532                ::aws_smithy_types::error::operation::BuildError::missing_field(
533                    "name",
534                    "name was not specified but it is required when building GetGuardrailOutput",
535                )
536            })?,
537            description: self.description,
538            guardrail_id: self.guardrail_id.ok_or_else(|| {
539                ::aws_smithy_types::error::operation::BuildError::missing_field(
540                    "guardrail_id",
541                    "guardrail_id was not specified but it is required when building GetGuardrailOutput",
542                )
543            })?,
544            guardrail_arn: self.guardrail_arn.ok_or_else(|| {
545                ::aws_smithy_types::error::operation::BuildError::missing_field(
546                    "guardrail_arn",
547                    "guardrail_arn was not specified but it is required when building GetGuardrailOutput",
548                )
549            })?,
550            version: self.version.ok_or_else(|| {
551                ::aws_smithy_types::error::operation::BuildError::missing_field(
552                    "version",
553                    "version was not specified but it is required when building GetGuardrailOutput",
554                )
555            })?,
556            status: self.status.ok_or_else(|| {
557                ::aws_smithy_types::error::operation::BuildError::missing_field(
558                    "status",
559                    "status was not specified but it is required when building GetGuardrailOutput",
560                )
561            })?,
562            topic_policy: self.topic_policy,
563            content_policy: self.content_policy,
564            word_policy: self.word_policy,
565            sensitive_information_policy: self.sensitive_information_policy,
566            contextual_grounding_policy: self.contextual_grounding_policy,
567            automated_reasoning_policy: self.automated_reasoning_policy,
568            cross_region_details: self.cross_region_details,
569            created_at: self.created_at.ok_or_else(|| {
570                ::aws_smithy_types::error::operation::BuildError::missing_field(
571                    "created_at",
572                    "created_at was not specified but it is required when building GetGuardrailOutput",
573                )
574            })?,
575            updated_at: self.updated_at.ok_or_else(|| {
576                ::aws_smithy_types::error::operation::BuildError::missing_field(
577                    "updated_at",
578                    "updated_at was not specified but it is required when building GetGuardrailOutput",
579                )
580            })?,
581            status_reasons: self.status_reasons,
582            failure_recommendations: self.failure_recommendations,
583            blocked_input_messaging: self.blocked_input_messaging.ok_or_else(|| {
584                ::aws_smithy_types::error::operation::BuildError::missing_field(
585                    "blocked_input_messaging",
586                    "blocked_input_messaging was not specified but it is required when building GetGuardrailOutput",
587                )
588            })?,
589            blocked_outputs_messaging: self.blocked_outputs_messaging.ok_or_else(|| {
590                ::aws_smithy_types::error::operation::BuildError::missing_field(
591                    "blocked_outputs_messaging",
592                    "blocked_outputs_messaging was not specified but it is required when building GetGuardrailOutput",
593                )
594            })?,
595            kms_key_arn: self.kms_key_arn,
596            _request_id: self._request_id,
597        })
598    }
599}
600impl ::std::fmt::Debug for GetGuardrailOutputBuilder {
601    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
602        let mut formatter = f.debug_struct("GetGuardrailOutputBuilder");
603        formatter.field("name", &"*** Sensitive Data Redacted ***");
604        formatter.field("description", &"*** Sensitive Data Redacted ***");
605        formatter.field("guardrail_id", &self.guardrail_id);
606        formatter.field("guardrail_arn", &self.guardrail_arn);
607        formatter.field("version", &self.version);
608        formatter.field("status", &self.status);
609        formatter.field("topic_policy", &self.topic_policy);
610        formatter.field("content_policy", &self.content_policy);
611        formatter.field("word_policy", &self.word_policy);
612        formatter.field("sensitive_information_policy", &self.sensitive_information_policy);
613        formatter.field("contextual_grounding_policy", &self.contextual_grounding_policy);
614        formatter.field("automated_reasoning_policy", &self.automated_reasoning_policy);
615        formatter.field("cross_region_details", &self.cross_region_details);
616        formatter.field("created_at", &self.created_at);
617        formatter.field("updated_at", &self.updated_at);
618        formatter.field("status_reasons", &"*** Sensitive Data Redacted ***");
619        formatter.field("failure_recommendations", &"*** Sensitive Data Redacted ***");
620        formatter.field("blocked_input_messaging", &"*** Sensitive Data Redacted ***");
621        formatter.field("blocked_outputs_messaging", &"*** Sensitive Data Redacted ***");
622        formatter.field("kms_key_arn", &self.kms_key_arn);
623        formatter.field("_request_id", &self._request_id);
624        formatter.finish()
625    }
626}