Skip to main content

google_cloud_connectors_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// AuthConfig defines details of a authentication type.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct AuthConfig {
43    /// The type of authentication configured.
44    pub auth_type: crate::model::AuthType,
45
46    /// List containing additional auth configs.
47    pub additional_variables: std::vec::Vec<crate::model::ConfigVariable>,
48
49    /// Supported auth types.
50    pub r#type: std::option::Option<crate::model::auth_config::Type>,
51
52    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl AuthConfig {
56    pub fn new() -> Self {
57        std::default::Default::default()
58    }
59
60    /// Sets the value of [auth_type][crate::model::AuthConfig::auth_type].
61    ///
62    /// # Example
63    /// ```ignore,no_run
64    /// # use google_cloud_connectors_v1::model::AuthConfig;
65    /// use google_cloud_connectors_v1::model::AuthType;
66    /// let x0 = AuthConfig::new().set_auth_type(AuthType::UserPassword);
67    /// let x1 = AuthConfig::new().set_auth_type(AuthType::Oauth2JwtBearer);
68    /// let x2 = AuthConfig::new().set_auth_type(AuthType::Oauth2ClientCredentials);
69    /// ```
70    pub fn set_auth_type<T: std::convert::Into<crate::model::AuthType>>(mut self, v: T) -> Self {
71        self.auth_type = v.into();
72        self
73    }
74
75    /// Sets the value of [additional_variables][crate::model::AuthConfig::additional_variables].
76    ///
77    /// # Example
78    /// ```ignore,no_run
79    /// # use google_cloud_connectors_v1::model::AuthConfig;
80    /// use google_cloud_connectors_v1::model::ConfigVariable;
81    /// let x = AuthConfig::new()
82    ///     .set_additional_variables([
83    ///         ConfigVariable::default()/* use setters */,
84    ///         ConfigVariable::default()/* use (different) setters */,
85    ///     ]);
86    /// ```
87    pub fn set_additional_variables<T, V>(mut self, v: T) -> Self
88    where
89        T: std::iter::IntoIterator<Item = V>,
90        V: std::convert::Into<crate::model::ConfigVariable>,
91    {
92        use std::iter::Iterator;
93        self.additional_variables = v.into_iter().map(|i| i.into()).collect();
94        self
95    }
96
97    /// Sets the value of [r#type][crate::model::AuthConfig::type].
98    ///
99    /// Note that all the setters affecting `r#type` are mutually
100    /// exclusive.
101    ///
102    /// # Example
103    /// ```ignore,no_run
104    /// # use google_cloud_connectors_v1::model::AuthConfig;
105    /// use google_cloud_connectors_v1::model::auth_config::UserPassword;
106    /// let x = AuthConfig::new().set_type(Some(
107    ///     google_cloud_connectors_v1::model::auth_config::Type::UserPassword(UserPassword::default().into())));
108    /// ```
109    pub fn set_type<T: std::convert::Into<std::option::Option<crate::model::auth_config::Type>>>(
110        mut self,
111        v: T,
112    ) -> Self {
113        self.r#type = v.into();
114        self
115    }
116
117    /// The value of [r#type][crate::model::AuthConfig::r#type]
118    /// if it holds a `UserPassword`, `None` if the field is not set or
119    /// holds a different branch.
120    pub fn user_password(
121        &self,
122    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::UserPassword>> {
123        #[allow(unreachable_patterns)]
124        self.r#type.as_ref().and_then(|v| match v {
125            crate::model::auth_config::Type::UserPassword(v) => std::option::Option::Some(v),
126            _ => std::option::Option::None,
127        })
128    }
129
130    /// Sets the value of [r#type][crate::model::AuthConfig::r#type]
131    /// to hold a `UserPassword`.
132    ///
133    /// Note that all the setters affecting `r#type` are
134    /// mutually exclusive.
135    ///
136    /// # Example
137    /// ```ignore,no_run
138    /// # use google_cloud_connectors_v1::model::AuthConfig;
139    /// use google_cloud_connectors_v1::model::auth_config::UserPassword;
140    /// let x = AuthConfig::new().set_user_password(UserPassword::default()/* use setters */);
141    /// assert!(x.user_password().is_some());
142    /// assert!(x.oauth2_jwt_bearer().is_none());
143    /// assert!(x.oauth2_client_credentials().is_none());
144    /// assert!(x.ssh_public_key().is_none());
145    /// ```
146    pub fn set_user_password<
147        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::UserPassword>>,
148    >(
149        mut self,
150        v: T,
151    ) -> Self {
152        self.r#type =
153            std::option::Option::Some(crate::model::auth_config::Type::UserPassword(v.into()));
154        self
155    }
156
157    /// The value of [r#type][crate::model::AuthConfig::r#type]
158    /// if it holds a `Oauth2JwtBearer`, `None` if the field is not set or
159    /// holds a different branch.
160    pub fn oauth2_jwt_bearer(
161        &self,
162    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::Oauth2JwtBearer>> {
163        #[allow(unreachable_patterns)]
164        self.r#type.as_ref().and_then(|v| match v {
165            crate::model::auth_config::Type::Oauth2JwtBearer(v) => std::option::Option::Some(v),
166            _ => std::option::Option::None,
167        })
168    }
169
170    /// Sets the value of [r#type][crate::model::AuthConfig::r#type]
171    /// to hold a `Oauth2JwtBearer`.
172    ///
173    /// Note that all the setters affecting `r#type` are
174    /// mutually exclusive.
175    ///
176    /// # Example
177    /// ```ignore,no_run
178    /// # use google_cloud_connectors_v1::model::AuthConfig;
179    /// use google_cloud_connectors_v1::model::auth_config::Oauth2JwtBearer;
180    /// let x = AuthConfig::new().set_oauth2_jwt_bearer(Oauth2JwtBearer::default()/* use setters */);
181    /// assert!(x.oauth2_jwt_bearer().is_some());
182    /// assert!(x.user_password().is_none());
183    /// assert!(x.oauth2_client_credentials().is_none());
184    /// assert!(x.ssh_public_key().is_none());
185    /// ```
186    pub fn set_oauth2_jwt_bearer<
187        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::Oauth2JwtBearer>>,
188    >(
189        mut self,
190        v: T,
191    ) -> Self {
192        self.r#type =
193            std::option::Option::Some(crate::model::auth_config::Type::Oauth2JwtBearer(v.into()));
194        self
195    }
196
197    /// The value of [r#type][crate::model::AuthConfig::r#type]
198    /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
199    /// holds a different branch.
200    pub fn oauth2_client_credentials(
201        &self,
202    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentials>>
203    {
204        #[allow(unreachable_patterns)]
205        self.r#type.as_ref().and_then(|v| match v {
206            crate::model::auth_config::Type::Oauth2ClientCredentials(v) => {
207                std::option::Option::Some(v)
208            }
209            _ => std::option::Option::None,
210        })
211    }
212
213    /// Sets the value of [r#type][crate::model::AuthConfig::r#type]
214    /// to hold a `Oauth2ClientCredentials`.
215    ///
216    /// Note that all the setters affecting `r#type` are
217    /// mutually exclusive.
218    ///
219    /// # Example
220    /// ```ignore,no_run
221    /// # use google_cloud_connectors_v1::model::AuthConfig;
222    /// use google_cloud_connectors_v1::model::auth_config::Oauth2ClientCredentials;
223    /// let x = AuthConfig::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
224    /// assert!(x.oauth2_client_credentials().is_some());
225    /// assert!(x.user_password().is_none());
226    /// assert!(x.oauth2_jwt_bearer().is_none());
227    /// assert!(x.ssh_public_key().is_none());
228    /// ```
229    pub fn set_oauth2_client_credentials<
230        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentials>>,
231    >(
232        mut self,
233        v: T,
234    ) -> Self {
235        self.r#type = std::option::Option::Some(
236            crate::model::auth_config::Type::Oauth2ClientCredentials(v.into()),
237        );
238        self
239    }
240
241    /// The value of [r#type][crate::model::AuthConfig::r#type]
242    /// if it holds a `SshPublicKey`, `None` if the field is not set or
243    /// holds a different branch.
244    pub fn ssh_public_key(
245        &self,
246    ) -> std::option::Option<&std::boxed::Box<crate::model::auth_config::SshPublicKey>> {
247        #[allow(unreachable_patterns)]
248        self.r#type.as_ref().and_then(|v| match v {
249            crate::model::auth_config::Type::SshPublicKey(v) => std::option::Option::Some(v),
250            _ => std::option::Option::None,
251        })
252    }
253
254    /// Sets the value of [r#type][crate::model::AuthConfig::r#type]
255    /// to hold a `SshPublicKey`.
256    ///
257    /// Note that all the setters affecting `r#type` are
258    /// mutually exclusive.
259    ///
260    /// # Example
261    /// ```ignore,no_run
262    /// # use google_cloud_connectors_v1::model::AuthConfig;
263    /// use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
264    /// let x = AuthConfig::new().set_ssh_public_key(SshPublicKey::default()/* use setters */);
265    /// assert!(x.ssh_public_key().is_some());
266    /// assert!(x.user_password().is_none());
267    /// assert!(x.oauth2_jwt_bearer().is_none());
268    /// assert!(x.oauth2_client_credentials().is_none());
269    /// ```
270    pub fn set_ssh_public_key<
271        T: std::convert::Into<std::boxed::Box<crate::model::auth_config::SshPublicKey>>,
272    >(
273        mut self,
274        v: T,
275    ) -> Self {
276        self.r#type =
277            std::option::Option::Some(crate::model::auth_config::Type::SshPublicKey(v.into()));
278        self
279    }
280}
281
282impl wkt::message::Message for AuthConfig {
283    fn typename() -> &'static str {
284        "type.googleapis.com/google.cloud.connectors.v1.AuthConfig"
285    }
286}
287
288/// Defines additional types related to [AuthConfig].
289pub mod auth_config {
290    #[allow(unused_imports)]
291    use super::*;
292
293    /// Parameters to support Username and Password Authentication.
294    #[derive(Clone, Default, PartialEq)]
295    #[non_exhaustive]
296    pub struct UserPassword {
297        /// Username.
298        pub username: std::string::String,
299
300        /// Secret version reference containing the password.
301        pub password: std::option::Option<crate::model::Secret>,
302
303        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
304    }
305
306    impl UserPassword {
307        pub fn new() -> Self {
308            std::default::Default::default()
309        }
310
311        /// Sets the value of [username][crate::model::auth_config::UserPassword::username].
312        ///
313        /// # Example
314        /// ```ignore,no_run
315        /// # use google_cloud_connectors_v1::model::auth_config::UserPassword;
316        /// let x = UserPassword::new().set_username("example");
317        /// ```
318        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
319            self.username = v.into();
320            self
321        }
322
323        /// Sets the value of [password][crate::model::auth_config::UserPassword::password].
324        ///
325        /// # Example
326        /// ```ignore,no_run
327        /// # use google_cloud_connectors_v1::model::auth_config::UserPassword;
328        /// use google_cloud_connectors_v1::model::Secret;
329        /// let x = UserPassword::new().set_password(Secret::default()/* use setters */);
330        /// ```
331        pub fn set_password<T>(mut self, v: T) -> Self
332        where
333            T: std::convert::Into<crate::model::Secret>,
334        {
335            self.password = std::option::Option::Some(v.into());
336            self
337        }
338
339        /// Sets or clears the value of [password][crate::model::auth_config::UserPassword::password].
340        ///
341        /// # Example
342        /// ```ignore,no_run
343        /// # use google_cloud_connectors_v1::model::auth_config::UserPassword;
344        /// use google_cloud_connectors_v1::model::Secret;
345        /// let x = UserPassword::new().set_or_clear_password(Some(Secret::default()/* use setters */));
346        /// let x = UserPassword::new().set_or_clear_password(None::<Secret>);
347        /// ```
348        pub fn set_or_clear_password<T>(mut self, v: std::option::Option<T>) -> Self
349        where
350            T: std::convert::Into<crate::model::Secret>,
351        {
352            self.password = v.map(|x| x.into());
353            self
354        }
355    }
356
357    impl wkt::message::Message for UserPassword {
358        fn typename() -> &'static str {
359            "type.googleapis.com/google.cloud.connectors.v1.AuthConfig.UserPassword"
360        }
361    }
362
363    /// Parameters to support JSON Web Token (JWT) Profile for Oauth 2.0
364    /// Authorization Grant based authentication.
365    /// See <https://tools.ietf.org/html/rfc7523> for more details.
366    #[derive(Clone, Default, PartialEq)]
367    #[non_exhaustive]
368    pub struct Oauth2JwtBearer {
369        /// Secret version reference containing a PKCS#8 PEM-encoded private
370        /// key associated with the Client Certificate. This private key will be
371        /// used to sign JWTs used for the jwt-bearer authorization grant.
372        /// Specified in the form as: `projects/*/secrets/*/versions/*`.
373        pub client_key: std::option::Option<crate::model::Secret>,
374
375        /// JwtClaims providers fields to generate the token.
376        pub jwt_claims:
377            std::option::Option<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
378
379        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
380    }
381
382    impl Oauth2JwtBearer {
383        pub fn new() -> Self {
384            std::default::Default::default()
385        }
386
387        /// Sets the value of [client_key][crate::model::auth_config::Oauth2JwtBearer::client_key].
388        ///
389        /// # Example
390        /// ```ignore,no_run
391        /// # use google_cloud_connectors_v1::model::auth_config::Oauth2JwtBearer;
392        /// use google_cloud_connectors_v1::model::Secret;
393        /// let x = Oauth2JwtBearer::new().set_client_key(Secret::default()/* use setters */);
394        /// ```
395        pub fn set_client_key<T>(mut self, v: T) -> Self
396        where
397            T: std::convert::Into<crate::model::Secret>,
398        {
399            self.client_key = std::option::Option::Some(v.into());
400            self
401        }
402
403        /// Sets or clears the value of [client_key][crate::model::auth_config::Oauth2JwtBearer::client_key].
404        ///
405        /// # Example
406        /// ```ignore,no_run
407        /// # use google_cloud_connectors_v1::model::auth_config::Oauth2JwtBearer;
408        /// use google_cloud_connectors_v1::model::Secret;
409        /// let x = Oauth2JwtBearer::new().set_or_clear_client_key(Some(Secret::default()/* use setters */));
410        /// let x = Oauth2JwtBearer::new().set_or_clear_client_key(None::<Secret>);
411        /// ```
412        pub fn set_or_clear_client_key<T>(mut self, v: std::option::Option<T>) -> Self
413        where
414            T: std::convert::Into<crate::model::Secret>,
415        {
416            self.client_key = v.map(|x| x.into());
417            self
418        }
419
420        /// Sets the value of [jwt_claims][crate::model::auth_config::Oauth2JwtBearer::jwt_claims].
421        ///
422        /// # Example
423        /// ```ignore,no_run
424        /// # use google_cloud_connectors_v1::model::auth_config::Oauth2JwtBearer;
425        /// use google_cloud_connectors_v1::model::auth_config::oauth_2_jwt_bearer::JwtClaims;
426        /// let x = Oauth2JwtBearer::new().set_jwt_claims(JwtClaims::default()/* use setters */);
427        /// ```
428        pub fn set_jwt_claims<T>(mut self, v: T) -> Self
429        where
430            T: std::convert::Into<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
431        {
432            self.jwt_claims = std::option::Option::Some(v.into());
433            self
434        }
435
436        /// Sets or clears the value of [jwt_claims][crate::model::auth_config::Oauth2JwtBearer::jwt_claims].
437        ///
438        /// # Example
439        /// ```ignore,no_run
440        /// # use google_cloud_connectors_v1::model::auth_config::Oauth2JwtBearer;
441        /// use google_cloud_connectors_v1::model::auth_config::oauth_2_jwt_bearer::JwtClaims;
442        /// let x = Oauth2JwtBearer::new().set_or_clear_jwt_claims(Some(JwtClaims::default()/* use setters */));
443        /// let x = Oauth2JwtBearer::new().set_or_clear_jwt_claims(None::<JwtClaims>);
444        /// ```
445        pub fn set_or_clear_jwt_claims<T>(mut self, v: std::option::Option<T>) -> Self
446        where
447            T: std::convert::Into<crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims>,
448        {
449            self.jwt_claims = v.map(|x| x.into());
450            self
451        }
452    }
453
454    impl wkt::message::Message for Oauth2JwtBearer {
455        fn typename() -> &'static str {
456            "type.googleapis.com/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer"
457        }
458    }
459
460    /// Defines additional types related to [Oauth2JwtBearer].
461    pub mod oauth_2_jwt_bearer {
462        #[allow(unused_imports)]
463        use super::*;
464
465        /// JWT claims used for the jwt-bearer authorization grant.
466        #[derive(Clone, Default, PartialEq)]
467        #[non_exhaustive]
468        pub struct JwtClaims {
469            /// Value for the "iss" claim.
470            pub issuer: std::string::String,
471
472            /// Value for the "sub" claim.
473            pub subject: std::string::String,
474
475            /// Value for the "aud" claim.
476            pub audience: std::string::String,
477
478            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
479        }
480
481        impl JwtClaims {
482            pub fn new() -> Self {
483                std::default::Default::default()
484            }
485
486            /// Sets the value of [issuer][crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims::issuer].
487            ///
488            /// # Example
489            /// ```ignore,no_run
490            /// # use google_cloud_connectors_v1::model::auth_config::oauth_2_jwt_bearer::JwtClaims;
491            /// let x = JwtClaims::new().set_issuer("example");
492            /// ```
493            pub fn set_issuer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
494                self.issuer = v.into();
495                self
496            }
497
498            /// Sets the value of [subject][crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims::subject].
499            ///
500            /// # Example
501            /// ```ignore,no_run
502            /// # use google_cloud_connectors_v1::model::auth_config::oauth_2_jwt_bearer::JwtClaims;
503            /// let x = JwtClaims::new().set_subject("example");
504            /// ```
505            pub fn set_subject<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
506                self.subject = v.into();
507                self
508            }
509
510            /// Sets the value of [audience][crate::model::auth_config::oauth_2_jwt_bearer::JwtClaims::audience].
511            ///
512            /// # Example
513            /// ```ignore,no_run
514            /// # use google_cloud_connectors_v1::model::auth_config::oauth_2_jwt_bearer::JwtClaims;
515            /// let x = JwtClaims::new().set_audience("example");
516            /// ```
517            pub fn set_audience<T: std::convert::Into<std::string::String>>(
518                mut self,
519                v: T,
520            ) -> Self {
521                self.audience = v.into();
522                self
523            }
524        }
525
526        impl wkt::message::Message for JwtClaims {
527            fn typename() -> &'static str {
528                "type.googleapis.com/google.cloud.connectors.v1.AuthConfig.Oauth2JwtBearer.JwtClaims"
529            }
530        }
531    }
532
533    /// Parameters to support Oauth 2.0 Client Credentials Grant Authentication.
534    /// See <https://tools.ietf.org/html/rfc6749#section-1.3.4> for more details.
535    #[derive(Clone, Default, PartialEq)]
536    #[non_exhaustive]
537    pub struct Oauth2ClientCredentials {
538        /// The client identifier.
539        pub client_id: std::string::String,
540
541        /// Secret version reference containing the client secret.
542        pub client_secret: std::option::Option<crate::model::Secret>,
543
544        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
545    }
546
547    impl Oauth2ClientCredentials {
548        pub fn new() -> Self {
549            std::default::Default::default()
550        }
551
552        /// Sets the value of [client_id][crate::model::auth_config::Oauth2ClientCredentials::client_id].
553        ///
554        /// # Example
555        /// ```ignore,no_run
556        /// # use google_cloud_connectors_v1::model::auth_config::Oauth2ClientCredentials;
557        /// let x = Oauth2ClientCredentials::new().set_client_id("example");
558        /// ```
559        pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
560            self.client_id = v.into();
561            self
562        }
563
564        /// Sets the value of [client_secret][crate::model::auth_config::Oauth2ClientCredentials::client_secret].
565        ///
566        /// # Example
567        /// ```ignore,no_run
568        /// # use google_cloud_connectors_v1::model::auth_config::Oauth2ClientCredentials;
569        /// use google_cloud_connectors_v1::model::Secret;
570        /// let x = Oauth2ClientCredentials::new().set_client_secret(Secret::default()/* use setters */);
571        /// ```
572        pub fn set_client_secret<T>(mut self, v: T) -> Self
573        where
574            T: std::convert::Into<crate::model::Secret>,
575        {
576            self.client_secret = std::option::Option::Some(v.into());
577            self
578        }
579
580        /// Sets or clears the value of [client_secret][crate::model::auth_config::Oauth2ClientCredentials::client_secret].
581        ///
582        /// # Example
583        /// ```ignore,no_run
584        /// # use google_cloud_connectors_v1::model::auth_config::Oauth2ClientCredentials;
585        /// use google_cloud_connectors_v1::model::Secret;
586        /// let x = Oauth2ClientCredentials::new().set_or_clear_client_secret(Some(Secret::default()/* use setters */));
587        /// let x = Oauth2ClientCredentials::new().set_or_clear_client_secret(None::<Secret>);
588        /// ```
589        pub fn set_or_clear_client_secret<T>(mut self, v: std::option::Option<T>) -> Self
590        where
591            T: std::convert::Into<crate::model::Secret>,
592        {
593            self.client_secret = v.map(|x| x.into());
594            self
595        }
596    }
597
598    impl wkt::message::Message for Oauth2ClientCredentials {
599        fn typename() -> &'static str {
600            "type.googleapis.com/google.cloud.connectors.v1.AuthConfig.Oauth2ClientCredentials"
601        }
602    }
603
604    /// Parameters to support Ssh public key Authentication.
605    #[derive(Clone, Default, PartialEq)]
606    #[non_exhaustive]
607    pub struct SshPublicKey {
608        /// The user account used to authenticate.
609        pub username: std::string::String,
610
611        /// SSH Client Cert. It should contain both public and private key.
612        pub ssh_client_cert: std::option::Option<crate::model::Secret>,
613
614        /// Format of SSH Client cert.
615        pub cert_type: std::string::String,
616
617        /// Password (passphrase) for ssh client certificate if it has one.
618        pub ssh_client_cert_pass: std::option::Option<crate::model::Secret>,
619
620        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
621    }
622
623    impl SshPublicKey {
624        pub fn new() -> Self {
625            std::default::Default::default()
626        }
627
628        /// Sets the value of [username][crate::model::auth_config::SshPublicKey::username].
629        ///
630        /// # Example
631        /// ```ignore,no_run
632        /// # use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
633        /// let x = SshPublicKey::new().set_username("example");
634        /// ```
635        pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
636            self.username = v.into();
637            self
638        }
639
640        /// Sets the value of [ssh_client_cert][crate::model::auth_config::SshPublicKey::ssh_client_cert].
641        ///
642        /// # Example
643        /// ```ignore,no_run
644        /// # use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
645        /// use google_cloud_connectors_v1::model::Secret;
646        /// let x = SshPublicKey::new().set_ssh_client_cert(Secret::default()/* use setters */);
647        /// ```
648        pub fn set_ssh_client_cert<T>(mut self, v: T) -> Self
649        where
650            T: std::convert::Into<crate::model::Secret>,
651        {
652            self.ssh_client_cert = std::option::Option::Some(v.into());
653            self
654        }
655
656        /// Sets or clears the value of [ssh_client_cert][crate::model::auth_config::SshPublicKey::ssh_client_cert].
657        ///
658        /// # Example
659        /// ```ignore,no_run
660        /// # use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
661        /// use google_cloud_connectors_v1::model::Secret;
662        /// let x = SshPublicKey::new().set_or_clear_ssh_client_cert(Some(Secret::default()/* use setters */));
663        /// let x = SshPublicKey::new().set_or_clear_ssh_client_cert(None::<Secret>);
664        /// ```
665        pub fn set_or_clear_ssh_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
666        where
667            T: std::convert::Into<crate::model::Secret>,
668        {
669            self.ssh_client_cert = v.map(|x| x.into());
670            self
671        }
672
673        /// Sets the value of [cert_type][crate::model::auth_config::SshPublicKey::cert_type].
674        ///
675        /// # Example
676        /// ```ignore,no_run
677        /// # use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
678        /// let x = SshPublicKey::new().set_cert_type("example");
679        /// ```
680        pub fn set_cert_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
681            self.cert_type = v.into();
682            self
683        }
684
685        /// Sets the value of [ssh_client_cert_pass][crate::model::auth_config::SshPublicKey::ssh_client_cert_pass].
686        ///
687        /// # Example
688        /// ```ignore,no_run
689        /// # use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
690        /// use google_cloud_connectors_v1::model::Secret;
691        /// let x = SshPublicKey::new().set_ssh_client_cert_pass(Secret::default()/* use setters */);
692        /// ```
693        pub fn set_ssh_client_cert_pass<T>(mut self, v: T) -> Self
694        where
695            T: std::convert::Into<crate::model::Secret>,
696        {
697            self.ssh_client_cert_pass = std::option::Option::Some(v.into());
698            self
699        }
700
701        /// Sets or clears the value of [ssh_client_cert_pass][crate::model::auth_config::SshPublicKey::ssh_client_cert_pass].
702        ///
703        /// # Example
704        /// ```ignore,no_run
705        /// # use google_cloud_connectors_v1::model::auth_config::SshPublicKey;
706        /// use google_cloud_connectors_v1::model::Secret;
707        /// let x = SshPublicKey::new().set_or_clear_ssh_client_cert_pass(Some(Secret::default()/* use setters */));
708        /// let x = SshPublicKey::new().set_or_clear_ssh_client_cert_pass(None::<Secret>);
709        /// ```
710        pub fn set_or_clear_ssh_client_cert_pass<T>(mut self, v: std::option::Option<T>) -> Self
711        where
712            T: std::convert::Into<crate::model::Secret>,
713        {
714            self.ssh_client_cert_pass = v.map(|x| x.into());
715            self
716        }
717    }
718
719    impl wkt::message::Message for SshPublicKey {
720        fn typename() -> &'static str {
721            "type.googleapis.com/google.cloud.connectors.v1.AuthConfig.SshPublicKey"
722        }
723    }
724
725    /// Supported auth types.
726    #[derive(Clone, Debug, PartialEq)]
727    #[non_exhaustive]
728    pub enum Type {
729        /// UserPassword.
730        UserPassword(std::boxed::Box<crate::model::auth_config::UserPassword>),
731        /// Oauth2JwtBearer.
732        Oauth2JwtBearer(std::boxed::Box<crate::model::auth_config::Oauth2JwtBearer>),
733        /// Oauth2ClientCredentials.
734        Oauth2ClientCredentials(
735            std::boxed::Box<crate::model::auth_config::Oauth2ClientCredentials>,
736        ),
737        /// SSH Public Key.
738        SshPublicKey(std::boxed::Box<crate::model::auth_config::SshPublicKey>),
739    }
740}
741
742/// AuthConfigTemplate defines required field over an authentication type.
743#[derive(Clone, Default, PartialEq)]
744#[non_exhaustive]
745pub struct AuthConfigTemplate {
746    /// The type of authentication configured.
747    pub auth_type: crate::model::AuthType,
748
749    /// Config variables to describe an `AuthConfig` for a `Connection`.
750    pub config_variable_templates: std::vec::Vec<crate::model::ConfigVariableTemplate>,
751
752    /// Display name for authentication template.
753    pub display_name: std::string::String,
754
755    /// Connector specific description for an authentication template.
756    pub description: std::string::String,
757
758    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
759}
760
761impl AuthConfigTemplate {
762    pub fn new() -> Self {
763        std::default::Default::default()
764    }
765
766    /// Sets the value of [auth_type][crate::model::AuthConfigTemplate::auth_type].
767    ///
768    /// # Example
769    /// ```ignore,no_run
770    /// # use google_cloud_connectors_v1::model::AuthConfigTemplate;
771    /// use google_cloud_connectors_v1::model::AuthType;
772    /// let x0 = AuthConfigTemplate::new().set_auth_type(AuthType::UserPassword);
773    /// let x1 = AuthConfigTemplate::new().set_auth_type(AuthType::Oauth2JwtBearer);
774    /// let x2 = AuthConfigTemplate::new().set_auth_type(AuthType::Oauth2ClientCredentials);
775    /// ```
776    pub fn set_auth_type<T: std::convert::Into<crate::model::AuthType>>(mut self, v: T) -> Self {
777        self.auth_type = v.into();
778        self
779    }
780
781    /// Sets the value of [config_variable_templates][crate::model::AuthConfigTemplate::config_variable_templates].
782    ///
783    /// # Example
784    /// ```ignore,no_run
785    /// # use google_cloud_connectors_v1::model::AuthConfigTemplate;
786    /// use google_cloud_connectors_v1::model::ConfigVariableTemplate;
787    /// let x = AuthConfigTemplate::new()
788    ///     .set_config_variable_templates([
789    ///         ConfigVariableTemplate::default()/* use setters */,
790    ///         ConfigVariableTemplate::default()/* use (different) setters */,
791    ///     ]);
792    /// ```
793    pub fn set_config_variable_templates<T, V>(mut self, v: T) -> Self
794    where
795        T: std::iter::IntoIterator<Item = V>,
796        V: std::convert::Into<crate::model::ConfigVariableTemplate>,
797    {
798        use std::iter::Iterator;
799        self.config_variable_templates = v.into_iter().map(|i| i.into()).collect();
800        self
801    }
802
803    /// Sets the value of [display_name][crate::model::AuthConfigTemplate::display_name].
804    ///
805    /// # Example
806    /// ```ignore,no_run
807    /// # use google_cloud_connectors_v1::model::AuthConfigTemplate;
808    /// let x = AuthConfigTemplate::new().set_display_name("example");
809    /// ```
810    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
811        self.display_name = v.into();
812        self
813    }
814
815    /// Sets the value of [description][crate::model::AuthConfigTemplate::description].
816    ///
817    /// # Example
818    /// ```ignore,no_run
819    /// # use google_cloud_connectors_v1::model::AuthConfigTemplate;
820    /// let x = AuthConfigTemplate::new().set_description("example");
821    /// ```
822    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
823        self.description = v.into();
824        self
825    }
826}
827
828impl wkt::message::Message for AuthConfigTemplate {
829    fn typename() -> &'static str {
830        "type.googleapis.com/google.cloud.connectors.v1.AuthConfigTemplate"
831    }
832}
833
834/// Represents the metadata of the long-running operation.
835#[derive(Clone, Default, PartialEq)]
836#[non_exhaustive]
837pub struct OperationMetadata {
838    /// Output only. The time the operation was created.
839    pub create_time: std::option::Option<wkt::Timestamp>,
840
841    /// Output only. The time the operation finished running.
842    pub end_time: std::option::Option<wkt::Timestamp>,
843
844    /// Output only. Server-defined resource path for the target of the operation.
845    pub target: std::string::String,
846
847    /// Output only. Name of the verb executed by the operation.
848    pub verb: std::string::String,
849
850    /// Output only. Human-readable status of the operation, if any.
851    pub status_message: std::string::String,
852
853    /// Output only. Identifies whether the user has requested cancellation
854    /// of the operation. Operations that have successfully been cancelled
855    /// have [Operation.error][] value with a
856    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
857    /// `Code.CANCELLED`.
858    ///
859    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
860    pub requested_cancellation: bool,
861
862    /// Output only. API version used to start the operation.
863    pub api_version: std::string::String,
864
865    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
866}
867
868impl OperationMetadata {
869    pub fn new() -> Self {
870        std::default::Default::default()
871    }
872
873    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
874    ///
875    /// # Example
876    /// ```ignore,no_run
877    /// # use google_cloud_connectors_v1::model::OperationMetadata;
878    /// use wkt::Timestamp;
879    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
880    /// ```
881    pub fn set_create_time<T>(mut self, v: T) -> Self
882    where
883        T: std::convert::Into<wkt::Timestamp>,
884    {
885        self.create_time = std::option::Option::Some(v.into());
886        self
887    }
888
889    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
890    ///
891    /// # Example
892    /// ```ignore,no_run
893    /// # use google_cloud_connectors_v1::model::OperationMetadata;
894    /// use wkt::Timestamp;
895    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
896    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
897    /// ```
898    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
899    where
900        T: std::convert::Into<wkt::Timestamp>,
901    {
902        self.create_time = v.map(|x| x.into());
903        self
904    }
905
906    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
907    ///
908    /// # Example
909    /// ```ignore,no_run
910    /// # use google_cloud_connectors_v1::model::OperationMetadata;
911    /// use wkt::Timestamp;
912    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
913    /// ```
914    pub fn set_end_time<T>(mut self, v: T) -> Self
915    where
916        T: std::convert::Into<wkt::Timestamp>,
917    {
918        self.end_time = std::option::Option::Some(v.into());
919        self
920    }
921
922    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
923    ///
924    /// # Example
925    /// ```ignore,no_run
926    /// # use google_cloud_connectors_v1::model::OperationMetadata;
927    /// use wkt::Timestamp;
928    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
929    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
930    /// ```
931    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
932    where
933        T: std::convert::Into<wkt::Timestamp>,
934    {
935        self.end_time = v.map(|x| x.into());
936        self
937    }
938
939    /// Sets the value of [target][crate::model::OperationMetadata::target].
940    ///
941    /// # Example
942    /// ```ignore,no_run
943    /// # use google_cloud_connectors_v1::model::OperationMetadata;
944    /// let x = OperationMetadata::new().set_target("example");
945    /// ```
946    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
947        self.target = v.into();
948        self
949    }
950
951    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
952    ///
953    /// # Example
954    /// ```ignore,no_run
955    /// # use google_cloud_connectors_v1::model::OperationMetadata;
956    /// let x = OperationMetadata::new().set_verb("example");
957    /// ```
958    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
959        self.verb = v.into();
960        self
961    }
962
963    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
964    ///
965    /// # Example
966    /// ```ignore,no_run
967    /// # use google_cloud_connectors_v1::model::OperationMetadata;
968    /// let x = OperationMetadata::new().set_status_message("example");
969    /// ```
970    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
971        self.status_message = v.into();
972        self
973    }
974
975    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
976    ///
977    /// # Example
978    /// ```ignore,no_run
979    /// # use google_cloud_connectors_v1::model::OperationMetadata;
980    /// let x = OperationMetadata::new().set_requested_cancellation(true);
981    /// ```
982    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
983        self.requested_cancellation = v.into();
984        self
985    }
986
987    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
988    ///
989    /// # Example
990    /// ```ignore,no_run
991    /// # use google_cloud_connectors_v1::model::OperationMetadata;
992    /// let x = OperationMetadata::new().set_api_version("example");
993    /// ```
994    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
995        self.api_version = v.into();
996        self
997    }
998}
999
1000impl wkt::message::Message for OperationMetadata {
1001    fn typename() -> &'static str {
1002        "type.googleapis.com/google.cloud.connectors.v1.OperationMetadata"
1003    }
1004}
1005
1006/// ConfigVariableTemplate provides metadata about a `ConfigVariable` that is
1007/// used in a Connection.
1008#[derive(Clone, Default, PartialEq)]
1009#[non_exhaustive]
1010pub struct ConfigVariableTemplate {
1011    /// Key of the config variable.
1012    pub key: std::string::String,
1013
1014    /// Type of the parameter: string, int, bool etc.
1015    /// consider custom type for the benefit for the validation.
1016    pub value_type: crate::model::config_variable_template::ValueType,
1017
1018    /// Display name of the parameter.
1019    pub display_name: std::string::String,
1020
1021    /// Description.
1022    pub description: std::string::String,
1023
1024    /// Regular expression in RE2 syntax used for validating the `value` of a
1025    /// `ConfigVariable`.
1026    pub validation_regex: std::string::String,
1027
1028    /// Flag represents that this `ConfigVariable` must be provided for a
1029    /// connection.
1030    pub required: bool,
1031
1032    /// Role grant configuration for the config variable.
1033    pub role_grant: std::option::Option<crate::model::RoleGrant>,
1034
1035    /// Enum options. To be populated if `ValueType` is `ENUM`
1036    pub enum_options: std::vec::Vec<crate::model::EnumOption>,
1037
1038    /// Authorization code link options. To be populated if `ValueType` is
1039    /// `AUTHORIZATION_CODE`
1040    pub authorization_code_link: std::option::Option<crate::model::AuthorizationCodeLink>,
1041
1042    /// State of the config variable.
1043    pub state: crate::model::config_variable_template::State,
1044
1045    /// Indicates if current template is part of advanced settings
1046    pub is_advanced: bool,
1047
1048    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1049}
1050
1051impl ConfigVariableTemplate {
1052    pub fn new() -> Self {
1053        std::default::Default::default()
1054    }
1055
1056    /// Sets the value of [key][crate::model::ConfigVariableTemplate::key].
1057    ///
1058    /// # Example
1059    /// ```ignore,no_run
1060    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1061    /// let x = ConfigVariableTemplate::new().set_key("example");
1062    /// ```
1063    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1064        self.key = v.into();
1065        self
1066    }
1067
1068    /// Sets the value of [value_type][crate::model::ConfigVariableTemplate::value_type].
1069    ///
1070    /// # Example
1071    /// ```ignore,no_run
1072    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1073    /// use google_cloud_connectors_v1::model::config_variable_template::ValueType;
1074    /// let x0 = ConfigVariableTemplate::new().set_value_type(ValueType::String);
1075    /// let x1 = ConfigVariableTemplate::new().set_value_type(ValueType::Int);
1076    /// let x2 = ConfigVariableTemplate::new().set_value_type(ValueType::Bool);
1077    /// ```
1078    pub fn set_value_type<
1079        T: std::convert::Into<crate::model::config_variable_template::ValueType>,
1080    >(
1081        mut self,
1082        v: T,
1083    ) -> Self {
1084        self.value_type = v.into();
1085        self
1086    }
1087
1088    /// Sets the value of [display_name][crate::model::ConfigVariableTemplate::display_name].
1089    ///
1090    /// # Example
1091    /// ```ignore,no_run
1092    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1093    /// let x = ConfigVariableTemplate::new().set_display_name("example");
1094    /// ```
1095    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1096        self.display_name = v.into();
1097        self
1098    }
1099
1100    /// Sets the value of [description][crate::model::ConfigVariableTemplate::description].
1101    ///
1102    /// # Example
1103    /// ```ignore,no_run
1104    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1105    /// let x = ConfigVariableTemplate::new().set_description("example");
1106    /// ```
1107    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1108        self.description = v.into();
1109        self
1110    }
1111
1112    /// Sets the value of [validation_regex][crate::model::ConfigVariableTemplate::validation_regex].
1113    ///
1114    /// # Example
1115    /// ```ignore,no_run
1116    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1117    /// let x = ConfigVariableTemplate::new().set_validation_regex("example");
1118    /// ```
1119    pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
1120        mut self,
1121        v: T,
1122    ) -> Self {
1123        self.validation_regex = v.into();
1124        self
1125    }
1126
1127    /// Sets the value of [required][crate::model::ConfigVariableTemplate::required].
1128    ///
1129    /// # Example
1130    /// ```ignore,no_run
1131    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1132    /// let x = ConfigVariableTemplate::new().set_required(true);
1133    /// ```
1134    pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1135        self.required = v.into();
1136        self
1137    }
1138
1139    /// Sets the value of [role_grant][crate::model::ConfigVariableTemplate::role_grant].
1140    ///
1141    /// # Example
1142    /// ```ignore,no_run
1143    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1144    /// use google_cloud_connectors_v1::model::RoleGrant;
1145    /// let x = ConfigVariableTemplate::new().set_role_grant(RoleGrant::default()/* use setters */);
1146    /// ```
1147    pub fn set_role_grant<T>(mut self, v: T) -> Self
1148    where
1149        T: std::convert::Into<crate::model::RoleGrant>,
1150    {
1151        self.role_grant = std::option::Option::Some(v.into());
1152        self
1153    }
1154
1155    /// Sets or clears the value of [role_grant][crate::model::ConfigVariableTemplate::role_grant].
1156    ///
1157    /// # Example
1158    /// ```ignore,no_run
1159    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1160    /// use google_cloud_connectors_v1::model::RoleGrant;
1161    /// let x = ConfigVariableTemplate::new().set_or_clear_role_grant(Some(RoleGrant::default()/* use setters */));
1162    /// let x = ConfigVariableTemplate::new().set_or_clear_role_grant(None::<RoleGrant>);
1163    /// ```
1164    pub fn set_or_clear_role_grant<T>(mut self, v: std::option::Option<T>) -> Self
1165    where
1166        T: std::convert::Into<crate::model::RoleGrant>,
1167    {
1168        self.role_grant = v.map(|x| x.into());
1169        self
1170    }
1171
1172    /// Sets the value of [enum_options][crate::model::ConfigVariableTemplate::enum_options].
1173    ///
1174    /// # Example
1175    /// ```ignore,no_run
1176    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1177    /// use google_cloud_connectors_v1::model::EnumOption;
1178    /// let x = ConfigVariableTemplate::new()
1179    ///     .set_enum_options([
1180    ///         EnumOption::default()/* use setters */,
1181    ///         EnumOption::default()/* use (different) setters */,
1182    ///     ]);
1183    /// ```
1184    pub fn set_enum_options<T, V>(mut self, v: T) -> Self
1185    where
1186        T: std::iter::IntoIterator<Item = V>,
1187        V: std::convert::Into<crate::model::EnumOption>,
1188    {
1189        use std::iter::Iterator;
1190        self.enum_options = v.into_iter().map(|i| i.into()).collect();
1191        self
1192    }
1193
1194    /// Sets the value of [authorization_code_link][crate::model::ConfigVariableTemplate::authorization_code_link].
1195    ///
1196    /// # Example
1197    /// ```ignore,no_run
1198    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1199    /// use google_cloud_connectors_v1::model::AuthorizationCodeLink;
1200    /// let x = ConfigVariableTemplate::new().set_authorization_code_link(AuthorizationCodeLink::default()/* use setters */);
1201    /// ```
1202    pub fn set_authorization_code_link<T>(mut self, v: T) -> Self
1203    where
1204        T: std::convert::Into<crate::model::AuthorizationCodeLink>,
1205    {
1206        self.authorization_code_link = std::option::Option::Some(v.into());
1207        self
1208    }
1209
1210    /// Sets or clears the value of [authorization_code_link][crate::model::ConfigVariableTemplate::authorization_code_link].
1211    ///
1212    /// # Example
1213    /// ```ignore,no_run
1214    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1215    /// use google_cloud_connectors_v1::model::AuthorizationCodeLink;
1216    /// let x = ConfigVariableTemplate::new().set_or_clear_authorization_code_link(Some(AuthorizationCodeLink::default()/* use setters */));
1217    /// let x = ConfigVariableTemplate::new().set_or_clear_authorization_code_link(None::<AuthorizationCodeLink>);
1218    /// ```
1219    pub fn set_or_clear_authorization_code_link<T>(mut self, v: std::option::Option<T>) -> Self
1220    where
1221        T: std::convert::Into<crate::model::AuthorizationCodeLink>,
1222    {
1223        self.authorization_code_link = v.map(|x| x.into());
1224        self
1225    }
1226
1227    /// Sets the value of [state][crate::model::ConfigVariableTemplate::state].
1228    ///
1229    /// # Example
1230    /// ```ignore,no_run
1231    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1232    /// use google_cloud_connectors_v1::model::config_variable_template::State;
1233    /// let x0 = ConfigVariableTemplate::new().set_state(State::Active);
1234    /// let x1 = ConfigVariableTemplate::new().set_state(State::Deprecated);
1235    /// ```
1236    pub fn set_state<T: std::convert::Into<crate::model::config_variable_template::State>>(
1237        mut self,
1238        v: T,
1239    ) -> Self {
1240        self.state = v.into();
1241        self
1242    }
1243
1244    /// Sets the value of [is_advanced][crate::model::ConfigVariableTemplate::is_advanced].
1245    ///
1246    /// # Example
1247    /// ```ignore,no_run
1248    /// # use google_cloud_connectors_v1::model::ConfigVariableTemplate;
1249    /// let x = ConfigVariableTemplate::new().set_is_advanced(true);
1250    /// ```
1251    pub fn set_is_advanced<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1252        self.is_advanced = v.into();
1253        self
1254    }
1255}
1256
1257impl wkt::message::Message for ConfigVariableTemplate {
1258    fn typename() -> &'static str {
1259        "type.googleapis.com/google.cloud.connectors.v1.ConfigVariableTemplate"
1260    }
1261}
1262
1263/// Defines additional types related to [ConfigVariableTemplate].
1264pub mod config_variable_template {
1265    #[allow(unused_imports)]
1266    use super::*;
1267
1268    /// ValueType indicates the data type of the value.
1269    ///
1270    /// # Working with unknown values
1271    ///
1272    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1273    /// additional enum variants at any time. Adding new variants is not considered
1274    /// a breaking change. Applications should write their code in anticipation of:
1275    ///
1276    /// - New values appearing in future releases of the client library, **and**
1277    /// - New values received dynamically, without application changes.
1278    ///
1279    /// Please consult the [Working with enums] section in the user guide for some
1280    /// guidelines.
1281    ///
1282    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1283    #[derive(Clone, Debug, PartialEq)]
1284    #[non_exhaustive]
1285    pub enum ValueType {
1286        /// Value type is not specified.
1287        Unspecified,
1288        /// Value type is string.
1289        String,
1290        /// Value type is integer.
1291        Int,
1292        /// Value type is boolean.
1293        Bool,
1294        /// Value type is secret.
1295        Secret,
1296        /// Value type is enum.
1297        Enum,
1298        /// Value type is authorization code.
1299        AuthorizationCode,
1300        /// If set, the enum was initialized with an unknown value.
1301        ///
1302        /// Applications can examine the value using [ValueType::value] or
1303        /// [ValueType::name].
1304        UnknownValue(value_type::UnknownValue),
1305    }
1306
1307    #[doc(hidden)]
1308    pub mod value_type {
1309        #[allow(unused_imports)]
1310        use super::*;
1311        #[derive(Clone, Debug, PartialEq)]
1312        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1313    }
1314
1315    impl ValueType {
1316        /// Gets the enum value.
1317        ///
1318        /// Returns `None` if the enum contains an unknown value deserialized from
1319        /// the string representation of enums.
1320        pub fn value(&self) -> std::option::Option<i32> {
1321            match self {
1322                Self::Unspecified => std::option::Option::Some(0),
1323                Self::String => std::option::Option::Some(1),
1324                Self::Int => std::option::Option::Some(2),
1325                Self::Bool => std::option::Option::Some(3),
1326                Self::Secret => std::option::Option::Some(4),
1327                Self::Enum => std::option::Option::Some(5),
1328                Self::AuthorizationCode => std::option::Option::Some(6),
1329                Self::UnknownValue(u) => u.0.value(),
1330            }
1331        }
1332
1333        /// Gets the enum value as a string.
1334        ///
1335        /// Returns `None` if the enum contains an unknown value deserialized from
1336        /// the integer representation of enums.
1337        pub fn name(&self) -> std::option::Option<&str> {
1338            match self {
1339                Self::Unspecified => std::option::Option::Some("VALUE_TYPE_UNSPECIFIED"),
1340                Self::String => std::option::Option::Some("STRING"),
1341                Self::Int => std::option::Option::Some("INT"),
1342                Self::Bool => std::option::Option::Some("BOOL"),
1343                Self::Secret => std::option::Option::Some("SECRET"),
1344                Self::Enum => std::option::Option::Some("ENUM"),
1345                Self::AuthorizationCode => std::option::Option::Some("AUTHORIZATION_CODE"),
1346                Self::UnknownValue(u) => u.0.name(),
1347            }
1348        }
1349    }
1350
1351    impl std::default::Default for ValueType {
1352        fn default() -> Self {
1353            use std::convert::From;
1354            Self::from(0)
1355        }
1356    }
1357
1358    impl std::fmt::Display for ValueType {
1359        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1360            wkt::internal::display_enum(f, self.name(), self.value())
1361        }
1362    }
1363
1364    impl std::convert::From<i32> for ValueType {
1365        fn from(value: i32) -> Self {
1366            match value {
1367                0 => Self::Unspecified,
1368                1 => Self::String,
1369                2 => Self::Int,
1370                3 => Self::Bool,
1371                4 => Self::Secret,
1372                5 => Self::Enum,
1373                6 => Self::AuthorizationCode,
1374                _ => Self::UnknownValue(value_type::UnknownValue(
1375                    wkt::internal::UnknownEnumValue::Integer(value),
1376                )),
1377            }
1378        }
1379    }
1380
1381    impl std::convert::From<&str> for ValueType {
1382        fn from(value: &str) -> Self {
1383            use std::string::ToString;
1384            match value {
1385                "VALUE_TYPE_UNSPECIFIED" => Self::Unspecified,
1386                "STRING" => Self::String,
1387                "INT" => Self::Int,
1388                "BOOL" => Self::Bool,
1389                "SECRET" => Self::Secret,
1390                "ENUM" => Self::Enum,
1391                "AUTHORIZATION_CODE" => Self::AuthorizationCode,
1392                _ => Self::UnknownValue(value_type::UnknownValue(
1393                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1394                )),
1395            }
1396        }
1397    }
1398
1399    impl serde::ser::Serialize for ValueType {
1400        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1401        where
1402            S: serde::Serializer,
1403        {
1404            match self {
1405                Self::Unspecified => serializer.serialize_i32(0),
1406                Self::String => serializer.serialize_i32(1),
1407                Self::Int => serializer.serialize_i32(2),
1408                Self::Bool => serializer.serialize_i32(3),
1409                Self::Secret => serializer.serialize_i32(4),
1410                Self::Enum => serializer.serialize_i32(5),
1411                Self::AuthorizationCode => serializer.serialize_i32(6),
1412                Self::UnknownValue(u) => u.0.serialize(serializer),
1413            }
1414        }
1415    }
1416
1417    impl<'de> serde::de::Deserialize<'de> for ValueType {
1418        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1419        where
1420            D: serde::Deserializer<'de>,
1421        {
1422            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ValueType>::new(
1423                ".google.cloud.connectors.v1.ConfigVariableTemplate.ValueType",
1424            ))
1425        }
1426    }
1427
1428    /// Indicates the state of the config variable.
1429    ///
1430    /// # Working with unknown values
1431    ///
1432    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1433    /// additional enum variants at any time. Adding new variants is not considered
1434    /// a breaking change. Applications should write their code in anticipation of:
1435    ///
1436    /// - New values appearing in future releases of the client library, **and**
1437    /// - New values received dynamically, without application changes.
1438    ///
1439    /// Please consult the [Working with enums] section in the user guide for some
1440    /// guidelines.
1441    ///
1442    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1443    #[derive(Clone, Debug, PartialEq)]
1444    #[non_exhaustive]
1445    pub enum State {
1446        /// Status is unspecified.
1447        Unspecified,
1448        /// Config variable is active
1449        Active,
1450        /// Config variable is deprecated.
1451        Deprecated,
1452        /// If set, the enum was initialized with an unknown value.
1453        ///
1454        /// Applications can examine the value using [State::value] or
1455        /// [State::name].
1456        UnknownValue(state::UnknownValue),
1457    }
1458
1459    #[doc(hidden)]
1460    pub mod state {
1461        #[allow(unused_imports)]
1462        use super::*;
1463        #[derive(Clone, Debug, PartialEq)]
1464        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1465    }
1466
1467    impl State {
1468        /// Gets the enum value.
1469        ///
1470        /// Returns `None` if the enum contains an unknown value deserialized from
1471        /// the string representation of enums.
1472        pub fn value(&self) -> std::option::Option<i32> {
1473            match self {
1474                Self::Unspecified => std::option::Option::Some(0),
1475                Self::Active => std::option::Option::Some(1),
1476                Self::Deprecated => std::option::Option::Some(2),
1477                Self::UnknownValue(u) => u.0.value(),
1478            }
1479        }
1480
1481        /// Gets the enum value as a string.
1482        ///
1483        /// Returns `None` if the enum contains an unknown value deserialized from
1484        /// the integer representation of enums.
1485        pub fn name(&self) -> std::option::Option<&str> {
1486            match self {
1487                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1488                Self::Active => std::option::Option::Some("ACTIVE"),
1489                Self::Deprecated => std::option::Option::Some("DEPRECATED"),
1490                Self::UnknownValue(u) => u.0.name(),
1491            }
1492        }
1493    }
1494
1495    impl std::default::Default for State {
1496        fn default() -> Self {
1497            use std::convert::From;
1498            Self::from(0)
1499        }
1500    }
1501
1502    impl std::fmt::Display for State {
1503        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1504            wkt::internal::display_enum(f, self.name(), self.value())
1505        }
1506    }
1507
1508    impl std::convert::From<i32> for State {
1509        fn from(value: i32) -> Self {
1510            match value {
1511                0 => Self::Unspecified,
1512                1 => Self::Active,
1513                2 => Self::Deprecated,
1514                _ => Self::UnknownValue(state::UnknownValue(
1515                    wkt::internal::UnknownEnumValue::Integer(value),
1516                )),
1517            }
1518        }
1519    }
1520
1521    impl std::convert::From<&str> for State {
1522        fn from(value: &str) -> Self {
1523            use std::string::ToString;
1524            match value {
1525                "STATE_UNSPECIFIED" => Self::Unspecified,
1526                "ACTIVE" => Self::Active,
1527                "DEPRECATED" => Self::Deprecated,
1528                _ => Self::UnknownValue(state::UnknownValue(
1529                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1530                )),
1531            }
1532        }
1533    }
1534
1535    impl serde::ser::Serialize for State {
1536        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1537        where
1538            S: serde::Serializer,
1539        {
1540            match self {
1541                Self::Unspecified => serializer.serialize_i32(0),
1542                Self::Active => serializer.serialize_i32(1),
1543                Self::Deprecated => serializer.serialize_i32(2),
1544                Self::UnknownValue(u) => u.0.serialize(serializer),
1545            }
1546        }
1547    }
1548
1549    impl<'de> serde::de::Deserialize<'de> for State {
1550        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1551        where
1552            D: serde::Deserializer<'de>,
1553        {
1554            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1555                ".google.cloud.connectors.v1.ConfigVariableTemplate.State",
1556            ))
1557        }
1558    }
1559}
1560
1561/// Secret provides a reference to entries in Secret Manager.
1562#[derive(Clone, Default, PartialEq)]
1563#[non_exhaustive]
1564pub struct Secret {
1565    /// The resource name of the secret version in the format,
1566    /// format as: `projects/*/secrets/*/versions/*`.
1567    pub secret_version: std::string::String,
1568
1569    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1570}
1571
1572impl Secret {
1573    pub fn new() -> Self {
1574        std::default::Default::default()
1575    }
1576
1577    /// Sets the value of [secret_version][crate::model::Secret::secret_version].
1578    ///
1579    /// # Example
1580    /// ```ignore,no_run
1581    /// # use google_cloud_connectors_v1::model::Secret;
1582    /// let x = Secret::new().set_secret_version("example");
1583    /// ```
1584    pub fn set_secret_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1585        self.secret_version = v.into();
1586        self
1587    }
1588}
1589
1590impl wkt::message::Message for Secret {
1591    fn typename() -> &'static str {
1592        "type.googleapis.com/google.cloud.connectors.v1.Secret"
1593    }
1594}
1595
1596/// EnumOption definition
1597#[derive(Clone, Default, PartialEq)]
1598#[non_exhaustive]
1599pub struct EnumOption {
1600    /// Id of the option.
1601    pub id: std::string::String,
1602
1603    /// Display name of the option.
1604    pub display_name: std::string::String,
1605
1606    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1607}
1608
1609impl EnumOption {
1610    pub fn new() -> Self {
1611        std::default::Default::default()
1612    }
1613
1614    /// Sets the value of [id][crate::model::EnumOption::id].
1615    ///
1616    /// # Example
1617    /// ```ignore,no_run
1618    /// # use google_cloud_connectors_v1::model::EnumOption;
1619    /// let x = EnumOption::new().set_id("example");
1620    /// ```
1621    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1622        self.id = v.into();
1623        self
1624    }
1625
1626    /// Sets the value of [display_name][crate::model::EnumOption::display_name].
1627    ///
1628    /// # Example
1629    /// ```ignore,no_run
1630    /// # use google_cloud_connectors_v1::model::EnumOption;
1631    /// let x = EnumOption::new().set_display_name("example");
1632    /// ```
1633    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1634        self.display_name = v.into();
1635        self
1636    }
1637}
1638
1639impl wkt::message::Message for EnumOption {
1640    fn typename() -> &'static str {
1641        "type.googleapis.com/google.cloud.connectors.v1.EnumOption"
1642    }
1643}
1644
1645/// ConfigVariable represents a configuration variable present in a Connection.
1646/// or AuthConfig.
1647#[derive(Clone, Default, PartialEq)]
1648#[non_exhaustive]
1649pub struct ConfigVariable {
1650    /// Key of the config variable.
1651    pub key: std::string::String,
1652
1653    /// Value type of the config variable.
1654    pub value: std::option::Option<crate::model::config_variable::Value>,
1655
1656    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1657}
1658
1659impl ConfigVariable {
1660    pub fn new() -> Self {
1661        std::default::Default::default()
1662    }
1663
1664    /// Sets the value of [key][crate::model::ConfigVariable::key].
1665    ///
1666    /// # Example
1667    /// ```ignore,no_run
1668    /// # use google_cloud_connectors_v1::model::ConfigVariable;
1669    /// let x = ConfigVariable::new().set_key("example");
1670    /// ```
1671    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1672        self.key = v.into();
1673        self
1674    }
1675
1676    /// Sets the value of [value][crate::model::ConfigVariable::value].
1677    ///
1678    /// Note that all the setters affecting `value` are mutually
1679    /// exclusive.
1680    ///
1681    /// # Example
1682    /// ```ignore,no_run
1683    /// # use google_cloud_connectors_v1::model::ConfigVariable;
1684    /// use google_cloud_connectors_v1::model::config_variable::Value;
1685    /// let x = ConfigVariable::new().set_value(Some(Value::IntValue(42)));
1686    /// ```
1687    pub fn set_value<
1688        T: std::convert::Into<std::option::Option<crate::model::config_variable::Value>>,
1689    >(
1690        mut self,
1691        v: T,
1692    ) -> Self {
1693        self.value = v.into();
1694        self
1695    }
1696
1697    /// The value of [value][crate::model::ConfigVariable::value]
1698    /// if it holds a `IntValue`, `None` if the field is not set or
1699    /// holds a different branch.
1700    pub fn int_value(&self) -> std::option::Option<&i64> {
1701        #[allow(unreachable_patterns)]
1702        self.value.as_ref().and_then(|v| match v {
1703            crate::model::config_variable::Value::IntValue(v) => std::option::Option::Some(v),
1704            _ => std::option::Option::None,
1705        })
1706    }
1707
1708    /// Sets the value of [value][crate::model::ConfigVariable::value]
1709    /// to hold a `IntValue`.
1710    ///
1711    /// Note that all the setters affecting `value` are
1712    /// mutually exclusive.
1713    ///
1714    /// # Example
1715    /// ```ignore,no_run
1716    /// # use google_cloud_connectors_v1::model::ConfigVariable;
1717    /// let x = ConfigVariable::new().set_int_value(42);
1718    /// assert!(x.int_value().is_some());
1719    /// assert!(x.bool_value().is_none());
1720    /// assert!(x.string_value().is_none());
1721    /// assert!(x.secret_value().is_none());
1722    /// ```
1723    pub fn set_int_value<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1724        self.value =
1725            std::option::Option::Some(crate::model::config_variable::Value::IntValue(v.into()));
1726        self
1727    }
1728
1729    /// The value of [value][crate::model::ConfigVariable::value]
1730    /// if it holds a `BoolValue`, `None` if the field is not set or
1731    /// holds a different branch.
1732    pub fn bool_value(&self) -> std::option::Option<&bool> {
1733        #[allow(unreachable_patterns)]
1734        self.value.as_ref().and_then(|v| match v {
1735            crate::model::config_variable::Value::BoolValue(v) => std::option::Option::Some(v),
1736            _ => std::option::Option::None,
1737        })
1738    }
1739
1740    /// Sets the value of [value][crate::model::ConfigVariable::value]
1741    /// to hold a `BoolValue`.
1742    ///
1743    /// Note that all the setters affecting `value` are
1744    /// mutually exclusive.
1745    ///
1746    /// # Example
1747    /// ```ignore,no_run
1748    /// # use google_cloud_connectors_v1::model::ConfigVariable;
1749    /// let x = ConfigVariable::new().set_bool_value(true);
1750    /// assert!(x.bool_value().is_some());
1751    /// assert!(x.int_value().is_none());
1752    /// assert!(x.string_value().is_none());
1753    /// assert!(x.secret_value().is_none());
1754    /// ```
1755    pub fn set_bool_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1756        self.value =
1757            std::option::Option::Some(crate::model::config_variable::Value::BoolValue(v.into()));
1758        self
1759    }
1760
1761    /// The value of [value][crate::model::ConfigVariable::value]
1762    /// if it holds a `StringValue`, `None` if the field is not set or
1763    /// holds a different branch.
1764    pub fn string_value(&self) -> std::option::Option<&std::string::String> {
1765        #[allow(unreachable_patterns)]
1766        self.value.as_ref().and_then(|v| match v {
1767            crate::model::config_variable::Value::StringValue(v) => std::option::Option::Some(v),
1768            _ => std::option::Option::None,
1769        })
1770    }
1771
1772    /// Sets the value of [value][crate::model::ConfigVariable::value]
1773    /// to hold a `StringValue`.
1774    ///
1775    /// Note that all the setters affecting `value` are
1776    /// mutually exclusive.
1777    ///
1778    /// # Example
1779    /// ```ignore,no_run
1780    /// # use google_cloud_connectors_v1::model::ConfigVariable;
1781    /// let x = ConfigVariable::new().set_string_value("example");
1782    /// assert!(x.string_value().is_some());
1783    /// assert!(x.int_value().is_none());
1784    /// assert!(x.bool_value().is_none());
1785    /// assert!(x.secret_value().is_none());
1786    /// ```
1787    pub fn set_string_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1788        self.value =
1789            std::option::Option::Some(crate::model::config_variable::Value::StringValue(v.into()));
1790        self
1791    }
1792
1793    /// The value of [value][crate::model::ConfigVariable::value]
1794    /// if it holds a `SecretValue`, `None` if the field is not set or
1795    /// holds a different branch.
1796    pub fn secret_value(&self) -> std::option::Option<&std::boxed::Box<crate::model::Secret>> {
1797        #[allow(unreachable_patterns)]
1798        self.value.as_ref().and_then(|v| match v {
1799            crate::model::config_variable::Value::SecretValue(v) => std::option::Option::Some(v),
1800            _ => std::option::Option::None,
1801        })
1802    }
1803
1804    /// Sets the value of [value][crate::model::ConfigVariable::value]
1805    /// to hold a `SecretValue`.
1806    ///
1807    /// Note that all the setters affecting `value` are
1808    /// mutually exclusive.
1809    ///
1810    /// # Example
1811    /// ```ignore,no_run
1812    /// # use google_cloud_connectors_v1::model::ConfigVariable;
1813    /// use google_cloud_connectors_v1::model::Secret;
1814    /// let x = ConfigVariable::new().set_secret_value(Secret::default()/* use setters */);
1815    /// assert!(x.secret_value().is_some());
1816    /// assert!(x.int_value().is_none());
1817    /// assert!(x.bool_value().is_none());
1818    /// assert!(x.string_value().is_none());
1819    /// ```
1820    pub fn set_secret_value<T: std::convert::Into<std::boxed::Box<crate::model::Secret>>>(
1821        mut self,
1822        v: T,
1823    ) -> Self {
1824        self.value =
1825            std::option::Option::Some(crate::model::config_variable::Value::SecretValue(v.into()));
1826        self
1827    }
1828}
1829
1830impl wkt::message::Message for ConfigVariable {
1831    fn typename() -> &'static str {
1832        "type.googleapis.com/google.cloud.connectors.v1.ConfigVariable"
1833    }
1834}
1835
1836/// Defines additional types related to [ConfigVariable].
1837pub mod config_variable {
1838    #[allow(unused_imports)]
1839    use super::*;
1840
1841    /// Value type of the config variable.
1842    #[derive(Clone, Debug, PartialEq)]
1843    #[non_exhaustive]
1844    pub enum Value {
1845        /// Value is an integer
1846        IntValue(i64),
1847        /// Value is a bool.
1848        BoolValue(bool),
1849        /// Value is a string.
1850        StringValue(std::string::String),
1851        /// Value is a secret.
1852        SecretValue(std::boxed::Box<crate::model::Secret>),
1853    }
1854}
1855
1856/// This configuration defines all the Cloud IAM roles that needs to be granted
1857/// to a particular GCP resource for the selected prinicpal like service
1858/// account. These configurations will let UI display to customers what
1859/// IAM roles need to be granted by them. Or these configurations can be used
1860/// by the UI to render a 'grant' button to do the same on behalf of the user.
1861#[derive(Clone, Default, PartialEq)]
1862#[non_exhaustive]
1863pub struct RoleGrant {
1864    /// Prinicipal/Identity for whom the role need to assigned.
1865    pub principal: crate::model::role_grant::Principal,
1866
1867    /// List of roles that need to be granted.
1868    pub roles: std::vec::Vec<std::string::String>,
1869
1870    /// Resource on which the roles needs to be granted for the principal.
1871    pub resource: std::option::Option<crate::model::role_grant::Resource>,
1872
1873    /// Template that UI can use to provide helper text to customers.
1874    pub helper_text_template: std::string::String,
1875
1876    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1877}
1878
1879impl RoleGrant {
1880    pub fn new() -> Self {
1881        std::default::Default::default()
1882    }
1883
1884    /// Sets the value of [principal][crate::model::RoleGrant::principal].
1885    ///
1886    /// # Example
1887    /// ```ignore,no_run
1888    /// # use google_cloud_connectors_v1::model::RoleGrant;
1889    /// use google_cloud_connectors_v1::model::role_grant::Principal;
1890    /// let x0 = RoleGrant::new().set_principal(Principal::ConnectorSa);
1891    /// ```
1892    pub fn set_principal<T: std::convert::Into<crate::model::role_grant::Principal>>(
1893        mut self,
1894        v: T,
1895    ) -> Self {
1896        self.principal = v.into();
1897        self
1898    }
1899
1900    /// Sets the value of [roles][crate::model::RoleGrant::roles].
1901    ///
1902    /// # Example
1903    /// ```ignore,no_run
1904    /// # use google_cloud_connectors_v1::model::RoleGrant;
1905    /// let x = RoleGrant::new().set_roles(["a", "b", "c"]);
1906    /// ```
1907    pub fn set_roles<T, V>(mut self, v: T) -> Self
1908    where
1909        T: std::iter::IntoIterator<Item = V>,
1910        V: std::convert::Into<std::string::String>,
1911    {
1912        use std::iter::Iterator;
1913        self.roles = v.into_iter().map(|i| i.into()).collect();
1914        self
1915    }
1916
1917    /// Sets the value of [resource][crate::model::RoleGrant::resource].
1918    ///
1919    /// # Example
1920    /// ```ignore,no_run
1921    /// # use google_cloud_connectors_v1::model::RoleGrant;
1922    /// use google_cloud_connectors_v1::model::role_grant::Resource;
1923    /// let x = RoleGrant::new().set_resource(Resource::default()/* use setters */);
1924    /// ```
1925    pub fn set_resource<T>(mut self, v: T) -> Self
1926    where
1927        T: std::convert::Into<crate::model::role_grant::Resource>,
1928    {
1929        self.resource = std::option::Option::Some(v.into());
1930        self
1931    }
1932
1933    /// Sets or clears the value of [resource][crate::model::RoleGrant::resource].
1934    ///
1935    /// # Example
1936    /// ```ignore,no_run
1937    /// # use google_cloud_connectors_v1::model::RoleGrant;
1938    /// use google_cloud_connectors_v1::model::role_grant::Resource;
1939    /// let x = RoleGrant::new().set_or_clear_resource(Some(Resource::default()/* use setters */));
1940    /// let x = RoleGrant::new().set_or_clear_resource(None::<Resource>);
1941    /// ```
1942    pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
1943    where
1944        T: std::convert::Into<crate::model::role_grant::Resource>,
1945    {
1946        self.resource = v.map(|x| x.into());
1947        self
1948    }
1949
1950    /// Sets the value of [helper_text_template][crate::model::RoleGrant::helper_text_template].
1951    ///
1952    /// # Example
1953    /// ```ignore,no_run
1954    /// # use google_cloud_connectors_v1::model::RoleGrant;
1955    /// let x = RoleGrant::new().set_helper_text_template("example");
1956    /// ```
1957    pub fn set_helper_text_template<T: std::convert::Into<std::string::String>>(
1958        mut self,
1959        v: T,
1960    ) -> Self {
1961        self.helper_text_template = v.into();
1962        self
1963    }
1964}
1965
1966impl wkt::message::Message for RoleGrant {
1967    fn typename() -> &'static str {
1968        "type.googleapis.com/google.cloud.connectors.v1.RoleGrant"
1969    }
1970}
1971
1972/// Defines additional types related to [RoleGrant].
1973pub mod role_grant {
1974    #[allow(unused_imports)]
1975    use super::*;
1976
1977    /// Resource definition
1978    #[derive(Clone, Default, PartialEq)]
1979    #[non_exhaustive]
1980    pub struct Resource {
1981        /// Different types of resource supported.
1982        pub r#type: crate::model::role_grant::resource::Type,
1983
1984        /// Template to uniquely represent a GCP resource in a format IAM expects
1985        /// This is a template that can have references to other values provided in
1986        /// the config variable template.
1987        pub path_template: std::string::String,
1988
1989        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1990    }
1991
1992    impl Resource {
1993        pub fn new() -> Self {
1994            std::default::Default::default()
1995        }
1996
1997        /// Sets the value of [r#type][crate::model::role_grant::Resource::type].
1998        ///
1999        /// # Example
2000        /// ```ignore,no_run
2001        /// # use google_cloud_connectors_v1::model::role_grant::Resource;
2002        /// use google_cloud_connectors_v1::model::role_grant::resource::Type;
2003        /// let x0 = Resource::new().set_type(Type::GcpProject);
2004        /// let x1 = Resource::new().set_type(Type::GcpResource);
2005        /// let x2 = Resource::new().set_type(Type::GcpSecretmanagerSecret);
2006        /// ```
2007        pub fn set_type<T: std::convert::Into<crate::model::role_grant::resource::Type>>(
2008            mut self,
2009            v: T,
2010        ) -> Self {
2011            self.r#type = v.into();
2012            self
2013        }
2014
2015        /// Sets the value of [path_template][crate::model::role_grant::Resource::path_template].
2016        ///
2017        /// # Example
2018        /// ```ignore,no_run
2019        /// # use google_cloud_connectors_v1::model::role_grant::Resource;
2020        /// let x = Resource::new().set_path_template("example");
2021        /// ```
2022        pub fn set_path_template<T: std::convert::Into<std::string::String>>(
2023            mut self,
2024            v: T,
2025        ) -> Self {
2026            self.path_template = v.into();
2027            self
2028        }
2029    }
2030
2031    impl wkt::message::Message for Resource {
2032        fn typename() -> &'static str {
2033            "type.googleapis.com/google.cloud.connectors.v1.RoleGrant.Resource"
2034        }
2035    }
2036
2037    /// Defines additional types related to [Resource].
2038    pub mod resource {
2039        #[allow(unused_imports)]
2040        use super::*;
2041
2042        /// Resource Type definition.
2043        ///
2044        /// # Working with unknown values
2045        ///
2046        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2047        /// additional enum variants at any time. Adding new variants is not considered
2048        /// a breaking change. Applications should write their code in anticipation of:
2049        ///
2050        /// - New values appearing in future releases of the client library, **and**
2051        /// - New values received dynamically, without application changes.
2052        ///
2053        /// Please consult the [Working with enums] section in the user guide for some
2054        /// guidelines.
2055        ///
2056        /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2057        #[derive(Clone, Debug, PartialEq)]
2058        #[non_exhaustive]
2059        pub enum Type {
2060            /// Value type is not specified.
2061            Unspecified,
2062            /// GCP Project Resource.
2063            GcpProject,
2064            /// Any GCP Resource which is identified uniquely by IAM.
2065            GcpResource,
2066            /// GCP Secret Resource.
2067            GcpSecretmanagerSecret,
2068            /// GCP Secret Version Resource.
2069            GcpSecretmanagerSecretVersion,
2070            /// If set, the enum was initialized with an unknown value.
2071            ///
2072            /// Applications can examine the value using [Type::value] or
2073            /// [Type::name].
2074            UnknownValue(r#type::UnknownValue),
2075        }
2076
2077        #[doc(hidden)]
2078        pub mod r#type {
2079            #[allow(unused_imports)]
2080            use super::*;
2081            #[derive(Clone, Debug, PartialEq)]
2082            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2083        }
2084
2085        impl Type {
2086            /// Gets the enum value.
2087            ///
2088            /// Returns `None` if the enum contains an unknown value deserialized from
2089            /// the string representation of enums.
2090            pub fn value(&self) -> std::option::Option<i32> {
2091                match self {
2092                    Self::Unspecified => std::option::Option::Some(0),
2093                    Self::GcpProject => std::option::Option::Some(1),
2094                    Self::GcpResource => std::option::Option::Some(2),
2095                    Self::GcpSecretmanagerSecret => std::option::Option::Some(3),
2096                    Self::GcpSecretmanagerSecretVersion => std::option::Option::Some(4),
2097                    Self::UnknownValue(u) => u.0.value(),
2098                }
2099            }
2100
2101            /// Gets the enum value as a string.
2102            ///
2103            /// Returns `None` if the enum contains an unknown value deserialized from
2104            /// the integer representation of enums.
2105            pub fn name(&self) -> std::option::Option<&str> {
2106                match self {
2107                    Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
2108                    Self::GcpProject => std::option::Option::Some("GCP_PROJECT"),
2109                    Self::GcpResource => std::option::Option::Some("GCP_RESOURCE"),
2110                    Self::GcpSecretmanagerSecret => {
2111                        std::option::Option::Some("GCP_SECRETMANAGER_SECRET")
2112                    }
2113                    Self::GcpSecretmanagerSecretVersion => {
2114                        std::option::Option::Some("GCP_SECRETMANAGER_SECRET_VERSION")
2115                    }
2116                    Self::UnknownValue(u) => u.0.name(),
2117                }
2118            }
2119        }
2120
2121        impl std::default::Default for Type {
2122            fn default() -> Self {
2123                use std::convert::From;
2124                Self::from(0)
2125            }
2126        }
2127
2128        impl std::fmt::Display for Type {
2129            fn fmt(
2130                &self,
2131                f: &mut std::fmt::Formatter<'_>,
2132            ) -> std::result::Result<(), std::fmt::Error> {
2133                wkt::internal::display_enum(f, self.name(), self.value())
2134            }
2135        }
2136
2137        impl std::convert::From<i32> for Type {
2138            fn from(value: i32) -> Self {
2139                match value {
2140                    0 => Self::Unspecified,
2141                    1 => Self::GcpProject,
2142                    2 => Self::GcpResource,
2143                    3 => Self::GcpSecretmanagerSecret,
2144                    4 => Self::GcpSecretmanagerSecretVersion,
2145                    _ => Self::UnknownValue(r#type::UnknownValue(
2146                        wkt::internal::UnknownEnumValue::Integer(value),
2147                    )),
2148                }
2149            }
2150        }
2151
2152        impl std::convert::From<&str> for Type {
2153            fn from(value: &str) -> Self {
2154                use std::string::ToString;
2155                match value {
2156                    "TYPE_UNSPECIFIED" => Self::Unspecified,
2157                    "GCP_PROJECT" => Self::GcpProject,
2158                    "GCP_RESOURCE" => Self::GcpResource,
2159                    "GCP_SECRETMANAGER_SECRET" => Self::GcpSecretmanagerSecret,
2160                    "GCP_SECRETMANAGER_SECRET_VERSION" => Self::GcpSecretmanagerSecretVersion,
2161                    _ => Self::UnknownValue(r#type::UnknownValue(
2162                        wkt::internal::UnknownEnumValue::String(value.to_string()),
2163                    )),
2164                }
2165            }
2166        }
2167
2168        impl serde::ser::Serialize for Type {
2169            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2170            where
2171                S: serde::Serializer,
2172            {
2173                match self {
2174                    Self::Unspecified => serializer.serialize_i32(0),
2175                    Self::GcpProject => serializer.serialize_i32(1),
2176                    Self::GcpResource => serializer.serialize_i32(2),
2177                    Self::GcpSecretmanagerSecret => serializer.serialize_i32(3),
2178                    Self::GcpSecretmanagerSecretVersion => serializer.serialize_i32(4),
2179                    Self::UnknownValue(u) => u.0.serialize(serializer),
2180                }
2181            }
2182        }
2183
2184        impl<'de> serde::de::Deserialize<'de> for Type {
2185            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2186            where
2187                D: serde::Deserializer<'de>,
2188            {
2189                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
2190                    ".google.cloud.connectors.v1.RoleGrant.Resource.Type",
2191                ))
2192            }
2193        }
2194    }
2195
2196    /// Supported Principal values.
2197    ///
2198    /// # Working with unknown values
2199    ///
2200    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2201    /// additional enum variants at any time. Adding new variants is not considered
2202    /// a breaking change. Applications should write their code in anticipation of:
2203    ///
2204    /// - New values appearing in future releases of the client library, **and**
2205    /// - New values received dynamically, without application changes.
2206    ///
2207    /// Please consult the [Working with enums] section in the user guide for some
2208    /// guidelines.
2209    ///
2210    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2211    #[derive(Clone, Debug, PartialEq)]
2212    #[non_exhaustive]
2213    pub enum Principal {
2214        /// Value type is not specified.
2215        Unspecified,
2216        /// Service Account used for Connector workload identity
2217        /// This is either the default service account if unspecified or Service
2218        /// Account provided by Customers through BYOSA.
2219        ConnectorSa,
2220        /// If set, the enum was initialized with an unknown value.
2221        ///
2222        /// Applications can examine the value using [Principal::value] or
2223        /// [Principal::name].
2224        UnknownValue(principal::UnknownValue),
2225    }
2226
2227    #[doc(hidden)]
2228    pub mod principal {
2229        #[allow(unused_imports)]
2230        use super::*;
2231        #[derive(Clone, Debug, PartialEq)]
2232        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2233    }
2234
2235    impl Principal {
2236        /// Gets the enum value.
2237        ///
2238        /// Returns `None` if the enum contains an unknown value deserialized from
2239        /// the string representation of enums.
2240        pub fn value(&self) -> std::option::Option<i32> {
2241            match self {
2242                Self::Unspecified => std::option::Option::Some(0),
2243                Self::ConnectorSa => std::option::Option::Some(1),
2244                Self::UnknownValue(u) => u.0.value(),
2245            }
2246        }
2247
2248        /// Gets the enum value as a string.
2249        ///
2250        /// Returns `None` if the enum contains an unknown value deserialized from
2251        /// the integer representation of enums.
2252        pub fn name(&self) -> std::option::Option<&str> {
2253            match self {
2254                Self::Unspecified => std::option::Option::Some("PRINCIPAL_UNSPECIFIED"),
2255                Self::ConnectorSa => std::option::Option::Some("CONNECTOR_SA"),
2256                Self::UnknownValue(u) => u.0.name(),
2257            }
2258        }
2259    }
2260
2261    impl std::default::Default for Principal {
2262        fn default() -> Self {
2263            use std::convert::From;
2264            Self::from(0)
2265        }
2266    }
2267
2268    impl std::fmt::Display for Principal {
2269        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2270            wkt::internal::display_enum(f, self.name(), self.value())
2271        }
2272    }
2273
2274    impl std::convert::From<i32> for Principal {
2275        fn from(value: i32) -> Self {
2276            match value {
2277                0 => Self::Unspecified,
2278                1 => Self::ConnectorSa,
2279                _ => Self::UnknownValue(principal::UnknownValue(
2280                    wkt::internal::UnknownEnumValue::Integer(value),
2281                )),
2282            }
2283        }
2284    }
2285
2286    impl std::convert::From<&str> for Principal {
2287        fn from(value: &str) -> Self {
2288            use std::string::ToString;
2289            match value {
2290                "PRINCIPAL_UNSPECIFIED" => Self::Unspecified,
2291                "CONNECTOR_SA" => Self::ConnectorSa,
2292                _ => Self::UnknownValue(principal::UnknownValue(
2293                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2294                )),
2295            }
2296        }
2297    }
2298
2299    impl serde::ser::Serialize for Principal {
2300        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2301        where
2302            S: serde::Serializer,
2303        {
2304            match self {
2305                Self::Unspecified => serializer.serialize_i32(0),
2306                Self::ConnectorSa => serializer.serialize_i32(1),
2307                Self::UnknownValue(u) => u.0.serialize(serializer),
2308            }
2309        }
2310    }
2311
2312    impl<'de> serde::de::Deserialize<'de> for Principal {
2313        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2314        where
2315            D: serde::Deserializer<'de>,
2316        {
2317            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Principal>::new(
2318                ".google.cloud.connectors.v1.RoleGrant.Principal",
2319            ))
2320        }
2321    }
2322}
2323
2324/// This configuration captures the details required to render an authorization
2325/// link for the OAuth Authorization Code Flow.
2326#[derive(Clone, Default, PartialEq)]
2327#[non_exhaustive]
2328pub struct AuthorizationCodeLink {
2329    /// The base URI the user must click to trigger the authorization code login
2330    /// flow.
2331    pub uri: std::string::String,
2332
2333    /// The scopes for which the user will authorize GCP Connectors on the
2334    /// connector data source.
2335    pub scopes: std::vec::Vec<std::string::String>,
2336
2337    /// The client ID assigned to the GCP Connectors OAuth app for the connector
2338    /// data source.
2339    pub client_id: std::string::String,
2340
2341    /// Whether to enable PKCE for the auth code flow.
2342    pub enable_pkce: bool,
2343
2344    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2345}
2346
2347impl AuthorizationCodeLink {
2348    pub fn new() -> Self {
2349        std::default::Default::default()
2350    }
2351
2352    /// Sets the value of [uri][crate::model::AuthorizationCodeLink::uri].
2353    ///
2354    /// # Example
2355    /// ```ignore,no_run
2356    /// # use google_cloud_connectors_v1::model::AuthorizationCodeLink;
2357    /// let x = AuthorizationCodeLink::new().set_uri("example");
2358    /// ```
2359    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2360        self.uri = v.into();
2361        self
2362    }
2363
2364    /// Sets the value of [scopes][crate::model::AuthorizationCodeLink::scopes].
2365    ///
2366    /// # Example
2367    /// ```ignore,no_run
2368    /// # use google_cloud_connectors_v1::model::AuthorizationCodeLink;
2369    /// let x = AuthorizationCodeLink::new().set_scopes(["a", "b", "c"]);
2370    /// ```
2371    pub fn set_scopes<T, V>(mut self, v: T) -> Self
2372    where
2373        T: std::iter::IntoIterator<Item = V>,
2374        V: std::convert::Into<std::string::String>,
2375    {
2376        use std::iter::Iterator;
2377        self.scopes = v.into_iter().map(|i| i.into()).collect();
2378        self
2379    }
2380
2381    /// Sets the value of [client_id][crate::model::AuthorizationCodeLink::client_id].
2382    ///
2383    /// # Example
2384    /// ```ignore,no_run
2385    /// # use google_cloud_connectors_v1::model::AuthorizationCodeLink;
2386    /// let x = AuthorizationCodeLink::new().set_client_id("example");
2387    /// ```
2388    pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2389        self.client_id = v.into();
2390        self
2391    }
2392
2393    /// Sets the value of [enable_pkce][crate::model::AuthorizationCodeLink::enable_pkce].
2394    ///
2395    /// # Example
2396    /// ```ignore,no_run
2397    /// # use google_cloud_connectors_v1::model::AuthorizationCodeLink;
2398    /// let x = AuthorizationCodeLink::new().set_enable_pkce(true);
2399    /// ```
2400    pub fn set_enable_pkce<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2401        self.enable_pkce = v.into();
2402        self
2403    }
2404}
2405
2406impl wkt::message::Message for AuthorizationCodeLink {
2407    fn typename() -> &'static str {
2408        "type.googleapis.com/google.cloud.connectors.v1.AuthorizationCodeLink"
2409    }
2410}
2411
2412/// Connection represents an instance of connector.
2413#[derive(Clone, Default, PartialEq)]
2414#[non_exhaustive]
2415pub struct Connection {
2416    /// Output only. Resource name of the Connection.
2417    /// Format: projects/{project}/locations/{location}/connections/{connection}
2418    pub name: std::string::String,
2419
2420    /// Output only. Created time.
2421    pub create_time: std::option::Option<wkt::Timestamp>,
2422
2423    /// Output only. Updated time.
2424    pub update_time: std::option::Option<wkt::Timestamp>,
2425
2426    /// Optional. Resource labels to represent user-provided metadata.
2427    /// Refer to cloud documentation on labels for more details.
2428    /// <https://cloud.google.com/compute/docs/labeling-resources>
2429    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2430
2431    /// Optional. Description of the resource.
2432    pub description: std::string::String,
2433
2434    /// Required. Connector version on which the connection is created.
2435    /// The format is:
2436    /// projects/*/locations/*/providers/*/connectors/*/versions/*
2437    /// Only global location is supported for ConnectorVersion resource.
2438    pub connector_version: std::string::String,
2439
2440    /// Output only. Current status of the connection.
2441    pub status: std::option::Option<crate::model::ConnectionStatus>,
2442
2443    /// Optional. Configuration for configuring the connection with an external
2444    /// system.
2445    pub config_variables: std::vec::Vec<crate::model::ConfigVariable>,
2446
2447    /// Optional. Configuration for establishing the connection's authentication
2448    /// with an external system.
2449    pub auth_config: std::option::Option<crate::model::AuthConfig>,
2450
2451    /// Optional. Configuration that indicates whether or not the Connection can be
2452    /// edited.
2453    pub lock_config: std::option::Option<crate::model::LockConfig>,
2454
2455    /// Optional. Configuration of the Connector's destination. Only accepted for
2456    /// Connectors that accepts user defined destination(s).
2457    pub destination_configs: std::vec::Vec<crate::model::DestinationConfig>,
2458
2459    /// Output only. GCR location where the runtime image is stored.
2460    /// formatted like: gcr.io/{bucketName}/{imageName}
2461    pub image_location: std::string::String,
2462
2463    /// Optional. Service account needed for runtime plane to access GCP resources.
2464    pub service_account: std::string::String,
2465
2466    /// Output only. The name of the Service Directory service name. Used for
2467    /// Private Harpoon to resolve the ILB address.
2468    /// e.g.
2469    /// "projects/cloud-connectors-e2e-testing/locations/us-central1/namespaces/istio-system/services/istio-ingressgateway-connectors"
2470    pub service_directory: std::string::String,
2471
2472    /// Output only. GCR location where the envoy image is stored.
2473    /// formatted like: gcr.io/{bucketName}/{imageName}
2474    pub envoy_image_location: std::string::String,
2475
2476    /// Optional. Suspended indicates if a user has suspended a connection or not.
2477    pub suspended: bool,
2478
2479    /// Optional. Node configuration for the connection.
2480    pub node_config: std::option::Option<crate::model::NodeConfig>,
2481
2482    /// Optional. Ssl config of a connection
2483    pub ssl_config: std::option::Option<crate::model::SslConfig>,
2484
2485    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2486}
2487
2488impl Connection {
2489    pub fn new() -> Self {
2490        std::default::Default::default()
2491    }
2492
2493    /// Sets the value of [name][crate::model::Connection::name].
2494    ///
2495    /// # Example
2496    /// ```ignore,no_run
2497    /// # use google_cloud_connectors_v1::model::Connection;
2498    /// let x = Connection::new().set_name("example");
2499    /// ```
2500    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2501        self.name = v.into();
2502        self
2503    }
2504
2505    /// Sets the value of [create_time][crate::model::Connection::create_time].
2506    ///
2507    /// # Example
2508    /// ```ignore,no_run
2509    /// # use google_cloud_connectors_v1::model::Connection;
2510    /// use wkt::Timestamp;
2511    /// let x = Connection::new().set_create_time(Timestamp::default()/* use setters */);
2512    /// ```
2513    pub fn set_create_time<T>(mut self, v: T) -> Self
2514    where
2515        T: std::convert::Into<wkt::Timestamp>,
2516    {
2517        self.create_time = std::option::Option::Some(v.into());
2518        self
2519    }
2520
2521    /// Sets or clears the value of [create_time][crate::model::Connection::create_time].
2522    ///
2523    /// # Example
2524    /// ```ignore,no_run
2525    /// # use google_cloud_connectors_v1::model::Connection;
2526    /// use wkt::Timestamp;
2527    /// let x = Connection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2528    /// let x = Connection::new().set_or_clear_create_time(None::<Timestamp>);
2529    /// ```
2530    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2531    where
2532        T: std::convert::Into<wkt::Timestamp>,
2533    {
2534        self.create_time = v.map(|x| x.into());
2535        self
2536    }
2537
2538    /// Sets the value of [update_time][crate::model::Connection::update_time].
2539    ///
2540    /// # Example
2541    /// ```ignore,no_run
2542    /// # use google_cloud_connectors_v1::model::Connection;
2543    /// use wkt::Timestamp;
2544    /// let x = Connection::new().set_update_time(Timestamp::default()/* use setters */);
2545    /// ```
2546    pub fn set_update_time<T>(mut self, v: T) -> Self
2547    where
2548        T: std::convert::Into<wkt::Timestamp>,
2549    {
2550        self.update_time = std::option::Option::Some(v.into());
2551        self
2552    }
2553
2554    /// Sets or clears the value of [update_time][crate::model::Connection::update_time].
2555    ///
2556    /// # Example
2557    /// ```ignore,no_run
2558    /// # use google_cloud_connectors_v1::model::Connection;
2559    /// use wkt::Timestamp;
2560    /// let x = Connection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2561    /// let x = Connection::new().set_or_clear_update_time(None::<Timestamp>);
2562    /// ```
2563    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2564    where
2565        T: std::convert::Into<wkt::Timestamp>,
2566    {
2567        self.update_time = v.map(|x| x.into());
2568        self
2569    }
2570
2571    /// Sets the value of [labels][crate::model::Connection::labels].
2572    ///
2573    /// # Example
2574    /// ```ignore,no_run
2575    /// # use google_cloud_connectors_v1::model::Connection;
2576    /// let x = Connection::new().set_labels([
2577    ///     ("key0", "abc"),
2578    ///     ("key1", "xyz"),
2579    /// ]);
2580    /// ```
2581    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2582    where
2583        T: std::iter::IntoIterator<Item = (K, V)>,
2584        K: std::convert::Into<std::string::String>,
2585        V: std::convert::Into<std::string::String>,
2586    {
2587        use std::iter::Iterator;
2588        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2589        self
2590    }
2591
2592    /// Sets the value of [description][crate::model::Connection::description].
2593    ///
2594    /// # Example
2595    /// ```ignore,no_run
2596    /// # use google_cloud_connectors_v1::model::Connection;
2597    /// let x = Connection::new().set_description("example");
2598    /// ```
2599    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2600        self.description = v.into();
2601        self
2602    }
2603
2604    /// Sets the value of [connector_version][crate::model::Connection::connector_version].
2605    ///
2606    /// # Example
2607    /// ```ignore,no_run
2608    /// # use google_cloud_connectors_v1::model::Connection;
2609    /// let x = Connection::new().set_connector_version("example");
2610    /// ```
2611    pub fn set_connector_version<T: std::convert::Into<std::string::String>>(
2612        mut self,
2613        v: T,
2614    ) -> Self {
2615        self.connector_version = v.into();
2616        self
2617    }
2618
2619    /// Sets the value of [status][crate::model::Connection::status].
2620    ///
2621    /// # Example
2622    /// ```ignore,no_run
2623    /// # use google_cloud_connectors_v1::model::Connection;
2624    /// use google_cloud_connectors_v1::model::ConnectionStatus;
2625    /// let x = Connection::new().set_status(ConnectionStatus::default()/* use setters */);
2626    /// ```
2627    pub fn set_status<T>(mut self, v: T) -> Self
2628    where
2629        T: std::convert::Into<crate::model::ConnectionStatus>,
2630    {
2631        self.status = std::option::Option::Some(v.into());
2632        self
2633    }
2634
2635    /// Sets or clears the value of [status][crate::model::Connection::status].
2636    ///
2637    /// # Example
2638    /// ```ignore,no_run
2639    /// # use google_cloud_connectors_v1::model::Connection;
2640    /// use google_cloud_connectors_v1::model::ConnectionStatus;
2641    /// let x = Connection::new().set_or_clear_status(Some(ConnectionStatus::default()/* use setters */));
2642    /// let x = Connection::new().set_or_clear_status(None::<ConnectionStatus>);
2643    /// ```
2644    pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
2645    where
2646        T: std::convert::Into<crate::model::ConnectionStatus>,
2647    {
2648        self.status = v.map(|x| x.into());
2649        self
2650    }
2651
2652    /// Sets the value of [config_variables][crate::model::Connection::config_variables].
2653    ///
2654    /// # Example
2655    /// ```ignore,no_run
2656    /// # use google_cloud_connectors_v1::model::Connection;
2657    /// use google_cloud_connectors_v1::model::ConfigVariable;
2658    /// let x = Connection::new()
2659    ///     .set_config_variables([
2660    ///         ConfigVariable::default()/* use setters */,
2661    ///         ConfigVariable::default()/* use (different) setters */,
2662    ///     ]);
2663    /// ```
2664    pub fn set_config_variables<T, V>(mut self, v: T) -> Self
2665    where
2666        T: std::iter::IntoIterator<Item = V>,
2667        V: std::convert::Into<crate::model::ConfigVariable>,
2668    {
2669        use std::iter::Iterator;
2670        self.config_variables = v.into_iter().map(|i| i.into()).collect();
2671        self
2672    }
2673
2674    /// Sets the value of [auth_config][crate::model::Connection::auth_config].
2675    ///
2676    /// # Example
2677    /// ```ignore,no_run
2678    /// # use google_cloud_connectors_v1::model::Connection;
2679    /// use google_cloud_connectors_v1::model::AuthConfig;
2680    /// let x = Connection::new().set_auth_config(AuthConfig::default()/* use setters */);
2681    /// ```
2682    pub fn set_auth_config<T>(mut self, v: T) -> Self
2683    where
2684        T: std::convert::Into<crate::model::AuthConfig>,
2685    {
2686        self.auth_config = std::option::Option::Some(v.into());
2687        self
2688    }
2689
2690    /// Sets or clears the value of [auth_config][crate::model::Connection::auth_config].
2691    ///
2692    /// # Example
2693    /// ```ignore,no_run
2694    /// # use google_cloud_connectors_v1::model::Connection;
2695    /// use google_cloud_connectors_v1::model::AuthConfig;
2696    /// let x = Connection::new().set_or_clear_auth_config(Some(AuthConfig::default()/* use setters */));
2697    /// let x = Connection::new().set_or_clear_auth_config(None::<AuthConfig>);
2698    /// ```
2699    pub fn set_or_clear_auth_config<T>(mut self, v: std::option::Option<T>) -> Self
2700    where
2701        T: std::convert::Into<crate::model::AuthConfig>,
2702    {
2703        self.auth_config = v.map(|x| x.into());
2704        self
2705    }
2706
2707    /// Sets the value of [lock_config][crate::model::Connection::lock_config].
2708    ///
2709    /// # Example
2710    /// ```ignore,no_run
2711    /// # use google_cloud_connectors_v1::model::Connection;
2712    /// use google_cloud_connectors_v1::model::LockConfig;
2713    /// let x = Connection::new().set_lock_config(LockConfig::default()/* use setters */);
2714    /// ```
2715    pub fn set_lock_config<T>(mut self, v: T) -> Self
2716    where
2717        T: std::convert::Into<crate::model::LockConfig>,
2718    {
2719        self.lock_config = std::option::Option::Some(v.into());
2720        self
2721    }
2722
2723    /// Sets or clears the value of [lock_config][crate::model::Connection::lock_config].
2724    ///
2725    /// # Example
2726    /// ```ignore,no_run
2727    /// # use google_cloud_connectors_v1::model::Connection;
2728    /// use google_cloud_connectors_v1::model::LockConfig;
2729    /// let x = Connection::new().set_or_clear_lock_config(Some(LockConfig::default()/* use setters */));
2730    /// let x = Connection::new().set_or_clear_lock_config(None::<LockConfig>);
2731    /// ```
2732    pub fn set_or_clear_lock_config<T>(mut self, v: std::option::Option<T>) -> Self
2733    where
2734        T: std::convert::Into<crate::model::LockConfig>,
2735    {
2736        self.lock_config = v.map(|x| x.into());
2737        self
2738    }
2739
2740    /// Sets the value of [destination_configs][crate::model::Connection::destination_configs].
2741    ///
2742    /// # Example
2743    /// ```ignore,no_run
2744    /// # use google_cloud_connectors_v1::model::Connection;
2745    /// use google_cloud_connectors_v1::model::DestinationConfig;
2746    /// let x = Connection::new()
2747    ///     .set_destination_configs([
2748    ///         DestinationConfig::default()/* use setters */,
2749    ///         DestinationConfig::default()/* use (different) setters */,
2750    ///     ]);
2751    /// ```
2752    pub fn set_destination_configs<T, V>(mut self, v: T) -> Self
2753    where
2754        T: std::iter::IntoIterator<Item = V>,
2755        V: std::convert::Into<crate::model::DestinationConfig>,
2756    {
2757        use std::iter::Iterator;
2758        self.destination_configs = v.into_iter().map(|i| i.into()).collect();
2759        self
2760    }
2761
2762    /// Sets the value of [image_location][crate::model::Connection::image_location].
2763    ///
2764    /// # Example
2765    /// ```ignore,no_run
2766    /// # use google_cloud_connectors_v1::model::Connection;
2767    /// let x = Connection::new().set_image_location("example");
2768    /// ```
2769    pub fn set_image_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2770        self.image_location = v.into();
2771        self
2772    }
2773
2774    /// Sets the value of [service_account][crate::model::Connection::service_account].
2775    ///
2776    /// # Example
2777    /// ```ignore,no_run
2778    /// # use google_cloud_connectors_v1::model::Connection;
2779    /// let x = Connection::new().set_service_account("example");
2780    /// ```
2781    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2782        self.service_account = v.into();
2783        self
2784    }
2785
2786    /// Sets the value of [service_directory][crate::model::Connection::service_directory].
2787    ///
2788    /// # Example
2789    /// ```ignore,no_run
2790    /// # use google_cloud_connectors_v1::model::Connection;
2791    /// let x = Connection::new().set_service_directory("example");
2792    /// ```
2793    pub fn set_service_directory<T: std::convert::Into<std::string::String>>(
2794        mut self,
2795        v: T,
2796    ) -> Self {
2797        self.service_directory = v.into();
2798        self
2799    }
2800
2801    /// Sets the value of [envoy_image_location][crate::model::Connection::envoy_image_location].
2802    ///
2803    /// # Example
2804    /// ```ignore,no_run
2805    /// # use google_cloud_connectors_v1::model::Connection;
2806    /// let x = Connection::new().set_envoy_image_location("example");
2807    /// ```
2808    pub fn set_envoy_image_location<T: std::convert::Into<std::string::String>>(
2809        mut self,
2810        v: T,
2811    ) -> Self {
2812        self.envoy_image_location = v.into();
2813        self
2814    }
2815
2816    /// Sets the value of [suspended][crate::model::Connection::suspended].
2817    ///
2818    /// # Example
2819    /// ```ignore,no_run
2820    /// # use google_cloud_connectors_v1::model::Connection;
2821    /// let x = Connection::new().set_suspended(true);
2822    /// ```
2823    pub fn set_suspended<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2824        self.suspended = v.into();
2825        self
2826    }
2827
2828    /// Sets the value of [node_config][crate::model::Connection::node_config].
2829    ///
2830    /// # Example
2831    /// ```ignore,no_run
2832    /// # use google_cloud_connectors_v1::model::Connection;
2833    /// use google_cloud_connectors_v1::model::NodeConfig;
2834    /// let x = Connection::new().set_node_config(NodeConfig::default()/* use setters */);
2835    /// ```
2836    pub fn set_node_config<T>(mut self, v: T) -> Self
2837    where
2838        T: std::convert::Into<crate::model::NodeConfig>,
2839    {
2840        self.node_config = std::option::Option::Some(v.into());
2841        self
2842    }
2843
2844    /// Sets or clears the value of [node_config][crate::model::Connection::node_config].
2845    ///
2846    /// # Example
2847    /// ```ignore,no_run
2848    /// # use google_cloud_connectors_v1::model::Connection;
2849    /// use google_cloud_connectors_v1::model::NodeConfig;
2850    /// let x = Connection::new().set_or_clear_node_config(Some(NodeConfig::default()/* use setters */));
2851    /// let x = Connection::new().set_or_clear_node_config(None::<NodeConfig>);
2852    /// ```
2853    pub fn set_or_clear_node_config<T>(mut self, v: std::option::Option<T>) -> Self
2854    where
2855        T: std::convert::Into<crate::model::NodeConfig>,
2856    {
2857        self.node_config = v.map(|x| x.into());
2858        self
2859    }
2860
2861    /// Sets the value of [ssl_config][crate::model::Connection::ssl_config].
2862    ///
2863    /// # Example
2864    /// ```ignore,no_run
2865    /// # use google_cloud_connectors_v1::model::Connection;
2866    /// use google_cloud_connectors_v1::model::SslConfig;
2867    /// let x = Connection::new().set_ssl_config(SslConfig::default()/* use setters */);
2868    /// ```
2869    pub fn set_ssl_config<T>(mut self, v: T) -> Self
2870    where
2871        T: std::convert::Into<crate::model::SslConfig>,
2872    {
2873        self.ssl_config = std::option::Option::Some(v.into());
2874        self
2875    }
2876
2877    /// Sets or clears the value of [ssl_config][crate::model::Connection::ssl_config].
2878    ///
2879    /// # Example
2880    /// ```ignore,no_run
2881    /// # use google_cloud_connectors_v1::model::Connection;
2882    /// use google_cloud_connectors_v1::model::SslConfig;
2883    /// let x = Connection::new().set_or_clear_ssl_config(Some(SslConfig::default()/* use setters */));
2884    /// let x = Connection::new().set_or_clear_ssl_config(None::<SslConfig>);
2885    /// ```
2886    pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
2887    where
2888        T: std::convert::Into<crate::model::SslConfig>,
2889    {
2890        self.ssl_config = v.map(|x| x.into());
2891        self
2892    }
2893}
2894
2895impl wkt::message::Message for Connection {
2896    fn typename() -> &'static str {
2897        "type.googleapis.com/google.cloud.connectors.v1.Connection"
2898    }
2899}
2900
2901/// Node configuration for the connection.
2902#[derive(Clone, Default, PartialEq)]
2903#[non_exhaustive]
2904pub struct NodeConfig {
2905    /// Minimum number of nodes in the runtime nodes.
2906    pub min_node_count: i32,
2907
2908    /// Maximum number of nodes in the runtime nodes.
2909    pub max_node_count: i32,
2910
2911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2912}
2913
2914impl NodeConfig {
2915    pub fn new() -> Self {
2916        std::default::Default::default()
2917    }
2918
2919    /// Sets the value of [min_node_count][crate::model::NodeConfig::min_node_count].
2920    ///
2921    /// # Example
2922    /// ```ignore,no_run
2923    /// # use google_cloud_connectors_v1::model::NodeConfig;
2924    /// let x = NodeConfig::new().set_min_node_count(42);
2925    /// ```
2926    pub fn set_min_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2927        self.min_node_count = v.into();
2928        self
2929    }
2930
2931    /// Sets the value of [max_node_count][crate::model::NodeConfig::max_node_count].
2932    ///
2933    /// # Example
2934    /// ```ignore,no_run
2935    /// # use google_cloud_connectors_v1::model::NodeConfig;
2936    /// let x = NodeConfig::new().set_max_node_count(42);
2937    /// ```
2938    pub fn set_max_node_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2939        self.max_node_count = v.into();
2940        self
2941    }
2942}
2943
2944impl wkt::message::Message for NodeConfig {
2945    fn typename() -> &'static str {
2946        "type.googleapis.com/google.cloud.connectors.v1.NodeConfig"
2947    }
2948}
2949
2950/// ConnectionSchemaMetadata is the singleton resource of each connection.
2951/// It includes the entity and action names of runtime resources exposed
2952/// by a connection backend.
2953#[derive(Clone, Default, PartialEq)]
2954#[non_exhaustive]
2955pub struct ConnectionSchemaMetadata {
2956    /// Output only. List of entity names.
2957    pub entities: std::vec::Vec<std::string::String>,
2958
2959    /// Output only. List of actions.
2960    pub actions: std::vec::Vec<std::string::String>,
2961
2962    /// Output only. Resource name.
2963    /// Format:
2964    /// projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata
2965    pub name: std::string::String,
2966
2967    /// Output only. Timestamp when the connection runtime schema was updated.
2968    pub update_time: std::option::Option<wkt::Timestamp>,
2969
2970    /// Output only. Timestamp when the connection runtime schema refresh was
2971    /// triggered.
2972    pub refresh_time: std::option::Option<wkt::Timestamp>,
2973
2974    /// Output only. The current state of runtime schema.
2975    pub state: crate::model::connection_schema_metadata::State,
2976
2977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2978}
2979
2980impl ConnectionSchemaMetadata {
2981    pub fn new() -> Self {
2982        std::default::Default::default()
2983    }
2984
2985    /// Sets the value of [entities][crate::model::ConnectionSchemaMetadata::entities].
2986    ///
2987    /// # Example
2988    /// ```ignore,no_run
2989    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
2990    /// let x = ConnectionSchemaMetadata::new().set_entities(["a", "b", "c"]);
2991    /// ```
2992    pub fn set_entities<T, V>(mut self, v: T) -> Self
2993    where
2994        T: std::iter::IntoIterator<Item = V>,
2995        V: std::convert::Into<std::string::String>,
2996    {
2997        use std::iter::Iterator;
2998        self.entities = v.into_iter().map(|i| i.into()).collect();
2999        self
3000    }
3001
3002    /// Sets the value of [actions][crate::model::ConnectionSchemaMetadata::actions].
3003    ///
3004    /// # Example
3005    /// ```ignore,no_run
3006    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
3007    /// let x = ConnectionSchemaMetadata::new().set_actions(["a", "b", "c"]);
3008    /// ```
3009    pub fn set_actions<T, V>(mut self, v: T) -> Self
3010    where
3011        T: std::iter::IntoIterator<Item = V>,
3012        V: std::convert::Into<std::string::String>,
3013    {
3014        use std::iter::Iterator;
3015        self.actions = v.into_iter().map(|i| i.into()).collect();
3016        self
3017    }
3018
3019    /// Sets the value of [name][crate::model::ConnectionSchemaMetadata::name].
3020    ///
3021    /// # Example
3022    /// ```ignore,no_run
3023    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
3024    /// let x = ConnectionSchemaMetadata::new().set_name("example");
3025    /// ```
3026    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3027        self.name = v.into();
3028        self
3029    }
3030
3031    /// Sets the value of [update_time][crate::model::ConnectionSchemaMetadata::update_time].
3032    ///
3033    /// # Example
3034    /// ```ignore,no_run
3035    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
3036    /// use wkt::Timestamp;
3037    /// let x = ConnectionSchemaMetadata::new().set_update_time(Timestamp::default()/* use setters */);
3038    /// ```
3039    pub fn set_update_time<T>(mut self, v: T) -> Self
3040    where
3041        T: std::convert::Into<wkt::Timestamp>,
3042    {
3043        self.update_time = std::option::Option::Some(v.into());
3044        self
3045    }
3046
3047    /// Sets or clears the value of [update_time][crate::model::ConnectionSchemaMetadata::update_time].
3048    ///
3049    /// # Example
3050    /// ```ignore,no_run
3051    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
3052    /// use wkt::Timestamp;
3053    /// let x = ConnectionSchemaMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3054    /// let x = ConnectionSchemaMetadata::new().set_or_clear_update_time(None::<Timestamp>);
3055    /// ```
3056    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3057    where
3058        T: std::convert::Into<wkt::Timestamp>,
3059    {
3060        self.update_time = v.map(|x| x.into());
3061        self
3062    }
3063
3064    /// Sets the value of [refresh_time][crate::model::ConnectionSchemaMetadata::refresh_time].
3065    ///
3066    /// # Example
3067    /// ```ignore,no_run
3068    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
3069    /// use wkt::Timestamp;
3070    /// let x = ConnectionSchemaMetadata::new().set_refresh_time(Timestamp::default()/* use setters */);
3071    /// ```
3072    pub fn set_refresh_time<T>(mut self, v: T) -> Self
3073    where
3074        T: std::convert::Into<wkt::Timestamp>,
3075    {
3076        self.refresh_time = std::option::Option::Some(v.into());
3077        self
3078    }
3079
3080    /// Sets or clears the value of [refresh_time][crate::model::ConnectionSchemaMetadata::refresh_time].
3081    ///
3082    /// # Example
3083    /// ```ignore,no_run
3084    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
3085    /// use wkt::Timestamp;
3086    /// let x = ConnectionSchemaMetadata::new().set_or_clear_refresh_time(Some(Timestamp::default()/* use setters */));
3087    /// let x = ConnectionSchemaMetadata::new().set_or_clear_refresh_time(None::<Timestamp>);
3088    /// ```
3089    pub fn set_or_clear_refresh_time<T>(mut self, v: std::option::Option<T>) -> Self
3090    where
3091        T: std::convert::Into<wkt::Timestamp>,
3092    {
3093        self.refresh_time = v.map(|x| x.into());
3094        self
3095    }
3096
3097    /// Sets the value of [state][crate::model::ConnectionSchemaMetadata::state].
3098    ///
3099    /// # Example
3100    /// ```ignore,no_run
3101    /// # use google_cloud_connectors_v1::model::ConnectionSchemaMetadata;
3102    /// use google_cloud_connectors_v1::model::connection_schema_metadata::State;
3103    /// let x0 = ConnectionSchemaMetadata::new().set_state(State::Refreshing);
3104    /// let x1 = ConnectionSchemaMetadata::new().set_state(State::Updated);
3105    /// ```
3106    pub fn set_state<T: std::convert::Into<crate::model::connection_schema_metadata::State>>(
3107        mut self,
3108        v: T,
3109    ) -> Self {
3110        self.state = v.into();
3111        self
3112    }
3113}
3114
3115impl wkt::message::Message for ConnectionSchemaMetadata {
3116    fn typename() -> &'static str {
3117        "type.googleapis.com/google.cloud.connectors.v1.ConnectionSchemaMetadata"
3118    }
3119}
3120
3121/// Defines additional types related to [ConnectionSchemaMetadata].
3122pub mod connection_schema_metadata {
3123    #[allow(unused_imports)]
3124    use super::*;
3125
3126    /// State of connection runtime schema.
3127    ///
3128    /// # Working with unknown values
3129    ///
3130    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3131    /// additional enum variants at any time. Adding new variants is not considered
3132    /// a breaking change. Applications should write their code in anticipation of:
3133    ///
3134    /// - New values appearing in future releases of the client library, **and**
3135    /// - New values received dynamically, without application changes.
3136    ///
3137    /// Please consult the [Working with enums] section in the user guide for some
3138    /// guidelines.
3139    ///
3140    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3141    #[derive(Clone, Debug, PartialEq)]
3142    #[non_exhaustive]
3143    pub enum State {
3144        /// Default state.
3145        Unspecified,
3146        /// Schema refresh is in progress.
3147        Refreshing,
3148        /// Schema has been updated.
3149        Updated,
3150        /// If set, the enum was initialized with an unknown value.
3151        ///
3152        /// Applications can examine the value using [State::value] or
3153        /// [State::name].
3154        UnknownValue(state::UnknownValue),
3155    }
3156
3157    #[doc(hidden)]
3158    pub mod state {
3159        #[allow(unused_imports)]
3160        use super::*;
3161        #[derive(Clone, Debug, PartialEq)]
3162        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3163    }
3164
3165    impl State {
3166        /// Gets the enum value.
3167        ///
3168        /// Returns `None` if the enum contains an unknown value deserialized from
3169        /// the string representation of enums.
3170        pub fn value(&self) -> std::option::Option<i32> {
3171            match self {
3172                Self::Unspecified => std::option::Option::Some(0),
3173                Self::Refreshing => std::option::Option::Some(1),
3174                Self::Updated => std::option::Option::Some(2),
3175                Self::UnknownValue(u) => u.0.value(),
3176            }
3177        }
3178
3179        /// Gets the enum value as a string.
3180        ///
3181        /// Returns `None` if the enum contains an unknown value deserialized from
3182        /// the integer representation of enums.
3183        pub fn name(&self) -> std::option::Option<&str> {
3184            match self {
3185                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3186                Self::Refreshing => std::option::Option::Some("REFRESHING"),
3187                Self::Updated => std::option::Option::Some("UPDATED"),
3188                Self::UnknownValue(u) => u.0.name(),
3189            }
3190        }
3191    }
3192
3193    impl std::default::Default for State {
3194        fn default() -> Self {
3195            use std::convert::From;
3196            Self::from(0)
3197        }
3198    }
3199
3200    impl std::fmt::Display for State {
3201        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3202            wkt::internal::display_enum(f, self.name(), self.value())
3203        }
3204    }
3205
3206    impl std::convert::From<i32> for State {
3207        fn from(value: i32) -> Self {
3208            match value {
3209                0 => Self::Unspecified,
3210                1 => Self::Refreshing,
3211                2 => Self::Updated,
3212                _ => Self::UnknownValue(state::UnknownValue(
3213                    wkt::internal::UnknownEnumValue::Integer(value),
3214                )),
3215            }
3216        }
3217    }
3218
3219    impl std::convert::From<&str> for State {
3220        fn from(value: &str) -> Self {
3221            use std::string::ToString;
3222            match value {
3223                "STATE_UNSPECIFIED" => Self::Unspecified,
3224                "REFRESHING" => Self::Refreshing,
3225                "UPDATED" => Self::Updated,
3226                _ => Self::UnknownValue(state::UnknownValue(
3227                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3228                )),
3229            }
3230        }
3231    }
3232
3233    impl serde::ser::Serialize for State {
3234        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3235        where
3236            S: serde::Serializer,
3237        {
3238            match self {
3239                Self::Unspecified => serializer.serialize_i32(0),
3240                Self::Refreshing => serializer.serialize_i32(1),
3241                Self::Updated => serializer.serialize_i32(2),
3242                Self::UnknownValue(u) => u.0.serialize(serializer),
3243            }
3244        }
3245    }
3246
3247    impl<'de> serde::de::Deserialize<'de> for State {
3248        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3249        where
3250            D: serde::Deserializer<'de>,
3251        {
3252            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3253                ".google.cloud.connectors.v1.ConnectionSchemaMetadata.State",
3254            ))
3255        }
3256    }
3257}
3258
3259/// Schema of a runtime entity.
3260#[derive(Clone, Default, PartialEq)]
3261#[non_exhaustive]
3262pub struct RuntimeEntitySchema {
3263    /// Output only. Name of the entity.
3264    pub entity: std::string::String,
3265
3266    /// Output only. List of fields in the entity.
3267    pub fields: std::vec::Vec<crate::model::runtime_entity_schema::Field>,
3268
3269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3270}
3271
3272impl RuntimeEntitySchema {
3273    pub fn new() -> Self {
3274        std::default::Default::default()
3275    }
3276
3277    /// Sets the value of [entity][crate::model::RuntimeEntitySchema::entity].
3278    ///
3279    /// # Example
3280    /// ```ignore,no_run
3281    /// # use google_cloud_connectors_v1::model::RuntimeEntitySchema;
3282    /// let x = RuntimeEntitySchema::new().set_entity("example");
3283    /// ```
3284    pub fn set_entity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3285        self.entity = v.into();
3286        self
3287    }
3288
3289    /// Sets the value of [fields][crate::model::RuntimeEntitySchema::fields].
3290    ///
3291    /// # Example
3292    /// ```ignore,no_run
3293    /// # use google_cloud_connectors_v1::model::RuntimeEntitySchema;
3294    /// use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3295    /// let x = RuntimeEntitySchema::new()
3296    ///     .set_fields([
3297    ///         Field::default()/* use setters */,
3298    ///         Field::default()/* use (different) setters */,
3299    ///     ]);
3300    /// ```
3301    pub fn set_fields<T, V>(mut self, v: T) -> Self
3302    where
3303        T: std::iter::IntoIterator<Item = V>,
3304        V: std::convert::Into<crate::model::runtime_entity_schema::Field>,
3305    {
3306        use std::iter::Iterator;
3307        self.fields = v.into_iter().map(|i| i.into()).collect();
3308        self
3309    }
3310}
3311
3312impl wkt::message::Message for RuntimeEntitySchema {
3313    fn typename() -> &'static str {
3314        "type.googleapis.com/google.cloud.connectors.v1.RuntimeEntitySchema"
3315    }
3316}
3317
3318/// Defines additional types related to [RuntimeEntitySchema].
3319pub mod runtime_entity_schema {
3320    #[allow(unused_imports)]
3321    use super::*;
3322
3323    /// Metadata of an entity field.
3324    #[derive(Clone, Default, PartialEq)]
3325    #[non_exhaustive]
3326    pub struct Field {
3327        /// Name of the Field.
3328        pub field: std::string::String,
3329
3330        /// A brief description of the Field.
3331        pub description: std::string::String,
3332
3333        /// The data type of the Field.
3334        pub data_type: crate::model::DataType,
3335
3336        /// The following boolean field specifies if the current Field acts
3337        /// as a primary key or id if the parent is of type entity.
3338        pub key: bool,
3339
3340        /// Specifies if the Field is readonly.
3341        pub readonly: bool,
3342
3343        /// Specifies whether a null value is allowed.
3344        pub nullable: bool,
3345
3346        /// The following field specifies the default value of the Field provided
3347        /// by the external system if a value is not provided.
3348        pub default_value: std::option::Option<wkt::Value>,
3349
3350        /// The following map contains fields that are not explicitly mentioned
3351        /// above,this give connectors the flexibility to add new metadata
3352        /// fields.
3353        pub additional_details: std::option::Option<wkt::Struct>,
3354
3355        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3356    }
3357
3358    impl Field {
3359        pub fn new() -> Self {
3360            std::default::Default::default()
3361        }
3362
3363        /// Sets the value of [field][crate::model::runtime_entity_schema::Field::field].
3364        ///
3365        /// # Example
3366        /// ```ignore,no_run
3367        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3368        /// let x = Field::new().set_field("example");
3369        /// ```
3370        pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3371            self.field = v.into();
3372            self
3373        }
3374
3375        /// Sets the value of [description][crate::model::runtime_entity_schema::Field::description].
3376        ///
3377        /// # Example
3378        /// ```ignore,no_run
3379        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3380        /// let x = Field::new().set_description("example");
3381        /// ```
3382        pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3383            self.description = v.into();
3384            self
3385        }
3386
3387        /// Sets the value of [data_type][crate::model::runtime_entity_schema::Field::data_type].
3388        ///
3389        /// # Example
3390        /// ```ignore,no_run
3391        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3392        /// use google_cloud_connectors_v1::model::DataType;
3393        /// let x0 = Field::new().set_data_type(DataType::Smallint);
3394        /// let x1 = Field::new().set_data_type(DataType::Double);
3395        /// let x2 = Field::new().set_data_type(DataType::Date);
3396        /// ```
3397        pub fn set_data_type<T: std::convert::Into<crate::model::DataType>>(
3398            mut self,
3399            v: T,
3400        ) -> Self {
3401            self.data_type = v.into();
3402            self
3403        }
3404
3405        /// Sets the value of [key][crate::model::runtime_entity_schema::Field::key].
3406        ///
3407        /// # Example
3408        /// ```ignore,no_run
3409        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3410        /// let x = Field::new().set_key(true);
3411        /// ```
3412        pub fn set_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3413            self.key = v.into();
3414            self
3415        }
3416
3417        /// Sets the value of [readonly][crate::model::runtime_entity_schema::Field::readonly].
3418        ///
3419        /// # Example
3420        /// ```ignore,no_run
3421        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3422        /// let x = Field::new().set_readonly(true);
3423        /// ```
3424        pub fn set_readonly<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3425            self.readonly = v.into();
3426            self
3427        }
3428
3429        /// Sets the value of [nullable][crate::model::runtime_entity_schema::Field::nullable].
3430        ///
3431        /// # Example
3432        /// ```ignore,no_run
3433        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3434        /// let x = Field::new().set_nullable(true);
3435        /// ```
3436        pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3437            self.nullable = v.into();
3438            self
3439        }
3440
3441        /// Sets the value of [default_value][crate::model::runtime_entity_schema::Field::default_value].
3442        ///
3443        /// # Example
3444        /// ```ignore,no_run
3445        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3446        /// use wkt::Value;
3447        /// let x = Field::new().set_default_value(Value::default()/* use setters */);
3448        /// ```
3449        pub fn set_default_value<T>(mut self, v: T) -> Self
3450        where
3451            T: std::convert::Into<wkt::Value>,
3452        {
3453            self.default_value = std::option::Option::Some(v.into());
3454            self
3455        }
3456
3457        /// Sets or clears the value of [default_value][crate::model::runtime_entity_schema::Field::default_value].
3458        ///
3459        /// # Example
3460        /// ```ignore,no_run
3461        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3462        /// use wkt::Value;
3463        /// let x = Field::new().set_or_clear_default_value(Some(Value::default()/* use setters */));
3464        /// let x = Field::new().set_or_clear_default_value(None::<Value>);
3465        /// ```
3466        pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
3467        where
3468            T: std::convert::Into<wkt::Value>,
3469        {
3470            self.default_value = v.map(|x| x.into());
3471            self
3472        }
3473
3474        /// Sets the value of [additional_details][crate::model::runtime_entity_schema::Field::additional_details].
3475        ///
3476        /// # Example
3477        /// ```ignore,no_run
3478        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3479        /// use wkt::Struct;
3480        /// let x = Field::new().set_additional_details(Struct::default()/* use setters */);
3481        /// ```
3482        pub fn set_additional_details<T>(mut self, v: T) -> Self
3483        where
3484            T: std::convert::Into<wkt::Struct>,
3485        {
3486            self.additional_details = std::option::Option::Some(v.into());
3487            self
3488        }
3489
3490        /// Sets or clears the value of [additional_details][crate::model::runtime_entity_schema::Field::additional_details].
3491        ///
3492        /// # Example
3493        /// ```ignore,no_run
3494        /// # use google_cloud_connectors_v1::model::runtime_entity_schema::Field;
3495        /// use wkt::Struct;
3496        /// let x = Field::new().set_or_clear_additional_details(Some(Struct::default()/* use setters */));
3497        /// let x = Field::new().set_or_clear_additional_details(None::<Struct>);
3498        /// ```
3499        pub fn set_or_clear_additional_details<T>(mut self, v: std::option::Option<T>) -> Self
3500        where
3501            T: std::convert::Into<wkt::Struct>,
3502        {
3503            self.additional_details = v.map(|x| x.into());
3504            self
3505        }
3506    }
3507
3508    impl wkt::message::Message for Field {
3509        fn typename() -> &'static str {
3510            "type.googleapis.com/google.cloud.connectors.v1.RuntimeEntitySchema.Field"
3511        }
3512    }
3513}
3514
3515/// Schema of a runtime action.
3516#[derive(Clone, Default, PartialEq)]
3517#[non_exhaustive]
3518pub struct RuntimeActionSchema {
3519    /// Output only. Name of the action.
3520    pub action: std::string::String,
3521
3522    /// Output only. List of input parameter metadata for the action.
3523    pub input_parameters: std::vec::Vec<crate::model::runtime_action_schema::InputParameter>,
3524
3525    /// Output only. List of result field metadata.
3526    pub result_metadata: std::vec::Vec<crate::model::runtime_action_schema::ResultMetadata>,
3527
3528    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3529}
3530
3531impl RuntimeActionSchema {
3532    pub fn new() -> Self {
3533        std::default::Default::default()
3534    }
3535
3536    /// Sets the value of [action][crate::model::RuntimeActionSchema::action].
3537    ///
3538    /// # Example
3539    /// ```ignore,no_run
3540    /// # use google_cloud_connectors_v1::model::RuntimeActionSchema;
3541    /// let x = RuntimeActionSchema::new().set_action("example");
3542    /// ```
3543    pub fn set_action<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3544        self.action = v.into();
3545        self
3546    }
3547
3548    /// Sets the value of [input_parameters][crate::model::RuntimeActionSchema::input_parameters].
3549    ///
3550    /// # Example
3551    /// ```ignore,no_run
3552    /// # use google_cloud_connectors_v1::model::RuntimeActionSchema;
3553    /// use google_cloud_connectors_v1::model::runtime_action_schema::InputParameter;
3554    /// let x = RuntimeActionSchema::new()
3555    ///     .set_input_parameters([
3556    ///         InputParameter::default()/* use setters */,
3557    ///         InputParameter::default()/* use (different) setters */,
3558    ///     ]);
3559    /// ```
3560    pub fn set_input_parameters<T, V>(mut self, v: T) -> Self
3561    where
3562        T: std::iter::IntoIterator<Item = V>,
3563        V: std::convert::Into<crate::model::runtime_action_schema::InputParameter>,
3564    {
3565        use std::iter::Iterator;
3566        self.input_parameters = v.into_iter().map(|i| i.into()).collect();
3567        self
3568    }
3569
3570    /// Sets the value of [result_metadata][crate::model::RuntimeActionSchema::result_metadata].
3571    ///
3572    /// # Example
3573    /// ```ignore,no_run
3574    /// # use google_cloud_connectors_v1::model::RuntimeActionSchema;
3575    /// use google_cloud_connectors_v1::model::runtime_action_schema::ResultMetadata;
3576    /// let x = RuntimeActionSchema::new()
3577    ///     .set_result_metadata([
3578    ///         ResultMetadata::default()/* use setters */,
3579    ///         ResultMetadata::default()/* use (different) setters */,
3580    ///     ]);
3581    /// ```
3582    pub fn set_result_metadata<T, V>(mut self, v: T) -> Self
3583    where
3584        T: std::iter::IntoIterator<Item = V>,
3585        V: std::convert::Into<crate::model::runtime_action_schema::ResultMetadata>,
3586    {
3587        use std::iter::Iterator;
3588        self.result_metadata = v.into_iter().map(|i| i.into()).collect();
3589        self
3590    }
3591}
3592
3593impl wkt::message::Message for RuntimeActionSchema {
3594    fn typename() -> &'static str {
3595        "type.googleapis.com/google.cloud.connectors.v1.RuntimeActionSchema"
3596    }
3597}
3598
3599/// Defines additional types related to [RuntimeActionSchema].
3600pub mod runtime_action_schema {
3601    #[allow(unused_imports)]
3602    use super::*;
3603
3604    /// Metadata of an input parameter.
3605    #[derive(Clone, Default, PartialEq)]
3606    #[non_exhaustive]
3607    pub struct InputParameter {
3608        /// Name of the Parameter.
3609        pub parameter: std::string::String,
3610
3611        /// A brief description of the Parameter.
3612        pub description: std::string::String,
3613
3614        /// The data type of the Parameter.
3615        pub data_type: crate::model::DataType,
3616
3617        /// Specifies whether a null value is allowed.
3618        pub nullable: bool,
3619
3620        /// The following field specifies the default value of the Parameter
3621        /// provided by the external system if a value is not provided.
3622        pub default_value: std::option::Option<wkt::Value>,
3623
3624        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3625    }
3626
3627    impl InputParameter {
3628        pub fn new() -> Self {
3629            std::default::Default::default()
3630        }
3631
3632        /// Sets the value of [parameter][crate::model::runtime_action_schema::InputParameter::parameter].
3633        ///
3634        /// # Example
3635        /// ```ignore,no_run
3636        /// # use google_cloud_connectors_v1::model::runtime_action_schema::InputParameter;
3637        /// let x = InputParameter::new().set_parameter("example");
3638        /// ```
3639        pub fn set_parameter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3640            self.parameter = v.into();
3641            self
3642        }
3643
3644        /// Sets the value of [description][crate::model::runtime_action_schema::InputParameter::description].
3645        ///
3646        /// # Example
3647        /// ```ignore,no_run
3648        /// # use google_cloud_connectors_v1::model::runtime_action_schema::InputParameter;
3649        /// let x = InputParameter::new().set_description("example");
3650        /// ```
3651        pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3652            self.description = v.into();
3653            self
3654        }
3655
3656        /// Sets the value of [data_type][crate::model::runtime_action_schema::InputParameter::data_type].
3657        ///
3658        /// # Example
3659        /// ```ignore,no_run
3660        /// # use google_cloud_connectors_v1::model::runtime_action_schema::InputParameter;
3661        /// use google_cloud_connectors_v1::model::DataType;
3662        /// let x0 = InputParameter::new().set_data_type(DataType::Smallint);
3663        /// let x1 = InputParameter::new().set_data_type(DataType::Double);
3664        /// let x2 = InputParameter::new().set_data_type(DataType::Date);
3665        /// ```
3666        pub fn set_data_type<T: std::convert::Into<crate::model::DataType>>(
3667            mut self,
3668            v: T,
3669        ) -> Self {
3670            self.data_type = v.into();
3671            self
3672        }
3673
3674        /// Sets the value of [nullable][crate::model::runtime_action_schema::InputParameter::nullable].
3675        ///
3676        /// # Example
3677        /// ```ignore,no_run
3678        /// # use google_cloud_connectors_v1::model::runtime_action_schema::InputParameter;
3679        /// let x = InputParameter::new().set_nullable(true);
3680        /// ```
3681        pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3682            self.nullable = v.into();
3683            self
3684        }
3685
3686        /// Sets the value of [default_value][crate::model::runtime_action_schema::InputParameter::default_value].
3687        ///
3688        /// # Example
3689        /// ```ignore,no_run
3690        /// # use google_cloud_connectors_v1::model::runtime_action_schema::InputParameter;
3691        /// use wkt::Value;
3692        /// let x = InputParameter::new().set_default_value(Value::default()/* use setters */);
3693        /// ```
3694        pub fn set_default_value<T>(mut self, v: T) -> Self
3695        where
3696            T: std::convert::Into<wkt::Value>,
3697        {
3698            self.default_value = std::option::Option::Some(v.into());
3699            self
3700        }
3701
3702        /// Sets or clears the value of [default_value][crate::model::runtime_action_schema::InputParameter::default_value].
3703        ///
3704        /// # Example
3705        /// ```ignore,no_run
3706        /// # use google_cloud_connectors_v1::model::runtime_action_schema::InputParameter;
3707        /// use wkt::Value;
3708        /// let x = InputParameter::new().set_or_clear_default_value(Some(Value::default()/* use setters */));
3709        /// let x = InputParameter::new().set_or_clear_default_value(None::<Value>);
3710        /// ```
3711        pub fn set_or_clear_default_value<T>(mut self, v: std::option::Option<T>) -> Self
3712        where
3713            T: std::convert::Into<wkt::Value>,
3714        {
3715            self.default_value = v.map(|x| x.into());
3716            self
3717        }
3718    }
3719
3720    impl wkt::message::Message for InputParameter {
3721        fn typename() -> &'static str {
3722            "type.googleapis.com/google.cloud.connectors.v1.RuntimeActionSchema.InputParameter"
3723        }
3724    }
3725
3726    /// Metadata of result field.
3727    #[derive(Clone, Default, PartialEq)]
3728    #[non_exhaustive]
3729    pub struct ResultMetadata {
3730        /// Name of the result field.
3731        pub field: std::string::String,
3732
3733        /// A brief description of the field.
3734        pub description: std::string::String,
3735
3736        /// The data type of the field.
3737        pub data_type: crate::model::DataType,
3738
3739        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3740    }
3741
3742    impl ResultMetadata {
3743        pub fn new() -> Self {
3744            std::default::Default::default()
3745        }
3746
3747        /// Sets the value of [field][crate::model::runtime_action_schema::ResultMetadata::field].
3748        ///
3749        /// # Example
3750        /// ```ignore,no_run
3751        /// # use google_cloud_connectors_v1::model::runtime_action_schema::ResultMetadata;
3752        /// let x = ResultMetadata::new().set_field("example");
3753        /// ```
3754        pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3755            self.field = v.into();
3756            self
3757        }
3758
3759        /// Sets the value of [description][crate::model::runtime_action_schema::ResultMetadata::description].
3760        ///
3761        /// # Example
3762        /// ```ignore,no_run
3763        /// # use google_cloud_connectors_v1::model::runtime_action_schema::ResultMetadata;
3764        /// let x = ResultMetadata::new().set_description("example");
3765        /// ```
3766        pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3767            self.description = v.into();
3768            self
3769        }
3770
3771        /// Sets the value of [data_type][crate::model::runtime_action_schema::ResultMetadata::data_type].
3772        ///
3773        /// # Example
3774        /// ```ignore,no_run
3775        /// # use google_cloud_connectors_v1::model::runtime_action_schema::ResultMetadata;
3776        /// use google_cloud_connectors_v1::model::DataType;
3777        /// let x0 = ResultMetadata::new().set_data_type(DataType::Smallint);
3778        /// let x1 = ResultMetadata::new().set_data_type(DataType::Double);
3779        /// let x2 = ResultMetadata::new().set_data_type(DataType::Date);
3780        /// ```
3781        pub fn set_data_type<T: std::convert::Into<crate::model::DataType>>(
3782            mut self,
3783            v: T,
3784        ) -> Self {
3785            self.data_type = v.into();
3786            self
3787        }
3788    }
3789
3790    impl wkt::message::Message for ResultMetadata {
3791        fn typename() -> &'static str {
3792            "type.googleapis.com/google.cloud.connectors.v1.RuntimeActionSchema.ResultMetadata"
3793        }
3794    }
3795}
3796
3797/// Determines whether or no a connection is locked. If locked, a reason must be
3798/// specified.
3799#[derive(Clone, Default, PartialEq)]
3800#[non_exhaustive]
3801pub struct LockConfig {
3802    /// Indicates whether or not the connection is locked.
3803    pub locked: bool,
3804
3805    /// Describes why a connection is locked.
3806    pub reason: std::string::String,
3807
3808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3809}
3810
3811impl LockConfig {
3812    pub fn new() -> Self {
3813        std::default::Default::default()
3814    }
3815
3816    /// Sets the value of [locked][crate::model::LockConfig::locked].
3817    ///
3818    /// # Example
3819    /// ```ignore,no_run
3820    /// # use google_cloud_connectors_v1::model::LockConfig;
3821    /// let x = LockConfig::new().set_locked(true);
3822    /// ```
3823    pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3824        self.locked = v.into();
3825        self
3826    }
3827
3828    /// Sets the value of [reason][crate::model::LockConfig::reason].
3829    ///
3830    /// # Example
3831    /// ```ignore,no_run
3832    /// # use google_cloud_connectors_v1::model::LockConfig;
3833    /// let x = LockConfig::new().set_reason("example");
3834    /// ```
3835    pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3836        self.reason = v.into();
3837        self
3838    }
3839}
3840
3841impl wkt::message::Message for LockConfig {
3842    fn typename() -> &'static str {
3843        "type.googleapis.com/google.cloud.connectors.v1.LockConfig"
3844    }
3845}
3846
3847/// Request message for ConnectorsService.ListConnections
3848#[derive(Clone, Default, PartialEq)]
3849#[non_exhaustive]
3850pub struct ListConnectionsRequest {
3851    /// Required. Parent resource of the Connection, of the form:
3852    /// `projects/*/locations/*`
3853    pub parent: std::string::String,
3854
3855    /// Page size.
3856    pub page_size: i32,
3857
3858    /// Page token.
3859    pub page_token: std::string::String,
3860
3861    /// Filter.
3862    pub filter: std::string::String,
3863
3864    /// Order by parameters.
3865    pub order_by: std::string::String,
3866
3867    /// Specifies which fields of the Connection are returned in the response.
3868    /// Defaults to `BASIC` view.
3869    pub view: crate::model::ConnectionView,
3870
3871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3872}
3873
3874impl ListConnectionsRequest {
3875    pub fn new() -> Self {
3876        std::default::Default::default()
3877    }
3878
3879    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
3880    ///
3881    /// # Example
3882    /// ```ignore,no_run
3883    /// # use google_cloud_connectors_v1::model::ListConnectionsRequest;
3884    /// let x = ListConnectionsRequest::new().set_parent("example");
3885    /// ```
3886    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3887        self.parent = v.into();
3888        self
3889    }
3890
3891    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
3892    ///
3893    /// # Example
3894    /// ```ignore,no_run
3895    /// # use google_cloud_connectors_v1::model::ListConnectionsRequest;
3896    /// let x = ListConnectionsRequest::new().set_page_size(42);
3897    /// ```
3898    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3899        self.page_size = v.into();
3900        self
3901    }
3902
3903    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
3904    ///
3905    /// # Example
3906    /// ```ignore,no_run
3907    /// # use google_cloud_connectors_v1::model::ListConnectionsRequest;
3908    /// let x = ListConnectionsRequest::new().set_page_token("example");
3909    /// ```
3910    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3911        self.page_token = v.into();
3912        self
3913    }
3914
3915    /// Sets the value of [filter][crate::model::ListConnectionsRequest::filter].
3916    ///
3917    /// # Example
3918    /// ```ignore,no_run
3919    /// # use google_cloud_connectors_v1::model::ListConnectionsRequest;
3920    /// let x = ListConnectionsRequest::new().set_filter("example");
3921    /// ```
3922    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3923        self.filter = v.into();
3924        self
3925    }
3926
3927    /// Sets the value of [order_by][crate::model::ListConnectionsRequest::order_by].
3928    ///
3929    /// # Example
3930    /// ```ignore,no_run
3931    /// # use google_cloud_connectors_v1::model::ListConnectionsRequest;
3932    /// let x = ListConnectionsRequest::new().set_order_by("example");
3933    /// ```
3934    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3935        self.order_by = v.into();
3936        self
3937    }
3938
3939    /// Sets the value of [view][crate::model::ListConnectionsRequest::view].
3940    ///
3941    /// # Example
3942    /// ```ignore,no_run
3943    /// # use google_cloud_connectors_v1::model::ListConnectionsRequest;
3944    /// use google_cloud_connectors_v1::model::ConnectionView;
3945    /// let x0 = ListConnectionsRequest::new().set_view(ConnectionView::Basic);
3946    /// let x1 = ListConnectionsRequest::new().set_view(ConnectionView::Full);
3947    /// ```
3948    pub fn set_view<T: std::convert::Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
3949        self.view = v.into();
3950        self
3951    }
3952}
3953
3954impl wkt::message::Message for ListConnectionsRequest {
3955    fn typename() -> &'static str {
3956        "type.googleapis.com/google.cloud.connectors.v1.ListConnectionsRequest"
3957    }
3958}
3959
3960/// Response message for ConnectorsService.ListConnections
3961#[derive(Clone, Default, PartialEq)]
3962#[non_exhaustive]
3963pub struct ListConnectionsResponse {
3964    /// Connections.
3965    pub connections: std::vec::Vec<crate::model::Connection>,
3966
3967    /// Next page token.
3968    pub next_page_token: std::string::String,
3969
3970    /// Locations that could not be reached.
3971    pub unreachable: std::vec::Vec<std::string::String>,
3972
3973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3974}
3975
3976impl ListConnectionsResponse {
3977    pub fn new() -> Self {
3978        std::default::Default::default()
3979    }
3980
3981    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
3982    ///
3983    /// # Example
3984    /// ```ignore,no_run
3985    /// # use google_cloud_connectors_v1::model::ListConnectionsResponse;
3986    /// use google_cloud_connectors_v1::model::Connection;
3987    /// let x = ListConnectionsResponse::new()
3988    ///     .set_connections([
3989    ///         Connection::default()/* use setters */,
3990    ///         Connection::default()/* use (different) setters */,
3991    ///     ]);
3992    /// ```
3993    pub fn set_connections<T, V>(mut self, v: T) -> Self
3994    where
3995        T: std::iter::IntoIterator<Item = V>,
3996        V: std::convert::Into<crate::model::Connection>,
3997    {
3998        use std::iter::Iterator;
3999        self.connections = v.into_iter().map(|i| i.into()).collect();
4000        self
4001    }
4002
4003    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
4004    ///
4005    /// # Example
4006    /// ```ignore,no_run
4007    /// # use google_cloud_connectors_v1::model::ListConnectionsResponse;
4008    /// let x = ListConnectionsResponse::new().set_next_page_token("example");
4009    /// ```
4010    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4011        self.next_page_token = v.into();
4012        self
4013    }
4014
4015    /// Sets the value of [unreachable][crate::model::ListConnectionsResponse::unreachable].
4016    ///
4017    /// # Example
4018    /// ```ignore,no_run
4019    /// # use google_cloud_connectors_v1::model::ListConnectionsResponse;
4020    /// let x = ListConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
4021    /// ```
4022    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4023    where
4024        T: std::iter::IntoIterator<Item = V>,
4025        V: std::convert::Into<std::string::String>,
4026    {
4027        use std::iter::Iterator;
4028        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4029        self
4030    }
4031}
4032
4033impl wkt::message::Message for ListConnectionsResponse {
4034    fn typename() -> &'static str {
4035        "type.googleapis.com/google.cloud.connectors.v1.ListConnectionsResponse"
4036    }
4037}
4038
4039#[doc(hidden)]
4040impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
4041    type PageItem = crate::model::Connection;
4042
4043    fn items(self) -> std::vec::Vec<Self::PageItem> {
4044        self.connections
4045    }
4046
4047    fn next_page_token(&self) -> std::string::String {
4048        use std::clone::Clone;
4049        self.next_page_token.clone()
4050    }
4051}
4052
4053/// Request message for ConnectorsService.GetConnection
4054#[derive(Clone, Default, PartialEq)]
4055#[non_exhaustive]
4056pub struct GetConnectionRequest {
4057    /// Required. Resource name of the form:
4058    /// `projects/*/locations/*/connections/*`
4059    pub name: std::string::String,
4060
4061    /// Specifies which fields of the Connection are returned in the response.
4062    /// Defaults to `BASIC` view.
4063    pub view: crate::model::ConnectionView,
4064
4065    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4066}
4067
4068impl GetConnectionRequest {
4069    pub fn new() -> Self {
4070        std::default::Default::default()
4071    }
4072
4073    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
4074    ///
4075    /// # Example
4076    /// ```ignore,no_run
4077    /// # use google_cloud_connectors_v1::model::GetConnectionRequest;
4078    /// let x = GetConnectionRequest::new().set_name("example");
4079    /// ```
4080    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4081        self.name = v.into();
4082        self
4083    }
4084
4085    /// Sets the value of [view][crate::model::GetConnectionRequest::view].
4086    ///
4087    /// # Example
4088    /// ```ignore,no_run
4089    /// # use google_cloud_connectors_v1::model::GetConnectionRequest;
4090    /// use google_cloud_connectors_v1::model::ConnectionView;
4091    /// let x0 = GetConnectionRequest::new().set_view(ConnectionView::Basic);
4092    /// let x1 = GetConnectionRequest::new().set_view(ConnectionView::Full);
4093    /// ```
4094    pub fn set_view<T: std::convert::Into<crate::model::ConnectionView>>(mut self, v: T) -> Self {
4095        self.view = v.into();
4096        self
4097    }
4098}
4099
4100impl wkt::message::Message for GetConnectionRequest {
4101    fn typename() -> &'static str {
4102        "type.googleapis.com/google.cloud.connectors.v1.GetConnectionRequest"
4103    }
4104}
4105
4106/// Request message for ConnectorsService.CreateConnection
4107#[derive(Clone, Default, PartialEq)]
4108#[non_exhaustive]
4109pub struct CreateConnectionRequest {
4110    /// Required. Parent resource of the Connection, of the form:
4111    /// `projects/*/locations/*`
4112    pub parent: std::string::String,
4113
4114    /// Required. Identifier to assign to the Connection. Must be unique within
4115    /// scope of the parent resource.
4116    pub connection_id: std::string::String,
4117
4118    /// Required. Connection resource.
4119    pub connection: std::option::Option<crate::model::Connection>,
4120
4121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4122}
4123
4124impl CreateConnectionRequest {
4125    pub fn new() -> Self {
4126        std::default::Default::default()
4127    }
4128
4129    /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
4130    ///
4131    /// # Example
4132    /// ```ignore,no_run
4133    /// # use google_cloud_connectors_v1::model::CreateConnectionRequest;
4134    /// let x = CreateConnectionRequest::new().set_parent("example");
4135    /// ```
4136    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4137        self.parent = v.into();
4138        self
4139    }
4140
4141    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
4142    ///
4143    /// # Example
4144    /// ```ignore,no_run
4145    /// # use google_cloud_connectors_v1::model::CreateConnectionRequest;
4146    /// let x = CreateConnectionRequest::new().set_connection_id("example");
4147    /// ```
4148    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4149        self.connection_id = v.into();
4150        self
4151    }
4152
4153    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
4154    ///
4155    /// # Example
4156    /// ```ignore,no_run
4157    /// # use google_cloud_connectors_v1::model::CreateConnectionRequest;
4158    /// use google_cloud_connectors_v1::model::Connection;
4159    /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
4160    /// ```
4161    pub fn set_connection<T>(mut self, v: T) -> Self
4162    where
4163        T: std::convert::Into<crate::model::Connection>,
4164    {
4165        self.connection = std::option::Option::Some(v.into());
4166        self
4167    }
4168
4169    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
4170    ///
4171    /// # Example
4172    /// ```ignore,no_run
4173    /// # use google_cloud_connectors_v1::model::CreateConnectionRequest;
4174    /// use google_cloud_connectors_v1::model::Connection;
4175    /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
4176    /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
4177    /// ```
4178    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
4179    where
4180        T: std::convert::Into<crate::model::Connection>,
4181    {
4182        self.connection = v.map(|x| x.into());
4183        self
4184    }
4185}
4186
4187impl wkt::message::Message for CreateConnectionRequest {
4188    fn typename() -> &'static str {
4189        "type.googleapis.com/google.cloud.connectors.v1.CreateConnectionRequest"
4190    }
4191}
4192
4193/// Request message for ConnectorsService.UpdateConnection
4194#[derive(Clone, Default, PartialEq)]
4195#[non_exhaustive]
4196pub struct UpdateConnectionRequest {
4197    /// Required. Connection resource.
4198    pub connection: std::option::Option<crate::model::Connection>,
4199
4200    /// Required. You can modify only the fields listed below.
4201    ///
4202    /// To lock/unlock a connection:
4203    ///
4204    /// * `lock_config`
4205    ///
4206    /// To suspend/resume a connection:
4207    ///
4208    /// * `suspended`
4209    ///
4210    /// To update the connection details:
4211    ///
4212    /// * `description`
4213    /// * `labels`
4214    /// * `connector_version`
4215    /// * `config_variables`
4216    /// * `auth_config`
4217    /// * `destination_configs`
4218    /// * `node_config`
4219    pub update_mask: std::option::Option<wkt::FieldMask>,
4220
4221    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4222}
4223
4224impl UpdateConnectionRequest {
4225    pub fn new() -> Self {
4226        std::default::Default::default()
4227    }
4228
4229    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
4230    ///
4231    /// # Example
4232    /// ```ignore,no_run
4233    /// # use google_cloud_connectors_v1::model::UpdateConnectionRequest;
4234    /// use google_cloud_connectors_v1::model::Connection;
4235    /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
4236    /// ```
4237    pub fn set_connection<T>(mut self, v: T) -> Self
4238    where
4239        T: std::convert::Into<crate::model::Connection>,
4240    {
4241        self.connection = std::option::Option::Some(v.into());
4242        self
4243    }
4244
4245    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
4246    ///
4247    /// # Example
4248    /// ```ignore,no_run
4249    /// # use google_cloud_connectors_v1::model::UpdateConnectionRequest;
4250    /// use google_cloud_connectors_v1::model::Connection;
4251    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
4252    /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
4253    /// ```
4254    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
4255    where
4256        T: std::convert::Into<crate::model::Connection>,
4257    {
4258        self.connection = v.map(|x| x.into());
4259        self
4260    }
4261
4262    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
4263    ///
4264    /// # Example
4265    /// ```ignore,no_run
4266    /// # use google_cloud_connectors_v1::model::UpdateConnectionRequest;
4267    /// use wkt::FieldMask;
4268    /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4269    /// ```
4270    pub fn set_update_mask<T>(mut self, v: T) -> Self
4271    where
4272        T: std::convert::Into<wkt::FieldMask>,
4273    {
4274        self.update_mask = std::option::Option::Some(v.into());
4275        self
4276    }
4277
4278    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
4279    ///
4280    /// # Example
4281    /// ```ignore,no_run
4282    /// # use google_cloud_connectors_v1::model::UpdateConnectionRequest;
4283    /// use wkt::FieldMask;
4284    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4285    /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4286    /// ```
4287    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4288    where
4289        T: std::convert::Into<wkt::FieldMask>,
4290    {
4291        self.update_mask = v.map(|x| x.into());
4292        self
4293    }
4294}
4295
4296impl wkt::message::Message for UpdateConnectionRequest {
4297    fn typename() -> &'static str {
4298        "type.googleapis.com/google.cloud.connectors.v1.UpdateConnectionRequest"
4299    }
4300}
4301
4302/// Request message for ConnectorsService.DeleteConnection.
4303#[derive(Clone, Default, PartialEq)]
4304#[non_exhaustive]
4305pub struct DeleteConnectionRequest {
4306    /// Required. Resource name of the form:
4307    /// `projects/*/locations/*/connections/*`
4308    pub name: std::string::String,
4309
4310    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4311}
4312
4313impl DeleteConnectionRequest {
4314    pub fn new() -> Self {
4315        std::default::Default::default()
4316    }
4317
4318    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
4319    ///
4320    /// # Example
4321    /// ```ignore,no_run
4322    /// # use google_cloud_connectors_v1::model::DeleteConnectionRequest;
4323    /// let x = DeleteConnectionRequest::new().set_name("example");
4324    /// ```
4325    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4326        self.name = v.into();
4327        self
4328    }
4329}
4330
4331impl wkt::message::Message for DeleteConnectionRequest {
4332    fn typename() -> &'static str {
4333        "type.googleapis.com/google.cloud.connectors.v1.DeleteConnectionRequest"
4334    }
4335}
4336
4337/// Request message for ConnectorsService.GetConnectionSchemaMetadata.
4338#[derive(Clone, Default, PartialEq)]
4339#[non_exhaustive]
4340pub struct GetConnectionSchemaMetadataRequest {
4341    /// Required. Connection name
4342    /// Format:
4343    /// projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata
4344    pub name: std::string::String,
4345
4346    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4347}
4348
4349impl GetConnectionSchemaMetadataRequest {
4350    pub fn new() -> Self {
4351        std::default::Default::default()
4352    }
4353
4354    /// Sets the value of [name][crate::model::GetConnectionSchemaMetadataRequest::name].
4355    ///
4356    /// # Example
4357    /// ```ignore,no_run
4358    /// # use google_cloud_connectors_v1::model::GetConnectionSchemaMetadataRequest;
4359    /// let x = GetConnectionSchemaMetadataRequest::new().set_name("example");
4360    /// ```
4361    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4362        self.name = v.into();
4363        self
4364    }
4365}
4366
4367impl wkt::message::Message for GetConnectionSchemaMetadataRequest {
4368    fn typename() -> &'static str {
4369        "type.googleapis.com/google.cloud.connectors.v1.GetConnectionSchemaMetadataRequest"
4370    }
4371}
4372
4373/// Request message for ConnectorsService.RefreshConnectionSchemaMetadata.
4374#[derive(Clone, Default, PartialEq)]
4375#[non_exhaustive]
4376pub struct RefreshConnectionSchemaMetadataRequest {
4377    /// Required. Resource name.
4378    /// Format:
4379    /// projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata
4380    pub name: std::string::String,
4381
4382    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4383}
4384
4385impl RefreshConnectionSchemaMetadataRequest {
4386    pub fn new() -> Self {
4387        std::default::Default::default()
4388    }
4389
4390    /// Sets the value of [name][crate::model::RefreshConnectionSchemaMetadataRequest::name].
4391    ///
4392    /// # Example
4393    /// ```ignore,no_run
4394    /// # use google_cloud_connectors_v1::model::RefreshConnectionSchemaMetadataRequest;
4395    /// let x = RefreshConnectionSchemaMetadataRequest::new().set_name("example");
4396    /// ```
4397    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4398        self.name = v.into();
4399        self
4400    }
4401}
4402
4403impl wkt::message::Message for RefreshConnectionSchemaMetadataRequest {
4404    fn typename() -> &'static str {
4405        "type.googleapis.com/google.cloud.connectors.v1.RefreshConnectionSchemaMetadataRequest"
4406    }
4407}
4408
4409/// Request message for ConnectorsService.ListRuntimeEntitySchemas.
4410/// For filter, only entity field is supported with literal equality operator.
4411/// Accepted filter example: entity="Order"
4412/// Wildcards are not supported in the filter currently.
4413#[derive(Clone, Default, PartialEq)]
4414#[non_exhaustive]
4415pub struct ListRuntimeEntitySchemasRequest {
4416    /// Required. Parent resource of RuntimeEntitySchema
4417    /// Format:
4418    /// projects/{project}/locations/{location}/connections/{connection}
4419    pub parent: std::string::String,
4420
4421    /// Page size.
4422    pub page_size: i32,
4423
4424    /// Page token.
4425    pub page_token: std::string::String,
4426
4427    /// Required. Filter
4428    /// Format:
4429    /// entity="{entityId}"
4430    /// Only entity field is supported with literal equality operator.
4431    /// Accepted filter example: entity="Order"
4432    /// Wildcards are not supported in the filter currently.
4433    pub filter: std::string::String,
4434
4435    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4436}
4437
4438impl ListRuntimeEntitySchemasRequest {
4439    pub fn new() -> Self {
4440        std::default::Default::default()
4441    }
4442
4443    /// Sets the value of [parent][crate::model::ListRuntimeEntitySchemasRequest::parent].
4444    ///
4445    /// # Example
4446    /// ```ignore,no_run
4447    /// # use google_cloud_connectors_v1::model::ListRuntimeEntitySchemasRequest;
4448    /// let x = ListRuntimeEntitySchemasRequest::new().set_parent("example");
4449    /// ```
4450    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4451        self.parent = v.into();
4452        self
4453    }
4454
4455    /// Sets the value of [page_size][crate::model::ListRuntimeEntitySchemasRequest::page_size].
4456    ///
4457    /// # Example
4458    /// ```ignore,no_run
4459    /// # use google_cloud_connectors_v1::model::ListRuntimeEntitySchemasRequest;
4460    /// let x = ListRuntimeEntitySchemasRequest::new().set_page_size(42);
4461    /// ```
4462    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4463        self.page_size = v.into();
4464        self
4465    }
4466
4467    /// Sets the value of [page_token][crate::model::ListRuntimeEntitySchemasRequest::page_token].
4468    ///
4469    /// # Example
4470    /// ```ignore,no_run
4471    /// # use google_cloud_connectors_v1::model::ListRuntimeEntitySchemasRequest;
4472    /// let x = ListRuntimeEntitySchemasRequest::new().set_page_token("example");
4473    /// ```
4474    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4475        self.page_token = v.into();
4476        self
4477    }
4478
4479    /// Sets the value of [filter][crate::model::ListRuntimeEntitySchemasRequest::filter].
4480    ///
4481    /// # Example
4482    /// ```ignore,no_run
4483    /// # use google_cloud_connectors_v1::model::ListRuntimeEntitySchemasRequest;
4484    /// let x = ListRuntimeEntitySchemasRequest::new().set_filter("example");
4485    /// ```
4486    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4487        self.filter = v.into();
4488        self
4489    }
4490}
4491
4492impl wkt::message::Message for ListRuntimeEntitySchemasRequest {
4493    fn typename() -> &'static str {
4494        "type.googleapis.com/google.cloud.connectors.v1.ListRuntimeEntitySchemasRequest"
4495    }
4496}
4497
4498/// Response message for ConnectorsService.ListRuntimeEntitySchemas.
4499#[derive(Clone, Default, PartialEq)]
4500#[non_exhaustive]
4501pub struct ListRuntimeEntitySchemasResponse {
4502    /// Runtime entity schemas.
4503    pub runtime_entity_schemas: std::vec::Vec<crate::model::RuntimeEntitySchema>,
4504
4505    /// Next page token.
4506    pub next_page_token: std::string::String,
4507
4508    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4509}
4510
4511impl ListRuntimeEntitySchemasResponse {
4512    pub fn new() -> Self {
4513        std::default::Default::default()
4514    }
4515
4516    /// Sets the value of [runtime_entity_schemas][crate::model::ListRuntimeEntitySchemasResponse::runtime_entity_schemas].
4517    ///
4518    /// # Example
4519    /// ```ignore,no_run
4520    /// # use google_cloud_connectors_v1::model::ListRuntimeEntitySchemasResponse;
4521    /// use google_cloud_connectors_v1::model::RuntimeEntitySchema;
4522    /// let x = ListRuntimeEntitySchemasResponse::new()
4523    ///     .set_runtime_entity_schemas([
4524    ///         RuntimeEntitySchema::default()/* use setters */,
4525    ///         RuntimeEntitySchema::default()/* use (different) setters */,
4526    ///     ]);
4527    /// ```
4528    pub fn set_runtime_entity_schemas<T, V>(mut self, v: T) -> Self
4529    where
4530        T: std::iter::IntoIterator<Item = V>,
4531        V: std::convert::Into<crate::model::RuntimeEntitySchema>,
4532    {
4533        use std::iter::Iterator;
4534        self.runtime_entity_schemas = v.into_iter().map(|i| i.into()).collect();
4535        self
4536    }
4537
4538    /// Sets the value of [next_page_token][crate::model::ListRuntimeEntitySchemasResponse::next_page_token].
4539    ///
4540    /// # Example
4541    /// ```ignore,no_run
4542    /// # use google_cloud_connectors_v1::model::ListRuntimeEntitySchemasResponse;
4543    /// let x = ListRuntimeEntitySchemasResponse::new().set_next_page_token("example");
4544    /// ```
4545    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4546        self.next_page_token = v.into();
4547        self
4548    }
4549}
4550
4551impl wkt::message::Message for ListRuntimeEntitySchemasResponse {
4552    fn typename() -> &'static str {
4553        "type.googleapis.com/google.cloud.connectors.v1.ListRuntimeEntitySchemasResponse"
4554    }
4555}
4556
4557#[doc(hidden)]
4558impl google_cloud_gax::paginator::internal::PageableResponse for ListRuntimeEntitySchemasResponse {
4559    type PageItem = crate::model::RuntimeEntitySchema;
4560
4561    fn items(self) -> std::vec::Vec<Self::PageItem> {
4562        self.runtime_entity_schemas
4563    }
4564
4565    fn next_page_token(&self) -> std::string::String {
4566        use std::clone::Clone;
4567        self.next_page_token.clone()
4568    }
4569}
4570
4571/// Request message for ConnectorsService.ListRuntimeActionSchemas.
4572/// For filter, only action field is supported with literal equality operator.
4573/// Accepted filter example: action="approveOrder"
4574/// Wildcards are not supported in the filter currently.
4575#[derive(Clone, Default, PartialEq)]
4576#[non_exhaustive]
4577pub struct ListRuntimeActionSchemasRequest {
4578    /// Required. Parent resource of RuntimeActionSchema
4579    /// Format:
4580    /// projects/{project}/locations/{location}/connections/{connection}
4581    pub parent: std::string::String,
4582
4583    /// Page size.
4584    pub page_size: i32,
4585
4586    /// Page token.
4587    pub page_token: std::string::String,
4588
4589    /// Required. Filter
4590    /// Format:
4591    /// action="{actionId}"
4592    /// Only action field is supported with literal equality operator.
4593    /// Accepted filter example: action="CancelOrder"
4594    /// Wildcards are not supported in the filter currently.
4595    pub filter: std::string::String,
4596
4597    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4598}
4599
4600impl ListRuntimeActionSchemasRequest {
4601    pub fn new() -> Self {
4602        std::default::Default::default()
4603    }
4604
4605    /// Sets the value of [parent][crate::model::ListRuntimeActionSchemasRequest::parent].
4606    ///
4607    /// # Example
4608    /// ```ignore,no_run
4609    /// # use google_cloud_connectors_v1::model::ListRuntimeActionSchemasRequest;
4610    /// let x = ListRuntimeActionSchemasRequest::new().set_parent("example");
4611    /// ```
4612    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4613        self.parent = v.into();
4614        self
4615    }
4616
4617    /// Sets the value of [page_size][crate::model::ListRuntimeActionSchemasRequest::page_size].
4618    ///
4619    /// # Example
4620    /// ```ignore,no_run
4621    /// # use google_cloud_connectors_v1::model::ListRuntimeActionSchemasRequest;
4622    /// let x = ListRuntimeActionSchemasRequest::new().set_page_size(42);
4623    /// ```
4624    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4625        self.page_size = v.into();
4626        self
4627    }
4628
4629    /// Sets the value of [page_token][crate::model::ListRuntimeActionSchemasRequest::page_token].
4630    ///
4631    /// # Example
4632    /// ```ignore,no_run
4633    /// # use google_cloud_connectors_v1::model::ListRuntimeActionSchemasRequest;
4634    /// let x = ListRuntimeActionSchemasRequest::new().set_page_token("example");
4635    /// ```
4636    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4637        self.page_token = v.into();
4638        self
4639    }
4640
4641    /// Sets the value of [filter][crate::model::ListRuntimeActionSchemasRequest::filter].
4642    ///
4643    /// # Example
4644    /// ```ignore,no_run
4645    /// # use google_cloud_connectors_v1::model::ListRuntimeActionSchemasRequest;
4646    /// let x = ListRuntimeActionSchemasRequest::new().set_filter("example");
4647    /// ```
4648    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4649        self.filter = v.into();
4650        self
4651    }
4652}
4653
4654impl wkt::message::Message for ListRuntimeActionSchemasRequest {
4655    fn typename() -> &'static str {
4656        "type.googleapis.com/google.cloud.connectors.v1.ListRuntimeActionSchemasRequest"
4657    }
4658}
4659
4660/// Response message for ConnectorsService.ListRuntimeActionSchemas.
4661#[derive(Clone, Default, PartialEq)]
4662#[non_exhaustive]
4663pub struct ListRuntimeActionSchemasResponse {
4664    /// Runtime action schemas.
4665    pub runtime_action_schemas: std::vec::Vec<crate::model::RuntimeActionSchema>,
4666
4667    /// Next page token.
4668    pub next_page_token: std::string::String,
4669
4670    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4671}
4672
4673impl ListRuntimeActionSchemasResponse {
4674    pub fn new() -> Self {
4675        std::default::Default::default()
4676    }
4677
4678    /// Sets the value of [runtime_action_schemas][crate::model::ListRuntimeActionSchemasResponse::runtime_action_schemas].
4679    ///
4680    /// # Example
4681    /// ```ignore,no_run
4682    /// # use google_cloud_connectors_v1::model::ListRuntimeActionSchemasResponse;
4683    /// use google_cloud_connectors_v1::model::RuntimeActionSchema;
4684    /// let x = ListRuntimeActionSchemasResponse::new()
4685    ///     .set_runtime_action_schemas([
4686    ///         RuntimeActionSchema::default()/* use setters */,
4687    ///         RuntimeActionSchema::default()/* use (different) setters */,
4688    ///     ]);
4689    /// ```
4690    pub fn set_runtime_action_schemas<T, V>(mut self, v: T) -> Self
4691    where
4692        T: std::iter::IntoIterator<Item = V>,
4693        V: std::convert::Into<crate::model::RuntimeActionSchema>,
4694    {
4695        use std::iter::Iterator;
4696        self.runtime_action_schemas = v.into_iter().map(|i| i.into()).collect();
4697        self
4698    }
4699
4700    /// Sets the value of [next_page_token][crate::model::ListRuntimeActionSchemasResponse::next_page_token].
4701    ///
4702    /// # Example
4703    /// ```ignore,no_run
4704    /// # use google_cloud_connectors_v1::model::ListRuntimeActionSchemasResponse;
4705    /// let x = ListRuntimeActionSchemasResponse::new().set_next_page_token("example");
4706    /// ```
4707    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4708        self.next_page_token = v.into();
4709        self
4710    }
4711}
4712
4713impl wkt::message::Message for ListRuntimeActionSchemasResponse {
4714    fn typename() -> &'static str {
4715        "type.googleapis.com/google.cloud.connectors.v1.ListRuntimeActionSchemasResponse"
4716    }
4717}
4718
4719#[doc(hidden)]
4720impl google_cloud_gax::paginator::internal::PageableResponse for ListRuntimeActionSchemasResponse {
4721    type PageItem = crate::model::RuntimeActionSchema;
4722
4723    fn items(self) -> std::vec::Vec<Self::PageItem> {
4724        self.runtime_action_schemas
4725    }
4726
4727    fn next_page_token(&self) -> std::string::String {
4728        use std::clone::Clone;
4729        self.next_page_token.clone()
4730    }
4731}
4732
4733/// ConnectionStatus indicates the state of the connection.
4734#[derive(Clone, Default, PartialEq)]
4735#[non_exhaustive]
4736pub struct ConnectionStatus {
4737    /// State.
4738    pub state: crate::model::connection_status::State,
4739
4740    /// Description.
4741    pub description: std::string::String,
4742
4743    /// Status provides detailed information for the state.
4744    pub status: std::string::String,
4745
4746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4747}
4748
4749impl ConnectionStatus {
4750    pub fn new() -> Self {
4751        std::default::Default::default()
4752    }
4753
4754    /// Sets the value of [state][crate::model::ConnectionStatus::state].
4755    ///
4756    /// # Example
4757    /// ```ignore,no_run
4758    /// # use google_cloud_connectors_v1::model::ConnectionStatus;
4759    /// use google_cloud_connectors_v1::model::connection_status::State;
4760    /// let x0 = ConnectionStatus::new().set_state(State::Creating);
4761    /// let x1 = ConnectionStatus::new().set_state(State::Active);
4762    /// let x2 = ConnectionStatus::new().set_state(State::Inactive);
4763    /// ```
4764    pub fn set_state<T: std::convert::Into<crate::model::connection_status::State>>(
4765        mut self,
4766        v: T,
4767    ) -> Self {
4768        self.state = v.into();
4769        self
4770    }
4771
4772    /// Sets the value of [description][crate::model::ConnectionStatus::description].
4773    ///
4774    /// # Example
4775    /// ```ignore,no_run
4776    /// # use google_cloud_connectors_v1::model::ConnectionStatus;
4777    /// let x = ConnectionStatus::new().set_description("example");
4778    /// ```
4779    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4780        self.description = v.into();
4781        self
4782    }
4783
4784    /// Sets the value of [status][crate::model::ConnectionStatus::status].
4785    ///
4786    /// # Example
4787    /// ```ignore,no_run
4788    /// # use google_cloud_connectors_v1::model::ConnectionStatus;
4789    /// let x = ConnectionStatus::new().set_status("example");
4790    /// ```
4791    pub fn set_status<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4792        self.status = v.into();
4793        self
4794    }
4795}
4796
4797impl wkt::message::Message for ConnectionStatus {
4798    fn typename() -> &'static str {
4799        "type.googleapis.com/google.cloud.connectors.v1.ConnectionStatus"
4800    }
4801}
4802
4803/// Defines additional types related to [ConnectionStatus].
4804pub mod connection_status {
4805    #[allow(unused_imports)]
4806    use super::*;
4807
4808    /// All the possible Connection State.
4809    ///
4810    /// # Working with unknown values
4811    ///
4812    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4813    /// additional enum variants at any time. Adding new variants is not considered
4814    /// a breaking change. Applications should write their code in anticipation of:
4815    ///
4816    /// - New values appearing in future releases of the client library, **and**
4817    /// - New values received dynamically, without application changes.
4818    ///
4819    /// Please consult the [Working with enums] section in the user guide for some
4820    /// guidelines.
4821    ///
4822    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4823    #[derive(Clone, Debug, PartialEq)]
4824    #[non_exhaustive]
4825    pub enum State {
4826        /// Connection does not have a state yet.
4827        Unspecified,
4828        /// Connection is being created.
4829        Creating,
4830        /// Connection is running and ready for requests.
4831        Active,
4832        /// Connection is stopped.
4833        Inactive,
4834        /// Connection is being deleted.
4835        Deleting,
4836        /// Connection is being updated.
4837        Updating,
4838        /// Connection is not running due to an error.
4839        Error,
4840        /// Connection is not running due to an auth error for the Oauth2 Auth Code
4841        /// based connector.
4842        AuthorizationRequired,
4843        /// If set, the enum was initialized with an unknown value.
4844        ///
4845        /// Applications can examine the value using [State::value] or
4846        /// [State::name].
4847        UnknownValue(state::UnknownValue),
4848    }
4849
4850    #[doc(hidden)]
4851    pub mod state {
4852        #[allow(unused_imports)]
4853        use super::*;
4854        #[derive(Clone, Debug, PartialEq)]
4855        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4856    }
4857
4858    impl State {
4859        /// Gets the enum value.
4860        ///
4861        /// Returns `None` if the enum contains an unknown value deserialized from
4862        /// the string representation of enums.
4863        pub fn value(&self) -> std::option::Option<i32> {
4864            match self {
4865                Self::Unspecified => std::option::Option::Some(0),
4866                Self::Creating => std::option::Option::Some(1),
4867                Self::Active => std::option::Option::Some(2),
4868                Self::Inactive => std::option::Option::Some(3),
4869                Self::Deleting => std::option::Option::Some(4),
4870                Self::Updating => std::option::Option::Some(5),
4871                Self::Error => std::option::Option::Some(6),
4872                Self::AuthorizationRequired => std::option::Option::Some(7),
4873                Self::UnknownValue(u) => u.0.value(),
4874            }
4875        }
4876
4877        /// Gets the enum value as a string.
4878        ///
4879        /// Returns `None` if the enum contains an unknown value deserialized from
4880        /// the integer representation of enums.
4881        pub fn name(&self) -> std::option::Option<&str> {
4882            match self {
4883                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4884                Self::Creating => std::option::Option::Some("CREATING"),
4885                Self::Active => std::option::Option::Some("ACTIVE"),
4886                Self::Inactive => std::option::Option::Some("INACTIVE"),
4887                Self::Deleting => std::option::Option::Some("DELETING"),
4888                Self::Updating => std::option::Option::Some("UPDATING"),
4889                Self::Error => std::option::Option::Some("ERROR"),
4890                Self::AuthorizationRequired => std::option::Option::Some("AUTHORIZATION_REQUIRED"),
4891                Self::UnknownValue(u) => u.0.name(),
4892            }
4893        }
4894    }
4895
4896    impl std::default::Default for State {
4897        fn default() -> Self {
4898            use std::convert::From;
4899            Self::from(0)
4900        }
4901    }
4902
4903    impl std::fmt::Display for State {
4904        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4905            wkt::internal::display_enum(f, self.name(), self.value())
4906        }
4907    }
4908
4909    impl std::convert::From<i32> for State {
4910        fn from(value: i32) -> Self {
4911            match value {
4912                0 => Self::Unspecified,
4913                1 => Self::Creating,
4914                2 => Self::Active,
4915                3 => Self::Inactive,
4916                4 => Self::Deleting,
4917                5 => Self::Updating,
4918                6 => Self::Error,
4919                7 => Self::AuthorizationRequired,
4920                _ => Self::UnknownValue(state::UnknownValue(
4921                    wkt::internal::UnknownEnumValue::Integer(value),
4922                )),
4923            }
4924        }
4925    }
4926
4927    impl std::convert::From<&str> for State {
4928        fn from(value: &str) -> Self {
4929            use std::string::ToString;
4930            match value {
4931                "STATE_UNSPECIFIED" => Self::Unspecified,
4932                "CREATING" => Self::Creating,
4933                "ACTIVE" => Self::Active,
4934                "INACTIVE" => Self::Inactive,
4935                "DELETING" => Self::Deleting,
4936                "UPDATING" => Self::Updating,
4937                "ERROR" => Self::Error,
4938                "AUTHORIZATION_REQUIRED" => Self::AuthorizationRequired,
4939                _ => Self::UnknownValue(state::UnknownValue(
4940                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4941                )),
4942            }
4943        }
4944    }
4945
4946    impl serde::ser::Serialize for State {
4947        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4948        where
4949            S: serde::Serializer,
4950        {
4951            match self {
4952                Self::Unspecified => serializer.serialize_i32(0),
4953                Self::Creating => serializer.serialize_i32(1),
4954                Self::Active => serializer.serialize_i32(2),
4955                Self::Inactive => serializer.serialize_i32(3),
4956                Self::Deleting => serializer.serialize_i32(4),
4957                Self::Updating => serializer.serialize_i32(5),
4958                Self::Error => serializer.serialize_i32(6),
4959                Self::AuthorizationRequired => serializer.serialize_i32(7),
4960                Self::UnknownValue(u) => u.0.serialize(serializer),
4961            }
4962        }
4963    }
4964
4965    impl<'de> serde::de::Deserialize<'de> for State {
4966        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4967        where
4968            D: serde::Deserializer<'de>,
4969        {
4970            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4971                ".google.cloud.connectors.v1.ConnectionStatus.State",
4972            ))
4973        }
4974    }
4975}
4976
4977/// Connectors indicates a specific connector type, e.x. Salesforce, SAP etc.
4978#[derive(Clone, Default, PartialEq)]
4979#[non_exhaustive]
4980pub struct Connector {
4981    /// Output only. Resource name of the Connector.
4982    /// Format:
4983    /// projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}
4984    /// Only global location is supported for Connector resource.
4985    pub name: std::string::String,
4986
4987    /// Output only. Created time.
4988    pub create_time: std::option::Option<wkt::Timestamp>,
4989
4990    /// Output only. Updated time.
4991    pub update_time: std::option::Option<wkt::Timestamp>,
4992
4993    /// Output only. Resource labels to represent user-provided metadata.
4994    /// Refer to cloud documentation on labels for more details.
4995    /// <https://cloud.google.com/compute/docs/labeling-resources>
4996    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4997
4998    /// Output only. Link to documentation page.
4999    pub documentation_uri: std::string::String,
5000
5001    /// Output only. Link to external page.
5002    pub external_uri: std::string::String,
5003
5004    /// Output only. Description of the resource.
5005    pub description: std::string::String,
5006
5007    /// Output only. Cloud storage location of icons etc consumed by UI.
5008    pub web_assets_location: std::string::String,
5009
5010    /// Output only. Display name.
5011    pub display_name: std::string::String,
5012
5013    /// Output only. Flag to mark the version indicating the launch stage.
5014    pub launch_stage: crate::model::LaunchStage,
5015
5016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5017}
5018
5019impl Connector {
5020    pub fn new() -> Self {
5021        std::default::Default::default()
5022    }
5023
5024    /// Sets the value of [name][crate::model::Connector::name].
5025    ///
5026    /// # Example
5027    /// ```ignore,no_run
5028    /// # use google_cloud_connectors_v1::model::Connector;
5029    /// let x = Connector::new().set_name("example");
5030    /// ```
5031    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5032        self.name = v.into();
5033        self
5034    }
5035
5036    /// Sets the value of [create_time][crate::model::Connector::create_time].
5037    ///
5038    /// # Example
5039    /// ```ignore,no_run
5040    /// # use google_cloud_connectors_v1::model::Connector;
5041    /// use wkt::Timestamp;
5042    /// let x = Connector::new().set_create_time(Timestamp::default()/* use setters */);
5043    /// ```
5044    pub fn set_create_time<T>(mut self, v: T) -> Self
5045    where
5046        T: std::convert::Into<wkt::Timestamp>,
5047    {
5048        self.create_time = std::option::Option::Some(v.into());
5049        self
5050    }
5051
5052    /// Sets or clears the value of [create_time][crate::model::Connector::create_time].
5053    ///
5054    /// # Example
5055    /// ```ignore,no_run
5056    /// # use google_cloud_connectors_v1::model::Connector;
5057    /// use wkt::Timestamp;
5058    /// let x = Connector::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5059    /// let x = Connector::new().set_or_clear_create_time(None::<Timestamp>);
5060    /// ```
5061    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5062    where
5063        T: std::convert::Into<wkt::Timestamp>,
5064    {
5065        self.create_time = v.map(|x| x.into());
5066        self
5067    }
5068
5069    /// Sets the value of [update_time][crate::model::Connector::update_time].
5070    ///
5071    /// # Example
5072    /// ```ignore,no_run
5073    /// # use google_cloud_connectors_v1::model::Connector;
5074    /// use wkt::Timestamp;
5075    /// let x = Connector::new().set_update_time(Timestamp::default()/* use setters */);
5076    /// ```
5077    pub fn set_update_time<T>(mut self, v: T) -> Self
5078    where
5079        T: std::convert::Into<wkt::Timestamp>,
5080    {
5081        self.update_time = std::option::Option::Some(v.into());
5082        self
5083    }
5084
5085    /// Sets or clears the value of [update_time][crate::model::Connector::update_time].
5086    ///
5087    /// # Example
5088    /// ```ignore,no_run
5089    /// # use google_cloud_connectors_v1::model::Connector;
5090    /// use wkt::Timestamp;
5091    /// let x = Connector::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5092    /// let x = Connector::new().set_or_clear_update_time(None::<Timestamp>);
5093    /// ```
5094    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5095    where
5096        T: std::convert::Into<wkt::Timestamp>,
5097    {
5098        self.update_time = v.map(|x| x.into());
5099        self
5100    }
5101
5102    /// Sets the value of [labels][crate::model::Connector::labels].
5103    ///
5104    /// # Example
5105    /// ```ignore,no_run
5106    /// # use google_cloud_connectors_v1::model::Connector;
5107    /// let x = Connector::new().set_labels([
5108    ///     ("key0", "abc"),
5109    ///     ("key1", "xyz"),
5110    /// ]);
5111    /// ```
5112    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5113    where
5114        T: std::iter::IntoIterator<Item = (K, V)>,
5115        K: std::convert::Into<std::string::String>,
5116        V: std::convert::Into<std::string::String>,
5117    {
5118        use std::iter::Iterator;
5119        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5120        self
5121    }
5122
5123    /// Sets the value of [documentation_uri][crate::model::Connector::documentation_uri].
5124    ///
5125    /// # Example
5126    /// ```ignore,no_run
5127    /// # use google_cloud_connectors_v1::model::Connector;
5128    /// let x = Connector::new().set_documentation_uri("example");
5129    /// ```
5130    pub fn set_documentation_uri<T: std::convert::Into<std::string::String>>(
5131        mut self,
5132        v: T,
5133    ) -> Self {
5134        self.documentation_uri = v.into();
5135        self
5136    }
5137
5138    /// Sets the value of [external_uri][crate::model::Connector::external_uri].
5139    ///
5140    /// # Example
5141    /// ```ignore,no_run
5142    /// # use google_cloud_connectors_v1::model::Connector;
5143    /// let x = Connector::new().set_external_uri("example");
5144    /// ```
5145    pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5146        self.external_uri = v.into();
5147        self
5148    }
5149
5150    /// Sets the value of [description][crate::model::Connector::description].
5151    ///
5152    /// # Example
5153    /// ```ignore,no_run
5154    /// # use google_cloud_connectors_v1::model::Connector;
5155    /// let x = Connector::new().set_description("example");
5156    /// ```
5157    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5158        self.description = v.into();
5159        self
5160    }
5161
5162    /// Sets the value of [web_assets_location][crate::model::Connector::web_assets_location].
5163    ///
5164    /// # Example
5165    /// ```ignore,no_run
5166    /// # use google_cloud_connectors_v1::model::Connector;
5167    /// let x = Connector::new().set_web_assets_location("example");
5168    /// ```
5169    pub fn set_web_assets_location<T: std::convert::Into<std::string::String>>(
5170        mut self,
5171        v: T,
5172    ) -> Self {
5173        self.web_assets_location = v.into();
5174        self
5175    }
5176
5177    /// Sets the value of [display_name][crate::model::Connector::display_name].
5178    ///
5179    /// # Example
5180    /// ```ignore,no_run
5181    /// # use google_cloud_connectors_v1::model::Connector;
5182    /// let x = Connector::new().set_display_name("example");
5183    /// ```
5184    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5185        self.display_name = v.into();
5186        self
5187    }
5188
5189    /// Sets the value of [launch_stage][crate::model::Connector::launch_stage].
5190    ///
5191    /// # Example
5192    /// ```ignore,no_run
5193    /// # use google_cloud_connectors_v1::model::Connector;
5194    /// use google_cloud_connectors_v1::model::LaunchStage;
5195    /// let x0 = Connector::new().set_launch_stage(LaunchStage::Preview);
5196    /// let x1 = Connector::new().set_launch_stage(LaunchStage::Ga);
5197    /// let x2 = Connector::new().set_launch_stage(LaunchStage::Deprecated);
5198    /// ```
5199    pub fn set_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
5200        mut self,
5201        v: T,
5202    ) -> Self {
5203        self.launch_stage = v.into();
5204        self
5205    }
5206}
5207
5208impl wkt::message::Message for Connector {
5209    fn typename() -> &'static str {
5210        "type.googleapis.com/google.cloud.connectors.v1.Connector"
5211    }
5212}
5213
5214/// Request message for Connectors.GetConnector.
5215#[derive(Clone, Default, PartialEq)]
5216#[non_exhaustive]
5217pub struct GetConnectorRequest {
5218    /// Required. Resource name of the form:
5219    /// `projects/*/locations/*/providers/*/connectors/*`
5220    /// Only global location is supported for Connector resource.
5221    pub name: std::string::String,
5222
5223    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5224}
5225
5226impl GetConnectorRequest {
5227    pub fn new() -> Self {
5228        std::default::Default::default()
5229    }
5230
5231    /// Sets the value of [name][crate::model::GetConnectorRequest::name].
5232    ///
5233    /// # Example
5234    /// ```ignore,no_run
5235    /// # use google_cloud_connectors_v1::model::GetConnectorRequest;
5236    /// let x = GetConnectorRequest::new().set_name("example");
5237    /// ```
5238    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5239        self.name = v.into();
5240        self
5241    }
5242}
5243
5244impl wkt::message::Message for GetConnectorRequest {
5245    fn typename() -> &'static str {
5246        "type.googleapis.com/google.cloud.connectors.v1.GetConnectorRequest"
5247    }
5248}
5249
5250/// Request message for Connectors.ListConnectors.
5251#[derive(Clone, Default, PartialEq)]
5252#[non_exhaustive]
5253pub struct ListConnectorsRequest {
5254    /// Required. Parent resource of the connectors, of the form:
5255    /// `projects/*/locations/*/providers/*`
5256    /// Only global location is supported for Connector resource.
5257    pub parent: std::string::String,
5258
5259    /// Page size.
5260    pub page_size: i32,
5261
5262    /// Page token.
5263    pub page_token: std::string::String,
5264
5265    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5266}
5267
5268impl ListConnectorsRequest {
5269    pub fn new() -> Self {
5270        std::default::Default::default()
5271    }
5272
5273    /// Sets the value of [parent][crate::model::ListConnectorsRequest::parent].
5274    ///
5275    /// # Example
5276    /// ```ignore,no_run
5277    /// # use google_cloud_connectors_v1::model::ListConnectorsRequest;
5278    /// let x = ListConnectorsRequest::new().set_parent("example");
5279    /// ```
5280    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5281        self.parent = v.into();
5282        self
5283    }
5284
5285    /// Sets the value of [page_size][crate::model::ListConnectorsRequest::page_size].
5286    ///
5287    /// # Example
5288    /// ```ignore,no_run
5289    /// # use google_cloud_connectors_v1::model::ListConnectorsRequest;
5290    /// let x = ListConnectorsRequest::new().set_page_size(42);
5291    /// ```
5292    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5293        self.page_size = v.into();
5294        self
5295    }
5296
5297    /// Sets the value of [page_token][crate::model::ListConnectorsRequest::page_token].
5298    ///
5299    /// # Example
5300    /// ```ignore,no_run
5301    /// # use google_cloud_connectors_v1::model::ListConnectorsRequest;
5302    /// let x = ListConnectorsRequest::new().set_page_token("example");
5303    /// ```
5304    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5305        self.page_token = v.into();
5306        self
5307    }
5308}
5309
5310impl wkt::message::Message for ListConnectorsRequest {
5311    fn typename() -> &'static str {
5312        "type.googleapis.com/google.cloud.connectors.v1.ListConnectorsRequest"
5313    }
5314}
5315
5316/// Response message for Connectors.ListConnectors.
5317#[derive(Clone, Default, PartialEq)]
5318#[non_exhaustive]
5319pub struct ListConnectorsResponse {
5320    /// A list of connectors.
5321    pub connectors: std::vec::Vec<crate::model::Connector>,
5322
5323    /// Next page token.
5324    pub next_page_token: std::string::String,
5325
5326    /// Locations that could not be reached.
5327    pub unreachable: std::vec::Vec<std::string::String>,
5328
5329    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5330}
5331
5332impl ListConnectorsResponse {
5333    pub fn new() -> Self {
5334        std::default::Default::default()
5335    }
5336
5337    /// Sets the value of [connectors][crate::model::ListConnectorsResponse::connectors].
5338    ///
5339    /// # Example
5340    /// ```ignore,no_run
5341    /// # use google_cloud_connectors_v1::model::ListConnectorsResponse;
5342    /// use google_cloud_connectors_v1::model::Connector;
5343    /// let x = ListConnectorsResponse::new()
5344    ///     .set_connectors([
5345    ///         Connector::default()/* use setters */,
5346    ///         Connector::default()/* use (different) setters */,
5347    ///     ]);
5348    /// ```
5349    pub fn set_connectors<T, V>(mut self, v: T) -> Self
5350    where
5351        T: std::iter::IntoIterator<Item = V>,
5352        V: std::convert::Into<crate::model::Connector>,
5353    {
5354        use std::iter::Iterator;
5355        self.connectors = v.into_iter().map(|i| i.into()).collect();
5356        self
5357    }
5358
5359    /// Sets the value of [next_page_token][crate::model::ListConnectorsResponse::next_page_token].
5360    ///
5361    /// # Example
5362    /// ```ignore,no_run
5363    /// # use google_cloud_connectors_v1::model::ListConnectorsResponse;
5364    /// let x = ListConnectorsResponse::new().set_next_page_token("example");
5365    /// ```
5366    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5367        self.next_page_token = v.into();
5368        self
5369    }
5370
5371    /// Sets the value of [unreachable][crate::model::ListConnectorsResponse::unreachable].
5372    ///
5373    /// # Example
5374    /// ```ignore,no_run
5375    /// # use google_cloud_connectors_v1::model::ListConnectorsResponse;
5376    /// let x = ListConnectorsResponse::new().set_unreachable(["a", "b", "c"]);
5377    /// ```
5378    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5379    where
5380        T: std::iter::IntoIterator<Item = V>,
5381        V: std::convert::Into<std::string::String>,
5382    {
5383        use std::iter::Iterator;
5384        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5385        self
5386    }
5387}
5388
5389impl wkt::message::Message for ListConnectorsResponse {
5390    fn typename() -> &'static str {
5391        "type.googleapis.com/google.cloud.connectors.v1.ListConnectorsResponse"
5392    }
5393}
5394
5395#[doc(hidden)]
5396impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectorsResponse {
5397    type PageItem = crate::model::Connector;
5398
5399    fn items(self) -> std::vec::Vec<Self::PageItem> {
5400        self.connectors
5401    }
5402
5403    fn next_page_token(&self) -> std::string::String {
5404        use std::clone::Clone;
5405        self.next_page_token.clone()
5406    }
5407}
5408
5409/// ConnectorVersion indicates a specific version of a connector.
5410#[derive(Clone, Default, PartialEq)]
5411#[non_exhaustive]
5412pub struct ConnectorVersion {
5413    /// Output only. Resource name of the Version.
5414    /// Format:
5415    /// projects/{project}/locations/{location}/providers/{provider}/connectors/{connector}/versions/{version}
5416    /// Only global location is supported for Connector resource.
5417    pub name: std::string::String,
5418
5419    /// Output only. Created time.
5420    pub create_time: std::option::Option<wkt::Timestamp>,
5421
5422    /// Output only. Updated time.
5423    pub update_time: std::option::Option<wkt::Timestamp>,
5424
5425    /// Output only. Resource labels to represent user-provided metadata.
5426    /// Refer to cloud documentation on labels for more details.
5427    /// <https://cloud.google.com/compute/docs/labeling-resources>
5428    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5429
5430    /// Output only. Flag to mark the version indicating the launch stage.
5431    pub launch_stage: crate::model::LaunchStage,
5432
5433    /// Output only. ReleaseVersion of the connector, for example: "1.0.1-alpha".
5434    pub release_version: std::string::String,
5435
5436    /// Output only. List of auth configs supported by the Connector Version.
5437    pub auth_config_templates: std::vec::Vec<crate::model::AuthConfigTemplate>,
5438
5439    /// Output only. List of config variables needed to create a connection.
5440    pub config_variable_templates: std::vec::Vec<crate::model::ConfigVariableTemplate>,
5441
5442    /// Output only. Information about the runtime features supported by the
5443    /// Connector.
5444    pub supported_runtime_features: std::option::Option<crate::model::SupportedRuntimeFeatures>,
5445
5446    /// Output only. Display name.
5447    pub display_name: std::string::String,
5448
5449    /// Output only. Configuration for Egress Control.
5450    pub egress_control_config: std::option::Option<crate::model::EgressControlConfig>,
5451
5452    /// Output only. Role grant configurations for this connector version.
5453    pub role_grants: std::vec::Vec<crate::model::RoleGrant>,
5454
5455    /// Output only. Role grant configuration for this config variable. It will be
5456    /// DEPRECATED soon.
5457    pub role_grant: std::option::Option<crate::model::RoleGrant>,
5458
5459    /// Output only. Ssl configuration supported by the Connector.
5460    pub ssl_config_template: std::option::Option<crate::model::SslConfigTemplate>,
5461
5462    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5463}
5464
5465impl ConnectorVersion {
5466    pub fn new() -> Self {
5467        std::default::Default::default()
5468    }
5469
5470    /// Sets the value of [name][crate::model::ConnectorVersion::name].
5471    ///
5472    /// # Example
5473    /// ```ignore,no_run
5474    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5475    /// let x = ConnectorVersion::new().set_name("example");
5476    /// ```
5477    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5478        self.name = v.into();
5479        self
5480    }
5481
5482    /// Sets the value of [create_time][crate::model::ConnectorVersion::create_time].
5483    ///
5484    /// # Example
5485    /// ```ignore,no_run
5486    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5487    /// use wkt::Timestamp;
5488    /// let x = ConnectorVersion::new().set_create_time(Timestamp::default()/* use setters */);
5489    /// ```
5490    pub fn set_create_time<T>(mut self, v: T) -> Self
5491    where
5492        T: std::convert::Into<wkt::Timestamp>,
5493    {
5494        self.create_time = std::option::Option::Some(v.into());
5495        self
5496    }
5497
5498    /// Sets or clears the value of [create_time][crate::model::ConnectorVersion::create_time].
5499    ///
5500    /// # Example
5501    /// ```ignore,no_run
5502    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5503    /// use wkt::Timestamp;
5504    /// let x = ConnectorVersion::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5505    /// let x = ConnectorVersion::new().set_or_clear_create_time(None::<Timestamp>);
5506    /// ```
5507    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5508    where
5509        T: std::convert::Into<wkt::Timestamp>,
5510    {
5511        self.create_time = v.map(|x| x.into());
5512        self
5513    }
5514
5515    /// Sets the value of [update_time][crate::model::ConnectorVersion::update_time].
5516    ///
5517    /// # Example
5518    /// ```ignore,no_run
5519    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5520    /// use wkt::Timestamp;
5521    /// let x = ConnectorVersion::new().set_update_time(Timestamp::default()/* use setters */);
5522    /// ```
5523    pub fn set_update_time<T>(mut self, v: T) -> Self
5524    where
5525        T: std::convert::Into<wkt::Timestamp>,
5526    {
5527        self.update_time = std::option::Option::Some(v.into());
5528        self
5529    }
5530
5531    /// Sets or clears the value of [update_time][crate::model::ConnectorVersion::update_time].
5532    ///
5533    /// # Example
5534    /// ```ignore,no_run
5535    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5536    /// use wkt::Timestamp;
5537    /// let x = ConnectorVersion::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5538    /// let x = ConnectorVersion::new().set_or_clear_update_time(None::<Timestamp>);
5539    /// ```
5540    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5541    where
5542        T: std::convert::Into<wkt::Timestamp>,
5543    {
5544        self.update_time = v.map(|x| x.into());
5545        self
5546    }
5547
5548    /// Sets the value of [labels][crate::model::ConnectorVersion::labels].
5549    ///
5550    /// # Example
5551    /// ```ignore,no_run
5552    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5553    /// let x = ConnectorVersion::new().set_labels([
5554    ///     ("key0", "abc"),
5555    ///     ("key1", "xyz"),
5556    /// ]);
5557    /// ```
5558    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5559    where
5560        T: std::iter::IntoIterator<Item = (K, V)>,
5561        K: std::convert::Into<std::string::String>,
5562        V: std::convert::Into<std::string::String>,
5563    {
5564        use std::iter::Iterator;
5565        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5566        self
5567    }
5568
5569    /// Sets the value of [launch_stage][crate::model::ConnectorVersion::launch_stage].
5570    ///
5571    /// # Example
5572    /// ```ignore,no_run
5573    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5574    /// use google_cloud_connectors_v1::model::LaunchStage;
5575    /// let x0 = ConnectorVersion::new().set_launch_stage(LaunchStage::Preview);
5576    /// let x1 = ConnectorVersion::new().set_launch_stage(LaunchStage::Ga);
5577    /// let x2 = ConnectorVersion::new().set_launch_stage(LaunchStage::Deprecated);
5578    /// ```
5579    pub fn set_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
5580        mut self,
5581        v: T,
5582    ) -> Self {
5583        self.launch_stage = v.into();
5584        self
5585    }
5586
5587    /// Sets the value of [release_version][crate::model::ConnectorVersion::release_version].
5588    ///
5589    /// # Example
5590    /// ```ignore,no_run
5591    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5592    /// let x = ConnectorVersion::new().set_release_version("example");
5593    /// ```
5594    pub fn set_release_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5595        self.release_version = v.into();
5596        self
5597    }
5598
5599    /// Sets the value of [auth_config_templates][crate::model::ConnectorVersion::auth_config_templates].
5600    ///
5601    /// # Example
5602    /// ```ignore,no_run
5603    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5604    /// use google_cloud_connectors_v1::model::AuthConfigTemplate;
5605    /// let x = ConnectorVersion::new()
5606    ///     .set_auth_config_templates([
5607    ///         AuthConfigTemplate::default()/* use setters */,
5608    ///         AuthConfigTemplate::default()/* use (different) setters */,
5609    ///     ]);
5610    /// ```
5611    pub fn set_auth_config_templates<T, V>(mut self, v: T) -> Self
5612    where
5613        T: std::iter::IntoIterator<Item = V>,
5614        V: std::convert::Into<crate::model::AuthConfigTemplate>,
5615    {
5616        use std::iter::Iterator;
5617        self.auth_config_templates = v.into_iter().map(|i| i.into()).collect();
5618        self
5619    }
5620
5621    /// Sets the value of [config_variable_templates][crate::model::ConnectorVersion::config_variable_templates].
5622    ///
5623    /// # Example
5624    /// ```ignore,no_run
5625    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5626    /// use google_cloud_connectors_v1::model::ConfigVariableTemplate;
5627    /// let x = ConnectorVersion::new()
5628    ///     .set_config_variable_templates([
5629    ///         ConfigVariableTemplate::default()/* use setters */,
5630    ///         ConfigVariableTemplate::default()/* use (different) setters */,
5631    ///     ]);
5632    /// ```
5633    pub fn set_config_variable_templates<T, V>(mut self, v: T) -> Self
5634    where
5635        T: std::iter::IntoIterator<Item = V>,
5636        V: std::convert::Into<crate::model::ConfigVariableTemplate>,
5637    {
5638        use std::iter::Iterator;
5639        self.config_variable_templates = v.into_iter().map(|i| i.into()).collect();
5640        self
5641    }
5642
5643    /// Sets the value of [supported_runtime_features][crate::model::ConnectorVersion::supported_runtime_features].
5644    ///
5645    /// # Example
5646    /// ```ignore,no_run
5647    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5648    /// use google_cloud_connectors_v1::model::SupportedRuntimeFeatures;
5649    /// let x = ConnectorVersion::new().set_supported_runtime_features(SupportedRuntimeFeatures::default()/* use setters */);
5650    /// ```
5651    pub fn set_supported_runtime_features<T>(mut self, v: T) -> Self
5652    where
5653        T: std::convert::Into<crate::model::SupportedRuntimeFeatures>,
5654    {
5655        self.supported_runtime_features = std::option::Option::Some(v.into());
5656        self
5657    }
5658
5659    /// Sets or clears the value of [supported_runtime_features][crate::model::ConnectorVersion::supported_runtime_features].
5660    ///
5661    /// # Example
5662    /// ```ignore,no_run
5663    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5664    /// use google_cloud_connectors_v1::model::SupportedRuntimeFeatures;
5665    /// let x = ConnectorVersion::new().set_or_clear_supported_runtime_features(Some(SupportedRuntimeFeatures::default()/* use setters */));
5666    /// let x = ConnectorVersion::new().set_or_clear_supported_runtime_features(None::<SupportedRuntimeFeatures>);
5667    /// ```
5668    pub fn set_or_clear_supported_runtime_features<T>(mut self, v: std::option::Option<T>) -> Self
5669    where
5670        T: std::convert::Into<crate::model::SupportedRuntimeFeatures>,
5671    {
5672        self.supported_runtime_features = v.map(|x| x.into());
5673        self
5674    }
5675
5676    /// Sets the value of [display_name][crate::model::ConnectorVersion::display_name].
5677    ///
5678    /// # Example
5679    /// ```ignore,no_run
5680    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5681    /// let x = ConnectorVersion::new().set_display_name("example");
5682    /// ```
5683    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5684        self.display_name = v.into();
5685        self
5686    }
5687
5688    /// Sets the value of [egress_control_config][crate::model::ConnectorVersion::egress_control_config].
5689    ///
5690    /// # Example
5691    /// ```ignore,no_run
5692    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5693    /// use google_cloud_connectors_v1::model::EgressControlConfig;
5694    /// let x = ConnectorVersion::new().set_egress_control_config(EgressControlConfig::default()/* use setters */);
5695    /// ```
5696    pub fn set_egress_control_config<T>(mut self, v: T) -> Self
5697    where
5698        T: std::convert::Into<crate::model::EgressControlConfig>,
5699    {
5700        self.egress_control_config = std::option::Option::Some(v.into());
5701        self
5702    }
5703
5704    /// Sets or clears the value of [egress_control_config][crate::model::ConnectorVersion::egress_control_config].
5705    ///
5706    /// # Example
5707    /// ```ignore,no_run
5708    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5709    /// use google_cloud_connectors_v1::model::EgressControlConfig;
5710    /// let x = ConnectorVersion::new().set_or_clear_egress_control_config(Some(EgressControlConfig::default()/* use setters */));
5711    /// let x = ConnectorVersion::new().set_or_clear_egress_control_config(None::<EgressControlConfig>);
5712    /// ```
5713    pub fn set_or_clear_egress_control_config<T>(mut self, v: std::option::Option<T>) -> Self
5714    where
5715        T: std::convert::Into<crate::model::EgressControlConfig>,
5716    {
5717        self.egress_control_config = v.map(|x| x.into());
5718        self
5719    }
5720
5721    /// Sets the value of [role_grants][crate::model::ConnectorVersion::role_grants].
5722    ///
5723    /// # Example
5724    /// ```ignore,no_run
5725    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5726    /// use google_cloud_connectors_v1::model::RoleGrant;
5727    /// let x = ConnectorVersion::new()
5728    ///     .set_role_grants([
5729    ///         RoleGrant::default()/* use setters */,
5730    ///         RoleGrant::default()/* use (different) setters */,
5731    ///     ]);
5732    /// ```
5733    pub fn set_role_grants<T, V>(mut self, v: T) -> Self
5734    where
5735        T: std::iter::IntoIterator<Item = V>,
5736        V: std::convert::Into<crate::model::RoleGrant>,
5737    {
5738        use std::iter::Iterator;
5739        self.role_grants = v.into_iter().map(|i| i.into()).collect();
5740        self
5741    }
5742
5743    /// Sets the value of [role_grant][crate::model::ConnectorVersion::role_grant].
5744    ///
5745    /// # Example
5746    /// ```ignore,no_run
5747    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5748    /// use google_cloud_connectors_v1::model::RoleGrant;
5749    /// let x = ConnectorVersion::new().set_role_grant(RoleGrant::default()/* use setters */);
5750    /// ```
5751    pub fn set_role_grant<T>(mut self, v: T) -> Self
5752    where
5753        T: std::convert::Into<crate::model::RoleGrant>,
5754    {
5755        self.role_grant = std::option::Option::Some(v.into());
5756        self
5757    }
5758
5759    /// Sets or clears the value of [role_grant][crate::model::ConnectorVersion::role_grant].
5760    ///
5761    /// # Example
5762    /// ```ignore,no_run
5763    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5764    /// use google_cloud_connectors_v1::model::RoleGrant;
5765    /// let x = ConnectorVersion::new().set_or_clear_role_grant(Some(RoleGrant::default()/* use setters */));
5766    /// let x = ConnectorVersion::new().set_or_clear_role_grant(None::<RoleGrant>);
5767    /// ```
5768    pub fn set_or_clear_role_grant<T>(mut self, v: std::option::Option<T>) -> Self
5769    where
5770        T: std::convert::Into<crate::model::RoleGrant>,
5771    {
5772        self.role_grant = v.map(|x| x.into());
5773        self
5774    }
5775
5776    /// Sets the value of [ssl_config_template][crate::model::ConnectorVersion::ssl_config_template].
5777    ///
5778    /// # Example
5779    /// ```ignore,no_run
5780    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5781    /// use google_cloud_connectors_v1::model::SslConfigTemplate;
5782    /// let x = ConnectorVersion::new().set_ssl_config_template(SslConfigTemplate::default()/* use setters */);
5783    /// ```
5784    pub fn set_ssl_config_template<T>(mut self, v: T) -> Self
5785    where
5786        T: std::convert::Into<crate::model::SslConfigTemplate>,
5787    {
5788        self.ssl_config_template = std::option::Option::Some(v.into());
5789        self
5790    }
5791
5792    /// Sets or clears the value of [ssl_config_template][crate::model::ConnectorVersion::ssl_config_template].
5793    ///
5794    /// # Example
5795    /// ```ignore,no_run
5796    /// # use google_cloud_connectors_v1::model::ConnectorVersion;
5797    /// use google_cloud_connectors_v1::model::SslConfigTemplate;
5798    /// let x = ConnectorVersion::new().set_or_clear_ssl_config_template(Some(SslConfigTemplate::default()/* use setters */));
5799    /// let x = ConnectorVersion::new().set_or_clear_ssl_config_template(None::<SslConfigTemplate>);
5800    /// ```
5801    pub fn set_or_clear_ssl_config_template<T>(mut self, v: std::option::Option<T>) -> Self
5802    where
5803        T: std::convert::Into<crate::model::SslConfigTemplate>,
5804    {
5805        self.ssl_config_template = v.map(|x| x.into());
5806        self
5807    }
5808}
5809
5810impl wkt::message::Message for ConnectorVersion {
5811    fn typename() -> &'static str {
5812        "type.googleapis.com/google.cloud.connectors.v1.ConnectorVersion"
5813    }
5814}
5815
5816/// Request message for Connectors.GetConnectorVersion.
5817#[derive(Clone, Default, PartialEq)]
5818#[non_exhaustive]
5819pub struct GetConnectorVersionRequest {
5820    /// Required. Resource name of the form:
5821    /// `projects/*/locations/*/providers/*/connectors/*/versions/*`
5822    /// Only global location is supported for ConnectorVersion resource.
5823    pub name: std::string::String,
5824
5825    /// Specifies which fields of the ConnectorVersion are returned in the
5826    /// response. Defaults to `CUSTOMER` view.
5827    pub view: crate::model::ConnectorVersionView,
5828
5829    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5830}
5831
5832impl GetConnectorVersionRequest {
5833    pub fn new() -> Self {
5834        std::default::Default::default()
5835    }
5836
5837    /// Sets the value of [name][crate::model::GetConnectorVersionRequest::name].
5838    ///
5839    /// # Example
5840    /// ```ignore,no_run
5841    /// # use google_cloud_connectors_v1::model::GetConnectorVersionRequest;
5842    /// let x = GetConnectorVersionRequest::new().set_name("example");
5843    /// ```
5844    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5845        self.name = v.into();
5846        self
5847    }
5848
5849    /// Sets the value of [view][crate::model::GetConnectorVersionRequest::view].
5850    ///
5851    /// # Example
5852    /// ```ignore,no_run
5853    /// # use google_cloud_connectors_v1::model::GetConnectorVersionRequest;
5854    /// use google_cloud_connectors_v1::model::ConnectorVersionView;
5855    /// let x0 = GetConnectorVersionRequest::new().set_view(ConnectorVersionView::Basic);
5856    /// let x1 = GetConnectorVersionRequest::new().set_view(ConnectorVersionView::Full);
5857    /// ```
5858    pub fn set_view<T: std::convert::Into<crate::model::ConnectorVersionView>>(
5859        mut self,
5860        v: T,
5861    ) -> Self {
5862        self.view = v.into();
5863        self
5864    }
5865}
5866
5867impl wkt::message::Message for GetConnectorVersionRequest {
5868    fn typename() -> &'static str {
5869        "type.googleapis.com/google.cloud.connectors.v1.GetConnectorVersionRequest"
5870    }
5871}
5872
5873/// Request message for Connectors.ListConnectorVersions.
5874#[derive(Clone, Default, PartialEq)]
5875#[non_exhaustive]
5876pub struct ListConnectorVersionsRequest {
5877    /// Required. Parent resource of the connectors, of the form:
5878    /// `projects/*/locations/*/providers/*/connectors/*`
5879    /// Only global location is supported for ConnectorVersion resource.
5880    pub parent: std::string::String,
5881
5882    /// Page size.
5883    pub page_size: i32,
5884
5885    /// Page token.
5886    pub page_token: std::string::String,
5887
5888    /// Specifies which fields of the ConnectorVersion are returned in the
5889    /// response. Defaults to `BASIC` view.
5890    pub view: crate::model::ConnectorVersionView,
5891
5892    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5893}
5894
5895impl ListConnectorVersionsRequest {
5896    pub fn new() -> Self {
5897        std::default::Default::default()
5898    }
5899
5900    /// Sets the value of [parent][crate::model::ListConnectorVersionsRequest::parent].
5901    ///
5902    /// # Example
5903    /// ```ignore,no_run
5904    /// # use google_cloud_connectors_v1::model::ListConnectorVersionsRequest;
5905    /// let x = ListConnectorVersionsRequest::new().set_parent("example");
5906    /// ```
5907    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5908        self.parent = v.into();
5909        self
5910    }
5911
5912    /// Sets the value of [page_size][crate::model::ListConnectorVersionsRequest::page_size].
5913    ///
5914    /// # Example
5915    /// ```ignore,no_run
5916    /// # use google_cloud_connectors_v1::model::ListConnectorVersionsRequest;
5917    /// let x = ListConnectorVersionsRequest::new().set_page_size(42);
5918    /// ```
5919    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5920        self.page_size = v.into();
5921        self
5922    }
5923
5924    /// Sets the value of [page_token][crate::model::ListConnectorVersionsRequest::page_token].
5925    ///
5926    /// # Example
5927    /// ```ignore,no_run
5928    /// # use google_cloud_connectors_v1::model::ListConnectorVersionsRequest;
5929    /// let x = ListConnectorVersionsRequest::new().set_page_token("example");
5930    /// ```
5931    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5932        self.page_token = v.into();
5933        self
5934    }
5935
5936    /// Sets the value of [view][crate::model::ListConnectorVersionsRequest::view].
5937    ///
5938    /// # Example
5939    /// ```ignore,no_run
5940    /// # use google_cloud_connectors_v1::model::ListConnectorVersionsRequest;
5941    /// use google_cloud_connectors_v1::model::ConnectorVersionView;
5942    /// let x0 = ListConnectorVersionsRequest::new().set_view(ConnectorVersionView::Basic);
5943    /// let x1 = ListConnectorVersionsRequest::new().set_view(ConnectorVersionView::Full);
5944    /// ```
5945    pub fn set_view<T: std::convert::Into<crate::model::ConnectorVersionView>>(
5946        mut self,
5947        v: T,
5948    ) -> Self {
5949        self.view = v.into();
5950        self
5951    }
5952}
5953
5954impl wkt::message::Message for ListConnectorVersionsRequest {
5955    fn typename() -> &'static str {
5956        "type.googleapis.com/google.cloud.connectors.v1.ListConnectorVersionsRequest"
5957    }
5958}
5959
5960/// Response message for Connectors.ListConnectorVersions.
5961#[derive(Clone, Default, PartialEq)]
5962#[non_exhaustive]
5963pub struct ListConnectorVersionsResponse {
5964    /// A list of connector versions.
5965    pub connector_versions: std::vec::Vec<crate::model::ConnectorVersion>,
5966
5967    /// Next page token.
5968    pub next_page_token: std::string::String,
5969
5970    /// Locations that could not be reached.
5971    pub unreachable: std::vec::Vec<std::string::String>,
5972
5973    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5974}
5975
5976impl ListConnectorVersionsResponse {
5977    pub fn new() -> Self {
5978        std::default::Default::default()
5979    }
5980
5981    /// Sets the value of [connector_versions][crate::model::ListConnectorVersionsResponse::connector_versions].
5982    ///
5983    /// # Example
5984    /// ```ignore,no_run
5985    /// # use google_cloud_connectors_v1::model::ListConnectorVersionsResponse;
5986    /// use google_cloud_connectors_v1::model::ConnectorVersion;
5987    /// let x = ListConnectorVersionsResponse::new()
5988    ///     .set_connector_versions([
5989    ///         ConnectorVersion::default()/* use setters */,
5990    ///         ConnectorVersion::default()/* use (different) setters */,
5991    ///     ]);
5992    /// ```
5993    pub fn set_connector_versions<T, V>(mut self, v: T) -> Self
5994    where
5995        T: std::iter::IntoIterator<Item = V>,
5996        V: std::convert::Into<crate::model::ConnectorVersion>,
5997    {
5998        use std::iter::Iterator;
5999        self.connector_versions = v.into_iter().map(|i| i.into()).collect();
6000        self
6001    }
6002
6003    /// Sets the value of [next_page_token][crate::model::ListConnectorVersionsResponse::next_page_token].
6004    ///
6005    /// # Example
6006    /// ```ignore,no_run
6007    /// # use google_cloud_connectors_v1::model::ListConnectorVersionsResponse;
6008    /// let x = ListConnectorVersionsResponse::new().set_next_page_token("example");
6009    /// ```
6010    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6011        self.next_page_token = v.into();
6012        self
6013    }
6014
6015    /// Sets the value of [unreachable][crate::model::ListConnectorVersionsResponse::unreachable].
6016    ///
6017    /// # Example
6018    /// ```ignore,no_run
6019    /// # use google_cloud_connectors_v1::model::ListConnectorVersionsResponse;
6020    /// let x = ListConnectorVersionsResponse::new().set_unreachable(["a", "b", "c"]);
6021    /// ```
6022    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6023    where
6024        T: std::iter::IntoIterator<Item = V>,
6025        V: std::convert::Into<std::string::String>,
6026    {
6027        use std::iter::Iterator;
6028        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6029        self
6030    }
6031}
6032
6033impl wkt::message::Message for ListConnectorVersionsResponse {
6034    fn typename() -> &'static str {
6035        "type.googleapis.com/google.cloud.connectors.v1.ListConnectorVersionsResponse"
6036    }
6037}
6038
6039#[doc(hidden)]
6040impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectorVersionsResponse {
6041    type PageItem = crate::model::ConnectorVersion;
6042
6043    fn items(self) -> std::vec::Vec<Self::PageItem> {
6044        self.connector_versions
6045    }
6046
6047    fn next_page_token(&self) -> std::string::String {
6048        use std::clone::Clone;
6049        self.next_page_token.clone()
6050    }
6051}
6052
6053/// Supported runtime features of a connector version. This is passed to the
6054/// management layer to add a new connector version by the connector developer.
6055/// Details about how this proto is passed to the management layer is covered in
6056/// this doc - go/runtime-manifest.
6057#[derive(Clone, Default, PartialEq)]
6058#[non_exhaustive]
6059pub struct SupportedRuntimeFeatures {
6060    /// Specifies if the connector supports entity apis like 'createEntity'.
6061    pub entity_apis: bool,
6062
6063    /// Specifies if the connector supports action apis like 'executeAction'.
6064    pub action_apis: bool,
6065
6066    /// Specifies if the connector supports 'ExecuteSqlQuery' operation.
6067    pub sql_query: bool,
6068
6069    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6070}
6071
6072impl SupportedRuntimeFeatures {
6073    pub fn new() -> Self {
6074        std::default::Default::default()
6075    }
6076
6077    /// Sets the value of [entity_apis][crate::model::SupportedRuntimeFeatures::entity_apis].
6078    ///
6079    /// # Example
6080    /// ```ignore,no_run
6081    /// # use google_cloud_connectors_v1::model::SupportedRuntimeFeatures;
6082    /// let x = SupportedRuntimeFeatures::new().set_entity_apis(true);
6083    /// ```
6084    pub fn set_entity_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6085        self.entity_apis = v.into();
6086        self
6087    }
6088
6089    /// Sets the value of [action_apis][crate::model::SupportedRuntimeFeatures::action_apis].
6090    ///
6091    /// # Example
6092    /// ```ignore,no_run
6093    /// # use google_cloud_connectors_v1::model::SupportedRuntimeFeatures;
6094    /// let x = SupportedRuntimeFeatures::new().set_action_apis(true);
6095    /// ```
6096    pub fn set_action_apis<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6097        self.action_apis = v.into();
6098        self
6099    }
6100
6101    /// Sets the value of [sql_query][crate::model::SupportedRuntimeFeatures::sql_query].
6102    ///
6103    /// # Example
6104    /// ```ignore,no_run
6105    /// # use google_cloud_connectors_v1::model::SupportedRuntimeFeatures;
6106    /// let x = SupportedRuntimeFeatures::new().set_sql_query(true);
6107    /// ```
6108    pub fn set_sql_query<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6109        self.sql_query = v.into();
6110        self
6111    }
6112}
6113
6114impl wkt::message::Message for SupportedRuntimeFeatures {
6115    fn typename() -> &'static str {
6116        "type.googleapis.com/google.cloud.connectors.v1.SupportedRuntimeFeatures"
6117    }
6118}
6119
6120/// Egress control config for connector runtime. These configurations define the
6121/// rules to identify which outbound domains/hosts needs to be whitelisted. It
6122/// may be a static information for a particular connector version or it is
6123/// derived from the configurations provided by the customer in Connection
6124/// resource.
6125#[derive(Clone, Default, PartialEq)]
6126#[non_exhaustive]
6127pub struct EgressControlConfig {
6128    pub oneof_backends: std::option::Option<crate::model::egress_control_config::OneofBackends>,
6129
6130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6131}
6132
6133impl EgressControlConfig {
6134    pub fn new() -> Self {
6135        std::default::Default::default()
6136    }
6137
6138    /// Sets the value of [oneof_backends][crate::model::EgressControlConfig::oneof_backends].
6139    ///
6140    /// Note that all the setters affecting `oneof_backends` are mutually
6141    /// exclusive.
6142    ///
6143    /// # Example
6144    /// ```ignore,no_run
6145    /// # use google_cloud_connectors_v1::model::EgressControlConfig;
6146    /// use google_cloud_connectors_v1::model::egress_control_config::OneofBackends;
6147    /// let x = EgressControlConfig::new().set_oneof_backends(Some(OneofBackends::Backends("example".to_string())));
6148    /// ```
6149    pub fn set_oneof_backends<
6150        T: std::convert::Into<std::option::Option<crate::model::egress_control_config::OneofBackends>>,
6151    >(
6152        mut self,
6153        v: T,
6154    ) -> Self {
6155        self.oneof_backends = v.into();
6156        self
6157    }
6158
6159    /// The value of [oneof_backends][crate::model::EgressControlConfig::oneof_backends]
6160    /// if it holds a `Backends`, `None` if the field is not set or
6161    /// holds a different branch.
6162    pub fn backends(&self) -> std::option::Option<&std::string::String> {
6163        #[allow(unreachable_patterns)]
6164        self.oneof_backends.as_ref().and_then(|v| match v {
6165            crate::model::egress_control_config::OneofBackends::Backends(v) => {
6166                std::option::Option::Some(v)
6167            }
6168            _ => std::option::Option::None,
6169        })
6170    }
6171
6172    /// Sets the value of [oneof_backends][crate::model::EgressControlConfig::oneof_backends]
6173    /// to hold a `Backends`.
6174    ///
6175    /// Note that all the setters affecting `oneof_backends` are
6176    /// mutually exclusive.
6177    ///
6178    /// # Example
6179    /// ```ignore,no_run
6180    /// # use google_cloud_connectors_v1::model::EgressControlConfig;
6181    /// let x = EgressControlConfig::new().set_backends("example");
6182    /// assert!(x.backends().is_some());
6183    /// assert!(x.extraction_rules().is_none());
6184    /// ```
6185    pub fn set_backends<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6186        self.oneof_backends = std::option::Option::Some(
6187            crate::model::egress_control_config::OneofBackends::Backends(v.into()),
6188        );
6189        self
6190    }
6191
6192    /// The value of [oneof_backends][crate::model::EgressControlConfig::oneof_backends]
6193    /// if it holds a `ExtractionRules`, `None` if the field is not set or
6194    /// holds a different branch.
6195    pub fn extraction_rules(
6196        &self,
6197    ) -> std::option::Option<&std::boxed::Box<crate::model::ExtractionRules>> {
6198        #[allow(unreachable_patterns)]
6199        self.oneof_backends.as_ref().and_then(|v| match v {
6200            crate::model::egress_control_config::OneofBackends::ExtractionRules(v) => {
6201                std::option::Option::Some(v)
6202            }
6203            _ => std::option::Option::None,
6204        })
6205    }
6206
6207    /// Sets the value of [oneof_backends][crate::model::EgressControlConfig::oneof_backends]
6208    /// to hold a `ExtractionRules`.
6209    ///
6210    /// Note that all the setters affecting `oneof_backends` are
6211    /// mutually exclusive.
6212    ///
6213    /// # Example
6214    /// ```ignore,no_run
6215    /// # use google_cloud_connectors_v1::model::EgressControlConfig;
6216    /// use google_cloud_connectors_v1::model::ExtractionRules;
6217    /// let x = EgressControlConfig::new().set_extraction_rules(ExtractionRules::default()/* use setters */);
6218    /// assert!(x.extraction_rules().is_some());
6219    /// assert!(x.backends().is_none());
6220    /// ```
6221    pub fn set_extraction_rules<
6222        T: std::convert::Into<std::boxed::Box<crate::model::ExtractionRules>>,
6223    >(
6224        mut self,
6225        v: T,
6226    ) -> Self {
6227        self.oneof_backends = std::option::Option::Some(
6228            crate::model::egress_control_config::OneofBackends::ExtractionRules(v.into()),
6229        );
6230        self
6231    }
6232}
6233
6234impl wkt::message::Message for EgressControlConfig {
6235    fn typename() -> &'static str {
6236        "type.googleapis.com/google.cloud.connectors.v1.EgressControlConfig"
6237    }
6238}
6239
6240/// Defines additional types related to [EgressControlConfig].
6241pub mod egress_control_config {
6242    #[allow(unused_imports)]
6243    use super::*;
6244
6245    #[derive(Clone, Debug, PartialEq)]
6246    #[non_exhaustive]
6247    pub enum OneofBackends {
6248        /// Static Comma separated backends which are common for all Connection
6249        /// resources. Supported formats for each backend are host:port or just
6250        /// host (host can be ip address or domain name).
6251        Backends(std::string::String),
6252        /// Extractions Rules to extract the backends from customer provided
6253        /// configuration.
6254        ExtractionRules(std::boxed::Box<crate::model::ExtractionRules>),
6255    }
6256}
6257
6258/// Extraction Rules to identity the backends from customer provided
6259/// configuration in Connection resource.
6260#[derive(Clone, Default, PartialEq)]
6261#[non_exhaustive]
6262pub struct ExtractionRules {
6263    /// Collection of Extraction Rule.
6264    pub extraction_rule: std::vec::Vec<crate::model::ExtractionRule>,
6265
6266    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6267}
6268
6269impl ExtractionRules {
6270    pub fn new() -> Self {
6271        std::default::Default::default()
6272    }
6273
6274    /// Sets the value of [extraction_rule][crate::model::ExtractionRules::extraction_rule].
6275    ///
6276    /// # Example
6277    /// ```ignore,no_run
6278    /// # use google_cloud_connectors_v1::model::ExtractionRules;
6279    /// use google_cloud_connectors_v1::model::ExtractionRule;
6280    /// let x = ExtractionRules::new()
6281    ///     .set_extraction_rule([
6282    ///         ExtractionRule::default()/* use setters */,
6283    ///         ExtractionRule::default()/* use (different) setters */,
6284    ///     ]);
6285    /// ```
6286    pub fn set_extraction_rule<T, V>(mut self, v: T) -> Self
6287    where
6288        T: std::iter::IntoIterator<Item = V>,
6289        V: std::convert::Into<crate::model::ExtractionRule>,
6290    {
6291        use std::iter::Iterator;
6292        self.extraction_rule = v.into_iter().map(|i| i.into()).collect();
6293        self
6294    }
6295}
6296
6297impl wkt::message::Message for ExtractionRules {
6298    fn typename() -> &'static str {
6299        "type.googleapis.com/google.cloud.connectors.v1.ExtractionRules"
6300    }
6301}
6302
6303/// Extraction Rule.
6304#[derive(Clone, Default, PartialEq)]
6305#[non_exhaustive]
6306pub struct ExtractionRule {
6307    /// Source on which the rule is applied.
6308    pub source: std::option::Option<crate::model::extraction_rule::Source>,
6309
6310    /// Regex used to extract backend details from source. If empty, whole source
6311    /// value will be used.
6312    pub extraction_regex: std::string::String,
6313
6314    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6315}
6316
6317impl ExtractionRule {
6318    pub fn new() -> Self {
6319        std::default::Default::default()
6320    }
6321
6322    /// Sets the value of [source][crate::model::ExtractionRule::source].
6323    ///
6324    /// # Example
6325    /// ```ignore,no_run
6326    /// # use google_cloud_connectors_v1::model::ExtractionRule;
6327    /// use google_cloud_connectors_v1::model::extraction_rule::Source;
6328    /// let x = ExtractionRule::new().set_source(Source::default()/* use setters */);
6329    /// ```
6330    pub fn set_source<T>(mut self, v: T) -> Self
6331    where
6332        T: std::convert::Into<crate::model::extraction_rule::Source>,
6333    {
6334        self.source = std::option::Option::Some(v.into());
6335        self
6336    }
6337
6338    /// Sets or clears the value of [source][crate::model::ExtractionRule::source].
6339    ///
6340    /// # Example
6341    /// ```ignore,no_run
6342    /// # use google_cloud_connectors_v1::model::ExtractionRule;
6343    /// use google_cloud_connectors_v1::model::extraction_rule::Source;
6344    /// let x = ExtractionRule::new().set_or_clear_source(Some(Source::default()/* use setters */));
6345    /// let x = ExtractionRule::new().set_or_clear_source(None::<Source>);
6346    /// ```
6347    pub fn set_or_clear_source<T>(mut self, v: std::option::Option<T>) -> Self
6348    where
6349        T: std::convert::Into<crate::model::extraction_rule::Source>,
6350    {
6351        self.source = v.map(|x| x.into());
6352        self
6353    }
6354
6355    /// Sets the value of [extraction_regex][crate::model::ExtractionRule::extraction_regex].
6356    ///
6357    /// # Example
6358    /// ```ignore,no_run
6359    /// # use google_cloud_connectors_v1::model::ExtractionRule;
6360    /// let x = ExtractionRule::new().set_extraction_regex("example");
6361    /// ```
6362    pub fn set_extraction_regex<T: std::convert::Into<std::string::String>>(
6363        mut self,
6364        v: T,
6365    ) -> Self {
6366        self.extraction_regex = v.into();
6367        self
6368    }
6369}
6370
6371impl wkt::message::Message for ExtractionRule {
6372    fn typename() -> &'static str {
6373        "type.googleapis.com/google.cloud.connectors.v1.ExtractionRule"
6374    }
6375}
6376
6377/// Defines additional types related to [ExtractionRule].
6378pub mod extraction_rule {
6379    #[allow(unused_imports)]
6380    use super::*;
6381
6382    /// Source to extract the backend from.
6383    #[derive(Clone, Default, PartialEq)]
6384    #[non_exhaustive]
6385    pub struct Source {
6386        /// Type of the source.
6387        pub source_type: crate::model::extraction_rule::SourceType,
6388
6389        /// Field identifier. For example config vaiable name.
6390        pub field_id: std::string::String,
6391
6392        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6393    }
6394
6395    impl Source {
6396        pub fn new() -> Self {
6397            std::default::Default::default()
6398        }
6399
6400        /// Sets the value of [source_type][crate::model::extraction_rule::Source::source_type].
6401        ///
6402        /// # Example
6403        /// ```ignore,no_run
6404        /// # use google_cloud_connectors_v1::model::extraction_rule::Source;
6405        /// use google_cloud_connectors_v1::model::extraction_rule::SourceType;
6406        /// let x0 = Source::new().set_source_type(SourceType::ConfigVariable);
6407        /// ```
6408        pub fn set_source_type<T: std::convert::Into<crate::model::extraction_rule::SourceType>>(
6409            mut self,
6410            v: T,
6411        ) -> Self {
6412            self.source_type = v.into();
6413            self
6414        }
6415
6416        /// Sets the value of [field_id][crate::model::extraction_rule::Source::field_id].
6417        ///
6418        /// # Example
6419        /// ```ignore,no_run
6420        /// # use google_cloud_connectors_v1::model::extraction_rule::Source;
6421        /// let x = Source::new().set_field_id("example");
6422        /// ```
6423        pub fn set_field_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6424            self.field_id = v.into();
6425            self
6426        }
6427    }
6428
6429    impl wkt::message::Message for Source {
6430        fn typename() -> &'static str {
6431            "type.googleapis.com/google.cloud.connectors.v1.ExtractionRule.Source"
6432        }
6433    }
6434
6435    /// Supported Source types for extraction.
6436    ///
6437    /// # Working with unknown values
6438    ///
6439    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6440    /// additional enum variants at any time. Adding new variants is not considered
6441    /// a breaking change. Applications should write their code in anticipation of:
6442    ///
6443    /// - New values appearing in future releases of the client library, **and**
6444    /// - New values received dynamically, without application changes.
6445    ///
6446    /// Please consult the [Working with enums] section in the user guide for some
6447    /// guidelines.
6448    ///
6449    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6450    #[derive(Clone, Debug, PartialEq)]
6451    #[non_exhaustive]
6452    pub enum SourceType {
6453        /// Default SOURCE.
6454        Unspecified,
6455        /// Config Variable source type.
6456        ConfigVariable,
6457        /// If set, the enum was initialized with an unknown value.
6458        ///
6459        /// Applications can examine the value using [SourceType::value] or
6460        /// [SourceType::name].
6461        UnknownValue(source_type::UnknownValue),
6462    }
6463
6464    #[doc(hidden)]
6465    pub mod source_type {
6466        #[allow(unused_imports)]
6467        use super::*;
6468        #[derive(Clone, Debug, PartialEq)]
6469        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6470    }
6471
6472    impl SourceType {
6473        /// Gets the enum value.
6474        ///
6475        /// Returns `None` if the enum contains an unknown value deserialized from
6476        /// the string representation of enums.
6477        pub fn value(&self) -> std::option::Option<i32> {
6478            match self {
6479                Self::Unspecified => std::option::Option::Some(0),
6480                Self::ConfigVariable => std::option::Option::Some(1),
6481                Self::UnknownValue(u) => u.0.value(),
6482            }
6483        }
6484
6485        /// Gets the enum value as a string.
6486        ///
6487        /// Returns `None` if the enum contains an unknown value deserialized from
6488        /// the integer representation of enums.
6489        pub fn name(&self) -> std::option::Option<&str> {
6490            match self {
6491                Self::Unspecified => std::option::Option::Some("SOURCE_TYPE_UNSPECIFIED"),
6492                Self::ConfigVariable => std::option::Option::Some("CONFIG_VARIABLE"),
6493                Self::UnknownValue(u) => u.0.name(),
6494            }
6495        }
6496    }
6497
6498    impl std::default::Default for SourceType {
6499        fn default() -> Self {
6500            use std::convert::From;
6501            Self::from(0)
6502        }
6503    }
6504
6505    impl std::fmt::Display for SourceType {
6506        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6507            wkt::internal::display_enum(f, self.name(), self.value())
6508        }
6509    }
6510
6511    impl std::convert::From<i32> for SourceType {
6512        fn from(value: i32) -> Self {
6513            match value {
6514                0 => Self::Unspecified,
6515                1 => Self::ConfigVariable,
6516                _ => Self::UnknownValue(source_type::UnknownValue(
6517                    wkt::internal::UnknownEnumValue::Integer(value),
6518                )),
6519            }
6520        }
6521    }
6522
6523    impl std::convert::From<&str> for SourceType {
6524        fn from(value: &str) -> Self {
6525            use std::string::ToString;
6526            match value {
6527                "SOURCE_TYPE_UNSPECIFIED" => Self::Unspecified,
6528                "CONFIG_VARIABLE" => Self::ConfigVariable,
6529                _ => Self::UnknownValue(source_type::UnknownValue(
6530                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6531                )),
6532            }
6533        }
6534    }
6535
6536    impl serde::ser::Serialize for SourceType {
6537        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6538        where
6539            S: serde::Serializer,
6540        {
6541            match self {
6542                Self::Unspecified => serializer.serialize_i32(0),
6543                Self::ConfigVariable => serializer.serialize_i32(1),
6544                Self::UnknownValue(u) => u.0.serialize(serializer),
6545            }
6546        }
6547    }
6548
6549    impl<'de> serde::de::Deserialize<'de> for SourceType {
6550        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6551        where
6552            D: serde::Deserializer<'de>,
6553        {
6554            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SourceType>::new(
6555                ".google.cloud.connectors.v1.ExtractionRule.SourceType",
6556            ))
6557        }
6558    }
6559}
6560
6561/// Define the Connectors target endpoint.
6562#[derive(Clone, Default, PartialEq)]
6563#[non_exhaustive]
6564pub struct DestinationConfig {
6565    /// The key is the destination identifier that is supported by the Connector.
6566    pub key: std::string::String,
6567
6568    /// The destinations for the key.
6569    pub destinations: std::vec::Vec<crate::model::Destination>,
6570
6571    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6572}
6573
6574impl DestinationConfig {
6575    pub fn new() -> Self {
6576        std::default::Default::default()
6577    }
6578
6579    /// Sets the value of [key][crate::model::DestinationConfig::key].
6580    ///
6581    /// # Example
6582    /// ```ignore,no_run
6583    /// # use google_cloud_connectors_v1::model::DestinationConfig;
6584    /// let x = DestinationConfig::new().set_key("example");
6585    /// ```
6586    pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6587        self.key = v.into();
6588        self
6589    }
6590
6591    /// Sets the value of [destinations][crate::model::DestinationConfig::destinations].
6592    ///
6593    /// # Example
6594    /// ```ignore,no_run
6595    /// # use google_cloud_connectors_v1::model::DestinationConfig;
6596    /// use google_cloud_connectors_v1::model::Destination;
6597    /// let x = DestinationConfig::new()
6598    ///     .set_destinations([
6599    ///         Destination::default()/* use setters */,
6600    ///         Destination::default()/* use (different) setters */,
6601    ///     ]);
6602    /// ```
6603    pub fn set_destinations<T, V>(mut self, v: T) -> Self
6604    where
6605        T: std::iter::IntoIterator<Item = V>,
6606        V: std::convert::Into<crate::model::Destination>,
6607    {
6608        use std::iter::Iterator;
6609        self.destinations = v.into_iter().map(|i| i.into()).collect();
6610        self
6611    }
6612}
6613
6614impl wkt::message::Message for DestinationConfig {
6615    fn typename() -> &'static str {
6616        "type.googleapis.com/google.cloud.connectors.v1.DestinationConfig"
6617    }
6618}
6619
6620#[derive(Clone, Default, PartialEq)]
6621#[non_exhaustive]
6622pub struct Destination {
6623    /// The port is the target port number that is accepted by the destination.
6624    pub port: i32,
6625
6626    pub destination: std::option::Option<crate::model::destination::Destination>,
6627
6628    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6629}
6630
6631impl Destination {
6632    pub fn new() -> Self {
6633        std::default::Default::default()
6634    }
6635
6636    /// Sets the value of [port][crate::model::Destination::port].
6637    ///
6638    /// # Example
6639    /// ```ignore,no_run
6640    /// # use google_cloud_connectors_v1::model::Destination;
6641    /// let x = Destination::new().set_port(42);
6642    /// ```
6643    pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6644        self.port = v.into();
6645        self
6646    }
6647
6648    /// Sets the value of [destination][crate::model::Destination::destination].
6649    ///
6650    /// Note that all the setters affecting `destination` are mutually
6651    /// exclusive.
6652    ///
6653    /// # Example
6654    /// ```ignore,no_run
6655    /// # use google_cloud_connectors_v1::model::Destination;
6656    /// use google_cloud_connectors_v1::model::destination::Destination as DestinationOneOf;
6657    /// let x = Destination::new().set_destination(Some(DestinationOneOf::ServiceAttachment("example".to_string())));
6658    /// ```
6659    pub fn set_destination<
6660        T: std::convert::Into<std::option::Option<crate::model::destination::Destination>>,
6661    >(
6662        mut self,
6663        v: T,
6664    ) -> Self {
6665        self.destination = v.into();
6666        self
6667    }
6668
6669    /// The value of [destination][crate::model::Destination::destination]
6670    /// if it holds a `ServiceAttachment`, `None` if the field is not set or
6671    /// holds a different branch.
6672    pub fn service_attachment(&self) -> std::option::Option<&std::string::String> {
6673        #[allow(unreachable_patterns)]
6674        self.destination.as_ref().and_then(|v| match v {
6675            crate::model::destination::Destination::ServiceAttachment(v) => {
6676                std::option::Option::Some(v)
6677            }
6678            _ => std::option::Option::None,
6679        })
6680    }
6681
6682    /// Sets the value of [destination][crate::model::Destination::destination]
6683    /// to hold a `ServiceAttachment`.
6684    ///
6685    /// Note that all the setters affecting `destination` are
6686    /// mutually exclusive.
6687    ///
6688    /// # Example
6689    /// ```ignore,no_run
6690    /// # use google_cloud_connectors_v1::model::Destination;
6691    /// let x = Destination::new().set_service_attachment("example");
6692    /// assert!(x.service_attachment().is_some());
6693    /// assert!(x.host().is_none());
6694    /// ```
6695    pub fn set_service_attachment<T: std::convert::Into<std::string::String>>(
6696        mut self,
6697        v: T,
6698    ) -> Self {
6699        self.destination = std::option::Option::Some(
6700            crate::model::destination::Destination::ServiceAttachment(v.into()),
6701        );
6702        self
6703    }
6704
6705    /// The value of [destination][crate::model::Destination::destination]
6706    /// if it holds a `Host`, `None` if the field is not set or
6707    /// holds a different branch.
6708    pub fn host(&self) -> std::option::Option<&std::string::String> {
6709        #[allow(unreachable_patterns)]
6710        self.destination.as_ref().and_then(|v| match v {
6711            crate::model::destination::Destination::Host(v) => std::option::Option::Some(v),
6712            _ => std::option::Option::None,
6713        })
6714    }
6715
6716    /// Sets the value of [destination][crate::model::Destination::destination]
6717    /// to hold a `Host`.
6718    ///
6719    /// Note that all the setters affecting `destination` are
6720    /// mutually exclusive.
6721    ///
6722    /// # Example
6723    /// ```ignore,no_run
6724    /// # use google_cloud_connectors_v1::model::Destination;
6725    /// let x = Destination::new().set_host("example");
6726    /// assert!(x.host().is_some());
6727    /// assert!(x.service_attachment().is_none());
6728    /// ```
6729    pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6730        self.destination =
6731            std::option::Option::Some(crate::model::destination::Destination::Host(v.into()));
6732        self
6733    }
6734}
6735
6736impl wkt::message::Message for Destination {
6737    fn typename() -> &'static str {
6738        "type.googleapis.com/google.cloud.connectors.v1.Destination"
6739    }
6740}
6741
6742/// Defines additional types related to [Destination].
6743pub mod destination {
6744    #[allow(unused_imports)]
6745    use super::*;
6746
6747    #[derive(Clone, Debug, PartialEq)]
6748    #[non_exhaustive]
6749    pub enum Destination {
6750        /// PSC service attachments.
6751        /// Format: projects/*/regions/*/serviceAttachments/*
6752        ServiceAttachment(std::string::String),
6753        /// For publicly routable host.
6754        Host(std::string::String),
6755    }
6756}
6757
6758/// Provider indicates the owner who provides the connectors.
6759#[derive(Clone, Default, PartialEq)]
6760#[non_exhaustive]
6761pub struct Provider {
6762    /// Output only. Resource name of the Provider.
6763    /// Format: projects/{project}/locations/{location}/providers/{provider}
6764    /// Only global location is supported for Provider resource.
6765    pub name: std::string::String,
6766
6767    /// Output only. Created time.
6768    pub create_time: std::option::Option<wkt::Timestamp>,
6769
6770    /// Output only. Updated time.
6771    pub update_time: std::option::Option<wkt::Timestamp>,
6772
6773    /// Output only. Resource labels to represent user-provided metadata.
6774    /// Refer to cloud documentation on labels for more details.
6775    /// <https://cloud.google.com/compute/docs/labeling-resources>
6776    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6777
6778    /// Output only. Link to documentation page.
6779    pub documentation_uri: std::string::String,
6780
6781    /// Output only. Link to external page.
6782    pub external_uri: std::string::String,
6783
6784    /// Output only. Description of the resource.
6785    pub description: std::string::String,
6786
6787    /// Output only. Cloud storage location of icons etc consumed by UI.
6788    pub web_assets_location: std::string::String,
6789
6790    /// Output only. Display name.
6791    pub display_name: std::string::String,
6792
6793    /// Output only. Flag to mark the version indicating the launch stage.
6794    pub launch_stage: crate::model::LaunchStage,
6795
6796    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6797}
6798
6799impl Provider {
6800    pub fn new() -> Self {
6801        std::default::Default::default()
6802    }
6803
6804    /// Sets the value of [name][crate::model::Provider::name].
6805    ///
6806    /// # Example
6807    /// ```ignore,no_run
6808    /// # use google_cloud_connectors_v1::model::Provider;
6809    /// let x = Provider::new().set_name("example");
6810    /// ```
6811    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6812        self.name = v.into();
6813        self
6814    }
6815
6816    /// Sets the value of [create_time][crate::model::Provider::create_time].
6817    ///
6818    /// # Example
6819    /// ```ignore,no_run
6820    /// # use google_cloud_connectors_v1::model::Provider;
6821    /// use wkt::Timestamp;
6822    /// let x = Provider::new().set_create_time(Timestamp::default()/* use setters */);
6823    /// ```
6824    pub fn set_create_time<T>(mut self, v: T) -> Self
6825    where
6826        T: std::convert::Into<wkt::Timestamp>,
6827    {
6828        self.create_time = std::option::Option::Some(v.into());
6829        self
6830    }
6831
6832    /// Sets or clears the value of [create_time][crate::model::Provider::create_time].
6833    ///
6834    /// # Example
6835    /// ```ignore,no_run
6836    /// # use google_cloud_connectors_v1::model::Provider;
6837    /// use wkt::Timestamp;
6838    /// let x = Provider::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6839    /// let x = Provider::new().set_or_clear_create_time(None::<Timestamp>);
6840    /// ```
6841    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6842    where
6843        T: std::convert::Into<wkt::Timestamp>,
6844    {
6845        self.create_time = v.map(|x| x.into());
6846        self
6847    }
6848
6849    /// Sets the value of [update_time][crate::model::Provider::update_time].
6850    ///
6851    /// # Example
6852    /// ```ignore,no_run
6853    /// # use google_cloud_connectors_v1::model::Provider;
6854    /// use wkt::Timestamp;
6855    /// let x = Provider::new().set_update_time(Timestamp::default()/* use setters */);
6856    /// ```
6857    pub fn set_update_time<T>(mut self, v: T) -> Self
6858    where
6859        T: std::convert::Into<wkt::Timestamp>,
6860    {
6861        self.update_time = std::option::Option::Some(v.into());
6862        self
6863    }
6864
6865    /// Sets or clears the value of [update_time][crate::model::Provider::update_time].
6866    ///
6867    /// # Example
6868    /// ```ignore,no_run
6869    /// # use google_cloud_connectors_v1::model::Provider;
6870    /// use wkt::Timestamp;
6871    /// let x = Provider::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6872    /// let x = Provider::new().set_or_clear_update_time(None::<Timestamp>);
6873    /// ```
6874    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6875    where
6876        T: std::convert::Into<wkt::Timestamp>,
6877    {
6878        self.update_time = v.map(|x| x.into());
6879        self
6880    }
6881
6882    /// Sets the value of [labels][crate::model::Provider::labels].
6883    ///
6884    /// # Example
6885    /// ```ignore,no_run
6886    /// # use google_cloud_connectors_v1::model::Provider;
6887    /// let x = Provider::new().set_labels([
6888    ///     ("key0", "abc"),
6889    ///     ("key1", "xyz"),
6890    /// ]);
6891    /// ```
6892    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6893    where
6894        T: std::iter::IntoIterator<Item = (K, V)>,
6895        K: std::convert::Into<std::string::String>,
6896        V: std::convert::Into<std::string::String>,
6897    {
6898        use std::iter::Iterator;
6899        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6900        self
6901    }
6902
6903    /// Sets the value of [documentation_uri][crate::model::Provider::documentation_uri].
6904    ///
6905    /// # Example
6906    /// ```ignore,no_run
6907    /// # use google_cloud_connectors_v1::model::Provider;
6908    /// let x = Provider::new().set_documentation_uri("example");
6909    /// ```
6910    pub fn set_documentation_uri<T: std::convert::Into<std::string::String>>(
6911        mut self,
6912        v: T,
6913    ) -> Self {
6914        self.documentation_uri = v.into();
6915        self
6916    }
6917
6918    /// Sets the value of [external_uri][crate::model::Provider::external_uri].
6919    ///
6920    /// # Example
6921    /// ```ignore,no_run
6922    /// # use google_cloud_connectors_v1::model::Provider;
6923    /// let x = Provider::new().set_external_uri("example");
6924    /// ```
6925    pub fn set_external_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6926        self.external_uri = v.into();
6927        self
6928    }
6929
6930    /// Sets the value of [description][crate::model::Provider::description].
6931    ///
6932    /// # Example
6933    /// ```ignore,no_run
6934    /// # use google_cloud_connectors_v1::model::Provider;
6935    /// let x = Provider::new().set_description("example");
6936    /// ```
6937    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6938        self.description = v.into();
6939        self
6940    }
6941
6942    /// Sets the value of [web_assets_location][crate::model::Provider::web_assets_location].
6943    ///
6944    /// # Example
6945    /// ```ignore,no_run
6946    /// # use google_cloud_connectors_v1::model::Provider;
6947    /// let x = Provider::new().set_web_assets_location("example");
6948    /// ```
6949    pub fn set_web_assets_location<T: std::convert::Into<std::string::String>>(
6950        mut self,
6951        v: T,
6952    ) -> Self {
6953        self.web_assets_location = v.into();
6954        self
6955    }
6956
6957    /// Sets the value of [display_name][crate::model::Provider::display_name].
6958    ///
6959    /// # Example
6960    /// ```ignore,no_run
6961    /// # use google_cloud_connectors_v1::model::Provider;
6962    /// let x = Provider::new().set_display_name("example");
6963    /// ```
6964    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6965        self.display_name = v.into();
6966        self
6967    }
6968
6969    /// Sets the value of [launch_stage][crate::model::Provider::launch_stage].
6970    ///
6971    /// # Example
6972    /// ```ignore,no_run
6973    /// # use google_cloud_connectors_v1::model::Provider;
6974    /// use google_cloud_connectors_v1::model::LaunchStage;
6975    /// let x0 = Provider::new().set_launch_stage(LaunchStage::Preview);
6976    /// let x1 = Provider::new().set_launch_stage(LaunchStage::Ga);
6977    /// let x2 = Provider::new().set_launch_stage(LaunchStage::Deprecated);
6978    /// ```
6979    pub fn set_launch_stage<T: std::convert::Into<crate::model::LaunchStage>>(
6980        mut self,
6981        v: T,
6982    ) -> Self {
6983        self.launch_stage = v.into();
6984        self
6985    }
6986}
6987
6988impl wkt::message::Message for Provider {
6989    fn typename() -> &'static str {
6990        "type.googleapis.com/google.cloud.connectors.v1.Provider"
6991    }
6992}
6993
6994/// Request message for Connectors.GetProvider.
6995#[derive(Clone, Default, PartialEq)]
6996#[non_exhaustive]
6997pub struct GetProviderRequest {
6998    /// Required. Resource name of the form:
6999    /// `projects/*/locations/*/providers/*`
7000    /// Only global location is supported for Provider resource.
7001    pub name: std::string::String,
7002
7003    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7004}
7005
7006impl GetProviderRequest {
7007    pub fn new() -> Self {
7008        std::default::Default::default()
7009    }
7010
7011    /// Sets the value of [name][crate::model::GetProviderRequest::name].
7012    ///
7013    /// # Example
7014    /// ```ignore,no_run
7015    /// # use google_cloud_connectors_v1::model::GetProviderRequest;
7016    /// let x = GetProviderRequest::new().set_name("example");
7017    /// ```
7018    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7019        self.name = v.into();
7020        self
7021    }
7022}
7023
7024impl wkt::message::Message for GetProviderRequest {
7025    fn typename() -> &'static str {
7026        "type.googleapis.com/google.cloud.connectors.v1.GetProviderRequest"
7027    }
7028}
7029
7030/// Request message for Connectors.ListProviders.
7031#[derive(Clone, Default, PartialEq)]
7032#[non_exhaustive]
7033pub struct ListProvidersRequest {
7034    /// Required. Parent resource of the API, of the form:
7035    /// `projects/*/locations/*`
7036    /// Only global location is supported for Provider resource.
7037    pub parent: std::string::String,
7038
7039    /// Page size.
7040    pub page_size: i32,
7041
7042    /// Page token.
7043    pub page_token: std::string::String,
7044
7045    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7046}
7047
7048impl ListProvidersRequest {
7049    pub fn new() -> Self {
7050        std::default::Default::default()
7051    }
7052
7053    /// Sets the value of [parent][crate::model::ListProvidersRequest::parent].
7054    ///
7055    /// # Example
7056    /// ```ignore,no_run
7057    /// # use google_cloud_connectors_v1::model::ListProvidersRequest;
7058    /// let x = ListProvidersRequest::new().set_parent("example");
7059    /// ```
7060    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7061        self.parent = v.into();
7062        self
7063    }
7064
7065    /// Sets the value of [page_size][crate::model::ListProvidersRequest::page_size].
7066    ///
7067    /// # Example
7068    /// ```ignore,no_run
7069    /// # use google_cloud_connectors_v1::model::ListProvidersRequest;
7070    /// let x = ListProvidersRequest::new().set_page_size(42);
7071    /// ```
7072    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7073        self.page_size = v.into();
7074        self
7075    }
7076
7077    /// Sets the value of [page_token][crate::model::ListProvidersRequest::page_token].
7078    ///
7079    /// # Example
7080    /// ```ignore,no_run
7081    /// # use google_cloud_connectors_v1::model::ListProvidersRequest;
7082    /// let x = ListProvidersRequest::new().set_page_token("example");
7083    /// ```
7084    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7085        self.page_token = v.into();
7086        self
7087    }
7088}
7089
7090impl wkt::message::Message for ListProvidersRequest {
7091    fn typename() -> &'static str {
7092        "type.googleapis.com/google.cloud.connectors.v1.ListProvidersRequest"
7093    }
7094}
7095
7096/// Response message for Connectors.ListProviders.
7097#[derive(Clone, Default, PartialEq)]
7098#[non_exhaustive]
7099pub struct ListProvidersResponse {
7100    /// A list of providers.
7101    pub providers: std::vec::Vec<crate::model::Provider>,
7102
7103    /// Next page token.
7104    pub next_page_token: std::string::String,
7105
7106    /// Locations that could not be reached.
7107    pub unreachable: std::vec::Vec<std::string::String>,
7108
7109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7110}
7111
7112impl ListProvidersResponse {
7113    pub fn new() -> Self {
7114        std::default::Default::default()
7115    }
7116
7117    /// Sets the value of [providers][crate::model::ListProvidersResponse::providers].
7118    ///
7119    /// # Example
7120    /// ```ignore,no_run
7121    /// # use google_cloud_connectors_v1::model::ListProvidersResponse;
7122    /// use google_cloud_connectors_v1::model::Provider;
7123    /// let x = ListProvidersResponse::new()
7124    ///     .set_providers([
7125    ///         Provider::default()/* use setters */,
7126    ///         Provider::default()/* use (different) setters */,
7127    ///     ]);
7128    /// ```
7129    pub fn set_providers<T, V>(mut self, v: T) -> Self
7130    where
7131        T: std::iter::IntoIterator<Item = V>,
7132        V: std::convert::Into<crate::model::Provider>,
7133    {
7134        use std::iter::Iterator;
7135        self.providers = v.into_iter().map(|i| i.into()).collect();
7136        self
7137    }
7138
7139    /// Sets the value of [next_page_token][crate::model::ListProvidersResponse::next_page_token].
7140    ///
7141    /// # Example
7142    /// ```ignore,no_run
7143    /// # use google_cloud_connectors_v1::model::ListProvidersResponse;
7144    /// let x = ListProvidersResponse::new().set_next_page_token("example");
7145    /// ```
7146    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7147        self.next_page_token = v.into();
7148        self
7149    }
7150
7151    /// Sets the value of [unreachable][crate::model::ListProvidersResponse::unreachable].
7152    ///
7153    /// # Example
7154    /// ```ignore,no_run
7155    /// # use google_cloud_connectors_v1::model::ListProvidersResponse;
7156    /// let x = ListProvidersResponse::new().set_unreachable(["a", "b", "c"]);
7157    /// ```
7158    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7159    where
7160        T: std::iter::IntoIterator<Item = V>,
7161        V: std::convert::Into<std::string::String>,
7162    {
7163        use std::iter::Iterator;
7164        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7165        self
7166    }
7167}
7168
7169impl wkt::message::Message for ListProvidersResponse {
7170    fn typename() -> &'static str {
7171        "type.googleapis.com/google.cloud.connectors.v1.ListProvidersResponse"
7172    }
7173}
7174
7175#[doc(hidden)]
7176impl google_cloud_gax::paginator::internal::PageableResponse for ListProvidersResponse {
7177    type PageItem = crate::model::Provider;
7178
7179    fn items(self) -> std::vec::Vec<Self::PageItem> {
7180        self.providers
7181    }
7182
7183    fn next_page_token(&self) -> std::string::String {
7184        use std::clone::Clone;
7185        self.next_page_token.clone()
7186    }
7187}
7188
7189/// Request message for Connectors.GetRuntimeConfig.
7190#[derive(Clone, Default, PartialEq)]
7191#[non_exhaustive]
7192pub struct GetRuntimeConfigRequest {
7193    /// Required. Resource name of the form:
7194    /// `projects/*/locations/*/runtimeConfig`
7195    pub name: std::string::String,
7196
7197    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7198}
7199
7200impl GetRuntimeConfigRequest {
7201    pub fn new() -> Self {
7202        std::default::Default::default()
7203    }
7204
7205    /// Sets the value of [name][crate::model::GetRuntimeConfigRequest::name].
7206    ///
7207    /// # Example
7208    /// ```ignore,no_run
7209    /// # use google_cloud_connectors_v1::model::GetRuntimeConfigRequest;
7210    /// let x = GetRuntimeConfigRequest::new().set_name("example");
7211    /// ```
7212    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7213        self.name = v.into();
7214        self
7215    }
7216}
7217
7218impl wkt::message::Message for GetRuntimeConfigRequest {
7219    fn typename() -> &'static str {
7220        "type.googleapis.com/google.cloud.connectors.v1.GetRuntimeConfigRequest"
7221    }
7222}
7223
7224/// RuntimeConfig is the singleton resource of each location.
7225/// It includes generic resource configs consumed by control plane and runtime
7226/// plane like: pub/sub topic/subscription resource name, Cloud Storage location
7227/// storing schema etc.
7228#[derive(Clone, Default, PartialEq)]
7229#[non_exhaustive]
7230pub struct RuntimeConfig {
7231    /// Output only. location_id of the runtime location. E.g. "us-west1".
7232    pub location_id: std::string::String,
7233
7234    /// Output only. Pub/Sub topic for connd to send message.
7235    /// E.g. projects/{project-id}/topics/{topic-id}
7236    pub connd_topic: std::string::String,
7237
7238    /// Output only. Pub/Sub subscription for connd to receive message.
7239    /// E.g. projects/{project-id}/subscriptions/{topic-id}
7240    pub connd_subscription: std::string::String,
7241
7242    /// Output only. Pub/Sub topic for control plne to send message.
7243    /// communication.
7244    /// E.g. projects/{project-id}/topics/{topic-id}
7245    pub control_plane_topic: std::string::String,
7246
7247    /// Output only. Pub/Sub subscription for control plane to receive message.
7248    /// E.g. projects/{project-id}/subscriptions/{topic-id}
7249    pub control_plane_subscription: std::string::String,
7250
7251    /// Output only. The endpoint of the connectors runtime ingress.
7252    pub runtime_endpoint: std::string::String,
7253
7254    /// Output only. The state of the location.
7255    pub state: crate::model::runtime_config::State,
7256
7257    /// Output only. The Cloud Storage bucket that stores connector's schema
7258    /// reports.
7259    pub schema_gcs_bucket: std::string::String,
7260
7261    /// Output only. The name of the Service Directory service name.
7262    pub service_directory: std::string::String,
7263
7264    /// Output only. Name of the runtimeConfig resource.
7265    /// Format: projects/{project}/locations/{location}/runtimeConfig
7266    pub name: std::string::String,
7267
7268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7269}
7270
7271impl RuntimeConfig {
7272    pub fn new() -> Self {
7273        std::default::Default::default()
7274    }
7275
7276    /// Sets the value of [location_id][crate::model::RuntimeConfig::location_id].
7277    ///
7278    /// # Example
7279    /// ```ignore,no_run
7280    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7281    /// let x = RuntimeConfig::new().set_location_id("example");
7282    /// ```
7283    pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7284        self.location_id = v.into();
7285        self
7286    }
7287
7288    /// Sets the value of [connd_topic][crate::model::RuntimeConfig::connd_topic].
7289    ///
7290    /// # Example
7291    /// ```ignore,no_run
7292    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7293    /// let x = RuntimeConfig::new().set_connd_topic("example");
7294    /// ```
7295    pub fn set_connd_topic<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7296        self.connd_topic = v.into();
7297        self
7298    }
7299
7300    /// Sets the value of [connd_subscription][crate::model::RuntimeConfig::connd_subscription].
7301    ///
7302    /// # Example
7303    /// ```ignore,no_run
7304    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7305    /// let x = RuntimeConfig::new().set_connd_subscription("example");
7306    /// ```
7307    pub fn set_connd_subscription<T: std::convert::Into<std::string::String>>(
7308        mut self,
7309        v: T,
7310    ) -> Self {
7311        self.connd_subscription = v.into();
7312        self
7313    }
7314
7315    /// Sets the value of [control_plane_topic][crate::model::RuntimeConfig::control_plane_topic].
7316    ///
7317    /// # Example
7318    /// ```ignore,no_run
7319    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7320    /// let x = RuntimeConfig::new().set_control_plane_topic("example");
7321    /// ```
7322    pub fn set_control_plane_topic<T: std::convert::Into<std::string::String>>(
7323        mut self,
7324        v: T,
7325    ) -> Self {
7326        self.control_plane_topic = v.into();
7327        self
7328    }
7329
7330    /// Sets the value of [control_plane_subscription][crate::model::RuntimeConfig::control_plane_subscription].
7331    ///
7332    /// # Example
7333    /// ```ignore,no_run
7334    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7335    /// let x = RuntimeConfig::new().set_control_plane_subscription("example");
7336    /// ```
7337    pub fn set_control_plane_subscription<T: std::convert::Into<std::string::String>>(
7338        mut self,
7339        v: T,
7340    ) -> Self {
7341        self.control_plane_subscription = v.into();
7342        self
7343    }
7344
7345    /// Sets the value of [runtime_endpoint][crate::model::RuntimeConfig::runtime_endpoint].
7346    ///
7347    /// # Example
7348    /// ```ignore,no_run
7349    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7350    /// let x = RuntimeConfig::new().set_runtime_endpoint("example");
7351    /// ```
7352    pub fn set_runtime_endpoint<T: std::convert::Into<std::string::String>>(
7353        mut self,
7354        v: T,
7355    ) -> Self {
7356        self.runtime_endpoint = v.into();
7357        self
7358    }
7359
7360    /// Sets the value of [state][crate::model::RuntimeConfig::state].
7361    ///
7362    /// # Example
7363    /// ```ignore,no_run
7364    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7365    /// use google_cloud_connectors_v1::model::runtime_config::State;
7366    /// let x0 = RuntimeConfig::new().set_state(State::Active);
7367    /// let x1 = RuntimeConfig::new().set_state(State::Creating);
7368    /// let x2 = RuntimeConfig::new().set_state(State::Deleting);
7369    /// ```
7370    pub fn set_state<T: std::convert::Into<crate::model::runtime_config::State>>(
7371        mut self,
7372        v: T,
7373    ) -> Self {
7374        self.state = v.into();
7375        self
7376    }
7377
7378    /// Sets the value of [schema_gcs_bucket][crate::model::RuntimeConfig::schema_gcs_bucket].
7379    ///
7380    /// # Example
7381    /// ```ignore,no_run
7382    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7383    /// let x = RuntimeConfig::new().set_schema_gcs_bucket("example");
7384    /// ```
7385    pub fn set_schema_gcs_bucket<T: std::convert::Into<std::string::String>>(
7386        mut self,
7387        v: T,
7388    ) -> Self {
7389        self.schema_gcs_bucket = v.into();
7390        self
7391    }
7392
7393    /// Sets the value of [service_directory][crate::model::RuntimeConfig::service_directory].
7394    ///
7395    /// # Example
7396    /// ```ignore,no_run
7397    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7398    /// let x = RuntimeConfig::new().set_service_directory("example");
7399    /// ```
7400    pub fn set_service_directory<T: std::convert::Into<std::string::String>>(
7401        mut self,
7402        v: T,
7403    ) -> Self {
7404        self.service_directory = v.into();
7405        self
7406    }
7407
7408    /// Sets the value of [name][crate::model::RuntimeConfig::name].
7409    ///
7410    /// # Example
7411    /// ```ignore,no_run
7412    /// # use google_cloud_connectors_v1::model::RuntimeConfig;
7413    /// let x = RuntimeConfig::new().set_name("example");
7414    /// ```
7415    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7416        self.name = v.into();
7417        self
7418    }
7419}
7420
7421impl wkt::message::Message for RuntimeConfig {
7422    fn typename() -> &'static str {
7423        "type.googleapis.com/google.cloud.connectors.v1.RuntimeConfig"
7424    }
7425}
7426
7427/// Defines additional types related to [RuntimeConfig].
7428pub mod runtime_config {
7429    #[allow(unused_imports)]
7430    use super::*;
7431
7432    /// State of the location.
7433    ///
7434    /// # Working with unknown values
7435    ///
7436    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7437    /// additional enum variants at any time. Adding new variants is not considered
7438    /// a breaking change. Applications should write their code in anticipation of:
7439    ///
7440    /// - New values appearing in future releases of the client library, **and**
7441    /// - New values received dynamically, without application changes.
7442    ///
7443    /// Please consult the [Working with enums] section in the user guide for some
7444    /// guidelines.
7445    ///
7446    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7447    #[derive(Clone, Debug, PartialEq)]
7448    #[non_exhaustive]
7449    pub enum State {
7450        /// STATE_UNSPECIFIED.
7451        Unspecified,
7452        /// INACTIVE.
7453        #[deprecated]
7454        Inactive,
7455        /// ACTIVATING.
7456        #[deprecated]
7457        Activating,
7458        /// ACTIVE.
7459        Active,
7460        /// CREATING.
7461        Creating,
7462        /// DELETING.
7463        Deleting,
7464        /// UPDATING.
7465        Updating,
7466        /// If set, the enum was initialized with an unknown value.
7467        ///
7468        /// Applications can examine the value using [State::value] or
7469        /// [State::name].
7470        UnknownValue(state::UnknownValue),
7471    }
7472
7473    #[doc(hidden)]
7474    pub mod state {
7475        #[allow(unused_imports)]
7476        use super::*;
7477        #[derive(Clone, Debug, PartialEq)]
7478        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7479    }
7480
7481    impl State {
7482        /// Gets the enum value.
7483        ///
7484        /// Returns `None` if the enum contains an unknown value deserialized from
7485        /// the string representation of enums.
7486        pub fn value(&self) -> std::option::Option<i32> {
7487            match self {
7488                Self::Unspecified => std::option::Option::Some(0),
7489                Self::Inactive => std::option::Option::Some(1),
7490                Self::Activating => std::option::Option::Some(2),
7491                Self::Active => std::option::Option::Some(3),
7492                Self::Creating => std::option::Option::Some(4),
7493                Self::Deleting => std::option::Option::Some(5),
7494                Self::Updating => std::option::Option::Some(6),
7495                Self::UnknownValue(u) => u.0.value(),
7496            }
7497        }
7498
7499        /// Gets the enum value as a string.
7500        ///
7501        /// Returns `None` if the enum contains an unknown value deserialized from
7502        /// the integer representation of enums.
7503        pub fn name(&self) -> std::option::Option<&str> {
7504            match self {
7505                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7506                Self::Inactive => std::option::Option::Some("INACTIVE"),
7507                Self::Activating => std::option::Option::Some("ACTIVATING"),
7508                Self::Active => std::option::Option::Some("ACTIVE"),
7509                Self::Creating => std::option::Option::Some("CREATING"),
7510                Self::Deleting => std::option::Option::Some("DELETING"),
7511                Self::Updating => std::option::Option::Some("UPDATING"),
7512                Self::UnknownValue(u) => u.0.name(),
7513            }
7514        }
7515    }
7516
7517    impl std::default::Default for State {
7518        fn default() -> Self {
7519            use std::convert::From;
7520            Self::from(0)
7521        }
7522    }
7523
7524    impl std::fmt::Display for State {
7525        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7526            wkt::internal::display_enum(f, self.name(), self.value())
7527        }
7528    }
7529
7530    impl std::convert::From<i32> for State {
7531        fn from(value: i32) -> Self {
7532            match value {
7533                0 => Self::Unspecified,
7534                1 => Self::Inactive,
7535                2 => Self::Activating,
7536                3 => Self::Active,
7537                4 => Self::Creating,
7538                5 => Self::Deleting,
7539                6 => Self::Updating,
7540                _ => Self::UnknownValue(state::UnknownValue(
7541                    wkt::internal::UnknownEnumValue::Integer(value),
7542                )),
7543            }
7544        }
7545    }
7546
7547    impl std::convert::From<&str> for State {
7548        fn from(value: &str) -> Self {
7549            use std::string::ToString;
7550            match value {
7551                "STATE_UNSPECIFIED" => Self::Unspecified,
7552                "INACTIVE" => Self::Inactive,
7553                "ACTIVATING" => Self::Activating,
7554                "ACTIVE" => Self::Active,
7555                "CREATING" => Self::Creating,
7556                "DELETING" => Self::Deleting,
7557                "UPDATING" => Self::Updating,
7558                _ => Self::UnknownValue(state::UnknownValue(
7559                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7560                )),
7561            }
7562        }
7563    }
7564
7565    impl serde::ser::Serialize for State {
7566        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7567        where
7568            S: serde::Serializer,
7569        {
7570            match self {
7571                Self::Unspecified => serializer.serialize_i32(0),
7572                Self::Inactive => serializer.serialize_i32(1),
7573                Self::Activating => serializer.serialize_i32(2),
7574                Self::Active => serializer.serialize_i32(3),
7575                Self::Creating => serializer.serialize_i32(4),
7576                Self::Deleting => serializer.serialize_i32(5),
7577                Self::Updating => serializer.serialize_i32(6),
7578                Self::UnknownValue(u) => u.0.serialize(serializer),
7579            }
7580        }
7581    }
7582
7583    impl<'de> serde::de::Deserialize<'de> for State {
7584        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7585        where
7586            D: serde::Deserializer<'de>,
7587        {
7588            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7589                ".google.cloud.connectors.v1.RuntimeConfig.State",
7590            ))
7591        }
7592    }
7593}
7594
7595/// Request for [GetGlobalSettingsRequest].
7596#[derive(Clone, Default, PartialEq)]
7597#[non_exhaustive]
7598pub struct GetGlobalSettingsRequest {
7599    /// Required. The resource name of the Settings.
7600    pub name: std::string::String,
7601
7602    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7603}
7604
7605impl GetGlobalSettingsRequest {
7606    pub fn new() -> Self {
7607        std::default::Default::default()
7608    }
7609
7610    /// Sets the value of [name][crate::model::GetGlobalSettingsRequest::name].
7611    ///
7612    /// # Example
7613    /// ```ignore,no_run
7614    /// # use google_cloud_connectors_v1::model::GetGlobalSettingsRequest;
7615    /// let x = GetGlobalSettingsRequest::new().set_name("example");
7616    /// ```
7617    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7618        self.name = v.into();
7619        self
7620    }
7621}
7622
7623impl wkt::message::Message for GetGlobalSettingsRequest {
7624    fn typename() -> &'static str {
7625        "type.googleapis.com/google.cloud.connectors.v1.GetGlobalSettingsRequest"
7626    }
7627}
7628
7629/// Global Settings details.
7630#[derive(Clone, Default, PartialEq)]
7631#[non_exhaustive]
7632pub struct Settings {
7633    /// Output only. Resource name of the Connection.
7634    /// Format: projects/{project}/locations/global/settings}
7635    pub name: std::string::String,
7636
7637    /// Optional. Flag indicates whether vpc-sc is enabled.
7638    pub vpcsc: bool,
7639
7640    /// Output only. Flag indicates if user is in PayG model
7641    pub payg: bool,
7642
7643    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7644}
7645
7646impl Settings {
7647    pub fn new() -> Self {
7648        std::default::Default::default()
7649    }
7650
7651    /// Sets the value of [name][crate::model::Settings::name].
7652    ///
7653    /// # Example
7654    /// ```ignore,no_run
7655    /// # use google_cloud_connectors_v1::model::Settings;
7656    /// let x = Settings::new().set_name("example");
7657    /// ```
7658    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7659        self.name = v.into();
7660        self
7661    }
7662
7663    /// Sets the value of [vpcsc][crate::model::Settings::vpcsc].
7664    ///
7665    /// # Example
7666    /// ```ignore,no_run
7667    /// # use google_cloud_connectors_v1::model::Settings;
7668    /// let x = Settings::new().set_vpcsc(true);
7669    /// ```
7670    pub fn set_vpcsc<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7671        self.vpcsc = v.into();
7672        self
7673    }
7674
7675    /// Sets the value of [payg][crate::model::Settings::payg].
7676    ///
7677    /// # Example
7678    /// ```ignore,no_run
7679    /// # use google_cloud_connectors_v1::model::Settings;
7680    /// let x = Settings::new().set_payg(true);
7681    /// ```
7682    pub fn set_payg<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7683        self.payg = v.into();
7684        self
7685    }
7686}
7687
7688impl wkt::message::Message for Settings {
7689    fn typename() -> &'static str {
7690        "type.googleapis.com/google.cloud.connectors.v1.Settings"
7691    }
7692}
7693
7694/// Ssl config details of a connector version
7695#[derive(Clone, Default, PartialEq)]
7696#[non_exhaustive]
7697pub struct SslConfigTemplate {
7698    /// Controls the ssl type for the given connector version
7699    pub ssl_type: crate::model::SslType,
7700
7701    /// Boolean for determining if the connector version mandates TLS.
7702    pub is_tls_mandatory: bool,
7703
7704    /// List of supported Server Cert Types
7705    pub server_cert_type: std::vec::Vec<crate::model::CertType>,
7706
7707    /// List of supported Client Cert Types
7708    pub client_cert_type: std::vec::Vec<crate::model::CertType>,
7709
7710    /// Any additional fields that need to be rendered
7711    pub additional_variables: std::vec::Vec<crate::model::ConfigVariableTemplate>,
7712
7713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7714}
7715
7716impl SslConfigTemplate {
7717    pub fn new() -> Self {
7718        std::default::Default::default()
7719    }
7720
7721    /// Sets the value of [ssl_type][crate::model::SslConfigTemplate::ssl_type].
7722    ///
7723    /// # Example
7724    /// ```ignore,no_run
7725    /// # use google_cloud_connectors_v1::model::SslConfigTemplate;
7726    /// use google_cloud_connectors_v1::model::SslType;
7727    /// let x0 = SslConfigTemplate::new().set_ssl_type(SslType::Tls);
7728    /// let x1 = SslConfigTemplate::new().set_ssl_type(SslType::Mtls);
7729    /// ```
7730    pub fn set_ssl_type<T: std::convert::Into<crate::model::SslType>>(mut self, v: T) -> Self {
7731        self.ssl_type = v.into();
7732        self
7733    }
7734
7735    /// Sets the value of [is_tls_mandatory][crate::model::SslConfigTemplate::is_tls_mandatory].
7736    ///
7737    /// # Example
7738    /// ```ignore,no_run
7739    /// # use google_cloud_connectors_v1::model::SslConfigTemplate;
7740    /// let x = SslConfigTemplate::new().set_is_tls_mandatory(true);
7741    /// ```
7742    pub fn set_is_tls_mandatory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7743        self.is_tls_mandatory = v.into();
7744        self
7745    }
7746
7747    /// Sets the value of [server_cert_type][crate::model::SslConfigTemplate::server_cert_type].
7748    ///
7749    /// # Example
7750    /// ```ignore,no_run
7751    /// # use google_cloud_connectors_v1::model::SslConfigTemplate;
7752    /// use google_cloud_connectors_v1::model::CertType;
7753    /// let x = SslConfigTemplate::new().set_server_cert_type([
7754    ///     CertType::Pem,
7755    /// ]);
7756    /// ```
7757    pub fn set_server_cert_type<T, V>(mut self, v: T) -> Self
7758    where
7759        T: std::iter::IntoIterator<Item = V>,
7760        V: std::convert::Into<crate::model::CertType>,
7761    {
7762        use std::iter::Iterator;
7763        self.server_cert_type = v.into_iter().map(|i| i.into()).collect();
7764        self
7765    }
7766
7767    /// Sets the value of [client_cert_type][crate::model::SslConfigTemplate::client_cert_type].
7768    ///
7769    /// # Example
7770    /// ```ignore,no_run
7771    /// # use google_cloud_connectors_v1::model::SslConfigTemplate;
7772    /// use google_cloud_connectors_v1::model::CertType;
7773    /// let x = SslConfigTemplate::new().set_client_cert_type([
7774    ///     CertType::Pem,
7775    /// ]);
7776    /// ```
7777    pub fn set_client_cert_type<T, V>(mut self, v: T) -> Self
7778    where
7779        T: std::iter::IntoIterator<Item = V>,
7780        V: std::convert::Into<crate::model::CertType>,
7781    {
7782        use std::iter::Iterator;
7783        self.client_cert_type = v.into_iter().map(|i| i.into()).collect();
7784        self
7785    }
7786
7787    /// Sets the value of [additional_variables][crate::model::SslConfigTemplate::additional_variables].
7788    ///
7789    /// # Example
7790    /// ```ignore,no_run
7791    /// # use google_cloud_connectors_v1::model::SslConfigTemplate;
7792    /// use google_cloud_connectors_v1::model::ConfigVariableTemplate;
7793    /// let x = SslConfigTemplate::new()
7794    ///     .set_additional_variables([
7795    ///         ConfigVariableTemplate::default()/* use setters */,
7796    ///         ConfigVariableTemplate::default()/* use (different) setters */,
7797    ///     ]);
7798    /// ```
7799    pub fn set_additional_variables<T, V>(mut self, v: T) -> Self
7800    where
7801        T: std::iter::IntoIterator<Item = V>,
7802        V: std::convert::Into<crate::model::ConfigVariableTemplate>,
7803    {
7804        use std::iter::Iterator;
7805        self.additional_variables = v.into_iter().map(|i| i.into()).collect();
7806        self
7807    }
7808}
7809
7810impl wkt::message::Message for SslConfigTemplate {
7811    fn typename() -> &'static str {
7812        "type.googleapis.com/google.cloud.connectors.v1.SslConfigTemplate"
7813    }
7814}
7815
7816/// SSL Configuration of a connection
7817#[derive(Clone, Default, PartialEq)]
7818#[non_exhaustive]
7819pub struct SslConfig {
7820    /// Controls the ssl type for the given connector version.
7821    pub r#type: crate::model::SslType,
7822
7823    /// Trust Model of the SSL connection
7824    pub trust_model: crate::model::ssl_config::TrustModel,
7825
7826    /// Private Server Certificate. Needs to be specified if trust model is
7827    /// `PRIVATE`.
7828    pub private_server_certificate: std::option::Option<crate::model::Secret>,
7829
7830    /// Client Certificate
7831    pub client_certificate: std::option::Option<crate::model::Secret>,
7832
7833    /// Client Private Key
7834    pub client_private_key: std::option::Option<crate::model::Secret>,
7835
7836    /// Secret containing the passphrase protecting the Client Private Key
7837    pub client_private_key_pass: std::option::Option<crate::model::Secret>,
7838
7839    /// Type of Server Cert (PEM/JKS/.. etc.)
7840    pub server_cert_type: crate::model::CertType,
7841
7842    /// Type of Client Cert (PEM/JKS/.. etc.)
7843    pub client_cert_type: crate::model::CertType,
7844
7845    /// Bool for enabling SSL
7846    pub use_ssl: bool,
7847
7848    /// Additional SSL related field values
7849    pub additional_variables: std::vec::Vec<crate::model::ConfigVariable>,
7850
7851    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7852}
7853
7854impl SslConfig {
7855    pub fn new() -> Self {
7856        std::default::Default::default()
7857    }
7858
7859    /// Sets the value of [r#type][crate::model::SslConfig::type].
7860    ///
7861    /// # Example
7862    /// ```ignore,no_run
7863    /// # use google_cloud_connectors_v1::model::SslConfig;
7864    /// use google_cloud_connectors_v1::model::SslType;
7865    /// let x0 = SslConfig::new().set_type(SslType::Tls);
7866    /// let x1 = SslConfig::new().set_type(SslType::Mtls);
7867    /// ```
7868    pub fn set_type<T: std::convert::Into<crate::model::SslType>>(mut self, v: T) -> Self {
7869        self.r#type = v.into();
7870        self
7871    }
7872
7873    /// Sets the value of [trust_model][crate::model::SslConfig::trust_model].
7874    ///
7875    /// # Example
7876    /// ```ignore,no_run
7877    /// # use google_cloud_connectors_v1::model::SslConfig;
7878    /// use google_cloud_connectors_v1::model::ssl_config::TrustModel;
7879    /// let x0 = SslConfig::new().set_trust_model(TrustModel::Private);
7880    /// let x1 = SslConfig::new().set_trust_model(TrustModel::Insecure);
7881    /// ```
7882    pub fn set_trust_model<T: std::convert::Into<crate::model::ssl_config::TrustModel>>(
7883        mut self,
7884        v: T,
7885    ) -> Self {
7886        self.trust_model = v.into();
7887        self
7888    }
7889
7890    /// Sets the value of [private_server_certificate][crate::model::SslConfig::private_server_certificate].
7891    ///
7892    /// # Example
7893    /// ```ignore,no_run
7894    /// # use google_cloud_connectors_v1::model::SslConfig;
7895    /// use google_cloud_connectors_v1::model::Secret;
7896    /// let x = SslConfig::new().set_private_server_certificate(Secret::default()/* use setters */);
7897    /// ```
7898    pub fn set_private_server_certificate<T>(mut self, v: T) -> Self
7899    where
7900        T: std::convert::Into<crate::model::Secret>,
7901    {
7902        self.private_server_certificate = std::option::Option::Some(v.into());
7903        self
7904    }
7905
7906    /// Sets or clears the value of [private_server_certificate][crate::model::SslConfig::private_server_certificate].
7907    ///
7908    /// # Example
7909    /// ```ignore,no_run
7910    /// # use google_cloud_connectors_v1::model::SslConfig;
7911    /// use google_cloud_connectors_v1::model::Secret;
7912    /// let x = SslConfig::new().set_or_clear_private_server_certificate(Some(Secret::default()/* use setters */));
7913    /// let x = SslConfig::new().set_or_clear_private_server_certificate(None::<Secret>);
7914    /// ```
7915    pub fn set_or_clear_private_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
7916    where
7917        T: std::convert::Into<crate::model::Secret>,
7918    {
7919        self.private_server_certificate = v.map(|x| x.into());
7920        self
7921    }
7922
7923    /// Sets the value of [client_certificate][crate::model::SslConfig::client_certificate].
7924    ///
7925    /// # Example
7926    /// ```ignore,no_run
7927    /// # use google_cloud_connectors_v1::model::SslConfig;
7928    /// use google_cloud_connectors_v1::model::Secret;
7929    /// let x = SslConfig::new().set_client_certificate(Secret::default()/* use setters */);
7930    /// ```
7931    pub fn set_client_certificate<T>(mut self, v: T) -> Self
7932    where
7933        T: std::convert::Into<crate::model::Secret>,
7934    {
7935        self.client_certificate = std::option::Option::Some(v.into());
7936        self
7937    }
7938
7939    /// Sets or clears the value of [client_certificate][crate::model::SslConfig::client_certificate].
7940    ///
7941    /// # Example
7942    /// ```ignore,no_run
7943    /// # use google_cloud_connectors_v1::model::SslConfig;
7944    /// use google_cloud_connectors_v1::model::Secret;
7945    /// let x = SslConfig::new().set_or_clear_client_certificate(Some(Secret::default()/* use setters */));
7946    /// let x = SslConfig::new().set_or_clear_client_certificate(None::<Secret>);
7947    /// ```
7948    pub fn set_or_clear_client_certificate<T>(mut self, v: std::option::Option<T>) -> Self
7949    where
7950        T: std::convert::Into<crate::model::Secret>,
7951    {
7952        self.client_certificate = v.map(|x| x.into());
7953        self
7954    }
7955
7956    /// Sets the value of [client_private_key][crate::model::SslConfig::client_private_key].
7957    ///
7958    /// # Example
7959    /// ```ignore,no_run
7960    /// # use google_cloud_connectors_v1::model::SslConfig;
7961    /// use google_cloud_connectors_v1::model::Secret;
7962    /// let x = SslConfig::new().set_client_private_key(Secret::default()/* use setters */);
7963    /// ```
7964    pub fn set_client_private_key<T>(mut self, v: T) -> Self
7965    where
7966        T: std::convert::Into<crate::model::Secret>,
7967    {
7968        self.client_private_key = std::option::Option::Some(v.into());
7969        self
7970    }
7971
7972    /// Sets or clears the value of [client_private_key][crate::model::SslConfig::client_private_key].
7973    ///
7974    /// # Example
7975    /// ```ignore,no_run
7976    /// # use google_cloud_connectors_v1::model::SslConfig;
7977    /// use google_cloud_connectors_v1::model::Secret;
7978    /// let x = SslConfig::new().set_or_clear_client_private_key(Some(Secret::default()/* use setters */));
7979    /// let x = SslConfig::new().set_or_clear_client_private_key(None::<Secret>);
7980    /// ```
7981    pub fn set_or_clear_client_private_key<T>(mut self, v: std::option::Option<T>) -> Self
7982    where
7983        T: std::convert::Into<crate::model::Secret>,
7984    {
7985        self.client_private_key = v.map(|x| x.into());
7986        self
7987    }
7988
7989    /// Sets the value of [client_private_key_pass][crate::model::SslConfig::client_private_key_pass].
7990    ///
7991    /// # Example
7992    /// ```ignore,no_run
7993    /// # use google_cloud_connectors_v1::model::SslConfig;
7994    /// use google_cloud_connectors_v1::model::Secret;
7995    /// let x = SslConfig::new().set_client_private_key_pass(Secret::default()/* use setters */);
7996    /// ```
7997    pub fn set_client_private_key_pass<T>(mut self, v: T) -> Self
7998    where
7999        T: std::convert::Into<crate::model::Secret>,
8000    {
8001        self.client_private_key_pass = std::option::Option::Some(v.into());
8002        self
8003    }
8004
8005    /// Sets or clears the value of [client_private_key_pass][crate::model::SslConfig::client_private_key_pass].
8006    ///
8007    /// # Example
8008    /// ```ignore,no_run
8009    /// # use google_cloud_connectors_v1::model::SslConfig;
8010    /// use google_cloud_connectors_v1::model::Secret;
8011    /// let x = SslConfig::new().set_or_clear_client_private_key_pass(Some(Secret::default()/* use setters */));
8012    /// let x = SslConfig::new().set_or_clear_client_private_key_pass(None::<Secret>);
8013    /// ```
8014    pub fn set_or_clear_client_private_key_pass<T>(mut self, v: std::option::Option<T>) -> Self
8015    where
8016        T: std::convert::Into<crate::model::Secret>,
8017    {
8018        self.client_private_key_pass = v.map(|x| x.into());
8019        self
8020    }
8021
8022    /// Sets the value of [server_cert_type][crate::model::SslConfig::server_cert_type].
8023    ///
8024    /// # Example
8025    /// ```ignore,no_run
8026    /// # use google_cloud_connectors_v1::model::SslConfig;
8027    /// use google_cloud_connectors_v1::model::CertType;
8028    /// let x0 = SslConfig::new().set_server_cert_type(CertType::Pem);
8029    /// ```
8030    pub fn set_server_cert_type<T: std::convert::Into<crate::model::CertType>>(
8031        mut self,
8032        v: T,
8033    ) -> Self {
8034        self.server_cert_type = v.into();
8035        self
8036    }
8037
8038    /// Sets the value of [client_cert_type][crate::model::SslConfig::client_cert_type].
8039    ///
8040    /// # Example
8041    /// ```ignore,no_run
8042    /// # use google_cloud_connectors_v1::model::SslConfig;
8043    /// use google_cloud_connectors_v1::model::CertType;
8044    /// let x0 = SslConfig::new().set_client_cert_type(CertType::Pem);
8045    /// ```
8046    pub fn set_client_cert_type<T: std::convert::Into<crate::model::CertType>>(
8047        mut self,
8048        v: T,
8049    ) -> Self {
8050        self.client_cert_type = v.into();
8051        self
8052    }
8053
8054    /// Sets the value of [use_ssl][crate::model::SslConfig::use_ssl].
8055    ///
8056    /// # Example
8057    /// ```ignore,no_run
8058    /// # use google_cloud_connectors_v1::model::SslConfig;
8059    /// let x = SslConfig::new().set_use_ssl(true);
8060    /// ```
8061    pub fn set_use_ssl<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8062        self.use_ssl = v.into();
8063        self
8064    }
8065
8066    /// Sets the value of [additional_variables][crate::model::SslConfig::additional_variables].
8067    ///
8068    /// # Example
8069    /// ```ignore,no_run
8070    /// # use google_cloud_connectors_v1::model::SslConfig;
8071    /// use google_cloud_connectors_v1::model::ConfigVariable;
8072    /// let x = SslConfig::new()
8073    ///     .set_additional_variables([
8074    ///         ConfigVariable::default()/* use setters */,
8075    ///         ConfigVariable::default()/* use (different) setters */,
8076    ///     ]);
8077    /// ```
8078    pub fn set_additional_variables<T, V>(mut self, v: T) -> Self
8079    where
8080        T: std::iter::IntoIterator<Item = V>,
8081        V: std::convert::Into<crate::model::ConfigVariable>,
8082    {
8083        use std::iter::Iterator;
8084        self.additional_variables = v.into_iter().map(|i| i.into()).collect();
8085        self
8086    }
8087}
8088
8089impl wkt::message::Message for SslConfig {
8090    fn typename() -> &'static str {
8091        "type.googleapis.com/google.cloud.connectors.v1.SslConfig"
8092    }
8093}
8094
8095/// Defines additional types related to [SslConfig].
8096pub mod ssl_config {
8097    #[allow(unused_imports)]
8098    use super::*;
8099
8100    /// Enum for Ttust Model
8101    ///
8102    /// # Working with unknown values
8103    ///
8104    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8105    /// additional enum variants at any time. Adding new variants is not considered
8106    /// a breaking change. Applications should write their code in anticipation of:
8107    ///
8108    /// - New values appearing in future releases of the client library, **and**
8109    /// - New values received dynamically, without application changes.
8110    ///
8111    /// Please consult the [Working with enums] section in the user guide for some
8112    /// guidelines.
8113    ///
8114    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8115    #[derive(Clone, Debug, PartialEq)]
8116    #[non_exhaustive]
8117    pub enum TrustModel {
8118        /// Public Trust Model. Takes the Default Java trust store.
8119        Public,
8120        /// Private Trust Model. Takes custom/private trust store.
8121        Private,
8122        /// Insecure Trust Model. Accept all certificates.
8123        Insecure,
8124        /// If set, the enum was initialized with an unknown value.
8125        ///
8126        /// Applications can examine the value using [TrustModel::value] or
8127        /// [TrustModel::name].
8128        UnknownValue(trust_model::UnknownValue),
8129    }
8130
8131    #[doc(hidden)]
8132    pub mod trust_model {
8133        #[allow(unused_imports)]
8134        use super::*;
8135        #[derive(Clone, Debug, PartialEq)]
8136        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8137    }
8138
8139    impl TrustModel {
8140        /// Gets the enum value.
8141        ///
8142        /// Returns `None` if the enum contains an unknown value deserialized from
8143        /// the string representation of enums.
8144        pub fn value(&self) -> std::option::Option<i32> {
8145            match self {
8146                Self::Public => std::option::Option::Some(0),
8147                Self::Private => std::option::Option::Some(1),
8148                Self::Insecure => std::option::Option::Some(2),
8149                Self::UnknownValue(u) => u.0.value(),
8150            }
8151        }
8152
8153        /// Gets the enum value as a string.
8154        ///
8155        /// Returns `None` if the enum contains an unknown value deserialized from
8156        /// the integer representation of enums.
8157        pub fn name(&self) -> std::option::Option<&str> {
8158            match self {
8159                Self::Public => std::option::Option::Some("PUBLIC"),
8160                Self::Private => std::option::Option::Some("PRIVATE"),
8161                Self::Insecure => std::option::Option::Some("INSECURE"),
8162                Self::UnknownValue(u) => u.0.name(),
8163            }
8164        }
8165    }
8166
8167    impl std::default::Default for TrustModel {
8168        fn default() -> Self {
8169            use std::convert::From;
8170            Self::from(0)
8171        }
8172    }
8173
8174    impl std::fmt::Display for TrustModel {
8175        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8176            wkt::internal::display_enum(f, self.name(), self.value())
8177        }
8178    }
8179
8180    impl std::convert::From<i32> for TrustModel {
8181        fn from(value: i32) -> Self {
8182            match value {
8183                0 => Self::Public,
8184                1 => Self::Private,
8185                2 => Self::Insecure,
8186                _ => Self::UnknownValue(trust_model::UnknownValue(
8187                    wkt::internal::UnknownEnumValue::Integer(value),
8188                )),
8189            }
8190        }
8191    }
8192
8193    impl std::convert::From<&str> for TrustModel {
8194        fn from(value: &str) -> Self {
8195            use std::string::ToString;
8196            match value {
8197                "PUBLIC" => Self::Public,
8198                "PRIVATE" => Self::Private,
8199                "INSECURE" => Self::Insecure,
8200                _ => Self::UnknownValue(trust_model::UnknownValue(
8201                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8202                )),
8203            }
8204        }
8205    }
8206
8207    impl serde::ser::Serialize for TrustModel {
8208        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8209        where
8210            S: serde::Serializer,
8211        {
8212            match self {
8213                Self::Public => serializer.serialize_i32(0),
8214                Self::Private => serializer.serialize_i32(1),
8215                Self::Insecure => serializer.serialize_i32(2),
8216                Self::UnknownValue(u) => u.0.serialize(serializer),
8217            }
8218        }
8219    }
8220
8221    impl<'de> serde::de::Deserialize<'de> for TrustModel {
8222        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8223        where
8224            D: serde::Deserializer<'de>,
8225        {
8226            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TrustModel>::new(
8227                ".google.cloud.connectors.v1.SslConfig.TrustModel",
8228            ))
8229        }
8230    }
8231}
8232
8233/// AuthType defines different authentication types.
8234///
8235/// # Working with unknown values
8236///
8237/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8238/// additional enum variants at any time. Adding new variants is not considered
8239/// a breaking change. Applications should write their code in anticipation of:
8240///
8241/// - New values appearing in future releases of the client library, **and**
8242/// - New values received dynamically, without application changes.
8243///
8244/// Please consult the [Working with enums] section in the user guide for some
8245/// guidelines.
8246///
8247/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8248#[derive(Clone, Debug, PartialEq)]
8249#[non_exhaustive]
8250pub enum AuthType {
8251    /// Authentication type not specified.
8252    Unspecified,
8253    /// Username and Password Authentication.
8254    UserPassword,
8255    /// JSON Web Token (JWT) Profile for Oauth 2.0
8256    /// Authorization Grant based authentication
8257    Oauth2JwtBearer,
8258    /// Oauth 2.0 Client Credentials Grant Authentication
8259    Oauth2ClientCredentials,
8260    /// SSH Public Key Authentication
8261    SshPublicKey,
8262    /// Oauth 2.0 Authorization Code Flow
8263    Oauth2AuthCodeFlow,
8264    /// If set, the enum was initialized with an unknown value.
8265    ///
8266    /// Applications can examine the value using [AuthType::value] or
8267    /// [AuthType::name].
8268    UnknownValue(auth_type::UnknownValue),
8269}
8270
8271#[doc(hidden)]
8272pub mod auth_type {
8273    #[allow(unused_imports)]
8274    use super::*;
8275    #[derive(Clone, Debug, PartialEq)]
8276    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8277}
8278
8279impl AuthType {
8280    /// Gets the enum value.
8281    ///
8282    /// Returns `None` if the enum contains an unknown value deserialized from
8283    /// the string representation of enums.
8284    pub fn value(&self) -> std::option::Option<i32> {
8285        match self {
8286            Self::Unspecified => std::option::Option::Some(0),
8287            Self::UserPassword => std::option::Option::Some(1),
8288            Self::Oauth2JwtBearer => std::option::Option::Some(2),
8289            Self::Oauth2ClientCredentials => std::option::Option::Some(3),
8290            Self::SshPublicKey => std::option::Option::Some(4),
8291            Self::Oauth2AuthCodeFlow => std::option::Option::Some(5),
8292            Self::UnknownValue(u) => u.0.value(),
8293        }
8294    }
8295
8296    /// Gets the enum value as a string.
8297    ///
8298    /// Returns `None` if the enum contains an unknown value deserialized from
8299    /// the integer representation of enums.
8300    pub fn name(&self) -> std::option::Option<&str> {
8301        match self {
8302            Self::Unspecified => std::option::Option::Some("AUTH_TYPE_UNSPECIFIED"),
8303            Self::UserPassword => std::option::Option::Some("USER_PASSWORD"),
8304            Self::Oauth2JwtBearer => std::option::Option::Some("OAUTH2_JWT_BEARER"),
8305            Self::Oauth2ClientCredentials => std::option::Option::Some("OAUTH2_CLIENT_CREDENTIALS"),
8306            Self::SshPublicKey => std::option::Option::Some("SSH_PUBLIC_KEY"),
8307            Self::Oauth2AuthCodeFlow => std::option::Option::Some("OAUTH2_AUTH_CODE_FLOW"),
8308            Self::UnknownValue(u) => u.0.name(),
8309        }
8310    }
8311}
8312
8313impl std::default::Default for AuthType {
8314    fn default() -> Self {
8315        use std::convert::From;
8316        Self::from(0)
8317    }
8318}
8319
8320impl std::fmt::Display for AuthType {
8321    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8322        wkt::internal::display_enum(f, self.name(), self.value())
8323    }
8324}
8325
8326impl std::convert::From<i32> for AuthType {
8327    fn from(value: i32) -> Self {
8328        match value {
8329            0 => Self::Unspecified,
8330            1 => Self::UserPassword,
8331            2 => Self::Oauth2JwtBearer,
8332            3 => Self::Oauth2ClientCredentials,
8333            4 => Self::SshPublicKey,
8334            5 => Self::Oauth2AuthCodeFlow,
8335            _ => Self::UnknownValue(auth_type::UnknownValue(
8336                wkt::internal::UnknownEnumValue::Integer(value),
8337            )),
8338        }
8339    }
8340}
8341
8342impl std::convert::From<&str> for AuthType {
8343    fn from(value: &str) -> Self {
8344        use std::string::ToString;
8345        match value {
8346            "AUTH_TYPE_UNSPECIFIED" => Self::Unspecified,
8347            "USER_PASSWORD" => Self::UserPassword,
8348            "OAUTH2_JWT_BEARER" => Self::Oauth2JwtBearer,
8349            "OAUTH2_CLIENT_CREDENTIALS" => Self::Oauth2ClientCredentials,
8350            "SSH_PUBLIC_KEY" => Self::SshPublicKey,
8351            "OAUTH2_AUTH_CODE_FLOW" => Self::Oauth2AuthCodeFlow,
8352            _ => Self::UnknownValue(auth_type::UnknownValue(
8353                wkt::internal::UnknownEnumValue::String(value.to_string()),
8354            )),
8355        }
8356    }
8357}
8358
8359impl serde::ser::Serialize for AuthType {
8360    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8361    where
8362        S: serde::Serializer,
8363    {
8364        match self {
8365            Self::Unspecified => serializer.serialize_i32(0),
8366            Self::UserPassword => serializer.serialize_i32(1),
8367            Self::Oauth2JwtBearer => serializer.serialize_i32(2),
8368            Self::Oauth2ClientCredentials => serializer.serialize_i32(3),
8369            Self::SshPublicKey => serializer.serialize_i32(4),
8370            Self::Oauth2AuthCodeFlow => serializer.serialize_i32(5),
8371            Self::UnknownValue(u) => u.0.serialize(serializer),
8372        }
8373    }
8374}
8375
8376impl<'de> serde::de::Deserialize<'de> for AuthType {
8377    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8378    where
8379        D: serde::Deserializer<'de>,
8380    {
8381        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthType>::new(
8382            ".google.cloud.connectors.v1.AuthType",
8383        ))
8384    }
8385}
8386
8387/// LaunchStage is a enum to indicate launch stage:
8388/// PREVIEW, GA, DEPRECATED, PRIVATE_PREVIEW.
8389///
8390/// # Working with unknown values
8391///
8392/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8393/// additional enum variants at any time. Adding new variants is not considered
8394/// a breaking change. Applications should write their code in anticipation of:
8395///
8396/// - New values appearing in future releases of the client library, **and**
8397/// - New values received dynamically, without application changes.
8398///
8399/// Please consult the [Working with enums] section in the user guide for some
8400/// guidelines.
8401///
8402/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8403#[derive(Clone, Debug, PartialEq)]
8404#[non_exhaustive]
8405pub enum LaunchStage {
8406    /// LAUNCH_STAGE_UNSPECIFIED.
8407    Unspecified,
8408    /// PREVIEW.
8409    Preview,
8410    /// GA.
8411    Ga,
8412    /// DEPRECATED.
8413    Deprecated,
8414    /// PRIVATE_PREVIEW.
8415    PrivatePreview,
8416    /// If set, the enum was initialized with an unknown value.
8417    ///
8418    /// Applications can examine the value using [LaunchStage::value] or
8419    /// [LaunchStage::name].
8420    UnknownValue(launch_stage::UnknownValue),
8421}
8422
8423#[doc(hidden)]
8424pub mod launch_stage {
8425    #[allow(unused_imports)]
8426    use super::*;
8427    #[derive(Clone, Debug, PartialEq)]
8428    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8429}
8430
8431impl LaunchStage {
8432    /// Gets the enum value.
8433    ///
8434    /// Returns `None` if the enum contains an unknown value deserialized from
8435    /// the string representation of enums.
8436    pub fn value(&self) -> std::option::Option<i32> {
8437        match self {
8438            Self::Unspecified => std::option::Option::Some(0),
8439            Self::Preview => std::option::Option::Some(1),
8440            Self::Ga => std::option::Option::Some(2),
8441            Self::Deprecated => std::option::Option::Some(3),
8442            Self::PrivatePreview => std::option::Option::Some(5),
8443            Self::UnknownValue(u) => u.0.value(),
8444        }
8445    }
8446
8447    /// Gets the enum value as a string.
8448    ///
8449    /// Returns `None` if the enum contains an unknown value deserialized from
8450    /// the integer representation of enums.
8451    pub fn name(&self) -> std::option::Option<&str> {
8452        match self {
8453            Self::Unspecified => std::option::Option::Some("LAUNCH_STAGE_UNSPECIFIED"),
8454            Self::Preview => std::option::Option::Some("PREVIEW"),
8455            Self::Ga => std::option::Option::Some("GA"),
8456            Self::Deprecated => std::option::Option::Some("DEPRECATED"),
8457            Self::PrivatePreview => std::option::Option::Some("PRIVATE_PREVIEW"),
8458            Self::UnknownValue(u) => u.0.name(),
8459        }
8460    }
8461}
8462
8463impl std::default::Default for LaunchStage {
8464    fn default() -> Self {
8465        use std::convert::From;
8466        Self::from(0)
8467    }
8468}
8469
8470impl std::fmt::Display for LaunchStage {
8471    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8472        wkt::internal::display_enum(f, self.name(), self.value())
8473    }
8474}
8475
8476impl std::convert::From<i32> for LaunchStage {
8477    fn from(value: i32) -> Self {
8478        match value {
8479            0 => Self::Unspecified,
8480            1 => Self::Preview,
8481            2 => Self::Ga,
8482            3 => Self::Deprecated,
8483            5 => Self::PrivatePreview,
8484            _ => Self::UnknownValue(launch_stage::UnknownValue(
8485                wkt::internal::UnknownEnumValue::Integer(value),
8486            )),
8487        }
8488    }
8489}
8490
8491impl std::convert::From<&str> for LaunchStage {
8492    fn from(value: &str) -> Self {
8493        use std::string::ToString;
8494        match value {
8495            "LAUNCH_STAGE_UNSPECIFIED" => Self::Unspecified,
8496            "PREVIEW" => Self::Preview,
8497            "GA" => Self::Ga,
8498            "DEPRECATED" => Self::Deprecated,
8499            "PRIVATE_PREVIEW" => Self::PrivatePreview,
8500            _ => Self::UnknownValue(launch_stage::UnknownValue(
8501                wkt::internal::UnknownEnumValue::String(value.to_string()),
8502            )),
8503        }
8504    }
8505}
8506
8507impl serde::ser::Serialize for LaunchStage {
8508    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8509    where
8510        S: serde::Serializer,
8511    {
8512        match self {
8513            Self::Unspecified => serializer.serialize_i32(0),
8514            Self::Preview => serializer.serialize_i32(1),
8515            Self::Ga => serializer.serialize_i32(2),
8516            Self::Deprecated => serializer.serialize_i32(3),
8517            Self::PrivatePreview => serializer.serialize_i32(5),
8518            Self::UnknownValue(u) => u.0.serialize(serializer),
8519        }
8520    }
8521}
8522
8523impl<'de> serde::de::Deserialize<'de> for LaunchStage {
8524    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8525    where
8526        D: serde::Deserializer<'de>,
8527    {
8528        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LaunchStage>::new(
8529            ".google.cloud.connectors.v1.LaunchStage",
8530        ))
8531    }
8532}
8533
8534/// All possible data types of a entity or action field.
8535///
8536/// # Working with unknown values
8537///
8538/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8539/// additional enum variants at any time. Adding new variants is not considered
8540/// a breaking change. Applications should write their code in anticipation of:
8541///
8542/// - New values appearing in future releases of the client library, **and**
8543/// - New values received dynamically, without application changes.
8544///
8545/// Please consult the [Working with enums] section in the user guide for some
8546/// guidelines.
8547///
8548/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8549#[derive(Clone, Debug, PartialEq)]
8550#[non_exhaustive]
8551pub enum DataType {
8552    /// Data type is not specified.
8553    Unspecified,
8554    /// DEPRECATED! Use DATA_TYPE_INTEGER.
8555    #[deprecated]
8556    Int,
8557    /// Short integer(int16) data type.
8558    Smallint,
8559    /// Double data type.
8560    Double,
8561    /// Date data type.
8562    Date,
8563    /// DEPRECATED! Use DATA_TYPE_TIMESTAMP.
8564    #[deprecated]
8565    Datetime,
8566    /// Time data type.
8567    Time,
8568    /// DEPRECATED! Use DATA_TYPE_VARCHAR.
8569    #[deprecated]
8570    String,
8571    /// DEPRECATED! Use DATA_TYPE_BIGINT.
8572    #[deprecated]
8573    Long,
8574    /// Boolean data type.
8575    Boolean,
8576    /// Decimal data type.
8577    Decimal,
8578    /// DEPRECATED! Use DATA_TYPE_VARCHAR.
8579    #[deprecated]
8580    Uuid,
8581    /// UNSUPPORTED! Binary data type.
8582    Blob,
8583    /// Bit data type.
8584    Bit,
8585    /// Small integer(int8) data type.
8586    Tinyint,
8587    /// Integer(int32) data type.
8588    Integer,
8589    /// Long integer(int64) data type.
8590    Bigint,
8591    /// Float data type.
8592    Float,
8593    /// Real data type.
8594    Real,
8595    /// Numeric data type.
8596    Numeric,
8597    /// Char data type.
8598    Char,
8599    /// Varchar data type.
8600    Varchar,
8601    /// Longvarchar data type.
8602    Longvarchar,
8603    /// Timestamp data type.
8604    Timestamp,
8605    /// Nchar data type.
8606    Nchar,
8607    /// Nvarchar data type.
8608    Nvarchar,
8609    /// Longnvarchar data type.
8610    Longnvarchar,
8611    /// Null data type.
8612    Null,
8613    /// UNSUPPORTED! Binary data type.
8614    Other,
8615    /// UNSUPPORTED! Binary data type.
8616    JavaObject,
8617    /// UNSUPPORTED! Binary data type.
8618    Distinct,
8619    /// UNSUPPORTED! Binary data type.
8620    Struct,
8621    /// UNSUPPORTED! Binary data type.
8622    Array,
8623    /// UNSUPPORTED! Binary data type.
8624    Clob,
8625    /// UNSUPPORTED! Binary data type.
8626    Ref,
8627    /// UNSUPPORTED! Binary data type.
8628    Datalink,
8629    /// UNSUPPORTED! Row id data type.
8630    Rowid,
8631    /// UNSUPPORTED! Binary data type.
8632    Binary,
8633    /// UNSUPPORTED! Variable binary data type.
8634    Varbinary,
8635    /// UNSUPPORTED! Long variable binary data type.
8636    Longvarbinary,
8637    /// UNSUPPORTED! NCLOB data type.
8638    Nclob,
8639    /// UNSUPPORTED! SQL XML data type is not supported.
8640    Sqlxml,
8641    /// UNSUPPORTED! Cursor reference type is not supported.
8642    RefCursor,
8643    /// UNSUPPORTED! Use TIME or TIMESTAMP instead.
8644    TimeWithTimezone,
8645    /// UNSUPPORTED! Use TIMESTAMP instead.
8646    TimestampWithTimezone,
8647    /// If set, the enum was initialized with an unknown value.
8648    ///
8649    /// Applications can examine the value using [DataType::value] or
8650    /// [DataType::name].
8651    UnknownValue(data_type::UnknownValue),
8652}
8653
8654#[doc(hidden)]
8655pub mod data_type {
8656    #[allow(unused_imports)]
8657    use super::*;
8658    #[derive(Clone, Debug, PartialEq)]
8659    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8660}
8661
8662impl DataType {
8663    /// Gets the enum value.
8664    ///
8665    /// Returns `None` if the enum contains an unknown value deserialized from
8666    /// the string representation of enums.
8667    pub fn value(&self) -> std::option::Option<i32> {
8668        match self {
8669            Self::Unspecified => std::option::Option::Some(0),
8670            Self::Int => std::option::Option::Some(1),
8671            Self::Smallint => std::option::Option::Some(2),
8672            Self::Double => std::option::Option::Some(3),
8673            Self::Date => std::option::Option::Some(4),
8674            Self::Datetime => std::option::Option::Some(5),
8675            Self::Time => std::option::Option::Some(6),
8676            Self::String => std::option::Option::Some(7),
8677            Self::Long => std::option::Option::Some(8),
8678            Self::Boolean => std::option::Option::Some(9),
8679            Self::Decimal => std::option::Option::Some(10),
8680            Self::Uuid => std::option::Option::Some(11),
8681            Self::Blob => std::option::Option::Some(12),
8682            Self::Bit => std::option::Option::Some(13),
8683            Self::Tinyint => std::option::Option::Some(14),
8684            Self::Integer => std::option::Option::Some(15),
8685            Self::Bigint => std::option::Option::Some(16),
8686            Self::Float => std::option::Option::Some(17),
8687            Self::Real => std::option::Option::Some(18),
8688            Self::Numeric => std::option::Option::Some(19),
8689            Self::Char => std::option::Option::Some(20),
8690            Self::Varchar => std::option::Option::Some(21),
8691            Self::Longvarchar => std::option::Option::Some(22),
8692            Self::Timestamp => std::option::Option::Some(23),
8693            Self::Nchar => std::option::Option::Some(24),
8694            Self::Nvarchar => std::option::Option::Some(25),
8695            Self::Longnvarchar => std::option::Option::Some(26),
8696            Self::Null => std::option::Option::Some(27),
8697            Self::Other => std::option::Option::Some(28),
8698            Self::JavaObject => std::option::Option::Some(29),
8699            Self::Distinct => std::option::Option::Some(30),
8700            Self::Struct => std::option::Option::Some(31),
8701            Self::Array => std::option::Option::Some(32),
8702            Self::Clob => std::option::Option::Some(33),
8703            Self::Ref => std::option::Option::Some(34),
8704            Self::Datalink => std::option::Option::Some(35),
8705            Self::Rowid => std::option::Option::Some(36),
8706            Self::Binary => std::option::Option::Some(37),
8707            Self::Varbinary => std::option::Option::Some(38),
8708            Self::Longvarbinary => std::option::Option::Some(39),
8709            Self::Nclob => std::option::Option::Some(40),
8710            Self::Sqlxml => std::option::Option::Some(41),
8711            Self::RefCursor => std::option::Option::Some(42),
8712            Self::TimeWithTimezone => std::option::Option::Some(43),
8713            Self::TimestampWithTimezone => std::option::Option::Some(44),
8714            Self::UnknownValue(u) => u.0.value(),
8715        }
8716    }
8717
8718    /// Gets the enum value as a string.
8719    ///
8720    /// Returns `None` if the enum contains an unknown value deserialized from
8721    /// the integer representation of enums.
8722    pub fn name(&self) -> std::option::Option<&str> {
8723        match self {
8724            Self::Unspecified => std::option::Option::Some("DATA_TYPE_UNSPECIFIED"),
8725            Self::Int => std::option::Option::Some("DATA_TYPE_INT"),
8726            Self::Smallint => std::option::Option::Some("DATA_TYPE_SMALLINT"),
8727            Self::Double => std::option::Option::Some("DATA_TYPE_DOUBLE"),
8728            Self::Date => std::option::Option::Some("DATA_TYPE_DATE"),
8729            Self::Datetime => std::option::Option::Some("DATA_TYPE_DATETIME"),
8730            Self::Time => std::option::Option::Some("DATA_TYPE_TIME"),
8731            Self::String => std::option::Option::Some("DATA_TYPE_STRING"),
8732            Self::Long => std::option::Option::Some("DATA_TYPE_LONG"),
8733            Self::Boolean => std::option::Option::Some("DATA_TYPE_BOOLEAN"),
8734            Self::Decimal => std::option::Option::Some("DATA_TYPE_DECIMAL"),
8735            Self::Uuid => std::option::Option::Some("DATA_TYPE_UUID"),
8736            Self::Blob => std::option::Option::Some("DATA_TYPE_BLOB"),
8737            Self::Bit => std::option::Option::Some("DATA_TYPE_BIT"),
8738            Self::Tinyint => std::option::Option::Some("DATA_TYPE_TINYINT"),
8739            Self::Integer => std::option::Option::Some("DATA_TYPE_INTEGER"),
8740            Self::Bigint => std::option::Option::Some("DATA_TYPE_BIGINT"),
8741            Self::Float => std::option::Option::Some("DATA_TYPE_FLOAT"),
8742            Self::Real => std::option::Option::Some("DATA_TYPE_REAL"),
8743            Self::Numeric => std::option::Option::Some("DATA_TYPE_NUMERIC"),
8744            Self::Char => std::option::Option::Some("DATA_TYPE_CHAR"),
8745            Self::Varchar => std::option::Option::Some("DATA_TYPE_VARCHAR"),
8746            Self::Longvarchar => std::option::Option::Some("DATA_TYPE_LONGVARCHAR"),
8747            Self::Timestamp => std::option::Option::Some("DATA_TYPE_TIMESTAMP"),
8748            Self::Nchar => std::option::Option::Some("DATA_TYPE_NCHAR"),
8749            Self::Nvarchar => std::option::Option::Some("DATA_TYPE_NVARCHAR"),
8750            Self::Longnvarchar => std::option::Option::Some("DATA_TYPE_LONGNVARCHAR"),
8751            Self::Null => std::option::Option::Some("DATA_TYPE_NULL"),
8752            Self::Other => std::option::Option::Some("DATA_TYPE_OTHER"),
8753            Self::JavaObject => std::option::Option::Some("DATA_TYPE_JAVA_OBJECT"),
8754            Self::Distinct => std::option::Option::Some("DATA_TYPE_DISTINCT"),
8755            Self::Struct => std::option::Option::Some("DATA_TYPE_STRUCT"),
8756            Self::Array => std::option::Option::Some("DATA_TYPE_ARRAY"),
8757            Self::Clob => std::option::Option::Some("DATA_TYPE_CLOB"),
8758            Self::Ref => std::option::Option::Some("DATA_TYPE_REF"),
8759            Self::Datalink => std::option::Option::Some("DATA_TYPE_DATALINK"),
8760            Self::Rowid => std::option::Option::Some("DATA_TYPE_ROWID"),
8761            Self::Binary => std::option::Option::Some("DATA_TYPE_BINARY"),
8762            Self::Varbinary => std::option::Option::Some("DATA_TYPE_VARBINARY"),
8763            Self::Longvarbinary => std::option::Option::Some("DATA_TYPE_LONGVARBINARY"),
8764            Self::Nclob => std::option::Option::Some("DATA_TYPE_NCLOB"),
8765            Self::Sqlxml => std::option::Option::Some("DATA_TYPE_SQLXML"),
8766            Self::RefCursor => std::option::Option::Some("DATA_TYPE_REF_CURSOR"),
8767            Self::TimeWithTimezone => std::option::Option::Some("DATA_TYPE_TIME_WITH_TIMEZONE"),
8768            Self::TimestampWithTimezone => {
8769                std::option::Option::Some("DATA_TYPE_TIMESTAMP_WITH_TIMEZONE")
8770            }
8771            Self::UnknownValue(u) => u.0.name(),
8772        }
8773    }
8774}
8775
8776impl std::default::Default for DataType {
8777    fn default() -> Self {
8778        use std::convert::From;
8779        Self::from(0)
8780    }
8781}
8782
8783impl std::fmt::Display for DataType {
8784    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8785        wkt::internal::display_enum(f, self.name(), self.value())
8786    }
8787}
8788
8789impl std::convert::From<i32> for DataType {
8790    fn from(value: i32) -> Self {
8791        match value {
8792            0 => Self::Unspecified,
8793            1 => Self::Int,
8794            2 => Self::Smallint,
8795            3 => Self::Double,
8796            4 => Self::Date,
8797            5 => Self::Datetime,
8798            6 => Self::Time,
8799            7 => Self::String,
8800            8 => Self::Long,
8801            9 => Self::Boolean,
8802            10 => Self::Decimal,
8803            11 => Self::Uuid,
8804            12 => Self::Blob,
8805            13 => Self::Bit,
8806            14 => Self::Tinyint,
8807            15 => Self::Integer,
8808            16 => Self::Bigint,
8809            17 => Self::Float,
8810            18 => Self::Real,
8811            19 => Self::Numeric,
8812            20 => Self::Char,
8813            21 => Self::Varchar,
8814            22 => Self::Longvarchar,
8815            23 => Self::Timestamp,
8816            24 => Self::Nchar,
8817            25 => Self::Nvarchar,
8818            26 => Self::Longnvarchar,
8819            27 => Self::Null,
8820            28 => Self::Other,
8821            29 => Self::JavaObject,
8822            30 => Self::Distinct,
8823            31 => Self::Struct,
8824            32 => Self::Array,
8825            33 => Self::Clob,
8826            34 => Self::Ref,
8827            35 => Self::Datalink,
8828            36 => Self::Rowid,
8829            37 => Self::Binary,
8830            38 => Self::Varbinary,
8831            39 => Self::Longvarbinary,
8832            40 => Self::Nclob,
8833            41 => Self::Sqlxml,
8834            42 => Self::RefCursor,
8835            43 => Self::TimeWithTimezone,
8836            44 => Self::TimestampWithTimezone,
8837            _ => Self::UnknownValue(data_type::UnknownValue(
8838                wkt::internal::UnknownEnumValue::Integer(value),
8839            )),
8840        }
8841    }
8842}
8843
8844impl std::convert::From<&str> for DataType {
8845    fn from(value: &str) -> Self {
8846        use std::string::ToString;
8847        match value {
8848            "DATA_TYPE_UNSPECIFIED" => Self::Unspecified,
8849            "DATA_TYPE_INT" => Self::Int,
8850            "DATA_TYPE_SMALLINT" => Self::Smallint,
8851            "DATA_TYPE_DOUBLE" => Self::Double,
8852            "DATA_TYPE_DATE" => Self::Date,
8853            "DATA_TYPE_DATETIME" => Self::Datetime,
8854            "DATA_TYPE_TIME" => Self::Time,
8855            "DATA_TYPE_STRING" => Self::String,
8856            "DATA_TYPE_LONG" => Self::Long,
8857            "DATA_TYPE_BOOLEAN" => Self::Boolean,
8858            "DATA_TYPE_DECIMAL" => Self::Decimal,
8859            "DATA_TYPE_UUID" => Self::Uuid,
8860            "DATA_TYPE_BLOB" => Self::Blob,
8861            "DATA_TYPE_BIT" => Self::Bit,
8862            "DATA_TYPE_TINYINT" => Self::Tinyint,
8863            "DATA_TYPE_INTEGER" => Self::Integer,
8864            "DATA_TYPE_BIGINT" => Self::Bigint,
8865            "DATA_TYPE_FLOAT" => Self::Float,
8866            "DATA_TYPE_REAL" => Self::Real,
8867            "DATA_TYPE_NUMERIC" => Self::Numeric,
8868            "DATA_TYPE_CHAR" => Self::Char,
8869            "DATA_TYPE_VARCHAR" => Self::Varchar,
8870            "DATA_TYPE_LONGVARCHAR" => Self::Longvarchar,
8871            "DATA_TYPE_TIMESTAMP" => Self::Timestamp,
8872            "DATA_TYPE_NCHAR" => Self::Nchar,
8873            "DATA_TYPE_NVARCHAR" => Self::Nvarchar,
8874            "DATA_TYPE_LONGNVARCHAR" => Self::Longnvarchar,
8875            "DATA_TYPE_NULL" => Self::Null,
8876            "DATA_TYPE_OTHER" => Self::Other,
8877            "DATA_TYPE_JAVA_OBJECT" => Self::JavaObject,
8878            "DATA_TYPE_DISTINCT" => Self::Distinct,
8879            "DATA_TYPE_STRUCT" => Self::Struct,
8880            "DATA_TYPE_ARRAY" => Self::Array,
8881            "DATA_TYPE_CLOB" => Self::Clob,
8882            "DATA_TYPE_REF" => Self::Ref,
8883            "DATA_TYPE_DATALINK" => Self::Datalink,
8884            "DATA_TYPE_ROWID" => Self::Rowid,
8885            "DATA_TYPE_BINARY" => Self::Binary,
8886            "DATA_TYPE_VARBINARY" => Self::Varbinary,
8887            "DATA_TYPE_LONGVARBINARY" => Self::Longvarbinary,
8888            "DATA_TYPE_NCLOB" => Self::Nclob,
8889            "DATA_TYPE_SQLXML" => Self::Sqlxml,
8890            "DATA_TYPE_REF_CURSOR" => Self::RefCursor,
8891            "DATA_TYPE_TIME_WITH_TIMEZONE" => Self::TimeWithTimezone,
8892            "DATA_TYPE_TIMESTAMP_WITH_TIMEZONE" => Self::TimestampWithTimezone,
8893            _ => Self::UnknownValue(data_type::UnknownValue(
8894                wkt::internal::UnknownEnumValue::String(value.to_string()),
8895            )),
8896        }
8897    }
8898}
8899
8900impl serde::ser::Serialize for DataType {
8901    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8902    where
8903        S: serde::Serializer,
8904    {
8905        match self {
8906            Self::Unspecified => serializer.serialize_i32(0),
8907            Self::Int => serializer.serialize_i32(1),
8908            Self::Smallint => serializer.serialize_i32(2),
8909            Self::Double => serializer.serialize_i32(3),
8910            Self::Date => serializer.serialize_i32(4),
8911            Self::Datetime => serializer.serialize_i32(5),
8912            Self::Time => serializer.serialize_i32(6),
8913            Self::String => serializer.serialize_i32(7),
8914            Self::Long => serializer.serialize_i32(8),
8915            Self::Boolean => serializer.serialize_i32(9),
8916            Self::Decimal => serializer.serialize_i32(10),
8917            Self::Uuid => serializer.serialize_i32(11),
8918            Self::Blob => serializer.serialize_i32(12),
8919            Self::Bit => serializer.serialize_i32(13),
8920            Self::Tinyint => serializer.serialize_i32(14),
8921            Self::Integer => serializer.serialize_i32(15),
8922            Self::Bigint => serializer.serialize_i32(16),
8923            Self::Float => serializer.serialize_i32(17),
8924            Self::Real => serializer.serialize_i32(18),
8925            Self::Numeric => serializer.serialize_i32(19),
8926            Self::Char => serializer.serialize_i32(20),
8927            Self::Varchar => serializer.serialize_i32(21),
8928            Self::Longvarchar => serializer.serialize_i32(22),
8929            Self::Timestamp => serializer.serialize_i32(23),
8930            Self::Nchar => serializer.serialize_i32(24),
8931            Self::Nvarchar => serializer.serialize_i32(25),
8932            Self::Longnvarchar => serializer.serialize_i32(26),
8933            Self::Null => serializer.serialize_i32(27),
8934            Self::Other => serializer.serialize_i32(28),
8935            Self::JavaObject => serializer.serialize_i32(29),
8936            Self::Distinct => serializer.serialize_i32(30),
8937            Self::Struct => serializer.serialize_i32(31),
8938            Self::Array => serializer.serialize_i32(32),
8939            Self::Clob => serializer.serialize_i32(33),
8940            Self::Ref => serializer.serialize_i32(34),
8941            Self::Datalink => serializer.serialize_i32(35),
8942            Self::Rowid => serializer.serialize_i32(36),
8943            Self::Binary => serializer.serialize_i32(37),
8944            Self::Varbinary => serializer.serialize_i32(38),
8945            Self::Longvarbinary => serializer.serialize_i32(39),
8946            Self::Nclob => serializer.serialize_i32(40),
8947            Self::Sqlxml => serializer.serialize_i32(41),
8948            Self::RefCursor => serializer.serialize_i32(42),
8949            Self::TimeWithTimezone => serializer.serialize_i32(43),
8950            Self::TimestampWithTimezone => serializer.serialize_i32(44),
8951            Self::UnknownValue(u) => u.0.serialize(serializer),
8952        }
8953    }
8954}
8955
8956impl<'de> serde::de::Deserialize<'de> for DataType {
8957    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8958    where
8959        D: serde::Deserializer<'de>,
8960    {
8961        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataType>::new(
8962            ".google.cloud.connectors.v1.DataType",
8963        ))
8964    }
8965}
8966
8967/// Enum to control which fields should be included in the response.
8968///
8969/// # Working with unknown values
8970///
8971/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8972/// additional enum variants at any time. Adding new variants is not considered
8973/// a breaking change. Applications should write their code in anticipation of:
8974///
8975/// - New values appearing in future releases of the client library, **and**
8976/// - New values received dynamically, without application changes.
8977///
8978/// Please consult the [Working with enums] section in the user guide for some
8979/// guidelines.
8980///
8981/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8982#[derive(Clone, Debug, PartialEq)]
8983#[non_exhaustive]
8984pub enum ConnectionView {
8985    /// CONNECTION_UNSPECIFIED.
8986    Unspecified,
8987    /// Do not include runtime required configs.
8988    Basic,
8989    /// Include runtime required configs.
8990    Full,
8991    /// If set, the enum was initialized with an unknown value.
8992    ///
8993    /// Applications can examine the value using [ConnectionView::value] or
8994    /// [ConnectionView::name].
8995    UnknownValue(connection_view::UnknownValue),
8996}
8997
8998#[doc(hidden)]
8999pub mod connection_view {
9000    #[allow(unused_imports)]
9001    use super::*;
9002    #[derive(Clone, Debug, PartialEq)]
9003    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9004}
9005
9006impl ConnectionView {
9007    /// Gets the enum value.
9008    ///
9009    /// Returns `None` if the enum contains an unknown value deserialized from
9010    /// the string representation of enums.
9011    pub fn value(&self) -> std::option::Option<i32> {
9012        match self {
9013            Self::Unspecified => std::option::Option::Some(0),
9014            Self::Basic => std::option::Option::Some(1),
9015            Self::Full => std::option::Option::Some(2),
9016            Self::UnknownValue(u) => u.0.value(),
9017        }
9018    }
9019
9020    /// Gets the enum value as a string.
9021    ///
9022    /// Returns `None` if the enum contains an unknown value deserialized from
9023    /// the integer representation of enums.
9024    pub fn name(&self) -> std::option::Option<&str> {
9025        match self {
9026            Self::Unspecified => std::option::Option::Some("CONNECTION_VIEW_UNSPECIFIED"),
9027            Self::Basic => std::option::Option::Some("BASIC"),
9028            Self::Full => std::option::Option::Some("FULL"),
9029            Self::UnknownValue(u) => u.0.name(),
9030        }
9031    }
9032}
9033
9034impl std::default::Default for ConnectionView {
9035    fn default() -> Self {
9036        use std::convert::From;
9037        Self::from(0)
9038    }
9039}
9040
9041impl std::fmt::Display for ConnectionView {
9042    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9043        wkt::internal::display_enum(f, self.name(), self.value())
9044    }
9045}
9046
9047impl std::convert::From<i32> for ConnectionView {
9048    fn from(value: i32) -> Self {
9049        match value {
9050            0 => Self::Unspecified,
9051            1 => Self::Basic,
9052            2 => Self::Full,
9053            _ => Self::UnknownValue(connection_view::UnknownValue(
9054                wkt::internal::UnknownEnumValue::Integer(value),
9055            )),
9056        }
9057    }
9058}
9059
9060impl std::convert::From<&str> for ConnectionView {
9061    fn from(value: &str) -> Self {
9062        use std::string::ToString;
9063        match value {
9064            "CONNECTION_VIEW_UNSPECIFIED" => Self::Unspecified,
9065            "BASIC" => Self::Basic,
9066            "FULL" => Self::Full,
9067            _ => Self::UnknownValue(connection_view::UnknownValue(
9068                wkt::internal::UnknownEnumValue::String(value.to_string()),
9069            )),
9070        }
9071    }
9072}
9073
9074impl serde::ser::Serialize for ConnectionView {
9075    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9076    where
9077        S: serde::Serializer,
9078    {
9079        match self {
9080            Self::Unspecified => serializer.serialize_i32(0),
9081            Self::Basic => serializer.serialize_i32(1),
9082            Self::Full => serializer.serialize_i32(2),
9083            Self::UnknownValue(u) => u.0.serialize(serializer),
9084        }
9085    }
9086}
9087
9088impl<'de> serde::de::Deserialize<'de> for ConnectionView {
9089    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9090    where
9091        D: serde::Deserializer<'de>,
9092    {
9093        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionView>::new(
9094            ".google.cloud.connectors.v1.ConnectionView",
9095        ))
9096    }
9097}
9098
9099/// Enum to control which fields should be included in the response.
9100///
9101/// # Working with unknown values
9102///
9103/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9104/// additional enum variants at any time. Adding new variants is not considered
9105/// a breaking change. Applications should write their code in anticipation of:
9106///
9107/// - New values appearing in future releases of the client library, **and**
9108/// - New values received dynamically, without application changes.
9109///
9110/// Please consult the [Working with enums] section in the user guide for some
9111/// guidelines.
9112///
9113/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9114#[derive(Clone, Debug, PartialEq)]
9115#[non_exhaustive]
9116pub enum ConnectorVersionView {
9117    /// CONNECTOR_VERSION_VIEW_UNSPECIFIED.
9118    Unspecified,
9119    /// Do not include role grant configs.
9120    Basic,
9121    /// Include role grant configs.
9122    Full,
9123    /// If set, the enum was initialized with an unknown value.
9124    ///
9125    /// Applications can examine the value using [ConnectorVersionView::value] or
9126    /// [ConnectorVersionView::name].
9127    UnknownValue(connector_version_view::UnknownValue),
9128}
9129
9130#[doc(hidden)]
9131pub mod connector_version_view {
9132    #[allow(unused_imports)]
9133    use super::*;
9134    #[derive(Clone, Debug, PartialEq)]
9135    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9136}
9137
9138impl ConnectorVersionView {
9139    /// Gets the enum value.
9140    ///
9141    /// Returns `None` if the enum contains an unknown value deserialized from
9142    /// the string representation of enums.
9143    pub fn value(&self) -> std::option::Option<i32> {
9144        match self {
9145            Self::Unspecified => std::option::Option::Some(0),
9146            Self::Basic => std::option::Option::Some(1),
9147            Self::Full => std::option::Option::Some(2),
9148            Self::UnknownValue(u) => u.0.value(),
9149        }
9150    }
9151
9152    /// Gets the enum value as a string.
9153    ///
9154    /// Returns `None` if the enum contains an unknown value deserialized from
9155    /// the integer representation of enums.
9156    pub fn name(&self) -> std::option::Option<&str> {
9157        match self {
9158            Self::Unspecified => std::option::Option::Some("CONNECTOR_VERSION_VIEW_UNSPECIFIED"),
9159            Self::Basic => std::option::Option::Some("CONNECTOR_VERSION_VIEW_BASIC"),
9160            Self::Full => std::option::Option::Some("CONNECTOR_VERSION_VIEW_FULL"),
9161            Self::UnknownValue(u) => u.0.name(),
9162        }
9163    }
9164}
9165
9166impl std::default::Default for ConnectorVersionView {
9167    fn default() -> Self {
9168        use std::convert::From;
9169        Self::from(0)
9170    }
9171}
9172
9173impl std::fmt::Display for ConnectorVersionView {
9174    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9175        wkt::internal::display_enum(f, self.name(), self.value())
9176    }
9177}
9178
9179impl std::convert::From<i32> for ConnectorVersionView {
9180    fn from(value: i32) -> Self {
9181        match value {
9182            0 => Self::Unspecified,
9183            1 => Self::Basic,
9184            2 => Self::Full,
9185            _ => Self::UnknownValue(connector_version_view::UnknownValue(
9186                wkt::internal::UnknownEnumValue::Integer(value),
9187            )),
9188        }
9189    }
9190}
9191
9192impl std::convert::From<&str> for ConnectorVersionView {
9193    fn from(value: &str) -> Self {
9194        use std::string::ToString;
9195        match value {
9196            "CONNECTOR_VERSION_VIEW_UNSPECIFIED" => Self::Unspecified,
9197            "CONNECTOR_VERSION_VIEW_BASIC" => Self::Basic,
9198            "CONNECTOR_VERSION_VIEW_FULL" => Self::Full,
9199            _ => Self::UnknownValue(connector_version_view::UnknownValue(
9200                wkt::internal::UnknownEnumValue::String(value.to_string()),
9201            )),
9202        }
9203    }
9204}
9205
9206impl serde::ser::Serialize for ConnectorVersionView {
9207    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9208    where
9209        S: serde::Serializer,
9210    {
9211        match self {
9212            Self::Unspecified => serializer.serialize_i32(0),
9213            Self::Basic => serializer.serialize_i32(1),
9214            Self::Full => serializer.serialize_i32(2),
9215            Self::UnknownValue(u) => u.0.serialize(serializer),
9216        }
9217    }
9218}
9219
9220impl<'de> serde::de::Deserialize<'de> for ConnectorVersionView {
9221    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9222    where
9223        D: serde::Deserializer<'de>,
9224    {
9225        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorVersionView>::new(
9226            ".google.cloud.connectors.v1.ConnectorVersionView",
9227        ))
9228    }
9229}
9230
9231/// Enum for controlling the SSL Type (TLS/MTLS)
9232///
9233/// # Working with unknown values
9234///
9235/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9236/// additional enum variants at any time. Adding new variants is not considered
9237/// a breaking change. Applications should write their code in anticipation of:
9238///
9239/// - New values appearing in future releases of the client library, **and**
9240/// - New values received dynamically, without application changes.
9241///
9242/// Please consult the [Working with enums] section in the user guide for some
9243/// guidelines.
9244///
9245/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9246#[derive(Clone, Debug, PartialEq)]
9247#[non_exhaustive]
9248pub enum SslType {
9249    /// No SSL configuration required.
9250    Unspecified,
9251    /// TLS Handshake
9252    Tls,
9253    /// mutual TLS (MTLS) Handshake
9254    Mtls,
9255    /// If set, the enum was initialized with an unknown value.
9256    ///
9257    /// Applications can examine the value using [SslType::value] or
9258    /// [SslType::name].
9259    UnknownValue(ssl_type::UnknownValue),
9260}
9261
9262#[doc(hidden)]
9263pub mod ssl_type {
9264    #[allow(unused_imports)]
9265    use super::*;
9266    #[derive(Clone, Debug, PartialEq)]
9267    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9268}
9269
9270impl SslType {
9271    /// Gets the enum value.
9272    ///
9273    /// Returns `None` if the enum contains an unknown value deserialized from
9274    /// the string representation of enums.
9275    pub fn value(&self) -> std::option::Option<i32> {
9276        match self {
9277            Self::Unspecified => std::option::Option::Some(0),
9278            Self::Tls => std::option::Option::Some(1),
9279            Self::Mtls => std::option::Option::Some(2),
9280            Self::UnknownValue(u) => u.0.value(),
9281        }
9282    }
9283
9284    /// Gets the enum value as a string.
9285    ///
9286    /// Returns `None` if the enum contains an unknown value deserialized from
9287    /// the integer representation of enums.
9288    pub fn name(&self) -> std::option::Option<&str> {
9289        match self {
9290            Self::Unspecified => std::option::Option::Some("SSL_TYPE_UNSPECIFIED"),
9291            Self::Tls => std::option::Option::Some("TLS"),
9292            Self::Mtls => std::option::Option::Some("MTLS"),
9293            Self::UnknownValue(u) => u.0.name(),
9294        }
9295    }
9296}
9297
9298impl std::default::Default for SslType {
9299    fn default() -> Self {
9300        use std::convert::From;
9301        Self::from(0)
9302    }
9303}
9304
9305impl std::fmt::Display for SslType {
9306    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9307        wkt::internal::display_enum(f, self.name(), self.value())
9308    }
9309}
9310
9311impl std::convert::From<i32> for SslType {
9312    fn from(value: i32) -> Self {
9313        match value {
9314            0 => Self::Unspecified,
9315            1 => Self::Tls,
9316            2 => Self::Mtls,
9317            _ => Self::UnknownValue(ssl_type::UnknownValue(
9318                wkt::internal::UnknownEnumValue::Integer(value),
9319            )),
9320        }
9321    }
9322}
9323
9324impl std::convert::From<&str> for SslType {
9325    fn from(value: &str) -> Self {
9326        use std::string::ToString;
9327        match value {
9328            "SSL_TYPE_UNSPECIFIED" => Self::Unspecified,
9329            "TLS" => Self::Tls,
9330            "MTLS" => Self::Mtls,
9331            _ => Self::UnknownValue(ssl_type::UnknownValue(
9332                wkt::internal::UnknownEnumValue::String(value.to_string()),
9333            )),
9334        }
9335    }
9336}
9337
9338impl serde::ser::Serialize for SslType {
9339    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9340    where
9341        S: serde::Serializer,
9342    {
9343        match self {
9344            Self::Unspecified => serializer.serialize_i32(0),
9345            Self::Tls => serializer.serialize_i32(1),
9346            Self::Mtls => serializer.serialize_i32(2),
9347            Self::UnknownValue(u) => u.0.serialize(serializer),
9348        }
9349    }
9350}
9351
9352impl<'de> serde::de::Deserialize<'de> for SslType {
9353    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9354    where
9355        D: serde::Deserializer<'de>,
9356    {
9357        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslType>::new(
9358            ".google.cloud.connectors.v1.SslType",
9359        ))
9360    }
9361}
9362
9363/// Enum for Cert Types
9364///
9365/// # Working with unknown values
9366///
9367/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9368/// additional enum variants at any time. Adding new variants is not considered
9369/// a breaking change. Applications should write their code in anticipation of:
9370///
9371/// - New values appearing in future releases of the client library, **and**
9372/// - New values received dynamically, without application changes.
9373///
9374/// Please consult the [Working with enums] section in the user guide for some
9375/// guidelines.
9376///
9377/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9378#[derive(Clone, Debug, PartialEq)]
9379#[non_exhaustive]
9380pub enum CertType {
9381    /// Cert type unspecified.
9382    Unspecified,
9383    /// Privacy Enhanced Mail (PEM) Type
9384    Pem,
9385    /// If set, the enum was initialized with an unknown value.
9386    ///
9387    /// Applications can examine the value using [CertType::value] or
9388    /// [CertType::name].
9389    UnknownValue(cert_type::UnknownValue),
9390}
9391
9392#[doc(hidden)]
9393pub mod cert_type {
9394    #[allow(unused_imports)]
9395    use super::*;
9396    #[derive(Clone, Debug, PartialEq)]
9397    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9398}
9399
9400impl CertType {
9401    /// Gets the enum value.
9402    ///
9403    /// Returns `None` if the enum contains an unknown value deserialized from
9404    /// the string representation of enums.
9405    pub fn value(&self) -> std::option::Option<i32> {
9406        match self {
9407            Self::Unspecified => std::option::Option::Some(0),
9408            Self::Pem => std::option::Option::Some(1),
9409            Self::UnknownValue(u) => u.0.value(),
9410        }
9411    }
9412
9413    /// Gets the enum value as a string.
9414    ///
9415    /// Returns `None` if the enum contains an unknown value deserialized from
9416    /// the integer representation of enums.
9417    pub fn name(&self) -> std::option::Option<&str> {
9418        match self {
9419            Self::Unspecified => std::option::Option::Some("CERT_TYPE_UNSPECIFIED"),
9420            Self::Pem => std::option::Option::Some("PEM"),
9421            Self::UnknownValue(u) => u.0.name(),
9422        }
9423    }
9424}
9425
9426impl std::default::Default for CertType {
9427    fn default() -> Self {
9428        use std::convert::From;
9429        Self::from(0)
9430    }
9431}
9432
9433impl std::fmt::Display for CertType {
9434    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9435        wkt::internal::display_enum(f, self.name(), self.value())
9436    }
9437}
9438
9439impl std::convert::From<i32> for CertType {
9440    fn from(value: i32) -> Self {
9441        match value {
9442            0 => Self::Unspecified,
9443            1 => Self::Pem,
9444            _ => Self::UnknownValue(cert_type::UnknownValue(
9445                wkt::internal::UnknownEnumValue::Integer(value),
9446            )),
9447        }
9448    }
9449}
9450
9451impl std::convert::From<&str> for CertType {
9452    fn from(value: &str) -> Self {
9453        use std::string::ToString;
9454        match value {
9455            "CERT_TYPE_UNSPECIFIED" => Self::Unspecified,
9456            "PEM" => Self::Pem,
9457            _ => Self::UnknownValue(cert_type::UnknownValue(
9458                wkt::internal::UnknownEnumValue::String(value.to_string()),
9459            )),
9460        }
9461    }
9462}
9463
9464impl serde::ser::Serialize for CertType {
9465    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9466    where
9467        S: serde::Serializer,
9468    {
9469        match self {
9470            Self::Unspecified => serializer.serialize_i32(0),
9471            Self::Pem => serializer.serialize_i32(1),
9472            Self::UnknownValue(u) => u.0.serialize(serializer),
9473        }
9474    }
9475}
9476
9477impl<'de> serde::de::Deserialize<'de> for CertType {
9478    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9479    where
9480        D: serde::Deserializer<'de>,
9481    {
9482        deserializer.deserialize_any(wkt::internal::EnumVisitor::<CertType>::new(
9483            ".google.cloud.connectors.v1.CertType",
9484        ))
9485    }
9486}