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