1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>A behavior assessment of the guardrail policies used in a call to the Converse API.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct GuardrailAssessment {
|
7 + | /// <p>The topic policy.</p>
|
8 + | pub topic_policy: ::std::option::Option<crate::types::GuardrailTopicPolicyAssessment>,
|
9 + | /// <p>The content policy.</p>
|
10 + | pub content_policy: ::std::option::Option<crate::types::GuardrailContentPolicyAssessment>,
|
11 + | /// <p>The word policy.</p>
|
12 + | pub word_policy: ::std::option::Option<crate::types::GuardrailWordPolicyAssessment>,
|
13 + | /// <p>The sensitive information policy.</p>
|
14 + | pub sensitive_information_policy: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAssessment>,
|
15 + | /// <p>The contextual grounding policy used for the guardrail assessment.</p>
|
16 + | pub contextual_grounding_policy: ::std::option::Option<crate::types::GuardrailContextualGroundingPolicyAssessment>,
|
17 + | /// <p>The invocation metrics for the guardrail assessment.</p>
|
18 + | pub invocation_metrics: ::std::option::Option<crate::types::GuardrailInvocationMetrics>,
|
19 + | }
|
20 + | impl GuardrailAssessment {
|
21 + | /// <p>The topic policy.</p>
|
22 + | pub fn topic_policy(&self) -> ::std::option::Option<&crate::types::GuardrailTopicPolicyAssessment> {
|
23 + | self.topic_policy.as_ref()
|
24 + | }
|
25 + | /// <p>The content policy.</p>
|
26 + | pub fn content_policy(&self) -> ::std::option::Option<&crate::types::GuardrailContentPolicyAssessment> {
|
27 + | self.content_policy.as_ref()
|
28 + | }
|
29 + | /// <p>The word policy.</p>
|
30 + | pub fn word_policy(&self) -> ::std::option::Option<&crate::types::GuardrailWordPolicyAssessment> {
|
31 + | self.word_policy.as_ref()
|
32 + | }
|
33 + | /// <p>The sensitive information policy.</p>
|
34 + | pub fn sensitive_information_policy(&self) -> ::std::option::Option<&crate::types::GuardrailSensitiveInformationPolicyAssessment> {
|
35 + | self.sensitive_information_policy.as_ref()
|
36 + | }
|
37 + | /// <p>The contextual grounding policy used for the guardrail assessment.</p>
|
38 + | pub fn contextual_grounding_policy(&self) -> ::std::option::Option<&crate::types::GuardrailContextualGroundingPolicyAssessment> {
|
39 + | self.contextual_grounding_policy.as_ref()
|
40 + | }
|
41 + | /// <p>The invocation metrics for the guardrail assessment.</p>
|
42 + | pub fn invocation_metrics(&self) -> ::std::option::Option<&crate::types::GuardrailInvocationMetrics> {
|
43 + | self.invocation_metrics.as_ref()
|
44 + | }
|
45 + | }
|
46 + | impl GuardrailAssessment {
|
47 + | /// Creates a new builder-style object to manufacture [`GuardrailAssessment`](crate::types::GuardrailAssessment).
|
48 + | pub fn builder() -> crate::types::builders::GuardrailAssessmentBuilder {
|
49 + | crate::types::builders::GuardrailAssessmentBuilder::default()
|
50 + | }
|
51 + | }
|
52 + |
|
53 + | /// A builder for [`GuardrailAssessment`](crate::types::GuardrailAssessment).
|
54 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
55 + | #[non_exhaustive]
|
56 + | pub struct GuardrailAssessmentBuilder {
|
57 + | pub(crate) topic_policy: ::std::option::Option<crate::types::GuardrailTopicPolicyAssessment>,
|
58 + | pub(crate) content_policy: ::std::option::Option<crate::types::GuardrailContentPolicyAssessment>,
|
59 + | pub(crate) word_policy: ::std::option::Option<crate::types::GuardrailWordPolicyAssessment>,
|
60 + | pub(crate) sensitive_information_policy: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAssessment>,
|
61 + | pub(crate) contextual_grounding_policy: ::std::option::Option<crate::types::GuardrailContextualGroundingPolicyAssessment>,
|
62 + | pub(crate) invocation_metrics: ::std::option::Option<crate::types::GuardrailInvocationMetrics>,
|
63 + | }
|
64 + | impl GuardrailAssessmentBuilder {
|
65 + | /// <p>The topic policy.</p>
|
66 + | pub fn topic_policy(mut self, input: crate::types::GuardrailTopicPolicyAssessment) -> Self {
|
67 + | self.topic_policy = ::std::option::Option::Some(input);
|
68 + | self
|
69 + | }
|
70 + | /// <p>The topic policy.</p>
|
71 + | pub fn set_topic_policy(mut self, input: ::std::option::Option<crate::types::GuardrailTopicPolicyAssessment>) -> Self {
|
72 + | self.topic_policy = input;
|
73 + | self
|
74 + | }
|
75 + | /// <p>The topic policy.</p>
|
76 + | pub fn get_topic_policy(&self) -> &::std::option::Option<crate::types::GuardrailTopicPolicyAssessment> {
|
77 + | &self.topic_policy
|
78 + | }
|
79 + | /// <p>The content policy.</p>
|
80 + | pub fn content_policy(mut self, input: crate::types::GuardrailContentPolicyAssessment) -> Self {
|
81 + | self.content_policy = ::std::option::Option::Some(input);
|
82 + | self
|
83 + | }
|
84 + | /// <p>The content policy.</p>
|
85 + | pub fn set_content_policy(mut self, input: ::std::option::Option<crate::types::GuardrailContentPolicyAssessment>) -> Self {
|
86 + | self.content_policy = input;
|
87 + | self
|
88 + | }
|
89 + | /// <p>The content policy.</p>
|
90 + | pub fn get_content_policy(&self) -> &::std::option::Option<crate::types::GuardrailContentPolicyAssessment> {
|
91 + | &self.content_policy
|
92 + | }
|
93 + | /// <p>The word policy.</p>
|
94 + | pub fn word_policy(mut self, input: crate::types::GuardrailWordPolicyAssessment) -> Self {
|
95 + | self.word_policy = ::std::option::Option::Some(input);
|
96 + | self
|
97 + | }
|
98 + | /// <p>The word policy.</p>
|
99 + | pub fn set_word_policy(mut self, input: ::std::option::Option<crate::types::GuardrailWordPolicyAssessment>) -> Self {
|
100 + | self.word_policy = input;
|
101 + | self
|
102 + | }
|
103 + | /// <p>The word policy.</p>
|
104 + | pub fn get_word_policy(&self) -> &::std::option::Option<crate::types::GuardrailWordPolicyAssessment> {
|
105 + | &self.word_policy
|
106 + | }
|
107 + | /// <p>The sensitive information policy.</p>
|
108 + | pub fn sensitive_information_policy(mut self, input: crate::types::GuardrailSensitiveInformationPolicyAssessment) -> Self {
|
109 + | self.sensitive_information_policy = ::std::option::Option::Some(input);
|
110 + | self
|
111 + | }
|
112 + | /// <p>The sensitive information policy.</p>
|
113 + | pub fn set_sensitive_information_policy(
|
114 + | mut self,
|
115 + | input: ::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAssessment>,
|
116 + | ) -> Self {
|
117 + | self.sensitive_information_policy = input;
|
118 + | self
|
119 + | }
|
120 + | /// <p>The sensitive information policy.</p>
|
121 + | pub fn get_sensitive_information_policy(&self) -> &::std::option::Option<crate::types::GuardrailSensitiveInformationPolicyAssessment> {
|
122 + | &self.sensitive_information_policy
|
123 + | }
|
124 + | /// <p>The contextual grounding policy used for the guardrail assessment.</p>
|
125 + | pub fn contextual_grounding_policy(mut self, input: crate::types::GuardrailContextualGroundingPolicyAssessment) -> Self {
|
126 + | self.contextual_grounding_policy = ::std::option::Option::Some(input);
|
127 + | self
|
128 + | }
|
129 + | /// <p>The contextual grounding policy used for the guardrail assessment.</p>
|
130 + | pub fn set_contextual_grounding_policy(
|
131 + | mut self,
|
132 + | input: ::std::option::Option<crate::types::GuardrailContextualGroundingPolicyAssessment>,
|
133 + | ) -> Self {
|
134 + | self.contextual_grounding_policy = input;
|
135 + | self
|
136 + | }
|
137 + | /// <p>The contextual grounding policy used for the guardrail assessment.</p>
|
138 + | pub fn get_contextual_grounding_policy(&self) -> &::std::option::Option<crate::types::GuardrailContextualGroundingPolicyAssessment> {
|
139 + | &self.contextual_grounding_policy
|
140 + | }
|
141 + | /// <p>The invocation metrics for the guardrail assessment.</p>
|
142 + | pub fn invocation_metrics(mut self, input: crate::types::GuardrailInvocationMetrics) -> Self {
|
143 + | self.invocation_metrics = ::std::option::Option::Some(input);
|
144 + | self
|
145 + | }
|
146 + | /// <p>The invocation metrics for the guardrail assessment.</p>
|
147 + | pub fn set_invocation_metrics(mut self, input: ::std::option::Option<crate::types::GuardrailInvocationMetrics>) -> Self {
|
148 + | self.invocation_metrics = input;
|
149 + | self
|
150 + | }
|
151 + | /// <p>The invocation metrics for the guardrail assessment.</p>
|
152 + | pub fn get_invocation_metrics(&self) -> &::std::option::Option<crate::types::GuardrailInvocationMetrics> {
|
153 + | &self.invocation_metrics
|
154 + | }
|
155 + | /// Consumes the builder and constructs a [`GuardrailAssessment`](crate::types::GuardrailAssessment).
|
156 + | pub fn build(self) -> crate::types::GuardrailAssessment {
|
157 + | crate::types::GuardrailAssessment {
|
158 + | topic_policy: self.topic_policy,
|
159 + | content_policy: self.content_policy,
|
160 + | word_policy: self.word_policy,
|
161 + | sensitive_information_policy: self.sensitive_information_policy,
|
162 + | contextual_grounding_policy: self.contextual_grounding_policy,
|
163 + | invocation_metrics: self.invocation_metrics,
|
164 + | }
|
165 + | }
|
166 + | }
|