Skip to main content

google_cloud_modelarmor_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate serde;
26extern crate serde_json;
27extern crate serde_with;
28extern crate std;
29extern crate tracing;
30extern crate wkt;
31
32mod debug;
33mod deserialize;
34mod serialize;
35
36/// Message describing Template resource
37#[derive(Clone, Default, PartialEq)]
38#[non_exhaustive]
39pub struct Template {
40    /// Identifier. name of resource
41    pub name: std::string::String,
42
43    /// Output only. [Output only] Create time stamp
44    pub create_time: std::option::Option<wkt::Timestamp>,
45
46    /// Output only. [Output only] Update time stamp
47    pub update_time: std::option::Option<wkt::Timestamp>,
48
49    /// Optional. Labels as key value pairs
50    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
51
52    /// Required. filter configuration for this template
53    pub filter_config: std::option::Option<crate::model::FilterConfig>,
54
55    /// Optional. metadata for this template
56    pub template_metadata: std::option::Option<crate::model::template::TemplateMetadata>,
57
58    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl Template {
62    pub fn new() -> Self {
63        std::default::Default::default()
64    }
65
66    /// Sets the value of [name][crate::model::Template::name].
67    ///
68    /// # Example
69    /// ```ignore,no_run
70    /// # use google_cloud_modelarmor_v1::model::Template;
71    /// let x = Template::new().set_name("example");
72    /// ```
73    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74        self.name = v.into();
75        self
76    }
77
78    /// Sets the value of [create_time][crate::model::Template::create_time].
79    ///
80    /// # Example
81    /// ```ignore,no_run
82    /// # use google_cloud_modelarmor_v1::model::Template;
83    /// use wkt::Timestamp;
84    /// let x = Template::new().set_create_time(Timestamp::default()/* use setters */);
85    /// ```
86    pub fn set_create_time<T>(mut self, v: T) -> Self
87    where
88        T: std::convert::Into<wkt::Timestamp>,
89    {
90        self.create_time = std::option::Option::Some(v.into());
91        self
92    }
93
94    /// Sets or clears the value of [create_time][crate::model::Template::create_time].
95    ///
96    /// # Example
97    /// ```ignore,no_run
98    /// # use google_cloud_modelarmor_v1::model::Template;
99    /// use wkt::Timestamp;
100    /// let x = Template::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
101    /// let x = Template::new().set_or_clear_create_time(None::<Timestamp>);
102    /// ```
103    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
104    where
105        T: std::convert::Into<wkt::Timestamp>,
106    {
107        self.create_time = v.map(|x| x.into());
108        self
109    }
110
111    /// Sets the value of [update_time][crate::model::Template::update_time].
112    ///
113    /// # Example
114    /// ```ignore,no_run
115    /// # use google_cloud_modelarmor_v1::model::Template;
116    /// use wkt::Timestamp;
117    /// let x = Template::new().set_update_time(Timestamp::default()/* use setters */);
118    /// ```
119    pub fn set_update_time<T>(mut self, v: T) -> Self
120    where
121        T: std::convert::Into<wkt::Timestamp>,
122    {
123        self.update_time = std::option::Option::Some(v.into());
124        self
125    }
126
127    /// Sets or clears the value of [update_time][crate::model::Template::update_time].
128    ///
129    /// # Example
130    /// ```ignore,no_run
131    /// # use google_cloud_modelarmor_v1::model::Template;
132    /// use wkt::Timestamp;
133    /// let x = Template::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
134    /// let x = Template::new().set_or_clear_update_time(None::<Timestamp>);
135    /// ```
136    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
137    where
138        T: std::convert::Into<wkt::Timestamp>,
139    {
140        self.update_time = v.map(|x| x.into());
141        self
142    }
143
144    /// Sets the value of [labels][crate::model::Template::labels].
145    ///
146    /// # Example
147    /// ```ignore,no_run
148    /// # use google_cloud_modelarmor_v1::model::Template;
149    /// let x = Template::new().set_labels([
150    ///     ("key0", "abc"),
151    ///     ("key1", "xyz"),
152    /// ]);
153    /// ```
154    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
155    where
156        T: std::iter::IntoIterator<Item = (K, V)>,
157        K: std::convert::Into<std::string::String>,
158        V: std::convert::Into<std::string::String>,
159    {
160        use std::iter::Iterator;
161        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
162        self
163    }
164
165    /// Sets the value of [filter_config][crate::model::Template::filter_config].
166    ///
167    /// # Example
168    /// ```ignore,no_run
169    /// # use google_cloud_modelarmor_v1::model::Template;
170    /// use google_cloud_modelarmor_v1::model::FilterConfig;
171    /// let x = Template::new().set_filter_config(FilterConfig::default()/* use setters */);
172    /// ```
173    pub fn set_filter_config<T>(mut self, v: T) -> Self
174    where
175        T: std::convert::Into<crate::model::FilterConfig>,
176    {
177        self.filter_config = std::option::Option::Some(v.into());
178        self
179    }
180
181    /// Sets or clears the value of [filter_config][crate::model::Template::filter_config].
182    ///
183    /// # Example
184    /// ```ignore,no_run
185    /// # use google_cloud_modelarmor_v1::model::Template;
186    /// use google_cloud_modelarmor_v1::model::FilterConfig;
187    /// let x = Template::new().set_or_clear_filter_config(Some(FilterConfig::default()/* use setters */));
188    /// let x = Template::new().set_or_clear_filter_config(None::<FilterConfig>);
189    /// ```
190    pub fn set_or_clear_filter_config<T>(mut self, v: std::option::Option<T>) -> Self
191    where
192        T: std::convert::Into<crate::model::FilterConfig>,
193    {
194        self.filter_config = v.map(|x| x.into());
195        self
196    }
197
198    /// Sets the value of [template_metadata][crate::model::Template::template_metadata].
199    ///
200    /// # Example
201    /// ```ignore,no_run
202    /// # use google_cloud_modelarmor_v1::model::Template;
203    /// use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
204    /// let x = Template::new().set_template_metadata(TemplateMetadata::default()/* use setters */);
205    /// ```
206    pub fn set_template_metadata<T>(mut self, v: T) -> Self
207    where
208        T: std::convert::Into<crate::model::template::TemplateMetadata>,
209    {
210        self.template_metadata = std::option::Option::Some(v.into());
211        self
212    }
213
214    /// Sets or clears the value of [template_metadata][crate::model::Template::template_metadata].
215    ///
216    /// # Example
217    /// ```ignore,no_run
218    /// # use google_cloud_modelarmor_v1::model::Template;
219    /// use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
220    /// let x = Template::new().set_or_clear_template_metadata(Some(TemplateMetadata::default()/* use setters */));
221    /// let x = Template::new().set_or_clear_template_metadata(None::<TemplateMetadata>);
222    /// ```
223    pub fn set_or_clear_template_metadata<T>(mut self, v: std::option::Option<T>) -> Self
224    where
225        T: std::convert::Into<crate::model::template::TemplateMetadata>,
226    {
227        self.template_metadata = v.map(|x| x.into());
228        self
229    }
230}
231
232impl wkt::message::Message for Template {
233    fn typename() -> &'static str {
234        "type.googleapis.com/google.cloud.modelarmor.v1.Template"
235    }
236}
237
238/// Defines additional types related to [Template].
239pub mod template {
240    #[allow(unused_imports)]
241    use super::*;
242
243    /// Message describing TemplateMetadata
244    #[derive(Clone, Default, PartialEq)]
245    #[non_exhaustive]
246    pub struct TemplateMetadata {
247        /// Optional. If true, partial detector failures should be ignored.
248        pub ignore_partial_invocation_failures: bool,
249
250        /// Optional. Indicates the custom error code set by the user to be returned
251        /// to the end user by the service extension if the prompt trips Model Armor
252        /// filters.
253        pub custom_prompt_safety_error_code: i32,
254
255        /// Optional. Indicates the custom error message set by the user to be
256        /// returned to the end user if the prompt trips Model Armor filters.
257        pub custom_prompt_safety_error_message: std::string::String,
258
259        /// Optional. Indicates the custom error code set by the user to be returned
260        /// to the end user if the LLM response trips Model Armor filters.
261        pub custom_llm_response_safety_error_code: i32,
262
263        /// Optional. Indicates the custom error message set by the user to be
264        /// returned to the end user if the LLM response trips Model Armor filters.
265        pub custom_llm_response_safety_error_message: std::string::String,
266
267        /// Optional. If true, log template crud operations.
268        pub log_template_operations: bool,
269
270        /// Optional. If true, log sanitize operations.
271        pub log_sanitize_operations: bool,
272
273        /// Optional. Enforcement type for Model Armor filters.
274        pub enforcement_type: crate::model::template::template_metadata::EnforcementType,
275
276        /// Optional. Metadata for multi language detection.
277        pub multi_language_detection:
278            std::option::Option<crate::model::template::template_metadata::MultiLanguageDetection>,
279
280        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
281    }
282
283    impl TemplateMetadata {
284        pub fn new() -> Self {
285            std::default::Default::default()
286        }
287
288        /// Sets the value of [ignore_partial_invocation_failures][crate::model::template::TemplateMetadata::ignore_partial_invocation_failures].
289        ///
290        /// # Example
291        /// ```ignore,no_run
292        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
293        /// let x = TemplateMetadata::new().set_ignore_partial_invocation_failures(true);
294        /// ```
295        pub fn set_ignore_partial_invocation_failures<T: std::convert::Into<bool>>(
296            mut self,
297            v: T,
298        ) -> Self {
299            self.ignore_partial_invocation_failures = v.into();
300            self
301        }
302
303        /// Sets the value of [custom_prompt_safety_error_code][crate::model::template::TemplateMetadata::custom_prompt_safety_error_code].
304        ///
305        /// # Example
306        /// ```ignore,no_run
307        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
308        /// let x = TemplateMetadata::new().set_custom_prompt_safety_error_code(42);
309        /// ```
310        pub fn set_custom_prompt_safety_error_code<T: std::convert::Into<i32>>(
311            mut self,
312            v: T,
313        ) -> Self {
314            self.custom_prompt_safety_error_code = v.into();
315            self
316        }
317
318        /// Sets the value of [custom_prompt_safety_error_message][crate::model::template::TemplateMetadata::custom_prompt_safety_error_message].
319        ///
320        /// # Example
321        /// ```ignore,no_run
322        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
323        /// let x = TemplateMetadata::new().set_custom_prompt_safety_error_message("example");
324        /// ```
325        pub fn set_custom_prompt_safety_error_message<
326            T: std::convert::Into<std::string::String>,
327        >(
328            mut self,
329            v: T,
330        ) -> Self {
331            self.custom_prompt_safety_error_message = v.into();
332            self
333        }
334
335        /// Sets the value of [custom_llm_response_safety_error_code][crate::model::template::TemplateMetadata::custom_llm_response_safety_error_code].
336        ///
337        /// # Example
338        /// ```ignore,no_run
339        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
340        /// let x = TemplateMetadata::new().set_custom_llm_response_safety_error_code(42);
341        /// ```
342        pub fn set_custom_llm_response_safety_error_code<T: std::convert::Into<i32>>(
343            mut self,
344            v: T,
345        ) -> Self {
346            self.custom_llm_response_safety_error_code = v.into();
347            self
348        }
349
350        /// Sets the value of [custom_llm_response_safety_error_message][crate::model::template::TemplateMetadata::custom_llm_response_safety_error_message].
351        ///
352        /// # Example
353        /// ```ignore,no_run
354        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
355        /// let x = TemplateMetadata::new().set_custom_llm_response_safety_error_message("example");
356        /// ```
357        pub fn set_custom_llm_response_safety_error_message<
358            T: std::convert::Into<std::string::String>,
359        >(
360            mut self,
361            v: T,
362        ) -> Self {
363            self.custom_llm_response_safety_error_message = v.into();
364            self
365        }
366
367        /// Sets the value of [log_template_operations][crate::model::template::TemplateMetadata::log_template_operations].
368        ///
369        /// # Example
370        /// ```ignore,no_run
371        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
372        /// let x = TemplateMetadata::new().set_log_template_operations(true);
373        /// ```
374        pub fn set_log_template_operations<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
375            self.log_template_operations = v.into();
376            self
377        }
378
379        /// Sets the value of [log_sanitize_operations][crate::model::template::TemplateMetadata::log_sanitize_operations].
380        ///
381        /// # Example
382        /// ```ignore,no_run
383        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
384        /// let x = TemplateMetadata::new().set_log_sanitize_operations(true);
385        /// ```
386        pub fn set_log_sanitize_operations<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
387            self.log_sanitize_operations = v.into();
388            self
389        }
390
391        /// Sets the value of [enforcement_type][crate::model::template::TemplateMetadata::enforcement_type].
392        ///
393        /// # Example
394        /// ```ignore,no_run
395        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
396        /// use google_cloud_modelarmor_v1::model::template::template_metadata::EnforcementType;
397        /// let x0 = TemplateMetadata::new().set_enforcement_type(EnforcementType::InspectOnly);
398        /// let x1 = TemplateMetadata::new().set_enforcement_type(EnforcementType::InspectAndBlock);
399        /// ```
400        pub fn set_enforcement_type<
401            T: std::convert::Into<crate::model::template::template_metadata::EnforcementType>,
402        >(
403            mut self,
404            v: T,
405        ) -> Self {
406            self.enforcement_type = v.into();
407            self
408        }
409
410        /// Sets the value of [multi_language_detection][crate::model::template::TemplateMetadata::multi_language_detection].
411        ///
412        /// # Example
413        /// ```ignore,no_run
414        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
415        /// use google_cloud_modelarmor_v1::model::template::template_metadata::MultiLanguageDetection;
416        /// let x = TemplateMetadata::new().set_multi_language_detection(MultiLanguageDetection::default()/* use setters */);
417        /// ```
418        pub fn set_multi_language_detection<T>(mut self, v: T) -> Self
419        where
420            T: std::convert::Into<
421                    crate::model::template::template_metadata::MultiLanguageDetection,
422                >,
423        {
424            self.multi_language_detection = std::option::Option::Some(v.into());
425            self
426        }
427
428        /// Sets or clears the value of [multi_language_detection][crate::model::template::TemplateMetadata::multi_language_detection].
429        ///
430        /// # Example
431        /// ```ignore,no_run
432        /// # use google_cloud_modelarmor_v1::model::template::TemplateMetadata;
433        /// use google_cloud_modelarmor_v1::model::template::template_metadata::MultiLanguageDetection;
434        /// let x = TemplateMetadata::new().set_or_clear_multi_language_detection(Some(MultiLanguageDetection::default()/* use setters */));
435        /// let x = TemplateMetadata::new().set_or_clear_multi_language_detection(None::<MultiLanguageDetection>);
436        /// ```
437        pub fn set_or_clear_multi_language_detection<T>(mut self, v: std::option::Option<T>) -> Self
438        where
439            T: std::convert::Into<
440                    crate::model::template::template_metadata::MultiLanguageDetection,
441                >,
442        {
443            self.multi_language_detection = v.map(|x| x.into());
444            self
445        }
446    }
447
448    impl wkt::message::Message for TemplateMetadata {
449        fn typename() -> &'static str {
450            "type.googleapis.com/google.cloud.modelarmor.v1.Template.TemplateMetadata"
451        }
452    }
453
454    /// Defines additional types related to [TemplateMetadata].
455    pub mod template_metadata {
456        #[allow(unused_imports)]
457        use super::*;
458
459        /// Metadata to enable multi language detection via template.
460        #[derive(Clone, Default, PartialEq)]
461        #[non_exhaustive]
462        pub struct MultiLanguageDetection {
463            /// Required. If true, multi language detection will be enabled.
464            pub enable_multi_language_detection: bool,
465
466            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
467        }
468
469        impl MultiLanguageDetection {
470            pub fn new() -> Self {
471                std::default::Default::default()
472            }
473
474            /// Sets the value of [enable_multi_language_detection][crate::model::template::template_metadata::MultiLanguageDetection::enable_multi_language_detection].
475            ///
476            /// # Example
477            /// ```ignore,no_run
478            /// # use google_cloud_modelarmor_v1::model::template::template_metadata::MultiLanguageDetection;
479            /// let x = MultiLanguageDetection::new().set_enable_multi_language_detection(true);
480            /// ```
481            pub fn set_enable_multi_language_detection<T: std::convert::Into<bool>>(
482                mut self,
483                v: T,
484            ) -> Self {
485                self.enable_multi_language_detection = v.into();
486                self
487            }
488        }
489
490        impl wkt::message::Message for MultiLanguageDetection {
491            fn typename() -> &'static str {
492                "type.googleapis.com/google.cloud.modelarmor.v1.Template.TemplateMetadata.MultiLanguageDetection"
493            }
494        }
495
496        /// Enforcement type for Model Armor filters.
497        ///
498        /// # Working with unknown values
499        ///
500        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
501        /// additional enum variants at any time. Adding new variants is not considered
502        /// a breaking change. Applications should write their code in anticipation of:
503        ///
504        /// - New values appearing in future releases of the client library, **and**
505        /// - New values received dynamically, without application changes.
506        ///
507        /// Please consult the [Working with enums] section in the user guide for some
508        /// guidelines.
509        ///
510        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
511        #[derive(Clone, Debug, PartialEq)]
512        #[non_exhaustive]
513        pub enum EnforcementType {
514            /// Default value. Same as INSPECT_AND_BLOCK.
515            Unspecified,
516            /// Model Armor filters will run in inspect only mode. No action will be
517            /// taken on the request.
518            InspectOnly,
519            /// Model Armor filters will run in inspect and block mode. Requests
520            /// that trip Model Armor filters will be blocked.
521            InspectAndBlock,
522            /// If set, the enum was initialized with an unknown value.
523            ///
524            /// Applications can examine the value using [EnforcementType::value] or
525            /// [EnforcementType::name].
526            UnknownValue(enforcement_type::UnknownValue),
527        }
528
529        #[doc(hidden)]
530        pub mod enforcement_type {
531            #[allow(unused_imports)]
532            use super::*;
533            #[derive(Clone, Debug, PartialEq)]
534            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
535        }
536
537        impl EnforcementType {
538            /// Gets the enum value.
539            ///
540            /// Returns `None` if the enum contains an unknown value deserialized from
541            /// the string representation of enums.
542            pub fn value(&self) -> std::option::Option<i32> {
543                match self {
544                    Self::Unspecified => std::option::Option::Some(0),
545                    Self::InspectOnly => std::option::Option::Some(1),
546                    Self::InspectAndBlock => std::option::Option::Some(2),
547                    Self::UnknownValue(u) => u.0.value(),
548                }
549            }
550
551            /// Gets the enum value as a string.
552            ///
553            /// Returns `None` if the enum contains an unknown value deserialized from
554            /// the integer representation of enums.
555            pub fn name(&self) -> std::option::Option<&str> {
556                match self {
557                    Self::Unspecified => std::option::Option::Some("ENFORCEMENT_TYPE_UNSPECIFIED"),
558                    Self::InspectOnly => std::option::Option::Some("INSPECT_ONLY"),
559                    Self::InspectAndBlock => std::option::Option::Some("INSPECT_AND_BLOCK"),
560                    Self::UnknownValue(u) => u.0.name(),
561                }
562            }
563        }
564
565        impl std::default::Default for EnforcementType {
566            fn default() -> Self {
567                use std::convert::From;
568                Self::from(0)
569            }
570        }
571
572        impl std::fmt::Display for EnforcementType {
573            fn fmt(
574                &self,
575                f: &mut std::fmt::Formatter<'_>,
576            ) -> std::result::Result<(), std::fmt::Error> {
577                wkt::internal::display_enum(f, self.name(), self.value())
578            }
579        }
580
581        impl std::convert::From<i32> for EnforcementType {
582            fn from(value: i32) -> Self {
583                match value {
584                    0 => Self::Unspecified,
585                    1 => Self::InspectOnly,
586                    2 => Self::InspectAndBlock,
587                    _ => Self::UnknownValue(enforcement_type::UnknownValue(
588                        wkt::internal::UnknownEnumValue::Integer(value),
589                    )),
590                }
591            }
592        }
593
594        impl std::convert::From<&str> for EnforcementType {
595            fn from(value: &str) -> Self {
596                use std::string::ToString;
597                match value {
598                    "ENFORCEMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
599                    "INSPECT_ONLY" => Self::InspectOnly,
600                    "INSPECT_AND_BLOCK" => Self::InspectAndBlock,
601                    _ => Self::UnknownValue(enforcement_type::UnknownValue(
602                        wkt::internal::UnknownEnumValue::String(value.to_string()),
603                    )),
604                }
605            }
606        }
607
608        impl serde::ser::Serialize for EnforcementType {
609            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
610            where
611                S: serde::Serializer,
612            {
613                match self {
614                    Self::Unspecified => serializer.serialize_i32(0),
615                    Self::InspectOnly => serializer.serialize_i32(1),
616                    Self::InspectAndBlock => serializer.serialize_i32(2),
617                    Self::UnknownValue(u) => u.0.serialize(serializer),
618                }
619            }
620        }
621
622        impl<'de> serde::de::Deserialize<'de> for EnforcementType {
623            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
624            where
625                D: serde::Deserializer<'de>,
626            {
627                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EnforcementType>::new(
628                    ".google.cloud.modelarmor.v1.Template.TemplateMetadata.EnforcementType",
629                ))
630            }
631        }
632    }
633}
634
635/// Message describing FloorSetting resource
636#[derive(Clone, Default, PartialEq)]
637#[non_exhaustive]
638pub struct FloorSetting {
639    /// Identifier. The resource name.
640    pub name: std::string::String,
641
642    /// Output only. [Output only] Create timestamp
643    pub create_time: std::option::Option<wkt::Timestamp>,
644
645    /// Output only. [Output only] Update timestamp
646    pub update_time: std::option::Option<wkt::Timestamp>,
647
648    /// Required. ModelArmor filter configuration.
649    pub filter_config: std::option::Option<crate::model::FilterConfig>,
650
651    /// Optional. Floor Settings enforcement status.
652    pub enable_floor_setting_enforcement: std::option::Option<bool>,
653
654    /// Optional. List of integrated services for which the floor setting is
655    /// applicable.
656    pub integrated_services: std::vec::Vec<crate::model::floor_setting::IntegratedService>,
657
658    /// Optional. AI Platform floor setting.
659    pub ai_platform_floor_setting: std::option::Option<crate::model::AiPlatformFloorSetting>,
660
661    /// Optional. Metadata for FloorSetting
662    pub floor_setting_metadata:
663        std::option::Option<crate::model::floor_setting::FloorSettingMetadata>,
664
665    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
666}
667
668impl FloorSetting {
669    pub fn new() -> Self {
670        std::default::Default::default()
671    }
672
673    /// Sets the value of [name][crate::model::FloorSetting::name].
674    ///
675    /// # Example
676    /// ```ignore,no_run
677    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
678    /// let x = FloorSetting::new().set_name("example");
679    /// ```
680    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
681        self.name = v.into();
682        self
683    }
684
685    /// Sets the value of [create_time][crate::model::FloorSetting::create_time].
686    ///
687    /// # Example
688    /// ```ignore,no_run
689    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
690    /// use wkt::Timestamp;
691    /// let x = FloorSetting::new().set_create_time(Timestamp::default()/* use setters */);
692    /// ```
693    pub fn set_create_time<T>(mut self, v: T) -> Self
694    where
695        T: std::convert::Into<wkt::Timestamp>,
696    {
697        self.create_time = std::option::Option::Some(v.into());
698        self
699    }
700
701    /// Sets or clears the value of [create_time][crate::model::FloorSetting::create_time].
702    ///
703    /// # Example
704    /// ```ignore,no_run
705    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
706    /// use wkt::Timestamp;
707    /// let x = FloorSetting::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
708    /// let x = FloorSetting::new().set_or_clear_create_time(None::<Timestamp>);
709    /// ```
710    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
711    where
712        T: std::convert::Into<wkt::Timestamp>,
713    {
714        self.create_time = v.map(|x| x.into());
715        self
716    }
717
718    /// Sets the value of [update_time][crate::model::FloorSetting::update_time].
719    ///
720    /// # Example
721    /// ```ignore,no_run
722    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
723    /// use wkt::Timestamp;
724    /// let x = FloorSetting::new().set_update_time(Timestamp::default()/* use setters */);
725    /// ```
726    pub fn set_update_time<T>(mut self, v: T) -> Self
727    where
728        T: std::convert::Into<wkt::Timestamp>,
729    {
730        self.update_time = std::option::Option::Some(v.into());
731        self
732    }
733
734    /// Sets or clears the value of [update_time][crate::model::FloorSetting::update_time].
735    ///
736    /// # Example
737    /// ```ignore,no_run
738    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
739    /// use wkt::Timestamp;
740    /// let x = FloorSetting::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
741    /// let x = FloorSetting::new().set_or_clear_update_time(None::<Timestamp>);
742    /// ```
743    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
744    where
745        T: std::convert::Into<wkt::Timestamp>,
746    {
747        self.update_time = v.map(|x| x.into());
748        self
749    }
750
751    /// Sets the value of [filter_config][crate::model::FloorSetting::filter_config].
752    ///
753    /// # Example
754    /// ```ignore,no_run
755    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
756    /// use google_cloud_modelarmor_v1::model::FilterConfig;
757    /// let x = FloorSetting::new().set_filter_config(FilterConfig::default()/* use setters */);
758    /// ```
759    pub fn set_filter_config<T>(mut self, v: T) -> Self
760    where
761        T: std::convert::Into<crate::model::FilterConfig>,
762    {
763        self.filter_config = std::option::Option::Some(v.into());
764        self
765    }
766
767    /// Sets or clears the value of [filter_config][crate::model::FloorSetting::filter_config].
768    ///
769    /// # Example
770    /// ```ignore,no_run
771    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
772    /// use google_cloud_modelarmor_v1::model::FilterConfig;
773    /// let x = FloorSetting::new().set_or_clear_filter_config(Some(FilterConfig::default()/* use setters */));
774    /// let x = FloorSetting::new().set_or_clear_filter_config(None::<FilterConfig>);
775    /// ```
776    pub fn set_or_clear_filter_config<T>(mut self, v: std::option::Option<T>) -> Self
777    where
778        T: std::convert::Into<crate::model::FilterConfig>,
779    {
780        self.filter_config = v.map(|x| x.into());
781        self
782    }
783
784    /// Sets the value of [enable_floor_setting_enforcement][crate::model::FloorSetting::enable_floor_setting_enforcement].
785    ///
786    /// # Example
787    /// ```ignore,no_run
788    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
789    /// let x = FloorSetting::new().set_enable_floor_setting_enforcement(true);
790    /// ```
791    pub fn set_enable_floor_setting_enforcement<T>(mut self, v: T) -> Self
792    where
793        T: std::convert::Into<bool>,
794    {
795        self.enable_floor_setting_enforcement = std::option::Option::Some(v.into());
796        self
797    }
798
799    /// Sets or clears the value of [enable_floor_setting_enforcement][crate::model::FloorSetting::enable_floor_setting_enforcement].
800    ///
801    /// # Example
802    /// ```ignore,no_run
803    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
804    /// let x = FloorSetting::new().set_or_clear_enable_floor_setting_enforcement(Some(false));
805    /// let x = FloorSetting::new().set_or_clear_enable_floor_setting_enforcement(None::<bool>);
806    /// ```
807    pub fn set_or_clear_enable_floor_setting_enforcement<T>(
808        mut self,
809        v: std::option::Option<T>,
810    ) -> Self
811    where
812        T: std::convert::Into<bool>,
813    {
814        self.enable_floor_setting_enforcement = v.map(|x| x.into());
815        self
816    }
817
818    /// Sets the value of [integrated_services][crate::model::FloorSetting::integrated_services].
819    ///
820    /// # Example
821    /// ```ignore,no_run
822    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
823    /// use google_cloud_modelarmor_v1::model::floor_setting::IntegratedService;
824    /// let x = FloorSetting::new().set_integrated_services([
825    ///     IntegratedService::AiPlatform,
826    /// ]);
827    /// ```
828    pub fn set_integrated_services<T, V>(mut self, v: T) -> Self
829    where
830        T: std::iter::IntoIterator<Item = V>,
831        V: std::convert::Into<crate::model::floor_setting::IntegratedService>,
832    {
833        use std::iter::Iterator;
834        self.integrated_services = v.into_iter().map(|i| i.into()).collect();
835        self
836    }
837
838    /// Sets the value of [ai_platform_floor_setting][crate::model::FloorSetting::ai_platform_floor_setting].
839    ///
840    /// # Example
841    /// ```ignore,no_run
842    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
843    /// use google_cloud_modelarmor_v1::model::AiPlatformFloorSetting;
844    /// let x = FloorSetting::new().set_ai_platform_floor_setting(AiPlatformFloorSetting::default()/* use setters */);
845    /// ```
846    pub fn set_ai_platform_floor_setting<T>(mut self, v: T) -> Self
847    where
848        T: std::convert::Into<crate::model::AiPlatformFloorSetting>,
849    {
850        self.ai_platform_floor_setting = std::option::Option::Some(v.into());
851        self
852    }
853
854    /// Sets or clears the value of [ai_platform_floor_setting][crate::model::FloorSetting::ai_platform_floor_setting].
855    ///
856    /// # Example
857    /// ```ignore,no_run
858    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
859    /// use google_cloud_modelarmor_v1::model::AiPlatformFloorSetting;
860    /// let x = FloorSetting::new().set_or_clear_ai_platform_floor_setting(Some(AiPlatformFloorSetting::default()/* use setters */));
861    /// let x = FloorSetting::new().set_or_clear_ai_platform_floor_setting(None::<AiPlatformFloorSetting>);
862    /// ```
863    pub fn set_or_clear_ai_platform_floor_setting<T>(mut self, v: std::option::Option<T>) -> Self
864    where
865        T: std::convert::Into<crate::model::AiPlatformFloorSetting>,
866    {
867        self.ai_platform_floor_setting = v.map(|x| x.into());
868        self
869    }
870
871    /// Sets the value of [floor_setting_metadata][crate::model::FloorSetting::floor_setting_metadata].
872    ///
873    /// # Example
874    /// ```ignore,no_run
875    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
876    /// use google_cloud_modelarmor_v1::model::floor_setting::FloorSettingMetadata;
877    /// let x = FloorSetting::new().set_floor_setting_metadata(FloorSettingMetadata::default()/* use setters */);
878    /// ```
879    pub fn set_floor_setting_metadata<T>(mut self, v: T) -> Self
880    where
881        T: std::convert::Into<crate::model::floor_setting::FloorSettingMetadata>,
882    {
883        self.floor_setting_metadata = std::option::Option::Some(v.into());
884        self
885    }
886
887    /// Sets or clears the value of [floor_setting_metadata][crate::model::FloorSetting::floor_setting_metadata].
888    ///
889    /// # Example
890    /// ```ignore,no_run
891    /// # use google_cloud_modelarmor_v1::model::FloorSetting;
892    /// use google_cloud_modelarmor_v1::model::floor_setting::FloorSettingMetadata;
893    /// let x = FloorSetting::new().set_or_clear_floor_setting_metadata(Some(FloorSettingMetadata::default()/* use setters */));
894    /// let x = FloorSetting::new().set_or_clear_floor_setting_metadata(None::<FloorSettingMetadata>);
895    /// ```
896    pub fn set_or_clear_floor_setting_metadata<T>(mut self, v: std::option::Option<T>) -> Self
897    where
898        T: std::convert::Into<crate::model::floor_setting::FloorSettingMetadata>,
899    {
900        self.floor_setting_metadata = v.map(|x| x.into());
901        self
902    }
903}
904
905impl wkt::message::Message for FloorSetting {
906    fn typename() -> &'static str {
907        "type.googleapis.com/google.cloud.modelarmor.v1.FloorSetting"
908    }
909}
910
911/// Defines additional types related to [FloorSetting].
912pub mod floor_setting {
913    #[allow(unused_imports)]
914    use super::*;
915
916    /// message describing FloorSetting Metadata
917    #[derive(Clone, Default, PartialEq)]
918    #[non_exhaustive]
919    pub struct FloorSettingMetadata {
920        /// Optional. Metadata for multi language detection.
921        pub multi_language_detection: std::option::Option<
922            crate::model::floor_setting::floor_setting_metadata::MultiLanguageDetection,
923        >,
924
925        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
926    }
927
928    impl FloorSettingMetadata {
929        pub fn new() -> Self {
930            std::default::Default::default()
931        }
932
933        /// Sets the value of [multi_language_detection][crate::model::floor_setting::FloorSettingMetadata::multi_language_detection].
934        ///
935        /// # Example
936        /// ```ignore,no_run
937        /// # use google_cloud_modelarmor_v1::model::floor_setting::FloorSettingMetadata;
938        /// use google_cloud_modelarmor_v1::model::floor_setting::floor_setting_metadata::MultiLanguageDetection;
939        /// let x = FloorSettingMetadata::new().set_multi_language_detection(MultiLanguageDetection::default()/* use setters */);
940        /// ```
941        pub fn set_multi_language_detection<T>(mut self, v: T) -> Self
942        where
943            T: std::convert::Into<
944                    crate::model::floor_setting::floor_setting_metadata::MultiLanguageDetection,
945                >,
946        {
947            self.multi_language_detection = std::option::Option::Some(v.into());
948            self
949        }
950
951        /// Sets or clears the value of [multi_language_detection][crate::model::floor_setting::FloorSettingMetadata::multi_language_detection].
952        ///
953        /// # Example
954        /// ```ignore,no_run
955        /// # use google_cloud_modelarmor_v1::model::floor_setting::FloorSettingMetadata;
956        /// use google_cloud_modelarmor_v1::model::floor_setting::floor_setting_metadata::MultiLanguageDetection;
957        /// let x = FloorSettingMetadata::new().set_or_clear_multi_language_detection(Some(MultiLanguageDetection::default()/* use setters */));
958        /// let x = FloorSettingMetadata::new().set_or_clear_multi_language_detection(None::<MultiLanguageDetection>);
959        /// ```
960        pub fn set_or_clear_multi_language_detection<T>(mut self, v: std::option::Option<T>) -> Self
961        where
962            T: std::convert::Into<
963                    crate::model::floor_setting::floor_setting_metadata::MultiLanguageDetection,
964                >,
965        {
966            self.multi_language_detection = v.map(|x| x.into());
967            self
968        }
969    }
970
971    impl wkt::message::Message for FloorSettingMetadata {
972        fn typename() -> &'static str {
973            "type.googleapis.com/google.cloud.modelarmor.v1.FloorSetting.FloorSettingMetadata"
974        }
975    }
976
977    /// Defines additional types related to [FloorSettingMetadata].
978    pub mod floor_setting_metadata {
979        #[allow(unused_imports)]
980        use super::*;
981
982        /// Metadata to enable multi language detection via floor setting.
983        #[derive(Clone, Default, PartialEq)]
984        #[non_exhaustive]
985        pub struct MultiLanguageDetection {
986            /// Required. If true, multi language detection will be enabled.
987            pub enable_multi_language_detection: bool,
988
989            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
990        }
991
992        impl MultiLanguageDetection {
993            pub fn new() -> Self {
994                std::default::Default::default()
995            }
996
997            /// Sets the value of [enable_multi_language_detection][crate::model::floor_setting::floor_setting_metadata::MultiLanguageDetection::enable_multi_language_detection].
998            ///
999            /// # Example
1000            /// ```ignore,no_run
1001            /// # use google_cloud_modelarmor_v1::model::floor_setting::floor_setting_metadata::MultiLanguageDetection;
1002            /// let x = MultiLanguageDetection::new().set_enable_multi_language_detection(true);
1003            /// ```
1004            pub fn set_enable_multi_language_detection<T: std::convert::Into<bool>>(
1005                mut self,
1006                v: T,
1007            ) -> Self {
1008                self.enable_multi_language_detection = v.into();
1009                self
1010            }
1011        }
1012
1013        impl wkt::message::Message for MultiLanguageDetection {
1014            fn typename() -> &'static str {
1015                "type.googleapis.com/google.cloud.modelarmor.v1.FloorSetting.FloorSettingMetadata.MultiLanguageDetection"
1016            }
1017        }
1018    }
1019
1020    /// Integrated service for which the floor setting is applicable.
1021    ///
1022    /// # Working with unknown values
1023    ///
1024    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1025    /// additional enum variants at any time. Adding new variants is not considered
1026    /// a breaking change. Applications should write their code in anticipation of:
1027    ///
1028    /// - New values appearing in future releases of the client library, **and**
1029    /// - New values received dynamically, without application changes.
1030    ///
1031    /// Please consult the [Working with enums] section in the user guide for some
1032    /// guidelines.
1033    ///
1034    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1035    #[derive(Clone, Debug, PartialEq)]
1036    #[non_exhaustive]
1037    pub enum IntegratedService {
1038        /// Unspecified integrated service.
1039        Unspecified,
1040        /// AI Platform.
1041        AiPlatform,
1042        /// If set, the enum was initialized with an unknown value.
1043        ///
1044        /// Applications can examine the value using [IntegratedService::value] or
1045        /// [IntegratedService::name].
1046        UnknownValue(integrated_service::UnknownValue),
1047    }
1048
1049    #[doc(hidden)]
1050    pub mod integrated_service {
1051        #[allow(unused_imports)]
1052        use super::*;
1053        #[derive(Clone, Debug, PartialEq)]
1054        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1055    }
1056
1057    impl IntegratedService {
1058        /// Gets the enum value.
1059        ///
1060        /// Returns `None` if the enum contains an unknown value deserialized from
1061        /// the string representation of enums.
1062        pub fn value(&self) -> std::option::Option<i32> {
1063            match self {
1064                Self::Unspecified => std::option::Option::Some(0),
1065                Self::AiPlatform => std::option::Option::Some(1),
1066                Self::UnknownValue(u) => u.0.value(),
1067            }
1068        }
1069
1070        /// Gets the enum value as a string.
1071        ///
1072        /// Returns `None` if the enum contains an unknown value deserialized from
1073        /// the integer representation of enums.
1074        pub fn name(&self) -> std::option::Option<&str> {
1075            match self {
1076                Self::Unspecified => std::option::Option::Some("INTEGRATED_SERVICE_UNSPECIFIED"),
1077                Self::AiPlatform => std::option::Option::Some("AI_PLATFORM"),
1078                Self::UnknownValue(u) => u.0.name(),
1079            }
1080        }
1081    }
1082
1083    impl std::default::Default for IntegratedService {
1084        fn default() -> Self {
1085            use std::convert::From;
1086            Self::from(0)
1087        }
1088    }
1089
1090    impl std::fmt::Display for IntegratedService {
1091        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1092            wkt::internal::display_enum(f, self.name(), self.value())
1093        }
1094    }
1095
1096    impl std::convert::From<i32> for IntegratedService {
1097        fn from(value: i32) -> Self {
1098            match value {
1099                0 => Self::Unspecified,
1100                1 => Self::AiPlatform,
1101                _ => Self::UnknownValue(integrated_service::UnknownValue(
1102                    wkt::internal::UnknownEnumValue::Integer(value),
1103                )),
1104            }
1105        }
1106    }
1107
1108    impl std::convert::From<&str> for IntegratedService {
1109        fn from(value: &str) -> Self {
1110            use std::string::ToString;
1111            match value {
1112                "INTEGRATED_SERVICE_UNSPECIFIED" => Self::Unspecified,
1113                "AI_PLATFORM" => Self::AiPlatform,
1114                _ => Self::UnknownValue(integrated_service::UnknownValue(
1115                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1116                )),
1117            }
1118        }
1119    }
1120
1121    impl serde::ser::Serialize for IntegratedService {
1122        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1123        where
1124            S: serde::Serializer,
1125        {
1126            match self {
1127                Self::Unspecified => serializer.serialize_i32(0),
1128                Self::AiPlatform => serializer.serialize_i32(1),
1129                Self::UnknownValue(u) => u.0.serialize(serializer),
1130            }
1131        }
1132    }
1133
1134    impl<'de> serde::de::Deserialize<'de> for IntegratedService {
1135        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1136        where
1137            D: serde::Deserializer<'de>,
1138        {
1139            deserializer.deserialize_any(wkt::internal::EnumVisitor::<IntegratedService>::new(
1140                ".google.cloud.modelarmor.v1.FloorSetting.IntegratedService",
1141            ))
1142        }
1143    }
1144}
1145
1146/// message describing AiPlatformFloorSetting
1147#[derive(Clone, Default, PartialEq)]
1148#[non_exhaustive]
1149pub struct AiPlatformFloorSetting {
1150    /// Optional. If true, log Model Armor filter results to Cloud Logging.
1151    pub enable_cloud_logging: bool,
1152
1153    /// enforcement type for Model Armor filters.
1154    pub enforcement_type:
1155        std::option::Option<crate::model::ai_platform_floor_setting::EnforcementType>,
1156
1157    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1158}
1159
1160impl AiPlatformFloorSetting {
1161    pub fn new() -> Self {
1162        std::default::Default::default()
1163    }
1164
1165    /// Sets the value of [enable_cloud_logging][crate::model::AiPlatformFloorSetting::enable_cloud_logging].
1166    ///
1167    /// # Example
1168    /// ```ignore,no_run
1169    /// # use google_cloud_modelarmor_v1::model::AiPlatformFloorSetting;
1170    /// let x = AiPlatformFloorSetting::new().set_enable_cloud_logging(true);
1171    /// ```
1172    pub fn set_enable_cloud_logging<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1173        self.enable_cloud_logging = v.into();
1174        self
1175    }
1176
1177    /// Sets the value of [enforcement_type][crate::model::AiPlatformFloorSetting::enforcement_type].
1178    ///
1179    /// Note that all the setters affecting `enforcement_type` are mutually
1180    /// exclusive.
1181    ///
1182    /// # Example
1183    /// ```ignore,no_run
1184    /// # use google_cloud_modelarmor_v1::model::AiPlatformFloorSetting;
1185    /// use google_cloud_modelarmor_v1::model::ai_platform_floor_setting::EnforcementType;
1186    /// let x = AiPlatformFloorSetting::new().set_enforcement_type(Some(EnforcementType::InspectOnly(true)));
1187    /// ```
1188    pub fn set_enforcement_type<
1189        T: std::convert::Into<
1190                std::option::Option<crate::model::ai_platform_floor_setting::EnforcementType>,
1191            >,
1192    >(
1193        mut self,
1194        v: T,
1195    ) -> Self {
1196        self.enforcement_type = v.into();
1197        self
1198    }
1199
1200    /// The value of [enforcement_type][crate::model::AiPlatformFloorSetting::enforcement_type]
1201    /// if it holds a `InspectOnly`, `None` if the field is not set or
1202    /// holds a different branch.
1203    pub fn inspect_only(&self) -> std::option::Option<&bool> {
1204        #[allow(unreachable_patterns)]
1205        self.enforcement_type.as_ref().and_then(|v| match v {
1206            crate::model::ai_platform_floor_setting::EnforcementType::InspectOnly(v) => {
1207                std::option::Option::Some(v)
1208            }
1209            _ => std::option::Option::None,
1210        })
1211    }
1212
1213    /// Sets the value of [enforcement_type][crate::model::AiPlatformFloorSetting::enforcement_type]
1214    /// to hold a `InspectOnly`.
1215    ///
1216    /// Note that all the setters affecting `enforcement_type` are
1217    /// mutually exclusive.
1218    ///
1219    /// # Example
1220    /// ```ignore,no_run
1221    /// # use google_cloud_modelarmor_v1::model::AiPlatformFloorSetting;
1222    /// let x = AiPlatformFloorSetting::new().set_inspect_only(true);
1223    /// assert!(x.inspect_only().is_some());
1224    /// assert!(x.inspect_and_block().is_none());
1225    /// ```
1226    pub fn set_inspect_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1227        self.enforcement_type = std::option::Option::Some(
1228            crate::model::ai_platform_floor_setting::EnforcementType::InspectOnly(v.into()),
1229        );
1230        self
1231    }
1232
1233    /// The value of [enforcement_type][crate::model::AiPlatformFloorSetting::enforcement_type]
1234    /// if it holds a `InspectAndBlock`, `None` if the field is not set or
1235    /// holds a different branch.
1236    pub fn inspect_and_block(&self) -> std::option::Option<&bool> {
1237        #[allow(unreachable_patterns)]
1238        self.enforcement_type.as_ref().and_then(|v| match v {
1239            crate::model::ai_platform_floor_setting::EnforcementType::InspectAndBlock(v) => {
1240                std::option::Option::Some(v)
1241            }
1242            _ => std::option::Option::None,
1243        })
1244    }
1245
1246    /// Sets the value of [enforcement_type][crate::model::AiPlatformFloorSetting::enforcement_type]
1247    /// to hold a `InspectAndBlock`.
1248    ///
1249    /// Note that all the setters affecting `enforcement_type` are
1250    /// mutually exclusive.
1251    ///
1252    /// # Example
1253    /// ```ignore,no_run
1254    /// # use google_cloud_modelarmor_v1::model::AiPlatformFloorSetting;
1255    /// let x = AiPlatformFloorSetting::new().set_inspect_and_block(true);
1256    /// assert!(x.inspect_and_block().is_some());
1257    /// assert!(x.inspect_only().is_none());
1258    /// ```
1259    pub fn set_inspect_and_block<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1260        self.enforcement_type = std::option::Option::Some(
1261            crate::model::ai_platform_floor_setting::EnforcementType::InspectAndBlock(v.into()),
1262        );
1263        self
1264    }
1265}
1266
1267impl wkt::message::Message for AiPlatformFloorSetting {
1268    fn typename() -> &'static str {
1269        "type.googleapis.com/google.cloud.modelarmor.v1.AiPlatformFloorSetting"
1270    }
1271}
1272
1273/// Defines additional types related to [AiPlatformFloorSetting].
1274pub mod ai_platform_floor_setting {
1275    #[allow(unused_imports)]
1276    use super::*;
1277
1278    /// enforcement type for Model Armor filters.
1279    #[derive(Clone, Debug, PartialEq)]
1280    #[non_exhaustive]
1281    pub enum EnforcementType {
1282        /// Optional. If true, Model Armor filters will be run in inspect only mode.
1283        /// No action will be taken on the request.
1284        InspectOnly(bool),
1285        /// Optional. If true, Model Armor filters will be run in inspect and block
1286        /// mode. Requests that trip Model Armor filters will be blocked.
1287        InspectAndBlock(bool),
1288    }
1289}
1290
1291/// Message for requesting list of Templates
1292#[derive(Clone, Default, PartialEq)]
1293#[non_exhaustive]
1294pub struct ListTemplatesRequest {
1295    /// Required. Parent value for ListTemplatesRequest
1296    pub parent: std::string::String,
1297
1298    /// Optional. Requested page size. Server may return fewer items than
1299    /// requested. If unspecified, server will pick an appropriate default.
1300    pub page_size: i32,
1301
1302    /// Optional. A token identifying a page of results the server should return.
1303    pub page_token: std::string::String,
1304
1305    /// Optional. Filtering results
1306    pub filter: std::string::String,
1307
1308    /// Optional. Hint for how to order the results
1309    pub order_by: std::string::String,
1310
1311    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1312}
1313
1314impl ListTemplatesRequest {
1315    pub fn new() -> Self {
1316        std::default::Default::default()
1317    }
1318
1319    /// Sets the value of [parent][crate::model::ListTemplatesRequest::parent].
1320    ///
1321    /// # Example
1322    /// ```ignore,no_run
1323    /// # use google_cloud_modelarmor_v1::model::ListTemplatesRequest;
1324    /// let x = ListTemplatesRequest::new().set_parent("example");
1325    /// ```
1326    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1327        self.parent = v.into();
1328        self
1329    }
1330
1331    /// Sets the value of [page_size][crate::model::ListTemplatesRequest::page_size].
1332    ///
1333    /// # Example
1334    /// ```ignore,no_run
1335    /// # use google_cloud_modelarmor_v1::model::ListTemplatesRequest;
1336    /// let x = ListTemplatesRequest::new().set_page_size(42);
1337    /// ```
1338    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1339        self.page_size = v.into();
1340        self
1341    }
1342
1343    /// Sets the value of [page_token][crate::model::ListTemplatesRequest::page_token].
1344    ///
1345    /// # Example
1346    /// ```ignore,no_run
1347    /// # use google_cloud_modelarmor_v1::model::ListTemplatesRequest;
1348    /// let x = ListTemplatesRequest::new().set_page_token("example");
1349    /// ```
1350    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1351        self.page_token = v.into();
1352        self
1353    }
1354
1355    /// Sets the value of [filter][crate::model::ListTemplatesRequest::filter].
1356    ///
1357    /// # Example
1358    /// ```ignore,no_run
1359    /// # use google_cloud_modelarmor_v1::model::ListTemplatesRequest;
1360    /// let x = ListTemplatesRequest::new().set_filter("example");
1361    /// ```
1362    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1363        self.filter = v.into();
1364        self
1365    }
1366
1367    /// Sets the value of [order_by][crate::model::ListTemplatesRequest::order_by].
1368    ///
1369    /// # Example
1370    /// ```ignore,no_run
1371    /// # use google_cloud_modelarmor_v1::model::ListTemplatesRequest;
1372    /// let x = ListTemplatesRequest::new().set_order_by("example");
1373    /// ```
1374    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1375        self.order_by = v.into();
1376        self
1377    }
1378}
1379
1380impl wkt::message::Message for ListTemplatesRequest {
1381    fn typename() -> &'static str {
1382        "type.googleapis.com/google.cloud.modelarmor.v1.ListTemplatesRequest"
1383    }
1384}
1385
1386/// Message for response to listing Templates
1387#[derive(Clone, Default, PartialEq)]
1388#[non_exhaustive]
1389pub struct ListTemplatesResponse {
1390    /// The list of Template
1391    pub templates: std::vec::Vec<crate::model::Template>,
1392
1393    /// A token identifying a page of results the server should return.
1394    pub next_page_token: std::string::String,
1395
1396    /// Locations that could not be reached.
1397    pub unreachable: std::vec::Vec<std::string::String>,
1398
1399    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1400}
1401
1402impl ListTemplatesResponse {
1403    pub fn new() -> Self {
1404        std::default::Default::default()
1405    }
1406
1407    /// Sets the value of [templates][crate::model::ListTemplatesResponse::templates].
1408    ///
1409    /// # Example
1410    /// ```ignore,no_run
1411    /// # use google_cloud_modelarmor_v1::model::ListTemplatesResponse;
1412    /// use google_cloud_modelarmor_v1::model::Template;
1413    /// let x = ListTemplatesResponse::new()
1414    ///     .set_templates([
1415    ///         Template::default()/* use setters */,
1416    ///         Template::default()/* use (different) setters */,
1417    ///     ]);
1418    /// ```
1419    pub fn set_templates<T, V>(mut self, v: T) -> Self
1420    where
1421        T: std::iter::IntoIterator<Item = V>,
1422        V: std::convert::Into<crate::model::Template>,
1423    {
1424        use std::iter::Iterator;
1425        self.templates = v.into_iter().map(|i| i.into()).collect();
1426        self
1427    }
1428
1429    /// Sets the value of [next_page_token][crate::model::ListTemplatesResponse::next_page_token].
1430    ///
1431    /// # Example
1432    /// ```ignore,no_run
1433    /// # use google_cloud_modelarmor_v1::model::ListTemplatesResponse;
1434    /// let x = ListTemplatesResponse::new().set_next_page_token("example");
1435    /// ```
1436    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1437        self.next_page_token = v.into();
1438        self
1439    }
1440
1441    /// Sets the value of [unreachable][crate::model::ListTemplatesResponse::unreachable].
1442    ///
1443    /// # Example
1444    /// ```ignore,no_run
1445    /// # use google_cloud_modelarmor_v1::model::ListTemplatesResponse;
1446    /// let x = ListTemplatesResponse::new().set_unreachable(["a", "b", "c"]);
1447    /// ```
1448    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1449    where
1450        T: std::iter::IntoIterator<Item = V>,
1451        V: std::convert::Into<std::string::String>,
1452    {
1453        use std::iter::Iterator;
1454        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1455        self
1456    }
1457}
1458
1459impl wkt::message::Message for ListTemplatesResponse {
1460    fn typename() -> &'static str {
1461        "type.googleapis.com/google.cloud.modelarmor.v1.ListTemplatesResponse"
1462    }
1463}
1464
1465#[doc(hidden)]
1466impl google_cloud_gax::paginator::internal::PageableResponse for ListTemplatesResponse {
1467    type PageItem = crate::model::Template;
1468
1469    fn items(self) -> std::vec::Vec<Self::PageItem> {
1470        self.templates
1471    }
1472
1473    fn next_page_token(&self) -> std::string::String {
1474        use std::clone::Clone;
1475        self.next_page_token.clone()
1476    }
1477}
1478
1479/// Message for getting a Template
1480#[derive(Clone, Default, PartialEq)]
1481#[non_exhaustive]
1482pub struct GetTemplateRequest {
1483    /// Required. Name of the resource
1484    pub name: std::string::String,
1485
1486    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1487}
1488
1489impl GetTemplateRequest {
1490    pub fn new() -> Self {
1491        std::default::Default::default()
1492    }
1493
1494    /// Sets the value of [name][crate::model::GetTemplateRequest::name].
1495    ///
1496    /// # Example
1497    /// ```ignore,no_run
1498    /// # use google_cloud_modelarmor_v1::model::GetTemplateRequest;
1499    /// let x = GetTemplateRequest::new().set_name("example");
1500    /// ```
1501    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1502        self.name = v.into();
1503        self
1504    }
1505}
1506
1507impl wkt::message::Message for GetTemplateRequest {
1508    fn typename() -> &'static str {
1509        "type.googleapis.com/google.cloud.modelarmor.v1.GetTemplateRequest"
1510    }
1511}
1512
1513/// Message for creating a Template
1514#[derive(Clone, Default, PartialEq)]
1515#[non_exhaustive]
1516pub struct CreateTemplateRequest {
1517    /// Required. Value for parent.
1518    pub parent: std::string::String,
1519
1520    /// Required. Id of the requesting object
1521    /// If auto-generating Id server-side, remove this field and
1522    /// template_id from the method_signature of Create RPC
1523    pub template_id: std::string::String,
1524
1525    /// Required. The resource being created
1526    pub template: std::option::Option<crate::model::Template>,
1527
1528    /// Optional. An optional request ID to identify requests. Specify a unique
1529    /// request ID so that if you must retry your request, the server will know to
1530    /// ignore the request if it has already been completed. The server stores the
1531    /// request ID for 60 minutes after the first request.
1532    ///
1533    /// For example, consider a situation where you make an initial request and the
1534    /// request times out. If you make the request again with the same request
1535    /// ID, the server can check if original operation with the same request ID
1536    /// was received, and if so, will ignore the second request. This prevents
1537    /// clients from accidentally creating duplicate commitments.
1538    ///
1539    /// The request ID must be a valid UUID with the exception that zero UUID is
1540    /// not supported (00000000-0000-0000-0000-000000000000).
1541    pub request_id: std::string::String,
1542
1543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1544}
1545
1546impl CreateTemplateRequest {
1547    pub fn new() -> Self {
1548        std::default::Default::default()
1549    }
1550
1551    /// Sets the value of [parent][crate::model::CreateTemplateRequest::parent].
1552    ///
1553    /// # Example
1554    /// ```ignore,no_run
1555    /// # use google_cloud_modelarmor_v1::model::CreateTemplateRequest;
1556    /// let x = CreateTemplateRequest::new().set_parent("example");
1557    /// ```
1558    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1559        self.parent = v.into();
1560        self
1561    }
1562
1563    /// Sets the value of [template_id][crate::model::CreateTemplateRequest::template_id].
1564    ///
1565    /// # Example
1566    /// ```ignore,no_run
1567    /// # use google_cloud_modelarmor_v1::model::CreateTemplateRequest;
1568    /// let x = CreateTemplateRequest::new().set_template_id("example");
1569    /// ```
1570    pub fn set_template_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1571        self.template_id = v.into();
1572        self
1573    }
1574
1575    /// Sets the value of [template][crate::model::CreateTemplateRequest::template].
1576    ///
1577    /// # Example
1578    /// ```ignore,no_run
1579    /// # use google_cloud_modelarmor_v1::model::CreateTemplateRequest;
1580    /// use google_cloud_modelarmor_v1::model::Template;
1581    /// let x = CreateTemplateRequest::new().set_template(Template::default()/* use setters */);
1582    /// ```
1583    pub fn set_template<T>(mut self, v: T) -> Self
1584    where
1585        T: std::convert::Into<crate::model::Template>,
1586    {
1587        self.template = std::option::Option::Some(v.into());
1588        self
1589    }
1590
1591    /// Sets or clears the value of [template][crate::model::CreateTemplateRequest::template].
1592    ///
1593    /// # Example
1594    /// ```ignore,no_run
1595    /// # use google_cloud_modelarmor_v1::model::CreateTemplateRequest;
1596    /// use google_cloud_modelarmor_v1::model::Template;
1597    /// let x = CreateTemplateRequest::new().set_or_clear_template(Some(Template::default()/* use setters */));
1598    /// let x = CreateTemplateRequest::new().set_or_clear_template(None::<Template>);
1599    /// ```
1600    pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
1601    where
1602        T: std::convert::Into<crate::model::Template>,
1603    {
1604        self.template = v.map(|x| x.into());
1605        self
1606    }
1607
1608    /// Sets the value of [request_id][crate::model::CreateTemplateRequest::request_id].
1609    ///
1610    /// # Example
1611    /// ```ignore,no_run
1612    /// # use google_cloud_modelarmor_v1::model::CreateTemplateRequest;
1613    /// let x = CreateTemplateRequest::new().set_request_id("example");
1614    /// ```
1615    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1616        self.request_id = v.into();
1617        self
1618    }
1619}
1620
1621impl wkt::message::Message for CreateTemplateRequest {
1622    fn typename() -> &'static str {
1623        "type.googleapis.com/google.cloud.modelarmor.v1.CreateTemplateRequest"
1624    }
1625}
1626
1627/// Message for updating a Template
1628#[derive(Clone, Default, PartialEq)]
1629#[non_exhaustive]
1630pub struct UpdateTemplateRequest {
1631    /// Required. Field mask is used to specify the fields to be overwritten in the
1632    /// Template resource by the update.
1633    /// The fields specified in the update_mask are relative to the resource, not
1634    /// the full request. A field will be overwritten if it is in the mask. If the
1635    /// user does not provide a mask then all fields will be overwritten.
1636    pub update_mask: std::option::Option<wkt::FieldMask>,
1637
1638    /// Required. The resource being updated
1639    pub template: std::option::Option<crate::model::Template>,
1640
1641    /// Optional. An optional request ID to identify requests. Specify a unique
1642    /// request ID so that if you must retry your request, the server will know to
1643    /// ignore the request if it has already been completed. The server stores the
1644    /// request ID for 60 minutes after the first request.
1645    ///
1646    /// For example, consider a situation where you make an initial request and the
1647    /// request times out. If you make the request again with the same request
1648    /// ID, the server can check if original operation with the same request ID
1649    /// was received, and if so, will ignore the second request. This prevents
1650    /// clients from accidentally creating duplicate commitments.
1651    ///
1652    /// The request ID must be a valid UUID with the exception that zero UUID is
1653    /// not supported (00000000-0000-0000-0000-000000000000).
1654    pub request_id: std::string::String,
1655
1656    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1657}
1658
1659impl UpdateTemplateRequest {
1660    pub fn new() -> Self {
1661        std::default::Default::default()
1662    }
1663
1664    /// Sets the value of [update_mask][crate::model::UpdateTemplateRequest::update_mask].
1665    ///
1666    /// # Example
1667    /// ```ignore,no_run
1668    /// # use google_cloud_modelarmor_v1::model::UpdateTemplateRequest;
1669    /// use wkt::FieldMask;
1670    /// let x = UpdateTemplateRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1671    /// ```
1672    pub fn set_update_mask<T>(mut self, v: T) -> Self
1673    where
1674        T: std::convert::Into<wkt::FieldMask>,
1675    {
1676        self.update_mask = std::option::Option::Some(v.into());
1677        self
1678    }
1679
1680    /// Sets or clears the value of [update_mask][crate::model::UpdateTemplateRequest::update_mask].
1681    ///
1682    /// # Example
1683    /// ```ignore,no_run
1684    /// # use google_cloud_modelarmor_v1::model::UpdateTemplateRequest;
1685    /// use wkt::FieldMask;
1686    /// let x = UpdateTemplateRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1687    /// let x = UpdateTemplateRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1688    /// ```
1689    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1690    where
1691        T: std::convert::Into<wkt::FieldMask>,
1692    {
1693        self.update_mask = v.map(|x| x.into());
1694        self
1695    }
1696
1697    /// Sets the value of [template][crate::model::UpdateTemplateRequest::template].
1698    ///
1699    /// # Example
1700    /// ```ignore,no_run
1701    /// # use google_cloud_modelarmor_v1::model::UpdateTemplateRequest;
1702    /// use google_cloud_modelarmor_v1::model::Template;
1703    /// let x = UpdateTemplateRequest::new().set_template(Template::default()/* use setters */);
1704    /// ```
1705    pub fn set_template<T>(mut self, v: T) -> Self
1706    where
1707        T: std::convert::Into<crate::model::Template>,
1708    {
1709        self.template = std::option::Option::Some(v.into());
1710        self
1711    }
1712
1713    /// Sets or clears the value of [template][crate::model::UpdateTemplateRequest::template].
1714    ///
1715    /// # Example
1716    /// ```ignore,no_run
1717    /// # use google_cloud_modelarmor_v1::model::UpdateTemplateRequest;
1718    /// use google_cloud_modelarmor_v1::model::Template;
1719    /// let x = UpdateTemplateRequest::new().set_or_clear_template(Some(Template::default()/* use setters */));
1720    /// let x = UpdateTemplateRequest::new().set_or_clear_template(None::<Template>);
1721    /// ```
1722    pub fn set_or_clear_template<T>(mut self, v: std::option::Option<T>) -> Self
1723    where
1724        T: std::convert::Into<crate::model::Template>,
1725    {
1726        self.template = v.map(|x| x.into());
1727        self
1728    }
1729
1730    /// Sets the value of [request_id][crate::model::UpdateTemplateRequest::request_id].
1731    ///
1732    /// # Example
1733    /// ```ignore,no_run
1734    /// # use google_cloud_modelarmor_v1::model::UpdateTemplateRequest;
1735    /// let x = UpdateTemplateRequest::new().set_request_id("example");
1736    /// ```
1737    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1738        self.request_id = v.into();
1739        self
1740    }
1741}
1742
1743impl wkt::message::Message for UpdateTemplateRequest {
1744    fn typename() -> &'static str {
1745        "type.googleapis.com/google.cloud.modelarmor.v1.UpdateTemplateRequest"
1746    }
1747}
1748
1749/// Message for deleting a Template
1750#[derive(Clone, Default, PartialEq)]
1751#[non_exhaustive]
1752pub struct DeleteTemplateRequest {
1753    /// Required. Name of the resource
1754    pub name: std::string::String,
1755
1756    /// Optional. An optional request ID to identify requests. Specify a unique
1757    /// request ID so that if you must retry your request, the server will know to
1758    /// ignore the request if it has already been completed. The server stores the
1759    /// request ID for 60 minutes after the first request.
1760    ///
1761    /// For example, consider a situation where you make an initial request and the
1762    /// request times out. If you make the request again with the same request
1763    /// ID, the server can check if original operation with the same request ID
1764    /// was received, and if so, will ignore the second request. This prevents
1765    /// clients from accidentally creating duplicate commitments.
1766    ///
1767    /// The request ID must be a valid UUID with the exception that zero UUID is
1768    /// not supported (00000000-0000-0000-0000-000000000000).
1769    pub request_id: std::string::String,
1770
1771    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1772}
1773
1774impl DeleteTemplateRequest {
1775    pub fn new() -> Self {
1776        std::default::Default::default()
1777    }
1778
1779    /// Sets the value of [name][crate::model::DeleteTemplateRequest::name].
1780    ///
1781    /// # Example
1782    /// ```ignore,no_run
1783    /// # use google_cloud_modelarmor_v1::model::DeleteTemplateRequest;
1784    /// let x = DeleteTemplateRequest::new().set_name("example");
1785    /// ```
1786    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1787        self.name = v.into();
1788        self
1789    }
1790
1791    /// Sets the value of [request_id][crate::model::DeleteTemplateRequest::request_id].
1792    ///
1793    /// # Example
1794    /// ```ignore,no_run
1795    /// # use google_cloud_modelarmor_v1::model::DeleteTemplateRequest;
1796    /// let x = DeleteTemplateRequest::new().set_request_id("example");
1797    /// ```
1798    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1799        self.request_id = v.into();
1800        self
1801    }
1802}
1803
1804impl wkt::message::Message for DeleteTemplateRequest {
1805    fn typename() -> &'static str {
1806        "type.googleapis.com/google.cloud.modelarmor.v1.DeleteTemplateRequest"
1807    }
1808}
1809
1810/// Message for getting a Floor Setting
1811#[derive(Clone, Default, PartialEq)]
1812#[non_exhaustive]
1813pub struct GetFloorSettingRequest {
1814    /// Required. The name of the floor setting to get, example
1815    /// projects/123/floorsetting.
1816    pub name: std::string::String,
1817
1818    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1819}
1820
1821impl GetFloorSettingRequest {
1822    pub fn new() -> Self {
1823        std::default::Default::default()
1824    }
1825
1826    /// Sets the value of [name][crate::model::GetFloorSettingRequest::name].
1827    ///
1828    /// # Example
1829    /// ```ignore,no_run
1830    /// # use google_cloud_modelarmor_v1::model::GetFloorSettingRequest;
1831    /// let x = GetFloorSettingRequest::new().set_name("example");
1832    /// ```
1833    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1834        self.name = v.into();
1835        self
1836    }
1837}
1838
1839impl wkt::message::Message for GetFloorSettingRequest {
1840    fn typename() -> &'static str {
1841        "type.googleapis.com/google.cloud.modelarmor.v1.GetFloorSettingRequest"
1842    }
1843}
1844
1845/// Message for Updating a Floor Setting
1846#[derive(Clone, Default, PartialEq)]
1847#[non_exhaustive]
1848pub struct UpdateFloorSettingRequest {
1849    /// Required. The floor setting being updated.
1850    pub floor_setting: std::option::Option<crate::model::FloorSetting>,
1851
1852    /// Optional. Field mask is used to specify the fields to be overwritten in the
1853    /// FloorSetting resource by the update.
1854    /// The fields specified in the update_mask are relative to the resource, not
1855    /// the full request. A field will be overwritten if it is in the mask. If the
1856    /// user does not provide a mask then all fields will be overwritten.
1857    pub update_mask: std::option::Option<wkt::FieldMask>,
1858
1859    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1860}
1861
1862impl UpdateFloorSettingRequest {
1863    pub fn new() -> Self {
1864        std::default::Default::default()
1865    }
1866
1867    /// Sets the value of [floor_setting][crate::model::UpdateFloorSettingRequest::floor_setting].
1868    ///
1869    /// # Example
1870    /// ```ignore,no_run
1871    /// # use google_cloud_modelarmor_v1::model::UpdateFloorSettingRequest;
1872    /// use google_cloud_modelarmor_v1::model::FloorSetting;
1873    /// let x = UpdateFloorSettingRequest::new().set_floor_setting(FloorSetting::default()/* use setters */);
1874    /// ```
1875    pub fn set_floor_setting<T>(mut self, v: T) -> Self
1876    where
1877        T: std::convert::Into<crate::model::FloorSetting>,
1878    {
1879        self.floor_setting = std::option::Option::Some(v.into());
1880        self
1881    }
1882
1883    /// Sets or clears the value of [floor_setting][crate::model::UpdateFloorSettingRequest::floor_setting].
1884    ///
1885    /// # Example
1886    /// ```ignore,no_run
1887    /// # use google_cloud_modelarmor_v1::model::UpdateFloorSettingRequest;
1888    /// use google_cloud_modelarmor_v1::model::FloorSetting;
1889    /// let x = UpdateFloorSettingRequest::new().set_or_clear_floor_setting(Some(FloorSetting::default()/* use setters */));
1890    /// let x = UpdateFloorSettingRequest::new().set_or_clear_floor_setting(None::<FloorSetting>);
1891    /// ```
1892    pub fn set_or_clear_floor_setting<T>(mut self, v: std::option::Option<T>) -> Self
1893    where
1894        T: std::convert::Into<crate::model::FloorSetting>,
1895    {
1896        self.floor_setting = v.map(|x| x.into());
1897        self
1898    }
1899
1900    /// Sets the value of [update_mask][crate::model::UpdateFloorSettingRequest::update_mask].
1901    ///
1902    /// # Example
1903    /// ```ignore,no_run
1904    /// # use google_cloud_modelarmor_v1::model::UpdateFloorSettingRequest;
1905    /// use wkt::FieldMask;
1906    /// let x = UpdateFloorSettingRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1907    /// ```
1908    pub fn set_update_mask<T>(mut self, v: T) -> Self
1909    where
1910        T: std::convert::Into<wkt::FieldMask>,
1911    {
1912        self.update_mask = std::option::Option::Some(v.into());
1913        self
1914    }
1915
1916    /// Sets or clears the value of [update_mask][crate::model::UpdateFloorSettingRequest::update_mask].
1917    ///
1918    /// # Example
1919    /// ```ignore,no_run
1920    /// # use google_cloud_modelarmor_v1::model::UpdateFloorSettingRequest;
1921    /// use wkt::FieldMask;
1922    /// let x = UpdateFloorSettingRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1923    /// let x = UpdateFloorSettingRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1924    /// ```
1925    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1926    where
1927        T: std::convert::Into<wkt::FieldMask>,
1928    {
1929        self.update_mask = v.map(|x| x.into());
1930        self
1931    }
1932}
1933
1934impl wkt::message::Message for UpdateFloorSettingRequest {
1935    fn typename() -> &'static str {
1936        "type.googleapis.com/google.cloud.modelarmor.v1.UpdateFloorSettingRequest"
1937    }
1938}
1939
1940/// Filters configuration.
1941#[derive(Clone, Default, PartialEq)]
1942#[non_exhaustive]
1943pub struct FilterConfig {
1944    /// Optional. Responsible AI settings.
1945    pub rai_settings: std::option::Option<crate::model::RaiFilterSettings>,
1946
1947    /// Optional. Sensitive Data Protection settings.
1948    pub sdp_settings: std::option::Option<crate::model::SdpFilterSettings>,
1949
1950    /// Optional. Prompt injection and Jailbreak filter settings.
1951    pub pi_and_jailbreak_filter_settings:
1952        std::option::Option<crate::model::PiAndJailbreakFilterSettings>,
1953
1954    /// Optional. Malicious URI filter settings.
1955    pub malicious_uri_filter_settings:
1956        std::option::Option<crate::model::MaliciousUriFilterSettings>,
1957
1958    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1959}
1960
1961impl FilterConfig {
1962    pub fn new() -> Self {
1963        std::default::Default::default()
1964    }
1965
1966    /// Sets the value of [rai_settings][crate::model::FilterConfig::rai_settings].
1967    ///
1968    /// # Example
1969    /// ```ignore,no_run
1970    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
1971    /// use google_cloud_modelarmor_v1::model::RaiFilterSettings;
1972    /// let x = FilterConfig::new().set_rai_settings(RaiFilterSettings::default()/* use setters */);
1973    /// ```
1974    pub fn set_rai_settings<T>(mut self, v: T) -> Self
1975    where
1976        T: std::convert::Into<crate::model::RaiFilterSettings>,
1977    {
1978        self.rai_settings = std::option::Option::Some(v.into());
1979        self
1980    }
1981
1982    /// Sets or clears the value of [rai_settings][crate::model::FilterConfig::rai_settings].
1983    ///
1984    /// # Example
1985    /// ```ignore,no_run
1986    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
1987    /// use google_cloud_modelarmor_v1::model::RaiFilterSettings;
1988    /// let x = FilterConfig::new().set_or_clear_rai_settings(Some(RaiFilterSettings::default()/* use setters */));
1989    /// let x = FilterConfig::new().set_or_clear_rai_settings(None::<RaiFilterSettings>);
1990    /// ```
1991    pub fn set_or_clear_rai_settings<T>(mut self, v: std::option::Option<T>) -> Self
1992    where
1993        T: std::convert::Into<crate::model::RaiFilterSettings>,
1994    {
1995        self.rai_settings = v.map(|x| x.into());
1996        self
1997    }
1998
1999    /// Sets the value of [sdp_settings][crate::model::FilterConfig::sdp_settings].
2000    ///
2001    /// # Example
2002    /// ```ignore,no_run
2003    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
2004    /// use google_cloud_modelarmor_v1::model::SdpFilterSettings;
2005    /// let x = FilterConfig::new().set_sdp_settings(SdpFilterSettings::default()/* use setters */);
2006    /// ```
2007    pub fn set_sdp_settings<T>(mut self, v: T) -> Self
2008    where
2009        T: std::convert::Into<crate::model::SdpFilterSettings>,
2010    {
2011        self.sdp_settings = std::option::Option::Some(v.into());
2012        self
2013    }
2014
2015    /// Sets or clears the value of [sdp_settings][crate::model::FilterConfig::sdp_settings].
2016    ///
2017    /// # Example
2018    /// ```ignore,no_run
2019    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
2020    /// use google_cloud_modelarmor_v1::model::SdpFilterSettings;
2021    /// let x = FilterConfig::new().set_or_clear_sdp_settings(Some(SdpFilterSettings::default()/* use setters */));
2022    /// let x = FilterConfig::new().set_or_clear_sdp_settings(None::<SdpFilterSettings>);
2023    /// ```
2024    pub fn set_or_clear_sdp_settings<T>(mut self, v: std::option::Option<T>) -> Self
2025    where
2026        T: std::convert::Into<crate::model::SdpFilterSettings>,
2027    {
2028        self.sdp_settings = v.map(|x| x.into());
2029        self
2030    }
2031
2032    /// Sets the value of [pi_and_jailbreak_filter_settings][crate::model::FilterConfig::pi_and_jailbreak_filter_settings].
2033    ///
2034    /// # Example
2035    /// ```ignore,no_run
2036    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
2037    /// use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterSettings;
2038    /// let x = FilterConfig::new().set_pi_and_jailbreak_filter_settings(PiAndJailbreakFilterSettings::default()/* use setters */);
2039    /// ```
2040    pub fn set_pi_and_jailbreak_filter_settings<T>(mut self, v: T) -> Self
2041    where
2042        T: std::convert::Into<crate::model::PiAndJailbreakFilterSettings>,
2043    {
2044        self.pi_and_jailbreak_filter_settings = std::option::Option::Some(v.into());
2045        self
2046    }
2047
2048    /// Sets or clears the value of [pi_and_jailbreak_filter_settings][crate::model::FilterConfig::pi_and_jailbreak_filter_settings].
2049    ///
2050    /// # Example
2051    /// ```ignore,no_run
2052    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
2053    /// use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterSettings;
2054    /// let x = FilterConfig::new().set_or_clear_pi_and_jailbreak_filter_settings(Some(PiAndJailbreakFilterSettings::default()/* use setters */));
2055    /// let x = FilterConfig::new().set_or_clear_pi_and_jailbreak_filter_settings(None::<PiAndJailbreakFilterSettings>);
2056    /// ```
2057    pub fn set_or_clear_pi_and_jailbreak_filter_settings<T>(
2058        mut self,
2059        v: std::option::Option<T>,
2060    ) -> Self
2061    where
2062        T: std::convert::Into<crate::model::PiAndJailbreakFilterSettings>,
2063    {
2064        self.pi_and_jailbreak_filter_settings = v.map(|x| x.into());
2065        self
2066    }
2067
2068    /// Sets the value of [malicious_uri_filter_settings][crate::model::FilterConfig::malicious_uri_filter_settings].
2069    ///
2070    /// # Example
2071    /// ```ignore,no_run
2072    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
2073    /// use google_cloud_modelarmor_v1::model::MaliciousUriFilterSettings;
2074    /// let x = FilterConfig::new().set_malicious_uri_filter_settings(MaliciousUriFilterSettings::default()/* use setters */);
2075    /// ```
2076    pub fn set_malicious_uri_filter_settings<T>(mut self, v: T) -> Self
2077    where
2078        T: std::convert::Into<crate::model::MaliciousUriFilterSettings>,
2079    {
2080        self.malicious_uri_filter_settings = std::option::Option::Some(v.into());
2081        self
2082    }
2083
2084    /// Sets or clears the value of [malicious_uri_filter_settings][crate::model::FilterConfig::malicious_uri_filter_settings].
2085    ///
2086    /// # Example
2087    /// ```ignore,no_run
2088    /// # use google_cloud_modelarmor_v1::model::FilterConfig;
2089    /// use google_cloud_modelarmor_v1::model::MaliciousUriFilterSettings;
2090    /// let x = FilterConfig::new().set_or_clear_malicious_uri_filter_settings(Some(MaliciousUriFilterSettings::default()/* use setters */));
2091    /// let x = FilterConfig::new().set_or_clear_malicious_uri_filter_settings(None::<MaliciousUriFilterSettings>);
2092    /// ```
2093    pub fn set_or_clear_malicious_uri_filter_settings<T>(
2094        mut self,
2095        v: std::option::Option<T>,
2096    ) -> Self
2097    where
2098        T: std::convert::Into<crate::model::MaliciousUriFilterSettings>,
2099    {
2100        self.malicious_uri_filter_settings = v.map(|x| x.into());
2101        self
2102    }
2103}
2104
2105impl wkt::message::Message for FilterConfig {
2106    fn typename() -> &'static str {
2107        "type.googleapis.com/google.cloud.modelarmor.v1.FilterConfig"
2108    }
2109}
2110
2111/// Prompt injection and Jailbreak Filter settings.
2112#[derive(Clone, Default, PartialEq)]
2113#[non_exhaustive]
2114pub struct PiAndJailbreakFilterSettings {
2115    /// Optional. Tells whether Prompt injection and Jailbreak filter is enabled or
2116    /// disabled.
2117    pub filter_enforcement:
2118        crate::model::pi_and_jailbreak_filter_settings::PiAndJailbreakFilterEnforcement,
2119
2120    /// Optional. Confidence level for this filter.
2121    /// Confidence level is used to determine the threshold for the filter. If
2122    /// detection confidence is equal to or greater than the specified level, a
2123    /// positive match is reported. Confidence level will only be used if the
2124    /// filter is enabled.
2125    pub confidence_level: crate::model::DetectionConfidenceLevel,
2126
2127    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2128}
2129
2130impl PiAndJailbreakFilterSettings {
2131    pub fn new() -> Self {
2132        std::default::Default::default()
2133    }
2134
2135    /// Sets the value of [filter_enforcement][crate::model::PiAndJailbreakFilterSettings::filter_enforcement].
2136    ///
2137    /// # Example
2138    /// ```ignore,no_run
2139    /// # use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterSettings;
2140    /// use google_cloud_modelarmor_v1::model::pi_and_jailbreak_filter_settings::PiAndJailbreakFilterEnforcement;
2141    /// let x0 = PiAndJailbreakFilterSettings::new().set_filter_enforcement(PiAndJailbreakFilterEnforcement::Enabled);
2142    /// let x1 = PiAndJailbreakFilterSettings::new().set_filter_enforcement(PiAndJailbreakFilterEnforcement::Disabled);
2143    /// ```
2144    pub fn set_filter_enforcement<
2145        T: std::convert::Into<
2146                crate::model::pi_and_jailbreak_filter_settings::PiAndJailbreakFilterEnforcement,
2147            >,
2148    >(
2149        mut self,
2150        v: T,
2151    ) -> Self {
2152        self.filter_enforcement = v.into();
2153        self
2154    }
2155
2156    /// Sets the value of [confidence_level][crate::model::PiAndJailbreakFilterSettings::confidence_level].
2157    ///
2158    /// # Example
2159    /// ```ignore,no_run
2160    /// # use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterSettings;
2161    /// use google_cloud_modelarmor_v1::model::DetectionConfidenceLevel;
2162    /// let x0 = PiAndJailbreakFilterSettings::new().set_confidence_level(DetectionConfidenceLevel::LowAndAbove);
2163    /// let x1 = PiAndJailbreakFilterSettings::new().set_confidence_level(DetectionConfidenceLevel::MediumAndAbove);
2164    /// let x2 = PiAndJailbreakFilterSettings::new().set_confidence_level(DetectionConfidenceLevel::High);
2165    /// ```
2166    pub fn set_confidence_level<T: std::convert::Into<crate::model::DetectionConfidenceLevel>>(
2167        mut self,
2168        v: T,
2169    ) -> Self {
2170        self.confidence_level = v.into();
2171        self
2172    }
2173}
2174
2175impl wkt::message::Message for PiAndJailbreakFilterSettings {
2176    fn typename() -> &'static str {
2177        "type.googleapis.com/google.cloud.modelarmor.v1.PiAndJailbreakFilterSettings"
2178    }
2179}
2180
2181/// Defines additional types related to [PiAndJailbreakFilterSettings].
2182pub mod pi_and_jailbreak_filter_settings {
2183    #[allow(unused_imports)]
2184    use super::*;
2185
2186    /// Option to specify the state of Prompt Injection and Jailbreak filter
2187    /// (ENABLED/DISABLED).
2188    ///
2189    /// # Working with unknown values
2190    ///
2191    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2192    /// additional enum variants at any time. Adding new variants is not considered
2193    /// a breaking change. Applications should write their code in anticipation of:
2194    ///
2195    /// - New values appearing in future releases of the client library, **and**
2196    /// - New values received dynamically, without application changes.
2197    ///
2198    /// Please consult the [Working with enums] section in the user guide for some
2199    /// guidelines.
2200    ///
2201    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2202    #[derive(Clone, Debug, PartialEq)]
2203    #[non_exhaustive]
2204    pub enum PiAndJailbreakFilterEnforcement {
2205        /// Same as Disabled
2206        Unspecified,
2207        /// Enabled
2208        Enabled,
2209        /// Enabled
2210        Disabled,
2211        /// If set, the enum was initialized with an unknown value.
2212        ///
2213        /// Applications can examine the value using [PiAndJailbreakFilterEnforcement::value] or
2214        /// [PiAndJailbreakFilterEnforcement::name].
2215        UnknownValue(pi_and_jailbreak_filter_enforcement::UnknownValue),
2216    }
2217
2218    #[doc(hidden)]
2219    pub mod pi_and_jailbreak_filter_enforcement {
2220        #[allow(unused_imports)]
2221        use super::*;
2222        #[derive(Clone, Debug, PartialEq)]
2223        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2224    }
2225
2226    impl PiAndJailbreakFilterEnforcement {
2227        /// Gets the enum value.
2228        ///
2229        /// Returns `None` if the enum contains an unknown value deserialized from
2230        /// the string representation of enums.
2231        pub fn value(&self) -> std::option::Option<i32> {
2232            match self {
2233                Self::Unspecified => std::option::Option::Some(0),
2234                Self::Enabled => std::option::Option::Some(1),
2235                Self::Disabled => std::option::Option::Some(2),
2236                Self::UnknownValue(u) => u.0.value(),
2237            }
2238        }
2239
2240        /// Gets the enum value as a string.
2241        ///
2242        /// Returns `None` if the enum contains an unknown value deserialized from
2243        /// the integer representation of enums.
2244        pub fn name(&self) -> std::option::Option<&str> {
2245            match self {
2246                Self::Unspecified => {
2247                    std::option::Option::Some("PI_AND_JAILBREAK_FILTER_ENFORCEMENT_UNSPECIFIED")
2248                }
2249                Self::Enabled => std::option::Option::Some("ENABLED"),
2250                Self::Disabled => std::option::Option::Some("DISABLED"),
2251                Self::UnknownValue(u) => u.0.name(),
2252            }
2253        }
2254    }
2255
2256    impl std::default::Default for PiAndJailbreakFilterEnforcement {
2257        fn default() -> Self {
2258            use std::convert::From;
2259            Self::from(0)
2260        }
2261    }
2262
2263    impl std::fmt::Display for PiAndJailbreakFilterEnforcement {
2264        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2265            wkt::internal::display_enum(f, self.name(), self.value())
2266        }
2267    }
2268
2269    impl std::convert::From<i32> for PiAndJailbreakFilterEnforcement {
2270        fn from(value: i32) -> Self {
2271            match value {
2272                0 => Self::Unspecified,
2273                1 => Self::Enabled,
2274                2 => Self::Disabled,
2275                _ => Self::UnknownValue(pi_and_jailbreak_filter_enforcement::UnknownValue(
2276                    wkt::internal::UnknownEnumValue::Integer(value),
2277                )),
2278            }
2279        }
2280    }
2281
2282    impl std::convert::From<&str> for PiAndJailbreakFilterEnforcement {
2283        fn from(value: &str) -> Self {
2284            use std::string::ToString;
2285            match value {
2286                "PI_AND_JAILBREAK_FILTER_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
2287                "ENABLED" => Self::Enabled,
2288                "DISABLED" => Self::Disabled,
2289                _ => Self::UnknownValue(pi_and_jailbreak_filter_enforcement::UnknownValue(
2290                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2291                )),
2292            }
2293        }
2294    }
2295
2296    impl serde::ser::Serialize for PiAndJailbreakFilterEnforcement {
2297        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2298        where
2299            S: serde::Serializer,
2300        {
2301            match self {
2302                Self::Unspecified => serializer.serialize_i32(0),
2303                Self::Enabled => serializer.serialize_i32(1),
2304                Self::Disabled => serializer.serialize_i32(2),
2305                Self::UnknownValue(u) => u.0.serialize(serializer),
2306            }
2307        }
2308    }
2309
2310    impl<'de> serde::de::Deserialize<'de> for PiAndJailbreakFilterEnforcement {
2311        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2312        where
2313            D: serde::Deserializer<'de>,
2314        {
2315            deserializer.deserialize_any(wkt::internal::EnumVisitor::<PiAndJailbreakFilterEnforcement>::new(
2316                ".google.cloud.modelarmor.v1.PiAndJailbreakFilterSettings.PiAndJailbreakFilterEnforcement"))
2317        }
2318    }
2319}
2320
2321/// Malicious URI filter settings.
2322#[derive(Clone, Default, PartialEq)]
2323#[non_exhaustive]
2324pub struct MaliciousUriFilterSettings {
2325    /// Optional. Tells whether the Malicious URI filter is enabled or disabled.
2326    pub filter_enforcement:
2327        crate::model::malicious_uri_filter_settings::MaliciousUriFilterEnforcement,
2328
2329    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2330}
2331
2332impl MaliciousUriFilterSettings {
2333    pub fn new() -> Self {
2334        std::default::Default::default()
2335    }
2336
2337    /// Sets the value of [filter_enforcement][crate::model::MaliciousUriFilterSettings::filter_enforcement].
2338    ///
2339    /// # Example
2340    /// ```ignore,no_run
2341    /// # use google_cloud_modelarmor_v1::model::MaliciousUriFilterSettings;
2342    /// use google_cloud_modelarmor_v1::model::malicious_uri_filter_settings::MaliciousUriFilterEnforcement;
2343    /// let x0 = MaliciousUriFilterSettings::new().set_filter_enforcement(MaliciousUriFilterEnforcement::Enabled);
2344    /// let x1 = MaliciousUriFilterSettings::new().set_filter_enforcement(MaliciousUriFilterEnforcement::Disabled);
2345    /// ```
2346    pub fn set_filter_enforcement<
2347        T: std::convert::Into<
2348                crate::model::malicious_uri_filter_settings::MaliciousUriFilterEnforcement,
2349            >,
2350    >(
2351        mut self,
2352        v: T,
2353    ) -> Self {
2354        self.filter_enforcement = v.into();
2355        self
2356    }
2357}
2358
2359impl wkt::message::Message for MaliciousUriFilterSettings {
2360    fn typename() -> &'static str {
2361        "type.googleapis.com/google.cloud.modelarmor.v1.MaliciousUriFilterSettings"
2362    }
2363}
2364
2365/// Defines additional types related to [MaliciousUriFilterSettings].
2366pub mod malicious_uri_filter_settings {
2367    #[allow(unused_imports)]
2368    use super::*;
2369
2370    /// Option to specify the state of Malicious URI filter (ENABLED/DISABLED).
2371    ///
2372    /// # Working with unknown values
2373    ///
2374    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2375    /// additional enum variants at any time. Adding new variants is not considered
2376    /// a breaking change. Applications should write their code in anticipation of:
2377    ///
2378    /// - New values appearing in future releases of the client library, **and**
2379    /// - New values received dynamically, without application changes.
2380    ///
2381    /// Please consult the [Working with enums] section in the user guide for some
2382    /// guidelines.
2383    ///
2384    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2385    #[derive(Clone, Debug, PartialEq)]
2386    #[non_exhaustive]
2387    pub enum MaliciousUriFilterEnforcement {
2388        /// Same as Disabled
2389        Unspecified,
2390        /// Enabled
2391        Enabled,
2392        /// Disabled
2393        Disabled,
2394        /// If set, the enum was initialized with an unknown value.
2395        ///
2396        /// Applications can examine the value using [MaliciousUriFilterEnforcement::value] or
2397        /// [MaliciousUriFilterEnforcement::name].
2398        UnknownValue(malicious_uri_filter_enforcement::UnknownValue),
2399    }
2400
2401    #[doc(hidden)]
2402    pub mod malicious_uri_filter_enforcement {
2403        #[allow(unused_imports)]
2404        use super::*;
2405        #[derive(Clone, Debug, PartialEq)]
2406        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2407    }
2408
2409    impl MaliciousUriFilterEnforcement {
2410        /// Gets the enum value.
2411        ///
2412        /// Returns `None` if the enum contains an unknown value deserialized from
2413        /// the string representation of enums.
2414        pub fn value(&self) -> std::option::Option<i32> {
2415            match self {
2416                Self::Unspecified => std::option::Option::Some(0),
2417                Self::Enabled => std::option::Option::Some(1),
2418                Self::Disabled => std::option::Option::Some(2),
2419                Self::UnknownValue(u) => u.0.value(),
2420            }
2421        }
2422
2423        /// Gets the enum value as a string.
2424        ///
2425        /// Returns `None` if the enum contains an unknown value deserialized from
2426        /// the integer representation of enums.
2427        pub fn name(&self) -> std::option::Option<&str> {
2428            match self {
2429                Self::Unspecified => {
2430                    std::option::Option::Some("MALICIOUS_URI_FILTER_ENFORCEMENT_UNSPECIFIED")
2431                }
2432                Self::Enabled => std::option::Option::Some("ENABLED"),
2433                Self::Disabled => std::option::Option::Some("DISABLED"),
2434                Self::UnknownValue(u) => u.0.name(),
2435            }
2436        }
2437    }
2438
2439    impl std::default::Default for MaliciousUriFilterEnforcement {
2440        fn default() -> Self {
2441            use std::convert::From;
2442            Self::from(0)
2443        }
2444    }
2445
2446    impl std::fmt::Display for MaliciousUriFilterEnforcement {
2447        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2448            wkt::internal::display_enum(f, self.name(), self.value())
2449        }
2450    }
2451
2452    impl std::convert::From<i32> for MaliciousUriFilterEnforcement {
2453        fn from(value: i32) -> Self {
2454            match value {
2455                0 => Self::Unspecified,
2456                1 => Self::Enabled,
2457                2 => Self::Disabled,
2458                _ => Self::UnknownValue(malicious_uri_filter_enforcement::UnknownValue(
2459                    wkt::internal::UnknownEnumValue::Integer(value),
2460                )),
2461            }
2462        }
2463    }
2464
2465    impl std::convert::From<&str> for MaliciousUriFilterEnforcement {
2466        fn from(value: &str) -> Self {
2467            use std::string::ToString;
2468            match value {
2469                "MALICIOUS_URI_FILTER_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
2470                "ENABLED" => Self::Enabled,
2471                "DISABLED" => Self::Disabled,
2472                _ => Self::UnknownValue(malicious_uri_filter_enforcement::UnknownValue(
2473                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2474                )),
2475            }
2476        }
2477    }
2478
2479    impl serde::ser::Serialize for MaliciousUriFilterEnforcement {
2480        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2481        where
2482            S: serde::Serializer,
2483        {
2484            match self {
2485                Self::Unspecified => serializer.serialize_i32(0),
2486                Self::Enabled => serializer.serialize_i32(1),
2487                Self::Disabled => serializer.serialize_i32(2),
2488                Self::UnknownValue(u) => u.0.serialize(serializer),
2489            }
2490        }
2491    }
2492
2493    impl<'de> serde::de::Deserialize<'de> for MaliciousUriFilterEnforcement {
2494        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2495        where
2496            D: serde::Deserializer<'de>,
2497        {
2498            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MaliciousUriFilterEnforcement>::new(
2499                ".google.cloud.modelarmor.v1.MaliciousUriFilterSettings.MaliciousUriFilterEnforcement"))
2500        }
2501    }
2502}
2503
2504/// Responsible AI Filter settings.
2505#[derive(Clone, Default, PartialEq)]
2506#[non_exhaustive]
2507pub struct RaiFilterSettings {
2508    /// Required. List of Responsible AI filters enabled for template.
2509    pub rai_filters: std::vec::Vec<crate::model::rai_filter_settings::RaiFilter>,
2510
2511    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2512}
2513
2514impl RaiFilterSettings {
2515    pub fn new() -> Self {
2516        std::default::Default::default()
2517    }
2518
2519    /// Sets the value of [rai_filters][crate::model::RaiFilterSettings::rai_filters].
2520    ///
2521    /// # Example
2522    /// ```ignore,no_run
2523    /// # use google_cloud_modelarmor_v1::model::RaiFilterSettings;
2524    /// use google_cloud_modelarmor_v1::model::rai_filter_settings::RaiFilter;
2525    /// let x = RaiFilterSettings::new()
2526    ///     .set_rai_filters([
2527    ///         RaiFilter::default()/* use setters */,
2528    ///         RaiFilter::default()/* use (different) setters */,
2529    ///     ]);
2530    /// ```
2531    pub fn set_rai_filters<T, V>(mut self, v: T) -> Self
2532    where
2533        T: std::iter::IntoIterator<Item = V>,
2534        V: std::convert::Into<crate::model::rai_filter_settings::RaiFilter>,
2535    {
2536        use std::iter::Iterator;
2537        self.rai_filters = v.into_iter().map(|i| i.into()).collect();
2538        self
2539    }
2540}
2541
2542impl wkt::message::Message for RaiFilterSettings {
2543    fn typename() -> &'static str {
2544        "type.googleapis.com/google.cloud.modelarmor.v1.RaiFilterSettings"
2545    }
2546}
2547
2548/// Defines additional types related to [RaiFilterSettings].
2549pub mod rai_filter_settings {
2550    #[allow(unused_imports)]
2551    use super::*;
2552
2553    /// Responsible AI filter.
2554    #[derive(Clone, Default, PartialEq)]
2555    #[non_exhaustive]
2556    pub struct RaiFilter {
2557        /// Required. Type of responsible AI filter.
2558        pub filter_type: crate::model::RaiFilterType,
2559
2560        /// Optional. Confidence level for this RAI filter.
2561        /// During data sanitization, if data is classified under this filter with a
2562        /// confidence level equal to or greater than the specified level, a positive
2563        /// match is reported. If the confidence level is unspecified (i.e., 0), the
2564        /// system will use a reasonable default level based on the `filter_type`.
2565        pub confidence_level: crate::model::DetectionConfidenceLevel,
2566
2567        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2568    }
2569
2570    impl RaiFilter {
2571        pub fn new() -> Self {
2572            std::default::Default::default()
2573        }
2574
2575        /// Sets the value of [filter_type][crate::model::rai_filter_settings::RaiFilter::filter_type].
2576        ///
2577        /// # Example
2578        /// ```ignore,no_run
2579        /// # use google_cloud_modelarmor_v1::model::rai_filter_settings::RaiFilter;
2580        /// use google_cloud_modelarmor_v1::model::RaiFilterType;
2581        /// let x0 = RaiFilter::new().set_filter_type(RaiFilterType::SexuallyExplicit);
2582        /// let x1 = RaiFilter::new().set_filter_type(RaiFilterType::HateSpeech);
2583        /// let x2 = RaiFilter::new().set_filter_type(RaiFilterType::Harassment);
2584        /// ```
2585        pub fn set_filter_type<T: std::convert::Into<crate::model::RaiFilterType>>(
2586            mut self,
2587            v: T,
2588        ) -> Self {
2589            self.filter_type = v.into();
2590            self
2591        }
2592
2593        /// Sets the value of [confidence_level][crate::model::rai_filter_settings::RaiFilter::confidence_level].
2594        ///
2595        /// # Example
2596        /// ```ignore,no_run
2597        /// # use google_cloud_modelarmor_v1::model::rai_filter_settings::RaiFilter;
2598        /// use google_cloud_modelarmor_v1::model::DetectionConfidenceLevel;
2599        /// let x0 = RaiFilter::new().set_confidence_level(DetectionConfidenceLevel::LowAndAbove);
2600        /// let x1 = RaiFilter::new().set_confidence_level(DetectionConfidenceLevel::MediumAndAbove);
2601        /// let x2 = RaiFilter::new().set_confidence_level(DetectionConfidenceLevel::High);
2602        /// ```
2603        pub fn set_confidence_level<
2604            T: std::convert::Into<crate::model::DetectionConfidenceLevel>,
2605        >(
2606            mut self,
2607            v: T,
2608        ) -> Self {
2609            self.confidence_level = v.into();
2610            self
2611        }
2612    }
2613
2614    impl wkt::message::Message for RaiFilter {
2615        fn typename() -> &'static str {
2616            "type.googleapis.com/google.cloud.modelarmor.v1.RaiFilterSettings.RaiFilter"
2617        }
2618    }
2619}
2620
2621/// Sensitive Data Protection settings.
2622#[derive(Clone, Default, PartialEq)]
2623#[non_exhaustive]
2624pub struct SdpFilterSettings {
2625    /// Either of Sensitive Data Protection basic or advanced configuration.
2626    pub sdp_configuration: std::option::Option<crate::model::sdp_filter_settings::SdpConfiguration>,
2627
2628    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2629}
2630
2631impl SdpFilterSettings {
2632    pub fn new() -> Self {
2633        std::default::Default::default()
2634    }
2635
2636    /// Sets the value of [sdp_configuration][crate::model::SdpFilterSettings::sdp_configuration].
2637    ///
2638    /// Note that all the setters affecting `sdp_configuration` are mutually
2639    /// exclusive.
2640    ///
2641    /// # Example
2642    /// ```ignore,no_run
2643    /// # use google_cloud_modelarmor_v1::model::SdpFilterSettings;
2644    /// use google_cloud_modelarmor_v1::model::SdpBasicConfig;
2645    /// let x = SdpFilterSettings::new().set_sdp_configuration(Some(
2646    ///     google_cloud_modelarmor_v1::model::sdp_filter_settings::SdpConfiguration::BasicConfig(SdpBasicConfig::default().into())));
2647    /// ```
2648    pub fn set_sdp_configuration<
2649        T: std::convert::Into<
2650                std::option::Option<crate::model::sdp_filter_settings::SdpConfiguration>,
2651            >,
2652    >(
2653        mut self,
2654        v: T,
2655    ) -> Self {
2656        self.sdp_configuration = v.into();
2657        self
2658    }
2659
2660    /// The value of [sdp_configuration][crate::model::SdpFilterSettings::sdp_configuration]
2661    /// if it holds a `BasicConfig`, `None` if the field is not set or
2662    /// holds a different branch.
2663    pub fn basic_config(
2664        &self,
2665    ) -> std::option::Option<&std::boxed::Box<crate::model::SdpBasicConfig>> {
2666        #[allow(unreachable_patterns)]
2667        self.sdp_configuration.as_ref().and_then(|v| match v {
2668            crate::model::sdp_filter_settings::SdpConfiguration::BasicConfig(v) => {
2669                std::option::Option::Some(v)
2670            }
2671            _ => std::option::Option::None,
2672        })
2673    }
2674
2675    /// Sets the value of [sdp_configuration][crate::model::SdpFilterSettings::sdp_configuration]
2676    /// to hold a `BasicConfig`.
2677    ///
2678    /// Note that all the setters affecting `sdp_configuration` are
2679    /// mutually exclusive.
2680    ///
2681    /// # Example
2682    /// ```ignore,no_run
2683    /// # use google_cloud_modelarmor_v1::model::SdpFilterSettings;
2684    /// use google_cloud_modelarmor_v1::model::SdpBasicConfig;
2685    /// let x = SdpFilterSettings::new().set_basic_config(SdpBasicConfig::default()/* use setters */);
2686    /// assert!(x.basic_config().is_some());
2687    /// assert!(x.advanced_config().is_none());
2688    /// ```
2689    pub fn set_basic_config<
2690        T: std::convert::Into<std::boxed::Box<crate::model::SdpBasicConfig>>,
2691    >(
2692        mut self,
2693        v: T,
2694    ) -> Self {
2695        self.sdp_configuration = std::option::Option::Some(
2696            crate::model::sdp_filter_settings::SdpConfiguration::BasicConfig(v.into()),
2697        );
2698        self
2699    }
2700
2701    /// The value of [sdp_configuration][crate::model::SdpFilterSettings::sdp_configuration]
2702    /// if it holds a `AdvancedConfig`, `None` if the field is not set or
2703    /// holds a different branch.
2704    pub fn advanced_config(
2705        &self,
2706    ) -> std::option::Option<&std::boxed::Box<crate::model::SdpAdvancedConfig>> {
2707        #[allow(unreachable_patterns)]
2708        self.sdp_configuration.as_ref().and_then(|v| match v {
2709            crate::model::sdp_filter_settings::SdpConfiguration::AdvancedConfig(v) => {
2710                std::option::Option::Some(v)
2711            }
2712            _ => std::option::Option::None,
2713        })
2714    }
2715
2716    /// Sets the value of [sdp_configuration][crate::model::SdpFilterSettings::sdp_configuration]
2717    /// to hold a `AdvancedConfig`.
2718    ///
2719    /// Note that all the setters affecting `sdp_configuration` are
2720    /// mutually exclusive.
2721    ///
2722    /// # Example
2723    /// ```ignore,no_run
2724    /// # use google_cloud_modelarmor_v1::model::SdpFilterSettings;
2725    /// use google_cloud_modelarmor_v1::model::SdpAdvancedConfig;
2726    /// let x = SdpFilterSettings::new().set_advanced_config(SdpAdvancedConfig::default()/* use setters */);
2727    /// assert!(x.advanced_config().is_some());
2728    /// assert!(x.basic_config().is_none());
2729    /// ```
2730    pub fn set_advanced_config<
2731        T: std::convert::Into<std::boxed::Box<crate::model::SdpAdvancedConfig>>,
2732    >(
2733        mut self,
2734        v: T,
2735    ) -> Self {
2736        self.sdp_configuration = std::option::Option::Some(
2737            crate::model::sdp_filter_settings::SdpConfiguration::AdvancedConfig(v.into()),
2738        );
2739        self
2740    }
2741}
2742
2743impl wkt::message::Message for SdpFilterSettings {
2744    fn typename() -> &'static str {
2745        "type.googleapis.com/google.cloud.modelarmor.v1.SdpFilterSettings"
2746    }
2747}
2748
2749/// Defines additional types related to [SdpFilterSettings].
2750pub mod sdp_filter_settings {
2751    #[allow(unused_imports)]
2752    use super::*;
2753
2754    /// Either of Sensitive Data Protection basic or advanced configuration.
2755    #[derive(Clone, Debug, PartialEq)]
2756    #[non_exhaustive]
2757    pub enum SdpConfiguration {
2758        /// Optional. Basic Sensitive Data Protection configuration inspects the
2759        /// content for sensitive data using a fixed set of six info-types. Sensitive
2760        /// Data Protection templates cannot be used with basic configuration. Only
2761        /// Sensitive Data Protection inspection operation is supported with basic
2762        /// configuration.
2763        BasicConfig(std::boxed::Box<crate::model::SdpBasicConfig>),
2764        /// Optional. Advanced Sensitive Data Protection configuration which enables
2765        /// use of Sensitive Data Protection templates. Supports both Sensitive Data
2766        /// Protection inspection and de-identification operations.
2767        AdvancedConfig(std::boxed::Box<crate::model::SdpAdvancedConfig>),
2768    }
2769}
2770
2771/// Sensitive Data Protection basic configuration.
2772#[derive(Clone, Default, PartialEq)]
2773#[non_exhaustive]
2774pub struct SdpBasicConfig {
2775    /// Optional. Tells whether the Sensitive Data Protection basic config is
2776    /// enabled or disabled.
2777    pub filter_enforcement: crate::model::sdp_basic_config::SdpBasicConfigEnforcement,
2778
2779    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2780}
2781
2782impl SdpBasicConfig {
2783    pub fn new() -> Self {
2784        std::default::Default::default()
2785    }
2786
2787    /// Sets the value of [filter_enforcement][crate::model::SdpBasicConfig::filter_enforcement].
2788    ///
2789    /// # Example
2790    /// ```ignore,no_run
2791    /// # use google_cloud_modelarmor_v1::model::SdpBasicConfig;
2792    /// use google_cloud_modelarmor_v1::model::sdp_basic_config::SdpBasicConfigEnforcement;
2793    /// let x0 = SdpBasicConfig::new().set_filter_enforcement(SdpBasicConfigEnforcement::Enabled);
2794    /// let x1 = SdpBasicConfig::new().set_filter_enforcement(SdpBasicConfigEnforcement::Disabled);
2795    /// ```
2796    pub fn set_filter_enforcement<
2797        T: std::convert::Into<crate::model::sdp_basic_config::SdpBasicConfigEnforcement>,
2798    >(
2799        mut self,
2800        v: T,
2801    ) -> Self {
2802        self.filter_enforcement = v.into();
2803        self
2804    }
2805}
2806
2807impl wkt::message::Message for SdpBasicConfig {
2808    fn typename() -> &'static str {
2809        "type.googleapis.com/google.cloud.modelarmor.v1.SdpBasicConfig"
2810    }
2811}
2812
2813/// Defines additional types related to [SdpBasicConfig].
2814pub mod sdp_basic_config {
2815    #[allow(unused_imports)]
2816    use super::*;
2817
2818    /// Option to specify the state of Sensitive Data Protection basic config
2819    /// (ENABLED/DISABLED).
2820    ///
2821    /// # Working with unknown values
2822    ///
2823    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2824    /// additional enum variants at any time. Adding new variants is not considered
2825    /// a breaking change. Applications should write their code in anticipation of:
2826    ///
2827    /// - New values appearing in future releases of the client library, **and**
2828    /// - New values received dynamically, without application changes.
2829    ///
2830    /// Please consult the [Working with enums] section in the user guide for some
2831    /// guidelines.
2832    ///
2833    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2834    #[derive(Clone, Debug, PartialEq)]
2835    #[non_exhaustive]
2836    pub enum SdpBasicConfigEnforcement {
2837        /// Same as Disabled
2838        Unspecified,
2839        /// Enabled
2840        Enabled,
2841        /// Disabled
2842        Disabled,
2843        /// If set, the enum was initialized with an unknown value.
2844        ///
2845        /// Applications can examine the value using [SdpBasicConfigEnforcement::value] or
2846        /// [SdpBasicConfigEnforcement::name].
2847        UnknownValue(sdp_basic_config_enforcement::UnknownValue),
2848    }
2849
2850    #[doc(hidden)]
2851    pub mod sdp_basic_config_enforcement {
2852        #[allow(unused_imports)]
2853        use super::*;
2854        #[derive(Clone, Debug, PartialEq)]
2855        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2856    }
2857
2858    impl SdpBasicConfigEnforcement {
2859        /// Gets the enum value.
2860        ///
2861        /// Returns `None` if the enum contains an unknown value deserialized from
2862        /// the string representation of enums.
2863        pub fn value(&self) -> std::option::Option<i32> {
2864            match self {
2865                Self::Unspecified => std::option::Option::Some(0),
2866                Self::Enabled => std::option::Option::Some(1),
2867                Self::Disabled => std::option::Option::Some(2),
2868                Self::UnknownValue(u) => u.0.value(),
2869            }
2870        }
2871
2872        /// Gets the enum value as a string.
2873        ///
2874        /// Returns `None` if the enum contains an unknown value deserialized from
2875        /// the integer representation of enums.
2876        pub fn name(&self) -> std::option::Option<&str> {
2877            match self {
2878                Self::Unspecified => {
2879                    std::option::Option::Some("SDP_BASIC_CONFIG_ENFORCEMENT_UNSPECIFIED")
2880                }
2881                Self::Enabled => std::option::Option::Some("ENABLED"),
2882                Self::Disabled => std::option::Option::Some("DISABLED"),
2883                Self::UnknownValue(u) => u.0.name(),
2884            }
2885        }
2886    }
2887
2888    impl std::default::Default for SdpBasicConfigEnforcement {
2889        fn default() -> Self {
2890            use std::convert::From;
2891            Self::from(0)
2892        }
2893    }
2894
2895    impl std::fmt::Display for SdpBasicConfigEnforcement {
2896        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2897            wkt::internal::display_enum(f, self.name(), self.value())
2898        }
2899    }
2900
2901    impl std::convert::From<i32> for SdpBasicConfigEnforcement {
2902        fn from(value: i32) -> Self {
2903            match value {
2904                0 => Self::Unspecified,
2905                1 => Self::Enabled,
2906                2 => Self::Disabled,
2907                _ => Self::UnknownValue(sdp_basic_config_enforcement::UnknownValue(
2908                    wkt::internal::UnknownEnumValue::Integer(value),
2909                )),
2910            }
2911        }
2912    }
2913
2914    impl std::convert::From<&str> for SdpBasicConfigEnforcement {
2915        fn from(value: &str) -> Self {
2916            use std::string::ToString;
2917            match value {
2918                "SDP_BASIC_CONFIG_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
2919                "ENABLED" => Self::Enabled,
2920                "DISABLED" => Self::Disabled,
2921                _ => Self::UnknownValue(sdp_basic_config_enforcement::UnknownValue(
2922                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2923                )),
2924            }
2925        }
2926    }
2927
2928    impl serde::ser::Serialize for SdpBasicConfigEnforcement {
2929        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2930        where
2931            S: serde::Serializer,
2932        {
2933            match self {
2934                Self::Unspecified => serializer.serialize_i32(0),
2935                Self::Enabled => serializer.serialize_i32(1),
2936                Self::Disabled => serializer.serialize_i32(2),
2937                Self::UnknownValue(u) => u.0.serialize(serializer),
2938            }
2939        }
2940    }
2941
2942    impl<'de> serde::de::Deserialize<'de> for SdpBasicConfigEnforcement {
2943        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2944        where
2945            D: serde::Deserializer<'de>,
2946        {
2947            deserializer.deserialize_any(
2948                wkt::internal::EnumVisitor::<SdpBasicConfigEnforcement>::new(
2949                    ".google.cloud.modelarmor.v1.SdpBasicConfig.SdpBasicConfigEnforcement",
2950                ),
2951            )
2952        }
2953    }
2954}
2955
2956/// Sensitive Data Protection Advanced configuration.
2957#[derive(Clone, Default, PartialEq)]
2958#[non_exhaustive]
2959pub struct SdpAdvancedConfig {
2960    /// Optional. Sensitive Data Protection inspect template resource name
2961    ///
2962    /// If only inspect template is provided (de-identify template not provided),
2963    /// then Sensitive Data Protection InspectContent action is performed during
2964    /// Sanitization. All Sensitive Data Protection findings identified during
2965    /// inspection will be returned as SdpFinding in SdpInsepctionResult.
2966    ///
2967    /// e.g.
2968    /// `projects/{project}/locations/{location}/inspectTemplates/{inspect_template}`
2969    pub inspect_template: std::string::String,
2970
2971    /// Optional. Optional Sensitive Data Protection Deidentify template resource
2972    /// name.
2973    ///
2974    /// If provided then DeidentifyContent action is performed during Sanitization
2975    /// using this template and inspect template. The De-identified data will
2976    /// be returned in SdpDeidentifyResult.
2977    /// Note that all info-types present in the deidentify template must be present
2978    /// in inspect template.
2979    ///
2980    /// e.g.
2981    /// `projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}`
2982    pub deidentify_template: std::string::String,
2983
2984    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2985}
2986
2987impl SdpAdvancedConfig {
2988    pub fn new() -> Self {
2989        std::default::Default::default()
2990    }
2991
2992    /// Sets the value of [inspect_template][crate::model::SdpAdvancedConfig::inspect_template].
2993    ///
2994    /// # Example
2995    /// ```ignore,no_run
2996    /// # use google_cloud_modelarmor_v1::model::SdpAdvancedConfig;
2997    /// let x = SdpAdvancedConfig::new().set_inspect_template("example");
2998    /// ```
2999    pub fn set_inspect_template<T: std::convert::Into<std::string::String>>(
3000        mut self,
3001        v: T,
3002    ) -> Self {
3003        self.inspect_template = v.into();
3004        self
3005    }
3006
3007    /// Sets the value of [deidentify_template][crate::model::SdpAdvancedConfig::deidentify_template].
3008    ///
3009    /// # Example
3010    /// ```ignore,no_run
3011    /// # use google_cloud_modelarmor_v1::model::SdpAdvancedConfig;
3012    /// let x = SdpAdvancedConfig::new().set_deidentify_template("example");
3013    /// ```
3014    pub fn set_deidentify_template<T: std::convert::Into<std::string::String>>(
3015        mut self,
3016        v: T,
3017    ) -> Self {
3018        self.deidentify_template = v.into();
3019        self
3020    }
3021}
3022
3023impl wkt::message::Message for SdpAdvancedConfig {
3024    fn typename() -> &'static str {
3025        "type.googleapis.com/google.cloud.modelarmor.v1.SdpAdvancedConfig"
3026    }
3027}
3028
3029/// Sanitize User Prompt request.
3030#[derive(Clone, Default, PartialEq)]
3031#[non_exhaustive]
3032pub struct SanitizeUserPromptRequest {
3033    /// Required. Represents resource name of template
3034    /// e.g. name=projects/sample-project/locations/us-central1/templates/templ01
3035    pub name: std::string::String,
3036
3037    /// Required. User prompt data to sanitize.
3038    pub user_prompt_data: std::option::Option<crate::model::DataItem>,
3039
3040    /// Optional. Metadata related to Multi Language Detection.
3041    pub multi_language_detection_metadata:
3042        std::option::Option<crate::model::MultiLanguageDetectionMetadata>,
3043
3044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3045}
3046
3047impl SanitizeUserPromptRequest {
3048    pub fn new() -> Self {
3049        std::default::Default::default()
3050    }
3051
3052    /// Sets the value of [name][crate::model::SanitizeUserPromptRequest::name].
3053    ///
3054    /// # Example
3055    /// ```ignore,no_run
3056    /// # use google_cloud_modelarmor_v1::model::SanitizeUserPromptRequest;
3057    /// let x = SanitizeUserPromptRequest::new().set_name("example");
3058    /// ```
3059    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3060        self.name = v.into();
3061        self
3062    }
3063
3064    /// Sets the value of [user_prompt_data][crate::model::SanitizeUserPromptRequest::user_prompt_data].
3065    ///
3066    /// # Example
3067    /// ```ignore,no_run
3068    /// # use google_cloud_modelarmor_v1::model::SanitizeUserPromptRequest;
3069    /// use google_cloud_modelarmor_v1::model::DataItem;
3070    /// let x = SanitizeUserPromptRequest::new().set_user_prompt_data(DataItem::default()/* use setters */);
3071    /// ```
3072    pub fn set_user_prompt_data<T>(mut self, v: T) -> Self
3073    where
3074        T: std::convert::Into<crate::model::DataItem>,
3075    {
3076        self.user_prompt_data = std::option::Option::Some(v.into());
3077        self
3078    }
3079
3080    /// Sets or clears the value of [user_prompt_data][crate::model::SanitizeUserPromptRequest::user_prompt_data].
3081    ///
3082    /// # Example
3083    /// ```ignore,no_run
3084    /// # use google_cloud_modelarmor_v1::model::SanitizeUserPromptRequest;
3085    /// use google_cloud_modelarmor_v1::model::DataItem;
3086    /// let x = SanitizeUserPromptRequest::new().set_or_clear_user_prompt_data(Some(DataItem::default()/* use setters */));
3087    /// let x = SanitizeUserPromptRequest::new().set_or_clear_user_prompt_data(None::<DataItem>);
3088    /// ```
3089    pub fn set_or_clear_user_prompt_data<T>(mut self, v: std::option::Option<T>) -> Self
3090    where
3091        T: std::convert::Into<crate::model::DataItem>,
3092    {
3093        self.user_prompt_data = v.map(|x| x.into());
3094        self
3095    }
3096
3097    /// Sets the value of [multi_language_detection_metadata][crate::model::SanitizeUserPromptRequest::multi_language_detection_metadata].
3098    ///
3099    /// # Example
3100    /// ```ignore,no_run
3101    /// # use google_cloud_modelarmor_v1::model::SanitizeUserPromptRequest;
3102    /// use google_cloud_modelarmor_v1::model::MultiLanguageDetectionMetadata;
3103    /// let x = SanitizeUserPromptRequest::new().set_multi_language_detection_metadata(MultiLanguageDetectionMetadata::default()/* use setters */);
3104    /// ```
3105    pub fn set_multi_language_detection_metadata<T>(mut self, v: T) -> Self
3106    where
3107        T: std::convert::Into<crate::model::MultiLanguageDetectionMetadata>,
3108    {
3109        self.multi_language_detection_metadata = std::option::Option::Some(v.into());
3110        self
3111    }
3112
3113    /// Sets or clears the value of [multi_language_detection_metadata][crate::model::SanitizeUserPromptRequest::multi_language_detection_metadata].
3114    ///
3115    /// # Example
3116    /// ```ignore,no_run
3117    /// # use google_cloud_modelarmor_v1::model::SanitizeUserPromptRequest;
3118    /// use google_cloud_modelarmor_v1::model::MultiLanguageDetectionMetadata;
3119    /// let x = SanitizeUserPromptRequest::new().set_or_clear_multi_language_detection_metadata(Some(MultiLanguageDetectionMetadata::default()/* use setters */));
3120    /// let x = SanitizeUserPromptRequest::new().set_or_clear_multi_language_detection_metadata(None::<MultiLanguageDetectionMetadata>);
3121    /// ```
3122    pub fn set_or_clear_multi_language_detection_metadata<T>(
3123        mut self,
3124        v: std::option::Option<T>,
3125    ) -> Self
3126    where
3127        T: std::convert::Into<crate::model::MultiLanguageDetectionMetadata>,
3128    {
3129        self.multi_language_detection_metadata = v.map(|x| x.into());
3130        self
3131    }
3132}
3133
3134impl wkt::message::Message for SanitizeUserPromptRequest {
3135    fn typename() -> &'static str {
3136        "type.googleapis.com/google.cloud.modelarmor.v1.SanitizeUserPromptRequest"
3137    }
3138}
3139
3140/// Sanitize Model Response request.
3141#[derive(Clone, Default, PartialEq)]
3142#[non_exhaustive]
3143pub struct SanitizeModelResponseRequest {
3144    /// Required. Represents resource name of template
3145    /// e.g. name=projects/sample-project/locations/us-central1/templates/templ01
3146    pub name: std::string::String,
3147
3148    /// Required. Model response data to sanitize.
3149    pub model_response_data: std::option::Option<crate::model::DataItem>,
3150
3151    /// Optional. User Prompt associated with Model response.
3152    pub user_prompt: std::string::String,
3153
3154    /// Optional. Metadata related for multi language detection.
3155    pub multi_language_detection_metadata:
3156        std::option::Option<crate::model::MultiLanguageDetectionMetadata>,
3157
3158    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3159}
3160
3161impl SanitizeModelResponseRequest {
3162    pub fn new() -> Self {
3163        std::default::Default::default()
3164    }
3165
3166    /// Sets the value of [name][crate::model::SanitizeModelResponseRequest::name].
3167    ///
3168    /// # Example
3169    /// ```ignore,no_run
3170    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseRequest;
3171    /// let x = SanitizeModelResponseRequest::new().set_name("example");
3172    /// ```
3173    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3174        self.name = v.into();
3175        self
3176    }
3177
3178    /// Sets the value of [model_response_data][crate::model::SanitizeModelResponseRequest::model_response_data].
3179    ///
3180    /// # Example
3181    /// ```ignore,no_run
3182    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseRequest;
3183    /// use google_cloud_modelarmor_v1::model::DataItem;
3184    /// let x = SanitizeModelResponseRequest::new().set_model_response_data(DataItem::default()/* use setters */);
3185    /// ```
3186    pub fn set_model_response_data<T>(mut self, v: T) -> Self
3187    where
3188        T: std::convert::Into<crate::model::DataItem>,
3189    {
3190        self.model_response_data = std::option::Option::Some(v.into());
3191        self
3192    }
3193
3194    /// Sets or clears the value of [model_response_data][crate::model::SanitizeModelResponseRequest::model_response_data].
3195    ///
3196    /// # Example
3197    /// ```ignore,no_run
3198    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseRequest;
3199    /// use google_cloud_modelarmor_v1::model::DataItem;
3200    /// let x = SanitizeModelResponseRequest::new().set_or_clear_model_response_data(Some(DataItem::default()/* use setters */));
3201    /// let x = SanitizeModelResponseRequest::new().set_or_clear_model_response_data(None::<DataItem>);
3202    /// ```
3203    pub fn set_or_clear_model_response_data<T>(mut self, v: std::option::Option<T>) -> Self
3204    where
3205        T: std::convert::Into<crate::model::DataItem>,
3206    {
3207        self.model_response_data = v.map(|x| x.into());
3208        self
3209    }
3210
3211    /// Sets the value of [user_prompt][crate::model::SanitizeModelResponseRequest::user_prompt].
3212    ///
3213    /// # Example
3214    /// ```ignore,no_run
3215    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseRequest;
3216    /// let x = SanitizeModelResponseRequest::new().set_user_prompt("example");
3217    /// ```
3218    pub fn set_user_prompt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3219        self.user_prompt = v.into();
3220        self
3221    }
3222
3223    /// Sets the value of [multi_language_detection_metadata][crate::model::SanitizeModelResponseRequest::multi_language_detection_metadata].
3224    ///
3225    /// # Example
3226    /// ```ignore,no_run
3227    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseRequest;
3228    /// use google_cloud_modelarmor_v1::model::MultiLanguageDetectionMetadata;
3229    /// let x = SanitizeModelResponseRequest::new().set_multi_language_detection_metadata(MultiLanguageDetectionMetadata::default()/* use setters */);
3230    /// ```
3231    pub fn set_multi_language_detection_metadata<T>(mut self, v: T) -> Self
3232    where
3233        T: std::convert::Into<crate::model::MultiLanguageDetectionMetadata>,
3234    {
3235        self.multi_language_detection_metadata = std::option::Option::Some(v.into());
3236        self
3237    }
3238
3239    /// Sets or clears the value of [multi_language_detection_metadata][crate::model::SanitizeModelResponseRequest::multi_language_detection_metadata].
3240    ///
3241    /// # Example
3242    /// ```ignore,no_run
3243    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseRequest;
3244    /// use google_cloud_modelarmor_v1::model::MultiLanguageDetectionMetadata;
3245    /// let x = SanitizeModelResponseRequest::new().set_or_clear_multi_language_detection_metadata(Some(MultiLanguageDetectionMetadata::default()/* use setters */));
3246    /// let x = SanitizeModelResponseRequest::new().set_or_clear_multi_language_detection_metadata(None::<MultiLanguageDetectionMetadata>);
3247    /// ```
3248    pub fn set_or_clear_multi_language_detection_metadata<T>(
3249        mut self,
3250        v: std::option::Option<T>,
3251    ) -> Self
3252    where
3253        T: std::convert::Into<crate::model::MultiLanguageDetectionMetadata>,
3254    {
3255        self.multi_language_detection_metadata = v.map(|x| x.into());
3256        self
3257    }
3258}
3259
3260impl wkt::message::Message for SanitizeModelResponseRequest {
3261    fn typename() -> &'static str {
3262        "type.googleapis.com/google.cloud.modelarmor.v1.SanitizeModelResponseRequest"
3263    }
3264}
3265
3266/// Sanitized User Prompt Response.
3267#[derive(Clone, Default, PartialEq)]
3268#[non_exhaustive]
3269pub struct SanitizeUserPromptResponse {
3270    /// Output only. Sanitization Result.
3271    pub sanitization_result: std::option::Option<crate::model::SanitizationResult>,
3272
3273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3274}
3275
3276impl SanitizeUserPromptResponse {
3277    pub fn new() -> Self {
3278        std::default::Default::default()
3279    }
3280
3281    /// Sets the value of [sanitization_result][crate::model::SanitizeUserPromptResponse::sanitization_result].
3282    ///
3283    /// # Example
3284    /// ```ignore,no_run
3285    /// # use google_cloud_modelarmor_v1::model::SanitizeUserPromptResponse;
3286    /// use google_cloud_modelarmor_v1::model::SanitizationResult;
3287    /// let x = SanitizeUserPromptResponse::new().set_sanitization_result(SanitizationResult::default()/* use setters */);
3288    /// ```
3289    pub fn set_sanitization_result<T>(mut self, v: T) -> Self
3290    where
3291        T: std::convert::Into<crate::model::SanitizationResult>,
3292    {
3293        self.sanitization_result = std::option::Option::Some(v.into());
3294        self
3295    }
3296
3297    /// Sets or clears the value of [sanitization_result][crate::model::SanitizeUserPromptResponse::sanitization_result].
3298    ///
3299    /// # Example
3300    /// ```ignore,no_run
3301    /// # use google_cloud_modelarmor_v1::model::SanitizeUserPromptResponse;
3302    /// use google_cloud_modelarmor_v1::model::SanitizationResult;
3303    /// let x = SanitizeUserPromptResponse::new().set_or_clear_sanitization_result(Some(SanitizationResult::default()/* use setters */));
3304    /// let x = SanitizeUserPromptResponse::new().set_or_clear_sanitization_result(None::<SanitizationResult>);
3305    /// ```
3306    pub fn set_or_clear_sanitization_result<T>(mut self, v: std::option::Option<T>) -> Self
3307    where
3308        T: std::convert::Into<crate::model::SanitizationResult>,
3309    {
3310        self.sanitization_result = v.map(|x| x.into());
3311        self
3312    }
3313}
3314
3315impl wkt::message::Message for SanitizeUserPromptResponse {
3316    fn typename() -> &'static str {
3317        "type.googleapis.com/google.cloud.modelarmor.v1.SanitizeUserPromptResponse"
3318    }
3319}
3320
3321/// Sanitized Model Response Response.
3322#[derive(Clone, Default, PartialEq)]
3323#[non_exhaustive]
3324pub struct SanitizeModelResponseResponse {
3325    /// Output only. Sanitization Result.
3326    pub sanitization_result: std::option::Option<crate::model::SanitizationResult>,
3327
3328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3329}
3330
3331impl SanitizeModelResponseResponse {
3332    pub fn new() -> Self {
3333        std::default::Default::default()
3334    }
3335
3336    /// Sets the value of [sanitization_result][crate::model::SanitizeModelResponseResponse::sanitization_result].
3337    ///
3338    /// # Example
3339    /// ```ignore,no_run
3340    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseResponse;
3341    /// use google_cloud_modelarmor_v1::model::SanitizationResult;
3342    /// let x = SanitizeModelResponseResponse::new().set_sanitization_result(SanitizationResult::default()/* use setters */);
3343    /// ```
3344    pub fn set_sanitization_result<T>(mut self, v: T) -> Self
3345    where
3346        T: std::convert::Into<crate::model::SanitizationResult>,
3347    {
3348        self.sanitization_result = std::option::Option::Some(v.into());
3349        self
3350    }
3351
3352    /// Sets or clears the value of [sanitization_result][crate::model::SanitizeModelResponseResponse::sanitization_result].
3353    ///
3354    /// # Example
3355    /// ```ignore,no_run
3356    /// # use google_cloud_modelarmor_v1::model::SanitizeModelResponseResponse;
3357    /// use google_cloud_modelarmor_v1::model::SanitizationResult;
3358    /// let x = SanitizeModelResponseResponse::new().set_or_clear_sanitization_result(Some(SanitizationResult::default()/* use setters */));
3359    /// let x = SanitizeModelResponseResponse::new().set_or_clear_sanitization_result(None::<SanitizationResult>);
3360    /// ```
3361    pub fn set_or_clear_sanitization_result<T>(mut self, v: std::option::Option<T>) -> Self
3362    where
3363        T: std::convert::Into<crate::model::SanitizationResult>,
3364    {
3365        self.sanitization_result = v.map(|x| x.into());
3366        self
3367    }
3368}
3369
3370impl wkt::message::Message for SanitizeModelResponseResponse {
3371    fn typename() -> &'static str {
3372        "type.googleapis.com/google.cloud.modelarmor.v1.SanitizeModelResponseResponse"
3373    }
3374}
3375
3376/// Sanitization result after applying all the filters on input content.
3377#[derive(Clone, Default, PartialEq)]
3378#[non_exhaustive]
3379pub struct SanitizationResult {
3380    /// Output only. Overall filter match state for Sanitization.
3381    /// The state can have below two values.
3382    ///
3383    /// 1. NO_MATCH_FOUND: No filters in configuration satisfy matching criteria.
3384    ///    In other words, input passed all filters.
3385    ///
3386    /// 1. MATCH_FOUND: At least one filter in configuration satisfies matching.
3387    ///    In other words, input did not pass one or more filters.
3388    ///
3389    pub filter_match_state: crate::model::FilterMatchState,
3390
3391    /// Output only. Results for all filters where the key is the filter name -
3392    /// either of "csam", "malicious_uris", "rai", "pi_and_jailbreak" ,"sdp".
3393    pub filter_results: std::collections::HashMap<std::string::String, crate::model::FilterResult>,
3394
3395    /// Output only. A field indicating the outcome of the invocation, irrespective
3396    /// of match status. It can have the following three values: SUCCESS: All
3397    /// filters were executed successfully. PARTIAL: Some filters were skipped or
3398    /// failed execution. FAILURE: All filters were skipped or failed execution.
3399    pub invocation_result: crate::model::InvocationResult,
3400
3401    /// Output only. Metadata related to Sanitization.
3402    pub sanitization_metadata:
3403        std::option::Option<crate::model::sanitization_result::SanitizationMetadata>,
3404
3405    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3406}
3407
3408impl SanitizationResult {
3409    pub fn new() -> Self {
3410        std::default::Default::default()
3411    }
3412
3413    /// Sets the value of [filter_match_state][crate::model::SanitizationResult::filter_match_state].
3414    ///
3415    /// # Example
3416    /// ```ignore,no_run
3417    /// # use google_cloud_modelarmor_v1::model::SanitizationResult;
3418    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
3419    /// let x0 = SanitizationResult::new().set_filter_match_state(FilterMatchState::NoMatchFound);
3420    /// let x1 = SanitizationResult::new().set_filter_match_state(FilterMatchState::MatchFound);
3421    /// ```
3422    pub fn set_filter_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
3423        mut self,
3424        v: T,
3425    ) -> Self {
3426        self.filter_match_state = v.into();
3427        self
3428    }
3429
3430    /// Sets the value of [filter_results][crate::model::SanitizationResult::filter_results].
3431    ///
3432    /// # Example
3433    /// ```ignore,no_run
3434    /// # use google_cloud_modelarmor_v1::model::SanitizationResult;
3435    /// use google_cloud_modelarmor_v1::model::FilterResult;
3436    /// let x = SanitizationResult::new().set_filter_results([
3437    ///     ("key0", FilterResult::default()/* use setters */),
3438    ///     ("key1", FilterResult::default()/* use (different) setters */),
3439    /// ]);
3440    /// ```
3441    pub fn set_filter_results<T, K, V>(mut self, v: T) -> Self
3442    where
3443        T: std::iter::IntoIterator<Item = (K, V)>,
3444        K: std::convert::Into<std::string::String>,
3445        V: std::convert::Into<crate::model::FilterResult>,
3446    {
3447        use std::iter::Iterator;
3448        self.filter_results = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3449        self
3450    }
3451
3452    /// Sets the value of [invocation_result][crate::model::SanitizationResult::invocation_result].
3453    ///
3454    /// # Example
3455    /// ```ignore,no_run
3456    /// # use google_cloud_modelarmor_v1::model::SanitizationResult;
3457    /// use google_cloud_modelarmor_v1::model::InvocationResult;
3458    /// let x0 = SanitizationResult::new().set_invocation_result(InvocationResult::Success);
3459    /// let x1 = SanitizationResult::new().set_invocation_result(InvocationResult::Partial);
3460    /// let x2 = SanitizationResult::new().set_invocation_result(InvocationResult::Failure);
3461    /// ```
3462    pub fn set_invocation_result<T: std::convert::Into<crate::model::InvocationResult>>(
3463        mut self,
3464        v: T,
3465    ) -> Self {
3466        self.invocation_result = v.into();
3467        self
3468    }
3469
3470    /// Sets the value of [sanitization_metadata][crate::model::SanitizationResult::sanitization_metadata].
3471    ///
3472    /// # Example
3473    /// ```ignore,no_run
3474    /// # use google_cloud_modelarmor_v1::model::SanitizationResult;
3475    /// use google_cloud_modelarmor_v1::model::sanitization_result::SanitizationMetadata;
3476    /// let x = SanitizationResult::new().set_sanitization_metadata(SanitizationMetadata::default()/* use setters */);
3477    /// ```
3478    pub fn set_sanitization_metadata<T>(mut self, v: T) -> Self
3479    where
3480        T: std::convert::Into<crate::model::sanitization_result::SanitizationMetadata>,
3481    {
3482        self.sanitization_metadata = std::option::Option::Some(v.into());
3483        self
3484    }
3485
3486    /// Sets or clears the value of [sanitization_metadata][crate::model::SanitizationResult::sanitization_metadata].
3487    ///
3488    /// # Example
3489    /// ```ignore,no_run
3490    /// # use google_cloud_modelarmor_v1::model::SanitizationResult;
3491    /// use google_cloud_modelarmor_v1::model::sanitization_result::SanitizationMetadata;
3492    /// let x = SanitizationResult::new().set_or_clear_sanitization_metadata(Some(SanitizationMetadata::default()/* use setters */));
3493    /// let x = SanitizationResult::new().set_or_clear_sanitization_metadata(None::<SanitizationMetadata>);
3494    /// ```
3495    pub fn set_or_clear_sanitization_metadata<T>(mut self, v: std::option::Option<T>) -> Self
3496    where
3497        T: std::convert::Into<crate::model::sanitization_result::SanitizationMetadata>,
3498    {
3499        self.sanitization_metadata = v.map(|x| x.into());
3500        self
3501    }
3502}
3503
3504impl wkt::message::Message for SanitizationResult {
3505    fn typename() -> &'static str {
3506        "type.googleapis.com/google.cloud.modelarmor.v1.SanitizationResult"
3507    }
3508}
3509
3510/// Defines additional types related to [SanitizationResult].
3511pub mod sanitization_result {
3512    #[allow(unused_imports)]
3513    use super::*;
3514
3515    /// Message describing Sanitization metadata.
3516    #[derive(Clone, Default, PartialEq)]
3517    #[non_exhaustive]
3518    pub struct SanitizationMetadata {
3519        /// Error code if any.
3520        pub error_code: i64,
3521
3522        /// Error message if any.
3523        pub error_message: std::string::String,
3524
3525        /// Passthrough field defined in TemplateMetadata to indicate whether to
3526        /// ignore partial invocation failures.
3527        pub ignore_partial_invocation_failures: bool,
3528
3529        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3530    }
3531
3532    impl SanitizationMetadata {
3533        pub fn new() -> Self {
3534            std::default::Default::default()
3535        }
3536
3537        /// Sets the value of [error_code][crate::model::sanitization_result::SanitizationMetadata::error_code].
3538        ///
3539        /// # Example
3540        /// ```ignore,no_run
3541        /// # use google_cloud_modelarmor_v1::model::sanitization_result::SanitizationMetadata;
3542        /// let x = SanitizationMetadata::new().set_error_code(42);
3543        /// ```
3544        pub fn set_error_code<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3545            self.error_code = v.into();
3546            self
3547        }
3548
3549        /// Sets the value of [error_message][crate::model::sanitization_result::SanitizationMetadata::error_message].
3550        ///
3551        /// # Example
3552        /// ```ignore,no_run
3553        /// # use google_cloud_modelarmor_v1::model::sanitization_result::SanitizationMetadata;
3554        /// let x = SanitizationMetadata::new().set_error_message("example");
3555        /// ```
3556        pub fn set_error_message<T: std::convert::Into<std::string::String>>(
3557            mut self,
3558            v: T,
3559        ) -> Self {
3560            self.error_message = v.into();
3561            self
3562        }
3563
3564        /// Sets the value of [ignore_partial_invocation_failures][crate::model::sanitization_result::SanitizationMetadata::ignore_partial_invocation_failures].
3565        ///
3566        /// # Example
3567        /// ```ignore,no_run
3568        /// # use google_cloud_modelarmor_v1::model::sanitization_result::SanitizationMetadata;
3569        /// let x = SanitizationMetadata::new().set_ignore_partial_invocation_failures(true);
3570        /// ```
3571        pub fn set_ignore_partial_invocation_failures<T: std::convert::Into<bool>>(
3572            mut self,
3573            v: T,
3574        ) -> Self {
3575            self.ignore_partial_invocation_failures = v.into();
3576            self
3577        }
3578    }
3579
3580    impl wkt::message::Message for SanitizationMetadata {
3581        fn typename() -> &'static str {
3582            "type.googleapis.com/google.cloud.modelarmor.v1.SanitizationResult.SanitizationMetadata"
3583        }
3584    }
3585}
3586
3587/// Message for Enabling Multi Language Detection.
3588#[derive(Clone, Default, PartialEq)]
3589#[non_exhaustive]
3590pub struct MultiLanguageDetectionMetadata {
3591    /// Optional. Optional Source language of the user prompt.
3592    ///
3593    /// If multi-language detection is enabled but language is not set in that case
3594    /// we would automatically detect the source language.
3595    pub source_language: std::string::String,
3596
3597    /// Optional. Enable detection of multi-language prompts and responses.
3598    pub enable_multi_language_detection: bool,
3599
3600    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3601}
3602
3603impl MultiLanguageDetectionMetadata {
3604    pub fn new() -> Self {
3605        std::default::Default::default()
3606    }
3607
3608    /// Sets the value of [source_language][crate::model::MultiLanguageDetectionMetadata::source_language].
3609    ///
3610    /// # Example
3611    /// ```ignore,no_run
3612    /// # use google_cloud_modelarmor_v1::model::MultiLanguageDetectionMetadata;
3613    /// let x = MultiLanguageDetectionMetadata::new().set_source_language("example");
3614    /// ```
3615    pub fn set_source_language<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3616        self.source_language = v.into();
3617        self
3618    }
3619
3620    /// Sets the value of [enable_multi_language_detection][crate::model::MultiLanguageDetectionMetadata::enable_multi_language_detection].
3621    ///
3622    /// # Example
3623    /// ```ignore,no_run
3624    /// # use google_cloud_modelarmor_v1::model::MultiLanguageDetectionMetadata;
3625    /// let x = MultiLanguageDetectionMetadata::new().set_enable_multi_language_detection(true);
3626    /// ```
3627    pub fn set_enable_multi_language_detection<T: std::convert::Into<bool>>(
3628        mut self,
3629        v: T,
3630    ) -> Self {
3631        self.enable_multi_language_detection = v.into();
3632        self
3633    }
3634}
3635
3636impl wkt::message::Message for MultiLanguageDetectionMetadata {
3637    fn typename() -> &'static str {
3638        "type.googleapis.com/google.cloud.modelarmor.v1.MultiLanguageDetectionMetadata"
3639    }
3640}
3641
3642/// Filter Result obtained after Sanitization operations.
3643#[derive(Clone, Default, PartialEq)]
3644#[non_exhaustive]
3645pub struct FilterResult {
3646    /// Encapsulates one of responsible AI, Sensitive Data Protection, Prompt
3647    /// Injection and Jailbreak, Malicious URI, CSAM, Virus Scan related filter
3648    /// results.
3649    pub filter_result: std::option::Option<crate::model::filter_result::FilterResult>,
3650
3651    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3652}
3653
3654impl FilterResult {
3655    pub fn new() -> Self {
3656        std::default::Default::default()
3657    }
3658
3659    /// Sets the value of [filter_result][crate::model::FilterResult::filter_result].
3660    ///
3661    /// Note that all the setters affecting `filter_result` are mutually
3662    /// exclusive.
3663    ///
3664    /// # Example
3665    /// ```ignore,no_run
3666    /// # use google_cloud_modelarmor_v1::model::FilterResult;
3667    /// use google_cloud_modelarmor_v1::model::RaiFilterResult;
3668    /// let x = FilterResult::new().set_filter_result(Some(
3669    ///     google_cloud_modelarmor_v1::model::filter_result::FilterResult::RaiFilterResult(RaiFilterResult::default().into())));
3670    /// ```
3671    pub fn set_filter_result<
3672        T: std::convert::Into<std::option::Option<crate::model::filter_result::FilterResult>>,
3673    >(
3674        mut self,
3675        v: T,
3676    ) -> Self {
3677        self.filter_result = v.into();
3678        self
3679    }
3680
3681    /// The value of [filter_result][crate::model::FilterResult::filter_result]
3682    /// if it holds a `RaiFilterResult`, `None` if the field is not set or
3683    /// holds a different branch.
3684    pub fn rai_filter_result(
3685        &self,
3686    ) -> std::option::Option<&std::boxed::Box<crate::model::RaiFilterResult>> {
3687        #[allow(unreachable_patterns)]
3688        self.filter_result.as_ref().and_then(|v| match v {
3689            crate::model::filter_result::FilterResult::RaiFilterResult(v) => {
3690                std::option::Option::Some(v)
3691            }
3692            _ => std::option::Option::None,
3693        })
3694    }
3695
3696    /// Sets the value of [filter_result][crate::model::FilterResult::filter_result]
3697    /// to hold a `RaiFilterResult`.
3698    ///
3699    /// Note that all the setters affecting `filter_result` are
3700    /// mutually exclusive.
3701    ///
3702    /// # Example
3703    /// ```ignore,no_run
3704    /// # use google_cloud_modelarmor_v1::model::FilterResult;
3705    /// use google_cloud_modelarmor_v1::model::RaiFilterResult;
3706    /// let x = FilterResult::new().set_rai_filter_result(RaiFilterResult::default()/* use setters */);
3707    /// assert!(x.rai_filter_result().is_some());
3708    /// assert!(x.sdp_filter_result().is_none());
3709    /// assert!(x.pi_and_jailbreak_filter_result().is_none());
3710    /// assert!(x.malicious_uri_filter_result().is_none());
3711    /// assert!(x.csam_filter_filter_result().is_none());
3712    /// assert!(x.virus_scan_filter_result().is_none());
3713    /// ```
3714    pub fn set_rai_filter_result<
3715        T: std::convert::Into<std::boxed::Box<crate::model::RaiFilterResult>>,
3716    >(
3717        mut self,
3718        v: T,
3719    ) -> Self {
3720        self.filter_result = std::option::Option::Some(
3721            crate::model::filter_result::FilterResult::RaiFilterResult(v.into()),
3722        );
3723        self
3724    }
3725
3726    /// The value of [filter_result][crate::model::FilterResult::filter_result]
3727    /// if it holds a `SdpFilterResult`, `None` if the field is not set or
3728    /// holds a different branch.
3729    pub fn sdp_filter_result(
3730        &self,
3731    ) -> std::option::Option<&std::boxed::Box<crate::model::SdpFilterResult>> {
3732        #[allow(unreachable_patterns)]
3733        self.filter_result.as_ref().and_then(|v| match v {
3734            crate::model::filter_result::FilterResult::SdpFilterResult(v) => {
3735                std::option::Option::Some(v)
3736            }
3737            _ => std::option::Option::None,
3738        })
3739    }
3740
3741    /// Sets the value of [filter_result][crate::model::FilterResult::filter_result]
3742    /// to hold a `SdpFilterResult`.
3743    ///
3744    /// Note that all the setters affecting `filter_result` are
3745    /// mutually exclusive.
3746    ///
3747    /// # Example
3748    /// ```ignore,no_run
3749    /// # use google_cloud_modelarmor_v1::model::FilterResult;
3750    /// use google_cloud_modelarmor_v1::model::SdpFilterResult;
3751    /// let x = FilterResult::new().set_sdp_filter_result(SdpFilterResult::default()/* use setters */);
3752    /// assert!(x.sdp_filter_result().is_some());
3753    /// assert!(x.rai_filter_result().is_none());
3754    /// assert!(x.pi_and_jailbreak_filter_result().is_none());
3755    /// assert!(x.malicious_uri_filter_result().is_none());
3756    /// assert!(x.csam_filter_filter_result().is_none());
3757    /// assert!(x.virus_scan_filter_result().is_none());
3758    /// ```
3759    pub fn set_sdp_filter_result<
3760        T: std::convert::Into<std::boxed::Box<crate::model::SdpFilterResult>>,
3761    >(
3762        mut self,
3763        v: T,
3764    ) -> Self {
3765        self.filter_result = std::option::Option::Some(
3766            crate::model::filter_result::FilterResult::SdpFilterResult(v.into()),
3767        );
3768        self
3769    }
3770
3771    /// The value of [filter_result][crate::model::FilterResult::filter_result]
3772    /// if it holds a `PiAndJailbreakFilterResult`, `None` if the field is not set or
3773    /// holds a different branch.
3774    pub fn pi_and_jailbreak_filter_result(
3775        &self,
3776    ) -> std::option::Option<&std::boxed::Box<crate::model::PiAndJailbreakFilterResult>> {
3777        #[allow(unreachable_patterns)]
3778        self.filter_result.as_ref().and_then(|v| match v {
3779            crate::model::filter_result::FilterResult::PiAndJailbreakFilterResult(v) => {
3780                std::option::Option::Some(v)
3781            }
3782            _ => std::option::Option::None,
3783        })
3784    }
3785
3786    /// Sets the value of [filter_result][crate::model::FilterResult::filter_result]
3787    /// to hold a `PiAndJailbreakFilterResult`.
3788    ///
3789    /// Note that all the setters affecting `filter_result` are
3790    /// mutually exclusive.
3791    ///
3792    /// # Example
3793    /// ```ignore,no_run
3794    /// # use google_cloud_modelarmor_v1::model::FilterResult;
3795    /// use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterResult;
3796    /// let x = FilterResult::new().set_pi_and_jailbreak_filter_result(PiAndJailbreakFilterResult::default()/* use setters */);
3797    /// assert!(x.pi_and_jailbreak_filter_result().is_some());
3798    /// assert!(x.rai_filter_result().is_none());
3799    /// assert!(x.sdp_filter_result().is_none());
3800    /// assert!(x.malicious_uri_filter_result().is_none());
3801    /// assert!(x.csam_filter_filter_result().is_none());
3802    /// assert!(x.virus_scan_filter_result().is_none());
3803    /// ```
3804    pub fn set_pi_and_jailbreak_filter_result<
3805        T: std::convert::Into<std::boxed::Box<crate::model::PiAndJailbreakFilterResult>>,
3806    >(
3807        mut self,
3808        v: T,
3809    ) -> Self {
3810        self.filter_result = std::option::Option::Some(
3811            crate::model::filter_result::FilterResult::PiAndJailbreakFilterResult(v.into()),
3812        );
3813        self
3814    }
3815
3816    /// The value of [filter_result][crate::model::FilterResult::filter_result]
3817    /// if it holds a `MaliciousUriFilterResult`, `None` if the field is not set or
3818    /// holds a different branch.
3819    pub fn malicious_uri_filter_result(
3820        &self,
3821    ) -> std::option::Option<&std::boxed::Box<crate::model::MaliciousUriFilterResult>> {
3822        #[allow(unreachable_patterns)]
3823        self.filter_result.as_ref().and_then(|v| match v {
3824            crate::model::filter_result::FilterResult::MaliciousUriFilterResult(v) => {
3825                std::option::Option::Some(v)
3826            }
3827            _ => std::option::Option::None,
3828        })
3829    }
3830
3831    /// Sets the value of [filter_result][crate::model::FilterResult::filter_result]
3832    /// to hold a `MaliciousUriFilterResult`.
3833    ///
3834    /// Note that all the setters affecting `filter_result` are
3835    /// mutually exclusive.
3836    ///
3837    /// # Example
3838    /// ```ignore,no_run
3839    /// # use google_cloud_modelarmor_v1::model::FilterResult;
3840    /// use google_cloud_modelarmor_v1::model::MaliciousUriFilterResult;
3841    /// let x = FilterResult::new().set_malicious_uri_filter_result(MaliciousUriFilterResult::default()/* use setters */);
3842    /// assert!(x.malicious_uri_filter_result().is_some());
3843    /// assert!(x.rai_filter_result().is_none());
3844    /// assert!(x.sdp_filter_result().is_none());
3845    /// assert!(x.pi_and_jailbreak_filter_result().is_none());
3846    /// assert!(x.csam_filter_filter_result().is_none());
3847    /// assert!(x.virus_scan_filter_result().is_none());
3848    /// ```
3849    pub fn set_malicious_uri_filter_result<
3850        T: std::convert::Into<std::boxed::Box<crate::model::MaliciousUriFilterResult>>,
3851    >(
3852        mut self,
3853        v: T,
3854    ) -> Self {
3855        self.filter_result = std::option::Option::Some(
3856            crate::model::filter_result::FilterResult::MaliciousUriFilterResult(v.into()),
3857        );
3858        self
3859    }
3860
3861    /// The value of [filter_result][crate::model::FilterResult::filter_result]
3862    /// if it holds a `CsamFilterFilterResult`, `None` if the field is not set or
3863    /// holds a different branch.
3864    pub fn csam_filter_filter_result(
3865        &self,
3866    ) -> std::option::Option<&std::boxed::Box<crate::model::CsamFilterResult>> {
3867        #[allow(unreachable_patterns)]
3868        self.filter_result.as_ref().and_then(|v| match v {
3869            crate::model::filter_result::FilterResult::CsamFilterFilterResult(v) => {
3870                std::option::Option::Some(v)
3871            }
3872            _ => std::option::Option::None,
3873        })
3874    }
3875
3876    /// Sets the value of [filter_result][crate::model::FilterResult::filter_result]
3877    /// to hold a `CsamFilterFilterResult`.
3878    ///
3879    /// Note that all the setters affecting `filter_result` are
3880    /// mutually exclusive.
3881    ///
3882    /// # Example
3883    /// ```ignore,no_run
3884    /// # use google_cloud_modelarmor_v1::model::FilterResult;
3885    /// use google_cloud_modelarmor_v1::model::CsamFilterResult;
3886    /// let x = FilterResult::new().set_csam_filter_filter_result(CsamFilterResult::default()/* use setters */);
3887    /// assert!(x.csam_filter_filter_result().is_some());
3888    /// assert!(x.rai_filter_result().is_none());
3889    /// assert!(x.sdp_filter_result().is_none());
3890    /// assert!(x.pi_and_jailbreak_filter_result().is_none());
3891    /// assert!(x.malicious_uri_filter_result().is_none());
3892    /// assert!(x.virus_scan_filter_result().is_none());
3893    /// ```
3894    pub fn set_csam_filter_filter_result<
3895        T: std::convert::Into<std::boxed::Box<crate::model::CsamFilterResult>>,
3896    >(
3897        mut self,
3898        v: T,
3899    ) -> Self {
3900        self.filter_result = std::option::Option::Some(
3901            crate::model::filter_result::FilterResult::CsamFilterFilterResult(v.into()),
3902        );
3903        self
3904    }
3905
3906    /// The value of [filter_result][crate::model::FilterResult::filter_result]
3907    /// if it holds a `VirusScanFilterResult`, `None` if the field is not set or
3908    /// holds a different branch.
3909    pub fn virus_scan_filter_result(
3910        &self,
3911    ) -> std::option::Option<&std::boxed::Box<crate::model::VirusScanFilterResult>> {
3912        #[allow(unreachable_patterns)]
3913        self.filter_result.as_ref().and_then(|v| match v {
3914            crate::model::filter_result::FilterResult::VirusScanFilterResult(v) => {
3915                std::option::Option::Some(v)
3916            }
3917            _ => std::option::Option::None,
3918        })
3919    }
3920
3921    /// Sets the value of [filter_result][crate::model::FilterResult::filter_result]
3922    /// to hold a `VirusScanFilterResult`.
3923    ///
3924    /// Note that all the setters affecting `filter_result` are
3925    /// mutually exclusive.
3926    ///
3927    /// # Example
3928    /// ```ignore,no_run
3929    /// # use google_cloud_modelarmor_v1::model::FilterResult;
3930    /// use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
3931    /// let x = FilterResult::new().set_virus_scan_filter_result(VirusScanFilterResult::default()/* use setters */);
3932    /// assert!(x.virus_scan_filter_result().is_some());
3933    /// assert!(x.rai_filter_result().is_none());
3934    /// assert!(x.sdp_filter_result().is_none());
3935    /// assert!(x.pi_and_jailbreak_filter_result().is_none());
3936    /// assert!(x.malicious_uri_filter_result().is_none());
3937    /// assert!(x.csam_filter_filter_result().is_none());
3938    /// ```
3939    pub fn set_virus_scan_filter_result<
3940        T: std::convert::Into<std::boxed::Box<crate::model::VirusScanFilterResult>>,
3941    >(
3942        mut self,
3943        v: T,
3944    ) -> Self {
3945        self.filter_result = std::option::Option::Some(
3946            crate::model::filter_result::FilterResult::VirusScanFilterResult(v.into()),
3947        );
3948        self
3949    }
3950}
3951
3952impl wkt::message::Message for FilterResult {
3953    fn typename() -> &'static str {
3954        "type.googleapis.com/google.cloud.modelarmor.v1.FilterResult"
3955    }
3956}
3957
3958/// Defines additional types related to [FilterResult].
3959pub mod filter_result {
3960    #[allow(unused_imports)]
3961    use super::*;
3962
3963    /// Encapsulates one of responsible AI, Sensitive Data Protection, Prompt
3964    /// Injection and Jailbreak, Malicious URI, CSAM, Virus Scan related filter
3965    /// results.
3966    #[derive(Clone, Debug, PartialEq)]
3967    #[non_exhaustive]
3968    pub enum FilterResult {
3969        /// Responsible AI filter results.
3970        RaiFilterResult(std::boxed::Box<crate::model::RaiFilterResult>),
3971        /// Sensitive Data Protection results.
3972        SdpFilterResult(std::boxed::Box<crate::model::SdpFilterResult>),
3973        /// Prompt injection and Jailbreak filter results.
3974        PiAndJailbreakFilterResult(std::boxed::Box<crate::model::PiAndJailbreakFilterResult>),
3975        /// Malicious URI filter results.
3976        MaliciousUriFilterResult(std::boxed::Box<crate::model::MaliciousUriFilterResult>),
3977        /// CSAM filter results.
3978        CsamFilterFilterResult(std::boxed::Box<crate::model::CsamFilterResult>),
3979        /// Virus scan results.
3980        VirusScanFilterResult(std::boxed::Box<crate::model::VirusScanFilterResult>),
3981    }
3982}
3983
3984/// Responsible AI Result.
3985#[derive(Clone, Default, PartialEq)]
3986#[non_exhaustive]
3987pub struct RaiFilterResult {
3988    /// Output only. Reports whether the RAI filter was successfully executed or
3989    /// not.
3990    pub execution_state: crate::model::FilterExecutionState,
3991
3992    /// Optional messages corresponding to the result.
3993    /// A message can provide warnings or error details.
3994    /// For example, if execution state is skipped then this field provides
3995    /// related reason/explanation.
3996    pub message_items: std::vec::Vec<crate::model::MessageItem>,
3997
3998    /// Output only. Overall filter match state for RAI.
3999    /// Value is MATCH_FOUND if at least one RAI filter confidence level is
4000    /// equal to or higher than the confidence level defined in configuration.
4001    pub match_state: crate::model::FilterMatchState,
4002
4003    /// The map of RAI filter results where key is RAI filter type - either of
4004    /// "sexually_explicit", "hate_speech", "harassment", "dangerous".
4005    pub rai_filter_type_results: std::collections::HashMap<
4006        std::string::String,
4007        crate::model::rai_filter_result::RaiFilterTypeResult,
4008    >,
4009
4010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4011}
4012
4013impl RaiFilterResult {
4014    pub fn new() -> Self {
4015        std::default::Default::default()
4016    }
4017
4018    /// Sets the value of [execution_state][crate::model::RaiFilterResult::execution_state].
4019    ///
4020    /// # Example
4021    /// ```ignore,no_run
4022    /// # use google_cloud_modelarmor_v1::model::RaiFilterResult;
4023    /// use google_cloud_modelarmor_v1::model::FilterExecutionState;
4024    /// let x0 = RaiFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSuccess);
4025    /// let x1 = RaiFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSkipped);
4026    /// ```
4027    pub fn set_execution_state<T: std::convert::Into<crate::model::FilterExecutionState>>(
4028        mut self,
4029        v: T,
4030    ) -> Self {
4031        self.execution_state = v.into();
4032        self
4033    }
4034
4035    /// Sets the value of [message_items][crate::model::RaiFilterResult::message_items].
4036    ///
4037    /// # Example
4038    /// ```ignore,no_run
4039    /// # use google_cloud_modelarmor_v1::model::RaiFilterResult;
4040    /// use google_cloud_modelarmor_v1::model::MessageItem;
4041    /// let x = RaiFilterResult::new()
4042    ///     .set_message_items([
4043    ///         MessageItem::default()/* use setters */,
4044    ///         MessageItem::default()/* use (different) setters */,
4045    ///     ]);
4046    /// ```
4047    pub fn set_message_items<T, V>(mut self, v: T) -> Self
4048    where
4049        T: std::iter::IntoIterator<Item = V>,
4050        V: std::convert::Into<crate::model::MessageItem>,
4051    {
4052        use std::iter::Iterator;
4053        self.message_items = v.into_iter().map(|i| i.into()).collect();
4054        self
4055    }
4056
4057    /// Sets the value of [match_state][crate::model::RaiFilterResult::match_state].
4058    ///
4059    /// # Example
4060    /// ```ignore,no_run
4061    /// # use google_cloud_modelarmor_v1::model::RaiFilterResult;
4062    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
4063    /// let x0 = RaiFilterResult::new().set_match_state(FilterMatchState::NoMatchFound);
4064    /// let x1 = RaiFilterResult::new().set_match_state(FilterMatchState::MatchFound);
4065    /// ```
4066    pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
4067        mut self,
4068        v: T,
4069    ) -> Self {
4070        self.match_state = v.into();
4071        self
4072    }
4073
4074    /// Sets the value of [rai_filter_type_results][crate::model::RaiFilterResult::rai_filter_type_results].
4075    ///
4076    /// # Example
4077    /// ```ignore,no_run
4078    /// # use google_cloud_modelarmor_v1::model::RaiFilterResult;
4079    /// use google_cloud_modelarmor_v1::model::rai_filter_result::RaiFilterTypeResult;
4080    /// let x = RaiFilterResult::new().set_rai_filter_type_results([
4081    ///     ("key0", RaiFilterTypeResult::default()/* use setters */),
4082    ///     ("key1", RaiFilterTypeResult::default()/* use (different) setters */),
4083    /// ]);
4084    /// ```
4085    pub fn set_rai_filter_type_results<T, K, V>(mut self, v: T) -> Self
4086    where
4087        T: std::iter::IntoIterator<Item = (K, V)>,
4088        K: std::convert::Into<std::string::String>,
4089        V: std::convert::Into<crate::model::rai_filter_result::RaiFilterTypeResult>,
4090    {
4091        use std::iter::Iterator;
4092        self.rai_filter_type_results = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4093        self
4094    }
4095}
4096
4097impl wkt::message::Message for RaiFilterResult {
4098    fn typename() -> &'static str {
4099        "type.googleapis.com/google.cloud.modelarmor.v1.RaiFilterResult"
4100    }
4101}
4102
4103/// Defines additional types related to [RaiFilterResult].
4104pub mod rai_filter_result {
4105    #[allow(unused_imports)]
4106    use super::*;
4107
4108    /// Detailed Filter result for each of the responsible AI Filter Types.
4109    #[derive(Clone, Default, PartialEq)]
4110    #[non_exhaustive]
4111    pub struct RaiFilterTypeResult {
4112        /// Type of responsible AI filter.
4113        pub filter_type: crate::model::RaiFilterType,
4114
4115        /// Confidence level identified for this RAI filter.
4116        pub confidence_level: crate::model::DetectionConfidenceLevel,
4117
4118        /// Output only. Match state for this RAI filter.
4119        pub match_state: crate::model::FilterMatchState,
4120
4121        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4122    }
4123
4124    impl RaiFilterTypeResult {
4125        pub fn new() -> Self {
4126            std::default::Default::default()
4127        }
4128
4129        /// Sets the value of [filter_type][crate::model::rai_filter_result::RaiFilterTypeResult::filter_type].
4130        ///
4131        /// # Example
4132        /// ```ignore,no_run
4133        /// # use google_cloud_modelarmor_v1::model::rai_filter_result::RaiFilterTypeResult;
4134        /// use google_cloud_modelarmor_v1::model::RaiFilterType;
4135        /// let x0 = RaiFilterTypeResult::new().set_filter_type(RaiFilterType::SexuallyExplicit);
4136        /// let x1 = RaiFilterTypeResult::new().set_filter_type(RaiFilterType::HateSpeech);
4137        /// let x2 = RaiFilterTypeResult::new().set_filter_type(RaiFilterType::Harassment);
4138        /// ```
4139        pub fn set_filter_type<T: std::convert::Into<crate::model::RaiFilterType>>(
4140            mut self,
4141            v: T,
4142        ) -> Self {
4143            self.filter_type = v.into();
4144            self
4145        }
4146
4147        /// Sets the value of [confidence_level][crate::model::rai_filter_result::RaiFilterTypeResult::confidence_level].
4148        ///
4149        /// # Example
4150        /// ```ignore,no_run
4151        /// # use google_cloud_modelarmor_v1::model::rai_filter_result::RaiFilterTypeResult;
4152        /// use google_cloud_modelarmor_v1::model::DetectionConfidenceLevel;
4153        /// let x0 = RaiFilterTypeResult::new().set_confidence_level(DetectionConfidenceLevel::LowAndAbove);
4154        /// let x1 = RaiFilterTypeResult::new().set_confidence_level(DetectionConfidenceLevel::MediumAndAbove);
4155        /// let x2 = RaiFilterTypeResult::new().set_confidence_level(DetectionConfidenceLevel::High);
4156        /// ```
4157        pub fn set_confidence_level<
4158            T: std::convert::Into<crate::model::DetectionConfidenceLevel>,
4159        >(
4160            mut self,
4161            v: T,
4162        ) -> Self {
4163            self.confidence_level = v.into();
4164            self
4165        }
4166
4167        /// Sets the value of [match_state][crate::model::rai_filter_result::RaiFilterTypeResult::match_state].
4168        ///
4169        /// # Example
4170        /// ```ignore,no_run
4171        /// # use google_cloud_modelarmor_v1::model::rai_filter_result::RaiFilterTypeResult;
4172        /// use google_cloud_modelarmor_v1::model::FilterMatchState;
4173        /// let x0 = RaiFilterTypeResult::new().set_match_state(FilterMatchState::NoMatchFound);
4174        /// let x1 = RaiFilterTypeResult::new().set_match_state(FilterMatchState::MatchFound);
4175        /// ```
4176        pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
4177            mut self,
4178            v: T,
4179        ) -> Self {
4180            self.match_state = v.into();
4181            self
4182        }
4183    }
4184
4185    impl wkt::message::Message for RaiFilterTypeResult {
4186        fn typename() -> &'static str {
4187            "type.googleapis.com/google.cloud.modelarmor.v1.RaiFilterResult.RaiFilterTypeResult"
4188        }
4189    }
4190}
4191
4192/// Sensitive Data Protection filter result.
4193#[derive(Clone, Default, PartialEq)]
4194#[non_exhaustive]
4195pub struct SdpFilterResult {
4196    /// Either of Sensitive Data Protection Inspect result or Deidentify result.
4197    pub result: std::option::Option<crate::model::sdp_filter_result::Result>,
4198
4199    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4200}
4201
4202impl SdpFilterResult {
4203    pub fn new() -> Self {
4204        std::default::Default::default()
4205    }
4206
4207    /// Sets the value of [result][crate::model::SdpFilterResult::result].
4208    ///
4209    /// Note that all the setters affecting `result` are mutually
4210    /// exclusive.
4211    ///
4212    /// # Example
4213    /// ```ignore,no_run
4214    /// # use google_cloud_modelarmor_v1::model::SdpFilterResult;
4215    /// use google_cloud_modelarmor_v1::model::SdpInspectResult;
4216    /// let x = SdpFilterResult::new().set_result(Some(
4217    ///     google_cloud_modelarmor_v1::model::sdp_filter_result::Result::InspectResult(SdpInspectResult::default().into())));
4218    /// ```
4219    pub fn set_result<
4220        T: std::convert::Into<std::option::Option<crate::model::sdp_filter_result::Result>>,
4221    >(
4222        mut self,
4223        v: T,
4224    ) -> Self {
4225        self.result = v.into();
4226        self
4227    }
4228
4229    /// The value of [result][crate::model::SdpFilterResult::result]
4230    /// if it holds a `InspectResult`, `None` if the field is not set or
4231    /// holds a different branch.
4232    pub fn inspect_result(
4233        &self,
4234    ) -> std::option::Option<&std::boxed::Box<crate::model::SdpInspectResult>> {
4235        #[allow(unreachable_patterns)]
4236        self.result.as_ref().and_then(|v| match v {
4237            crate::model::sdp_filter_result::Result::InspectResult(v) => {
4238                std::option::Option::Some(v)
4239            }
4240            _ => std::option::Option::None,
4241        })
4242    }
4243
4244    /// Sets the value of [result][crate::model::SdpFilterResult::result]
4245    /// to hold a `InspectResult`.
4246    ///
4247    /// Note that all the setters affecting `result` are
4248    /// mutually exclusive.
4249    ///
4250    /// # Example
4251    /// ```ignore,no_run
4252    /// # use google_cloud_modelarmor_v1::model::SdpFilterResult;
4253    /// use google_cloud_modelarmor_v1::model::SdpInspectResult;
4254    /// let x = SdpFilterResult::new().set_inspect_result(SdpInspectResult::default()/* use setters */);
4255    /// assert!(x.inspect_result().is_some());
4256    /// assert!(x.deidentify_result().is_none());
4257    /// ```
4258    pub fn set_inspect_result<
4259        T: std::convert::Into<std::boxed::Box<crate::model::SdpInspectResult>>,
4260    >(
4261        mut self,
4262        v: T,
4263    ) -> Self {
4264        self.result = std::option::Option::Some(
4265            crate::model::sdp_filter_result::Result::InspectResult(v.into()),
4266        );
4267        self
4268    }
4269
4270    /// The value of [result][crate::model::SdpFilterResult::result]
4271    /// if it holds a `DeidentifyResult`, `None` if the field is not set or
4272    /// holds a different branch.
4273    pub fn deidentify_result(
4274        &self,
4275    ) -> std::option::Option<&std::boxed::Box<crate::model::SdpDeidentifyResult>> {
4276        #[allow(unreachable_patterns)]
4277        self.result.as_ref().and_then(|v| match v {
4278            crate::model::sdp_filter_result::Result::DeidentifyResult(v) => {
4279                std::option::Option::Some(v)
4280            }
4281            _ => std::option::Option::None,
4282        })
4283    }
4284
4285    /// Sets the value of [result][crate::model::SdpFilterResult::result]
4286    /// to hold a `DeidentifyResult`.
4287    ///
4288    /// Note that all the setters affecting `result` are
4289    /// mutually exclusive.
4290    ///
4291    /// # Example
4292    /// ```ignore,no_run
4293    /// # use google_cloud_modelarmor_v1::model::SdpFilterResult;
4294    /// use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4295    /// let x = SdpFilterResult::new().set_deidentify_result(SdpDeidentifyResult::default()/* use setters */);
4296    /// assert!(x.deidentify_result().is_some());
4297    /// assert!(x.inspect_result().is_none());
4298    /// ```
4299    pub fn set_deidentify_result<
4300        T: std::convert::Into<std::boxed::Box<crate::model::SdpDeidentifyResult>>,
4301    >(
4302        mut self,
4303        v: T,
4304    ) -> Self {
4305        self.result = std::option::Option::Some(
4306            crate::model::sdp_filter_result::Result::DeidentifyResult(v.into()),
4307        );
4308        self
4309    }
4310}
4311
4312impl wkt::message::Message for SdpFilterResult {
4313    fn typename() -> &'static str {
4314        "type.googleapis.com/google.cloud.modelarmor.v1.SdpFilterResult"
4315    }
4316}
4317
4318/// Defines additional types related to [SdpFilterResult].
4319pub mod sdp_filter_result {
4320    #[allow(unused_imports)]
4321    use super::*;
4322
4323    /// Either of Sensitive Data Protection Inspect result or Deidentify result.
4324    #[derive(Clone, Debug, PartialEq)]
4325    #[non_exhaustive]
4326    pub enum Result {
4327        /// Sensitive Data Protection Inspection result if inspection is performed.
4328        InspectResult(std::boxed::Box<crate::model::SdpInspectResult>),
4329        /// Sensitive Data Protection Deidentification result if deidentification is
4330        /// performed.
4331        DeidentifyResult(std::boxed::Box<crate::model::SdpDeidentifyResult>),
4332    }
4333}
4334
4335/// Sensitive Data Protection Inspection Result.
4336#[derive(Clone, Default, PartialEq)]
4337#[non_exhaustive]
4338pub struct SdpInspectResult {
4339    /// Output only. Reports whether Sensitive Data Protection inspection was
4340    /// successfully executed or not.
4341    pub execution_state: crate::model::FilterExecutionState,
4342
4343    /// Optional messages corresponding to the result.
4344    /// A message can provide warnings or error details.
4345    /// For example, if execution state is skipped then this field provides
4346    /// related reason/explanation.
4347    pub message_items: std::vec::Vec<crate::model::MessageItem>,
4348
4349    /// Output only. Match state for SDP Inspection.
4350    /// Value is MATCH_FOUND if at least one Sensitive Data Protection finding is
4351    /// identified.
4352    pub match_state: crate::model::FilterMatchState,
4353
4354    /// List of Sensitive Data Protection findings.
4355    pub findings: std::vec::Vec<crate::model::SdpFinding>,
4356
4357    /// If true, then there is possibility that more findings were identified and
4358    /// the findings returned are a subset of all findings. The findings
4359    /// list might be truncated because the input items were too large, or because
4360    /// the server reached the maximum amount of resources allowed for a single API
4361    /// call.
4362    pub findings_truncated: bool,
4363
4364    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4365}
4366
4367impl SdpInspectResult {
4368    pub fn new() -> Self {
4369        std::default::Default::default()
4370    }
4371
4372    /// Sets the value of [execution_state][crate::model::SdpInspectResult::execution_state].
4373    ///
4374    /// # Example
4375    /// ```ignore,no_run
4376    /// # use google_cloud_modelarmor_v1::model::SdpInspectResult;
4377    /// use google_cloud_modelarmor_v1::model::FilterExecutionState;
4378    /// let x0 = SdpInspectResult::new().set_execution_state(FilterExecutionState::ExecutionSuccess);
4379    /// let x1 = SdpInspectResult::new().set_execution_state(FilterExecutionState::ExecutionSkipped);
4380    /// ```
4381    pub fn set_execution_state<T: std::convert::Into<crate::model::FilterExecutionState>>(
4382        mut self,
4383        v: T,
4384    ) -> Self {
4385        self.execution_state = v.into();
4386        self
4387    }
4388
4389    /// Sets the value of [message_items][crate::model::SdpInspectResult::message_items].
4390    ///
4391    /// # Example
4392    /// ```ignore,no_run
4393    /// # use google_cloud_modelarmor_v1::model::SdpInspectResult;
4394    /// use google_cloud_modelarmor_v1::model::MessageItem;
4395    /// let x = SdpInspectResult::new()
4396    ///     .set_message_items([
4397    ///         MessageItem::default()/* use setters */,
4398    ///         MessageItem::default()/* use (different) setters */,
4399    ///     ]);
4400    /// ```
4401    pub fn set_message_items<T, V>(mut self, v: T) -> Self
4402    where
4403        T: std::iter::IntoIterator<Item = V>,
4404        V: std::convert::Into<crate::model::MessageItem>,
4405    {
4406        use std::iter::Iterator;
4407        self.message_items = v.into_iter().map(|i| i.into()).collect();
4408        self
4409    }
4410
4411    /// Sets the value of [match_state][crate::model::SdpInspectResult::match_state].
4412    ///
4413    /// # Example
4414    /// ```ignore,no_run
4415    /// # use google_cloud_modelarmor_v1::model::SdpInspectResult;
4416    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
4417    /// let x0 = SdpInspectResult::new().set_match_state(FilterMatchState::NoMatchFound);
4418    /// let x1 = SdpInspectResult::new().set_match_state(FilterMatchState::MatchFound);
4419    /// ```
4420    pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
4421        mut self,
4422        v: T,
4423    ) -> Self {
4424        self.match_state = v.into();
4425        self
4426    }
4427
4428    /// Sets the value of [findings][crate::model::SdpInspectResult::findings].
4429    ///
4430    /// # Example
4431    /// ```ignore,no_run
4432    /// # use google_cloud_modelarmor_v1::model::SdpInspectResult;
4433    /// use google_cloud_modelarmor_v1::model::SdpFinding;
4434    /// let x = SdpInspectResult::new()
4435    ///     .set_findings([
4436    ///         SdpFinding::default()/* use setters */,
4437    ///         SdpFinding::default()/* use (different) setters */,
4438    ///     ]);
4439    /// ```
4440    pub fn set_findings<T, V>(mut self, v: T) -> Self
4441    where
4442        T: std::iter::IntoIterator<Item = V>,
4443        V: std::convert::Into<crate::model::SdpFinding>,
4444    {
4445        use std::iter::Iterator;
4446        self.findings = v.into_iter().map(|i| i.into()).collect();
4447        self
4448    }
4449
4450    /// Sets the value of [findings_truncated][crate::model::SdpInspectResult::findings_truncated].
4451    ///
4452    /// # Example
4453    /// ```ignore,no_run
4454    /// # use google_cloud_modelarmor_v1::model::SdpInspectResult;
4455    /// let x = SdpInspectResult::new().set_findings_truncated(true);
4456    /// ```
4457    pub fn set_findings_truncated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4458        self.findings_truncated = v.into();
4459        self
4460    }
4461}
4462
4463impl wkt::message::Message for SdpInspectResult {
4464    fn typename() -> &'static str {
4465        "type.googleapis.com/google.cloud.modelarmor.v1.SdpInspectResult"
4466    }
4467}
4468
4469/// Represents Data item
4470#[derive(Clone, Default, PartialEq)]
4471#[non_exhaustive]
4472pub struct DataItem {
4473    /// Either of text or bytes data.
4474    pub data_item: std::option::Option<crate::model::data_item::DataItem>,
4475
4476    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4477}
4478
4479impl DataItem {
4480    pub fn new() -> Self {
4481        std::default::Default::default()
4482    }
4483
4484    /// Sets the value of [data_item][crate::model::DataItem::data_item].
4485    ///
4486    /// Note that all the setters affecting `data_item` are mutually
4487    /// exclusive.
4488    ///
4489    /// # Example
4490    /// ```ignore,no_run
4491    /// # use google_cloud_modelarmor_v1::model::DataItem;
4492    /// use google_cloud_modelarmor_v1::model::data_item::DataItem as DataItemOneOf;
4493    /// let x = DataItem::new().set_data_item(Some(DataItemOneOf::Text("example".to_string())));
4494    /// ```
4495    pub fn set_data_item<
4496        T: std::convert::Into<std::option::Option<crate::model::data_item::DataItem>>,
4497    >(
4498        mut self,
4499        v: T,
4500    ) -> Self {
4501        self.data_item = v.into();
4502        self
4503    }
4504
4505    /// The value of [data_item][crate::model::DataItem::data_item]
4506    /// if it holds a `Text`, `None` if the field is not set or
4507    /// holds a different branch.
4508    pub fn text(&self) -> std::option::Option<&std::string::String> {
4509        #[allow(unreachable_patterns)]
4510        self.data_item.as_ref().and_then(|v| match v {
4511            crate::model::data_item::DataItem::Text(v) => std::option::Option::Some(v),
4512            _ => std::option::Option::None,
4513        })
4514    }
4515
4516    /// Sets the value of [data_item][crate::model::DataItem::data_item]
4517    /// to hold a `Text`.
4518    ///
4519    /// Note that all the setters affecting `data_item` are
4520    /// mutually exclusive.
4521    ///
4522    /// # Example
4523    /// ```ignore,no_run
4524    /// # use google_cloud_modelarmor_v1::model::DataItem;
4525    /// let x = DataItem::new().set_text("example");
4526    /// assert!(x.text().is_some());
4527    /// assert!(x.byte_item().is_none());
4528    /// ```
4529    pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4530        self.data_item =
4531            std::option::Option::Some(crate::model::data_item::DataItem::Text(v.into()));
4532        self
4533    }
4534
4535    /// The value of [data_item][crate::model::DataItem::data_item]
4536    /// if it holds a `ByteItem`, `None` if the field is not set or
4537    /// holds a different branch.
4538    pub fn byte_item(&self) -> std::option::Option<&std::boxed::Box<crate::model::ByteDataItem>> {
4539        #[allow(unreachable_patterns)]
4540        self.data_item.as_ref().and_then(|v| match v {
4541            crate::model::data_item::DataItem::ByteItem(v) => std::option::Option::Some(v),
4542            _ => std::option::Option::None,
4543        })
4544    }
4545
4546    /// Sets the value of [data_item][crate::model::DataItem::data_item]
4547    /// to hold a `ByteItem`.
4548    ///
4549    /// Note that all the setters affecting `data_item` are
4550    /// mutually exclusive.
4551    ///
4552    /// # Example
4553    /// ```ignore,no_run
4554    /// # use google_cloud_modelarmor_v1::model::DataItem;
4555    /// use google_cloud_modelarmor_v1::model::ByteDataItem;
4556    /// let x = DataItem::new().set_byte_item(ByteDataItem::default()/* use setters */);
4557    /// assert!(x.byte_item().is_some());
4558    /// assert!(x.text().is_none());
4559    /// ```
4560    pub fn set_byte_item<T: std::convert::Into<std::boxed::Box<crate::model::ByteDataItem>>>(
4561        mut self,
4562        v: T,
4563    ) -> Self {
4564        self.data_item =
4565            std::option::Option::Some(crate::model::data_item::DataItem::ByteItem(v.into()));
4566        self
4567    }
4568}
4569
4570impl wkt::message::Message for DataItem {
4571    fn typename() -> &'static str {
4572        "type.googleapis.com/google.cloud.modelarmor.v1.DataItem"
4573    }
4574}
4575
4576/// Defines additional types related to [DataItem].
4577pub mod data_item {
4578    #[allow(unused_imports)]
4579    use super::*;
4580
4581    /// Either of text or bytes data.
4582    #[derive(Clone, Debug, PartialEq)]
4583    #[non_exhaustive]
4584    pub enum DataItem {
4585        /// Plaintext string data for sanitization.
4586        Text(std::string::String),
4587        /// Data provided in the form of bytes.
4588        ByteItem(std::boxed::Box<crate::model::ByteDataItem>),
4589    }
4590}
4591
4592/// Represents Byte Data item.
4593#[derive(Clone, Default, PartialEq)]
4594#[non_exhaustive]
4595pub struct ByteDataItem {
4596    /// Required. The type of byte data
4597    pub byte_data_type: crate::model::byte_data_item::ByteItemType,
4598
4599    /// Required. Bytes Data
4600    pub byte_data: ::bytes::Bytes,
4601
4602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4603}
4604
4605impl ByteDataItem {
4606    pub fn new() -> Self {
4607        std::default::Default::default()
4608    }
4609
4610    /// Sets the value of [byte_data_type][crate::model::ByteDataItem::byte_data_type].
4611    ///
4612    /// # Example
4613    /// ```ignore,no_run
4614    /// # use google_cloud_modelarmor_v1::model::ByteDataItem;
4615    /// use google_cloud_modelarmor_v1::model::byte_data_item::ByteItemType;
4616    /// let x0 = ByteDataItem::new().set_byte_data_type(ByteItemType::PlaintextUtf8);
4617    /// let x1 = ByteDataItem::new().set_byte_data_type(ByteItemType::Pdf);
4618    /// let x2 = ByteDataItem::new().set_byte_data_type(ByteItemType::WordDocument);
4619    /// ```
4620    pub fn set_byte_data_type<T: std::convert::Into<crate::model::byte_data_item::ByteItemType>>(
4621        mut self,
4622        v: T,
4623    ) -> Self {
4624        self.byte_data_type = v.into();
4625        self
4626    }
4627
4628    /// Sets the value of [byte_data][crate::model::ByteDataItem::byte_data].
4629    ///
4630    /// # Example
4631    /// ```ignore,no_run
4632    /// # use google_cloud_modelarmor_v1::model::ByteDataItem;
4633    /// let x = ByteDataItem::new().set_byte_data(bytes::Bytes::from_static(b"example"));
4634    /// ```
4635    pub fn set_byte_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4636        self.byte_data = v.into();
4637        self
4638    }
4639}
4640
4641impl wkt::message::Message for ByteDataItem {
4642    fn typename() -> &'static str {
4643        "type.googleapis.com/google.cloud.modelarmor.v1.ByteDataItem"
4644    }
4645}
4646
4647/// Defines additional types related to [ByteDataItem].
4648pub mod byte_data_item {
4649    #[allow(unused_imports)]
4650    use super::*;
4651
4652    /// Option to specify the type of byte data.
4653    ///
4654    /// # Working with unknown values
4655    ///
4656    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4657    /// additional enum variants at any time. Adding new variants is not considered
4658    /// a breaking change. Applications should write their code in anticipation of:
4659    ///
4660    /// - New values appearing in future releases of the client library, **and**
4661    /// - New values received dynamically, without application changes.
4662    ///
4663    /// Please consult the [Working with enums] section in the user guide for some
4664    /// guidelines.
4665    ///
4666    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4667    #[derive(Clone, Debug, PartialEq)]
4668    #[non_exhaustive]
4669    pub enum ByteItemType {
4670        /// Unused
4671        Unspecified,
4672        /// plain text
4673        PlaintextUtf8,
4674        /// PDF
4675        Pdf,
4676        /// DOCX, DOCM, DOTX, DOTM
4677        WordDocument,
4678        /// XLSX, XLSM, XLTX, XLYM
4679        ExcelDocument,
4680        /// PPTX, PPTM, POTX, POTM, POT
4681        PowerpointDocument,
4682        /// TXT
4683        Txt,
4684        /// CSV
4685        Csv,
4686        /// If set, the enum was initialized with an unknown value.
4687        ///
4688        /// Applications can examine the value using [ByteItemType::value] or
4689        /// [ByteItemType::name].
4690        UnknownValue(byte_item_type::UnknownValue),
4691    }
4692
4693    #[doc(hidden)]
4694    pub mod byte_item_type {
4695        #[allow(unused_imports)]
4696        use super::*;
4697        #[derive(Clone, Debug, PartialEq)]
4698        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4699    }
4700
4701    impl ByteItemType {
4702        /// Gets the enum value.
4703        ///
4704        /// Returns `None` if the enum contains an unknown value deserialized from
4705        /// the string representation of enums.
4706        pub fn value(&self) -> std::option::Option<i32> {
4707            match self {
4708                Self::Unspecified => std::option::Option::Some(0),
4709                Self::PlaintextUtf8 => std::option::Option::Some(1),
4710                Self::Pdf => std::option::Option::Some(2),
4711                Self::WordDocument => std::option::Option::Some(3),
4712                Self::ExcelDocument => std::option::Option::Some(4),
4713                Self::PowerpointDocument => std::option::Option::Some(5),
4714                Self::Txt => std::option::Option::Some(6),
4715                Self::Csv => std::option::Option::Some(7),
4716                Self::UnknownValue(u) => u.0.value(),
4717            }
4718        }
4719
4720        /// Gets the enum value as a string.
4721        ///
4722        /// Returns `None` if the enum contains an unknown value deserialized from
4723        /// the integer representation of enums.
4724        pub fn name(&self) -> std::option::Option<&str> {
4725            match self {
4726                Self::Unspecified => std::option::Option::Some("BYTE_ITEM_TYPE_UNSPECIFIED"),
4727                Self::PlaintextUtf8 => std::option::Option::Some("PLAINTEXT_UTF8"),
4728                Self::Pdf => std::option::Option::Some("PDF"),
4729                Self::WordDocument => std::option::Option::Some("WORD_DOCUMENT"),
4730                Self::ExcelDocument => std::option::Option::Some("EXCEL_DOCUMENT"),
4731                Self::PowerpointDocument => std::option::Option::Some("POWERPOINT_DOCUMENT"),
4732                Self::Txt => std::option::Option::Some("TXT"),
4733                Self::Csv => std::option::Option::Some("CSV"),
4734                Self::UnknownValue(u) => u.0.name(),
4735            }
4736        }
4737    }
4738
4739    impl std::default::Default for ByteItemType {
4740        fn default() -> Self {
4741            use std::convert::From;
4742            Self::from(0)
4743        }
4744    }
4745
4746    impl std::fmt::Display for ByteItemType {
4747        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4748            wkt::internal::display_enum(f, self.name(), self.value())
4749        }
4750    }
4751
4752    impl std::convert::From<i32> for ByteItemType {
4753        fn from(value: i32) -> Self {
4754            match value {
4755                0 => Self::Unspecified,
4756                1 => Self::PlaintextUtf8,
4757                2 => Self::Pdf,
4758                3 => Self::WordDocument,
4759                4 => Self::ExcelDocument,
4760                5 => Self::PowerpointDocument,
4761                6 => Self::Txt,
4762                7 => Self::Csv,
4763                _ => Self::UnknownValue(byte_item_type::UnknownValue(
4764                    wkt::internal::UnknownEnumValue::Integer(value),
4765                )),
4766            }
4767        }
4768    }
4769
4770    impl std::convert::From<&str> for ByteItemType {
4771        fn from(value: &str) -> Self {
4772            use std::string::ToString;
4773            match value {
4774                "BYTE_ITEM_TYPE_UNSPECIFIED" => Self::Unspecified,
4775                "PLAINTEXT_UTF8" => Self::PlaintextUtf8,
4776                "PDF" => Self::Pdf,
4777                "WORD_DOCUMENT" => Self::WordDocument,
4778                "EXCEL_DOCUMENT" => Self::ExcelDocument,
4779                "POWERPOINT_DOCUMENT" => Self::PowerpointDocument,
4780                "TXT" => Self::Txt,
4781                "CSV" => Self::Csv,
4782                _ => Self::UnknownValue(byte_item_type::UnknownValue(
4783                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4784                )),
4785            }
4786        }
4787    }
4788
4789    impl serde::ser::Serialize for ByteItemType {
4790        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4791        where
4792            S: serde::Serializer,
4793        {
4794            match self {
4795                Self::Unspecified => serializer.serialize_i32(0),
4796                Self::PlaintextUtf8 => serializer.serialize_i32(1),
4797                Self::Pdf => serializer.serialize_i32(2),
4798                Self::WordDocument => serializer.serialize_i32(3),
4799                Self::ExcelDocument => serializer.serialize_i32(4),
4800                Self::PowerpointDocument => serializer.serialize_i32(5),
4801                Self::Txt => serializer.serialize_i32(6),
4802                Self::Csv => serializer.serialize_i32(7),
4803                Self::UnknownValue(u) => u.0.serialize(serializer),
4804            }
4805        }
4806    }
4807
4808    impl<'de> serde::de::Deserialize<'de> for ByteItemType {
4809        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4810        where
4811            D: serde::Deserializer<'de>,
4812        {
4813            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ByteItemType>::new(
4814                ".google.cloud.modelarmor.v1.ByteDataItem.ByteItemType",
4815            ))
4816        }
4817    }
4818}
4819
4820/// Sensitive Data Protection Deidentification Result.
4821#[derive(Clone, Default, PartialEq)]
4822#[non_exhaustive]
4823pub struct SdpDeidentifyResult {
4824    /// Output only. Reports whether Sensitive Data Protection deidentification was
4825    /// successfully executed or not.
4826    pub execution_state: crate::model::FilterExecutionState,
4827
4828    /// Optional messages corresponding to the result.
4829    /// A message can provide warnings or error details.
4830    /// For example, if execution state is skipped then this field provides
4831    /// related reason/explanation.
4832    pub message_items: std::vec::Vec<crate::model::MessageItem>,
4833
4834    /// Output only. Match state for Sensitive Data Protection Deidentification.
4835    /// Value is MATCH_FOUND if content is de-identified.
4836    pub match_state: crate::model::FilterMatchState,
4837
4838    /// De-identified data.
4839    pub data: std::option::Option<crate::model::DataItem>,
4840
4841    /// Total size in bytes that were transformed during deidentification.
4842    pub transformed_bytes: i64,
4843
4844    /// List of Sensitive Data Protection info-types that were de-identified.
4845    pub info_types: std::vec::Vec<std::string::String>,
4846
4847    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4848}
4849
4850impl SdpDeidentifyResult {
4851    pub fn new() -> Self {
4852        std::default::Default::default()
4853    }
4854
4855    /// Sets the value of [execution_state][crate::model::SdpDeidentifyResult::execution_state].
4856    ///
4857    /// # Example
4858    /// ```ignore,no_run
4859    /// # use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4860    /// use google_cloud_modelarmor_v1::model::FilterExecutionState;
4861    /// let x0 = SdpDeidentifyResult::new().set_execution_state(FilterExecutionState::ExecutionSuccess);
4862    /// let x1 = SdpDeidentifyResult::new().set_execution_state(FilterExecutionState::ExecutionSkipped);
4863    /// ```
4864    pub fn set_execution_state<T: std::convert::Into<crate::model::FilterExecutionState>>(
4865        mut self,
4866        v: T,
4867    ) -> Self {
4868        self.execution_state = v.into();
4869        self
4870    }
4871
4872    /// Sets the value of [message_items][crate::model::SdpDeidentifyResult::message_items].
4873    ///
4874    /// # Example
4875    /// ```ignore,no_run
4876    /// # use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4877    /// use google_cloud_modelarmor_v1::model::MessageItem;
4878    /// let x = SdpDeidentifyResult::new()
4879    ///     .set_message_items([
4880    ///         MessageItem::default()/* use setters */,
4881    ///         MessageItem::default()/* use (different) setters */,
4882    ///     ]);
4883    /// ```
4884    pub fn set_message_items<T, V>(mut self, v: T) -> Self
4885    where
4886        T: std::iter::IntoIterator<Item = V>,
4887        V: std::convert::Into<crate::model::MessageItem>,
4888    {
4889        use std::iter::Iterator;
4890        self.message_items = v.into_iter().map(|i| i.into()).collect();
4891        self
4892    }
4893
4894    /// Sets the value of [match_state][crate::model::SdpDeidentifyResult::match_state].
4895    ///
4896    /// # Example
4897    /// ```ignore,no_run
4898    /// # use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4899    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
4900    /// let x0 = SdpDeidentifyResult::new().set_match_state(FilterMatchState::NoMatchFound);
4901    /// let x1 = SdpDeidentifyResult::new().set_match_state(FilterMatchState::MatchFound);
4902    /// ```
4903    pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
4904        mut self,
4905        v: T,
4906    ) -> Self {
4907        self.match_state = v.into();
4908        self
4909    }
4910
4911    /// Sets the value of [data][crate::model::SdpDeidentifyResult::data].
4912    ///
4913    /// # Example
4914    /// ```ignore,no_run
4915    /// # use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4916    /// use google_cloud_modelarmor_v1::model::DataItem;
4917    /// let x = SdpDeidentifyResult::new().set_data(DataItem::default()/* use setters */);
4918    /// ```
4919    pub fn set_data<T>(mut self, v: T) -> Self
4920    where
4921        T: std::convert::Into<crate::model::DataItem>,
4922    {
4923        self.data = std::option::Option::Some(v.into());
4924        self
4925    }
4926
4927    /// Sets or clears the value of [data][crate::model::SdpDeidentifyResult::data].
4928    ///
4929    /// # Example
4930    /// ```ignore,no_run
4931    /// # use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4932    /// use google_cloud_modelarmor_v1::model::DataItem;
4933    /// let x = SdpDeidentifyResult::new().set_or_clear_data(Some(DataItem::default()/* use setters */));
4934    /// let x = SdpDeidentifyResult::new().set_or_clear_data(None::<DataItem>);
4935    /// ```
4936    pub fn set_or_clear_data<T>(mut self, v: std::option::Option<T>) -> Self
4937    where
4938        T: std::convert::Into<crate::model::DataItem>,
4939    {
4940        self.data = v.map(|x| x.into());
4941        self
4942    }
4943
4944    /// Sets the value of [transformed_bytes][crate::model::SdpDeidentifyResult::transformed_bytes].
4945    ///
4946    /// # Example
4947    /// ```ignore,no_run
4948    /// # use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4949    /// let x = SdpDeidentifyResult::new().set_transformed_bytes(42);
4950    /// ```
4951    pub fn set_transformed_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4952        self.transformed_bytes = v.into();
4953        self
4954    }
4955
4956    /// Sets the value of [info_types][crate::model::SdpDeidentifyResult::info_types].
4957    ///
4958    /// # Example
4959    /// ```ignore,no_run
4960    /// # use google_cloud_modelarmor_v1::model::SdpDeidentifyResult;
4961    /// let x = SdpDeidentifyResult::new().set_info_types(["a", "b", "c"]);
4962    /// ```
4963    pub fn set_info_types<T, V>(mut self, v: T) -> Self
4964    where
4965        T: std::iter::IntoIterator<Item = V>,
4966        V: std::convert::Into<std::string::String>,
4967    {
4968        use std::iter::Iterator;
4969        self.info_types = v.into_iter().map(|i| i.into()).collect();
4970        self
4971    }
4972}
4973
4974impl wkt::message::Message for SdpDeidentifyResult {
4975    fn typename() -> &'static str {
4976        "type.googleapis.com/google.cloud.modelarmor.v1.SdpDeidentifyResult"
4977    }
4978}
4979
4980/// Finding corresponding to Sensitive Data Protection filter.
4981#[derive(Clone, Default, PartialEq)]
4982#[non_exhaustive]
4983pub struct SdpFinding {
4984    /// Name of Sensitive Data Protection info type for this finding.
4985    pub info_type: std::string::String,
4986
4987    /// Identified confidence likelihood for `info_type`.
4988    pub likelihood: crate::model::SdpFindingLikelihood,
4989
4990    /// Location for this finding.
4991    pub location: std::option::Option<crate::model::sdp_finding::SdpFindingLocation>,
4992
4993    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4994}
4995
4996impl SdpFinding {
4997    pub fn new() -> Self {
4998        std::default::Default::default()
4999    }
5000
5001    /// Sets the value of [info_type][crate::model::SdpFinding::info_type].
5002    ///
5003    /// # Example
5004    /// ```ignore,no_run
5005    /// # use google_cloud_modelarmor_v1::model::SdpFinding;
5006    /// let x = SdpFinding::new().set_info_type("example");
5007    /// ```
5008    pub fn set_info_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5009        self.info_type = v.into();
5010        self
5011    }
5012
5013    /// Sets the value of [likelihood][crate::model::SdpFinding::likelihood].
5014    ///
5015    /// # Example
5016    /// ```ignore,no_run
5017    /// # use google_cloud_modelarmor_v1::model::SdpFinding;
5018    /// use google_cloud_modelarmor_v1::model::SdpFindingLikelihood;
5019    /// let x0 = SdpFinding::new().set_likelihood(SdpFindingLikelihood::VeryUnlikely);
5020    /// let x1 = SdpFinding::new().set_likelihood(SdpFindingLikelihood::Unlikely);
5021    /// let x2 = SdpFinding::new().set_likelihood(SdpFindingLikelihood::Possible);
5022    /// ```
5023    pub fn set_likelihood<T: std::convert::Into<crate::model::SdpFindingLikelihood>>(
5024        mut self,
5025        v: T,
5026    ) -> Self {
5027        self.likelihood = v.into();
5028        self
5029    }
5030
5031    /// Sets the value of [location][crate::model::SdpFinding::location].
5032    ///
5033    /// # Example
5034    /// ```ignore,no_run
5035    /// # use google_cloud_modelarmor_v1::model::SdpFinding;
5036    /// use google_cloud_modelarmor_v1::model::sdp_finding::SdpFindingLocation;
5037    /// let x = SdpFinding::new().set_location(SdpFindingLocation::default()/* use setters */);
5038    /// ```
5039    pub fn set_location<T>(mut self, v: T) -> Self
5040    where
5041        T: std::convert::Into<crate::model::sdp_finding::SdpFindingLocation>,
5042    {
5043        self.location = std::option::Option::Some(v.into());
5044        self
5045    }
5046
5047    /// Sets or clears the value of [location][crate::model::SdpFinding::location].
5048    ///
5049    /// # Example
5050    /// ```ignore,no_run
5051    /// # use google_cloud_modelarmor_v1::model::SdpFinding;
5052    /// use google_cloud_modelarmor_v1::model::sdp_finding::SdpFindingLocation;
5053    /// let x = SdpFinding::new().set_or_clear_location(Some(SdpFindingLocation::default()/* use setters */));
5054    /// let x = SdpFinding::new().set_or_clear_location(None::<SdpFindingLocation>);
5055    /// ```
5056    pub fn set_or_clear_location<T>(mut self, v: std::option::Option<T>) -> Self
5057    where
5058        T: std::convert::Into<crate::model::sdp_finding::SdpFindingLocation>,
5059    {
5060        self.location = v.map(|x| x.into());
5061        self
5062    }
5063}
5064
5065impl wkt::message::Message for SdpFinding {
5066    fn typename() -> &'static str {
5067        "type.googleapis.com/google.cloud.modelarmor.v1.SdpFinding"
5068    }
5069}
5070
5071/// Defines additional types related to [SdpFinding].
5072pub mod sdp_finding {
5073    #[allow(unused_imports)]
5074    use super::*;
5075
5076    /// Location of this Sensitive Data Protection Finding within input content.
5077    #[derive(Clone, Default, PartialEq)]
5078    #[non_exhaustive]
5079    pub struct SdpFindingLocation {
5080        /// Zero-based byte offsets delimiting the finding.
5081        /// These are relative to the finding's containing element.
5082        /// Note that when the content is not textual, this references
5083        /// the UTF-8 encoded textual representation of the content.
5084        pub byte_range: std::option::Option<crate::model::RangeInfo>,
5085
5086        /// Unicode character offsets delimiting the finding.
5087        /// These are relative to the finding's containing element.
5088        /// Provided when the content is text.
5089        pub codepoint_range: std::option::Option<crate::model::RangeInfo>,
5090
5091        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5092    }
5093
5094    impl SdpFindingLocation {
5095        pub fn new() -> Self {
5096            std::default::Default::default()
5097        }
5098
5099        /// Sets the value of [byte_range][crate::model::sdp_finding::SdpFindingLocation::byte_range].
5100        ///
5101        /// # Example
5102        /// ```ignore,no_run
5103        /// # use google_cloud_modelarmor_v1::model::sdp_finding::SdpFindingLocation;
5104        /// use google_cloud_modelarmor_v1::model::RangeInfo;
5105        /// let x = SdpFindingLocation::new().set_byte_range(RangeInfo::default()/* use setters */);
5106        /// ```
5107        pub fn set_byte_range<T>(mut self, v: T) -> Self
5108        where
5109            T: std::convert::Into<crate::model::RangeInfo>,
5110        {
5111            self.byte_range = std::option::Option::Some(v.into());
5112            self
5113        }
5114
5115        /// Sets or clears the value of [byte_range][crate::model::sdp_finding::SdpFindingLocation::byte_range].
5116        ///
5117        /// # Example
5118        /// ```ignore,no_run
5119        /// # use google_cloud_modelarmor_v1::model::sdp_finding::SdpFindingLocation;
5120        /// use google_cloud_modelarmor_v1::model::RangeInfo;
5121        /// let x = SdpFindingLocation::new().set_or_clear_byte_range(Some(RangeInfo::default()/* use setters */));
5122        /// let x = SdpFindingLocation::new().set_or_clear_byte_range(None::<RangeInfo>);
5123        /// ```
5124        pub fn set_or_clear_byte_range<T>(mut self, v: std::option::Option<T>) -> Self
5125        where
5126            T: std::convert::Into<crate::model::RangeInfo>,
5127        {
5128            self.byte_range = v.map(|x| x.into());
5129            self
5130        }
5131
5132        /// Sets the value of [codepoint_range][crate::model::sdp_finding::SdpFindingLocation::codepoint_range].
5133        ///
5134        /// # Example
5135        /// ```ignore,no_run
5136        /// # use google_cloud_modelarmor_v1::model::sdp_finding::SdpFindingLocation;
5137        /// use google_cloud_modelarmor_v1::model::RangeInfo;
5138        /// let x = SdpFindingLocation::new().set_codepoint_range(RangeInfo::default()/* use setters */);
5139        /// ```
5140        pub fn set_codepoint_range<T>(mut self, v: T) -> Self
5141        where
5142            T: std::convert::Into<crate::model::RangeInfo>,
5143        {
5144            self.codepoint_range = std::option::Option::Some(v.into());
5145            self
5146        }
5147
5148        /// Sets or clears the value of [codepoint_range][crate::model::sdp_finding::SdpFindingLocation::codepoint_range].
5149        ///
5150        /// # Example
5151        /// ```ignore,no_run
5152        /// # use google_cloud_modelarmor_v1::model::sdp_finding::SdpFindingLocation;
5153        /// use google_cloud_modelarmor_v1::model::RangeInfo;
5154        /// let x = SdpFindingLocation::new().set_or_clear_codepoint_range(Some(RangeInfo::default()/* use setters */));
5155        /// let x = SdpFindingLocation::new().set_or_clear_codepoint_range(None::<RangeInfo>);
5156        /// ```
5157        pub fn set_or_clear_codepoint_range<T>(mut self, v: std::option::Option<T>) -> Self
5158        where
5159            T: std::convert::Into<crate::model::RangeInfo>,
5160        {
5161            self.codepoint_range = v.map(|x| x.into());
5162            self
5163        }
5164    }
5165
5166    impl wkt::message::Message for SdpFindingLocation {
5167        fn typename() -> &'static str {
5168            "type.googleapis.com/google.cloud.modelarmor.v1.SdpFinding.SdpFindingLocation"
5169        }
5170    }
5171}
5172
5173/// Prompt injection and Jailbreak Filter Result.
5174#[derive(Clone, Default, PartialEq)]
5175#[non_exhaustive]
5176pub struct PiAndJailbreakFilterResult {
5177    /// Output only. Reports whether Prompt injection and Jailbreak filter was
5178    /// successfully executed or not.
5179    pub execution_state: crate::model::FilterExecutionState,
5180
5181    /// Optional messages corresponding to the result.
5182    /// A message can provide warnings or error details.
5183    /// For example, if execution state is skipped then this field provides
5184    /// related reason/explanation.
5185    pub message_items: std::vec::Vec<crate::model::MessageItem>,
5186
5187    /// Output only. Match state for Prompt injection and Jailbreak.
5188    pub match_state: crate::model::FilterMatchState,
5189
5190    /// Confidence level identified for Prompt injection and Jailbreak.
5191    pub confidence_level: crate::model::DetectionConfidenceLevel,
5192
5193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5194}
5195
5196impl PiAndJailbreakFilterResult {
5197    pub fn new() -> Self {
5198        std::default::Default::default()
5199    }
5200
5201    /// Sets the value of [execution_state][crate::model::PiAndJailbreakFilterResult::execution_state].
5202    ///
5203    /// # Example
5204    /// ```ignore,no_run
5205    /// # use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterResult;
5206    /// use google_cloud_modelarmor_v1::model::FilterExecutionState;
5207    /// let x0 = PiAndJailbreakFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSuccess);
5208    /// let x1 = PiAndJailbreakFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSkipped);
5209    /// ```
5210    pub fn set_execution_state<T: std::convert::Into<crate::model::FilterExecutionState>>(
5211        mut self,
5212        v: T,
5213    ) -> Self {
5214        self.execution_state = v.into();
5215        self
5216    }
5217
5218    /// Sets the value of [message_items][crate::model::PiAndJailbreakFilterResult::message_items].
5219    ///
5220    /// # Example
5221    /// ```ignore,no_run
5222    /// # use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterResult;
5223    /// use google_cloud_modelarmor_v1::model::MessageItem;
5224    /// let x = PiAndJailbreakFilterResult::new()
5225    ///     .set_message_items([
5226    ///         MessageItem::default()/* use setters */,
5227    ///         MessageItem::default()/* use (different) setters */,
5228    ///     ]);
5229    /// ```
5230    pub fn set_message_items<T, V>(mut self, v: T) -> Self
5231    where
5232        T: std::iter::IntoIterator<Item = V>,
5233        V: std::convert::Into<crate::model::MessageItem>,
5234    {
5235        use std::iter::Iterator;
5236        self.message_items = v.into_iter().map(|i| i.into()).collect();
5237        self
5238    }
5239
5240    /// Sets the value of [match_state][crate::model::PiAndJailbreakFilterResult::match_state].
5241    ///
5242    /// # Example
5243    /// ```ignore,no_run
5244    /// # use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterResult;
5245    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
5246    /// let x0 = PiAndJailbreakFilterResult::new().set_match_state(FilterMatchState::NoMatchFound);
5247    /// let x1 = PiAndJailbreakFilterResult::new().set_match_state(FilterMatchState::MatchFound);
5248    /// ```
5249    pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
5250        mut self,
5251        v: T,
5252    ) -> Self {
5253        self.match_state = v.into();
5254        self
5255    }
5256
5257    /// Sets the value of [confidence_level][crate::model::PiAndJailbreakFilterResult::confidence_level].
5258    ///
5259    /// # Example
5260    /// ```ignore,no_run
5261    /// # use google_cloud_modelarmor_v1::model::PiAndJailbreakFilterResult;
5262    /// use google_cloud_modelarmor_v1::model::DetectionConfidenceLevel;
5263    /// let x0 = PiAndJailbreakFilterResult::new().set_confidence_level(DetectionConfidenceLevel::LowAndAbove);
5264    /// let x1 = PiAndJailbreakFilterResult::new().set_confidence_level(DetectionConfidenceLevel::MediumAndAbove);
5265    /// let x2 = PiAndJailbreakFilterResult::new().set_confidence_level(DetectionConfidenceLevel::High);
5266    /// ```
5267    pub fn set_confidence_level<T: std::convert::Into<crate::model::DetectionConfidenceLevel>>(
5268        mut self,
5269        v: T,
5270    ) -> Self {
5271        self.confidence_level = v.into();
5272        self
5273    }
5274}
5275
5276impl wkt::message::Message for PiAndJailbreakFilterResult {
5277    fn typename() -> &'static str {
5278        "type.googleapis.com/google.cloud.modelarmor.v1.PiAndJailbreakFilterResult"
5279    }
5280}
5281
5282/// Malicious URI Filter Result.
5283#[derive(Clone, Default, PartialEq)]
5284#[non_exhaustive]
5285pub struct MaliciousUriFilterResult {
5286    /// Output only. Reports whether Malicious URI filter was successfully executed
5287    /// or not.
5288    pub execution_state: crate::model::FilterExecutionState,
5289
5290    /// Optional messages corresponding to the result.
5291    /// A message can provide warnings or error details.
5292    /// For example, if execution state is skipped then this field provides
5293    /// related reason/explanation.
5294    pub message_items: std::vec::Vec<crate::model::MessageItem>,
5295
5296    /// Output only. Match state for this Malicious URI.
5297    /// Value is MATCH_FOUND if at least one Malicious URI is found.
5298    pub match_state: crate::model::FilterMatchState,
5299
5300    /// List of Malicious URIs found in data.
5301    pub malicious_uri_matched_items:
5302        std::vec::Vec<crate::model::malicious_uri_filter_result::MaliciousUriMatchedItem>,
5303
5304    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5305}
5306
5307impl MaliciousUriFilterResult {
5308    pub fn new() -> Self {
5309        std::default::Default::default()
5310    }
5311
5312    /// Sets the value of [execution_state][crate::model::MaliciousUriFilterResult::execution_state].
5313    ///
5314    /// # Example
5315    /// ```ignore,no_run
5316    /// # use google_cloud_modelarmor_v1::model::MaliciousUriFilterResult;
5317    /// use google_cloud_modelarmor_v1::model::FilterExecutionState;
5318    /// let x0 = MaliciousUriFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSuccess);
5319    /// let x1 = MaliciousUriFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSkipped);
5320    /// ```
5321    pub fn set_execution_state<T: std::convert::Into<crate::model::FilterExecutionState>>(
5322        mut self,
5323        v: T,
5324    ) -> Self {
5325        self.execution_state = v.into();
5326        self
5327    }
5328
5329    /// Sets the value of [message_items][crate::model::MaliciousUriFilterResult::message_items].
5330    ///
5331    /// # Example
5332    /// ```ignore,no_run
5333    /// # use google_cloud_modelarmor_v1::model::MaliciousUriFilterResult;
5334    /// use google_cloud_modelarmor_v1::model::MessageItem;
5335    /// let x = MaliciousUriFilterResult::new()
5336    ///     .set_message_items([
5337    ///         MessageItem::default()/* use setters */,
5338    ///         MessageItem::default()/* use (different) setters */,
5339    ///     ]);
5340    /// ```
5341    pub fn set_message_items<T, V>(mut self, v: T) -> Self
5342    where
5343        T: std::iter::IntoIterator<Item = V>,
5344        V: std::convert::Into<crate::model::MessageItem>,
5345    {
5346        use std::iter::Iterator;
5347        self.message_items = v.into_iter().map(|i| i.into()).collect();
5348        self
5349    }
5350
5351    /// Sets the value of [match_state][crate::model::MaliciousUriFilterResult::match_state].
5352    ///
5353    /// # Example
5354    /// ```ignore,no_run
5355    /// # use google_cloud_modelarmor_v1::model::MaliciousUriFilterResult;
5356    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
5357    /// let x0 = MaliciousUriFilterResult::new().set_match_state(FilterMatchState::NoMatchFound);
5358    /// let x1 = MaliciousUriFilterResult::new().set_match_state(FilterMatchState::MatchFound);
5359    /// ```
5360    pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
5361        mut self,
5362        v: T,
5363    ) -> Self {
5364        self.match_state = v.into();
5365        self
5366    }
5367
5368    /// Sets the value of [malicious_uri_matched_items][crate::model::MaliciousUriFilterResult::malicious_uri_matched_items].
5369    ///
5370    /// # Example
5371    /// ```ignore,no_run
5372    /// # use google_cloud_modelarmor_v1::model::MaliciousUriFilterResult;
5373    /// use google_cloud_modelarmor_v1::model::malicious_uri_filter_result::MaliciousUriMatchedItem;
5374    /// let x = MaliciousUriFilterResult::new()
5375    ///     .set_malicious_uri_matched_items([
5376    ///         MaliciousUriMatchedItem::default()/* use setters */,
5377    ///         MaliciousUriMatchedItem::default()/* use (different) setters */,
5378    ///     ]);
5379    /// ```
5380    pub fn set_malicious_uri_matched_items<T, V>(mut self, v: T) -> Self
5381    where
5382        T: std::iter::IntoIterator<Item = V>,
5383        V: std::convert::Into<crate::model::malicious_uri_filter_result::MaliciousUriMatchedItem>,
5384    {
5385        use std::iter::Iterator;
5386        self.malicious_uri_matched_items = v.into_iter().map(|i| i.into()).collect();
5387        self
5388    }
5389}
5390
5391impl wkt::message::Message for MaliciousUriFilterResult {
5392    fn typename() -> &'static str {
5393        "type.googleapis.com/google.cloud.modelarmor.v1.MaliciousUriFilterResult"
5394    }
5395}
5396
5397/// Defines additional types related to [MaliciousUriFilterResult].
5398pub mod malicious_uri_filter_result {
5399    #[allow(unused_imports)]
5400    use super::*;
5401
5402    /// Information regarding malicious URI and its location within the input
5403    /// content.
5404    #[derive(Clone, Default, PartialEq)]
5405    #[non_exhaustive]
5406    pub struct MaliciousUriMatchedItem {
5407        /// Malicious URI.
5408        pub uri: std::string::String,
5409
5410        /// List of locations where Malicious URI is identified.
5411        /// The `locations` field is supported only for plaintext content i.e.
5412        /// ByteItemType.PLAINTEXT_UTF8
5413        pub locations: std::vec::Vec<crate::model::RangeInfo>,
5414
5415        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5416    }
5417
5418    impl MaliciousUriMatchedItem {
5419        pub fn new() -> Self {
5420            std::default::Default::default()
5421        }
5422
5423        /// Sets the value of [uri][crate::model::malicious_uri_filter_result::MaliciousUriMatchedItem::uri].
5424        ///
5425        /// # Example
5426        /// ```ignore,no_run
5427        /// # use google_cloud_modelarmor_v1::model::malicious_uri_filter_result::MaliciousUriMatchedItem;
5428        /// let x = MaliciousUriMatchedItem::new().set_uri("example");
5429        /// ```
5430        pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5431            self.uri = v.into();
5432            self
5433        }
5434
5435        /// Sets the value of [locations][crate::model::malicious_uri_filter_result::MaliciousUriMatchedItem::locations].
5436        ///
5437        /// # Example
5438        /// ```ignore,no_run
5439        /// # use google_cloud_modelarmor_v1::model::malicious_uri_filter_result::MaliciousUriMatchedItem;
5440        /// use google_cloud_modelarmor_v1::model::RangeInfo;
5441        /// let x = MaliciousUriMatchedItem::new()
5442        ///     .set_locations([
5443        ///         RangeInfo::default()/* use setters */,
5444        ///         RangeInfo::default()/* use (different) setters */,
5445        ///     ]);
5446        /// ```
5447        pub fn set_locations<T, V>(mut self, v: T) -> Self
5448        where
5449            T: std::iter::IntoIterator<Item = V>,
5450            V: std::convert::Into<crate::model::RangeInfo>,
5451        {
5452            use std::iter::Iterator;
5453            self.locations = v.into_iter().map(|i| i.into()).collect();
5454            self
5455        }
5456    }
5457
5458    impl wkt::message::Message for MaliciousUriMatchedItem {
5459        fn typename() -> &'static str {
5460            "type.googleapis.com/google.cloud.modelarmor.v1.MaliciousUriFilterResult.MaliciousUriMatchedItem"
5461        }
5462    }
5463}
5464
5465/// Virus scan results.
5466#[derive(Clone, Default, PartialEq)]
5467#[non_exhaustive]
5468pub struct VirusScanFilterResult {
5469    /// Output only. Reports whether Virus Scan was successfully executed or not.
5470    pub execution_state: crate::model::FilterExecutionState,
5471
5472    /// Optional messages corresponding to the result.
5473    /// A message can provide warnings or error details.
5474    /// For example, if execution status is skipped then this field provides
5475    /// related reason/explanation.
5476    pub message_items: std::vec::Vec<crate::model::MessageItem>,
5477
5478    /// Output only. Match status for Virus.
5479    /// Value is MATCH_FOUND if the data is infected with a virus.
5480    pub match_state: crate::model::FilterMatchState,
5481
5482    /// Type of content scanned.
5483    pub scanned_content_type: crate::model::virus_scan_filter_result::ScannedContentType,
5484
5485    /// Size of scanned content in bytes.
5486    pub scanned_size: std::option::Option<i64>,
5487
5488    /// List of Viruses identified.
5489    /// This field will be empty if no virus was detected.
5490    pub virus_details: std::vec::Vec<crate::model::VirusDetail>,
5491
5492    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5493}
5494
5495impl VirusScanFilterResult {
5496    pub fn new() -> Self {
5497        std::default::Default::default()
5498    }
5499
5500    /// Sets the value of [execution_state][crate::model::VirusScanFilterResult::execution_state].
5501    ///
5502    /// # Example
5503    /// ```ignore,no_run
5504    /// # use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
5505    /// use google_cloud_modelarmor_v1::model::FilterExecutionState;
5506    /// let x0 = VirusScanFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSuccess);
5507    /// let x1 = VirusScanFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSkipped);
5508    /// ```
5509    pub fn set_execution_state<T: std::convert::Into<crate::model::FilterExecutionState>>(
5510        mut self,
5511        v: T,
5512    ) -> Self {
5513        self.execution_state = v.into();
5514        self
5515    }
5516
5517    /// Sets the value of [message_items][crate::model::VirusScanFilterResult::message_items].
5518    ///
5519    /// # Example
5520    /// ```ignore,no_run
5521    /// # use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
5522    /// use google_cloud_modelarmor_v1::model::MessageItem;
5523    /// let x = VirusScanFilterResult::new()
5524    ///     .set_message_items([
5525    ///         MessageItem::default()/* use setters */,
5526    ///         MessageItem::default()/* use (different) setters */,
5527    ///     ]);
5528    /// ```
5529    pub fn set_message_items<T, V>(mut self, v: T) -> Self
5530    where
5531        T: std::iter::IntoIterator<Item = V>,
5532        V: std::convert::Into<crate::model::MessageItem>,
5533    {
5534        use std::iter::Iterator;
5535        self.message_items = v.into_iter().map(|i| i.into()).collect();
5536        self
5537    }
5538
5539    /// Sets the value of [match_state][crate::model::VirusScanFilterResult::match_state].
5540    ///
5541    /// # Example
5542    /// ```ignore,no_run
5543    /// # use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
5544    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
5545    /// let x0 = VirusScanFilterResult::new().set_match_state(FilterMatchState::NoMatchFound);
5546    /// let x1 = VirusScanFilterResult::new().set_match_state(FilterMatchState::MatchFound);
5547    /// ```
5548    pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
5549        mut self,
5550        v: T,
5551    ) -> Self {
5552        self.match_state = v.into();
5553        self
5554    }
5555
5556    /// Sets the value of [scanned_content_type][crate::model::VirusScanFilterResult::scanned_content_type].
5557    ///
5558    /// # Example
5559    /// ```ignore,no_run
5560    /// # use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
5561    /// use google_cloud_modelarmor_v1::model::virus_scan_filter_result::ScannedContentType;
5562    /// let x0 = VirusScanFilterResult::new().set_scanned_content_type(ScannedContentType::Unknown);
5563    /// let x1 = VirusScanFilterResult::new().set_scanned_content_type(ScannedContentType::Plaintext);
5564    /// let x2 = VirusScanFilterResult::new().set_scanned_content_type(ScannedContentType::Pdf);
5565    /// ```
5566    pub fn set_scanned_content_type<
5567        T: std::convert::Into<crate::model::virus_scan_filter_result::ScannedContentType>,
5568    >(
5569        mut self,
5570        v: T,
5571    ) -> Self {
5572        self.scanned_content_type = v.into();
5573        self
5574    }
5575
5576    /// Sets the value of [scanned_size][crate::model::VirusScanFilterResult::scanned_size].
5577    ///
5578    /// # Example
5579    /// ```ignore,no_run
5580    /// # use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
5581    /// let x = VirusScanFilterResult::new().set_scanned_size(42);
5582    /// ```
5583    pub fn set_scanned_size<T>(mut self, v: T) -> Self
5584    where
5585        T: std::convert::Into<i64>,
5586    {
5587        self.scanned_size = std::option::Option::Some(v.into());
5588        self
5589    }
5590
5591    /// Sets or clears the value of [scanned_size][crate::model::VirusScanFilterResult::scanned_size].
5592    ///
5593    /// # Example
5594    /// ```ignore,no_run
5595    /// # use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
5596    /// let x = VirusScanFilterResult::new().set_or_clear_scanned_size(Some(42));
5597    /// let x = VirusScanFilterResult::new().set_or_clear_scanned_size(None::<i32>);
5598    /// ```
5599    pub fn set_or_clear_scanned_size<T>(mut self, v: std::option::Option<T>) -> Self
5600    where
5601        T: std::convert::Into<i64>,
5602    {
5603        self.scanned_size = v.map(|x| x.into());
5604        self
5605    }
5606
5607    /// Sets the value of [virus_details][crate::model::VirusScanFilterResult::virus_details].
5608    ///
5609    /// # Example
5610    /// ```ignore,no_run
5611    /// # use google_cloud_modelarmor_v1::model::VirusScanFilterResult;
5612    /// use google_cloud_modelarmor_v1::model::VirusDetail;
5613    /// let x = VirusScanFilterResult::new()
5614    ///     .set_virus_details([
5615    ///         VirusDetail::default()/* use setters */,
5616    ///         VirusDetail::default()/* use (different) setters */,
5617    ///     ]);
5618    /// ```
5619    pub fn set_virus_details<T, V>(mut self, v: T) -> Self
5620    where
5621        T: std::iter::IntoIterator<Item = V>,
5622        V: std::convert::Into<crate::model::VirusDetail>,
5623    {
5624        use std::iter::Iterator;
5625        self.virus_details = v.into_iter().map(|i| i.into()).collect();
5626        self
5627    }
5628}
5629
5630impl wkt::message::Message for VirusScanFilterResult {
5631    fn typename() -> &'static str {
5632        "type.googleapis.com/google.cloud.modelarmor.v1.VirusScanFilterResult"
5633    }
5634}
5635
5636/// Defines additional types related to [VirusScanFilterResult].
5637pub mod virus_scan_filter_result {
5638    #[allow(unused_imports)]
5639    use super::*;
5640
5641    /// Type of content scanned.
5642    ///
5643    /// # Working with unknown values
5644    ///
5645    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5646    /// additional enum variants at any time. Adding new variants is not considered
5647    /// a breaking change. Applications should write their code in anticipation of:
5648    ///
5649    /// - New values appearing in future releases of the client library, **and**
5650    /// - New values received dynamically, without application changes.
5651    ///
5652    /// Please consult the [Working with enums] section in the user guide for some
5653    /// guidelines.
5654    ///
5655    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5656    #[derive(Clone, Debug, PartialEq)]
5657    #[non_exhaustive]
5658    pub enum ScannedContentType {
5659        /// Unused
5660        Unspecified,
5661        /// Unknown content
5662        Unknown,
5663        /// Plaintext
5664        Plaintext,
5665        /// PDF
5666        /// Scanning for only PDF is supported.
5667        Pdf,
5668        /// If set, the enum was initialized with an unknown value.
5669        ///
5670        /// Applications can examine the value using [ScannedContentType::value] or
5671        /// [ScannedContentType::name].
5672        UnknownValue(scanned_content_type::UnknownValue),
5673    }
5674
5675    #[doc(hidden)]
5676    pub mod scanned_content_type {
5677        #[allow(unused_imports)]
5678        use super::*;
5679        #[derive(Clone, Debug, PartialEq)]
5680        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5681    }
5682
5683    impl ScannedContentType {
5684        /// Gets the enum value.
5685        ///
5686        /// Returns `None` if the enum contains an unknown value deserialized from
5687        /// the string representation of enums.
5688        pub fn value(&self) -> std::option::Option<i32> {
5689            match self {
5690                Self::Unspecified => std::option::Option::Some(0),
5691                Self::Unknown => std::option::Option::Some(1),
5692                Self::Plaintext => std::option::Option::Some(2),
5693                Self::Pdf => std::option::Option::Some(3),
5694                Self::UnknownValue(u) => u.0.value(),
5695            }
5696        }
5697
5698        /// Gets the enum value as a string.
5699        ///
5700        /// Returns `None` if the enum contains an unknown value deserialized from
5701        /// the integer representation of enums.
5702        pub fn name(&self) -> std::option::Option<&str> {
5703            match self {
5704                Self::Unspecified => std::option::Option::Some("SCANNED_CONTENT_TYPE_UNSPECIFIED"),
5705                Self::Unknown => std::option::Option::Some("UNKNOWN"),
5706                Self::Plaintext => std::option::Option::Some("PLAINTEXT"),
5707                Self::Pdf => std::option::Option::Some("PDF"),
5708                Self::UnknownValue(u) => u.0.name(),
5709            }
5710        }
5711    }
5712
5713    impl std::default::Default for ScannedContentType {
5714        fn default() -> Self {
5715            use std::convert::From;
5716            Self::from(0)
5717        }
5718    }
5719
5720    impl std::fmt::Display for ScannedContentType {
5721        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5722            wkt::internal::display_enum(f, self.name(), self.value())
5723        }
5724    }
5725
5726    impl std::convert::From<i32> for ScannedContentType {
5727        fn from(value: i32) -> Self {
5728            match value {
5729                0 => Self::Unspecified,
5730                1 => Self::Unknown,
5731                2 => Self::Plaintext,
5732                3 => Self::Pdf,
5733                _ => Self::UnknownValue(scanned_content_type::UnknownValue(
5734                    wkt::internal::UnknownEnumValue::Integer(value),
5735                )),
5736            }
5737        }
5738    }
5739
5740    impl std::convert::From<&str> for ScannedContentType {
5741        fn from(value: &str) -> Self {
5742            use std::string::ToString;
5743            match value {
5744                "SCANNED_CONTENT_TYPE_UNSPECIFIED" => Self::Unspecified,
5745                "UNKNOWN" => Self::Unknown,
5746                "PLAINTEXT" => Self::Plaintext,
5747                "PDF" => Self::Pdf,
5748                _ => Self::UnknownValue(scanned_content_type::UnknownValue(
5749                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5750                )),
5751            }
5752        }
5753    }
5754
5755    impl serde::ser::Serialize for ScannedContentType {
5756        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5757        where
5758            S: serde::Serializer,
5759        {
5760            match self {
5761                Self::Unspecified => serializer.serialize_i32(0),
5762                Self::Unknown => serializer.serialize_i32(1),
5763                Self::Plaintext => serializer.serialize_i32(2),
5764                Self::Pdf => serializer.serialize_i32(3),
5765                Self::UnknownValue(u) => u.0.serialize(serializer),
5766            }
5767        }
5768    }
5769
5770    impl<'de> serde::de::Deserialize<'de> for ScannedContentType {
5771        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5772        where
5773            D: serde::Deserializer<'de>,
5774        {
5775            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScannedContentType>::new(
5776                ".google.cloud.modelarmor.v1.VirusScanFilterResult.ScannedContentType",
5777            ))
5778        }
5779    }
5780}
5781
5782/// Details of an identified virus
5783#[derive(Clone, Default, PartialEq)]
5784#[non_exhaustive]
5785pub struct VirusDetail {
5786    /// Name of vendor that produced this virus identification.
5787    pub vendor: std::string::String,
5788
5789    /// Names of this Virus.
5790    pub names: std::vec::Vec<std::string::String>,
5791
5792    /// Threat type of the identified virus
5793    pub threat_type: crate::model::virus_detail::ThreatType,
5794
5795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5796}
5797
5798impl VirusDetail {
5799    pub fn new() -> Self {
5800        std::default::Default::default()
5801    }
5802
5803    /// Sets the value of [vendor][crate::model::VirusDetail::vendor].
5804    ///
5805    /// # Example
5806    /// ```ignore,no_run
5807    /// # use google_cloud_modelarmor_v1::model::VirusDetail;
5808    /// let x = VirusDetail::new().set_vendor("example");
5809    /// ```
5810    pub fn set_vendor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5811        self.vendor = v.into();
5812        self
5813    }
5814
5815    /// Sets the value of [names][crate::model::VirusDetail::names].
5816    ///
5817    /// # Example
5818    /// ```ignore,no_run
5819    /// # use google_cloud_modelarmor_v1::model::VirusDetail;
5820    /// let x = VirusDetail::new().set_names(["a", "b", "c"]);
5821    /// ```
5822    pub fn set_names<T, V>(mut self, v: T) -> Self
5823    where
5824        T: std::iter::IntoIterator<Item = V>,
5825        V: std::convert::Into<std::string::String>,
5826    {
5827        use std::iter::Iterator;
5828        self.names = v.into_iter().map(|i| i.into()).collect();
5829        self
5830    }
5831
5832    /// Sets the value of [threat_type][crate::model::VirusDetail::threat_type].
5833    ///
5834    /// # Example
5835    /// ```ignore,no_run
5836    /// # use google_cloud_modelarmor_v1::model::VirusDetail;
5837    /// use google_cloud_modelarmor_v1::model::virus_detail::ThreatType;
5838    /// let x0 = VirusDetail::new().set_threat_type(ThreatType::Unknown);
5839    /// let x1 = VirusDetail::new().set_threat_type(ThreatType::VirusOrWorm);
5840    /// let x2 = VirusDetail::new().set_threat_type(ThreatType::MaliciousProgram);
5841    /// ```
5842    pub fn set_threat_type<T: std::convert::Into<crate::model::virus_detail::ThreatType>>(
5843        mut self,
5844        v: T,
5845    ) -> Self {
5846        self.threat_type = v.into();
5847        self
5848    }
5849}
5850
5851impl wkt::message::Message for VirusDetail {
5852    fn typename() -> &'static str {
5853        "type.googleapis.com/google.cloud.modelarmor.v1.VirusDetail"
5854    }
5855}
5856
5857/// Defines additional types related to [VirusDetail].
5858pub mod virus_detail {
5859    #[allow(unused_imports)]
5860    use super::*;
5861
5862    /// Defines all the threat types of a virus
5863    ///
5864    /// # Working with unknown values
5865    ///
5866    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5867    /// additional enum variants at any time. Adding new variants is not considered
5868    /// a breaking change. Applications should write their code in anticipation of:
5869    ///
5870    /// - New values appearing in future releases of the client library, **and**
5871    /// - New values received dynamically, without application changes.
5872    ///
5873    /// Please consult the [Working with enums] section in the user guide for some
5874    /// guidelines.
5875    ///
5876    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5877    #[derive(Clone, Debug, PartialEq)]
5878    #[non_exhaustive]
5879    pub enum ThreatType {
5880        /// Unused
5881        Unspecified,
5882        /// Unable to categorize threat
5883        Unknown,
5884        /// Virus or Worm threat.
5885        VirusOrWorm,
5886        /// Malicious program. E.g. Spyware, Trojan.
5887        MaliciousProgram,
5888        /// Potentially harmful content. E.g. Injected code, Macro
5889        PotentiallyHarmfulContent,
5890        /// Potentially unwanted content. E.g. Adware.
5891        PotentiallyUnwantedContent,
5892        /// If set, the enum was initialized with an unknown value.
5893        ///
5894        /// Applications can examine the value using [ThreatType::value] or
5895        /// [ThreatType::name].
5896        UnknownValue(threat_type::UnknownValue),
5897    }
5898
5899    #[doc(hidden)]
5900    pub mod threat_type {
5901        #[allow(unused_imports)]
5902        use super::*;
5903        #[derive(Clone, Debug, PartialEq)]
5904        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5905    }
5906
5907    impl ThreatType {
5908        /// Gets the enum value.
5909        ///
5910        /// Returns `None` if the enum contains an unknown value deserialized from
5911        /// the string representation of enums.
5912        pub fn value(&self) -> std::option::Option<i32> {
5913            match self {
5914                Self::Unspecified => std::option::Option::Some(0),
5915                Self::Unknown => std::option::Option::Some(1),
5916                Self::VirusOrWorm => std::option::Option::Some(2),
5917                Self::MaliciousProgram => std::option::Option::Some(3),
5918                Self::PotentiallyHarmfulContent => std::option::Option::Some(4),
5919                Self::PotentiallyUnwantedContent => std::option::Option::Some(5),
5920                Self::UnknownValue(u) => u.0.value(),
5921            }
5922        }
5923
5924        /// Gets the enum value as a string.
5925        ///
5926        /// Returns `None` if the enum contains an unknown value deserialized from
5927        /// the integer representation of enums.
5928        pub fn name(&self) -> std::option::Option<&str> {
5929            match self {
5930                Self::Unspecified => std::option::Option::Some("THREAT_TYPE_UNSPECIFIED"),
5931                Self::Unknown => std::option::Option::Some("UNKNOWN"),
5932                Self::VirusOrWorm => std::option::Option::Some("VIRUS_OR_WORM"),
5933                Self::MaliciousProgram => std::option::Option::Some("MALICIOUS_PROGRAM"),
5934                Self::PotentiallyHarmfulContent => {
5935                    std::option::Option::Some("POTENTIALLY_HARMFUL_CONTENT")
5936                }
5937                Self::PotentiallyUnwantedContent => {
5938                    std::option::Option::Some("POTENTIALLY_UNWANTED_CONTENT")
5939                }
5940                Self::UnknownValue(u) => u.0.name(),
5941            }
5942        }
5943    }
5944
5945    impl std::default::Default for ThreatType {
5946        fn default() -> Self {
5947            use std::convert::From;
5948            Self::from(0)
5949        }
5950    }
5951
5952    impl std::fmt::Display for ThreatType {
5953        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5954            wkt::internal::display_enum(f, self.name(), self.value())
5955        }
5956    }
5957
5958    impl std::convert::From<i32> for ThreatType {
5959        fn from(value: i32) -> Self {
5960            match value {
5961                0 => Self::Unspecified,
5962                1 => Self::Unknown,
5963                2 => Self::VirusOrWorm,
5964                3 => Self::MaliciousProgram,
5965                4 => Self::PotentiallyHarmfulContent,
5966                5 => Self::PotentiallyUnwantedContent,
5967                _ => Self::UnknownValue(threat_type::UnknownValue(
5968                    wkt::internal::UnknownEnumValue::Integer(value),
5969                )),
5970            }
5971        }
5972    }
5973
5974    impl std::convert::From<&str> for ThreatType {
5975        fn from(value: &str) -> Self {
5976            use std::string::ToString;
5977            match value {
5978                "THREAT_TYPE_UNSPECIFIED" => Self::Unspecified,
5979                "UNKNOWN" => Self::Unknown,
5980                "VIRUS_OR_WORM" => Self::VirusOrWorm,
5981                "MALICIOUS_PROGRAM" => Self::MaliciousProgram,
5982                "POTENTIALLY_HARMFUL_CONTENT" => Self::PotentiallyHarmfulContent,
5983                "POTENTIALLY_UNWANTED_CONTENT" => Self::PotentiallyUnwantedContent,
5984                _ => Self::UnknownValue(threat_type::UnknownValue(
5985                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5986                )),
5987            }
5988        }
5989    }
5990
5991    impl serde::ser::Serialize for ThreatType {
5992        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5993        where
5994            S: serde::Serializer,
5995        {
5996            match self {
5997                Self::Unspecified => serializer.serialize_i32(0),
5998                Self::Unknown => serializer.serialize_i32(1),
5999                Self::VirusOrWorm => serializer.serialize_i32(2),
6000                Self::MaliciousProgram => serializer.serialize_i32(3),
6001                Self::PotentiallyHarmfulContent => serializer.serialize_i32(4),
6002                Self::PotentiallyUnwantedContent => serializer.serialize_i32(5),
6003                Self::UnknownValue(u) => u.0.serialize(serializer),
6004            }
6005        }
6006    }
6007
6008    impl<'de> serde::de::Deserialize<'de> for ThreatType {
6009        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6010        where
6011            D: serde::Deserializer<'de>,
6012        {
6013            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ThreatType>::new(
6014                ".google.cloud.modelarmor.v1.VirusDetail.ThreatType",
6015            ))
6016        }
6017    }
6018}
6019
6020/// CSAM (Child Safety Abuse Material) Filter Result
6021#[derive(Clone, Default, PartialEq)]
6022#[non_exhaustive]
6023pub struct CsamFilterResult {
6024    /// Output only. Reports whether the CSAM filter was successfully executed or
6025    /// not.
6026    pub execution_state: crate::model::FilterExecutionState,
6027
6028    /// Optional messages corresponding to the result.
6029    /// A message can provide warnings or error details.
6030    /// For example, if execution state is skipped then this field provides
6031    /// related reason/explanation.
6032    pub message_items: std::vec::Vec<crate::model::MessageItem>,
6033
6034    /// Output only. Match state for CSAM.
6035    pub match_state: crate::model::FilterMatchState,
6036
6037    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6038}
6039
6040impl CsamFilterResult {
6041    pub fn new() -> Self {
6042        std::default::Default::default()
6043    }
6044
6045    /// Sets the value of [execution_state][crate::model::CsamFilterResult::execution_state].
6046    ///
6047    /// # Example
6048    /// ```ignore,no_run
6049    /// # use google_cloud_modelarmor_v1::model::CsamFilterResult;
6050    /// use google_cloud_modelarmor_v1::model::FilterExecutionState;
6051    /// let x0 = CsamFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSuccess);
6052    /// let x1 = CsamFilterResult::new().set_execution_state(FilterExecutionState::ExecutionSkipped);
6053    /// ```
6054    pub fn set_execution_state<T: std::convert::Into<crate::model::FilterExecutionState>>(
6055        mut self,
6056        v: T,
6057    ) -> Self {
6058        self.execution_state = v.into();
6059        self
6060    }
6061
6062    /// Sets the value of [message_items][crate::model::CsamFilterResult::message_items].
6063    ///
6064    /// # Example
6065    /// ```ignore,no_run
6066    /// # use google_cloud_modelarmor_v1::model::CsamFilterResult;
6067    /// use google_cloud_modelarmor_v1::model::MessageItem;
6068    /// let x = CsamFilterResult::new()
6069    ///     .set_message_items([
6070    ///         MessageItem::default()/* use setters */,
6071    ///         MessageItem::default()/* use (different) setters */,
6072    ///     ]);
6073    /// ```
6074    pub fn set_message_items<T, V>(mut self, v: T) -> Self
6075    where
6076        T: std::iter::IntoIterator<Item = V>,
6077        V: std::convert::Into<crate::model::MessageItem>,
6078    {
6079        use std::iter::Iterator;
6080        self.message_items = v.into_iter().map(|i| i.into()).collect();
6081        self
6082    }
6083
6084    /// Sets the value of [match_state][crate::model::CsamFilterResult::match_state].
6085    ///
6086    /// # Example
6087    /// ```ignore,no_run
6088    /// # use google_cloud_modelarmor_v1::model::CsamFilterResult;
6089    /// use google_cloud_modelarmor_v1::model::FilterMatchState;
6090    /// let x0 = CsamFilterResult::new().set_match_state(FilterMatchState::NoMatchFound);
6091    /// let x1 = CsamFilterResult::new().set_match_state(FilterMatchState::MatchFound);
6092    /// ```
6093    pub fn set_match_state<T: std::convert::Into<crate::model::FilterMatchState>>(
6094        mut self,
6095        v: T,
6096    ) -> Self {
6097        self.match_state = v.into();
6098        self
6099    }
6100}
6101
6102impl wkt::message::Message for CsamFilterResult {
6103    fn typename() -> &'static str {
6104        "type.googleapis.com/google.cloud.modelarmor.v1.CsamFilterResult"
6105    }
6106}
6107
6108/// Message item to report information, warning or error messages.
6109#[derive(Clone, Default, PartialEq)]
6110#[non_exhaustive]
6111pub struct MessageItem {
6112    /// Type of message.
6113    pub message_type: crate::model::message_item::MessageType,
6114
6115    /// The message content.
6116    pub message: std::string::String,
6117
6118    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6119}
6120
6121impl MessageItem {
6122    pub fn new() -> Self {
6123        std::default::Default::default()
6124    }
6125
6126    /// Sets the value of [message_type][crate::model::MessageItem::message_type].
6127    ///
6128    /// # Example
6129    /// ```ignore,no_run
6130    /// # use google_cloud_modelarmor_v1::model::MessageItem;
6131    /// use google_cloud_modelarmor_v1::model::message_item::MessageType;
6132    /// let x0 = MessageItem::new().set_message_type(MessageType::Info);
6133    /// let x1 = MessageItem::new().set_message_type(MessageType::Warning);
6134    /// let x2 = MessageItem::new().set_message_type(MessageType::Error);
6135    /// ```
6136    pub fn set_message_type<T: std::convert::Into<crate::model::message_item::MessageType>>(
6137        mut self,
6138        v: T,
6139    ) -> Self {
6140        self.message_type = v.into();
6141        self
6142    }
6143
6144    /// Sets the value of [message][crate::model::MessageItem::message].
6145    ///
6146    /// # Example
6147    /// ```ignore,no_run
6148    /// # use google_cloud_modelarmor_v1::model::MessageItem;
6149    /// let x = MessageItem::new().set_message("example");
6150    /// ```
6151    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6152        self.message = v.into();
6153        self
6154    }
6155}
6156
6157impl wkt::message::Message for MessageItem {
6158    fn typename() -> &'static str {
6159        "type.googleapis.com/google.cloud.modelarmor.v1.MessageItem"
6160    }
6161}
6162
6163/// Defines additional types related to [MessageItem].
6164pub mod message_item {
6165    #[allow(unused_imports)]
6166    use super::*;
6167
6168    /// Option to specify the type of message.
6169    ///
6170    /// # Working with unknown values
6171    ///
6172    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6173    /// additional enum variants at any time. Adding new variants is not considered
6174    /// a breaking change. Applications should write their code in anticipation of:
6175    ///
6176    /// - New values appearing in future releases of the client library, **and**
6177    /// - New values received dynamically, without application changes.
6178    ///
6179    /// Please consult the [Working with enums] section in the user guide for some
6180    /// guidelines.
6181    ///
6182    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6183    #[derive(Clone, Debug, PartialEq)]
6184    #[non_exhaustive]
6185    pub enum MessageType {
6186        /// Unused
6187        Unspecified,
6188        /// Information related message.
6189        Info,
6190        /// Warning related message.
6191        Warning,
6192        /// Error message.
6193        Error,
6194        /// If set, the enum was initialized with an unknown value.
6195        ///
6196        /// Applications can examine the value using [MessageType::value] or
6197        /// [MessageType::name].
6198        UnknownValue(message_type::UnknownValue),
6199    }
6200
6201    #[doc(hidden)]
6202    pub mod message_type {
6203        #[allow(unused_imports)]
6204        use super::*;
6205        #[derive(Clone, Debug, PartialEq)]
6206        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6207    }
6208
6209    impl MessageType {
6210        /// Gets the enum value.
6211        ///
6212        /// Returns `None` if the enum contains an unknown value deserialized from
6213        /// the string representation of enums.
6214        pub fn value(&self) -> std::option::Option<i32> {
6215            match self {
6216                Self::Unspecified => std::option::Option::Some(0),
6217                Self::Info => std::option::Option::Some(1),
6218                Self::Warning => std::option::Option::Some(2),
6219                Self::Error => std::option::Option::Some(3),
6220                Self::UnknownValue(u) => u.0.value(),
6221            }
6222        }
6223
6224        /// Gets the enum value as a string.
6225        ///
6226        /// Returns `None` if the enum contains an unknown value deserialized from
6227        /// the integer representation of enums.
6228        pub fn name(&self) -> std::option::Option<&str> {
6229            match self {
6230                Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
6231                Self::Info => std::option::Option::Some("INFO"),
6232                Self::Warning => std::option::Option::Some("WARNING"),
6233                Self::Error => std::option::Option::Some("ERROR"),
6234                Self::UnknownValue(u) => u.0.name(),
6235            }
6236        }
6237    }
6238
6239    impl std::default::Default for MessageType {
6240        fn default() -> Self {
6241            use std::convert::From;
6242            Self::from(0)
6243        }
6244    }
6245
6246    impl std::fmt::Display for MessageType {
6247        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6248            wkt::internal::display_enum(f, self.name(), self.value())
6249        }
6250    }
6251
6252    impl std::convert::From<i32> for MessageType {
6253        fn from(value: i32) -> Self {
6254            match value {
6255                0 => Self::Unspecified,
6256                1 => Self::Info,
6257                2 => Self::Warning,
6258                3 => Self::Error,
6259                _ => Self::UnknownValue(message_type::UnknownValue(
6260                    wkt::internal::UnknownEnumValue::Integer(value),
6261                )),
6262            }
6263        }
6264    }
6265
6266    impl std::convert::From<&str> for MessageType {
6267        fn from(value: &str) -> Self {
6268            use std::string::ToString;
6269            match value {
6270                "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
6271                "INFO" => Self::Info,
6272                "WARNING" => Self::Warning,
6273                "ERROR" => Self::Error,
6274                _ => Self::UnknownValue(message_type::UnknownValue(
6275                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6276                )),
6277            }
6278        }
6279    }
6280
6281    impl serde::ser::Serialize for MessageType {
6282        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6283        where
6284            S: serde::Serializer,
6285        {
6286            match self {
6287                Self::Unspecified => serializer.serialize_i32(0),
6288                Self::Info => serializer.serialize_i32(1),
6289                Self::Warning => serializer.serialize_i32(2),
6290                Self::Error => serializer.serialize_i32(3),
6291                Self::UnknownValue(u) => u.0.serialize(serializer),
6292            }
6293        }
6294    }
6295
6296    impl<'de> serde::de::Deserialize<'de> for MessageType {
6297        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6298        where
6299            D: serde::Deserializer<'de>,
6300        {
6301            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
6302                ".google.cloud.modelarmor.v1.MessageItem.MessageType",
6303            ))
6304        }
6305    }
6306}
6307
6308/// Half-open range interval [start, end)
6309#[derive(Clone, Default, PartialEq)]
6310#[non_exhaustive]
6311pub struct RangeInfo {
6312    /// For proto3, value cannot be set to 0 unless the field is optional.
6313    /// Ref: <https://protobuf.dev/programming-guides/proto3/#default>
6314    /// Index of first character (inclusive).
6315    pub start: std::option::Option<i64>,
6316
6317    /// Index of last character (exclusive).
6318    pub end: std::option::Option<i64>,
6319
6320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6321}
6322
6323impl RangeInfo {
6324    pub fn new() -> Self {
6325        std::default::Default::default()
6326    }
6327
6328    /// Sets the value of [start][crate::model::RangeInfo::start].
6329    ///
6330    /// # Example
6331    /// ```ignore,no_run
6332    /// # use google_cloud_modelarmor_v1::model::RangeInfo;
6333    /// let x = RangeInfo::new().set_start(42);
6334    /// ```
6335    pub fn set_start<T>(mut self, v: T) -> Self
6336    where
6337        T: std::convert::Into<i64>,
6338    {
6339        self.start = std::option::Option::Some(v.into());
6340        self
6341    }
6342
6343    /// Sets or clears the value of [start][crate::model::RangeInfo::start].
6344    ///
6345    /// # Example
6346    /// ```ignore,no_run
6347    /// # use google_cloud_modelarmor_v1::model::RangeInfo;
6348    /// let x = RangeInfo::new().set_or_clear_start(Some(42));
6349    /// let x = RangeInfo::new().set_or_clear_start(None::<i32>);
6350    /// ```
6351    pub fn set_or_clear_start<T>(mut self, v: std::option::Option<T>) -> Self
6352    where
6353        T: std::convert::Into<i64>,
6354    {
6355        self.start = v.map(|x| x.into());
6356        self
6357    }
6358
6359    /// Sets the value of [end][crate::model::RangeInfo::end].
6360    ///
6361    /// # Example
6362    /// ```ignore,no_run
6363    /// # use google_cloud_modelarmor_v1::model::RangeInfo;
6364    /// let x = RangeInfo::new().set_end(42);
6365    /// ```
6366    pub fn set_end<T>(mut self, v: T) -> Self
6367    where
6368        T: std::convert::Into<i64>,
6369    {
6370        self.end = std::option::Option::Some(v.into());
6371        self
6372    }
6373
6374    /// Sets or clears the value of [end][crate::model::RangeInfo::end].
6375    ///
6376    /// # Example
6377    /// ```ignore,no_run
6378    /// # use google_cloud_modelarmor_v1::model::RangeInfo;
6379    /// let x = RangeInfo::new().set_or_clear_end(Some(42));
6380    /// let x = RangeInfo::new().set_or_clear_end(None::<i32>);
6381    /// ```
6382    pub fn set_or_clear_end<T>(mut self, v: std::option::Option<T>) -> Self
6383    where
6384        T: std::convert::Into<i64>,
6385    {
6386        self.end = v.map(|x| x.into());
6387        self
6388    }
6389}
6390
6391impl wkt::message::Message for RangeInfo {
6392    fn typename() -> &'static str {
6393        "type.googleapis.com/google.cloud.modelarmor.v1.RangeInfo"
6394    }
6395}
6396
6397/// Option to specify filter match state.
6398///
6399/// # Working with unknown values
6400///
6401/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6402/// additional enum variants at any time. Adding new variants is not considered
6403/// a breaking change. Applications should write their code in anticipation of:
6404///
6405/// - New values appearing in future releases of the client library, **and**
6406/// - New values received dynamically, without application changes.
6407///
6408/// Please consult the [Working with enums] section in the user guide for some
6409/// guidelines.
6410///
6411/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6412#[derive(Clone, Debug, PartialEq)]
6413#[non_exhaustive]
6414pub enum FilterMatchState {
6415    /// Unused
6416    Unspecified,
6417    /// Matching criteria is not achieved for filters.
6418    NoMatchFound,
6419    /// Matching criteria is achieved for the filter.
6420    MatchFound,
6421    /// If set, the enum was initialized with an unknown value.
6422    ///
6423    /// Applications can examine the value using [FilterMatchState::value] or
6424    /// [FilterMatchState::name].
6425    UnknownValue(filter_match_state::UnknownValue),
6426}
6427
6428#[doc(hidden)]
6429pub mod filter_match_state {
6430    #[allow(unused_imports)]
6431    use super::*;
6432    #[derive(Clone, Debug, PartialEq)]
6433    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6434}
6435
6436impl FilterMatchState {
6437    /// Gets the enum value.
6438    ///
6439    /// Returns `None` if the enum contains an unknown value deserialized from
6440    /// the string representation of enums.
6441    pub fn value(&self) -> std::option::Option<i32> {
6442        match self {
6443            Self::Unspecified => std::option::Option::Some(0),
6444            Self::NoMatchFound => std::option::Option::Some(1),
6445            Self::MatchFound => std::option::Option::Some(2),
6446            Self::UnknownValue(u) => u.0.value(),
6447        }
6448    }
6449
6450    /// Gets the enum value as a string.
6451    ///
6452    /// Returns `None` if the enum contains an unknown value deserialized from
6453    /// the integer representation of enums.
6454    pub fn name(&self) -> std::option::Option<&str> {
6455        match self {
6456            Self::Unspecified => std::option::Option::Some("FILTER_MATCH_STATE_UNSPECIFIED"),
6457            Self::NoMatchFound => std::option::Option::Some("NO_MATCH_FOUND"),
6458            Self::MatchFound => std::option::Option::Some("MATCH_FOUND"),
6459            Self::UnknownValue(u) => u.0.name(),
6460        }
6461    }
6462}
6463
6464impl std::default::Default for FilterMatchState {
6465    fn default() -> Self {
6466        use std::convert::From;
6467        Self::from(0)
6468    }
6469}
6470
6471impl std::fmt::Display for FilterMatchState {
6472    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6473        wkt::internal::display_enum(f, self.name(), self.value())
6474    }
6475}
6476
6477impl std::convert::From<i32> for FilterMatchState {
6478    fn from(value: i32) -> Self {
6479        match value {
6480            0 => Self::Unspecified,
6481            1 => Self::NoMatchFound,
6482            2 => Self::MatchFound,
6483            _ => Self::UnknownValue(filter_match_state::UnknownValue(
6484                wkt::internal::UnknownEnumValue::Integer(value),
6485            )),
6486        }
6487    }
6488}
6489
6490impl std::convert::From<&str> for FilterMatchState {
6491    fn from(value: &str) -> Self {
6492        use std::string::ToString;
6493        match value {
6494            "FILTER_MATCH_STATE_UNSPECIFIED" => Self::Unspecified,
6495            "NO_MATCH_FOUND" => Self::NoMatchFound,
6496            "MATCH_FOUND" => Self::MatchFound,
6497            _ => Self::UnknownValue(filter_match_state::UnknownValue(
6498                wkt::internal::UnknownEnumValue::String(value.to_string()),
6499            )),
6500        }
6501    }
6502}
6503
6504impl serde::ser::Serialize for FilterMatchState {
6505    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6506    where
6507        S: serde::Serializer,
6508    {
6509        match self {
6510            Self::Unspecified => serializer.serialize_i32(0),
6511            Self::NoMatchFound => serializer.serialize_i32(1),
6512            Self::MatchFound => serializer.serialize_i32(2),
6513            Self::UnknownValue(u) => u.0.serialize(serializer),
6514        }
6515    }
6516}
6517
6518impl<'de> serde::de::Deserialize<'de> for FilterMatchState {
6519    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6520    where
6521        D: serde::Deserializer<'de>,
6522    {
6523        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FilterMatchState>::new(
6524            ".google.cloud.modelarmor.v1.FilterMatchState",
6525        ))
6526    }
6527}
6528
6529/// Enum which reports whether a specific filter executed successfully or not.
6530///
6531/// # Working with unknown values
6532///
6533/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6534/// additional enum variants at any time. Adding new variants is not considered
6535/// a breaking change. Applications should write their code in anticipation of:
6536///
6537/// - New values appearing in future releases of the client library, **and**
6538/// - New values received dynamically, without application changes.
6539///
6540/// Please consult the [Working with enums] section in the user guide for some
6541/// guidelines.
6542///
6543/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6544#[derive(Clone, Debug, PartialEq)]
6545#[non_exhaustive]
6546pub enum FilterExecutionState {
6547    /// Unused
6548    Unspecified,
6549    /// Filter executed successfully
6550    ExecutionSuccess,
6551    /// Filter execution was skipped. This can happen due to server-side error
6552    /// or permission issue.
6553    ExecutionSkipped,
6554    /// If set, the enum was initialized with an unknown value.
6555    ///
6556    /// Applications can examine the value using [FilterExecutionState::value] or
6557    /// [FilterExecutionState::name].
6558    UnknownValue(filter_execution_state::UnknownValue),
6559}
6560
6561#[doc(hidden)]
6562pub mod filter_execution_state {
6563    #[allow(unused_imports)]
6564    use super::*;
6565    #[derive(Clone, Debug, PartialEq)]
6566    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6567}
6568
6569impl FilterExecutionState {
6570    /// Gets the enum value.
6571    ///
6572    /// Returns `None` if the enum contains an unknown value deserialized from
6573    /// the string representation of enums.
6574    pub fn value(&self) -> std::option::Option<i32> {
6575        match self {
6576            Self::Unspecified => std::option::Option::Some(0),
6577            Self::ExecutionSuccess => std::option::Option::Some(1),
6578            Self::ExecutionSkipped => std::option::Option::Some(2),
6579            Self::UnknownValue(u) => u.0.value(),
6580        }
6581    }
6582
6583    /// Gets the enum value as a string.
6584    ///
6585    /// Returns `None` if the enum contains an unknown value deserialized from
6586    /// the integer representation of enums.
6587    pub fn name(&self) -> std::option::Option<&str> {
6588        match self {
6589            Self::Unspecified => std::option::Option::Some("FILTER_EXECUTION_STATE_UNSPECIFIED"),
6590            Self::ExecutionSuccess => std::option::Option::Some("EXECUTION_SUCCESS"),
6591            Self::ExecutionSkipped => std::option::Option::Some("EXECUTION_SKIPPED"),
6592            Self::UnknownValue(u) => u.0.name(),
6593        }
6594    }
6595}
6596
6597impl std::default::Default for FilterExecutionState {
6598    fn default() -> Self {
6599        use std::convert::From;
6600        Self::from(0)
6601    }
6602}
6603
6604impl std::fmt::Display for FilterExecutionState {
6605    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6606        wkt::internal::display_enum(f, self.name(), self.value())
6607    }
6608}
6609
6610impl std::convert::From<i32> for FilterExecutionState {
6611    fn from(value: i32) -> Self {
6612        match value {
6613            0 => Self::Unspecified,
6614            1 => Self::ExecutionSuccess,
6615            2 => Self::ExecutionSkipped,
6616            _ => Self::UnknownValue(filter_execution_state::UnknownValue(
6617                wkt::internal::UnknownEnumValue::Integer(value),
6618            )),
6619        }
6620    }
6621}
6622
6623impl std::convert::From<&str> for FilterExecutionState {
6624    fn from(value: &str) -> Self {
6625        use std::string::ToString;
6626        match value {
6627            "FILTER_EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
6628            "EXECUTION_SUCCESS" => Self::ExecutionSuccess,
6629            "EXECUTION_SKIPPED" => Self::ExecutionSkipped,
6630            _ => Self::UnknownValue(filter_execution_state::UnknownValue(
6631                wkt::internal::UnknownEnumValue::String(value.to_string()),
6632            )),
6633        }
6634    }
6635}
6636
6637impl serde::ser::Serialize for FilterExecutionState {
6638    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6639    where
6640        S: serde::Serializer,
6641    {
6642        match self {
6643            Self::Unspecified => serializer.serialize_i32(0),
6644            Self::ExecutionSuccess => serializer.serialize_i32(1),
6645            Self::ExecutionSkipped => serializer.serialize_i32(2),
6646            Self::UnknownValue(u) => u.0.serialize(serializer),
6647        }
6648    }
6649}
6650
6651impl<'de> serde::de::Deserialize<'de> for FilterExecutionState {
6652    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6653    where
6654        D: serde::Deserializer<'de>,
6655    {
6656        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FilterExecutionState>::new(
6657            ".google.cloud.modelarmor.v1.FilterExecutionState",
6658        ))
6659    }
6660}
6661
6662/// Options for responsible AI Filter Types.
6663///
6664/// # Working with unknown values
6665///
6666/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6667/// additional enum variants at any time. Adding new variants is not considered
6668/// a breaking change. Applications should write their code in anticipation of:
6669///
6670/// - New values appearing in future releases of the client library, **and**
6671/// - New values received dynamically, without application changes.
6672///
6673/// Please consult the [Working with enums] section in the user guide for some
6674/// guidelines.
6675///
6676/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6677#[derive(Clone, Debug, PartialEq)]
6678#[non_exhaustive]
6679pub enum RaiFilterType {
6680    /// Unspecified filter type.
6681    Unspecified,
6682    /// Sexually Explicit.
6683    SexuallyExplicit,
6684    /// Hate Speech.
6685    HateSpeech,
6686    /// Harassment.
6687    Harassment,
6688    /// Danger
6689    Dangerous,
6690    /// If set, the enum was initialized with an unknown value.
6691    ///
6692    /// Applications can examine the value using [RaiFilterType::value] or
6693    /// [RaiFilterType::name].
6694    UnknownValue(rai_filter_type::UnknownValue),
6695}
6696
6697#[doc(hidden)]
6698pub mod rai_filter_type {
6699    #[allow(unused_imports)]
6700    use super::*;
6701    #[derive(Clone, Debug, PartialEq)]
6702    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6703}
6704
6705impl RaiFilterType {
6706    /// Gets the enum value.
6707    ///
6708    /// Returns `None` if the enum contains an unknown value deserialized from
6709    /// the string representation of enums.
6710    pub fn value(&self) -> std::option::Option<i32> {
6711        match self {
6712            Self::Unspecified => std::option::Option::Some(0),
6713            Self::SexuallyExplicit => std::option::Option::Some(2),
6714            Self::HateSpeech => std::option::Option::Some(3),
6715            Self::Harassment => std::option::Option::Some(6),
6716            Self::Dangerous => std::option::Option::Some(17),
6717            Self::UnknownValue(u) => u.0.value(),
6718        }
6719    }
6720
6721    /// Gets the enum value as a string.
6722    ///
6723    /// Returns `None` if the enum contains an unknown value deserialized from
6724    /// the integer representation of enums.
6725    pub fn name(&self) -> std::option::Option<&str> {
6726        match self {
6727            Self::Unspecified => std::option::Option::Some("RAI_FILTER_TYPE_UNSPECIFIED"),
6728            Self::SexuallyExplicit => std::option::Option::Some("SEXUALLY_EXPLICIT"),
6729            Self::HateSpeech => std::option::Option::Some("HATE_SPEECH"),
6730            Self::Harassment => std::option::Option::Some("HARASSMENT"),
6731            Self::Dangerous => std::option::Option::Some("DANGEROUS"),
6732            Self::UnknownValue(u) => u.0.name(),
6733        }
6734    }
6735}
6736
6737impl std::default::Default for RaiFilterType {
6738    fn default() -> Self {
6739        use std::convert::From;
6740        Self::from(0)
6741    }
6742}
6743
6744impl std::fmt::Display for RaiFilterType {
6745    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6746        wkt::internal::display_enum(f, self.name(), self.value())
6747    }
6748}
6749
6750impl std::convert::From<i32> for RaiFilterType {
6751    fn from(value: i32) -> Self {
6752        match value {
6753            0 => Self::Unspecified,
6754            2 => Self::SexuallyExplicit,
6755            3 => Self::HateSpeech,
6756            6 => Self::Harassment,
6757            17 => Self::Dangerous,
6758            _ => Self::UnknownValue(rai_filter_type::UnknownValue(
6759                wkt::internal::UnknownEnumValue::Integer(value),
6760            )),
6761        }
6762    }
6763}
6764
6765impl std::convert::From<&str> for RaiFilterType {
6766    fn from(value: &str) -> Self {
6767        use std::string::ToString;
6768        match value {
6769            "RAI_FILTER_TYPE_UNSPECIFIED" => Self::Unspecified,
6770            "SEXUALLY_EXPLICIT" => Self::SexuallyExplicit,
6771            "HATE_SPEECH" => Self::HateSpeech,
6772            "HARASSMENT" => Self::Harassment,
6773            "DANGEROUS" => Self::Dangerous,
6774            _ => Self::UnknownValue(rai_filter_type::UnknownValue(
6775                wkt::internal::UnknownEnumValue::String(value.to_string()),
6776            )),
6777        }
6778    }
6779}
6780
6781impl serde::ser::Serialize for RaiFilterType {
6782    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6783    where
6784        S: serde::Serializer,
6785    {
6786        match self {
6787            Self::Unspecified => serializer.serialize_i32(0),
6788            Self::SexuallyExplicit => serializer.serialize_i32(2),
6789            Self::HateSpeech => serializer.serialize_i32(3),
6790            Self::Harassment => serializer.serialize_i32(6),
6791            Self::Dangerous => serializer.serialize_i32(17),
6792            Self::UnknownValue(u) => u.0.serialize(serializer),
6793        }
6794    }
6795}
6796
6797impl<'de> serde::de::Deserialize<'de> for RaiFilterType {
6798    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6799    where
6800        D: serde::Deserializer<'de>,
6801    {
6802        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RaiFilterType>::new(
6803            ".google.cloud.modelarmor.v1.RaiFilterType",
6804        ))
6805    }
6806}
6807
6808/// Confidence levels for detectors.
6809/// Higher value maps to a greater confidence level. To enforce stricter level a
6810/// lower value should be used.
6811///
6812/// # Working with unknown values
6813///
6814/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6815/// additional enum variants at any time. Adding new variants is not considered
6816/// a breaking change. Applications should write their code in anticipation of:
6817///
6818/// - New values appearing in future releases of the client library, **and**
6819/// - New values received dynamically, without application changes.
6820///
6821/// Please consult the [Working with enums] section in the user guide for some
6822/// guidelines.
6823///
6824/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6825#[derive(Clone, Debug, PartialEq)]
6826#[non_exhaustive]
6827pub enum DetectionConfidenceLevel {
6828    /// Same as LOW_AND_ABOVE.
6829    Unspecified,
6830    /// Highest chance of a false positive.
6831    LowAndAbove,
6832    /// Some chance of false positives.
6833    MediumAndAbove,
6834    /// Low chance of false positives.
6835    High,
6836    /// If set, the enum was initialized with an unknown value.
6837    ///
6838    /// Applications can examine the value using [DetectionConfidenceLevel::value] or
6839    /// [DetectionConfidenceLevel::name].
6840    UnknownValue(detection_confidence_level::UnknownValue),
6841}
6842
6843#[doc(hidden)]
6844pub mod detection_confidence_level {
6845    #[allow(unused_imports)]
6846    use super::*;
6847    #[derive(Clone, Debug, PartialEq)]
6848    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6849}
6850
6851impl DetectionConfidenceLevel {
6852    /// Gets the enum value.
6853    ///
6854    /// Returns `None` if the enum contains an unknown value deserialized from
6855    /// the string representation of enums.
6856    pub fn value(&self) -> std::option::Option<i32> {
6857        match self {
6858            Self::Unspecified => std::option::Option::Some(0),
6859            Self::LowAndAbove => std::option::Option::Some(1),
6860            Self::MediumAndAbove => std::option::Option::Some(2),
6861            Self::High => std::option::Option::Some(3),
6862            Self::UnknownValue(u) => u.0.value(),
6863        }
6864    }
6865
6866    /// Gets the enum value as a string.
6867    ///
6868    /// Returns `None` if the enum contains an unknown value deserialized from
6869    /// the integer representation of enums.
6870    pub fn name(&self) -> std::option::Option<&str> {
6871        match self {
6872            Self::Unspecified => {
6873                std::option::Option::Some("DETECTION_CONFIDENCE_LEVEL_UNSPECIFIED")
6874            }
6875            Self::LowAndAbove => std::option::Option::Some("LOW_AND_ABOVE"),
6876            Self::MediumAndAbove => std::option::Option::Some("MEDIUM_AND_ABOVE"),
6877            Self::High => std::option::Option::Some("HIGH"),
6878            Self::UnknownValue(u) => u.0.name(),
6879        }
6880    }
6881}
6882
6883impl std::default::Default for DetectionConfidenceLevel {
6884    fn default() -> Self {
6885        use std::convert::From;
6886        Self::from(0)
6887    }
6888}
6889
6890impl std::fmt::Display for DetectionConfidenceLevel {
6891    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6892        wkt::internal::display_enum(f, self.name(), self.value())
6893    }
6894}
6895
6896impl std::convert::From<i32> for DetectionConfidenceLevel {
6897    fn from(value: i32) -> Self {
6898        match value {
6899            0 => Self::Unspecified,
6900            1 => Self::LowAndAbove,
6901            2 => Self::MediumAndAbove,
6902            3 => Self::High,
6903            _ => Self::UnknownValue(detection_confidence_level::UnknownValue(
6904                wkt::internal::UnknownEnumValue::Integer(value),
6905            )),
6906        }
6907    }
6908}
6909
6910impl std::convert::From<&str> for DetectionConfidenceLevel {
6911    fn from(value: &str) -> Self {
6912        use std::string::ToString;
6913        match value {
6914            "DETECTION_CONFIDENCE_LEVEL_UNSPECIFIED" => Self::Unspecified,
6915            "LOW_AND_ABOVE" => Self::LowAndAbove,
6916            "MEDIUM_AND_ABOVE" => Self::MediumAndAbove,
6917            "HIGH" => Self::High,
6918            _ => Self::UnknownValue(detection_confidence_level::UnknownValue(
6919                wkt::internal::UnknownEnumValue::String(value.to_string()),
6920            )),
6921        }
6922    }
6923}
6924
6925impl serde::ser::Serialize for DetectionConfidenceLevel {
6926    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6927    where
6928        S: serde::Serializer,
6929    {
6930        match self {
6931            Self::Unspecified => serializer.serialize_i32(0),
6932            Self::LowAndAbove => serializer.serialize_i32(1),
6933            Self::MediumAndAbove => serializer.serialize_i32(2),
6934            Self::High => serializer.serialize_i32(3),
6935            Self::UnknownValue(u) => u.0.serialize(serializer),
6936        }
6937    }
6938}
6939
6940impl<'de> serde::de::Deserialize<'de> for DetectionConfidenceLevel {
6941    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6942    where
6943        D: serde::Deserializer<'de>,
6944    {
6945        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DetectionConfidenceLevel>::new(
6946            ".google.cloud.modelarmor.v1.DetectionConfidenceLevel",
6947        ))
6948    }
6949}
6950
6951/// For more information about each Sensitive Data Protection likelihood level,
6952/// see <https://cloud.google.com/sensitive-data-protection/docs/likelihood>.
6953///
6954/// # Working with unknown values
6955///
6956/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6957/// additional enum variants at any time. Adding new variants is not considered
6958/// a breaking change. Applications should write their code in anticipation of:
6959///
6960/// - New values appearing in future releases of the client library, **and**
6961/// - New values received dynamically, without application changes.
6962///
6963/// Please consult the [Working with enums] section in the user guide for some
6964/// guidelines.
6965///
6966/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6967#[derive(Clone, Debug, PartialEq)]
6968#[non_exhaustive]
6969pub enum SdpFindingLikelihood {
6970    /// Default value; same as POSSIBLE.
6971    Unspecified,
6972    /// Highest chance of a false positive.
6973    VeryUnlikely,
6974    /// High chance of a false positive.
6975    Unlikely,
6976    /// Some matching signals. The default value.
6977    Possible,
6978    /// Low chance of a false positive.
6979    Likely,
6980    /// Confidence level is high. Lowest chance of a false positive.
6981    VeryLikely,
6982    /// If set, the enum was initialized with an unknown value.
6983    ///
6984    /// Applications can examine the value using [SdpFindingLikelihood::value] or
6985    /// [SdpFindingLikelihood::name].
6986    UnknownValue(sdp_finding_likelihood::UnknownValue),
6987}
6988
6989#[doc(hidden)]
6990pub mod sdp_finding_likelihood {
6991    #[allow(unused_imports)]
6992    use super::*;
6993    #[derive(Clone, Debug, PartialEq)]
6994    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6995}
6996
6997impl SdpFindingLikelihood {
6998    /// Gets the enum value.
6999    ///
7000    /// Returns `None` if the enum contains an unknown value deserialized from
7001    /// the string representation of enums.
7002    pub fn value(&self) -> std::option::Option<i32> {
7003        match self {
7004            Self::Unspecified => std::option::Option::Some(0),
7005            Self::VeryUnlikely => std::option::Option::Some(1),
7006            Self::Unlikely => std::option::Option::Some(2),
7007            Self::Possible => std::option::Option::Some(3),
7008            Self::Likely => std::option::Option::Some(4),
7009            Self::VeryLikely => std::option::Option::Some(5),
7010            Self::UnknownValue(u) => u.0.value(),
7011        }
7012    }
7013
7014    /// Gets the enum value as a string.
7015    ///
7016    /// Returns `None` if the enum contains an unknown value deserialized from
7017    /// the integer representation of enums.
7018    pub fn name(&self) -> std::option::Option<&str> {
7019        match self {
7020            Self::Unspecified => std::option::Option::Some("SDP_FINDING_LIKELIHOOD_UNSPECIFIED"),
7021            Self::VeryUnlikely => std::option::Option::Some("VERY_UNLIKELY"),
7022            Self::Unlikely => std::option::Option::Some("UNLIKELY"),
7023            Self::Possible => std::option::Option::Some("POSSIBLE"),
7024            Self::Likely => std::option::Option::Some("LIKELY"),
7025            Self::VeryLikely => std::option::Option::Some("VERY_LIKELY"),
7026            Self::UnknownValue(u) => u.0.name(),
7027        }
7028    }
7029}
7030
7031impl std::default::Default for SdpFindingLikelihood {
7032    fn default() -> Self {
7033        use std::convert::From;
7034        Self::from(0)
7035    }
7036}
7037
7038impl std::fmt::Display for SdpFindingLikelihood {
7039    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7040        wkt::internal::display_enum(f, self.name(), self.value())
7041    }
7042}
7043
7044impl std::convert::From<i32> for SdpFindingLikelihood {
7045    fn from(value: i32) -> Self {
7046        match value {
7047            0 => Self::Unspecified,
7048            1 => Self::VeryUnlikely,
7049            2 => Self::Unlikely,
7050            3 => Self::Possible,
7051            4 => Self::Likely,
7052            5 => Self::VeryLikely,
7053            _ => Self::UnknownValue(sdp_finding_likelihood::UnknownValue(
7054                wkt::internal::UnknownEnumValue::Integer(value),
7055            )),
7056        }
7057    }
7058}
7059
7060impl std::convert::From<&str> for SdpFindingLikelihood {
7061    fn from(value: &str) -> Self {
7062        use std::string::ToString;
7063        match value {
7064            "SDP_FINDING_LIKELIHOOD_UNSPECIFIED" => Self::Unspecified,
7065            "VERY_UNLIKELY" => Self::VeryUnlikely,
7066            "UNLIKELY" => Self::Unlikely,
7067            "POSSIBLE" => Self::Possible,
7068            "LIKELY" => Self::Likely,
7069            "VERY_LIKELY" => Self::VeryLikely,
7070            _ => Self::UnknownValue(sdp_finding_likelihood::UnknownValue(
7071                wkt::internal::UnknownEnumValue::String(value.to_string()),
7072            )),
7073        }
7074    }
7075}
7076
7077impl serde::ser::Serialize for SdpFindingLikelihood {
7078    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7079    where
7080        S: serde::Serializer,
7081    {
7082        match self {
7083            Self::Unspecified => serializer.serialize_i32(0),
7084            Self::VeryUnlikely => serializer.serialize_i32(1),
7085            Self::Unlikely => serializer.serialize_i32(2),
7086            Self::Possible => serializer.serialize_i32(3),
7087            Self::Likely => serializer.serialize_i32(4),
7088            Self::VeryLikely => serializer.serialize_i32(5),
7089            Self::UnknownValue(u) => u.0.serialize(serializer),
7090        }
7091    }
7092}
7093
7094impl<'de> serde::de::Deserialize<'de> for SdpFindingLikelihood {
7095    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7096    where
7097        D: serde::Deserializer<'de>,
7098    {
7099        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SdpFindingLikelihood>::new(
7100            ".google.cloud.modelarmor.v1.SdpFindingLikelihood",
7101        ))
7102    }
7103}
7104
7105/// A field indicating the outcome of the invocation, irrespective of match
7106/// status.
7107///
7108/// # Working with unknown values
7109///
7110/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7111/// additional enum variants at any time. Adding new variants is not considered
7112/// a breaking change. Applications should write their code in anticipation of:
7113///
7114/// - New values appearing in future releases of the client library, **and**
7115/// - New values received dynamically, without application changes.
7116///
7117/// Please consult the [Working with enums] section in the user guide for some
7118/// guidelines.
7119///
7120/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7121#[derive(Clone, Debug, PartialEq)]
7122#[non_exhaustive]
7123pub enum InvocationResult {
7124    /// Unused. Default value.
7125    Unspecified,
7126    /// All filters were invoked successfully.
7127    Success,
7128    /// Some filters were skipped or failed.
7129    Partial,
7130    /// All filters were skipped or failed.
7131    Failure,
7132    /// If set, the enum was initialized with an unknown value.
7133    ///
7134    /// Applications can examine the value using [InvocationResult::value] or
7135    /// [InvocationResult::name].
7136    UnknownValue(invocation_result::UnknownValue),
7137}
7138
7139#[doc(hidden)]
7140pub mod invocation_result {
7141    #[allow(unused_imports)]
7142    use super::*;
7143    #[derive(Clone, Debug, PartialEq)]
7144    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7145}
7146
7147impl InvocationResult {
7148    /// Gets the enum value.
7149    ///
7150    /// Returns `None` if the enum contains an unknown value deserialized from
7151    /// the string representation of enums.
7152    pub fn value(&self) -> std::option::Option<i32> {
7153        match self {
7154            Self::Unspecified => std::option::Option::Some(0),
7155            Self::Success => std::option::Option::Some(1),
7156            Self::Partial => std::option::Option::Some(2),
7157            Self::Failure => std::option::Option::Some(3),
7158            Self::UnknownValue(u) => u.0.value(),
7159        }
7160    }
7161
7162    /// Gets the enum value as a string.
7163    ///
7164    /// Returns `None` if the enum contains an unknown value deserialized from
7165    /// the integer representation of enums.
7166    pub fn name(&self) -> std::option::Option<&str> {
7167        match self {
7168            Self::Unspecified => std::option::Option::Some("INVOCATION_RESULT_UNSPECIFIED"),
7169            Self::Success => std::option::Option::Some("SUCCESS"),
7170            Self::Partial => std::option::Option::Some("PARTIAL"),
7171            Self::Failure => std::option::Option::Some("FAILURE"),
7172            Self::UnknownValue(u) => u.0.name(),
7173        }
7174    }
7175}
7176
7177impl std::default::Default for InvocationResult {
7178    fn default() -> Self {
7179        use std::convert::From;
7180        Self::from(0)
7181    }
7182}
7183
7184impl std::fmt::Display for InvocationResult {
7185    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7186        wkt::internal::display_enum(f, self.name(), self.value())
7187    }
7188}
7189
7190impl std::convert::From<i32> for InvocationResult {
7191    fn from(value: i32) -> Self {
7192        match value {
7193            0 => Self::Unspecified,
7194            1 => Self::Success,
7195            2 => Self::Partial,
7196            3 => Self::Failure,
7197            _ => Self::UnknownValue(invocation_result::UnknownValue(
7198                wkt::internal::UnknownEnumValue::Integer(value),
7199            )),
7200        }
7201    }
7202}
7203
7204impl std::convert::From<&str> for InvocationResult {
7205    fn from(value: &str) -> Self {
7206        use std::string::ToString;
7207        match value {
7208            "INVOCATION_RESULT_UNSPECIFIED" => Self::Unspecified,
7209            "SUCCESS" => Self::Success,
7210            "PARTIAL" => Self::Partial,
7211            "FAILURE" => Self::Failure,
7212            _ => Self::UnknownValue(invocation_result::UnknownValue(
7213                wkt::internal::UnknownEnumValue::String(value.to_string()),
7214            )),
7215        }
7216    }
7217}
7218
7219impl serde::ser::Serialize for InvocationResult {
7220    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7221    where
7222        S: serde::Serializer,
7223    {
7224        match self {
7225            Self::Unspecified => serializer.serialize_i32(0),
7226            Self::Success => serializer.serialize_i32(1),
7227            Self::Partial => serializer.serialize_i32(2),
7228            Self::Failure => serializer.serialize_i32(3),
7229            Self::UnknownValue(u) => u.0.serialize(serializer),
7230        }
7231    }
7232}
7233
7234impl<'de> serde::de::Deserialize<'de> for InvocationResult {
7235    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7236    where
7237        D: serde::Deserializer<'de>,
7238    {
7239        deserializer.deserialize_any(wkt::internal::EnumVisitor::<InvocationResult>::new(
7240            ".google.cloud.modelarmor.v1.InvocationResult",
7241        ))
7242    }
7243}