1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// <p>The details on the use of the guardrail.</p>
|
4 - | #[non_exhaustive]
|
5 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 - | pub struct GuardrailUsage {
|
7 - | /// <p>The topic policy units processed by the guardrail.</p>
|
8 - | pub topic_policy_units: i32,
|
9 - | /// <p>The content policy units processed by the guardrail.</p>
|
10 - | pub content_policy_units: i32,
|
11 - | /// <p>The word policy units processed by the guardrail.</p>
|
12 - | pub word_policy_units: i32,
|
13 - | /// <p>The sensitive information policy units processed by the guardrail.</p>
|
14 - | pub sensitive_information_policy_units: i32,
|
15 - | /// <p>The sensitive information policy free units processed by the guardrail.</p>
|
16 - | pub sensitive_information_policy_free_units: i32,
|
17 - | /// <p>The contextual grounding policy units processed by the guardrail.</p>
|
18 - | pub contextual_grounding_policy_units: i32,
|
19 - | /// <p>The content policy image units processed by the guardrail.</p>
|
20 - | pub content_policy_image_units: ::std::option::Option<i32>,
|
21 - | }
|
22 - | impl GuardrailUsage {
|
23 - | /// <p>The topic policy units processed by the guardrail.</p>
|
24 - | pub fn topic_policy_units(&self) -> i32 {
|
25 - | self.topic_policy_units
|
26 - | }
|
27 - | /// <p>The content policy units processed by the guardrail.</p>
|
28 - | pub fn content_policy_units(&self) -> i32 {
|
29 - | self.content_policy_units
|
30 - | }
|
31 - | /// <p>The word policy units processed by the guardrail.</p>
|
32 - | pub fn word_policy_units(&self) -> i32 {
|
33 - | self.word_policy_units
|
34 - | }
|
35 - | /// <p>The sensitive information policy units processed by the guardrail.</p>
|
36 - | pub fn sensitive_information_policy_units(&self) -> i32 {
|
37 - | self.sensitive_information_policy_units
|
38 - | }
|
39 - | /// <p>The sensitive information policy free units processed by the guardrail.</p>
|
40 - | pub fn sensitive_information_policy_free_units(&self) -> i32 {
|
41 - | self.sensitive_information_policy_free_units
|
42 - | }
|
43 - | /// <p>The contextual grounding policy units processed by the guardrail.</p>
|
44 - | pub fn contextual_grounding_policy_units(&self) -> i32 {
|
45 - | self.contextual_grounding_policy_units
|
46 - | }
|
47 - | /// <p>The content policy image units processed by the guardrail.</p>
|
48 - | pub fn content_policy_image_units(&self) -> ::std::option::Option<i32> {
|
49 - | self.content_policy_image_units
|
50 - | }
|
51 - | }
|
52 - | impl GuardrailUsage {
|
53 - | /// Creates a new builder-style object to manufacture [`GuardrailUsage`](crate::types::GuardrailUsage).
|
54 - | pub fn builder() -> crate::types::builders::GuardrailUsageBuilder {
|
55 - | crate::types::builders::GuardrailUsageBuilder::default()
|
56 - | }
|
57 - | }
|
58 - |
|
59 - | /// A builder for [`GuardrailUsage`](crate::types::GuardrailUsage).
|
60 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
61 - | #[non_exhaustive]
|
62 - | pub struct GuardrailUsageBuilder {
|
63 - | pub(crate) topic_policy_units: ::std::option::Option<i32>,
|
64 - | pub(crate) content_policy_units: ::std::option::Option<i32>,
|
65 - | pub(crate) word_policy_units: ::std::option::Option<i32>,
|
66 - | pub(crate) sensitive_information_policy_units: ::std::option::Option<i32>,
|
67 - | pub(crate) sensitive_information_policy_free_units: ::std::option::Option<i32>,
|
68 - | pub(crate) contextual_grounding_policy_units: ::std::option::Option<i32>,
|
69 - | pub(crate) content_policy_image_units: ::std::option::Option<i32>,
|
70 - | }
|
71 - | impl GuardrailUsageBuilder {
|
72 - | /// <p>The topic policy units processed by the guardrail.</p>
|
73 - | /// This field is required.
|
74 - | pub fn topic_policy_units(mut self, input: i32) -> Self {
|
75 - | self.topic_policy_units = ::std::option::Option::Some(input);
|
76 - | self
|
77 - | }
|
78 - | /// <p>The topic policy units processed by the guardrail.</p>
|
79 - | pub fn set_topic_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
|
80 - | self.topic_policy_units = input;
|
81 - | self
|
82 - | }
|
83 - | /// <p>The topic policy units processed by the guardrail.</p>
|
84 - | pub fn get_topic_policy_units(&self) -> &::std::option::Option<i32> {
|
85 - | &self.topic_policy_units
|
86 - | }
|
87 - | /// <p>The content policy units processed by the guardrail.</p>
|
88 - | /// This field is required.
|
89 - | pub fn content_policy_units(mut self, input: i32) -> Self {
|
90 - | self.content_policy_units = ::std::option::Option::Some(input);
|
91 - | self
|
92 - | }
|
93 - | /// <p>The content policy units processed by the guardrail.</p>
|
94 - | pub fn set_content_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
|
95 - | self.content_policy_units = input;
|
96 - | self
|
97 - | }
|
98 - | /// <p>The content policy units processed by the guardrail.</p>
|
99 - | pub fn get_content_policy_units(&self) -> &::std::option::Option<i32> {
|
100 - | &self.content_policy_units
|
101 - | }
|
102 - | /// <p>The word policy units processed by the guardrail.</p>
|
103 - | /// This field is required.
|
104 - | pub fn word_policy_units(mut self, input: i32) -> Self {
|
105 - | self.word_policy_units = ::std::option::Option::Some(input);
|
106 - | self
|
107 - | }
|
108 - | /// <p>The word policy units processed by the guardrail.</p>
|
109 - | pub fn set_word_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
|
110 - | self.word_policy_units = input;
|
111 - | self
|
112 - | }
|
113 - | /// <p>The word policy units processed by the guardrail.</p>
|
114 - | pub fn get_word_policy_units(&self) -> &::std::option::Option<i32> {
|
115 - | &self.word_policy_units
|
116 - | }
|
117 - | /// <p>The sensitive information policy units processed by the guardrail.</p>
|
118 - | /// This field is required.
|
119 - | pub fn sensitive_information_policy_units(mut self, input: i32) -> Self {
|
120 - | self.sensitive_information_policy_units = ::std::option::Option::Some(input);
|
121 - | self
|
122 - | }
|
123 - | /// <p>The sensitive information policy units processed by the guardrail.</p>
|
124 - | pub fn set_sensitive_information_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
|
125 - | self.sensitive_information_policy_units = input;
|
126 - | self
|
127 - | }
|
128 - | /// <p>The sensitive information policy units processed by the guardrail.</p>
|
129 - | pub fn get_sensitive_information_policy_units(&self) -> &::std::option::Option<i32> {
|
130 - | &self.sensitive_information_policy_units
|
131 - | }
|
132 - | /// <p>The sensitive information policy free units processed by the guardrail.</p>
|
133 - | /// This field is required.
|
134 - | pub fn sensitive_information_policy_free_units(mut self, input: i32) -> Self {
|
135 - | self.sensitive_information_policy_free_units = ::std::option::Option::Some(input);
|
136 - | self
|
137 - | }
|
138 - | /// <p>The sensitive information policy free units processed by the guardrail.</p>
|
139 - | pub fn set_sensitive_information_policy_free_units(mut self, input: ::std::option::Option<i32>) -> Self {
|
140 - | self.sensitive_information_policy_free_units = input;
|
141 - | self
|
142 - | }
|
143 - | /// <p>The sensitive information policy free units processed by the guardrail.</p>
|
144 - | pub fn get_sensitive_information_policy_free_units(&self) -> &::std::option::Option<i32> {
|
145 - | &self.sensitive_information_policy_free_units
|
146 - | }
|
147 - | /// <p>The contextual grounding policy units processed by the guardrail.</p>
|
148 - | /// This field is required.
|
149 - | pub fn contextual_grounding_policy_units(mut self, input: i32) -> Self {
|
150 - | self.contextual_grounding_policy_units = ::std::option::Option::Some(input);
|
151 - | self
|
152 - | }
|
153 - | /// <p>The contextual grounding policy units processed by the guardrail.</p>
|
154 - | pub fn set_contextual_grounding_policy_units(mut self, input: ::std::option::Option<i32>) -> Self {
|
155 - | self.contextual_grounding_policy_units = input;
|
156 - | self
|
157 - | }
|
158 - | /// <p>The contextual grounding policy units processed by the guardrail.</p>
|
159 - | pub fn get_contextual_grounding_policy_units(&self) -> &::std::option::Option<i32> {
|
160 - | &self.contextual_grounding_policy_units
|
161 - | }
|
162 - | /// <p>The content policy image units processed by the guardrail.</p>
|
163 - | pub fn content_policy_image_units(mut self, input: i32) -> Self {
|
164 - | self.content_policy_image_units = ::std::option::Option::Some(input);
|
165 - | self
|
166 - | }
|
167 - | /// <p>The content policy image units processed by the guardrail.</p>
|
168 - | pub fn set_content_policy_image_units(mut self, input: ::std::option::Option<i32>) -> Self {
|
169 - | self.content_policy_image_units = input;
|
170 - | self
|
171 - | }
|
172 - | /// <p>The content policy image units processed by the guardrail.</p>
|
173 - | pub fn get_content_policy_image_units(&self) -> &::std::option::Option<i32> {
|
174 - | &self.content_policy_image_units
|
175 - | }
|
176 - | /// Consumes the builder and constructs a [`GuardrailUsage`](crate::types::GuardrailUsage).
|
177 - | /// This method will fail if any of the following fields are not set:
|
178 - | /// - [`topic_policy_units`](crate::types::builders::GuardrailUsageBuilder::topic_policy_units)
|
179 - | /// - [`content_policy_units`](crate::types::builders::GuardrailUsageBuilder::content_policy_units)
|
180 - | /// - [`word_policy_units`](crate::types::builders::GuardrailUsageBuilder::word_policy_units)
|
181 - | /// - [`sensitive_information_policy_units`](crate::types::builders::GuardrailUsageBuilder::sensitive_information_policy_units)
|
182 - | /// - [`sensitive_information_policy_free_units`](crate::types::builders::GuardrailUsageBuilder::sensitive_information_policy_free_units)
|
183 - | /// - [`contextual_grounding_policy_units`](crate::types::builders::GuardrailUsageBuilder::contextual_grounding_policy_units)
|
184 - | pub fn build(self) -> ::std::result::Result<crate::types::GuardrailUsage, ::aws_smithy_types::error::operation::BuildError> {
|
185 - | ::std::result::Result::Ok(crate::types::GuardrailUsage {
|
186 - | topic_policy_units: self.topic_policy_units.ok_or_else(|| {
|
187 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
188 - | "topic_policy_units",
|
189 - | "topic_policy_units was not specified but it is required when building GuardrailUsage",
|
190 - | )
|
191 - | })?,
|
192 - | content_policy_units: self.content_policy_units.ok_or_else(|| {
|
193 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
194 - | "content_policy_units",
|
195 - | "content_policy_units was not specified but it is required when building GuardrailUsage",
|
196 - | )
|
197 - | })?,
|
198 - | word_policy_units: self.word_policy_units.ok_or_else(|| {
|
199 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
200 - | "word_policy_units",
|
201 - | "word_policy_units was not specified but it is required when building GuardrailUsage",
|
202 - | )
|
203 - | })?,
|
204 - | sensitive_information_policy_units: self.sensitive_information_policy_units.ok_or_else(|| {
|
205 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
206 - | "sensitive_information_policy_units",
|
207 - | "sensitive_information_policy_units was not specified but it is required when building GuardrailUsage",
|
208 - | )
|
209 - | })?,
|
210 - | sensitive_information_policy_free_units: self.sensitive_information_policy_free_units.ok_or_else(|| {
|
211 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
212 - | "sensitive_information_policy_free_units",
|
213 - | "sensitive_information_policy_free_units was not specified but it is required when building GuardrailUsage",
|
214 - | )
|
215 - | })?,
|
216 - | contextual_grounding_policy_units: self.contextual_grounding_policy_units.ok_or_else(|| {
|
217 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
218 - | "contextual_grounding_policy_units",
|
219 - | "contextual_grounding_policy_units was not specified but it is required when building GuardrailUsage",
|
220 - | )
|
221 - | })?,
|
222 - | content_policy_image_units: self.content_policy_image_units,
|
223 - | })
|
224 - | }
|
225 - | }
|