google_cloud_sql_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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_rpc;
27extern crate google_cloud_type;
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/// Backup runs delete request.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct SqlBackupRunsDeleteRequest {
43 /// The ID of the backup run to delete. To find a backup run ID, use the
44 /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
45 /// method.
46 pub id: i64,
47
48 /// Cloud SQL instance ID. This does not include the project ID.
49 pub instance: std::string::String,
50
51 /// Project ID of the project that contains the instance.
52 pub project: std::string::String,
53
54 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
55}
56
57impl SqlBackupRunsDeleteRequest {
58 /// Creates a new default instance.
59 pub fn new() -> Self {
60 std::default::Default::default()
61 }
62
63 /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
64 ///
65 /// # Example
66 /// ```ignore,no_run
67 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
68 /// let x = SqlBackupRunsDeleteRequest::new().set_id(42);
69 /// ```
70 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
71 self.id = v.into();
72 self
73 }
74
75 /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
76 ///
77 /// # Example
78 /// ```ignore,no_run
79 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
80 /// let x = SqlBackupRunsDeleteRequest::new().set_instance("example");
81 /// ```
82 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
83 self.instance = v.into();
84 self
85 }
86
87 /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
88 ///
89 /// # Example
90 /// ```ignore,no_run
91 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
92 /// let x = SqlBackupRunsDeleteRequest::new().set_project("example");
93 /// ```
94 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
95 self.project = v.into();
96 self
97 }
98}
99
100impl wkt::message::Message for SqlBackupRunsDeleteRequest {
101 fn typename() -> &'static str {
102 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
103 }
104}
105
106/// Backup runs get request.
107#[derive(Clone, Default, PartialEq)]
108#[non_exhaustive]
109pub struct SqlBackupRunsGetRequest {
110 /// The ID of this backup run.
111 pub id: i64,
112
113 /// Cloud SQL instance ID. This does not include the project ID.
114 pub instance: std::string::String,
115
116 /// Project ID of the project that contains the instance.
117 pub project: std::string::String,
118
119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
120}
121
122impl SqlBackupRunsGetRequest {
123 /// Creates a new default instance.
124 pub fn new() -> Self {
125 std::default::Default::default()
126 }
127
128 /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
129 ///
130 /// # Example
131 /// ```ignore,no_run
132 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
133 /// let x = SqlBackupRunsGetRequest::new().set_id(42);
134 /// ```
135 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
136 self.id = v.into();
137 self
138 }
139
140 /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
141 ///
142 /// # Example
143 /// ```ignore,no_run
144 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
145 /// let x = SqlBackupRunsGetRequest::new().set_instance("example");
146 /// ```
147 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
148 self.instance = v.into();
149 self
150 }
151
152 /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
153 ///
154 /// # Example
155 /// ```ignore,no_run
156 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
157 /// let x = SqlBackupRunsGetRequest::new().set_project("example");
158 /// ```
159 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
160 self.project = v.into();
161 self
162 }
163}
164
165impl wkt::message::Message for SqlBackupRunsGetRequest {
166 fn typename() -> &'static str {
167 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
168 }
169}
170
171/// Backup runs insert request.
172#[derive(Clone, Default, PartialEq)]
173#[non_exhaustive]
174pub struct SqlBackupRunsInsertRequest {
175 /// Cloud SQL instance ID. This does not include the project ID.
176 pub instance: std::string::String,
177
178 /// Project ID of the project that contains the instance.
179 pub project: std::string::String,
180
181 #[allow(missing_docs)]
182 pub body: std::option::Option<crate::model::BackupRun>,
183
184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
185}
186
187impl SqlBackupRunsInsertRequest {
188 /// Creates a new default instance.
189 pub fn new() -> Self {
190 std::default::Default::default()
191 }
192
193 /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
194 ///
195 /// # Example
196 /// ```ignore,no_run
197 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
198 /// let x = SqlBackupRunsInsertRequest::new().set_instance("example");
199 /// ```
200 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
201 self.instance = v.into();
202 self
203 }
204
205 /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
206 ///
207 /// # Example
208 /// ```ignore,no_run
209 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
210 /// let x = SqlBackupRunsInsertRequest::new().set_project("example");
211 /// ```
212 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
213 self.project = v.into();
214 self
215 }
216
217 /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
218 ///
219 /// # Example
220 /// ```ignore,no_run
221 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
222 /// use google_cloud_sql_v1::model::BackupRun;
223 /// let x = SqlBackupRunsInsertRequest::new().set_body(BackupRun::default()/* use setters */);
224 /// ```
225 pub fn set_body<T>(mut self, v: T) -> Self
226 where
227 T: std::convert::Into<crate::model::BackupRun>,
228 {
229 self.body = std::option::Option::Some(v.into());
230 self
231 }
232
233 /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
234 ///
235 /// # Example
236 /// ```ignore,no_run
237 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
238 /// use google_cloud_sql_v1::model::BackupRun;
239 /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(Some(BackupRun::default()/* use setters */));
240 /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(None::<BackupRun>);
241 /// ```
242 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
243 where
244 T: std::convert::Into<crate::model::BackupRun>,
245 {
246 self.body = v.map(|x| x.into());
247 self
248 }
249}
250
251impl wkt::message::Message for SqlBackupRunsInsertRequest {
252 fn typename() -> &'static str {
253 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
254 }
255}
256
257/// Backup runs list request.
258#[derive(Clone, Default, PartialEq)]
259#[non_exhaustive]
260pub struct SqlBackupRunsListRequest {
261 /// Cloud SQL instance ID, or "-" for all instances. This does not include
262 /// the project ID.
263 pub instance: std::string::String,
264
265 /// Maximum number of backup runs per response.
266 pub max_results: i32,
267
268 /// A previously-returned page token representing part of the larger set of
269 /// results to view.
270 pub page_token: std::string::String,
271
272 /// Project ID of the project that contains the instance.
273 pub project: std::string::String,
274
275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
276}
277
278impl SqlBackupRunsListRequest {
279 /// Creates a new default instance.
280 pub fn new() -> Self {
281 std::default::Default::default()
282 }
283
284 /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
285 ///
286 /// # Example
287 /// ```ignore,no_run
288 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
289 /// let x = SqlBackupRunsListRequest::new().set_instance("example");
290 /// ```
291 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
292 self.instance = v.into();
293 self
294 }
295
296 /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
297 ///
298 /// # Example
299 /// ```ignore,no_run
300 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
301 /// let x = SqlBackupRunsListRequest::new().set_max_results(42);
302 /// ```
303 pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
304 self.max_results = v.into();
305 self
306 }
307
308 /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
309 ///
310 /// # Example
311 /// ```ignore,no_run
312 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
313 /// let x = SqlBackupRunsListRequest::new().set_page_token("example");
314 /// ```
315 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
316 self.page_token = v.into();
317 self
318 }
319
320 /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
321 ///
322 /// # Example
323 /// ```ignore,no_run
324 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
325 /// let x = SqlBackupRunsListRequest::new().set_project("example");
326 /// ```
327 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
328 self.project = v.into();
329 self
330 }
331}
332
333impl wkt::message::Message for SqlBackupRunsListRequest {
334 fn typename() -> &'static str {
335 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
336 }
337}
338
339/// A BackupRun resource.
340#[derive(Clone, Default, PartialEq)]
341#[non_exhaustive]
342pub struct BackupRun {
343 /// This is always `sql#backupRun`.
344 pub kind: std::string::String,
345
346 /// The status of this run.
347 pub status: crate::model::SqlBackupRunStatus,
348
349 /// The time the run was enqueued in UTC timezone in
350 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
351 /// `2012-11-15T16:19:00.094Z`.
352 pub enqueued_time: std::option::Option<wkt::Timestamp>,
353
354 /// The identifier for this backup run. Unique only for a specific Cloud SQL
355 /// instance.
356 pub id: i64,
357
358 /// The time the backup operation actually started in UTC timezone in
359 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
360 /// `2012-11-15T16:19:00.094Z`.
361 pub start_time: std::option::Option<wkt::Timestamp>,
362
363 /// The time the backup operation completed in UTC timezone in
364 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
365 /// `2012-11-15T16:19:00.094Z`.
366 pub end_time: std::option::Option<wkt::Timestamp>,
367
368 /// Information about why the backup operation failed. This is only present if
369 /// the run has the FAILED status.
370 pub error: std::option::Option<crate::model::OperationError>,
371
372 /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
373 /// This field defaults to "ON_DEMAND" and is ignored, when specified for
374 /// insert requests.
375 pub r#type: crate::model::SqlBackupRunType,
376
377 /// The description of this run, only applicable to on-demand backups.
378 pub description: std::string::String,
379
380 /// The start time of the backup window during which this the backup was
381 /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
382 /// example `2012-11-15T16:19:00.094Z`.
383 pub window_start_time: std::option::Option<wkt::Timestamp>,
384
385 /// Name of the database instance.
386 pub instance: std::string::String,
387
388 /// The URI of this resource.
389 pub self_link: std::string::String,
390
391 /// Location of the backups.
392 pub location: std::string::String,
393
394 /// Output only. The instance database version at the time this backup was
395 /// made.
396 pub database_version: crate::model::SqlDatabaseVersion,
397
398 /// Encryption configuration specific to a backup.
399 pub disk_encryption_configuration:
400 std::option::Option<crate::model::DiskEncryptionConfiguration>,
401
402 /// Encryption status specific to a backup.
403 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
404
405 /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
406 pub backup_kind: crate::model::SqlBackupKind,
407
408 /// Backup time zone to prevent restores to an instance with
409 /// a different time zone. Now relevant only for SQL Server.
410 pub time_zone: std::string::String,
411
412 /// Output only. The maximum chargeable bytes for the backup.
413 pub max_chargeable_bytes: std::option::Option<i64>,
414
415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
416}
417
418impl BackupRun {
419 /// Creates a new default instance.
420 pub fn new() -> Self {
421 std::default::Default::default()
422 }
423
424 /// Sets the value of [kind][crate::model::BackupRun::kind].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_sql_v1::model::BackupRun;
429 /// let x = BackupRun::new().set_kind("example");
430 /// ```
431 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
432 self.kind = v.into();
433 self
434 }
435
436 /// Sets the value of [status][crate::model::BackupRun::status].
437 ///
438 /// # Example
439 /// ```ignore,no_run
440 /// # use google_cloud_sql_v1::model::BackupRun;
441 /// use google_cloud_sql_v1::model::SqlBackupRunStatus;
442 /// let x0 = BackupRun::new().set_status(SqlBackupRunStatus::Enqueued);
443 /// let x1 = BackupRun::new().set_status(SqlBackupRunStatus::Overdue);
444 /// let x2 = BackupRun::new().set_status(SqlBackupRunStatus::Running);
445 /// ```
446 pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
447 mut self,
448 v: T,
449 ) -> Self {
450 self.status = v.into();
451 self
452 }
453
454 /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
455 ///
456 /// # Example
457 /// ```ignore,no_run
458 /// # use google_cloud_sql_v1::model::BackupRun;
459 /// use wkt::Timestamp;
460 /// let x = BackupRun::new().set_enqueued_time(Timestamp::default()/* use setters */);
461 /// ```
462 pub fn set_enqueued_time<T>(mut self, v: T) -> Self
463 where
464 T: std::convert::Into<wkt::Timestamp>,
465 {
466 self.enqueued_time = std::option::Option::Some(v.into());
467 self
468 }
469
470 /// Sets or clears the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
471 ///
472 /// # Example
473 /// ```ignore,no_run
474 /// # use google_cloud_sql_v1::model::BackupRun;
475 /// use wkt::Timestamp;
476 /// let x = BackupRun::new().set_or_clear_enqueued_time(Some(Timestamp::default()/* use setters */));
477 /// let x = BackupRun::new().set_or_clear_enqueued_time(None::<Timestamp>);
478 /// ```
479 pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
480 where
481 T: std::convert::Into<wkt::Timestamp>,
482 {
483 self.enqueued_time = v.map(|x| x.into());
484 self
485 }
486
487 /// Sets the value of [id][crate::model::BackupRun::id].
488 ///
489 /// # Example
490 /// ```ignore,no_run
491 /// # use google_cloud_sql_v1::model::BackupRun;
492 /// let x = BackupRun::new().set_id(42);
493 /// ```
494 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
495 self.id = v.into();
496 self
497 }
498
499 /// Sets the value of [start_time][crate::model::BackupRun::start_time].
500 ///
501 /// # Example
502 /// ```ignore,no_run
503 /// # use google_cloud_sql_v1::model::BackupRun;
504 /// use wkt::Timestamp;
505 /// let x = BackupRun::new().set_start_time(Timestamp::default()/* use setters */);
506 /// ```
507 pub fn set_start_time<T>(mut self, v: T) -> Self
508 where
509 T: std::convert::Into<wkt::Timestamp>,
510 {
511 self.start_time = std::option::Option::Some(v.into());
512 self
513 }
514
515 /// Sets or clears the value of [start_time][crate::model::BackupRun::start_time].
516 ///
517 /// # Example
518 /// ```ignore,no_run
519 /// # use google_cloud_sql_v1::model::BackupRun;
520 /// use wkt::Timestamp;
521 /// let x = BackupRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
522 /// let x = BackupRun::new().set_or_clear_start_time(None::<Timestamp>);
523 /// ```
524 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
525 where
526 T: std::convert::Into<wkt::Timestamp>,
527 {
528 self.start_time = v.map(|x| x.into());
529 self
530 }
531
532 /// Sets the value of [end_time][crate::model::BackupRun::end_time].
533 ///
534 /// # Example
535 /// ```ignore,no_run
536 /// # use google_cloud_sql_v1::model::BackupRun;
537 /// use wkt::Timestamp;
538 /// let x = BackupRun::new().set_end_time(Timestamp::default()/* use setters */);
539 /// ```
540 pub fn set_end_time<T>(mut self, v: T) -> Self
541 where
542 T: std::convert::Into<wkt::Timestamp>,
543 {
544 self.end_time = std::option::Option::Some(v.into());
545 self
546 }
547
548 /// Sets or clears the value of [end_time][crate::model::BackupRun::end_time].
549 ///
550 /// # Example
551 /// ```ignore,no_run
552 /// # use google_cloud_sql_v1::model::BackupRun;
553 /// use wkt::Timestamp;
554 /// let x = BackupRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
555 /// let x = BackupRun::new().set_or_clear_end_time(None::<Timestamp>);
556 /// ```
557 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
558 where
559 T: std::convert::Into<wkt::Timestamp>,
560 {
561 self.end_time = v.map(|x| x.into());
562 self
563 }
564
565 /// Sets the value of [error][crate::model::BackupRun::error].
566 ///
567 /// # Example
568 /// ```ignore,no_run
569 /// # use google_cloud_sql_v1::model::BackupRun;
570 /// use google_cloud_sql_v1::model::OperationError;
571 /// let x = BackupRun::new().set_error(OperationError::default()/* use setters */);
572 /// ```
573 pub fn set_error<T>(mut self, v: T) -> Self
574 where
575 T: std::convert::Into<crate::model::OperationError>,
576 {
577 self.error = std::option::Option::Some(v.into());
578 self
579 }
580
581 /// Sets or clears the value of [error][crate::model::BackupRun::error].
582 ///
583 /// # Example
584 /// ```ignore,no_run
585 /// # use google_cloud_sql_v1::model::BackupRun;
586 /// use google_cloud_sql_v1::model::OperationError;
587 /// let x = BackupRun::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
588 /// let x = BackupRun::new().set_or_clear_error(None::<OperationError>);
589 /// ```
590 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
591 where
592 T: std::convert::Into<crate::model::OperationError>,
593 {
594 self.error = v.map(|x| x.into());
595 self
596 }
597
598 /// Sets the value of [r#type][crate::model::BackupRun::type].
599 ///
600 /// # Example
601 /// ```ignore,no_run
602 /// # use google_cloud_sql_v1::model::BackupRun;
603 /// use google_cloud_sql_v1::model::SqlBackupRunType;
604 /// let x0 = BackupRun::new().set_type(SqlBackupRunType::Automated);
605 /// let x1 = BackupRun::new().set_type(SqlBackupRunType::OnDemand);
606 /// ```
607 pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
608 self.r#type = v.into();
609 self
610 }
611
612 /// Sets the value of [description][crate::model::BackupRun::description].
613 ///
614 /// # Example
615 /// ```ignore,no_run
616 /// # use google_cloud_sql_v1::model::BackupRun;
617 /// let x = BackupRun::new().set_description("example");
618 /// ```
619 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
620 self.description = v.into();
621 self
622 }
623
624 /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
625 ///
626 /// # Example
627 /// ```ignore,no_run
628 /// # use google_cloud_sql_v1::model::BackupRun;
629 /// use wkt::Timestamp;
630 /// let x = BackupRun::new().set_window_start_time(Timestamp::default()/* use setters */);
631 /// ```
632 pub fn set_window_start_time<T>(mut self, v: T) -> Self
633 where
634 T: std::convert::Into<wkt::Timestamp>,
635 {
636 self.window_start_time = std::option::Option::Some(v.into());
637 self
638 }
639
640 /// Sets or clears the value of [window_start_time][crate::model::BackupRun::window_start_time].
641 ///
642 /// # Example
643 /// ```ignore,no_run
644 /// # use google_cloud_sql_v1::model::BackupRun;
645 /// use wkt::Timestamp;
646 /// let x = BackupRun::new().set_or_clear_window_start_time(Some(Timestamp::default()/* use setters */));
647 /// let x = BackupRun::new().set_or_clear_window_start_time(None::<Timestamp>);
648 /// ```
649 pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
650 where
651 T: std::convert::Into<wkt::Timestamp>,
652 {
653 self.window_start_time = v.map(|x| x.into());
654 self
655 }
656
657 /// Sets the value of [instance][crate::model::BackupRun::instance].
658 ///
659 /// # Example
660 /// ```ignore,no_run
661 /// # use google_cloud_sql_v1::model::BackupRun;
662 /// let x = BackupRun::new().set_instance("example");
663 /// ```
664 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
665 self.instance = v.into();
666 self
667 }
668
669 /// Sets the value of [self_link][crate::model::BackupRun::self_link].
670 ///
671 /// # Example
672 /// ```ignore,no_run
673 /// # use google_cloud_sql_v1::model::BackupRun;
674 /// let x = BackupRun::new().set_self_link("example");
675 /// ```
676 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
677 self.self_link = v.into();
678 self
679 }
680
681 /// Sets the value of [location][crate::model::BackupRun::location].
682 ///
683 /// # Example
684 /// ```ignore,no_run
685 /// # use google_cloud_sql_v1::model::BackupRun;
686 /// let x = BackupRun::new().set_location("example");
687 /// ```
688 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
689 self.location = v.into();
690 self
691 }
692
693 /// Sets the value of [database_version][crate::model::BackupRun::database_version].
694 ///
695 /// # Example
696 /// ```ignore,no_run
697 /// # use google_cloud_sql_v1::model::BackupRun;
698 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
699 /// let x0 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql56);
700 /// let x1 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql57);
701 /// let x2 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql80);
702 /// ```
703 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
704 mut self,
705 v: T,
706 ) -> Self {
707 self.database_version = v.into();
708 self
709 }
710
711 /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
712 ///
713 /// # Example
714 /// ```ignore,no_run
715 /// # use google_cloud_sql_v1::model::BackupRun;
716 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
717 /// let x = BackupRun::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
718 /// ```
719 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
720 where
721 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
722 {
723 self.disk_encryption_configuration = std::option::Option::Some(v.into());
724 self
725 }
726
727 /// Sets or clears the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
728 ///
729 /// # Example
730 /// ```ignore,no_run
731 /// # use google_cloud_sql_v1::model::BackupRun;
732 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
733 /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
734 /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
735 /// ```
736 pub fn set_or_clear_disk_encryption_configuration<T>(
737 mut self,
738 v: std::option::Option<T>,
739 ) -> Self
740 where
741 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
742 {
743 self.disk_encryption_configuration = v.map(|x| x.into());
744 self
745 }
746
747 /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
748 ///
749 /// # Example
750 /// ```ignore,no_run
751 /// # use google_cloud_sql_v1::model::BackupRun;
752 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
753 /// let x = BackupRun::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
754 /// ```
755 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
756 where
757 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
758 {
759 self.disk_encryption_status = std::option::Option::Some(v.into());
760 self
761 }
762
763 /// Sets or clears the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
764 ///
765 /// # Example
766 /// ```ignore,no_run
767 /// # use google_cloud_sql_v1::model::BackupRun;
768 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
769 /// let x = BackupRun::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
770 /// let x = BackupRun::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
771 /// ```
772 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
773 where
774 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
775 {
776 self.disk_encryption_status = v.map(|x| x.into());
777 self
778 }
779
780 /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
781 ///
782 /// # Example
783 /// ```ignore,no_run
784 /// # use google_cloud_sql_v1::model::BackupRun;
785 /// use google_cloud_sql_v1::model::SqlBackupKind;
786 /// let x0 = BackupRun::new().set_backup_kind(SqlBackupKind::Snapshot);
787 /// let x1 = BackupRun::new().set_backup_kind(SqlBackupKind::Physical);
788 /// ```
789 pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
790 mut self,
791 v: T,
792 ) -> Self {
793 self.backup_kind = v.into();
794 self
795 }
796
797 /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
798 ///
799 /// # Example
800 /// ```ignore,no_run
801 /// # use google_cloud_sql_v1::model::BackupRun;
802 /// let x = BackupRun::new().set_time_zone("example");
803 /// ```
804 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
805 self.time_zone = v.into();
806 self
807 }
808
809 /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
810 ///
811 /// # Example
812 /// ```ignore,no_run
813 /// # use google_cloud_sql_v1::model::BackupRun;
814 /// let x = BackupRun::new().set_max_chargeable_bytes(42);
815 /// ```
816 pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
817 where
818 T: std::convert::Into<i64>,
819 {
820 self.max_chargeable_bytes = std::option::Option::Some(v.into());
821 self
822 }
823
824 /// Sets or clears the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
825 ///
826 /// # Example
827 /// ```ignore,no_run
828 /// # use google_cloud_sql_v1::model::BackupRun;
829 /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(Some(42));
830 /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(None::<i32>);
831 /// ```
832 pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
833 where
834 T: std::convert::Into<i64>,
835 {
836 self.max_chargeable_bytes = v.map(|x| x.into());
837 self
838 }
839}
840
841impl wkt::message::Message for BackupRun {
842 fn typename() -> &'static str {
843 "type.googleapis.com/google.cloud.sql.v1.BackupRun"
844 }
845}
846
847/// Backup run list results.
848#[derive(Clone, Default, PartialEq)]
849#[non_exhaustive]
850pub struct BackupRunsListResponse {
851 /// This is always `sql#backupRunsList`.
852 pub kind: std::string::String,
853
854 /// A list of backup runs in reverse chronological order of the enqueued time.
855 pub items: std::vec::Vec<crate::model::BackupRun>,
856
857 /// The continuation token, used to page through large result sets. Provide
858 /// this value in a subsequent request to return the next page of results.
859 pub next_page_token: std::string::String,
860
861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
862}
863
864impl BackupRunsListResponse {
865 /// Creates a new default instance.
866 pub fn new() -> Self {
867 std::default::Default::default()
868 }
869
870 /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
871 ///
872 /// # Example
873 /// ```ignore,no_run
874 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
875 /// let x = BackupRunsListResponse::new().set_kind("example");
876 /// ```
877 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
878 self.kind = v.into();
879 self
880 }
881
882 /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
883 ///
884 /// # Example
885 /// ```ignore,no_run
886 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
887 /// use google_cloud_sql_v1::model::BackupRun;
888 /// let x = BackupRunsListResponse::new()
889 /// .set_items([
890 /// BackupRun::default()/* use setters */,
891 /// BackupRun::default()/* use (different) setters */,
892 /// ]);
893 /// ```
894 pub fn set_items<T, V>(mut self, v: T) -> Self
895 where
896 T: std::iter::IntoIterator<Item = V>,
897 V: std::convert::Into<crate::model::BackupRun>,
898 {
899 use std::iter::Iterator;
900 self.items = v.into_iter().map(|i| i.into()).collect();
901 self
902 }
903
904 /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
905 ///
906 /// # Example
907 /// ```ignore,no_run
908 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
909 /// let x = BackupRunsListResponse::new().set_next_page_token("example");
910 /// ```
911 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
912 self.next_page_token = v.into();
913 self
914 }
915}
916
917impl wkt::message::Message for BackupRunsListResponse {
918 fn typename() -> &'static str {
919 "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
920 }
921}
922
923#[doc(hidden)]
924impl google_cloud_gax::paginator::internal::PageableResponse for BackupRunsListResponse {
925 type PageItem = crate::model::BackupRun;
926
927 fn items(self) -> std::vec::Vec<Self::PageItem> {
928 self.items
929 }
930
931 fn next_page_token(&self) -> std::string::String {
932 use std::clone::Clone;
933 self.next_page_token.clone()
934 }
935}
936
937/// The request payload to create the backup
938#[derive(Clone, Default, PartialEq)]
939#[non_exhaustive]
940pub struct CreateBackupRequest {
941 /// Required. The parent resource where this backup is created.
942 /// Format: projects/{project}
943 pub parent: std::string::String,
944
945 /// Required. The Backup to create.
946 pub backup: std::option::Option<crate::model::Backup>,
947
948 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
949}
950
951impl CreateBackupRequest {
952 /// Creates a new default instance.
953 pub fn new() -> Self {
954 std::default::Default::default()
955 }
956
957 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
958 ///
959 /// # Example
960 /// ```ignore,no_run
961 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
962 /// # let project_id = "project_id";
963 /// let x = CreateBackupRequest::new().set_parent(format!("projects/{project_id}"));
964 /// ```
965 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
966 self.parent = v.into();
967 self
968 }
969
970 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
971 ///
972 /// # Example
973 /// ```ignore,no_run
974 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
975 /// use google_cloud_sql_v1::model::Backup;
976 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
977 /// ```
978 pub fn set_backup<T>(mut self, v: T) -> Self
979 where
980 T: std::convert::Into<crate::model::Backup>,
981 {
982 self.backup = std::option::Option::Some(v.into());
983 self
984 }
985
986 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
987 ///
988 /// # Example
989 /// ```ignore,no_run
990 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
991 /// use google_cloud_sql_v1::model::Backup;
992 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
993 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
994 /// ```
995 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
996 where
997 T: std::convert::Into<crate::model::Backup>,
998 {
999 self.backup = v.map(|x| x.into());
1000 self
1001 }
1002}
1003
1004impl wkt::message::Message for CreateBackupRequest {
1005 fn typename() -> &'static str {
1006 "type.googleapis.com/google.cloud.sql.v1.CreateBackupRequest"
1007 }
1008}
1009
1010/// The request payload to get the backup.
1011#[derive(Clone, Default, PartialEq)]
1012#[non_exhaustive]
1013pub struct GetBackupRequest {
1014 /// Required. The name of the backup to retrieve.
1015 /// Format: projects/{project}/backups/{backup}
1016 pub name: std::string::String,
1017
1018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1019}
1020
1021impl GetBackupRequest {
1022 /// Creates a new default instance.
1023 pub fn new() -> Self {
1024 std::default::Default::default()
1025 }
1026
1027 /// Sets the value of [name][crate::model::GetBackupRequest::name].
1028 ///
1029 /// # Example
1030 /// ```ignore,no_run
1031 /// # use google_cloud_sql_v1::model::GetBackupRequest;
1032 /// # let project_id = "project_id";
1033 /// # let backup_id = "backup_id";
1034 /// let x = GetBackupRequest::new().set_name(format!("projects/{project_id}/backups/{backup_id}"));
1035 /// ```
1036 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1037 self.name = v.into();
1038 self
1039 }
1040}
1041
1042impl wkt::message::Message for GetBackupRequest {
1043 fn typename() -> &'static str {
1044 "type.googleapis.com/google.cloud.sql.v1.GetBackupRequest"
1045 }
1046}
1047
1048/// The request payload to list the backups.
1049#[derive(Clone, Default, PartialEq)]
1050#[non_exhaustive]
1051pub struct ListBackupsRequest {
1052 /// Required. The parent that owns this collection of backups.
1053 /// Format: projects/{project}
1054 pub parent: std::string::String,
1055
1056 /// The maximum number of backups to return per response. The service might
1057 /// return fewer backups than this value. If a value for this parameter isn't
1058 /// specified, then, at most, 500 backups are returned. The maximum value is
1059 /// 2,000. Any values that you set, which are greater than 2,000, are changed
1060 /// to 2,000.
1061 pub page_size: i32,
1062
1063 /// A page token, received from a previous `ListBackups` call.
1064 /// Provide this to retrieve the subsequent page.
1065 ///
1066 /// When paginating, all other parameters provided to `ListBackups` must match
1067 /// the call that provided the page token.
1068 pub page_token: std::string::String,
1069
1070 /// Multiple filter queries are separated by spaces. For example,
1071 /// 'instance:abc AND type:FINAL, 'location:us',
1072 /// 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
1073 /// type, instance, backupInterval.startTime (creation time), or location.
1074 pub filter: std::string::String,
1075
1076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1077}
1078
1079impl ListBackupsRequest {
1080 /// Creates a new default instance.
1081 pub fn new() -> Self {
1082 std::default::Default::default()
1083 }
1084
1085 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1086 ///
1087 /// # Example
1088 /// ```ignore,no_run
1089 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1090 /// # let project_id = "project_id";
1091 /// let x = ListBackupsRequest::new().set_parent(format!("projects/{project_id}"));
1092 /// ```
1093 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1094 self.parent = v.into();
1095 self
1096 }
1097
1098 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1099 ///
1100 /// # Example
1101 /// ```ignore,no_run
1102 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1103 /// let x = ListBackupsRequest::new().set_page_size(42);
1104 /// ```
1105 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1106 self.page_size = v.into();
1107 self
1108 }
1109
1110 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1111 ///
1112 /// # Example
1113 /// ```ignore,no_run
1114 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1115 /// let x = ListBackupsRequest::new().set_page_token("example");
1116 /// ```
1117 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1118 self.page_token = v.into();
1119 self
1120 }
1121
1122 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1123 ///
1124 /// # Example
1125 /// ```ignore,no_run
1126 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1127 /// let x = ListBackupsRequest::new().set_filter("example");
1128 /// ```
1129 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1130 self.filter = v.into();
1131 self
1132 }
1133}
1134
1135impl wkt::message::Message for ListBackupsRequest {
1136 fn typename() -> &'static str {
1137 "type.googleapis.com/google.cloud.sql.v1.ListBackupsRequest"
1138 }
1139}
1140
1141/// The response payload containing a list of the backups.
1142#[derive(Clone, Default, PartialEq)]
1143#[non_exhaustive]
1144pub struct ListBackupsResponse {
1145 /// A list of backups.
1146 pub backups: std::vec::Vec<crate::model::Backup>,
1147
1148 /// A token, which can be sent as `page_token` to retrieve the next page.
1149 /// If this field is omitted, then there aren't subsequent pages.
1150 pub next_page_token: std::string::String,
1151
1152 /// If a region isn't unavailable or if an unknown error occurs, then a warning
1153 /// message is returned.
1154 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
1155
1156 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1157}
1158
1159impl ListBackupsResponse {
1160 /// Creates a new default instance.
1161 pub fn new() -> Self {
1162 std::default::Default::default()
1163 }
1164
1165 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1166 ///
1167 /// # Example
1168 /// ```ignore,no_run
1169 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1170 /// use google_cloud_sql_v1::model::Backup;
1171 /// let x = ListBackupsResponse::new()
1172 /// .set_backups([
1173 /// Backup::default()/* use setters */,
1174 /// Backup::default()/* use (different) setters */,
1175 /// ]);
1176 /// ```
1177 pub fn set_backups<T, V>(mut self, v: T) -> Self
1178 where
1179 T: std::iter::IntoIterator<Item = V>,
1180 V: std::convert::Into<crate::model::Backup>,
1181 {
1182 use std::iter::Iterator;
1183 self.backups = v.into_iter().map(|i| i.into()).collect();
1184 self
1185 }
1186
1187 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1188 ///
1189 /// # Example
1190 /// ```ignore,no_run
1191 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1192 /// let x = ListBackupsResponse::new().set_next_page_token("example");
1193 /// ```
1194 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1195 self.next_page_token = v.into();
1196 self
1197 }
1198
1199 /// Sets the value of [warnings][crate::model::ListBackupsResponse::warnings].
1200 ///
1201 /// # Example
1202 /// ```ignore,no_run
1203 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1204 /// use google_cloud_sql_v1::model::ApiWarning;
1205 /// let x = ListBackupsResponse::new()
1206 /// .set_warnings([
1207 /// ApiWarning::default()/* use setters */,
1208 /// ApiWarning::default()/* use (different) setters */,
1209 /// ]);
1210 /// ```
1211 pub fn set_warnings<T, V>(mut self, v: T) -> Self
1212 where
1213 T: std::iter::IntoIterator<Item = V>,
1214 V: std::convert::Into<crate::model::ApiWarning>,
1215 {
1216 use std::iter::Iterator;
1217 self.warnings = v.into_iter().map(|i| i.into()).collect();
1218 self
1219 }
1220}
1221
1222impl wkt::message::Message for ListBackupsResponse {
1223 fn typename() -> &'static str {
1224 "type.googleapis.com/google.cloud.sql.v1.ListBackupsResponse"
1225 }
1226}
1227
1228#[doc(hidden)]
1229impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1230 type PageItem = crate::model::Backup;
1231
1232 fn items(self) -> std::vec::Vec<Self::PageItem> {
1233 self.backups
1234 }
1235
1236 fn next_page_token(&self) -> std::string::String {
1237 use std::clone::Clone;
1238 self.next_page_token.clone()
1239 }
1240}
1241
1242/// The request payload to update the backup.
1243#[derive(Clone, Default, PartialEq)]
1244#[non_exhaustive]
1245pub struct UpdateBackupRequest {
1246 /// Required. The backup to update.
1247 /// The backup’s `name` field is used to identify the backup to update.
1248 /// Format: projects/{project}/backups/{backup}
1249 pub backup: std::option::Option<crate::model::Backup>,
1250
1251 /// The list of fields that you can update. You can update only the description
1252 /// and retention period of the final backup.
1253 pub update_mask: std::option::Option<wkt::FieldMask>,
1254
1255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1256}
1257
1258impl UpdateBackupRequest {
1259 /// Creates a new default instance.
1260 pub fn new() -> Self {
1261 std::default::Default::default()
1262 }
1263
1264 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1265 ///
1266 /// # Example
1267 /// ```ignore,no_run
1268 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1269 /// use google_cloud_sql_v1::model::Backup;
1270 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1271 /// ```
1272 pub fn set_backup<T>(mut self, v: T) -> Self
1273 where
1274 T: std::convert::Into<crate::model::Backup>,
1275 {
1276 self.backup = std::option::Option::Some(v.into());
1277 self
1278 }
1279
1280 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
1281 ///
1282 /// # Example
1283 /// ```ignore,no_run
1284 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1285 /// use google_cloud_sql_v1::model::Backup;
1286 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
1287 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
1288 /// ```
1289 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1290 where
1291 T: std::convert::Into<crate::model::Backup>,
1292 {
1293 self.backup = v.map(|x| x.into());
1294 self
1295 }
1296
1297 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1298 ///
1299 /// # Example
1300 /// ```ignore,no_run
1301 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1302 /// use wkt::FieldMask;
1303 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1304 /// ```
1305 pub fn set_update_mask<T>(mut self, v: T) -> Self
1306 where
1307 T: std::convert::Into<wkt::FieldMask>,
1308 {
1309 self.update_mask = std::option::Option::Some(v.into());
1310 self
1311 }
1312
1313 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1314 ///
1315 /// # Example
1316 /// ```ignore,no_run
1317 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1318 /// use wkt::FieldMask;
1319 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1320 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1321 /// ```
1322 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1323 where
1324 T: std::convert::Into<wkt::FieldMask>,
1325 {
1326 self.update_mask = v.map(|x| x.into());
1327 self
1328 }
1329}
1330
1331impl wkt::message::Message for UpdateBackupRequest {
1332 fn typename() -> &'static str {
1333 "type.googleapis.com/google.cloud.sql.v1.UpdateBackupRequest"
1334 }
1335}
1336
1337/// The request payload to delete the backup.
1338#[derive(Clone, Default, PartialEq)]
1339#[non_exhaustive]
1340pub struct DeleteBackupRequest {
1341 /// Required. The name of the backup to delete.
1342 /// Format: projects/{project}/backups/{backup}
1343 pub name: std::string::String,
1344
1345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1346}
1347
1348impl DeleteBackupRequest {
1349 /// Creates a new default instance.
1350 pub fn new() -> Self {
1351 std::default::Default::default()
1352 }
1353
1354 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1355 ///
1356 /// # Example
1357 /// ```ignore,no_run
1358 /// # use google_cloud_sql_v1::model::DeleteBackupRequest;
1359 /// # let project_id = "project_id";
1360 /// # let backup_id = "backup_id";
1361 /// let x = DeleteBackupRequest::new().set_name(format!("projects/{project_id}/backups/{backup_id}"));
1362 /// ```
1363 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1364 self.name = v.into();
1365 self
1366 }
1367}
1368
1369impl wkt::message::Message for DeleteBackupRequest {
1370 fn typename() -> &'static str {
1371 "type.googleapis.com/google.cloud.sql.v1.DeleteBackupRequest"
1372 }
1373}
1374
1375/// A backup resource.
1376#[derive(Clone, Default, PartialEq)]
1377#[non_exhaustive]
1378pub struct Backup {
1379 /// Output only. The resource name of the backup.
1380 /// Format: projects/{project}/backups/{backup}.
1381 pub name: std::string::String,
1382
1383 /// Output only. This is always `sql#backup`.
1384 pub kind: std::string::String,
1385
1386 /// Output only. The URI of this resource.
1387 pub self_link: std::string::String,
1388
1389 /// Output only. The type of this backup. The type can be "AUTOMATED",
1390 /// "ON_DEMAND" or “FINAL”.
1391 pub r#type: crate::model::backup::SqlBackupType,
1392
1393 /// The description of this backup.
1394 pub description: std::string::String,
1395
1396 /// The name of the source database instance.
1397 pub instance: std::string::String,
1398
1399 /// The storage location of the backups. The location can be multi-regional.
1400 pub location: std::string::String,
1401
1402 /// Output only. This output contains the following values:
1403 /// start_time: All database writes up to this time are available.
1404 /// end_time: Any database writes after this time aren't available.
1405 pub backup_interval: std::option::Option<google_cloud_type::model::Interval>,
1406
1407 /// Output only. The status of this backup.
1408 pub state: crate::model::backup::SqlBackupState,
1409
1410 /// Output only. Information about why the backup operation fails (for example,
1411 /// when the backup state fails).
1412 pub error: std::option::Option<crate::model::OperationError>,
1413
1414 /// Output only. This output contains the encryption configuration for a backup
1415 /// and the resource name of the KMS key for disk encryption.
1416 pub kms_key: std::string::String,
1417
1418 /// Output only. This output contains the encryption status for a backup and
1419 /// the version of the KMS key that's used to encrypt the Cloud SQL instance.
1420 pub kms_key_version: std::string::String,
1421
1422 /// Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
1423 pub backup_kind: crate::model::SqlBackupKind,
1424
1425 /// Output only. This output contains a backup time zone. If a Cloud SQL for
1426 /// SQL Server instance has a different time zone from the backup's time zone,
1427 /// then the restore to the instance doesn't happen.
1428 pub time_zone: std::string::String,
1429
1430 /// Output only. The database version of the instance of at the time this
1431 /// backup was made.
1432 pub database_version: crate::model::SqlDatabaseVersion,
1433
1434 /// Output only. The maximum chargeable bytes for the backup.
1435 pub max_chargeable_bytes: std::option::Option<i64>,
1436
1437 /// Optional. Output only. Timestamp in UTC of when the instance associated
1438 /// with this backup is deleted.
1439 pub instance_deletion_time: std::option::Option<wkt::Timestamp>,
1440
1441 /// Optional. Output only. The instance setting of the source instance that's
1442 /// associated with this backup.
1443 pub instance_settings: std::option::Option<crate::model::DatabaseInstance>,
1444
1445 /// Output only. The mapping to backup run resource used for IAM validations.
1446 pub backup_run: std::string::String,
1447
1448 /// Output only. This status indicates whether the backup satisfies PZS.
1449 ///
1450 /// The status is reserved for future use.
1451 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
1452
1453 /// Output only. This status indicates whether the backup satisfies PZI.
1454 ///
1455 /// The status is reserved for future use.
1456 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
1457
1458 #[allow(missing_docs)]
1459 pub expiration: std::option::Option<crate::model::backup::Expiration>,
1460
1461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1462}
1463
1464impl Backup {
1465 /// Creates a new default instance.
1466 pub fn new() -> Self {
1467 std::default::Default::default()
1468 }
1469
1470 /// Sets the value of [name][crate::model::Backup::name].
1471 ///
1472 /// # Example
1473 /// ```ignore,no_run
1474 /// # use google_cloud_sql_v1::model::Backup;
1475 /// # let project_id = "project_id";
1476 /// # let backup_id = "backup_id";
1477 /// let x = Backup::new().set_name(format!("projects/{project_id}/backups/{backup_id}"));
1478 /// ```
1479 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1480 self.name = v.into();
1481 self
1482 }
1483
1484 /// Sets the value of [kind][crate::model::Backup::kind].
1485 ///
1486 /// # Example
1487 /// ```ignore,no_run
1488 /// # use google_cloud_sql_v1::model::Backup;
1489 /// let x = Backup::new().set_kind("example");
1490 /// ```
1491 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1492 self.kind = v.into();
1493 self
1494 }
1495
1496 /// Sets the value of [self_link][crate::model::Backup::self_link].
1497 ///
1498 /// # Example
1499 /// ```ignore,no_run
1500 /// # use google_cloud_sql_v1::model::Backup;
1501 /// let x = Backup::new().set_self_link("example");
1502 /// ```
1503 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1504 self.self_link = v.into();
1505 self
1506 }
1507
1508 /// Sets the value of [r#type][crate::model::Backup::type].
1509 ///
1510 /// # Example
1511 /// ```ignore,no_run
1512 /// # use google_cloud_sql_v1::model::Backup;
1513 /// use google_cloud_sql_v1::model::backup::SqlBackupType;
1514 /// let x0 = Backup::new().set_type(SqlBackupType::Automated);
1515 /// let x1 = Backup::new().set_type(SqlBackupType::OnDemand);
1516 /// let x2 = Backup::new().set_type(SqlBackupType::Final);
1517 /// ```
1518 pub fn set_type<T: std::convert::Into<crate::model::backup::SqlBackupType>>(
1519 mut self,
1520 v: T,
1521 ) -> Self {
1522 self.r#type = v.into();
1523 self
1524 }
1525
1526 /// Sets the value of [description][crate::model::Backup::description].
1527 ///
1528 /// # Example
1529 /// ```ignore,no_run
1530 /// # use google_cloud_sql_v1::model::Backup;
1531 /// let x = Backup::new().set_description("example");
1532 /// ```
1533 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1534 self.description = v.into();
1535 self
1536 }
1537
1538 /// Sets the value of [instance][crate::model::Backup::instance].
1539 ///
1540 /// # Example
1541 /// ```ignore,no_run
1542 /// # use google_cloud_sql_v1::model::Backup;
1543 /// let x = Backup::new().set_instance("example");
1544 /// ```
1545 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.instance = v.into();
1547 self
1548 }
1549
1550 /// Sets the value of [location][crate::model::Backup::location].
1551 ///
1552 /// # Example
1553 /// ```ignore,no_run
1554 /// # use google_cloud_sql_v1::model::Backup;
1555 /// let x = Backup::new().set_location("example");
1556 /// ```
1557 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1558 self.location = v.into();
1559 self
1560 }
1561
1562 /// Sets the value of [backup_interval][crate::model::Backup::backup_interval].
1563 ///
1564 /// # Example
1565 /// ```ignore,no_run
1566 /// # use google_cloud_sql_v1::model::Backup;
1567 /// use google_cloud_type::model::Interval;
1568 /// let x = Backup::new().set_backup_interval(Interval::default()/* use setters */);
1569 /// ```
1570 pub fn set_backup_interval<T>(mut self, v: T) -> Self
1571 where
1572 T: std::convert::Into<google_cloud_type::model::Interval>,
1573 {
1574 self.backup_interval = std::option::Option::Some(v.into());
1575 self
1576 }
1577
1578 /// Sets or clears the value of [backup_interval][crate::model::Backup::backup_interval].
1579 ///
1580 /// # Example
1581 /// ```ignore,no_run
1582 /// # use google_cloud_sql_v1::model::Backup;
1583 /// use google_cloud_type::model::Interval;
1584 /// let x = Backup::new().set_or_clear_backup_interval(Some(Interval::default()/* use setters */));
1585 /// let x = Backup::new().set_or_clear_backup_interval(None::<Interval>);
1586 /// ```
1587 pub fn set_or_clear_backup_interval<T>(mut self, v: std::option::Option<T>) -> Self
1588 where
1589 T: std::convert::Into<google_cloud_type::model::Interval>,
1590 {
1591 self.backup_interval = v.map(|x| x.into());
1592 self
1593 }
1594
1595 /// Sets the value of [state][crate::model::Backup::state].
1596 ///
1597 /// # Example
1598 /// ```ignore,no_run
1599 /// # use google_cloud_sql_v1::model::Backup;
1600 /// use google_cloud_sql_v1::model::backup::SqlBackupState;
1601 /// let x0 = Backup::new().set_state(SqlBackupState::Enqueued);
1602 /// let x1 = Backup::new().set_state(SqlBackupState::Running);
1603 /// let x2 = Backup::new().set_state(SqlBackupState::Failed);
1604 /// ```
1605 pub fn set_state<T: std::convert::Into<crate::model::backup::SqlBackupState>>(
1606 mut self,
1607 v: T,
1608 ) -> Self {
1609 self.state = v.into();
1610 self
1611 }
1612
1613 /// Sets the value of [error][crate::model::Backup::error].
1614 ///
1615 /// # Example
1616 /// ```ignore,no_run
1617 /// # use google_cloud_sql_v1::model::Backup;
1618 /// use google_cloud_sql_v1::model::OperationError;
1619 /// let x = Backup::new().set_error(OperationError::default()/* use setters */);
1620 /// ```
1621 pub fn set_error<T>(mut self, v: T) -> Self
1622 where
1623 T: std::convert::Into<crate::model::OperationError>,
1624 {
1625 self.error = std::option::Option::Some(v.into());
1626 self
1627 }
1628
1629 /// Sets or clears the value of [error][crate::model::Backup::error].
1630 ///
1631 /// # Example
1632 /// ```ignore,no_run
1633 /// # use google_cloud_sql_v1::model::Backup;
1634 /// use google_cloud_sql_v1::model::OperationError;
1635 /// let x = Backup::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
1636 /// let x = Backup::new().set_or_clear_error(None::<OperationError>);
1637 /// ```
1638 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1639 where
1640 T: std::convert::Into<crate::model::OperationError>,
1641 {
1642 self.error = v.map(|x| x.into());
1643 self
1644 }
1645
1646 /// Sets the value of [kms_key][crate::model::Backup::kms_key].
1647 ///
1648 /// # Example
1649 /// ```ignore,no_run
1650 /// # use google_cloud_sql_v1::model::Backup;
1651 /// let x = Backup::new().set_kms_key("example");
1652 /// ```
1653 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.kms_key = v.into();
1655 self
1656 }
1657
1658 /// Sets the value of [kms_key_version][crate::model::Backup::kms_key_version].
1659 ///
1660 /// # Example
1661 /// ```ignore,no_run
1662 /// # use google_cloud_sql_v1::model::Backup;
1663 /// let x = Backup::new().set_kms_key_version("example");
1664 /// ```
1665 pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1666 self.kms_key_version = v.into();
1667 self
1668 }
1669
1670 /// Sets the value of [backup_kind][crate::model::Backup::backup_kind].
1671 ///
1672 /// # Example
1673 /// ```ignore,no_run
1674 /// # use google_cloud_sql_v1::model::Backup;
1675 /// use google_cloud_sql_v1::model::SqlBackupKind;
1676 /// let x0 = Backup::new().set_backup_kind(SqlBackupKind::Snapshot);
1677 /// let x1 = Backup::new().set_backup_kind(SqlBackupKind::Physical);
1678 /// ```
1679 pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
1680 mut self,
1681 v: T,
1682 ) -> Self {
1683 self.backup_kind = v.into();
1684 self
1685 }
1686
1687 /// Sets the value of [time_zone][crate::model::Backup::time_zone].
1688 ///
1689 /// # Example
1690 /// ```ignore,no_run
1691 /// # use google_cloud_sql_v1::model::Backup;
1692 /// let x = Backup::new().set_time_zone("example");
1693 /// ```
1694 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1695 self.time_zone = v.into();
1696 self
1697 }
1698
1699 /// Sets the value of [database_version][crate::model::Backup::database_version].
1700 ///
1701 /// # Example
1702 /// ```ignore,no_run
1703 /// # use google_cloud_sql_v1::model::Backup;
1704 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
1705 /// let x0 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql56);
1706 /// let x1 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql57);
1707 /// let x2 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql80);
1708 /// ```
1709 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
1710 mut self,
1711 v: T,
1712 ) -> Self {
1713 self.database_version = v.into();
1714 self
1715 }
1716
1717 /// Sets the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1718 ///
1719 /// # Example
1720 /// ```ignore,no_run
1721 /// # use google_cloud_sql_v1::model::Backup;
1722 /// let x = Backup::new().set_max_chargeable_bytes(42);
1723 /// ```
1724 pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
1725 where
1726 T: std::convert::Into<i64>,
1727 {
1728 self.max_chargeable_bytes = std::option::Option::Some(v.into());
1729 self
1730 }
1731
1732 /// Sets or clears the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1733 ///
1734 /// # Example
1735 /// ```ignore,no_run
1736 /// # use google_cloud_sql_v1::model::Backup;
1737 /// let x = Backup::new().set_or_clear_max_chargeable_bytes(Some(42));
1738 /// let x = Backup::new().set_or_clear_max_chargeable_bytes(None::<i32>);
1739 /// ```
1740 pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
1741 where
1742 T: std::convert::Into<i64>,
1743 {
1744 self.max_chargeable_bytes = v.map(|x| x.into());
1745 self
1746 }
1747
1748 /// Sets the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1749 ///
1750 /// # Example
1751 /// ```ignore,no_run
1752 /// # use google_cloud_sql_v1::model::Backup;
1753 /// use wkt::Timestamp;
1754 /// let x = Backup::new().set_instance_deletion_time(Timestamp::default()/* use setters */);
1755 /// ```
1756 pub fn set_instance_deletion_time<T>(mut self, v: T) -> Self
1757 where
1758 T: std::convert::Into<wkt::Timestamp>,
1759 {
1760 self.instance_deletion_time = std::option::Option::Some(v.into());
1761 self
1762 }
1763
1764 /// Sets or clears the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1765 ///
1766 /// # Example
1767 /// ```ignore,no_run
1768 /// # use google_cloud_sql_v1::model::Backup;
1769 /// use wkt::Timestamp;
1770 /// let x = Backup::new().set_or_clear_instance_deletion_time(Some(Timestamp::default()/* use setters */));
1771 /// let x = Backup::new().set_or_clear_instance_deletion_time(None::<Timestamp>);
1772 /// ```
1773 pub fn set_or_clear_instance_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
1774 where
1775 T: std::convert::Into<wkt::Timestamp>,
1776 {
1777 self.instance_deletion_time = v.map(|x| x.into());
1778 self
1779 }
1780
1781 /// Sets the value of [instance_settings][crate::model::Backup::instance_settings].
1782 ///
1783 /// # Example
1784 /// ```ignore,no_run
1785 /// # use google_cloud_sql_v1::model::Backup;
1786 /// use google_cloud_sql_v1::model::DatabaseInstance;
1787 /// let x = Backup::new().set_instance_settings(DatabaseInstance::default()/* use setters */);
1788 /// ```
1789 pub fn set_instance_settings<T>(mut self, v: T) -> Self
1790 where
1791 T: std::convert::Into<crate::model::DatabaseInstance>,
1792 {
1793 self.instance_settings = std::option::Option::Some(v.into());
1794 self
1795 }
1796
1797 /// Sets or clears the value of [instance_settings][crate::model::Backup::instance_settings].
1798 ///
1799 /// # Example
1800 /// ```ignore,no_run
1801 /// # use google_cloud_sql_v1::model::Backup;
1802 /// use google_cloud_sql_v1::model::DatabaseInstance;
1803 /// let x = Backup::new().set_or_clear_instance_settings(Some(DatabaseInstance::default()/* use setters */));
1804 /// let x = Backup::new().set_or_clear_instance_settings(None::<DatabaseInstance>);
1805 /// ```
1806 pub fn set_or_clear_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
1807 where
1808 T: std::convert::Into<crate::model::DatabaseInstance>,
1809 {
1810 self.instance_settings = v.map(|x| x.into());
1811 self
1812 }
1813
1814 /// Sets the value of [backup_run][crate::model::Backup::backup_run].
1815 ///
1816 /// # Example
1817 /// ```ignore,no_run
1818 /// # use google_cloud_sql_v1::model::Backup;
1819 /// let x = Backup::new().set_backup_run("example");
1820 /// ```
1821 pub fn set_backup_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1822 self.backup_run = v.into();
1823 self
1824 }
1825
1826 /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1827 ///
1828 /// # Example
1829 /// ```ignore,no_run
1830 /// # use google_cloud_sql_v1::model::Backup;
1831 /// use wkt::BoolValue;
1832 /// let x = Backup::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
1833 /// ```
1834 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
1835 where
1836 T: std::convert::Into<wkt::BoolValue>,
1837 {
1838 self.satisfies_pzs = std::option::Option::Some(v.into());
1839 self
1840 }
1841
1842 /// Sets or clears the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1843 ///
1844 /// # Example
1845 /// ```ignore,no_run
1846 /// # use google_cloud_sql_v1::model::Backup;
1847 /// use wkt::BoolValue;
1848 /// let x = Backup::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
1849 /// let x = Backup::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
1850 /// ```
1851 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
1852 where
1853 T: std::convert::Into<wkt::BoolValue>,
1854 {
1855 self.satisfies_pzs = v.map(|x| x.into());
1856 self
1857 }
1858
1859 /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1860 ///
1861 /// # Example
1862 /// ```ignore,no_run
1863 /// # use google_cloud_sql_v1::model::Backup;
1864 /// use wkt::BoolValue;
1865 /// let x = Backup::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
1866 /// ```
1867 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
1868 where
1869 T: std::convert::Into<wkt::BoolValue>,
1870 {
1871 self.satisfies_pzi = std::option::Option::Some(v.into());
1872 self
1873 }
1874
1875 /// Sets or clears the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1876 ///
1877 /// # Example
1878 /// ```ignore,no_run
1879 /// # use google_cloud_sql_v1::model::Backup;
1880 /// use wkt::BoolValue;
1881 /// let x = Backup::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
1882 /// let x = Backup::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
1883 /// ```
1884 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
1885 where
1886 T: std::convert::Into<wkt::BoolValue>,
1887 {
1888 self.satisfies_pzi = v.map(|x| x.into());
1889 self
1890 }
1891
1892 /// Sets the value of [expiration][crate::model::Backup::expiration].
1893 ///
1894 /// Note that all the setters affecting `expiration` are mutually
1895 /// exclusive.
1896 ///
1897 /// # Example
1898 /// ```ignore,no_run
1899 /// # use google_cloud_sql_v1::model::Backup;
1900 /// use google_cloud_sql_v1::model::backup::Expiration;
1901 /// let x = Backup::new().set_expiration(Some(Expiration::TtlDays(42)));
1902 /// ```
1903 pub fn set_expiration<
1904 T: std::convert::Into<std::option::Option<crate::model::backup::Expiration>>,
1905 >(
1906 mut self,
1907 v: T,
1908 ) -> Self {
1909 self.expiration = v.into();
1910 self
1911 }
1912
1913 /// The value of [expiration][crate::model::Backup::expiration]
1914 /// if it holds a `TtlDays`, `None` if the field is not set or
1915 /// holds a different branch.
1916 pub fn ttl_days(&self) -> std::option::Option<&i64> {
1917 #[allow(unreachable_patterns)]
1918 self.expiration.as_ref().and_then(|v| match v {
1919 crate::model::backup::Expiration::TtlDays(v) => std::option::Option::Some(v),
1920 _ => std::option::Option::None,
1921 })
1922 }
1923
1924 /// Sets the value of [expiration][crate::model::Backup::expiration]
1925 /// to hold a `TtlDays`.
1926 ///
1927 /// Note that all the setters affecting `expiration` are
1928 /// mutually exclusive.
1929 ///
1930 /// # Example
1931 /// ```ignore,no_run
1932 /// # use google_cloud_sql_v1::model::Backup;
1933 /// let x = Backup::new().set_ttl_days(42);
1934 /// assert!(x.ttl_days().is_some());
1935 /// assert!(x.expiry_time().is_none());
1936 /// ```
1937 pub fn set_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1938 self.expiration =
1939 std::option::Option::Some(crate::model::backup::Expiration::TtlDays(v.into()));
1940 self
1941 }
1942
1943 /// The value of [expiration][crate::model::Backup::expiration]
1944 /// if it holds a `ExpiryTime`, `None` if the field is not set or
1945 /// holds a different branch.
1946 pub fn expiry_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1947 #[allow(unreachable_patterns)]
1948 self.expiration.as_ref().and_then(|v| match v {
1949 crate::model::backup::Expiration::ExpiryTime(v) => std::option::Option::Some(v),
1950 _ => std::option::Option::None,
1951 })
1952 }
1953
1954 /// Sets the value of [expiration][crate::model::Backup::expiration]
1955 /// to hold a `ExpiryTime`.
1956 ///
1957 /// Note that all the setters affecting `expiration` are
1958 /// mutually exclusive.
1959 ///
1960 /// # Example
1961 /// ```ignore,no_run
1962 /// # use google_cloud_sql_v1::model::Backup;
1963 /// use wkt::Timestamp;
1964 /// let x = Backup::new().set_expiry_time(Timestamp::default()/* use setters */);
1965 /// assert!(x.expiry_time().is_some());
1966 /// assert!(x.ttl_days().is_none());
1967 /// ```
1968 pub fn set_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1969 mut self,
1970 v: T,
1971 ) -> Self {
1972 self.expiration =
1973 std::option::Option::Some(crate::model::backup::Expiration::ExpiryTime(v.into()));
1974 self
1975 }
1976}
1977
1978impl wkt::message::Message for Backup {
1979 fn typename() -> &'static str {
1980 "type.googleapis.com/google.cloud.sql.v1.Backup"
1981 }
1982}
1983
1984/// Defines additional types related to [Backup].
1985pub mod backup {
1986 #[allow(unused_imports)]
1987 use super::*;
1988
1989 /// The backup type.
1990 ///
1991 /// # Working with unknown values
1992 ///
1993 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1994 /// additional enum variants at any time. Adding new variants is not considered
1995 /// a breaking change. Applications should write their code in anticipation of:
1996 ///
1997 /// - New values appearing in future releases of the client library, **and**
1998 /// - New values received dynamically, without application changes.
1999 ///
2000 /// Please consult the [Working with enums] section in the user guide for some
2001 /// guidelines.
2002 ///
2003 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2004 #[derive(Clone, Debug, PartialEq)]
2005 #[non_exhaustive]
2006 pub enum SqlBackupType {
2007 /// This is an unknown backup type.
2008 Unspecified,
2009 /// The backup schedule triggers a backup automatically.
2010 Automated,
2011 /// The user triggers a backup manually.
2012 OnDemand,
2013 /// The backup created when instance is deleted.
2014 Final,
2015 /// If set, the enum was initialized with an unknown value.
2016 ///
2017 /// Applications can examine the value using [SqlBackupType::value] or
2018 /// [SqlBackupType::name].
2019 UnknownValue(sql_backup_type::UnknownValue),
2020 }
2021
2022 #[doc(hidden)]
2023 pub mod sql_backup_type {
2024 #[allow(unused_imports)]
2025 use super::*;
2026 #[derive(Clone, Debug, PartialEq)]
2027 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2028 }
2029
2030 impl SqlBackupType {
2031 /// Gets the enum value.
2032 ///
2033 /// Returns `None` if the enum contains an unknown value deserialized from
2034 /// the string representation of enums.
2035 pub fn value(&self) -> std::option::Option<i32> {
2036 match self {
2037 Self::Unspecified => std::option::Option::Some(0),
2038 Self::Automated => std::option::Option::Some(1),
2039 Self::OnDemand => std::option::Option::Some(2),
2040 Self::Final => std::option::Option::Some(3),
2041 Self::UnknownValue(u) => u.0.value(),
2042 }
2043 }
2044
2045 /// Gets the enum value as a string.
2046 ///
2047 /// Returns `None` if the enum contains an unknown value deserialized from
2048 /// the integer representation of enums.
2049 pub fn name(&self) -> std::option::Option<&str> {
2050 match self {
2051 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_TYPE_UNSPECIFIED"),
2052 Self::Automated => std::option::Option::Some("AUTOMATED"),
2053 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
2054 Self::Final => std::option::Option::Some("FINAL"),
2055 Self::UnknownValue(u) => u.0.name(),
2056 }
2057 }
2058 }
2059
2060 impl std::default::Default for SqlBackupType {
2061 fn default() -> Self {
2062 use std::convert::From;
2063 Self::from(0)
2064 }
2065 }
2066
2067 impl std::fmt::Display for SqlBackupType {
2068 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2069 wkt::internal::display_enum(f, self.name(), self.value())
2070 }
2071 }
2072
2073 impl std::convert::From<i32> for SqlBackupType {
2074 fn from(value: i32) -> Self {
2075 match value {
2076 0 => Self::Unspecified,
2077 1 => Self::Automated,
2078 2 => Self::OnDemand,
2079 3 => Self::Final,
2080 _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2081 wkt::internal::UnknownEnumValue::Integer(value),
2082 )),
2083 }
2084 }
2085 }
2086
2087 impl std::convert::From<&str> for SqlBackupType {
2088 fn from(value: &str) -> Self {
2089 use std::string::ToString;
2090 match value {
2091 "SQL_BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
2092 "AUTOMATED" => Self::Automated,
2093 "ON_DEMAND" => Self::OnDemand,
2094 "FINAL" => Self::Final,
2095 _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2096 wkt::internal::UnknownEnumValue::String(value.to_string()),
2097 )),
2098 }
2099 }
2100 }
2101
2102 impl serde::ser::Serialize for SqlBackupType {
2103 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2104 where
2105 S: serde::Serializer,
2106 {
2107 match self {
2108 Self::Unspecified => serializer.serialize_i32(0),
2109 Self::Automated => serializer.serialize_i32(1),
2110 Self::OnDemand => serializer.serialize_i32(2),
2111 Self::Final => serializer.serialize_i32(3),
2112 Self::UnknownValue(u) => u.0.serialize(serializer),
2113 }
2114 }
2115 }
2116
2117 impl<'de> serde::de::Deserialize<'de> for SqlBackupType {
2118 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2119 where
2120 D: serde::Deserializer<'de>,
2121 {
2122 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupType>::new(
2123 ".google.cloud.sql.v1.Backup.SqlBackupType",
2124 ))
2125 }
2126 }
2127
2128 /// The backup's state
2129 ///
2130 /// # Working with unknown values
2131 ///
2132 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2133 /// additional enum variants at any time. Adding new variants is not considered
2134 /// a breaking change. Applications should write their code in anticipation of:
2135 ///
2136 /// - New values appearing in future releases of the client library, **and**
2137 /// - New values received dynamically, without application changes.
2138 ///
2139 /// Please consult the [Working with enums] section in the user guide for some
2140 /// guidelines.
2141 ///
2142 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2143 #[derive(Clone, Debug, PartialEq)]
2144 #[non_exhaustive]
2145 pub enum SqlBackupState {
2146 /// The state of the backup is unknown.
2147 Unspecified,
2148 /// The backup that's added to a queue.
2149 Enqueued,
2150 /// The backup is in progress.
2151 Running,
2152 /// The backup failed.
2153 Failed,
2154 /// The backup is successful.
2155 Successful,
2156 /// The backup is being deleted.
2157 Deleting,
2158 /// Deletion of the backup failed.
2159 DeletionFailed,
2160 /// If set, the enum was initialized with an unknown value.
2161 ///
2162 /// Applications can examine the value using [SqlBackupState::value] or
2163 /// [SqlBackupState::name].
2164 UnknownValue(sql_backup_state::UnknownValue),
2165 }
2166
2167 #[doc(hidden)]
2168 pub mod sql_backup_state {
2169 #[allow(unused_imports)]
2170 use super::*;
2171 #[derive(Clone, Debug, PartialEq)]
2172 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2173 }
2174
2175 impl SqlBackupState {
2176 /// Gets the enum value.
2177 ///
2178 /// Returns `None` if the enum contains an unknown value deserialized from
2179 /// the string representation of enums.
2180 pub fn value(&self) -> std::option::Option<i32> {
2181 match self {
2182 Self::Unspecified => std::option::Option::Some(0),
2183 Self::Enqueued => std::option::Option::Some(1),
2184 Self::Running => std::option::Option::Some(2),
2185 Self::Failed => std::option::Option::Some(3),
2186 Self::Successful => std::option::Option::Some(4),
2187 Self::Deleting => std::option::Option::Some(5),
2188 Self::DeletionFailed => std::option::Option::Some(6),
2189 Self::UnknownValue(u) => u.0.value(),
2190 }
2191 }
2192
2193 /// Gets the enum value as a string.
2194 ///
2195 /// Returns `None` if the enum contains an unknown value deserialized from
2196 /// the integer representation of enums.
2197 pub fn name(&self) -> std::option::Option<&str> {
2198 match self {
2199 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_STATE_UNSPECIFIED"),
2200 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
2201 Self::Running => std::option::Option::Some("RUNNING"),
2202 Self::Failed => std::option::Option::Some("FAILED"),
2203 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
2204 Self::Deleting => std::option::Option::Some("DELETING"),
2205 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
2206 Self::UnknownValue(u) => u.0.name(),
2207 }
2208 }
2209 }
2210
2211 impl std::default::Default for SqlBackupState {
2212 fn default() -> Self {
2213 use std::convert::From;
2214 Self::from(0)
2215 }
2216 }
2217
2218 impl std::fmt::Display for SqlBackupState {
2219 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2220 wkt::internal::display_enum(f, self.name(), self.value())
2221 }
2222 }
2223
2224 impl std::convert::From<i32> for SqlBackupState {
2225 fn from(value: i32) -> Self {
2226 match value {
2227 0 => Self::Unspecified,
2228 1 => Self::Enqueued,
2229 2 => Self::Running,
2230 3 => Self::Failed,
2231 4 => Self::Successful,
2232 5 => Self::Deleting,
2233 6 => Self::DeletionFailed,
2234 _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2235 wkt::internal::UnknownEnumValue::Integer(value),
2236 )),
2237 }
2238 }
2239 }
2240
2241 impl std::convert::From<&str> for SqlBackupState {
2242 fn from(value: &str) -> Self {
2243 use std::string::ToString;
2244 match value {
2245 "SQL_BACKUP_STATE_UNSPECIFIED" => Self::Unspecified,
2246 "ENQUEUED" => Self::Enqueued,
2247 "RUNNING" => Self::Running,
2248 "FAILED" => Self::Failed,
2249 "SUCCESSFUL" => Self::Successful,
2250 "DELETING" => Self::Deleting,
2251 "DELETION_FAILED" => Self::DeletionFailed,
2252 _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2253 wkt::internal::UnknownEnumValue::String(value.to_string()),
2254 )),
2255 }
2256 }
2257 }
2258
2259 impl serde::ser::Serialize for SqlBackupState {
2260 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2261 where
2262 S: serde::Serializer,
2263 {
2264 match self {
2265 Self::Unspecified => serializer.serialize_i32(0),
2266 Self::Enqueued => serializer.serialize_i32(1),
2267 Self::Running => serializer.serialize_i32(2),
2268 Self::Failed => serializer.serialize_i32(3),
2269 Self::Successful => serializer.serialize_i32(4),
2270 Self::Deleting => serializer.serialize_i32(5),
2271 Self::DeletionFailed => serializer.serialize_i32(6),
2272 Self::UnknownValue(u) => u.0.serialize(serializer),
2273 }
2274 }
2275 }
2276
2277 impl<'de> serde::de::Deserialize<'de> for SqlBackupState {
2278 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2279 where
2280 D: serde::Deserializer<'de>,
2281 {
2282 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupState>::new(
2283 ".google.cloud.sql.v1.Backup.SqlBackupState",
2284 ))
2285 }
2286 }
2287
2288 #[allow(missing_docs)]
2289 #[derive(Clone, Debug, PartialEq)]
2290 #[non_exhaustive]
2291 pub enum Expiration {
2292 /// Input only. The time-to-live (TTL) interval for this resource (in days).
2293 /// For example: ttlDays:7, means 7 days from the current time. The
2294 /// expiration time can't exceed 365 days from the time that the backup is
2295 /// created.
2296 TtlDays(i64),
2297 /// Backup expiration time.
2298 /// A UTC timestamp of when this backup expired.
2299 ExpiryTime(std::boxed::Box<wkt::Timestamp>),
2300 }
2301}
2302
2303/// Connect settings retrieval request.
2304#[derive(Clone, Default, PartialEq)]
2305#[non_exhaustive]
2306pub struct GetConnectSettingsRequest {
2307 /// Cloud SQL instance ID. This does not include the project ID.
2308 pub instance: std::string::String,
2309
2310 /// Project ID of the project that contains the instance.
2311 pub project: std::string::String,
2312
2313 /// Optional. Optional snapshot read timestamp to trade freshness for
2314 /// performance.
2315 pub read_time: std::option::Option<wkt::Timestamp>,
2316
2317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2318}
2319
2320impl GetConnectSettingsRequest {
2321 /// Creates a new default instance.
2322 pub fn new() -> Self {
2323 std::default::Default::default()
2324 }
2325
2326 /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
2327 ///
2328 /// # Example
2329 /// ```ignore,no_run
2330 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2331 /// let x = GetConnectSettingsRequest::new().set_instance("example");
2332 /// ```
2333 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2334 self.instance = v.into();
2335 self
2336 }
2337
2338 /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
2339 ///
2340 /// # Example
2341 /// ```ignore,no_run
2342 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2343 /// let x = GetConnectSettingsRequest::new().set_project("example");
2344 /// ```
2345 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2346 self.project = v.into();
2347 self
2348 }
2349
2350 /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2351 ///
2352 /// # Example
2353 /// ```ignore,no_run
2354 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2355 /// use wkt::Timestamp;
2356 /// let x = GetConnectSettingsRequest::new().set_read_time(Timestamp::default()/* use setters */);
2357 /// ```
2358 pub fn set_read_time<T>(mut self, v: T) -> Self
2359 where
2360 T: std::convert::Into<wkt::Timestamp>,
2361 {
2362 self.read_time = std::option::Option::Some(v.into());
2363 self
2364 }
2365
2366 /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2367 ///
2368 /// # Example
2369 /// ```ignore,no_run
2370 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2371 /// use wkt::Timestamp;
2372 /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
2373 /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(None::<Timestamp>);
2374 /// ```
2375 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
2376 where
2377 T: std::convert::Into<wkt::Timestamp>,
2378 {
2379 self.read_time = v.map(|x| x.into());
2380 self
2381 }
2382}
2383
2384impl wkt::message::Message for GetConnectSettingsRequest {
2385 fn typename() -> &'static str {
2386 "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
2387 }
2388}
2389
2390/// Connect settings retrieval request.
2391#[derive(Clone, Default, PartialEq)]
2392#[non_exhaustive]
2393pub struct ResolveConnectSettingsRequest {
2394 /// Required. Cloud SQL instance ID. This does not include the project ID.
2395 pub dns_name: std::string::String,
2396
2397 /// Required. The region of the instance.
2398 pub location: std::string::String,
2399
2400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2401}
2402
2403impl ResolveConnectSettingsRequest {
2404 /// Creates a new default instance.
2405 pub fn new() -> Self {
2406 std::default::Default::default()
2407 }
2408
2409 /// Sets the value of [dns_name][crate::model::ResolveConnectSettingsRequest::dns_name].
2410 ///
2411 /// # Example
2412 /// ```ignore,no_run
2413 /// # use google_cloud_sql_v1::model::ResolveConnectSettingsRequest;
2414 /// let x = ResolveConnectSettingsRequest::new().set_dns_name("example");
2415 /// ```
2416 pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2417 self.dns_name = v.into();
2418 self
2419 }
2420
2421 /// Sets the value of [location][crate::model::ResolveConnectSettingsRequest::location].
2422 ///
2423 /// # Example
2424 /// ```ignore,no_run
2425 /// # use google_cloud_sql_v1::model::ResolveConnectSettingsRequest;
2426 /// let x = ResolveConnectSettingsRequest::new().set_location("example");
2427 /// ```
2428 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2429 self.location = v.into();
2430 self
2431 }
2432}
2433
2434impl wkt::message::Message for ResolveConnectSettingsRequest {
2435 fn typename() -> &'static str {
2436 "type.googleapis.com/google.cloud.sql.v1.ResolveConnectSettingsRequest"
2437 }
2438}
2439
2440/// Connect settings retrieval response.
2441#[derive(Clone, Default, PartialEq)]
2442#[non_exhaustive]
2443pub struct ConnectSettings {
2444 /// This is always `sql#connectSettings`.
2445 pub kind: std::string::String,
2446
2447 /// SSL configuration.
2448 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
2449
2450 /// The assigned IP addresses for the instance.
2451 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2452
2453 /// The cloud region for the instance. For example, `us-central1`,
2454 /// `europe-west1`. The region cannot be changed after instance creation.
2455 pub region: std::string::String,
2456
2457 /// The database engine type and version. The `databaseVersion`
2458 /// field cannot be changed after instance creation.
2459 /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
2460 /// or `MYSQL_5_6`.
2461 /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
2462 /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
2463 /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
2464 /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
2465 /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
2466 /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
2467 /// `SQLSERVER_2019_WEB`.
2468 pub database_version: crate::model::SqlDatabaseVersion,
2469
2470 /// `SECOND_GEN`: Cloud SQL database instance.
2471 /// `EXTERNAL`: A database server that is not managed by Google.
2472 /// This property is read-only; use the `tier` property in the `settings`
2473 /// object to determine the database type.
2474 pub backend_type: crate::model::SqlBackendType,
2475
2476 /// Whether PSC connectivity is enabled for this instance.
2477 pub psc_enabled: bool,
2478
2479 /// The dns name of the instance.
2480 pub dns_name: std::string::String,
2481
2482 /// Specify what type of CA is used for the server certificate.
2483 pub server_ca_mode: crate::model::connect_settings::CaMode,
2484
2485 /// Custom subject alternative names for the server certificate.
2486 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
2487
2488 /// Output only. The list of DNS names used by this instance.
2489 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2490
2491 /// The number of read pool nodes in a read pool.
2492 pub node_count: std::option::Option<i32>,
2493
2494 /// Output only. Entries containing information about each read pool node of
2495 /// the read pool.
2496 pub nodes: std::vec::Vec<crate::model::connect_settings::ConnectPoolNodeConfig>,
2497
2498 /// Optional. Output only. mdx_protocol_support controls how the client uses
2499 /// metadata exchange when connecting to the instance. The values in the list
2500 /// representing parts of the MDX protocol that are supported by this instance.
2501 /// When the list is empty, the instance does not support MDX, so the client
2502 /// must not send an MDX request. The default is empty.
2503 pub mdx_protocol_support: std::vec::Vec<crate::model::connect_settings::MdxProtocolSupport>,
2504
2505 /// Optional. Output only. Connection name of the Cloud SQL instance used in
2506 /// connection strings, in the format project:region:instance.
2507 pub connection_name: std::string::String,
2508
2509 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2510}
2511
2512impl ConnectSettings {
2513 /// Creates a new default instance.
2514 pub fn new() -> Self {
2515 std::default::Default::default()
2516 }
2517
2518 /// Sets the value of [kind][crate::model::ConnectSettings::kind].
2519 ///
2520 /// # Example
2521 /// ```ignore,no_run
2522 /// # use google_cloud_sql_v1::model::ConnectSettings;
2523 /// let x = ConnectSettings::new().set_kind("example");
2524 /// ```
2525 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2526 self.kind = v.into();
2527 self
2528 }
2529
2530 /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2531 ///
2532 /// # Example
2533 /// ```ignore,no_run
2534 /// # use google_cloud_sql_v1::model::ConnectSettings;
2535 /// use google_cloud_sql_v1::model::SslCert;
2536 /// let x = ConnectSettings::new().set_server_ca_cert(SslCert::default()/* use setters */);
2537 /// ```
2538 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
2539 where
2540 T: std::convert::Into<crate::model::SslCert>,
2541 {
2542 self.server_ca_cert = std::option::Option::Some(v.into());
2543 self
2544 }
2545
2546 /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2547 ///
2548 /// # Example
2549 /// ```ignore,no_run
2550 /// # use google_cloud_sql_v1::model::ConnectSettings;
2551 /// use google_cloud_sql_v1::model::SslCert;
2552 /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
2553 /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(None::<SslCert>);
2554 /// ```
2555 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
2556 where
2557 T: std::convert::Into<crate::model::SslCert>,
2558 {
2559 self.server_ca_cert = v.map(|x| x.into());
2560 self
2561 }
2562
2563 /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
2564 ///
2565 /// # Example
2566 /// ```ignore,no_run
2567 /// # use google_cloud_sql_v1::model::ConnectSettings;
2568 /// use google_cloud_sql_v1::model::IpMapping;
2569 /// let x = ConnectSettings::new()
2570 /// .set_ip_addresses([
2571 /// IpMapping::default()/* use setters */,
2572 /// IpMapping::default()/* use (different) setters */,
2573 /// ]);
2574 /// ```
2575 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2576 where
2577 T: std::iter::IntoIterator<Item = V>,
2578 V: std::convert::Into<crate::model::IpMapping>,
2579 {
2580 use std::iter::Iterator;
2581 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2582 self
2583 }
2584
2585 /// Sets the value of [region][crate::model::ConnectSettings::region].
2586 ///
2587 /// # Example
2588 /// ```ignore,no_run
2589 /// # use google_cloud_sql_v1::model::ConnectSettings;
2590 /// let x = ConnectSettings::new().set_region("example");
2591 /// ```
2592 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2593 self.region = v.into();
2594 self
2595 }
2596
2597 /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
2598 ///
2599 /// # Example
2600 /// ```ignore,no_run
2601 /// # use google_cloud_sql_v1::model::ConnectSettings;
2602 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
2603 /// let x0 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
2604 /// let x1 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
2605 /// let x2 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql80);
2606 /// ```
2607 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
2608 mut self,
2609 v: T,
2610 ) -> Self {
2611 self.database_version = v.into();
2612 self
2613 }
2614
2615 /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
2616 ///
2617 /// # Example
2618 /// ```ignore,no_run
2619 /// # use google_cloud_sql_v1::model::ConnectSettings;
2620 /// use google_cloud_sql_v1::model::SqlBackendType;
2621 /// let x0 = ConnectSettings::new().set_backend_type(SqlBackendType::SecondGen);
2622 /// let x1 = ConnectSettings::new().set_backend_type(SqlBackendType::External);
2623 /// ```
2624 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
2625 mut self,
2626 v: T,
2627 ) -> Self {
2628 self.backend_type = v.into();
2629 self
2630 }
2631
2632 /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
2633 ///
2634 /// # Example
2635 /// ```ignore,no_run
2636 /// # use google_cloud_sql_v1::model::ConnectSettings;
2637 /// let x = ConnectSettings::new().set_psc_enabled(true);
2638 /// ```
2639 pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2640 self.psc_enabled = v.into();
2641 self
2642 }
2643
2644 /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
2645 ///
2646 /// # Example
2647 /// ```ignore,no_run
2648 /// # use google_cloud_sql_v1::model::ConnectSettings;
2649 /// let x = ConnectSettings::new().set_dns_name("example");
2650 /// ```
2651 pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2652 self.dns_name = v.into();
2653 self
2654 }
2655
2656 /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
2657 ///
2658 /// # Example
2659 /// ```ignore,no_run
2660 /// # use google_cloud_sql_v1::model::ConnectSettings;
2661 /// use google_cloud_sql_v1::model::connect_settings::CaMode;
2662 /// let x0 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
2663 /// let x1 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
2664 /// let x2 = ConnectSettings::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
2665 /// ```
2666 pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
2667 mut self,
2668 v: T,
2669 ) -> Self {
2670 self.server_ca_mode = v.into();
2671 self
2672 }
2673
2674 /// Sets the value of [custom_subject_alternative_names][crate::model::ConnectSettings::custom_subject_alternative_names].
2675 ///
2676 /// # Example
2677 /// ```ignore,no_run
2678 /// # use google_cloud_sql_v1::model::ConnectSettings;
2679 /// let x = ConnectSettings::new().set_custom_subject_alternative_names(["a", "b", "c"]);
2680 /// ```
2681 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
2682 where
2683 T: std::iter::IntoIterator<Item = V>,
2684 V: std::convert::Into<std::string::String>,
2685 {
2686 use std::iter::Iterator;
2687 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
2688 self
2689 }
2690
2691 /// Sets the value of [dns_names][crate::model::ConnectSettings::dns_names].
2692 ///
2693 /// # Example
2694 /// ```ignore,no_run
2695 /// # use google_cloud_sql_v1::model::ConnectSettings;
2696 /// use google_cloud_sql_v1::model::DnsNameMapping;
2697 /// let x = ConnectSettings::new()
2698 /// .set_dns_names([
2699 /// DnsNameMapping::default()/* use setters */,
2700 /// DnsNameMapping::default()/* use (different) setters */,
2701 /// ]);
2702 /// ```
2703 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2704 where
2705 T: std::iter::IntoIterator<Item = V>,
2706 V: std::convert::Into<crate::model::DnsNameMapping>,
2707 {
2708 use std::iter::Iterator;
2709 self.dns_names = v.into_iter().map(|i| i.into()).collect();
2710 self
2711 }
2712
2713 /// Sets the value of [node_count][crate::model::ConnectSettings::node_count].
2714 ///
2715 /// # Example
2716 /// ```ignore,no_run
2717 /// # use google_cloud_sql_v1::model::ConnectSettings;
2718 /// let x = ConnectSettings::new().set_node_count(42);
2719 /// ```
2720 pub fn set_node_count<T>(mut self, v: T) -> Self
2721 where
2722 T: std::convert::Into<i32>,
2723 {
2724 self.node_count = std::option::Option::Some(v.into());
2725 self
2726 }
2727
2728 /// Sets or clears the value of [node_count][crate::model::ConnectSettings::node_count].
2729 ///
2730 /// # Example
2731 /// ```ignore,no_run
2732 /// # use google_cloud_sql_v1::model::ConnectSettings;
2733 /// let x = ConnectSettings::new().set_or_clear_node_count(Some(42));
2734 /// let x = ConnectSettings::new().set_or_clear_node_count(None::<i32>);
2735 /// ```
2736 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
2737 where
2738 T: std::convert::Into<i32>,
2739 {
2740 self.node_count = v.map(|x| x.into());
2741 self
2742 }
2743
2744 /// Sets the value of [nodes][crate::model::ConnectSettings::nodes].
2745 ///
2746 /// # Example
2747 /// ```ignore,no_run
2748 /// # use google_cloud_sql_v1::model::ConnectSettings;
2749 /// use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2750 /// let x = ConnectSettings::new()
2751 /// .set_nodes([
2752 /// ConnectPoolNodeConfig::default()/* use setters */,
2753 /// ConnectPoolNodeConfig::default()/* use (different) setters */,
2754 /// ]);
2755 /// ```
2756 pub fn set_nodes<T, V>(mut self, v: T) -> Self
2757 where
2758 T: std::iter::IntoIterator<Item = V>,
2759 V: std::convert::Into<crate::model::connect_settings::ConnectPoolNodeConfig>,
2760 {
2761 use std::iter::Iterator;
2762 self.nodes = v.into_iter().map(|i| i.into()).collect();
2763 self
2764 }
2765
2766 /// Sets the value of [mdx_protocol_support][crate::model::ConnectSettings::mdx_protocol_support].
2767 ///
2768 /// # Example
2769 /// ```ignore,no_run
2770 /// # use google_cloud_sql_v1::model::ConnectSettings;
2771 /// use google_cloud_sql_v1::model::connect_settings::MdxProtocolSupport;
2772 /// let x = ConnectSettings::new().set_mdx_protocol_support([
2773 /// MdxProtocolSupport::ClientProtocolType,
2774 /// ]);
2775 /// ```
2776 pub fn set_mdx_protocol_support<T, V>(mut self, v: T) -> Self
2777 where
2778 T: std::iter::IntoIterator<Item = V>,
2779 V: std::convert::Into<crate::model::connect_settings::MdxProtocolSupport>,
2780 {
2781 use std::iter::Iterator;
2782 self.mdx_protocol_support = v.into_iter().map(|i| i.into()).collect();
2783 self
2784 }
2785
2786 /// Sets the value of [connection_name][crate::model::ConnectSettings::connection_name].
2787 ///
2788 /// # Example
2789 /// ```ignore,no_run
2790 /// # use google_cloud_sql_v1::model::ConnectSettings;
2791 /// let x = ConnectSettings::new().set_connection_name("example");
2792 /// ```
2793 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2794 self.connection_name = v.into();
2795 self
2796 }
2797}
2798
2799impl wkt::message::Message for ConnectSettings {
2800 fn typename() -> &'static str {
2801 "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
2802 }
2803}
2804
2805/// Defines additional types related to [ConnectSettings].
2806pub mod connect_settings {
2807 #[allow(unused_imports)]
2808 use super::*;
2809
2810 /// Details of a single read pool node of a read pool.
2811 #[derive(Clone, Default, PartialEq)]
2812 #[non_exhaustive]
2813 pub struct ConnectPoolNodeConfig {
2814 /// Output only. The name of the read pool node. Doesn't include the project
2815 /// ID.
2816 pub name: std::option::Option<std::string::String>,
2817
2818 /// Output only. Mappings containing IP addresses that can be used to connect
2819 /// to the read pool node.
2820 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2821
2822 /// Output only. The DNS name of the read pool node.
2823 pub dns_name: std::option::Option<std::string::String>,
2824
2825 /// Output only. The list of DNS names used by this read pool node.
2826 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2827
2828 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2829 }
2830
2831 impl ConnectPoolNodeConfig {
2832 /// Creates a new default instance.
2833 pub fn new() -> Self {
2834 std::default::Default::default()
2835 }
2836
2837 /// Sets the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2838 ///
2839 /// # Example
2840 /// ```ignore,no_run
2841 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2842 /// let x = ConnectPoolNodeConfig::new().set_name("example");
2843 /// ```
2844 pub fn set_name<T>(mut self, v: T) -> Self
2845 where
2846 T: std::convert::Into<std::string::String>,
2847 {
2848 self.name = std::option::Option::Some(v.into());
2849 self
2850 }
2851
2852 /// Sets or clears the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2853 ///
2854 /// # Example
2855 /// ```ignore,no_run
2856 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2857 /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(Some("example"));
2858 /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(None::<String>);
2859 /// ```
2860 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
2861 where
2862 T: std::convert::Into<std::string::String>,
2863 {
2864 self.name = v.map(|x| x.into());
2865 self
2866 }
2867
2868 /// Sets the value of [ip_addresses][crate::model::connect_settings::ConnectPoolNodeConfig::ip_addresses].
2869 ///
2870 /// # Example
2871 /// ```ignore,no_run
2872 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2873 /// use google_cloud_sql_v1::model::IpMapping;
2874 /// let x = ConnectPoolNodeConfig::new()
2875 /// .set_ip_addresses([
2876 /// IpMapping::default()/* use setters */,
2877 /// IpMapping::default()/* use (different) setters */,
2878 /// ]);
2879 /// ```
2880 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2881 where
2882 T: std::iter::IntoIterator<Item = V>,
2883 V: std::convert::Into<crate::model::IpMapping>,
2884 {
2885 use std::iter::Iterator;
2886 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2887 self
2888 }
2889
2890 /// Sets the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2891 ///
2892 /// # Example
2893 /// ```ignore,no_run
2894 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2895 /// let x = ConnectPoolNodeConfig::new().set_dns_name("example");
2896 /// ```
2897 pub fn set_dns_name<T>(mut self, v: T) -> Self
2898 where
2899 T: std::convert::Into<std::string::String>,
2900 {
2901 self.dns_name = std::option::Option::Some(v.into());
2902 self
2903 }
2904
2905 /// Sets or clears the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2906 ///
2907 /// # Example
2908 /// ```ignore,no_run
2909 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2910 /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
2911 /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
2912 /// ```
2913 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
2914 where
2915 T: std::convert::Into<std::string::String>,
2916 {
2917 self.dns_name = v.map(|x| x.into());
2918 self
2919 }
2920
2921 /// Sets the value of [dns_names][crate::model::connect_settings::ConnectPoolNodeConfig::dns_names].
2922 ///
2923 /// # Example
2924 /// ```ignore,no_run
2925 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2926 /// use google_cloud_sql_v1::model::DnsNameMapping;
2927 /// let x = ConnectPoolNodeConfig::new()
2928 /// .set_dns_names([
2929 /// DnsNameMapping::default()/* use setters */,
2930 /// DnsNameMapping::default()/* use (different) setters */,
2931 /// ]);
2932 /// ```
2933 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2934 where
2935 T: std::iter::IntoIterator<Item = V>,
2936 V: std::convert::Into<crate::model::DnsNameMapping>,
2937 {
2938 use std::iter::Iterator;
2939 self.dns_names = v.into_iter().map(|i| i.into()).collect();
2940 self
2941 }
2942 }
2943
2944 impl wkt::message::Message for ConnectPoolNodeConfig {
2945 fn typename() -> &'static str {
2946 "type.googleapis.com/google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig"
2947 }
2948 }
2949
2950 /// Various Certificate Authority (CA) modes for certificate signing.
2951 ///
2952 /// # Working with unknown values
2953 ///
2954 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2955 /// additional enum variants at any time. Adding new variants is not considered
2956 /// a breaking change. Applications should write their code in anticipation of:
2957 ///
2958 /// - New values appearing in future releases of the client library, **and**
2959 /// - New values received dynamically, without application changes.
2960 ///
2961 /// Please consult the [Working with enums] section in the user guide for some
2962 /// guidelines.
2963 ///
2964 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2965 #[derive(Clone, Debug, PartialEq)]
2966 #[non_exhaustive]
2967 pub enum CaMode {
2968 /// CA mode is unknown.
2969 Unspecified,
2970 /// Google-managed self-signed internal CA.
2971 GoogleManagedInternalCa,
2972 /// Google-managed regional CA part of root CA hierarchy hosted on Google
2973 /// Cloud's Certificate Authority Service (CAS).
2974 GoogleManagedCasCa,
2975 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
2976 /// Service (CAS).
2977 CustomerManagedCasCa,
2978 /// If set, the enum was initialized with an unknown value.
2979 ///
2980 /// Applications can examine the value using [CaMode::value] or
2981 /// [CaMode::name].
2982 UnknownValue(ca_mode::UnknownValue),
2983 }
2984
2985 #[doc(hidden)]
2986 pub mod ca_mode {
2987 #[allow(unused_imports)]
2988 use super::*;
2989 #[derive(Clone, Debug, PartialEq)]
2990 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2991 }
2992
2993 impl CaMode {
2994 /// Gets the enum value.
2995 ///
2996 /// Returns `None` if the enum contains an unknown value deserialized from
2997 /// the string representation of enums.
2998 pub fn value(&self) -> std::option::Option<i32> {
2999 match self {
3000 Self::Unspecified => std::option::Option::Some(0),
3001 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
3002 Self::GoogleManagedCasCa => std::option::Option::Some(2),
3003 Self::CustomerManagedCasCa => std::option::Option::Some(3),
3004 Self::UnknownValue(u) => u.0.value(),
3005 }
3006 }
3007
3008 /// Gets the enum value as a string.
3009 ///
3010 /// Returns `None` if the enum contains an unknown value deserialized from
3011 /// the integer representation of enums.
3012 pub fn name(&self) -> std::option::Option<&str> {
3013 match self {
3014 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
3015 Self::GoogleManagedInternalCa => {
3016 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
3017 }
3018 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
3019 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
3020 Self::UnknownValue(u) => u.0.name(),
3021 }
3022 }
3023 }
3024
3025 impl std::default::Default for CaMode {
3026 fn default() -> Self {
3027 use std::convert::From;
3028 Self::from(0)
3029 }
3030 }
3031
3032 impl std::fmt::Display for CaMode {
3033 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3034 wkt::internal::display_enum(f, self.name(), self.value())
3035 }
3036 }
3037
3038 impl std::convert::From<i32> for CaMode {
3039 fn from(value: i32) -> Self {
3040 match value {
3041 0 => Self::Unspecified,
3042 1 => Self::GoogleManagedInternalCa,
3043 2 => Self::GoogleManagedCasCa,
3044 3 => Self::CustomerManagedCasCa,
3045 _ => Self::UnknownValue(ca_mode::UnknownValue(
3046 wkt::internal::UnknownEnumValue::Integer(value),
3047 )),
3048 }
3049 }
3050 }
3051
3052 impl std::convert::From<&str> for CaMode {
3053 fn from(value: &str) -> Self {
3054 use std::string::ToString;
3055 match value {
3056 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
3057 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
3058 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
3059 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
3060 _ => Self::UnknownValue(ca_mode::UnknownValue(
3061 wkt::internal::UnknownEnumValue::String(value.to_string()),
3062 )),
3063 }
3064 }
3065 }
3066
3067 impl serde::ser::Serialize for CaMode {
3068 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3069 where
3070 S: serde::Serializer,
3071 {
3072 match self {
3073 Self::Unspecified => serializer.serialize_i32(0),
3074 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
3075 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
3076 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
3077 Self::UnknownValue(u) => u.0.serialize(serializer),
3078 }
3079 }
3080 }
3081
3082 impl<'de> serde::de::Deserialize<'de> for CaMode {
3083 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3084 where
3085 D: serde::Deserializer<'de>,
3086 {
3087 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
3088 ".google.cloud.sql.v1.ConnectSettings.CaMode",
3089 ))
3090 }
3091 }
3092
3093 /// MdxProtocolSupport describes parts of the MDX protocol supported by this
3094 /// instance.
3095 ///
3096 /// # Working with unknown values
3097 ///
3098 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3099 /// additional enum variants at any time. Adding new variants is not considered
3100 /// a breaking change. Applications should write their code in anticipation of:
3101 ///
3102 /// - New values appearing in future releases of the client library, **and**
3103 /// - New values received dynamically, without application changes.
3104 ///
3105 /// Please consult the [Working with enums] section in the user guide for some
3106 /// guidelines.
3107 ///
3108 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3109 #[derive(Clone, Debug, PartialEq)]
3110 #[non_exhaustive]
3111 pub enum MdxProtocolSupport {
3112 /// Not specified.
3113 Unspecified,
3114 /// Client should send the client protocol type in the MDX request.
3115 ClientProtocolType,
3116 /// If set, the enum was initialized with an unknown value.
3117 ///
3118 /// Applications can examine the value using [MdxProtocolSupport::value] or
3119 /// [MdxProtocolSupport::name].
3120 UnknownValue(mdx_protocol_support::UnknownValue),
3121 }
3122
3123 #[doc(hidden)]
3124 pub mod mdx_protocol_support {
3125 #[allow(unused_imports)]
3126 use super::*;
3127 #[derive(Clone, Debug, PartialEq)]
3128 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3129 }
3130
3131 impl MdxProtocolSupport {
3132 /// Gets the enum value.
3133 ///
3134 /// Returns `None` if the enum contains an unknown value deserialized from
3135 /// the string representation of enums.
3136 pub fn value(&self) -> std::option::Option<i32> {
3137 match self {
3138 Self::Unspecified => std::option::Option::Some(0),
3139 Self::ClientProtocolType => std::option::Option::Some(1),
3140 Self::UnknownValue(u) => u.0.value(),
3141 }
3142 }
3143
3144 /// Gets the enum value as a string.
3145 ///
3146 /// Returns `None` if the enum contains an unknown value deserialized from
3147 /// the integer representation of enums.
3148 pub fn name(&self) -> std::option::Option<&str> {
3149 match self {
3150 Self::Unspecified => std::option::Option::Some("MDX_PROTOCOL_SUPPORT_UNSPECIFIED"),
3151 Self::ClientProtocolType => std::option::Option::Some("CLIENT_PROTOCOL_TYPE"),
3152 Self::UnknownValue(u) => u.0.name(),
3153 }
3154 }
3155 }
3156
3157 impl std::default::Default for MdxProtocolSupport {
3158 fn default() -> Self {
3159 use std::convert::From;
3160 Self::from(0)
3161 }
3162 }
3163
3164 impl std::fmt::Display for MdxProtocolSupport {
3165 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3166 wkt::internal::display_enum(f, self.name(), self.value())
3167 }
3168 }
3169
3170 impl std::convert::From<i32> for MdxProtocolSupport {
3171 fn from(value: i32) -> Self {
3172 match value {
3173 0 => Self::Unspecified,
3174 1 => Self::ClientProtocolType,
3175 _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3176 wkt::internal::UnknownEnumValue::Integer(value),
3177 )),
3178 }
3179 }
3180 }
3181
3182 impl std::convert::From<&str> for MdxProtocolSupport {
3183 fn from(value: &str) -> Self {
3184 use std::string::ToString;
3185 match value {
3186 "MDX_PROTOCOL_SUPPORT_UNSPECIFIED" => Self::Unspecified,
3187 "CLIENT_PROTOCOL_TYPE" => Self::ClientProtocolType,
3188 _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3189 wkt::internal::UnknownEnumValue::String(value.to_string()),
3190 )),
3191 }
3192 }
3193 }
3194
3195 impl serde::ser::Serialize for MdxProtocolSupport {
3196 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3197 where
3198 S: serde::Serializer,
3199 {
3200 match self {
3201 Self::Unspecified => serializer.serialize_i32(0),
3202 Self::ClientProtocolType => serializer.serialize_i32(1),
3203 Self::UnknownValue(u) => u.0.serialize(serializer),
3204 }
3205 }
3206 }
3207
3208 impl<'de> serde::de::Deserialize<'de> for MdxProtocolSupport {
3209 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3210 where
3211 D: serde::Deserializer<'de>,
3212 {
3213 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MdxProtocolSupport>::new(
3214 ".google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport",
3215 ))
3216 }
3217 }
3218}
3219
3220/// Ephemeral certificate creation request.
3221#[derive(Clone, Default, PartialEq)]
3222#[non_exhaustive]
3223pub struct GenerateEphemeralCertRequest {
3224 /// Cloud SQL instance ID. This does not include the project ID.
3225 pub instance: std::string::String,
3226
3227 /// Project ID of the project that contains the instance.
3228 pub project: std::string::String,
3229
3230 /// PEM encoded public key to include in the signed certificate.
3231 pub public_key: std::string::String,
3232
3233 /// Optional. Access token to include in the signed certificate.
3234 pub access_token: std::string::String,
3235
3236 /// Optional. Optional snapshot read timestamp to trade freshness for
3237 /// performance.
3238 pub read_time: std::option::Option<wkt::Timestamp>,
3239
3240 /// Optional. If set, it will contain the cert valid duration.
3241 pub valid_duration: std::option::Option<wkt::Duration>,
3242
3243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3244}
3245
3246impl GenerateEphemeralCertRequest {
3247 /// Creates a new default instance.
3248 pub fn new() -> Self {
3249 std::default::Default::default()
3250 }
3251
3252 /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
3253 ///
3254 /// # Example
3255 /// ```ignore,no_run
3256 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3257 /// let x = GenerateEphemeralCertRequest::new().set_instance("example");
3258 /// ```
3259 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3260 self.instance = v.into();
3261 self
3262 }
3263
3264 /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
3265 ///
3266 /// # Example
3267 /// ```ignore,no_run
3268 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3269 /// let x = GenerateEphemeralCertRequest::new().set_project("example");
3270 /// ```
3271 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3272 self.project = v.into();
3273 self
3274 }
3275
3276 /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
3277 ///
3278 /// # Example
3279 /// ```ignore,no_run
3280 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3281 /// let x = GenerateEphemeralCertRequest::new().set_public_key("example");
3282 /// ```
3283 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3284 self.public_key = v.into();
3285 self
3286 }
3287
3288 /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
3289 ///
3290 /// # Example
3291 /// ```ignore,no_run
3292 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3293 /// let x = GenerateEphemeralCertRequest::new().set_access_token("example");
3294 /// ```
3295 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.access_token = v.into();
3297 self
3298 }
3299
3300 /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3301 ///
3302 /// # Example
3303 /// ```ignore,no_run
3304 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3305 /// use wkt::Timestamp;
3306 /// let x = GenerateEphemeralCertRequest::new().set_read_time(Timestamp::default()/* use setters */);
3307 /// ```
3308 pub fn set_read_time<T>(mut self, v: T) -> Self
3309 where
3310 T: std::convert::Into<wkt::Timestamp>,
3311 {
3312 self.read_time = std::option::Option::Some(v.into());
3313 self
3314 }
3315
3316 /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3317 ///
3318 /// # Example
3319 /// ```ignore,no_run
3320 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3321 /// use wkt::Timestamp;
3322 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
3323 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(None::<Timestamp>);
3324 /// ```
3325 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
3326 where
3327 T: std::convert::Into<wkt::Timestamp>,
3328 {
3329 self.read_time = v.map(|x| x.into());
3330 self
3331 }
3332
3333 /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3334 ///
3335 /// # Example
3336 /// ```ignore,no_run
3337 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3338 /// use wkt::Duration;
3339 /// let x = GenerateEphemeralCertRequest::new().set_valid_duration(Duration::default()/* use setters */);
3340 /// ```
3341 pub fn set_valid_duration<T>(mut self, v: T) -> Self
3342 where
3343 T: std::convert::Into<wkt::Duration>,
3344 {
3345 self.valid_duration = std::option::Option::Some(v.into());
3346 self
3347 }
3348
3349 /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3350 ///
3351 /// # Example
3352 /// ```ignore,no_run
3353 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3354 /// use wkt::Duration;
3355 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(Some(Duration::default()/* use setters */));
3356 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(None::<Duration>);
3357 /// ```
3358 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
3359 where
3360 T: std::convert::Into<wkt::Duration>,
3361 {
3362 self.valid_duration = v.map(|x| x.into());
3363 self
3364 }
3365}
3366
3367impl wkt::message::Message for GenerateEphemeralCertRequest {
3368 fn typename() -> &'static str {
3369 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
3370 }
3371}
3372
3373/// Ephemeral certificate creation request.
3374#[derive(Clone, Default, PartialEq)]
3375#[non_exhaustive]
3376pub struct GenerateEphemeralCertResponse {
3377 /// Generated cert
3378 pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
3379
3380 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3381}
3382
3383impl GenerateEphemeralCertResponse {
3384 /// Creates a new default instance.
3385 pub fn new() -> Self {
3386 std::default::Default::default()
3387 }
3388
3389 /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3390 ///
3391 /// # Example
3392 /// ```ignore,no_run
3393 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3394 /// use google_cloud_sql_v1::model::SslCert;
3395 /// let x = GenerateEphemeralCertResponse::new().set_ephemeral_cert(SslCert::default()/* use setters */);
3396 /// ```
3397 pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
3398 where
3399 T: std::convert::Into<crate::model::SslCert>,
3400 {
3401 self.ephemeral_cert = std::option::Option::Some(v.into());
3402 self
3403 }
3404
3405 /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3406 ///
3407 /// # Example
3408 /// ```ignore,no_run
3409 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3410 /// use google_cloud_sql_v1::model::SslCert;
3411 /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(Some(SslCert::default()/* use setters */));
3412 /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(None::<SslCert>);
3413 /// ```
3414 pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
3415 where
3416 T: std::convert::Into<crate::model::SslCert>,
3417 {
3418 self.ephemeral_cert = v.map(|x| x.into());
3419 self
3420 }
3421}
3422
3423impl wkt::message::Message for GenerateEphemeralCertResponse {
3424 fn typename() -> &'static str {
3425 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
3426 }
3427}
3428
3429/// Database delete request.
3430#[derive(Clone, Default, PartialEq)]
3431#[non_exhaustive]
3432pub struct SqlDatabasesDeleteRequest {
3433 /// Name of the database to be deleted in the instance.
3434 pub database: std::string::String,
3435
3436 /// Database instance ID. This does not include the project ID.
3437 pub instance: std::string::String,
3438
3439 /// Project ID of the project that contains the instance.
3440 pub project: std::string::String,
3441
3442 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3443}
3444
3445impl SqlDatabasesDeleteRequest {
3446 /// Creates a new default instance.
3447 pub fn new() -> Self {
3448 std::default::Default::default()
3449 }
3450
3451 /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
3452 ///
3453 /// # Example
3454 /// ```ignore,no_run
3455 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3456 /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
3457 /// ```
3458 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459 self.database = v.into();
3460 self
3461 }
3462
3463 /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
3464 ///
3465 /// # Example
3466 /// ```ignore,no_run
3467 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3468 /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
3469 /// ```
3470 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3471 self.instance = v.into();
3472 self
3473 }
3474
3475 /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
3476 ///
3477 /// # Example
3478 /// ```ignore,no_run
3479 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3480 /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
3481 /// ```
3482 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3483 self.project = v.into();
3484 self
3485 }
3486}
3487
3488impl wkt::message::Message for SqlDatabasesDeleteRequest {
3489 fn typename() -> &'static str {
3490 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
3491 }
3492}
3493
3494/// Database get request.
3495#[derive(Clone, Default, PartialEq)]
3496#[non_exhaustive]
3497pub struct SqlDatabasesGetRequest {
3498 /// Name of the database in the instance.
3499 pub database: std::string::String,
3500
3501 /// Database instance ID. This does not include the project ID.
3502 pub instance: std::string::String,
3503
3504 /// Project ID of the project that contains the instance.
3505 pub project: std::string::String,
3506
3507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3508}
3509
3510impl SqlDatabasesGetRequest {
3511 /// Creates a new default instance.
3512 pub fn new() -> Self {
3513 std::default::Default::default()
3514 }
3515
3516 /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
3517 ///
3518 /// # Example
3519 /// ```ignore,no_run
3520 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3521 /// let x = SqlDatabasesGetRequest::new().set_database("example");
3522 /// ```
3523 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3524 self.database = v.into();
3525 self
3526 }
3527
3528 /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
3529 ///
3530 /// # Example
3531 /// ```ignore,no_run
3532 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3533 /// let x = SqlDatabasesGetRequest::new().set_instance("example");
3534 /// ```
3535 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3536 self.instance = v.into();
3537 self
3538 }
3539
3540 /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
3541 ///
3542 /// # Example
3543 /// ```ignore,no_run
3544 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3545 /// let x = SqlDatabasesGetRequest::new().set_project("example");
3546 /// ```
3547 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3548 self.project = v.into();
3549 self
3550 }
3551}
3552
3553impl wkt::message::Message for SqlDatabasesGetRequest {
3554 fn typename() -> &'static str {
3555 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
3556 }
3557}
3558
3559/// Database insert request.
3560#[derive(Clone, Default, PartialEq)]
3561#[non_exhaustive]
3562pub struct SqlDatabasesInsertRequest {
3563 /// Database instance ID. This does not include the project ID.
3564 pub instance: std::string::String,
3565
3566 /// Project ID of the project that contains the instance.
3567 pub project: std::string::String,
3568
3569 #[allow(missing_docs)]
3570 pub body: std::option::Option<crate::model::Database>,
3571
3572 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3573}
3574
3575impl SqlDatabasesInsertRequest {
3576 /// Creates a new default instance.
3577 pub fn new() -> Self {
3578 std::default::Default::default()
3579 }
3580
3581 /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
3582 ///
3583 /// # Example
3584 /// ```ignore,no_run
3585 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3586 /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
3587 /// ```
3588 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3589 self.instance = v.into();
3590 self
3591 }
3592
3593 /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
3594 ///
3595 /// # Example
3596 /// ```ignore,no_run
3597 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3598 /// let x = SqlDatabasesInsertRequest::new().set_project("example");
3599 /// ```
3600 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3601 self.project = v.into();
3602 self
3603 }
3604
3605 /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3606 ///
3607 /// # Example
3608 /// ```ignore,no_run
3609 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3610 /// use google_cloud_sql_v1::model::Database;
3611 /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
3612 /// ```
3613 pub fn set_body<T>(mut self, v: T) -> Self
3614 where
3615 T: std::convert::Into<crate::model::Database>,
3616 {
3617 self.body = std::option::Option::Some(v.into());
3618 self
3619 }
3620
3621 /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3622 ///
3623 /// # Example
3624 /// ```ignore,no_run
3625 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3626 /// use google_cloud_sql_v1::model::Database;
3627 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3628 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
3629 /// ```
3630 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3631 where
3632 T: std::convert::Into<crate::model::Database>,
3633 {
3634 self.body = v.map(|x| x.into());
3635 self
3636 }
3637}
3638
3639impl wkt::message::Message for SqlDatabasesInsertRequest {
3640 fn typename() -> &'static str {
3641 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
3642 }
3643}
3644
3645/// Database list request.
3646#[derive(Clone, Default, PartialEq)]
3647#[non_exhaustive]
3648pub struct SqlDatabasesListRequest {
3649 /// Cloud SQL instance ID. This does not include the project ID.
3650 pub instance: std::string::String,
3651
3652 /// Project ID of the project that contains the instance.
3653 pub project: std::string::String,
3654
3655 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3656}
3657
3658impl SqlDatabasesListRequest {
3659 /// Creates a new default instance.
3660 pub fn new() -> Self {
3661 std::default::Default::default()
3662 }
3663
3664 /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
3665 ///
3666 /// # Example
3667 /// ```ignore,no_run
3668 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3669 /// let x = SqlDatabasesListRequest::new().set_instance("example");
3670 /// ```
3671 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3672 self.instance = v.into();
3673 self
3674 }
3675
3676 /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
3677 ///
3678 /// # Example
3679 /// ```ignore,no_run
3680 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3681 /// let x = SqlDatabasesListRequest::new().set_project("example");
3682 /// ```
3683 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3684 self.project = v.into();
3685 self
3686 }
3687}
3688
3689impl wkt::message::Message for SqlDatabasesListRequest {
3690 fn typename() -> &'static str {
3691 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
3692 }
3693}
3694
3695/// Database update request.
3696#[derive(Clone, Default, PartialEq)]
3697#[non_exhaustive]
3698pub struct SqlDatabasesUpdateRequest {
3699 /// Name of the database to be updated in the instance.
3700 pub database: std::string::String,
3701
3702 /// Database instance ID. This does not include the project ID.
3703 pub instance: std::string::String,
3704
3705 /// Project ID of the project that contains the instance.
3706 pub project: std::string::String,
3707
3708 #[allow(missing_docs)]
3709 pub body: std::option::Option<crate::model::Database>,
3710
3711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3712}
3713
3714impl SqlDatabasesUpdateRequest {
3715 /// Creates a new default instance.
3716 pub fn new() -> Self {
3717 std::default::Default::default()
3718 }
3719
3720 /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
3721 ///
3722 /// # Example
3723 /// ```ignore,no_run
3724 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3725 /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
3726 /// ```
3727 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3728 self.database = v.into();
3729 self
3730 }
3731
3732 /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
3733 ///
3734 /// # Example
3735 /// ```ignore,no_run
3736 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3737 /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
3738 /// ```
3739 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3740 self.instance = v.into();
3741 self
3742 }
3743
3744 /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
3745 ///
3746 /// # Example
3747 /// ```ignore,no_run
3748 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3749 /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
3750 /// ```
3751 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3752 self.project = v.into();
3753 self
3754 }
3755
3756 /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3757 ///
3758 /// # Example
3759 /// ```ignore,no_run
3760 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3761 /// use google_cloud_sql_v1::model::Database;
3762 /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
3763 /// ```
3764 pub fn set_body<T>(mut self, v: T) -> Self
3765 where
3766 T: std::convert::Into<crate::model::Database>,
3767 {
3768 self.body = std::option::Option::Some(v.into());
3769 self
3770 }
3771
3772 /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3773 ///
3774 /// # Example
3775 /// ```ignore,no_run
3776 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3777 /// use google_cloud_sql_v1::model::Database;
3778 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3779 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
3780 /// ```
3781 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3782 where
3783 T: std::convert::Into<crate::model::Database>,
3784 {
3785 self.body = v.map(|x| x.into());
3786 self
3787 }
3788}
3789
3790impl wkt::message::Message for SqlDatabasesUpdateRequest {
3791 fn typename() -> &'static str {
3792 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
3793 }
3794}
3795
3796/// Database list response.
3797#[derive(Clone, Default, PartialEq)]
3798#[non_exhaustive]
3799pub struct DatabasesListResponse {
3800 /// This is always `sql#databasesList`.
3801 pub kind: std::string::String,
3802
3803 /// List of database resources in the instance.
3804 pub items: std::vec::Vec<crate::model::Database>,
3805
3806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3807}
3808
3809impl DatabasesListResponse {
3810 /// Creates a new default instance.
3811 pub fn new() -> Self {
3812 std::default::Default::default()
3813 }
3814
3815 /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
3816 ///
3817 /// # Example
3818 /// ```ignore,no_run
3819 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3820 /// let x = DatabasesListResponse::new().set_kind("example");
3821 /// ```
3822 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3823 self.kind = v.into();
3824 self
3825 }
3826
3827 /// Sets the value of [items][crate::model::DatabasesListResponse::items].
3828 ///
3829 /// # Example
3830 /// ```ignore,no_run
3831 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3832 /// use google_cloud_sql_v1::model::Database;
3833 /// let x = DatabasesListResponse::new()
3834 /// .set_items([
3835 /// Database::default()/* use setters */,
3836 /// Database::default()/* use (different) setters */,
3837 /// ]);
3838 /// ```
3839 pub fn set_items<T, V>(mut self, v: T) -> Self
3840 where
3841 T: std::iter::IntoIterator<Item = V>,
3842 V: std::convert::Into<crate::model::Database>,
3843 {
3844 use std::iter::Iterator;
3845 self.items = v.into_iter().map(|i| i.into()).collect();
3846 self
3847 }
3848}
3849
3850impl wkt::message::Message for DatabasesListResponse {
3851 fn typename() -> &'static str {
3852 "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
3853 }
3854}
3855
3856/// Flags list request.
3857#[derive(Clone, Default, PartialEq)]
3858#[non_exhaustive]
3859pub struct SqlFlagsListRequest {
3860 /// Database type and version you want to retrieve flags for. By default, this
3861 /// method returns flags for all database types and versions.
3862 pub database_version: std::string::String,
3863
3864 /// Optional. Specify the scope of flags to be returned by SqlFlagsListService.
3865 /// Return list of database flags if unspecified.
3866 pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
3867
3868 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3869}
3870
3871impl SqlFlagsListRequest {
3872 /// Creates a new default instance.
3873 pub fn new() -> Self {
3874 std::default::Default::default()
3875 }
3876
3877 /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
3878 ///
3879 /// # Example
3880 /// ```ignore,no_run
3881 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3882 /// let x = SqlFlagsListRequest::new().set_database_version("example");
3883 /// ```
3884 pub fn set_database_version<T: std::convert::Into<std::string::String>>(
3885 mut self,
3886 v: T,
3887 ) -> Self {
3888 self.database_version = v.into();
3889 self
3890 }
3891
3892 /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3893 ///
3894 /// # Example
3895 /// ```ignore,no_run
3896 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3897 /// use google_cloud_sql_v1::model::SqlFlagScope;
3898 /// let x0 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::Database);
3899 /// let x1 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::ConnectionPool);
3900 /// ```
3901 pub fn set_flag_scope<T>(mut self, v: T) -> Self
3902 where
3903 T: std::convert::Into<crate::model::SqlFlagScope>,
3904 {
3905 self.flag_scope = std::option::Option::Some(v.into());
3906 self
3907 }
3908
3909 /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3910 ///
3911 /// # Example
3912 /// ```ignore,no_run
3913 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3914 /// use google_cloud_sql_v1::model::SqlFlagScope;
3915 /// let x0 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::Database));
3916 /// let x1 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::ConnectionPool));
3917 /// let x_none = SqlFlagsListRequest::new().set_or_clear_flag_scope(None::<SqlFlagScope>);
3918 /// ```
3919 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
3920 where
3921 T: std::convert::Into<crate::model::SqlFlagScope>,
3922 {
3923 self.flag_scope = v.map(|x| x.into());
3924 self
3925 }
3926}
3927
3928impl wkt::message::Message for SqlFlagsListRequest {
3929 fn typename() -> &'static str {
3930 "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
3931 }
3932}
3933
3934/// Flags list response.
3935#[derive(Clone, Default, PartialEq)]
3936#[non_exhaustive]
3937pub struct FlagsListResponse {
3938 /// This is always `sql#flagsList`.
3939 pub kind: std::string::String,
3940
3941 /// List of flags.
3942 pub items: std::vec::Vec<crate::model::Flag>,
3943
3944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3945}
3946
3947impl FlagsListResponse {
3948 /// Creates a new default instance.
3949 pub fn new() -> Self {
3950 std::default::Default::default()
3951 }
3952
3953 /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
3954 ///
3955 /// # Example
3956 /// ```ignore,no_run
3957 /// # use google_cloud_sql_v1::model::FlagsListResponse;
3958 /// let x = FlagsListResponse::new().set_kind("example");
3959 /// ```
3960 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3961 self.kind = v.into();
3962 self
3963 }
3964
3965 /// Sets the value of [items][crate::model::FlagsListResponse::items].
3966 ///
3967 /// # Example
3968 /// ```ignore,no_run
3969 /// # use google_cloud_sql_v1::model::FlagsListResponse;
3970 /// use google_cloud_sql_v1::model::Flag;
3971 /// let x = FlagsListResponse::new()
3972 /// .set_items([
3973 /// Flag::default()/* use setters */,
3974 /// Flag::default()/* use (different) setters */,
3975 /// ]);
3976 /// ```
3977 pub fn set_items<T, V>(mut self, v: T) -> Self
3978 where
3979 T: std::iter::IntoIterator<Item = V>,
3980 V: std::convert::Into<crate::model::Flag>,
3981 {
3982 use std::iter::Iterator;
3983 self.items = v.into_iter().map(|i| i.into()).collect();
3984 self
3985 }
3986}
3987
3988impl wkt::message::Message for FlagsListResponse {
3989 fn typename() -> &'static str {
3990 "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
3991 }
3992}
3993
3994/// A flag resource.
3995#[derive(Clone, Default, PartialEq)]
3996#[non_exhaustive]
3997pub struct Flag {
3998 /// This is the name of the flag. Flag names always use underscores, not
3999 /// hyphens, for example: `max_allowed_packet`
4000 pub name: std::string::String,
4001
4002 /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
4003 /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
4004 /// value, such as `skip_grant_tables`.
4005 pub r#type: crate::model::SqlFlagType,
4006
4007 /// The database version this flag applies to. Can be
4008 /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
4009 /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
4010 /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
4011 /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
4012 /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
4013 /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
4014 /// `SQLSERVER_2019_WEB`.
4015 /// See [the complete
4016 /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
4017 pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
4018
4019 /// For `STRING` flags, a list of strings that the value can be set to.
4020 pub allowed_string_values: std::vec::Vec<std::string::String>,
4021
4022 /// For `INTEGER` flags, the minimum allowed value.
4023 pub min_value: std::option::Option<wkt::Int64Value>,
4024
4025 /// For `INTEGER` flags, the maximum allowed value.
4026 pub max_value: std::option::Option<wkt::Int64Value>,
4027
4028 /// Indicates whether changing this flag will trigger a database restart. Only
4029 /// applicable to Second Generation instances.
4030 pub requires_restart: std::option::Option<wkt::BoolValue>,
4031
4032 /// This is always `sql#flag`.
4033 pub kind: std::string::String,
4034
4035 /// Whether or not the flag is considered in beta.
4036 pub in_beta: std::option::Option<wkt::BoolValue>,
4037
4038 /// Use this field if only certain integers are accepted. Can be combined
4039 /// with min_value and max_value to add additional values.
4040 pub allowed_int_values: std::vec::Vec<i64>,
4041
4042 /// Scope of flag.
4043 pub flag_scope: crate::model::SqlFlagScope,
4044
4045 /// Recommended flag value for UI display.
4046 pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
4047
4048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4049}
4050
4051impl Flag {
4052 /// Creates a new default instance.
4053 pub fn new() -> Self {
4054 std::default::Default::default()
4055 }
4056
4057 /// Sets the value of [name][crate::model::Flag::name].
4058 ///
4059 /// # Example
4060 /// ```ignore,no_run
4061 /// # use google_cloud_sql_v1::model::Flag;
4062 /// let x = Flag::new().set_name("example");
4063 /// ```
4064 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4065 self.name = v.into();
4066 self
4067 }
4068
4069 /// Sets the value of [r#type][crate::model::Flag::type].
4070 ///
4071 /// # Example
4072 /// ```ignore,no_run
4073 /// # use google_cloud_sql_v1::model::Flag;
4074 /// use google_cloud_sql_v1::model::SqlFlagType;
4075 /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
4076 /// let x1 = Flag::new().set_type(SqlFlagType::String);
4077 /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
4078 /// ```
4079 pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
4080 self.r#type = v.into();
4081 self
4082 }
4083
4084 /// Sets the value of [applies_to][crate::model::Flag::applies_to].
4085 ///
4086 /// # Example
4087 /// ```ignore,no_run
4088 /// # use google_cloud_sql_v1::model::Flag;
4089 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
4090 /// let x = Flag::new().set_applies_to([
4091 /// SqlDatabaseVersion::Mysql56,
4092 /// SqlDatabaseVersion::Mysql57,
4093 /// SqlDatabaseVersion::Mysql80,
4094 /// ]);
4095 /// ```
4096 pub fn set_applies_to<T, V>(mut self, v: T) -> Self
4097 where
4098 T: std::iter::IntoIterator<Item = V>,
4099 V: std::convert::Into<crate::model::SqlDatabaseVersion>,
4100 {
4101 use std::iter::Iterator;
4102 self.applies_to = v.into_iter().map(|i| i.into()).collect();
4103 self
4104 }
4105
4106 /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
4107 ///
4108 /// # Example
4109 /// ```ignore,no_run
4110 /// # use google_cloud_sql_v1::model::Flag;
4111 /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
4112 /// ```
4113 pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
4114 where
4115 T: std::iter::IntoIterator<Item = V>,
4116 V: std::convert::Into<std::string::String>,
4117 {
4118 use std::iter::Iterator;
4119 self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
4120 self
4121 }
4122
4123 /// Sets the value of [min_value][crate::model::Flag::min_value].
4124 ///
4125 /// # Example
4126 /// ```ignore,no_run
4127 /// # use google_cloud_sql_v1::model::Flag;
4128 /// use wkt::Int64Value;
4129 /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
4130 /// ```
4131 pub fn set_min_value<T>(mut self, v: T) -> Self
4132 where
4133 T: std::convert::Into<wkt::Int64Value>,
4134 {
4135 self.min_value = std::option::Option::Some(v.into());
4136 self
4137 }
4138
4139 /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
4140 ///
4141 /// # Example
4142 /// ```ignore,no_run
4143 /// # use google_cloud_sql_v1::model::Flag;
4144 /// use wkt::Int64Value;
4145 /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
4146 /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
4147 /// ```
4148 pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
4149 where
4150 T: std::convert::Into<wkt::Int64Value>,
4151 {
4152 self.min_value = v.map(|x| x.into());
4153 self
4154 }
4155
4156 /// Sets the value of [max_value][crate::model::Flag::max_value].
4157 ///
4158 /// # Example
4159 /// ```ignore,no_run
4160 /// # use google_cloud_sql_v1::model::Flag;
4161 /// use wkt::Int64Value;
4162 /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
4163 /// ```
4164 pub fn set_max_value<T>(mut self, v: T) -> Self
4165 where
4166 T: std::convert::Into<wkt::Int64Value>,
4167 {
4168 self.max_value = std::option::Option::Some(v.into());
4169 self
4170 }
4171
4172 /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
4173 ///
4174 /// # Example
4175 /// ```ignore,no_run
4176 /// # use google_cloud_sql_v1::model::Flag;
4177 /// use wkt::Int64Value;
4178 /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
4179 /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
4180 /// ```
4181 pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
4182 where
4183 T: std::convert::Into<wkt::Int64Value>,
4184 {
4185 self.max_value = v.map(|x| x.into());
4186 self
4187 }
4188
4189 /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
4190 ///
4191 /// # Example
4192 /// ```ignore,no_run
4193 /// # use google_cloud_sql_v1::model::Flag;
4194 /// use wkt::BoolValue;
4195 /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
4196 /// ```
4197 pub fn set_requires_restart<T>(mut self, v: T) -> Self
4198 where
4199 T: std::convert::Into<wkt::BoolValue>,
4200 {
4201 self.requires_restart = std::option::Option::Some(v.into());
4202 self
4203 }
4204
4205 /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
4206 ///
4207 /// # Example
4208 /// ```ignore,no_run
4209 /// # use google_cloud_sql_v1::model::Flag;
4210 /// use wkt::BoolValue;
4211 /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
4212 /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
4213 /// ```
4214 pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
4215 where
4216 T: std::convert::Into<wkt::BoolValue>,
4217 {
4218 self.requires_restart = v.map(|x| x.into());
4219 self
4220 }
4221
4222 /// Sets the value of [kind][crate::model::Flag::kind].
4223 ///
4224 /// # Example
4225 /// ```ignore,no_run
4226 /// # use google_cloud_sql_v1::model::Flag;
4227 /// let x = Flag::new().set_kind("example");
4228 /// ```
4229 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4230 self.kind = v.into();
4231 self
4232 }
4233
4234 /// Sets the value of [in_beta][crate::model::Flag::in_beta].
4235 ///
4236 /// # Example
4237 /// ```ignore,no_run
4238 /// # use google_cloud_sql_v1::model::Flag;
4239 /// use wkt::BoolValue;
4240 /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
4241 /// ```
4242 pub fn set_in_beta<T>(mut self, v: T) -> Self
4243 where
4244 T: std::convert::Into<wkt::BoolValue>,
4245 {
4246 self.in_beta = std::option::Option::Some(v.into());
4247 self
4248 }
4249
4250 /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
4251 ///
4252 /// # Example
4253 /// ```ignore,no_run
4254 /// # use google_cloud_sql_v1::model::Flag;
4255 /// use wkt::BoolValue;
4256 /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
4257 /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
4258 /// ```
4259 pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
4260 where
4261 T: std::convert::Into<wkt::BoolValue>,
4262 {
4263 self.in_beta = v.map(|x| x.into());
4264 self
4265 }
4266
4267 /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
4268 ///
4269 /// # Example
4270 /// ```ignore,no_run
4271 /// # use google_cloud_sql_v1::model::Flag;
4272 /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
4273 /// ```
4274 pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
4275 where
4276 T: std::iter::IntoIterator<Item = V>,
4277 V: std::convert::Into<i64>,
4278 {
4279 use std::iter::Iterator;
4280 self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
4281 self
4282 }
4283
4284 /// Sets the value of [flag_scope][crate::model::Flag::flag_scope].
4285 ///
4286 /// # Example
4287 /// ```ignore,no_run
4288 /// # use google_cloud_sql_v1::model::Flag;
4289 /// use google_cloud_sql_v1::model::SqlFlagScope;
4290 /// let x0 = Flag::new().set_flag_scope(SqlFlagScope::Database);
4291 /// let x1 = Flag::new().set_flag_scope(SqlFlagScope::ConnectionPool);
4292 /// ```
4293 pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
4294 mut self,
4295 v: T,
4296 ) -> Self {
4297 self.flag_scope = v.into();
4298 self
4299 }
4300
4301 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value].
4302 ///
4303 /// Note that all the setters affecting `recommended_value` are mutually
4304 /// exclusive.
4305 ///
4306 /// # Example
4307 /// ```ignore,no_run
4308 /// # use google_cloud_sql_v1::model::Flag;
4309 /// use google_cloud_sql_v1::model::flag::RecommendedValue;
4310 /// let x = Flag::new().set_recommended_value(Some(RecommendedValue::RecommendedStringValue("example".to_string())));
4311 /// ```
4312 pub fn set_recommended_value<
4313 T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
4314 >(
4315 mut self,
4316 v: T,
4317 ) -> Self {
4318 self.recommended_value = v.into();
4319 self
4320 }
4321
4322 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4323 /// if it holds a `RecommendedStringValue`, `None` if the field is not set or
4324 /// holds a different branch.
4325 pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
4326 #[allow(unreachable_patterns)]
4327 self.recommended_value.as_ref().and_then(|v| match v {
4328 crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
4329 std::option::Option::Some(v)
4330 }
4331 _ => std::option::Option::None,
4332 })
4333 }
4334
4335 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4336 /// to hold a `RecommendedStringValue`.
4337 ///
4338 /// Note that all the setters affecting `recommended_value` are
4339 /// mutually exclusive.
4340 ///
4341 /// # Example
4342 /// ```ignore,no_run
4343 /// # use google_cloud_sql_v1::model::Flag;
4344 /// let x = Flag::new().set_recommended_string_value("example");
4345 /// assert!(x.recommended_string_value().is_some());
4346 /// assert!(x.recommended_int_value().is_none());
4347 /// ```
4348 pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
4349 mut self,
4350 v: T,
4351 ) -> Self {
4352 self.recommended_value = std::option::Option::Some(
4353 crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
4354 );
4355 self
4356 }
4357
4358 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4359 /// if it holds a `RecommendedIntValue`, `None` if the field is not set or
4360 /// holds a different branch.
4361 pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
4362 #[allow(unreachable_patterns)]
4363 self.recommended_value.as_ref().and_then(|v| match v {
4364 crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
4365 std::option::Option::Some(v)
4366 }
4367 _ => std::option::Option::None,
4368 })
4369 }
4370
4371 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4372 /// to hold a `RecommendedIntValue`.
4373 ///
4374 /// Note that all the setters affecting `recommended_value` are
4375 /// mutually exclusive.
4376 ///
4377 /// # Example
4378 /// ```ignore,no_run
4379 /// # use google_cloud_sql_v1::model::Flag;
4380 /// use wkt::Int64Value;
4381 /// let x = Flag::new().set_recommended_int_value(Int64Value::default()/* use setters */);
4382 /// assert!(x.recommended_int_value().is_some());
4383 /// assert!(x.recommended_string_value().is_none());
4384 /// ```
4385 pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
4386 mut self,
4387 v: T,
4388 ) -> Self {
4389 self.recommended_value = std::option::Option::Some(
4390 crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
4391 );
4392 self
4393 }
4394}
4395
4396impl wkt::message::Message for Flag {
4397 fn typename() -> &'static str {
4398 "type.googleapis.com/google.cloud.sql.v1.Flag"
4399 }
4400}
4401
4402/// Defines additional types related to [Flag].
4403pub mod flag {
4404 #[allow(unused_imports)]
4405 use super::*;
4406
4407 /// Recommended flag value for UI display.
4408 #[derive(Clone, Debug, PartialEq)]
4409 #[non_exhaustive]
4410 pub enum RecommendedValue {
4411 /// Recommended string value in string format for UI display.
4412 RecommendedStringValue(std::string::String),
4413 /// Recommended int value in integer format for UI display.
4414 RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
4415 }
4416}
4417
4418/// Instance add server CA request.
4419#[derive(Clone, Default, PartialEq)]
4420#[non_exhaustive]
4421pub struct SqlInstancesAddServerCaRequest {
4422 /// Cloud SQL instance ID. This does not include the project ID.
4423 pub instance: std::string::String,
4424
4425 /// Project ID of the project that contains the instance.
4426 pub project: std::string::String,
4427
4428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4429}
4430
4431impl SqlInstancesAddServerCaRequest {
4432 /// Creates a new default instance.
4433 pub fn new() -> Self {
4434 std::default::Default::default()
4435 }
4436
4437 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
4438 ///
4439 /// # Example
4440 /// ```ignore,no_run
4441 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4442 /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
4443 /// ```
4444 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4445 self.instance = v.into();
4446 self
4447 }
4448
4449 /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
4450 ///
4451 /// # Example
4452 /// ```ignore,no_run
4453 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4454 /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
4455 /// ```
4456 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4457 self.project = v.into();
4458 self
4459 }
4460}
4461
4462impl wkt::message::Message for SqlInstancesAddServerCaRequest {
4463 fn typename() -> &'static str {
4464 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
4465 }
4466}
4467
4468/// Instance add server certificate request.
4469#[derive(Clone, Default, PartialEq)]
4470#[non_exhaustive]
4471pub struct SqlInstancesAddServerCertificateRequest {
4472 /// Cloud SQL instance ID. This does not include the project ID.
4473 pub instance: std::string::String,
4474
4475 /// Project ID of the project that contains the instance.
4476 pub project: std::string::String,
4477
4478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4479}
4480
4481impl SqlInstancesAddServerCertificateRequest {
4482 /// Creates a new default instance.
4483 pub fn new() -> Self {
4484 std::default::Default::default()
4485 }
4486
4487 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
4488 ///
4489 /// # Example
4490 /// ```ignore,no_run
4491 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4492 /// let x = SqlInstancesAddServerCertificateRequest::new().set_instance("example");
4493 /// ```
4494 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4495 self.instance = v.into();
4496 self
4497 }
4498
4499 /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
4500 ///
4501 /// # Example
4502 /// ```ignore,no_run
4503 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4504 /// let x = SqlInstancesAddServerCertificateRequest::new().set_project("example");
4505 /// ```
4506 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4507 self.project = v.into();
4508 self
4509 }
4510}
4511
4512impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
4513 fn typename() -> &'static str {
4514 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
4515 }
4516}
4517
4518/// Instance add Entra ID certificate request.
4519#[derive(Clone, Default, PartialEq)]
4520#[non_exhaustive]
4521pub struct SqlInstancesAddEntraIdCertificateRequest {
4522 /// Required. Cloud SQL instance ID. This does not include the project ID.
4523 pub instance: std::string::String,
4524
4525 /// Required. Project ID of the project that contains the instance.
4526 pub project: std::string::String,
4527
4528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4529}
4530
4531impl SqlInstancesAddEntraIdCertificateRequest {
4532 /// Creates a new default instance.
4533 pub fn new() -> Self {
4534 std::default::Default::default()
4535 }
4536
4537 /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
4538 ///
4539 /// # Example
4540 /// ```ignore,no_run
4541 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4542 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_instance("example");
4543 /// ```
4544 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4545 self.instance = v.into();
4546 self
4547 }
4548
4549 /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
4550 ///
4551 /// # Example
4552 /// ```ignore,no_run
4553 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4554 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_project("example");
4555 /// ```
4556 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4557 self.project = v.into();
4558 self
4559 }
4560}
4561
4562impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
4563 fn typename() -> &'static str {
4564 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
4565 }
4566}
4567
4568/// Instance clone request.
4569#[derive(Clone, Default, PartialEq)]
4570#[non_exhaustive]
4571pub struct SqlInstancesCloneRequest {
4572 /// Required. The ID of the Cloud SQL instance to be cloned (source). This does
4573 /// not include the project ID.
4574 pub instance: std::string::String,
4575
4576 /// Required. Project ID of the source Cloud SQL instance.
4577 pub project: std::string::String,
4578
4579 #[allow(missing_docs)]
4580 pub body: std::option::Option<crate::model::InstancesCloneRequest>,
4581
4582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4583}
4584
4585impl SqlInstancesCloneRequest {
4586 /// Creates a new default instance.
4587 pub fn new() -> Self {
4588 std::default::Default::default()
4589 }
4590
4591 /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
4592 ///
4593 /// # Example
4594 /// ```ignore,no_run
4595 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4596 /// let x = SqlInstancesCloneRequest::new().set_instance("example");
4597 /// ```
4598 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4599 self.instance = v.into();
4600 self
4601 }
4602
4603 /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
4604 ///
4605 /// # Example
4606 /// ```ignore,no_run
4607 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4608 /// let x = SqlInstancesCloneRequest::new().set_project("example");
4609 /// ```
4610 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4611 self.project = v.into();
4612 self
4613 }
4614
4615 /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
4616 ///
4617 /// # Example
4618 /// ```ignore,no_run
4619 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4620 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4621 /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
4622 /// ```
4623 pub fn set_body<T>(mut self, v: T) -> Self
4624 where
4625 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4626 {
4627 self.body = std::option::Option::Some(v.into());
4628 self
4629 }
4630
4631 /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
4632 ///
4633 /// # Example
4634 /// ```ignore,no_run
4635 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4636 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4637 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
4638 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
4639 /// ```
4640 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4641 where
4642 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4643 {
4644 self.body = v.map(|x| x.into());
4645 self
4646 }
4647}
4648
4649impl wkt::message::Message for SqlInstancesCloneRequest {
4650 fn typename() -> &'static str {
4651 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
4652 }
4653}
4654
4655/// Instance delete request.
4656#[derive(Clone, Default, PartialEq)]
4657#[non_exhaustive]
4658pub struct SqlInstancesDeleteRequest {
4659 /// Cloud SQL instance ID. This does not include the project ID.
4660 pub instance: std::string::String,
4661
4662 /// Project ID of the project that contains the instance to be deleted.
4663 pub project: std::string::String,
4664
4665 /// Flag to opt-in for final backup. By default, it is turned off.
4666 pub enable_final_backup: std::option::Option<bool>,
4667
4668 /// Optional. The description of the final backup.
4669 pub final_backup_description: std::string::String,
4670
4671 #[allow(missing_docs)]
4672 pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4673
4674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4675}
4676
4677impl SqlInstancesDeleteRequest {
4678 /// Creates a new default instance.
4679 pub fn new() -> Self {
4680 std::default::Default::default()
4681 }
4682
4683 /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
4684 ///
4685 /// # Example
4686 /// ```ignore,no_run
4687 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4688 /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
4689 /// ```
4690 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4691 self.instance = v.into();
4692 self
4693 }
4694
4695 /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
4696 ///
4697 /// # Example
4698 /// ```ignore,no_run
4699 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4700 /// let x = SqlInstancesDeleteRequest::new().set_project("example");
4701 /// ```
4702 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4703 self.project = v.into();
4704 self
4705 }
4706
4707 /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4708 ///
4709 /// # Example
4710 /// ```ignore,no_run
4711 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4712 /// let x = SqlInstancesDeleteRequest::new().set_enable_final_backup(true);
4713 /// ```
4714 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
4715 where
4716 T: std::convert::Into<bool>,
4717 {
4718 self.enable_final_backup = std::option::Option::Some(v.into());
4719 self
4720 }
4721
4722 /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4723 ///
4724 /// # Example
4725 /// ```ignore,no_run
4726 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4727 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(Some(false));
4728 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(None::<bool>);
4729 /// ```
4730 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
4731 where
4732 T: std::convert::Into<bool>,
4733 {
4734 self.enable_final_backup = v.map(|x| x.into());
4735 self
4736 }
4737
4738 /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
4739 ///
4740 /// # Example
4741 /// ```ignore,no_run
4742 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4743 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_description("example");
4744 /// ```
4745 pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
4746 mut self,
4747 v: T,
4748 ) -> Self {
4749 self.final_backup_description = v.into();
4750 self
4751 }
4752
4753 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
4754 ///
4755 /// Note that all the setters affecting `expiration` are mutually
4756 /// exclusive.
4757 ///
4758 /// # Example
4759 /// ```ignore,no_run
4760 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4761 /// use google_cloud_sql_v1::model::sql_instances_delete_request::Expiration;
4762 /// let x = SqlInstancesDeleteRequest::new().set_expiration(Some(Expiration::FinalBackupTtlDays(42)));
4763 /// ```
4764 pub fn set_expiration<
4765 T: std::convert::Into<
4766 std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4767 >,
4768 >(
4769 mut self,
4770 v: T,
4771 ) -> Self {
4772 self.expiration = v.into();
4773 self
4774 }
4775
4776 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4777 /// if it holds a `FinalBackupTtlDays`, `None` if the field is not set or
4778 /// holds a different branch.
4779 pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
4780 #[allow(unreachable_patterns)]
4781 self.expiration.as_ref().and_then(|v| match v {
4782 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
4783 std::option::Option::Some(v)
4784 }
4785 _ => std::option::Option::None,
4786 })
4787 }
4788
4789 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4790 /// to hold a `FinalBackupTtlDays`.
4791 ///
4792 /// Note that all the setters affecting `expiration` are
4793 /// mutually exclusive.
4794 ///
4795 /// # Example
4796 /// ```ignore,no_run
4797 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4798 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_ttl_days(42);
4799 /// assert!(x.final_backup_ttl_days().is_some());
4800 /// assert!(x.final_backup_expiry_time().is_none());
4801 /// ```
4802 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4803 self.expiration = std::option::Option::Some(
4804 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
4805 );
4806 self
4807 }
4808
4809 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4810 /// if it holds a `FinalBackupExpiryTime`, `None` if the field is not set or
4811 /// holds a different branch.
4812 pub fn final_backup_expiry_time(
4813 &self,
4814 ) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4815 #[allow(unreachable_patterns)]
4816 self.expiration.as_ref().and_then(|v| match v {
4817 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
4818 std::option::Option::Some(v)
4819 }
4820 _ => std::option::Option::None,
4821 })
4822 }
4823
4824 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4825 /// to hold a `FinalBackupExpiryTime`.
4826 ///
4827 /// Note that all the setters affecting `expiration` are
4828 /// mutually exclusive.
4829 ///
4830 /// # Example
4831 /// ```ignore,no_run
4832 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4833 /// use wkt::Timestamp;
4834 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_expiry_time(Timestamp::default()/* use setters */);
4835 /// assert!(x.final_backup_expiry_time().is_some());
4836 /// assert!(x.final_backup_ttl_days().is_none());
4837 /// ```
4838 pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4839 mut self,
4840 v: T,
4841 ) -> Self {
4842 self.expiration = std::option::Option::Some(
4843 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
4844 );
4845 self
4846 }
4847}
4848
4849impl wkt::message::Message for SqlInstancesDeleteRequest {
4850 fn typename() -> &'static str {
4851 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
4852 }
4853}
4854
4855/// Defines additional types related to [SqlInstancesDeleteRequest].
4856pub mod sql_instances_delete_request {
4857 #[allow(unused_imports)]
4858 use super::*;
4859
4860 #[allow(missing_docs)]
4861 #[derive(Clone, Debug, PartialEq)]
4862 #[non_exhaustive]
4863 pub enum Expiration {
4864 /// Optional. Retention period of the final backup.
4865 FinalBackupTtlDays(i64),
4866 /// Optional. Final Backup expiration time.
4867 /// Timestamp in UTC of when this resource is considered expired.
4868 FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
4869 }
4870}
4871
4872/// Instance demote master request.
4873#[derive(Clone, Default, PartialEq)]
4874#[non_exhaustive]
4875pub struct SqlInstancesDemoteMasterRequest {
4876 /// Cloud SQL instance name.
4877 pub instance: std::string::String,
4878
4879 /// ID of the project that contains the instance.
4880 pub project: std::string::String,
4881
4882 #[allow(missing_docs)]
4883 pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
4884
4885 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4886}
4887
4888impl SqlInstancesDemoteMasterRequest {
4889 /// Creates a new default instance.
4890 pub fn new() -> Self {
4891 std::default::Default::default()
4892 }
4893
4894 /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
4895 ///
4896 /// # Example
4897 /// ```ignore,no_run
4898 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4899 /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
4900 /// ```
4901 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4902 self.instance = v.into();
4903 self
4904 }
4905
4906 /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
4907 ///
4908 /// # Example
4909 /// ```ignore,no_run
4910 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4911 /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
4912 /// ```
4913 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4914 self.project = v.into();
4915 self
4916 }
4917
4918 /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4919 ///
4920 /// # Example
4921 /// ```ignore,no_run
4922 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4923 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4924 /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
4925 /// ```
4926 pub fn set_body<T>(mut self, v: T) -> Self
4927 where
4928 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4929 {
4930 self.body = std::option::Option::Some(v.into());
4931 self
4932 }
4933
4934 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4935 ///
4936 /// # Example
4937 /// ```ignore,no_run
4938 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4939 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4940 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
4941 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
4942 /// ```
4943 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4944 where
4945 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4946 {
4947 self.body = v.map(|x| x.into());
4948 self
4949 }
4950}
4951
4952impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
4953 fn typename() -> &'static str {
4954 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
4955 }
4956}
4957
4958/// Instance demote request.
4959#[derive(Clone, Default, PartialEq)]
4960#[non_exhaustive]
4961pub struct SqlInstancesDemoteRequest {
4962 /// Required. Cloud SQL instance name.
4963 pub instance: std::string::String,
4964
4965 /// Required. ID of the project that contains the instance.
4966 pub project: std::string::String,
4967
4968 /// Required. The request body.
4969 pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
4970
4971 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4972}
4973
4974impl SqlInstancesDemoteRequest {
4975 /// Creates a new default instance.
4976 pub fn new() -> Self {
4977 std::default::Default::default()
4978 }
4979
4980 /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
4981 ///
4982 /// # Example
4983 /// ```ignore,no_run
4984 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4985 /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
4986 /// ```
4987 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4988 self.instance = v.into();
4989 self
4990 }
4991
4992 /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
4993 ///
4994 /// # Example
4995 /// ```ignore,no_run
4996 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4997 /// let x = SqlInstancesDemoteRequest::new().set_project("example");
4998 /// ```
4999 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5000 self.project = v.into();
5001 self
5002 }
5003
5004 /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
5005 ///
5006 /// # Example
5007 /// ```ignore,no_run
5008 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
5009 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
5010 /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
5011 /// ```
5012 pub fn set_body<T>(mut self, v: T) -> Self
5013 where
5014 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
5015 {
5016 self.body = std::option::Option::Some(v.into());
5017 self
5018 }
5019
5020 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
5021 ///
5022 /// # Example
5023 /// ```ignore,no_run
5024 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
5025 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
5026 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
5027 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
5028 /// ```
5029 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5030 where
5031 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
5032 {
5033 self.body = v.map(|x| x.into());
5034 self
5035 }
5036}
5037
5038impl wkt::message::Message for SqlInstancesDemoteRequest {
5039 fn typename() -> &'static str {
5040 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
5041 }
5042}
5043
5044/// Instance export request.
5045#[derive(Clone, Default, PartialEq)]
5046#[non_exhaustive]
5047pub struct SqlInstancesExportRequest {
5048 /// Cloud SQL instance ID. This does not include the project ID.
5049 pub instance: std::string::String,
5050
5051 /// Project ID of the project that contains the instance to be exported.
5052 pub project: std::string::String,
5053
5054 #[allow(missing_docs)]
5055 pub body: std::option::Option<crate::model::InstancesExportRequest>,
5056
5057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5058}
5059
5060impl SqlInstancesExportRequest {
5061 /// Creates a new default instance.
5062 pub fn new() -> Self {
5063 std::default::Default::default()
5064 }
5065
5066 /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
5067 ///
5068 /// # Example
5069 /// ```ignore,no_run
5070 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5071 /// let x = SqlInstancesExportRequest::new().set_instance("example");
5072 /// ```
5073 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5074 self.instance = v.into();
5075 self
5076 }
5077
5078 /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
5079 ///
5080 /// # Example
5081 /// ```ignore,no_run
5082 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5083 /// let x = SqlInstancesExportRequest::new().set_project("example");
5084 /// ```
5085 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5086 self.project = v.into();
5087 self
5088 }
5089
5090 /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
5091 ///
5092 /// # Example
5093 /// ```ignore,no_run
5094 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5095 /// use google_cloud_sql_v1::model::InstancesExportRequest;
5096 /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
5097 /// ```
5098 pub fn set_body<T>(mut self, v: T) -> Self
5099 where
5100 T: std::convert::Into<crate::model::InstancesExportRequest>,
5101 {
5102 self.body = std::option::Option::Some(v.into());
5103 self
5104 }
5105
5106 /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
5107 ///
5108 /// # Example
5109 /// ```ignore,no_run
5110 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5111 /// use google_cloud_sql_v1::model::InstancesExportRequest;
5112 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
5113 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
5114 /// ```
5115 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5116 where
5117 T: std::convert::Into<crate::model::InstancesExportRequest>,
5118 {
5119 self.body = v.map(|x| x.into());
5120 self
5121 }
5122}
5123
5124impl wkt::message::Message for SqlInstancesExportRequest {
5125 fn typename() -> &'static str {
5126 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
5127 }
5128}
5129
5130/// Instance failover request.
5131#[derive(Clone, Default, PartialEq)]
5132#[non_exhaustive]
5133pub struct SqlInstancesFailoverRequest {
5134 /// Cloud SQL instance ID. This does not include the project ID.
5135 pub instance: std::string::String,
5136
5137 /// ID of the project that contains the read replica.
5138 pub project: std::string::String,
5139
5140 #[allow(missing_docs)]
5141 pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
5142
5143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5144}
5145
5146impl SqlInstancesFailoverRequest {
5147 /// Creates a new default instance.
5148 pub fn new() -> Self {
5149 std::default::Default::default()
5150 }
5151
5152 /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
5153 ///
5154 /// # Example
5155 /// ```ignore,no_run
5156 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5157 /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
5158 /// ```
5159 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5160 self.instance = v.into();
5161 self
5162 }
5163
5164 /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
5165 ///
5166 /// # Example
5167 /// ```ignore,no_run
5168 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5169 /// let x = SqlInstancesFailoverRequest::new().set_project("example");
5170 /// ```
5171 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5172 self.project = v.into();
5173 self
5174 }
5175
5176 /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5177 ///
5178 /// # Example
5179 /// ```ignore,no_run
5180 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5181 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5182 /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
5183 /// ```
5184 pub fn set_body<T>(mut self, v: T) -> Self
5185 where
5186 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5187 {
5188 self.body = std::option::Option::Some(v.into());
5189 self
5190 }
5191
5192 /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5193 ///
5194 /// # Example
5195 /// ```ignore,no_run
5196 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5197 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5198 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
5199 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
5200 /// ```
5201 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5202 where
5203 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5204 {
5205 self.body = v.map(|x| x.into());
5206 self
5207 }
5208}
5209
5210impl wkt::message::Message for SqlInstancesFailoverRequest {
5211 fn typename() -> &'static str {
5212 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
5213 }
5214}
5215
5216/// Instance get request.
5217#[derive(Clone, Default, PartialEq)]
5218#[non_exhaustive]
5219pub struct SqlInstancesGetRequest {
5220 /// Required. Database instance ID. This does not include the project ID.
5221 pub instance: std::string::String,
5222
5223 /// Required. Project ID of the project that contains the instance.
5224 pub project: std::string::String,
5225
5226 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5227}
5228
5229impl SqlInstancesGetRequest {
5230 /// Creates a new default instance.
5231 pub fn new() -> Self {
5232 std::default::Default::default()
5233 }
5234
5235 /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
5236 ///
5237 /// # Example
5238 /// ```ignore,no_run
5239 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5240 /// let x = SqlInstancesGetRequest::new().set_instance("example");
5241 /// ```
5242 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5243 self.instance = v.into();
5244 self
5245 }
5246
5247 /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
5248 ///
5249 /// # Example
5250 /// ```ignore,no_run
5251 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5252 /// let x = SqlInstancesGetRequest::new().set_project("example");
5253 /// ```
5254 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5255 self.project = v.into();
5256 self
5257 }
5258}
5259
5260impl wkt::message::Message for SqlInstancesGetRequest {
5261 fn typename() -> &'static str {
5262 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
5263 }
5264}
5265
5266/// Instance import request.
5267#[derive(Clone, Default, PartialEq)]
5268#[non_exhaustive]
5269pub struct SqlInstancesImportRequest {
5270 /// Cloud SQL instance ID. This does not include the project ID.
5271 pub instance: std::string::String,
5272
5273 /// Project ID of the project that contains the instance.
5274 pub project: std::string::String,
5275
5276 #[allow(missing_docs)]
5277 pub body: std::option::Option<crate::model::InstancesImportRequest>,
5278
5279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5280}
5281
5282impl SqlInstancesImportRequest {
5283 /// Creates a new default instance.
5284 pub fn new() -> Self {
5285 std::default::Default::default()
5286 }
5287
5288 /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
5289 ///
5290 /// # Example
5291 /// ```ignore,no_run
5292 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5293 /// let x = SqlInstancesImportRequest::new().set_instance("example");
5294 /// ```
5295 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5296 self.instance = v.into();
5297 self
5298 }
5299
5300 /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
5301 ///
5302 /// # Example
5303 /// ```ignore,no_run
5304 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5305 /// let x = SqlInstancesImportRequest::new().set_project("example");
5306 /// ```
5307 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5308 self.project = v.into();
5309 self
5310 }
5311
5312 /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
5313 ///
5314 /// # Example
5315 /// ```ignore,no_run
5316 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5317 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5318 /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
5319 /// ```
5320 pub fn set_body<T>(mut self, v: T) -> Self
5321 where
5322 T: std::convert::Into<crate::model::InstancesImportRequest>,
5323 {
5324 self.body = std::option::Option::Some(v.into());
5325 self
5326 }
5327
5328 /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
5329 ///
5330 /// # Example
5331 /// ```ignore,no_run
5332 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5333 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5334 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
5335 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
5336 /// ```
5337 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5338 where
5339 T: std::convert::Into<crate::model::InstancesImportRequest>,
5340 {
5341 self.body = v.map(|x| x.into());
5342 self
5343 }
5344}
5345
5346impl wkt::message::Message for SqlInstancesImportRequest {
5347 fn typename() -> &'static str {
5348 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
5349 }
5350}
5351
5352/// Instance insert request.
5353#[derive(Clone, Default, PartialEq)]
5354#[non_exhaustive]
5355pub struct SqlInstancesInsertRequest {
5356 /// Project ID of the project to which the newly created Cloud SQL instances
5357 /// should belong.
5358 pub project: std::string::String,
5359
5360 #[allow(missing_docs)]
5361 pub body: std::option::Option<crate::model::DatabaseInstance>,
5362
5363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5364}
5365
5366impl SqlInstancesInsertRequest {
5367 /// Creates a new default instance.
5368 pub fn new() -> Self {
5369 std::default::Default::default()
5370 }
5371
5372 /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
5373 ///
5374 /// # Example
5375 /// ```ignore,no_run
5376 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5377 /// let x = SqlInstancesInsertRequest::new().set_project("example");
5378 /// ```
5379 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5380 self.project = v.into();
5381 self
5382 }
5383
5384 /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
5385 ///
5386 /// # Example
5387 /// ```ignore,no_run
5388 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5389 /// use google_cloud_sql_v1::model::DatabaseInstance;
5390 /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5391 /// ```
5392 pub fn set_body<T>(mut self, v: T) -> Self
5393 where
5394 T: std::convert::Into<crate::model::DatabaseInstance>,
5395 {
5396 self.body = std::option::Option::Some(v.into());
5397 self
5398 }
5399
5400 /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
5401 ///
5402 /// # Example
5403 /// ```ignore,no_run
5404 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5405 /// use google_cloud_sql_v1::model::DatabaseInstance;
5406 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5407 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5408 /// ```
5409 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5410 where
5411 T: std::convert::Into<crate::model::DatabaseInstance>,
5412 {
5413 self.body = v.map(|x| x.into());
5414 self
5415 }
5416}
5417
5418impl wkt::message::Message for SqlInstancesInsertRequest {
5419 fn typename() -> &'static str {
5420 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
5421 }
5422}
5423
5424/// Instance list request.
5425#[derive(Clone, Default, PartialEq)]
5426#[non_exhaustive]
5427pub struct SqlInstancesListRequest {
5428 /// A filter expression that filters resources listed in the response.
5429 /// The expression is in the form of field:value. For example,
5430 /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
5431 /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
5432 ///
5433 /// Multiple filter queries are space-separated. For example.
5434 /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
5435 /// expression is an AND expression. However, you can include AND and OR
5436 /// expressions explicitly.
5437 pub filter: std::string::String,
5438
5439 /// The maximum number of instances to return. The service may return fewer
5440 /// than this value.
5441 /// If unspecified, at most 500 instances are returned.
5442 /// The maximum value is 1000; values above 1000 are coerced to 1000.
5443 pub max_results: u32,
5444
5445 /// A previously-returned page token representing part of the larger set of
5446 /// results to view.
5447 pub page_token: std::string::String,
5448
5449 /// Project ID of the project for which to list Cloud SQL instances.
5450 pub project: std::string::String,
5451
5452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5453}
5454
5455impl SqlInstancesListRequest {
5456 /// Creates a new default instance.
5457 pub fn new() -> Self {
5458 std::default::Default::default()
5459 }
5460
5461 /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
5462 ///
5463 /// # Example
5464 /// ```ignore,no_run
5465 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5466 /// let x = SqlInstancesListRequest::new().set_filter("example");
5467 /// ```
5468 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5469 self.filter = v.into();
5470 self
5471 }
5472
5473 /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
5474 ///
5475 /// # Example
5476 /// ```ignore,no_run
5477 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5478 /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
5479 /// ```
5480 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
5481 self.max_results = v.into();
5482 self
5483 }
5484
5485 /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
5486 ///
5487 /// # Example
5488 /// ```ignore,no_run
5489 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5490 /// let x = SqlInstancesListRequest::new().set_page_token("example");
5491 /// ```
5492 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5493 self.page_token = v.into();
5494 self
5495 }
5496
5497 /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
5498 ///
5499 /// # Example
5500 /// ```ignore,no_run
5501 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5502 /// let x = SqlInstancesListRequest::new().set_project("example");
5503 /// ```
5504 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5505 self.project = v.into();
5506 self
5507 }
5508}
5509
5510impl wkt::message::Message for SqlInstancesListRequest {
5511 fn typename() -> &'static str {
5512 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
5513 }
5514}
5515
5516/// Instance list server CAs request.
5517#[derive(Clone, Default, PartialEq)]
5518#[non_exhaustive]
5519pub struct SqlInstancesListServerCasRequest {
5520 /// Cloud SQL instance ID. This does not include the project ID.
5521 pub instance: std::string::String,
5522
5523 /// Project ID of the project that contains the instance.
5524 pub project: std::string::String,
5525
5526 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5527}
5528
5529impl SqlInstancesListServerCasRequest {
5530 /// Creates a new default instance.
5531 pub fn new() -> Self {
5532 std::default::Default::default()
5533 }
5534
5535 /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
5536 ///
5537 /// # Example
5538 /// ```ignore,no_run
5539 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5540 /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
5541 /// ```
5542 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5543 self.instance = v.into();
5544 self
5545 }
5546
5547 /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
5548 ///
5549 /// # Example
5550 /// ```ignore,no_run
5551 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5552 /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
5553 /// ```
5554 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5555 self.project = v.into();
5556 self
5557 }
5558}
5559
5560impl wkt::message::Message for SqlInstancesListServerCasRequest {
5561 fn typename() -> &'static str {
5562 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
5563 }
5564}
5565
5566/// Instance list server certificates request.
5567#[derive(Clone, Default, PartialEq)]
5568#[non_exhaustive]
5569pub struct SqlInstancesListServerCertificatesRequest {
5570 /// Required. Cloud SQL instance ID. This does not include the project ID.
5571 pub instance: std::string::String,
5572
5573 /// Required. Project ID of the project that contains the instance.
5574 pub project: std::string::String,
5575
5576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5577}
5578
5579impl SqlInstancesListServerCertificatesRequest {
5580 /// Creates a new default instance.
5581 pub fn new() -> Self {
5582 std::default::Default::default()
5583 }
5584
5585 /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
5586 ///
5587 /// # Example
5588 /// ```ignore,no_run
5589 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5590 /// let x = SqlInstancesListServerCertificatesRequest::new().set_instance("example");
5591 /// ```
5592 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5593 self.instance = v.into();
5594 self
5595 }
5596
5597 /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
5598 ///
5599 /// # Example
5600 /// ```ignore,no_run
5601 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5602 /// let x = SqlInstancesListServerCertificatesRequest::new().set_project("example");
5603 /// ```
5604 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5605 self.project = v.into();
5606 self
5607 }
5608}
5609
5610impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
5611 fn typename() -> &'static str {
5612 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
5613 }
5614}
5615
5616/// Instance list Entra ID certificates request.
5617#[derive(Clone, Default, PartialEq)]
5618#[non_exhaustive]
5619pub struct SqlInstancesListEntraIdCertificatesRequest {
5620 /// Required. Cloud SQL instance ID. This does not include the project ID.
5621 pub instance: std::string::String,
5622
5623 /// Required. Project ID of the project that contains the instance.
5624 pub project: std::string::String,
5625
5626 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5627}
5628
5629impl SqlInstancesListEntraIdCertificatesRequest {
5630 /// Creates a new default instance.
5631 pub fn new() -> Self {
5632 std::default::Default::default()
5633 }
5634
5635 /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
5636 ///
5637 /// # Example
5638 /// ```ignore,no_run
5639 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5640 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_instance("example");
5641 /// ```
5642 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5643 self.instance = v.into();
5644 self
5645 }
5646
5647 /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
5648 ///
5649 /// # Example
5650 /// ```ignore,no_run
5651 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5652 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_project("example");
5653 /// ```
5654 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5655 self.project = v.into();
5656 self
5657 }
5658}
5659
5660impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
5661 fn typename() -> &'static str {
5662 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
5663 }
5664}
5665
5666/// Instance patch request.
5667#[derive(Clone, Default, PartialEq)]
5668#[non_exhaustive]
5669pub struct SqlInstancesPatchRequest {
5670 /// Cloud SQL instance ID. This does not include the project ID.
5671 pub instance: std::string::String,
5672
5673 /// Project ID of the project that contains the instance.
5674 pub project: std::string::String,
5675
5676 /// Optional. Set PSC config to the same value as the existing config to
5677 /// reconcile the PSC networking.
5678 pub reconcile_psc_networking: std::option::Option<bool>,
5679
5680 /// Optional. Set PSC config to the same value as the existing config and force
5681 /// reconcile the PSC networking.
5682 pub reconcile_psc_networking_force: std::option::Option<bool>,
5683
5684 #[allow(missing_docs)]
5685 pub body: std::option::Option<crate::model::DatabaseInstance>,
5686
5687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5688}
5689
5690impl SqlInstancesPatchRequest {
5691 /// Creates a new default instance.
5692 pub fn new() -> Self {
5693 std::default::Default::default()
5694 }
5695
5696 /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
5697 ///
5698 /// # Example
5699 /// ```ignore,no_run
5700 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5701 /// let x = SqlInstancesPatchRequest::new().set_instance("example");
5702 /// ```
5703 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5704 self.instance = v.into();
5705 self
5706 }
5707
5708 /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
5709 ///
5710 /// # Example
5711 /// ```ignore,no_run
5712 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5713 /// let x = SqlInstancesPatchRequest::new().set_project("example");
5714 /// ```
5715 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5716 self.project = v.into();
5717 self
5718 }
5719
5720 /// Sets the value of [reconcile_psc_networking][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking].
5721 ///
5722 /// # Example
5723 /// ```ignore,no_run
5724 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5725 /// let x = SqlInstancesPatchRequest::new().set_reconcile_psc_networking(true);
5726 /// ```
5727 pub fn set_reconcile_psc_networking<T>(mut self, v: T) -> Self
5728 where
5729 T: std::convert::Into<bool>,
5730 {
5731 self.reconcile_psc_networking = std::option::Option::Some(v.into());
5732 self
5733 }
5734
5735 /// Sets or clears the value of [reconcile_psc_networking][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking].
5736 ///
5737 /// # Example
5738 /// ```ignore,no_run
5739 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5740 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking(Some(false));
5741 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking(None::<bool>);
5742 /// ```
5743 pub fn set_or_clear_reconcile_psc_networking<T>(mut self, v: std::option::Option<T>) -> Self
5744 where
5745 T: std::convert::Into<bool>,
5746 {
5747 self.reconcile_psc_networking = v.map(|x| x.into());
5748 self
5749 }
5750
5751 /// Sets the value of [reconcile_psc_networking_force][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking_force].
5752 ///
5753 /// # Example
5754 /// ```ignore,no_run
5755 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5756 /// let x = SqlInstancesPatchRequest::new().set_reconcile_psc_networking_force(true);
5757 /// ```
5758 pub fn set_reconcile_psc_networking_force<T>(mut self, v: T) -> Self
5759 where
5760 T: std::convert::Into<bool>,
5761 {
5762 self.reconcile_psc_networking_force = std::option::Option::Some(v.into());
5763 self
5764 }
5765
5766 /// Sets or clears the value of [reconcile_psc_networking_force][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking_force].
5767 ///
5768 /// # Example
5769 /// ```ignore,no_run
5770 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5771 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking_force(Some(false));
5772 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking_force(None::<bool>);
5773 /// ```
5774 pub fn set_or_clear_reconcile_psc_networking_force<T>(
5775 mut self,
5776 v: std::option::Option<T>,
5777 ) -> Self
5778 where
5779 T: std::convert::Into<bool>,
5780 {
5781 self.reconcile_psc_networking_force = v.map(|x| x.into());
5782 self
5783 }
5784
5785 /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
5786 ///
5787 /// # Example
5788 /// ```ignore,no_run
5789 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5790 /// use google_cloud_sql_v1::model::DatabaseInstance;
5791 /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5792 /// ```
5793 pub fn set_body<T>(mut self, v: T) -> Self
5794 where
5795 T: std::convert::Into<crate::model::DatabaseInstance>,
5796 {
5797 self.body = std::option::Option::Some(v.into());
5798 self
5799 }
5800
5801 /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
5802 ///
5803 /// # Example
5804 /// ```ignore,no_run
5805 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5806 /// use google_cloud_sql_v1::model::DatabaseInstance;
5807 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5808 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5809 /// ```
5810 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5811 where
5812 T: std::convert::Into<crate::model::DatabaseInstance>,
5813 {
5814 self.body = v.map(|x| x.into());
5815 self
5816 }
5817}
5818
5819impl wkt::message::Message for SqlInstancesPatchRequest {
5820 fn typename() -> &'static str {
5821 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
5822 }
5823}
5824
5825/// Instance promote replica request.
5826#[derive(Clone, Default, PartialEq)]
5827#[non_exhaustive]
5828pub struct SqlInstancesPromoteReplicaRequest {
5829 /// Cloud SQL read replica instance name.
5830 pub instance: std::string::String,
5831
5832 /// ID of the project that contains the read replica.
5833 pub project: std::string::String,
5834
5835 /// Set to true to invoke a replica failover to the DR
5836 /// replica. As part of replica failover, the promote operation attempts
5837 /// to add the original primary instance as a replica of the promoted
5838 /// DR replica when the original primary instance comes back online.
5839 /// If set to false or not specified, then the original primary
5840 /// instance becomes an independent Cloud SQL primary instance.
5841 pub failover: bool,
5842
5843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5844}
5845
5846impl SqlInstancesPromoteReplicaRequest {
5847 /// Creates a new default instance.
5848 pub fn new() -> Self {
5849 std::default::Default::default()
5850 }
5851
5852 /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
5853 ///
5854 /// # Example
5855 /// ```ignore,no_run
5856 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5857 /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
5858 /// ```
5859 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5860 self.instance = v.into();
5861 self
5862 }
5863
5864 /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
5865 ///
5866 /// # Example
5867 /// ```ignore,no_run
5868 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5869 /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
5870 /// ```
5871 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5872 self.project = v.into();
5873 self
5874 }
5875
5876 /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
5877 ///
5878 /// # Example
5879 /// ```ignore,no_run
5880 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5881 /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
5882 /// ```
5883 pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5884 self.failover = v.into();
5885 self
5886 }
5887}
5888
5889impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
5890 fn typename() -> &'static str {
5891 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
5892 }
5893}
5894
5895/// Instance switchover request.
5896#[derive(Clone, Default, PartialEq)]
5897#[non_exhaustive]
5898pub struct SqlInstancesSwitchoverRequest {
5899 /// Cloud SQL read replica instance name.
5900 pub instance: std::string::String,
5901
5902 /// ID of the project that contains the replica.
5903 pub project: std::string::String,
5904
5905 /// Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
5906 /// timeout, which is a sum of all database operations. Default value is 10
5907 /// minutes and can be modified to a maximum value of 24 hours.
5908 pub db_timeout: std::option::Option<wkt::Duration>,
5909
5910 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5911}
5912
5913impl SqlInstancesSwitchoverRequest {
5914 /// Creates a new default instance.
5915 pub fn new() -> Self {
5916 std::default::Default::default()
5917 }
5918
5919 /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
5920 ///
5921 /// # Example
5922 /// ```ignore,no_run
5923 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5924 /// let x = SqlInstancesSwitchoverRequest::new().set_instance("example");
5925 /// ```
5926 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5927 self.instance = v.into();
5928 self
5929 }
5930
5931 /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
5932 ///
5933 /// # Example
5934 /// ```ignore,no_run
5935 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5936 /// let x = SqlInstancesSwitchoverRequest::new().set_project("example");
5937 /// ```
5938 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5939 self.project = v.into();
5940 self
5941 }
5942
5943 /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5944 ///
5945 /// # Example
5946 /// ```ignore,no_run
5947 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5948 /// use wkt::Duration;
5949 /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
5950 /// ```
5951 pub fn set_db_timeout<T>(mut self, v: T) -> Self
5952 where
5953 T: std::convert::Into<wkt::Duration>,
5954 {
5955 self.db_timeout = std::option::Option::Some(v.into());
5956 self
5957 }
5958
5959 /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5960 ///
5961 /// # Example
5962 /// ```ignore,no_run
5963 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5964 /// use wkt::Duration;
5965 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
5966 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
5967 /// ```
5968 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5969 where
5970 T: std::convert::Into<wkt::Duration>,
5971 {
5972 self.db_timeout = v.map(|x| x.into());
5973 self
5974 }
5975}
5976
5977impl wkt::message::Message for SqlInstancesSwitchoverRequest {
5978 fn typename() -> &'static str {
5979 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
5980 }
5981}
5982
5983/// Instance reset SSL config request.
5984#[derive(Clone, Default, PartialEq)]
5985#[non_exhaustive]
5986pub struct SqlInstancesResetSslConfigRequest {
5987 /// Cloud SQL instance ID. This does not include the project ID.
5988 pub instance: std::string::String,
5989
5990 /// Project ID of the project that contains the instance.
5991 pub project: std::string::String,
5992
5993 /// Optional. Reset SSL mode to use.
5994 pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
5995
5996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5997}
5998
5999impl SqlInstancesResetSslConfigRequest {
6000 /// Creates a new default instance.
6001 pub fn new() -> Self {
6002 std::default::Default::default()
6003 }
6004
6005 /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
6006 ///
6007 /// # Example
6008 /// ```ignore,no_run
6009 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
6010 /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
6011 /// ```
6012 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6013 self.instance = v.into();
6014 self
6015 }
6016
6017 /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
6018 ///
6019 /// # Example
6020 /// ```ignore,no_run
6021 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
6022 /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
6023 /// ```
6024 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6025 self.project = v.into();
6026 self
6027 }
6028
6029 /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
6030 ///
6031 /// # Example
6032 /// ```ignore,no_run
6033 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
6034 /// use google_cloud_sql_v1::model::sql_instances_reset_ssl_config_request::ResetSslMode;
6035 /// let x0 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::All);
6036 /// let x1 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::SyncFromPrimary);
6037 /// ```
6038 pub fn set_mode<
6039 T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
6040 >(
6041 mut self,
6042 v: T,
6043 ) -> Self {
6044 self.mode = v.into();
6045 self
6046 }
6047}
6048
6049impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
6050 fn typename() -> &'static str {
6051 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
6052 }
6053}
6054
6055/// Defines additional types related to [SqlInstancesResetSslConfigRequest].
6056pub mod sql_instances_reset_ssl_config_request {
6057 #[allow(unused_imports)]
6058 use super::*;
6059
6060 /// Reset SSL mode to selectively refresh the SSL materials.
6061 ///
6062 /// # Working with unknown values
6063 ///
6064 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6065 /// additional enum variants at any time. Adding new variants is not considered
6066 /// a breaking change. Applications should write their code in anticipation of:
6067 ///
6068 /// - New values appearing in future releases of the client library, **and**
6069 /// - New values received dynamically, without application changes.
6070 ///
6071 /// Please consult the [Working with enums] section in the user guide for some
6072 /// guidelines.
6073 ///
6074 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6075 #[derive(Clone, Debug, PartialEq)]
6076 #[non_exhaustive]
6077 pub enum ResetSslMode {
6078 /// Reset SSL mode is not specified.
6079 Unspecified,
6080 /// Refresh all TLS configs. This is the default behaviour.
6081 All,
6082 /// Refreshes the replication-related TLS configuration settings provided by
6083 /// the primary instance.
6084 /// Not applicable to on-premises replication instances.
6085 SyncFromPrimary,
6086 /// If set, the enum was initialized with an unknown value.
6087 ///
6088 /// Applications can examine the value using [ResetSslMode::value] or
6089 /// [ResetSslMode::name].
6090 UnknownValue(reset_ssl_mode::UnknownValue),
6091 }
6092
6093 #[doc(hidden)]
6094 pub mod reset_ssl_mode {
6095 #[allow(unused_imports)]
6096 use super::*;
6097 #[derive(Clone, Debug, PartialEq)]
6098 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6099 }
6100
6101 impl ResetSslMode {
6102 /// Gets the enum value.
6103 ///
6104 /// Returns `None` if the enum contains an unknown value deserialized from
6105 /// the string representation of enums.
6106 pub fn value(&self) -> std::option::Option<i32> {
6107 match self {
6108 Self::Unspecified => std::option::Option::Some(0),
6109 Self::All => std::option::Option::Some(1),
6110 Self::SyncFromPrimary => std::option::Option::Some(2),
6111 Self::UnknownValue(u) => u.0.value(),
6112 }
6113 }
6114
6115 /// Gets the enum value as a string.
6116 ///
6117 /// Returns `None` if the enum contains an unknown value deserialized from
6118 /// the integer representation of enums.
6119 pub fn name(&self) -> std::option::Option<&str> {
6120 match self {
6121 Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
6122 Self::All => std::option::Option::Some("ALL"),
6123 Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
6124 Self::UnknownValue(u) => u.0.name(),
6125 }
6126 }
6127 }
6128
6129 impl std::default::Default for ResetSslMode {
6130 fn default() -> Self {
6131 use std::convert::From;
6132 Self::from(0)
6133 }
6134 }
6135
6136 impl std::fmt::Display for ResetSslMode {
6137 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6138 wkt::internal::display_enum(f, self.name(), self.value())
6139 }
6140 }
6141
6142 impl std::convert::From<i32> for ResetSslMode {
6143 fn from(value: i32) -> Self {
6144 match value {
6145 0 => Self::Unspecified,
6146 1 => Self::All,
6147 2 => Self::SyncFromPrimary,
6148 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6149 wkt::internal::UnknownEnumValue::Integer(value),
6150 )),
6151 }
6152 }
6153 }
6154
6155 impl std::convert::From<&str> for ResetSslMode {
6156 fn from(value: &str) -> Self {
6157 use std::string::ToString;
6158 match value {
6159 "RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
6160 "ALL" => Self::All,
6161 "SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
6162 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6163 wkt::internal::UnknownEnumValue::String(value.to_string()),
6164 )),
6165 }
6166 }
6167 }
6168
6169 impl serde::ser::Serialize for ResetSslMode {
6170 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6171 where
6172 S: serde::Serializer,
6173 {
6174 match self {
6175 Self::Unspecified => serializer.serialize_i32(0),
6176 Self::All => serializer.serialize_i32(1),
6177 Self::SyncFromPrimary => serializer.serialize_i32(2),
6178 Self::UnknownValue(u) => u.0.serialize(serializer),
6179 }
6180 }
6181 }
6182
6183 impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
6184 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6185 where
6186 D: serde::Deserializer<'de>,
6187 {
6188 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
6189 ".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
6190 ))
6191 }
6192 }
6193}
6194
6195/// Instance restart request.
6196#[derive(Clone, Default, PartialEq)]
6197#[non_exhaustive]
6198pub struct SqlInstancesRestartRequest {
6199 /// Cloud SQL instance ID. This does not include the project ID.
6200 pub instance: std::string::String,
6201
6202 /// Project ID of the project that contains the instance to be restarted.
6203 pub project: std::string::String,
6204
6205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6206}
6207
6208impl SqlInstancesRestartRequest {
6209 /// Creates a new default instance.
6210 pub fn new() -> Self {
6211 std::default::Default::default()
6212 }
6213
6214 /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
6215 ///
6216 /// # Example
6217 /// ```ignore,no_run
6218 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6219 /// let x = SqlInstancesRestartRequest::new().set_instance("example");
6220 /// ```
6221 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6222 self.instance = v.into();
6223 self
6224 }
6225
6226 /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
6227 ///
6228 /// # Example
6229 /// ```ignore,no_run
6230 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6231 /// let x = SqlInstancesRestartRequest::new().set_project("example");
6232 /// ```
6233 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6234 self.project = v.into();
6235 self
6236 }
6237}
6238
6239impl wkt::message::Message for SqlInstancesRestartRequest {
6240 fn typename() -> &'static str {
6241 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
6242 }
6243}
6244
6245/// Instance restore backup request.
6246#[derive(Clone, Default, PartialEq)]
6247#[non_exhaustive]
6248pub struct SqlInstancesRestoreBackupRequest {
6249 /// Cloud SQL instance ID. This does not include the project ID.
6250 pub instance: std::string::String,
6251
6252 /// Project ID of the project that contains the instance.
6253 pub project: std::string::String,
6254
6255 #[allow(missing_docs)]
6256 pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
6257
6258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6259}
6260
6261impl SqlInstancesRestoreBackupRequest {
6262 /// Creates a new default instance.
6263 pub fn new() -> Self {
6264 std::default::Default::default()
6265 }
6266
6267 /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
6268 ///
6269 /// # Example
6270 /// ```ignore,no_run
6271 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6272 /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
6273 /// ```
6274 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6275 self.instance = v.into();
6276 self
6277 }
6278
6279 /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
6280 ///
6281 /// # Example
6282 /// ```ignore,no_run
6283 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6284 /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
6285 /// ```
6286 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6287 self.project = v.into();
6288 self
6289 }
6290
6291 /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6292 ///
6293 /// # Example
6294 /// ```ignore,no_run
6295 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6296 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6297 /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
6298 /// ```
6299 pub fn set_body<T>(mut self, v: T) -> Self
6300 where
6301 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6302 {
6303 self.body = std::option::Option::Some(v.into());
6304 self
6305 }
6306
6307 /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6308 ///
6309 /// # Example
6310 /// ```ignore,no_run
6311 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6312 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6313 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
6314 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
6315 /// ```
6316 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6317 where
6318 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6319 {
6320 self.body = v.map(|x| x.into());
6321 self
6322 }
6323}
6324
6325impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
6326 fn typename() -> &'static str {
6327 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
6328 }
6329}
6330
6331/// Instance rotate server CA request.
6332#[derive(Clone, Default, PartialEq)]
6333#[non_exhaustive]
6334pub struct SqlInstancesRotateServerCaRequest {
6335 /// Cloud SQL instance ID. This does not include the project ID.
6336 pub instance: std::string::String,
6337
6338 /// Project ID of the project that contains the instance.
6339 pub project: std::string::String,
6340
6341 #[allow(missing_docs)]
6342 pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
6343
6344 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6345}
6346
6347impl SqlInstancesRotateServerCaRequest {
6348 /// Creates a new default instance.
6349 pub fn new() -> Self {
6350 std::default::Default::default()
6351 }
6352
6353 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
6354 ///
6355 /// # Example
6356 /// ```ignore,no_run
6357 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6358 /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
6359 /// ```
6360 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6361 self.instance = v.into();
6362 self
6363 }
6364
6365 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
6366 ///
6367 /// # Example
6368 /// ```ignore,no_run
6369 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6370 /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
6371 /// ```
6372 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6373 self.project = v.into();
6374 self
6375 }
6376
6377 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6378 ///
6379 /// # Example
6380 /// ```ignore,no_run
6381 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6382 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6383 /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
6384 /// ```
6385 pub fn set_body<T>(mut self, v: T) -> Self
6386 where
6387 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6388 {
6389 self.body = std::option::Option::Some(v.into());
6390 self
6391 }
6392
6393 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6394 ///
6395 /// # Example
6396 /// ```ignore,no_run
6397 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6398 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6399 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
6400 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
6401 /// ```
6402 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6403 where
6404 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6405 {
6406 self.body = v.map(|x| x.into());
6407 self
6408 }
6409}
6410
6411impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
6412 fn typename() -> &'static str {
6413 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
6414 }
6415}
6416
6417/// Instance rotate server certificate request.
6418#[derive(Clone, Default, PartialEq)]
6419#[non_exhaustive]
6420pub struct SqlInstancesRotateServerCertificateRequest {
6421 /// Required. Cloud SQL instance ID. This does not include the project ID.
6422 pub instance: std::string::String,
6423
6424 /// Required. Project ID of the project that contains the instance.
6425 pub project: std::string::String,
6426
6427 /// Optional. Rotate server certificate request body.
6428 pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
6429
6430 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6431}
6432
6433impl SqlInstancesRotateServerCertificateRequest {
6434 /// Creates a new default instance.
6435 pub fn new() -> Self {
6436 std::default::Default::default()
6437 }
6438
6439 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
6440 ///
6441 /// # Example
6442 /// ```ignore,no_run
6443 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6444 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_instance("example");
6445 /// ```
6446 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6447 self.instance = v.into();
6448 self
6449 }
6450
6451 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
6452 ///
6453 /// # Example
6454 /// ```ignore,no_run
6455 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6456 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_project("example");
6457 /// ```
6458 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6459 self.project = v.into();
6460 self
6461 }
6462
6463 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6464 ///
6465 /// # Example
6466 /// ```ignore,no_run
6467 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6468 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6469 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_body(InstancesRotateServerCertificateRequest::default()/* use setters */);
6470 /// ```
6471 pub fn set_body<T>(mut self, v: T) -> Self
6472 where
6473 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6474 {
6475 self.body = std::option::Option::Some(v.into());
6476 self
6477 }
6478
6479 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6480 ///
6481 /// # Example
6482 /// ```ignore,no_run
6483 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6484 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6485 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(Some(InstancesRotateServerCertificateRequest::default()/* use setters */));
6486 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(None::<InstancesRotateServerCertificateRequest>);
6487 /// ```
6488 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6489 where
6490 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6491 {
6492 self.body = v.map(|x| x.into());
6493 self
6494 }
6495}
6496
6497impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
6498 fn typename() -> &'static str {
6499 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
6500 }
6501}
6502
6503/// Instance rotate server certificate request.
6504#[derive(Clone, Default, PartialEq)]
6505#[non_exhaustive]
6506pub struct SqlInstancesRotateEntraIdCertificateRequest {
6507 /// Required. Cloud SQL instance ID. This does not include the project ID.
6508 pub instance: std::string::String,
6509
6510 /// Required. Project ID of the project that contains the instance.
6511 pub project: std::string::String,
6512
6513 /// Optional. Rotate Entra ID certificate request body.
6514 pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
6515
6516 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6517}
6518
6519impl SqlInstancesRotateEntraIdCertificateRequest {
6520 /// Creates a new default instance.
6521 pub fn new() -> Self {
6522 std::default::Default::default()
6523 }
6524
6525 /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
6526 ///
6527 /// # Example
6528 /// ```ignore,no_run
6529 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6530 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_instance("example");
6531 /// ```
6532 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6533 self.instance = v.into();
6534 self
6535 }
6536
6537 /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
6538 ///
6539 /// # Example
6540 /// ```ignore,no_run
6541 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6542 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_project("example");
6543 /// ```
6544 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6545 self.project = v.into();
6546 self
6547 }
6548
6549 /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6550 ///
6551 /// # Example
6552 /// ```ignore,no_run
6553 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6554 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6555 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_body(InstancesRotateEntraIdCertificateRequest::default()/* use setters */);
6556 /// ```
6557 pub fn set_body<T>(mut self, v: T) -> Self
6558 where
6559 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6560 {
6561 self.body = std::option::Option::Some(v.into());
6562 self
6563 }
6564
6565 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6566 ///
6567 /// # Example
6568 /// ```ignore,no_run
6569 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6570 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6571 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(Some(InstancesRotateEntraIdCertificateRequest::default()/* use setters */));
6572 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(None::<InstancesRotateEntraIdCertificateRequest>);
6573 /// ```
6574 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6575 where
6576 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6577 {
6578 self.body = v.map(|x| x.into());
6579 self
6580 }
6581}
6582
6583impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
6584 fn typename() -> &'static str {
6585 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
6586 }
6587}
6588
6589/// Instance start replica request.
6590#[derive(Clone, Default, PartialEq)]
6591#[non_exhaustive]
6592pub struct SqlInstancesStartReplicaRequest {
6593 /// Cloud SQL read replica instance name.
6594 pub instance: std::string::String,
6595
6596 /// ID of the project that contains the read replica.
6597 pub project: std::string::String,
6598
6599 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6600}
6601
6602impl SqlInstancesStartReplicaRequest {
6603 /// Creates a new default instance.
6604 pub fn new() -> Self {
6605 std::default::Default::default()
6606 }
6607
6608 /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
6609 ///
6610 /// # Example
6611 /// ```ignore,no_run
6612 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6613 /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
6614 /// ```
6615 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6616 self.instance = v.into();
6617 self
6618 }
6619
6620 /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
6621 ///
6622 /// # Example
6623 /// ```ignore,no_run
6624 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6625 /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
6626 /// ```
6627 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6628 self.project = v.into();
6629 self
6630 }
6631}
6632
6633impl wkt::message::Message for SqlInstancesStartReplicaRequest {
6634 fn typename() -> &'static str {
6635 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
6636 }
6637}
6638
6639/// Instance stop replica request.
6640#[derive(Clone, Default, PartialEq)]
6641#[non_exhaustive]
6642pub struct SqlInstancesStopReplicaRequest {
6643 /// Cloud SQL read replica instance name.
6644 pub instance: std::string::String,
6645
6646 /// ID of the project that contains the read replica.
6647 pub project: std::string::String,
6648
6649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6650}
6651
6652impl SqlInstancesStopReplicaRequest {
6653 /// Creates a new default instance.
6654 pub fn new() -> Self {
6655 std::default::Default::default()
6656 }
6657
6658 /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
6659 ///
6660 /// # Example
6661 /// ```ignore,no_run
6662 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6663 /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
6664 /// ```
6665 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6666 self.instance = v.into();
6667 self
6668 }
6669
6670 /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
6671 ///
6672 /// # Example
6673 /// ```ignore,no_run
6674 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6675 /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
6676 /// ```
6677 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6678 self.project = v.into();
6679 self
6680 }
6681}
6682
6683impl wkt::message::Message for SqlInstancesStopReplicaRequest {
6684 fn typename() -> &'static str {
6685 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
6686 }
6687}
6688
6689/// Instance truncate log request.
6690#[derive(Clone, Default, PartialEq)]
6691#[non_exhaustive]
6692pub struct SqlInstancesTruncateLogRequest {
6693 /// Cloud SQL instance ID. This does not include the project ID.
6694 pub instance: std::string::String,
6695
6696 /// Project ID of the Cloud SQL project.
6697 pub project: std::string::String,
6698
6699 #[allow(missing_docs)]
6700 pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
6701
6702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6703}
6704
6705impl SqlInstancesTruncateLogRequest {
6706 /// Creates a new default instance.
6707 pub fn new() -> Self {
6708 std::default::Default::default()
6709 }
6710
6711 /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
6712 ///
6713 /// # Example
6714 /// ```ignore,no_run
6715 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6716 /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
6717 /// ```
6718 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6719 self.instance = v.into();
6720 self
6721 }
6722
6723 /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
6724 ///
6725 /// # Example
6726 /// ```ignore,no_run
6727 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6728 /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
6729 /// ```
6730 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6731 self.project = v.into();
6732 self
6733 }
6734
6735 /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6736 ///
6737 /// # Example
6738 /// ```ignore,no_run
6739 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6740 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6741 /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
6742 /// ```
6743 pub fn set_body<T>(mut self, v: T) -> Self
6744 where
6745 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6746 {
6747 self.body = std::option::Option::Some(v.into());
6748 self
6749 }
6750
6751 /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6752 ///
6753 /// # Example
6754 /// ```ignore,no_run
6755 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6756 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6757 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
6758 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
6759 /// ```
6760 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6761 where
6762 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6763 {
6764 self.body = v.map(|x| x.into());
6765 self
6766 }
6767}
6768
6769impl wkt::message::Message for SqlInstancesTruncateLogRequest {
6770 fn typename() -> &'static str {
6771 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
6772 }
6773}
6774
6775/// Instance perform disk shrink request.
6776#[derive(Clone, Default, PartialEq)]
6777#[non_exhaustive]
6778pub struct SqlInstancesPerformDiskShrinkRequest {
6779 /// Cloud SQL instance ID. This does not include the project ID.
6780 pub instance: std::string::String,
6781
6782 /// Project ID of the project that contains the instance.
6783 pub project: std::string::String,
6784
6785 /// Perform disk shrink context.
6786 pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
6787
6788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6789}
6790
6791impl SqlInstancesPerformDiskShrinkRequest {
6792 /// Creates a new default instance.
6793 pub fn new() -> Self {
6794 std::default::Default::default()
6795 }
6796
6797 /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
6798 ///
6799 /// # Example
6800 /// ```ignore,no_run
6801 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6802 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
6803 /// ```
6804 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6805 self.instance = v.into();
6806 self
6807 }
6808
6809 /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
6810 ///
6811 /// # Example
6812 /// ```ignore,no_run
6813 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6814 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
6815 /// ```
6816 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6817 self.project = v.into();
6818 self
6819 }
6820
6821 /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6822 ///
6823 /// # Example
6824 /// ```ignore,no_run
6825 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6826 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6827 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
6828 /// ```
6829 pub fn set_body<T>(mut self, v: T) -> Self
6830 where
6831 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6832 {
6833 self.body = std::option::Option::Some(v.into());
6834 self
6835 }
6836
6837 /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6838 ///
6839 /// # Example
6840 /// ```ignore,no_run
6841 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6842 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6843 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
6844 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
6845 /// ```
6846 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6847 where
6848 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6849 {
6850 self.body = v.map(|x| x.into());
6851 self
6852 }
6853}
6854
6855impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
6856 fn typename() -> &'static str {
6857 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
6858 }
6859}
6860
6861/// Instance update request.
6862#[derive(Clone, Default, PartialEq)]
6863#[non_exhaustive]
6864pub struct SqlInstancesUpdateRequest {
6865 /// Cloud SQL instance ID. This does not include the project ID.
6866 pub instance: std::string::String,
6867
6868 /// Project ID of the project that contains the instance.
6869 pub project: std::string::String,
6870
6871 #[allow(missing_docs)]
6872 pub body: std::option::Option<crate::model::DatabaseInstance>,
6873
6874 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6875}
6876
6877impl SqlInstancesUpdateRequest {
6878 /// Creates a new default instance.
6879 pub fn new() -> Self {
6880 std::default::Default::default()
6881 }
6882
6883 /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
6884 ///
6885 /// # Example
6886 /// ```ignore,no_run
6887 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6888 /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
6889 /// ```
6890 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6891 self.instance = v.into();
6892 self
6893 }
6894
6895 /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
6896 ///
6897 /// # Example
6898 /// ```ignore,no_run
6899 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6900 /// let x = SqlInstancesUpdateRequest::new().set_project("example");
6901 /// ```
6902 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6903 self.project = v.into();
6904 self
6905 }
6906
6907 /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6908 ///
6909 /// # Example
6910 /// ```ignore,no_run
6911 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6912 /// use google_cloud_sql_v1::model::DatabaseInstance;
6913 /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
6914 /// ```
6915 pub fn set_body<T>(mut self, v: T) -> Self
6916 where
6917 T: std::convert::Into<crate::model::DatabaseInstance>,
6918 {
6919 self.body = std::option::Option::Some(v.into());
6920 self
6921 }
6922
6923 /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6924 ///
6925 /// # Example
6926 /// ```ignore,no_run
6927 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6928 /// use google_cloud_sql_v1::model::DatabaseInstance;
6929 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
6930 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
6931 /// ```
6932 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6933 where
6934 T: std::convert::Into<crate::model::DatabaseInstance>,
6935 {
6936 self.body = v.map(|x| x.into());
6937 self
6938 }
6939}
6940
6941impl wkt::message::Message for SqlInstancesUpdateRequest {
6942 fn typename() -> &'static str {
6943 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
6944 }
6945}
6946
6947/// Instance reschedule maintenance request.
6948#[derive(Clone, Default, PartialEq)]
6949#[non_exhaustive]
6950pub struct SqlInstancesRescheduleMaintenanceRequest {
6951 /// Cloud SQL instance ID. This does not include the project ID.
6952 pub instance: std::string::String,
6953
6954 /// ID of the project that contains the instance.
6955 pub project: std::string::String,
6956
6957 #[allow(missing_docs)]
6958 pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6959
6960 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6961}
6962
6963impl SqlInstancesRescheduleMaintenanceRequest {
6964 /// Creates a new default instance.
6965 pub fn new() -> Self {
6966 std::default::Default::default()
6967 }
6968
6969 /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
6970 ///
6971 /// # Example
6972 /// ```ignore,no_run
6973 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6974 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
6975 /// ```
6976 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6977 self.instance = v.into();
6978 self
6979 }
6980
6981 /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
6982 ///
6983 /// # Example
6984 /// ```ignore,no_run
6985 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6986 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
6987 /// ```
6988 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6989 self.project = v.into();
6990 self
6991 }
6992
6993 /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6994 ///
6995 /// # Example
6996 /// ```ignore,no_run
6997 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6998 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6999 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
7000 /// ```
7001 pub fn set_body<T>(mut self, v: T) -> Self
7002 where
7003 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
7004 {
7005 self.body = std::option::Option::Some(v.into());
7006 self
7007 }
7008
7009 /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
7010 ///
7011 /// # Example
7012 /// ```ignore,no_run
7013 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
7014 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
7015 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
7016 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
7017 /// ```
7018 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7019 where
7020 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
7021 {
7022 self.body = v.map(|x| x.into());
7023 self
7024 }
7025}
7026
7027impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
7028 fn typename() -> &'static str {
7029 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
7030 }
7031}
7032
7033/// Instance reencrypt request.
7034#[derive(Clone, Default, PartialEq)]
7035#[non_exhaustive]
7036pub struct SqlInstancesReencryptRequest {
7037 /// Cloud SQL instance ID. This does not include the project ID.
7038 pub instance: std::string::String,
7039
7040 /// ID of the project that contains the instance.
7041 pub project: std::string::String,
7042
7043 /// Reencrypt body that users request
7044 pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
7045
7046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7047}
7048
7049impl SqlInstancesReencryptRequest {
7050 /// Creates a new default instance.
7051 pub fn new() -> Self {
7052 std::default::Default::default()
7053 }
7054
7055 /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
7056 ///
7057 /// # Example
7058 /// ```ignore,no_run
7059 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7060 /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
7061 /// ```
7062 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7063 self.instance = v.into();
7064 self
7065 }
7066
7067 /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
7068 ///
7069 /// # Example
7070 /// ```ignore,no_run
7071 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7072 /// let x = SqlInstancesReencryptRequest::new().set_project("example");
7073 /// ```
7074 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7075 self.project = v.into();
7076 self
7077 }
7078
7079 /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
7080 ///
7081 /// # Example
7082 /// ```ignore,no_run
7083 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7084 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
7085 /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
7086 /// ```
7087 pub fn set_body<T>(mut self, v: T) -> Self
7088 where
7089 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
7090 {
7091 self.body = std::option::Option::Some(v.into());
7092 self
7093 }
7094
7095 /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
7096 ///
7097 /// # Example
7098 /// ```ignore,no_run
7099 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7100 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
7101 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
7102 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
7103 /// ```
7104 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7105 where
7106 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
7107 {
7108 self.body = v.map(|x| x.into());
7109 self
7110 }
7111}
7112
7113impl wkt::message::Message for SqlInstancesReencryptRequest {
7114 fn typename() -> &'static str {
7115 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
7116 }
7117}
7118
7119/// Database Instance reencrypt request.
7120#[derive(Clone, Default, PartialEq)]
7121#[non_exhaustive]
7122pub struct InstancesReencryptRequest {
7123 /// Configuration specific to backup re-encryption
7124 pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
7125
7126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7127}
7128
7129impl InstancesReencryptRequest {
7130 /// Creates a new default instance.
7131 pub fn new() -> Self {
7132 std::default::Default::default()
7133 }
7134
7135 /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
7136 ///
7137 /// # Example
7138 /// ```ignore,no_run
7139 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
7140 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
7141 /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
7142 /// ```
7143 pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
7144 where
7145 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
7146 {
7147 self.backup_reencryption_config = std::option::Option::Some(v.into());
7148 self
7149 }
7150
7151 /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
7152 ///
7153 /// # Example
7154 /// ```ignore,no_run
7155 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
7156 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
7157 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
7158 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
7159 /// ```
7160 pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7161 where
7162 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
7163 {
7164 self.backup_reencryption_config = v.map(|x| x.into());
7165 self
7166 }
7167}
7168
7169impl wkt::message::Message for InstancesReencryptRequest {
7170 fn typename() -> &'static str {
7171 "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
7172 }
7173}
7174
7175/// Backup Reencryption Config
7176#[derive(Clone, Default, PartialEq)]
7177#[non_exhaustive]
7178pub struct BackupReencryptionConfig {
7179 /// Backup re-encryption limit
7180 pub backup_limit: std::option::Option<i32>,
7181
7182 /// Type of backups users want to re-encrypt.
7183 pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
7184
7185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7186}
7187
7188impl BackupReencryptionConfig {
7189 /// Creates a new default instance.
7190 pub fn new() -> Self {
7191 std::default::Default::default()
7192 }
7193
7194 /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7195 ///
7196 /// # Example
7197 /// ```ignore,no_run
7198 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7199 /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
7200 /// ```
7201 pub fn set_backup_limit<T>(mut self, v: T) -> Self
7202 where
7203 T: std::convert::Into<i32>,
7204 {
7205 self.backup_limit = std::option::Option::Some(v.into());
7206 self
7207 }
7208
7209 /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7210 ///
7211 /// # Example
7212 /// ```ignore,no_run
7213 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7214 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
7215 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
7216 /// ```
7217 pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
7218 where
7219 T: std::convert::Into<i32>,
7220 {
7221 self.backup_limit = v.map(|x| x.into());
7222 self
7223 }
7224
7225 /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7226 ///
7227 /// # Example
7228 /// ```ignore,no_run
7229 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7230 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7231 /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
7232 /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
7233 /// ```
7234 pub fn set_backup_type<T>(mut self, v: T) -> Self
7235 where
7236 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7237 {
7238 self.backup_type = std::option::Option::Some(v.into());
7239 self
7240 }
7241
7242 /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7243 ///
7244 /// # Example
7245 /// ```ignore,no_run
7246 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7247 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7248 /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
7249 /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
7250 /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
7251 /// ```
7252 pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
7253 where
7254 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7255 {
7256 self.backup_type = v.map(|x| x.into());
7257 self
7258 }
7259}
7260
7261impl wkt::message::Message for BackupReencryptionConfig {
7262 fn typename() -> &'static str {
7263 "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
7264 }
7265}
7266
7267/// Defines additional types related to [BackupReencryptionConfig].
7268pub mod backup_reencryption_config {
7269 #[allow(unused_imports)]
7270 use super::*;
7271
7272 /// Backup type for re-encryption
7273 ///
7274 /// # Working with unknown values
7275 ///
7276 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7277 /// additional enum variants at any time. Adding new variants is not considered
7278 /// a breaking change. Applications should write their code in anticipation of:
7279 ///
7280 /// - New values appearing in future releases of the client library, **and**
7281 /// - New values received dynamically, without application changes.
7282 ///
7283 /// Please consult the [Working with enums] section in the user guide for some
7284 /// guidelines.
7285 ///
7286 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7287 #[derive(Clone, Debug, PartialEq)]
7288 #[non_exhaustive]
7289 pub enum BackupType {
7290 /// Unknown backup type, will be defaulted to AUTOMATIC backup type
7291 Unspecified,
7292 /// Reencrypt automatic backups
7293 Automated,
7294 /// Reencrypt on-demand backups
7295 OnDemand,
7296 /// If set, the enum was initialized with an unknown value.
7297 ///
7298 /// Applications can examine the value using [BackupType::value] or
7299 /// [BackupType::name].
7300 UnknownValue(backup_type::UnknownValue),
7301 }
7302
7303 #[doc(hidden)]
7304 pub mod backup_type {
7305 #[allow(unused_imports)]
7306 use super::*;
7307 #[derive(Clone, Debug, PartialEq)]
7308 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7309 }
7310
7311 impl BackupType {
7312 /// Gets the enum value.
7313 ///
7314 /// Returns `None` if the enum contains an unknown value deserialized from
7315 /// the string representation of enums.
7316 pub fn value(&self) -> std::option::Option<i32> {
7317 match self {
7318 Self::Unspecified => std::option::Option::Some(0),
7319 Self::Automated => std::option::Option::Some(1),
7320 Self::OnDemand => std::option::Option::Some(2),
7321 Self::UnknownValue(u) => u.0.value(),
7322 }
7323 }
7324
7325 /// Gets the enum value as a string.
7326 ///
7327 /// Returns `None` if the enum contains an unknown value deserialized from
7328 /// the integer representation of enums.
7329 pub fn name(&self) -> std::option::Option<&str> {
7330 match self {
7331 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
7332 Self::Automated => std::option::Option::Some("AUTOMATED"),
7333 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
7334 Self::UnknownValue(u) => u.0.name(),
7335 }
7336 }
7337 }
7338
7339 impl std::default::Default for BackupType {
7340 fn default() -> Self {
7341 use std::convert::From;
7342 Self::from(0)
7343 }
7344 }
7345
7346 impl std::fmt::Display for BackupType {
7347 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7348 wkt::internal::display_enum(f, self.name(), self.value())
7349 }
7350 }
7351
7352 impl std::convert::From<i32> for BackupType {
7353 fn from(value: i32) -> Self {
7354 match value {
7355 0 => Self::Unspecified,
7356 1 => Self::Automated,
7357 2 => Self::OnDemand,
7358 _ => Self::UnknownValue(backup_type::UnknownValue(
7359 wkt::internal::UnknownEnumValue::Integer(value),
7360 )),
7361 }
7362 }
7363 }
7364
7365 impl std::convert::From<&str> for BackupType {
7366 fn from(value: &str) -> Self {
7367 use std::string::ToString;
7368 match value {
7369 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
7370 "AUTOMATED" => Self::Automated,
7371 "ON_DEMAND" => Self::OnDemand,
7372 _ => Self::UnknownValue(backup_type::UnknownValue(
7373 wkt::internal::UnknownEnumValue::String(value.to_string()),
7374 )),
7375 }
7376 }
7377 }
7378
7379 impl serde::ser::Serialize for BackupType {
7380 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7381 where
7382 S: serde::Serializer,
7383 {
7384 match self {
7385 Self::Unspecified => serializer.serialize_i32(0),
7386 Self::Automated => serializer.serialize_i32(1),
7387 Self::OnDemand => serializer.serialize_i32(2),
7388 Self::UnknownValue(u) => u.0.serialize(serializer),
7389 }
7390 }
7391 }
7392
7393 impl<'de> serde::de::Deserialize<'de> for BackupType {
7394 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7395 where
7396 D: serde::Deserializer<'de>,
7397 {
7398 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
7399 ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
7400 ))
7401 }
7402 }
7403}
7404
7405/// The selected object that Cloud SQL migrates.
7406#[derive(Clone, Default, PartialEq)]
7407#[non_exhaustive]
7408pub struct ExternalSyncSelectedObject {
7409 /// The name of the database that Cloud SQL migrates.
7410 pub database: std::string::String,
7411
7412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7413}
7414
7415impl ExternalSyncSelectedObject {
7416 /// Creates a new default instance.
7417 pub fn new() -> Self {
7418 std::default::Default::default()
7419 }
7420
7421 /// Sets the value of [database][crate::model::ExternalSyncSelectedObject::database].
7422 ///
7423 /// # Example
7424 /// ```ignore,no_run
7425 /// # use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7426 /// let x = ExternalSyncSelectedObject::new().set_database("example");
7427 /// ```
7428 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7429 self.database = v.into();
7430 self
7431 }
7432}
7433
7434impl wkt::message::Message for ExternalSyncSelectedObject {
7435 fn typename() -> &'static str {
7436 "type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
7437 }
7438}
7439
7440/// Instance get disk shrink config request.
7441#[derive(Clone, Default, PartialEq)]
7442#[non_exhaustive]
7443pub struct SqlInstancesGetDiskShrinkConfigRequest {
7444 /// Cloud SQL instance ID. This does not include the project ID.
7445 pub instance: std::string::String,
7446
7447 /// Project ID of the project that contains the instance.
7448 pub project: std::string::String,
7449
7450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7451}
7452
7453impl SqlInstancesGetDiskShrinkConfigRequest {
7454 /// Creates a new default instance.
7455 pub fn new() -> Self {
7456 std::default::Default::default()
7457 }
7458
7459 /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
7460 ///
7461 /// # Example
7462 /// ```ignore,no_run
7463 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7464 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
7465 /// ```
7466 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7467 self.instance = v.into();
7468 self
7469 }
7470
7471 /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
7472 ///
7473 /// # Example
7474 /// ```ignore,no_run
7475 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7476 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
7477 /// ```
7478 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7479 self.project = v.into();
7480 self
7481 }
7482}
7483
7484impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
7485 fn typename() -> &'static str {
7486 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
7487 }
7488}
7489
7490/// Instance verify external sync settings request.
7491#[derive(Clone, Default, PartialEq)]
7492#[non_exhaustive]
7493pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
7494 /// Cloud SQL instance ID. This does not include the project ID.
7495 pub instance: std::string::String,
7496
7497 /// Project ID of the project that contains the instance.
7498 pub project: std::string::String,
7499
7500 /// Flag to enable verifying connection only
7501 pub verify_connection_only: bool,
7502
7503 /// External sync mode
7504 pub sync_mode:
7505 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7506
7507 /// Optional. Flag to verify settings required by replication setup only
7508 pub verify_replication_only: bool,
7509
7510 /// Optional. MigrationType configures the migration to use physical files or
7511 /// logical dump files. If not set, then the logical dump file configuration is
7512 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7513 pub migration_type:
7514 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7515
7516 /// Optional. Parallel level for initial data sync. Only applicable for
7517 /// PostgreSQL.
7518 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7519
7520 /// Optional. Migrate only the specified objects from the source instance. If
7521 /// this field is empty, then migrate all objects.
7522 pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
7523
7524 #[allow(missing_docs)]
7525 pub sync_config: std::option::Option<
7526 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7527 >,
7528
7529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7530}
7531
7532impl SqlInstancesVerifyExternalSyncSettingsRequest {
7533 /// Creates a new default instance.
7534 pub fn new() -> Self {
7535 std::default::Default::default()
7536 }
7537
7538 /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
7539 ///
7540 /// # Example
7541 /// ```ignore,no_run
7542 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7543 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
7544 /// ```
7545 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7546 self.instance = v.into();
7547 self
7548 }
7549
7550 /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
7551 ///
7552 /// # Example
7553 /// ```ignore,no_run
7554 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7555 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
7556 /// ```
7557 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7558 self.project = v.into();
7559 self
7560 }
7561
7562 /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
7563 ///
7564 /// # Example
7565 /// ```ignore,no_run
7566 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7567 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
7568 /// ```
7569 pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7570 self.verify_connection_only = v.into();
7571 self
7572 }
7573
7574 /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
7575 ///
7576 /// # Example
7577 /// ```ignore,no_run
7578 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7579 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7580 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
7581 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7582 /// ```
7583 pub fn set_sync_mode<
7584 T: std::convert::Into<
7585 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7586 >,
7587 >(
7588 mut self,
7589 v: T,
7590 ) -> Self {
7591 self.sync_mode = v.into();
7592 self
7593 }
7594
7595 /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
7596 ///
7597 /// # Example
7598 /// ```ignore,no_run
7599 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7600 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
7601 /// ```
7602 pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7603 self.verify_replication_only = v.into();
7604 self
7605 }
7606
7607 /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
7608 ///
7609 /// # Example
7610 /// ```ignore,no_run
7611 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7612 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7613 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
7614 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
7615 /// ```
7616 pub fn set_migration_type<
7617 T: std::convert::Into<
7618 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7619 >,
7620 >(
7621 mut self,
7622 v: T,
7623 ) -> Self {
7624 self.migration_type = v.into();
7625 self
7626 }
7627
7628 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
7629 ///
7630 /// # Example
7631 /// ```ignore,no_run
7632 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7633 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7634 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7635 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7636 /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7637 /// ```
7638 pub fn set_sync_parallel_level<
7639 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7640 >(
7641 mut self,
7642 v: T,
7643 ) -> Self {
7644 self.sync_parallel_level = v.into();
7645 self
7646 }
7647
7648 /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
7649 ///
7650 /// # Example
7651 /// ```ignore,no_run
7652 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7653 /// use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7654 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new()
7655 /// .set_selected_objects([
7656 /// ExternalSyncSelectedObject::default()/* use setters */,
7657 /// ExternalSyncSelectedObject::default()/* use (different) setters */,
7658 /// ]);
7659 /// ```
7660 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
7661 where
7662 T: std::iter::IntoIterator<Item = V>,
7663 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
7664 {
7665 use std::iter::Iterator;
7666 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
7667 self
7668 }
7669
7670 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
7671 ///
7672 /// Note that all the setters affecting `sync_config` are mutually
7673 /// exclusive.
7674 ///
7675 /// # Example
7676 /// ```ignore,no_run
7677 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7678 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7679 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
7680 /// google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7681 /// ```
7682 pub fn set_sync_config<
7683 T: std::convert::Into<
7684 std::option::Option<
7685 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7686 >,
7687 >,
7688 >(
7689 mut self,
7690 v: T,
7691 ) -> Self {
7692 self.sync_config = v.into();
7693 self
7694 }
7695
7696 /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7697 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7698 /// holds a different branch.
7699 pub fn mysql_sync_config(
7700 &self,
7701 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7702 #[allow(unreachable_patterns)]
7703 self.sync_config.as_ref().and_then(|v| match v {
7704 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7705 _ => std::option::Option::None,
7706 })
7707 }
7708
7709 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7710 /// to hold a `MysqlSyncConfig`.
7711 ///
7712 /// Note that all the setters affecting `sync_config` are
7713 /// mutually exclusive.
7714 ///
7715 /// # Example
7716 /// ```ignore,no_run
7717 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7718 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7719 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7720 /// assert!(x.mysql_sync_config().is_some());
7721 /// ```
7722 pub fn set_mysql_sync_config<
7723 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7724 >(
7725 mut self,
7726 v: T,
7727 ) -> Self {
7728 self.sync_config = std::option::Option::Some(
7729 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
7730 v.into()
7731 )
7732 );
7733 self
7734 }
7735}
7736
7737impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
7738 fn typename() -> &'static str {
7739 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
7740 }
7741}
7742
7743/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
7744pub mod sql_instances_verify_external_sync_settings_request {
7745 #[allow(unused_imports)]
7746 use super::*;
7747
7748 /// Enum for [ExternalSyncMode].
7749 ///
7750 /// # Working with unknown values
7751 ///
7752 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7753 /// additional enum variants at any time. Adding new variants is not considered
7754 /// a breaking change. Applications should write their code in anticipation of:
7755 ///
7756 /// - New values appearing in future releases of the client library, **and**
7757 /// - New values received dynamically, without application changes.
7758 ///
7759 /// Please consult the [Working with enums] section in the user guide for some
7760 /// guidelines.
7761 ///
7762 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7763 #[derive(Clone, Debug, PartialEq)]
7764 #[non_exhaustive]
7765 pub enum ExternalSyncMode {
7766 /// Unknown external sync mode, will be defaulted to ONLINE mode
7767 Unspecified,
7768 /// Online external sync will set up replication after initial data external
7769 /// sync
7770 Online,
7771 /// Offline external sync only dumps and loads a one-time snapshot of
7772 /// the primary instance's data
7773 Offline,
7774 /// If set, the enum was initialized with an unknown value.
7775 ///
7776 /// Applications can examine the value using [ExternalSyncMode::value] or
7777 /// [ExternalSyncMode::name].
7778 UnknownValue(external_sync_mode::UnknownValue),
7779 }
7780
7781 #[doc(hidden)]
7782 pub mod external_sync_mode {
7783 #[allow(unused_imports)]
7784 use super::*;
7785 #[derive(Clone, Debug, PartialEq)]
7786 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7787 }
7788
7789 impl ExternalSyncMode {
7790 /// Gets the enum value.
7791 ///
7792 /// Returns `None` if the enum contains an unknown value deserialized from
7793 /// the string representation of enums.
7794 pub fn value(&self) -> std::option::Option<i32> {
7795 match self {
7796 Self::Unspecified => std::option::Option::Some(0),
7797 Self::Online => std::option::Option::Some(1),
7798 Self::Offline => std::option::Option::Some(2),
7799 Self::UnknownValue(u) => u.0.value(),
7800 }
7801 }
7802
7803 /// Gets the enum value as a string.
7804 ///
7805 /// Returns `None` if the enum contains an unknown value deserialized from
7806 /// the integer representation of enums.
7807 pub fn name(&self) -> std::option::Option<&str> {
7808 match self {
7809 Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
7810 Self::Online => std::option::Option::Some("ONLINE"),
7811 Self::Offline => std::option::Option::Some("OFFLINE"),
7812 Self::UnknownValue(u) => u.0.name(),
7813 }
7814 }
7815 }
7816
7817 impl std::default::Default for ExternalSyncMode {
7818 fn default() -> Self {
7819 use std::convert::From;
7820 Self::from(0)
7821 }
7822 }
7823
7824 impl std::fmt::Display for ExternalSyncMode {
7825 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7826 wkt::internal::display_enum(f, self.name(), self.value())
7827 }
7828 }
7829
7830 impl std::convert::From<i32> for ExternalSyncMode {
7831 fn from(value: i32) -> Self {
7832 match value {
7833 0 => Self::Unspecified,
7834 1 => Self::Online,
7835 2 => Self::Offline,
7836 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7837 wkt::internal::UnknownEnumValue::Integer(value),
7838 )),
7839 }
7840 }
7841 }
7842
7843 impl std::convert::From<&str> for ExternalSyncMode {
7844 fn from(value: &str) -> Self {
7845 use std::string::ToString;
7846 match value {
7847 "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
7848 "ONLINE" => Self::Online,
7849 "OFFLINE" => Self::Offline,
7850 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7851 wkt::internal::UnknownEnumValue::String(value.to_string()),
7852 )),
7853 }
7854 }
7855 }
7856
7857 impl serde::ser::Serialize for ExternalSyncMode {
7858 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7859 where
7860 S: serde::Serializer,
7861 {
7862 match self {
7863 Self::Unspecified => serializer.serialize_i32(0),
7864 Self::Online => serializer.serialize_i32(1),
7865 Self::Offline => serializer.serialize_i32(2),
7866 Self::UnknownValue(u) => u.0.serialize(serializer),
7867 }
7868 }
7869 }
7870
7871 impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
7872 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7873 where
7874 D: serde::Deserializer<'de>,
7875 {
7876 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
7877 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
7878 }
7879 }
7880
7881 /// MigrationType determines whether the migration is a physical file-based
7882 /// migration or a logical dump file-based migration.
7883 ///
7884 /// # Working with unknown values
7885 ///
7886 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7887 /// additional enum variants at any time. Adding new variants is not considered
7888 /// a breaking change. Applications should write their code in anticipation of:
7889 ///
7890 /// - New values appearing in future releases of the client library, **and**
7891 /// - New values received dynamically, without application changes.
7892 ///
7893 /// Please consult the [Working with enums] section in the user guide for some
7894 /// guidelines.
7895 ///
7896 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7897 #[derive(Clone, Debug, PartialEq)]
7898 #[non_exhaustive]
7899 pub enum MigrationType {
7900 /// Default value is a logical dump file-based migration
7901 Unspecified,
7902 /// Logical dump file-based migration
7903 Logical,
7904 /// Physical file-based migration
7905 Physical,
7906 /// If set, the enum was initialized with an unknown value.
7907 ///
7908 /// Applications can examine the value using [MigrationType::value] or
7909 /// [MigrationType::name].
7910 UnknownValue(migration_type::UnknownValue),
7911 }
7912
7913 #[doc(hidden)]
7914 pub mod migration_type {
7915 #[allow(unused_imports)]
7916 use super::*;
7917 #[derive(Clone, Debug, PartialEq)]
7918 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7919 }
7920
7921 impl MigrationType {
7922 /// Gets the enum value.
7923 ///
7924 /// Returns `None` if the enum contains an unknown value deserialized from
7925 /// the string representation of enums.
7926 pub fn value(&self) -> std::option::Option<i32> {
7927 match self {
7928 Self::Unspecified => std::option::Option::Some(0),
7929 Self::Logical => std::option::Option::Some(1),
7930 Self::Physical => std::option::Option::Some(2),
7931 Self::UnknownValue(u) => u.0.value(),
7932 }
7933 }
7934
7935 /// Gets the enum value as a string.
7936 ///
7937 /// Returns `None` if the enum contains an unknown value deserialized from
7938 /// the integer representation of enums.
7939 pub fn name(&self) -> std::option::Option<&str> {
7940 match self {
7941 Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
7942 Self::Logical => std::option::Option::Some("LOGICAL"),
7943 Self::Physical => std::option::Option::Some("PHYSICAL"),
7944 Self::UnknownValue(u) => u.0.name(),
7945 }
7946 }
7947 }
7948
7949 impl std::default::Default for MigrationType {
7950 fn default() -> Self {
7951 use std::convert::From;
7952 Self::from(0)
7953 }
7954 }
7955
7956 impl std::fmt::Display for MigrationType {
7957 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7958 wkt::internal::display_enum(f, self.name(), self.value())
7959 }
7960 }
7961
7962 impl std::convert::From<i32> for MigrationType {
7963 fn from(value: i32) -> Self {
7964 match value {
7965 0 => Self::Unspecified,
7966 1 => Self::Logical,
7967 2 => Self::Physical,
7968 _ => Self::UnknownValue(migration_type::UnknownValue(
7969 wkt::internal::UnknownEnumValue::Integer(value),
7970 )),
7971 }
7972 }
7973 }
7974
7975 impl std::convert::From<&str> for MigrationType {
7976 fn from(value: &str) -> Self {
7977 use std::string::ToString;
7978 match value {
7979 "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
7980 "LOGICAL" => Self::Logical,
7981 "PHYSICAL" => Self::Physical,
7982 _ => Self::UnknownValue(migration_type::UnknownValue(
7983 wkt::internal::UnknownEnumValue::String(value.to_string()),
7984 )),
7985 }
7986 }
7987 }
7988
7989 impl serde::ser::Serialize for MigrationType {
7990 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7991 where
7992 S: serde::Serializer,
7993 {
7994 match self {
7995 Self::Unspecified => serializer.serialize_i32(0),
7996 Self::Logical => serializer.serialize_i32(1),
7997 Self::Physical => serializer.serialize_i32(2),
7998 Self::UnknownValue(u) => u.0.serialize(serializer),
7999 }
8000 }
8001 }
8002
8003 impl<'de> serde::de::Deserialize<'de> for MigrationType {
8004 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8005 where
8006 D: serde::Deserializer<'de>,
8007 {
8008 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
8009 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
8010 ))
8011 }
8012 }
8013
8014 #[allow(missing_docs)]
8015 #[derive(Clone, Debug, PartialEq)]
8016 #[non_exhaustive]
8017 pub enum SyncConfig {
8018 /// Optional. MySQL-specific settings for start external sync.
8019 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8020 }
8021}
8022
8023/// Instance start external sync request.
8024#[derive(Clone, Default, PartialEq)]
8025#[non_exhaustive]
8026pub struct SqlInstancesStartExternalSyncRequest {
8027 /// Cloud SQL instance ID. This does not include the project ID.
8028 pub instance: std::string::String,
8029
8030 /// ID of the project that contains the instance.
8031 pub project: std::string::String,
8032
8033 /// External sync mode.
8034 pub sync_mode:
8035 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
8036
8037 /// Whether to skip the verification step (VESS).
8038 pub skip_verification: bool,
8039
8040 /// Optional. Parallel level for initial data sync. Currently only applicable
8041 /// for MySQL.
8042 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
8043
8044 /// Optional. MigrationType configures the migration to use physical files or
8045 /// logical dump files. If not set, then the logical dump file configuration is
8046 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
8047 pub migration_type:
8048 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8049
8050 /// Optional. MySQL only. True if end-user has confirmed that this SES call
8051 /// will wipe replica databases overlapping with the proposed selected_objects.
8052 /// If this field is not set and there are both overlapping and additional
8053 /// databases proposed, an error will be returned.
8054 pub replica_overwrite_enabled: bool,
8055
8056 #[allow(missing_docs)]
8057 pub sync_config:
8058 std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
8059
8060 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8061}
8062
8063impl SqlInstancesStartExternalSyncRequest {
8064 /// Creates a new default instance.
8065 pub fn new() -> Self {
8066 std::default::Default::default()
8067 }
8068
8069 /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
8070 ///
8071 /// # Example
8072 /// ```ignore,no_run
8073 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8074 /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
8075 /// ```
8076 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8077 self.instance = v.into();
8078 self
8079 }
8080
8081 /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
8082 ///
8083 /// # Example
8084 /// ```ignore,no_run
8085 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8086 /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
8087 /// ```
8088 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8089 self.project = v.into();
8090 self
8091 }
8092
8093 /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
8094 ///
8095 /// # Example
8096 /// ```ignore,no_run
8097 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8098 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
8099 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
8100 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
8101 /// ```
8102 pub fn set_sync_mode<
8103 T: std::convert::Into<
8104 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
8105 >,
8106 >(
8107 mut self,
8108 v: T,
8109 ) -> Self {
8110 self.sync_mode = v.into();
8111 self
8112 }
8113
8114 /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
8115 ///
8116 /// # Example
8117 /// ```ignore,no_run
8118 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8119 /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
8120 /// ```
8121 pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8122 self.skip_verification = v.into();
8123 self
8124 }
8125
8126 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
8127 ///
8128 /// # Example
8129 /// ```ignore,no_run
8130 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8131 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
8132 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
8133 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
8134 /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
8135 /// ```
8136 pub fn set_sync_parallel_level<
8137 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
8138 >(
8139 mut self,
8140 v: T,
8141 ) -> Self {
8142 self.sync_parallel_level = v.into();
8143 self
8144 }
8145
8146 /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
8147 ///
8148 /// # Example
8149 /// ```ignore,no_run
8150 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8151 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
8152 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
8153 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
8154 /// ```
8155 pub fn set_migration_type<
8156 T: std::convert::Into<
8157 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8158 >,
8159 >(
8160 mut self,
8161 v: T,
8162 ) -> Self {
8163 self.migration_type = v.into();
8164 self
8165 }
8166
8167 /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
8168 ///
8169 /// # Example
8170 /// ```ignore,no_run
8171 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8172 /// let x = SqlInstancesStartExternalSyncRequest::new().set_replica_overwrite_enabled(true);
8173 /// ```
8174 pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8175 self.replica_overwrite_enabled = v.into();
8176 self
8177 }
8178
8179 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
8180 ///
8181 /// Note that all the setters affecting `sync_config` are mutually
8182 /// exclusive.
8183 ///
8184 /// # Example
8185 /// ```ignore,no_run
8186 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8187 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8188 /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
8189 /// google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
8190 /// ```
8191 pub fn set_sync_config<
8192 T: std::convert::Into<
8193 std::option::Option<
8194 crate::model::sql_instances_start_external_sync_request::SyncConfig,
8195 >,
8196 >,
8197 >(
8198 mut self,
8199 v: T,
8200 ) -> Self {
8201 self.sync_config = v.into();
8202 self
8203 }
8204
8205 /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8206 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
8207 /// holds a different branch.
8208 pub fn mysql_sync_config(
8209 &self,
8210 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
8211 #[allow(unreachable_patterns)]
8212 self.sync_config.as_ref().and_then(|v| match v {
8213 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
8214 _ => std::option::Option::None,
8215 })
8216 }
8217
8218 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8219 /// to hold a `MysqlSyncConfig`.
8220 ///
8221 /// Note that all the setters affecting `sync_config` are
8222 /// mutually exclusive.
8223 ///
8224 /// # Example
8225 /// ```ignore,no_run
8226 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8227 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8228 /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
8229 /// assert!(x.mysql_sync_config().is_some());
8230 /// ```
8231 pub fn set_mysql_sync_config<
8232 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
8233 >(
8234 mut self,
8235 v: T,
8236 ) -> Self {
8237 self.sync_config = std::option::Option::Some(
8238 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
8239 v.into(),
8240 ),
8241 );
8242 self
8243 }
8244}
8245
8246impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
8247 fn typename() -> &'static str {
8248 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
8249 }
8250}
8251
8252/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
8253pub mod sql_instances_start_external_sync_request {
8254 #[allow(unused_imports)]
8255 use super::*;
8256
8257 #[allow(missing_docs)]
8258 #[derive(Clone, Debug, PartialEq)]
8259 #[non_exhaustive]
8260 pub enum SyncConfig {
8261 /// MySQL-specific settings for start external sync.
8262 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8263 }
8264}
8265
8266/// Instance reset replica size request.
8267#[derive(Clone, Default, PartialEq)]
8268#[non_exhaustive]
8269pub struct SqlInstancesResetReplicaSizeRequest {
8270 /// Cloud SQL read replica instance name.
8271 pub instance: std::string::String,
8272
8273 /// ID of the project that contains the read replica.
8274 pub project: std::string::String,
8275
8276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8277}
8278
8279impl SqlInstancesResetReplicaSizeRequest {
8280 /// Creates a new default instance.
8281 pub fn new() -> Self {
8282 std::default::Default::default()
8283 }
8284
8285 /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
8286 ///
8287 /// # Example
8288 /// ```ignore,no_run
8289 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8290 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
8291 /// ```
8292 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8293 self.instance = v.into();
8294 self
8295 }
8296
8297 /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
8298 ///
8299 /// # Example
8300 /// ```ignore,no_run
8301 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8302 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
8303 /// ```
8304 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8305 self.project = v.into();
8306 self
8307 }
8308}
8309
8310impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
8311 fn typename() -> &'static str {
8312 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
8313 }
8314}
8315
8316/// Instance create ephemeral certificate request.
8317#[derive(Clone, Default, PartialEq)]
8318#[non_exhaustive]
8319pub struct SqlInstancesCreateEphemeralCertRequest {
8320 /// Cloud SQL instance ID. This does not include the project ID.
8321 pub instance: std::string::String,
8322
8323 /// Project ID of the Cloud SQL project.
8324 pub project: std::string::String,
8325
8326 #[allow(missing_docs)]
8327 pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
8328
8329 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8330}
8331
8332impl SqlInstancesCreateEphemeralCertRequest {
8333 /// Creates a new default instance.
8334 pub fn new() -> Self {
8335 std::default::Default::default()
8336 }
8337
8338 /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
8339 ///
8340 /// # Example
8341 /// ```ignore,no_run
8342 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8343 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
8344 /// ```
8345 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8346 self.instance = v.into();
8347 self
8348 }
8349
8350 /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
8351 ///
8352 /// # Example
8353 /// ```ignore,no_run
8354 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8355 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
8356 /// ```
8357 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8358 self.project = v.into();
8359 self
8360 }
8361
8362 /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8363 ///
8364 /// # Example
8365 /// ```ignore,no_run
8366 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8367 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8368 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
8369 /// ```
8370 pub fn set_body<T>(mut self, v: T) -> Self
8371 where
8372 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8373 {
8374 self.body = std::option::Option::Some(v.into());
8375 self
8376 }
8377
8378 /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8379 ///
8380 /// # Example
8381 /// ```ignore,no_run
8382 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8383 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8384 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
8385 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
8386 /// ```
8387 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8388 where
8389 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8390 {
8391 self.body = v.map(|x| x.into());
8392 self
8393 }
8394}
8395
8396impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
8397 fn typename() -> &'static str {
8398 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
8399 }
8400}
8401
8402/// Database instance clone request.
8403#[derive(Clone, Default, PartialEq)]
8404#[non_exhaustive]
8405pub struct InstancesCloneRequest {
8406 /// Required. Contains details about the clone operation.
8407 pub clone_context: std::option::Option<crate::model::CloneContext>,
8408
8409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8410}
8411
8412impl InstancesCloneRequest {
8413 /// Creates a new default instance.
8414 pub fn new() -> Self {
8415 std::default::Default::default()
8416 }
8417
8418 /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8419 ///
8420 /// # Example
8421 /// ```ignore,no_run
8422 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8423 /// use google_cloud_sql_v1::model::CloneContext;
8424 /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
8425 /// ```
8426 pub fn set_clone_context<T>(mut self, v: T) -> Self
8427 where
8428 T: std::convert::Into<crate::model::CloneContext>,
8429 {
8430 self.clone_context = std::option::Option::Some(v.into());
8431 self
8432 }
8433
8434 /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8435 ///
8436 /// # Example
8437 /// ```ignore,no_run
8438 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8439 /// use google_cloud_sql_v1::model::CloneContext;
8440 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
8441 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
8442 /// ```
8443 pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
8444 where
8445 T: std::convert::Into<crate::model::CloneContext>,
8446 {
8447 self.clone_context = v.map(|x| x.into());
8448 self
8449 }
8450}
8451
8452impl wkt::message::Message for InstancesCloneRequest {
8453 fn typename() -> &'static str {
8454 "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
8455 }
8456}
8457
8458/// Database demote primary instance request.
8459#[derive(Clone, Default, PartialEq)]
8460#[non_exhaustive]
8461pub struct InstancesDemoteMasterRequest {
8462 /// Contains details about the demoteMaster operation.
8463 pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
8464
8465 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8466}
8467
8468impl InstancesDemoteMasterRequest {
8469 /// Creates a new default instance.
8470 pub fn new() -> Self {
8471 std::default::Default::default()
8472 }
8473
8474 /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8475 ///
8476 /// # Example
8477 /// ```ignore,no_run
8478 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8479 /// use google_cloud_sql_v1::model::DemoteMasterContext;
8480 /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
8481 /// ```
8482 pub fn set_demote_master_context<T>(mut self, v: T) -> Self
8483 where
8484 T: std::convert::Into<crate::model::DemoteMasterContext>,
8485 {
8486 self.demote_master_context = std::option::Option::Some(v.into());
8487 self
8488 }
8489
8490 /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8491 ///
8492 /// # Example
8493 /// ```ignore,no_run
8494 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8495 /// use google_cloud_sql_v1::model::DemoteMasterContext;
8496 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
8497 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
8498 /// ```
8499 pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
8500 where
8501 T: std::convert::Into<crate::model::DemoteMasterContext>,
8502 {
8503 self.demote_master_context = v.map(|x| x.into());
8504 self
8505 }
8506}
8507
8508impl wkt::message::Message for InstancesDemoteMasterRequest {
8509 fn typename() -> &'static str {
8510 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
8511 }
8512}
8513
8514/// This request is used to demote an existing standalone instance to be a
8515/// Cloud SQL read replica for an external database server.
8516#[derive(Clone, Default, PartialEq)]
8517#[non_exhaustive]
8518pub struct InstancesDemoteRequest {
8519 /// Required. Contains details about the demote operation.
8520 pub demote_context: std::option::Option<crate::model::DemoteContext>,
8521
8522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8523}
8524
8525impl InstancesDemoteRequest {
8526 /// Creates a new default instance.
8527 pub fn new() -> Self {
8528 std::default::Default::default()
8529 }
8530
8531 /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8532 ///
8533 /// # Example
8534 /// ```ignore,no_run
8535 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8536 /// use google_cloud_sql_v1::model::DemoteContext;
8537 /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
8538 /// ```
8539 pub fn set_demote_context<T>(mut self, v: T) -> Self
8540 where
8541 T: std::convert::Into<crate::model::DemoteContext>,
8542 {
8543 self.demote_context = std::option::Option::Some(v.into());
8544 self
8545 }
8546
8547 /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8548 ///
8549 /// # Example
8550 /// ```ignore,no_run
8551 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8552 /// use google_cloud_sql_v1::model::DemoteContext;
8553 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
8554 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
8555 /// ```
8556 pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
8557 where
8558 T: std::convert::Into<crate::model::DemoteContext>,
8559 {
8560 self.demote_context = v.map(|x| x.into());
8561 self
8562 }
8563}
8564
8565impl wkt::message::Message for InstancesDemoteRequest {
8566 fn typename() -> &'static str {
8567 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
8568 }
8569}
8570
8571/// Database instance export request.
8572#[derive(Clone, Default, PartialEq)]
8573#[non_exhaustive]
8574pub struct InstancesExportRequest {
8575 /// Contains details about the export operation.
8576 pub export_context: std::option::Option<crate::model::ExportContext>,
8577
8578 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8579}
8580
8581impl InstancesExportRequest {
8582 /// Creates a new default instance.
8583 pub fn new() -> Self {
8584 std::default::Default::default()
8585 }
8586
8587 /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
8588 ///
8589 /// # Example
8590 /// ```ignore,no_run
8591 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8592 /// use google_cloud_sql_v1::model::ExportContext;
8593 /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
8594 /// ```
8595 pub fn set_export_context<T>(mut self, v: T) -> Self
8596 where
8597 T: std::convert::Into<crate::model::ExportContext>,
8598 {
8599 self.export_context = std::option::Option::Some(v.into());
8600 self
8601 }
8602
8603 /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
8604 ///
8605 /// # Example
8606 /// ```ignore,no_run
8607 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8608 /// use google_cloud_sql_v1::model::ExportContext;
8609 /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
8610 /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
8611 /// ```
8612 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
8613 where
8614 T: std::convert::Into<crate::model::ExportContext>,
8615 {
8616 self.export_context = v.map(|x| x.into());
8617 self
8618 }
8619}
8620
8621impl wkt::message::Message for InstancesExportRequest {
8622 fn typename() -> &'static str {
8623 "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
8624 }
8625}
8626
8627/// Instance failover request.
8628#[derive(Clone, Default, PartialEq)]
8629#[non_exhaustive]
8630pub struct InstancesFailoverRequest {
8631 /// Failover Context.
8632 pub failover_context: std::option::Option<crate::model::FailoverContext>,
8633
8634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8635}
8636
8637impl InstancesFailoverRequest {
8638 /// Creates a new default instance.
8639 pub fn new() -> Self {
8640 std::default::Default::default()
8641 }
8642
8643 /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8644 ///
8645 /// # Example
8646 /// ```ignore,no_run
8647 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8648 /// use google_cloud_sql_v1::model::FailoverContext;
8649 /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
8650 /// ```
8651 pub fn set_failover_context<T>(mut self, v: T) -> Self
8652 where
8653 T: std::convert::Into<crate::model::FailoverContext>,
8654 {
8655 self.failover_context = std::option::Option::Some(v.into());
8656 self
8657 }
8658
8659 /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8660 ///
8661 /// # Example
8662 /// ```ignore,no_run
8663 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8664 /// use google_cloud_sql_v1::model::FailoverContext;
8665 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
8666 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
8667 /// ```
8668 pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
8669 where
8670 T: std::convert::Into<crate::model::FailoverContext>,
8671 {
8672 self.failover_context = v.map(|x| x.into());
8673 self
8674 }
8675}
8676
8677impl wkt::message::Message for InstancesFailoverRequest {
8678 fn typename() -> &'static str {
8679 "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
8680 }
8681}
8682
8683/// SslCerts create ephemeral certificate request.
8684#[derive(Clone, Default, PartialEq)]
8685#[non_exhaustive]
8686pub struct SslCertsCreateEphemeralRequest {
8687 /// PEM encoded public key to include in the signed certificate.
8688 pub public_key: std::string::String,
8689
8690 /// Access token to include in the signed certificate.
8691 pub access_token: std::string::String,
8692
8693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8694}
8695
8696impl SslCertsCreateEphemeralRequest {
8697 /// Creates a new default instance.
8698 pub fn new() -> Self {
8699 std::default::Default::default()
8700 }
8701
8702 /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
8703 ///
8704 /// # Example
8705 /// ```ignore,no_run
8706 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8707 /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
8708 /// ```
8709 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8710 self.public_key = v.into();
8711 self
8712 }
8713
8714 /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
8715 ///
8716 /// # Example
8717 /// ```ignore,no_run
8718 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8719 /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
8720 /// ```
8721 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8722 self.access_token = v.into();
8723 self
8724 }
8725}
8726
8727impl wkt::message::Message for SslCertsCreateEphemeralRequest {
8728 fn typename() -> &'static str {
8729 "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
8730 }
8731}
8732
8733/// Database instance import request.
8734#[derive(Clone, Default, PartialEq)]
8735#[non_exhaustive]
8736pub struct InstancesImportRequest {
8737 /// Contains details about the import operation.
8738 pub import_context: std::option::Option<crate::model::ImportContext>,
8739
8740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8741}
8742
8743impl InstancesImportRequest {
8744 /// Creates a new default instance.
8745 pub fn new() -> Self {
8746 std::default::Default::default()
8747 }
8748
8749 /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
8750 ///
8751 /// # Example
8752 /// ```ignore,no_run
8753 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8754 /// use google_cloud_sql_v1::model::ImportContext;
8755 /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
8756 /// ```
8757 pub fn set_import_context<T>(mut self, v: T) -> Self
8758 where
8759 T: std::convert::Into<crate::model::ImportContext>,
8760 {
8761 self.import_context = std::option::Option::Some(v.into());
8762 self
8763 }
8764
8765 /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
8766 ///
8767 /// # Example
8768 /// ```ignore,no_run
8769 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8770 /// use google_cloud_sql_v1::model::ImportContext;
8771 /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
8772 /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
8773 /// ```
8774 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
8775 where
8776 T: std::convert::Into<crate::model::ImportContext>,
8777 {
8778 self.import_context = v.map(|x| x.into());
8779 self
8780 }
8781}
8782
8783impl wkt::message::Message for InstancesImportRequest {
8784 fn typename() -> &'static str {
8785 "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
8786 }
8787}
8788
8789/// Request for Pre-checks for MVU
8790#[derive(Clone, Default, PartialEq)]
8791#[non_exhaustive]
8792pub struct InstancesPreCheckMajorVersionUpgradeRequest {
8793 /// Required. Contains details about the pre-check major version upgrade
8794 /// operation.
8795 pub pre_check_major_version_upgrade_context:
8796 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
8797
8798 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8799}
8800
8801impl InstancesPreCheckMajorVersionUpgradeRequest {
8802 /// Creates a new default instance.
8803 pub fn new() -> Self {
8804 std::default::Default::default()
8805 }
8806
8807 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8808 ///
8809 /// # Example
8810 /// ```ignore,no_run
8811 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8812 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8813 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
8814 /// ```
8815 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
8816 where
8817 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8818 {
8819 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
8820 self
8821 }
8822
8823 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8824 ///
8825 /// # Example
8826 /// ```ignore,no_run
8827 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8828 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8829 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
8830 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
8831 /// ```
8832 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
8833 mut self,
8834 v: std::option::Option<T>,
8835 ) -> Self
8836 where
8837 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8838 {
8839 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
8840 self
8841 }
8842}
8843
8844impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
8845 fn typename() -> &'static str {
8846 "type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
8847 }
8848}
8849
8850/// Database instances list response.
8851#[derive(Clone, Default, PartialEq)]
8852#[non_exhaustive]
8853pub struct InstancesListResponse {
8854 /// This is always `sql#instancesList`.
8855 pub kind: std::string::String,
8856
8857 /// List of warnings that occurred while handling the request.
8858 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
8859
8860 /// List of database instance resources.
8861 pub items: std::vec::Vec<crate::model::DatabaseInstance>,
8862
8863 /// The continuation token, used to page through large result sets. Provide
8864 /// this value in a subsequent request to return the next page of results.
8865 pub next_page_token: std::string::String,
8866
8867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8868}
8869
8870impl InstancesListResponse {
8871 /// Creates a new default instance.
8872 pub fn new() -> Self {
8873 std::default::Default::default()
8874 }
8875
8876 /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
8877 ///
8878 /// # Example
8879 /// ```ignore,no_run
8880 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8881 /// let x = InstancesListResponse::new().set_kind("example");
8882 /// ```
8883 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8884 self.kind = v.into();
8885 self
8886 }
8887
8888 /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
8889 ///
8890 /// # Example
8891 /// ```ignore,no_run
8892 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8893 /// use google_cloud_sql_v1::model::ApiWarning;
8894 /// let x = InstancesListResponse::new()
8895 /// .set_warnings([
8896 /// ApiWarning::default()/* use setters */,
8897 /// ApiWarning::default()/* use (different) setters */,
8898 /// ]);
8899 /// ```
8900 pub fn set_warnings<T, V>(mut self, v: T) -> Self
8901 where
8902 T: std::iter::IntoIterator<Item = V>,
8903 V: std::convert::Into<crate::model::ApiWarning>,
8904 {
8905 use std::iter::Iterator;
8906 self.warnings = v.into_iter().map(|i| i.into()).collect();
8907 self
8908 }
8909
8910 /// Sets the value of [items][crate::model::InstancesListResponse::items].
8911 ///
8912 /// # Example
8913 /// ```ignore,no_run
8914 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8915 /// use google_cloud_sql_v1::model::DatabaseInstance;
8916 /// let x = InstancesListResponse::new()
8917 /// .set_items([
8918 /// DatabaseInstance::default()/* use setters */,
8919 /// DatabaseInstance::default()/* use (different) setters */,
8920 /// ]);
8921 /// ```
8922 pub fn set_items<T, V>(mut self, v: T) -> Self
8923 where
8924 T: std::iter::IntoIterator<Item = V>,
8925 V: std::convert::Into<crate::model::DatabaseInstance>,
8926 {
8927 use std::iter::Iterator;
8928 self.items = v.into_iter().map(|i| i.into()).collect();
8929 self
8930 }
8931
8932 /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
8933 ///
8934 /// # Example
8935 /// ```ignore,no_run
8936 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8937 /// let x = InstancesListResponse::new().set_next_page_token("example");
8938 /// ```
8939 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8940 self.next_page_token = v.into();
8941 self
8942 }
8943}
8944
8945impl wkt::message::Message for InstancesListResponse {
8946 fn typename() -> &'static str {
8947 "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
8948 }
8949}
8950
8951#[doc(hidden)]
8952impl google_cloud_gax::paginator::internal::PageableResponse for InstancesListResponse {
8953 type PageItem = crate::model::DatabaseInstance;
8954
8955 fn items(self) -> std::vec::Vec<Self::PageItem> {
8956 self.items
8957 }
8958
8959 fn next_page_token(&self) -> std::string::String {
8960 use std::clone::Clone;
8961 self.next_page_token.clone()
8962 }
8963}
8964
8965/// Instances ListServerCas response.
8966#[derive(Clone, Default, PartialEq)]
8967#[non_exhaustive]
8968pub struct InstancesListServerCasResponse {
8969 /// List of server CA certificates for the instance.
8970 pub certs: std::vec::Vec<crate::model::SslCert>,
8971
8972 #[allow(missing_docs)]
8973 pub active_version: std::string::String,
8974
8975 /// This is always `sql#instancesListServerCas`.
8976 pub kind: std::string::String,
8977
8978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8979}
8980
8981impl InstancesListServerCasResponse {
8982 /// Creates a new default instance.
8983 pub fn new() -> Self {
8984 std::default::Default::default()
8985 }
8986
8987 /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
8988 ///
8989 /// # Example
8990 /// ```ignore,no_run
8991 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8992 /// use google_cloud_sql_v1::model::SslCert;
8993 /// let x = InstancesListServerCasResponse::new()
8994 /// .set_certs([
8995 /// SslCert::default()/* use setters */,
8996 /// SslCert::default()/* use (different) setters */,
8997 /// ]);
8998 /// ```
8999 pub fn set_certs<T, V>(mut self, v: T) -> Self
9000 where
9001 T: std::iter::IntoIterator<Item = V>,
9002 V: std::convert::Into<crate::model::SslCert>,
9003 {
9004 use std::iter::Iterator;
9005 self.certs = v.into_iter().map(|i| i.into()).collect();
9006 self
9007 }
9008
9009 /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
9010 ///
9011 /// # Example
9012 /// ```ignore,no_run
9013 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
9014 /// let x = InstancesListServerCasResponse::new().set_active_version("example");
9015 /// ```
9016 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9017 self.active_version = v.into();
9018 self
9019 }
9020
9021 /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
9022 ///
9023 /// # Example
9024 /// ```ignore,no_run
9025 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
9026 /// let x = InstancesListServerCasResponse::new().set_kind("example");
9027 /// ```
9028 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9029 self.kind = v.into();
9030 self
9031 }
9032}
9033
9034impl wkt::message::Message for InstancesListServerCasResponse {
9035 fn typename() -> &'static str {
9036 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
9037 }
9038}
9039
9040/// Instances ListServerCertificates response.
9041#[derive(Clone, Default, PartialEq)]
9042#[non_exhaustive]
9043pub struct InstancesListServerCertificatesResponse {
9044 /// List of server CA certificates for the instance.
9045 pub ca_certs: std::vec::Vec<crate::model::SslCert>,
9046
9047 /// List of server certificates for the instance, signed by the corresponding
9048 /// CA from the `ca_certs` list.
9049 pub server_certs: std::vec::Vec<crate::model::SslCert>,
9050
9051 /// The `sha1_fingerprint` of the active certificate from `server_certs`.
9052 pub active_version: std::string::String,
9053
9054 /// This is always `sql#instancesListServerCertificates`.
9055 pub kind: std::string::String,
9056
9057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9058}
9059
9060impl InstancesListServerCertificatesResponse {
9061 /// Creates a new default instance.
9062 pub fn new() -> Self {
9063 std::default::Default::default()
9064 }
9065
9066 /// Sets the value of [ca_certs][crate::model::InstancesListServerCertificatesResponse::ca_certs].
9067 ///
9068 /// # Example
9069 /// ```ignore,no_run
9070 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9071 /// use google_cloud_sql_v1::model::SslCert;
9072 /// let x = InstancesListServerCertificatesResponse::new()
9073 /// .set_ca_certs([
9074 /// SslCert::default()/* use setters */,
9075 /// SslCert::default()/* use (different) setters */,
9076 /// ]);
9077 /// ```
9078 pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
9079 where
9080 T: std::iter::IntoIterator<Item = V>,
9081 V: std::convert::Into<crate::model::SslCert>,
9082 {
9083 use std::iter::Iterator;
9084 self.ca_certs = v.into_iter().map(|i| i.into()).collect();
9085 self
9086 }
9087
9088 /// Sets the value of [server_certs][crate::model::InstancesListServerCertificatesResponse::server_certs].
9089 ///
9090 /// # Example
9091 /// ```ignore,no_run
9092 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9093 /// use google_cloud_sql_v1::model::SslCert;
9094 /// let x = InstancesListServerCertificatesResponse::new()
9095 /// .set_server_certs([
9096 /// SslCert::default()/* use setters */,
9097 /// SslCert::default()/* use (different) setters */,
9098 /// ]);
9099 /// ```
9100 pub fn set_server_certs<T, V>(mut self, v: T) -> Self
9101 where
9102 T: std::iter::IntoIterator<Item = V>,
9103 V: std::convert::Into<crate::model::SslCert>,
9104 {
9105 use std::iter::Iterator;
9106 self.server_certs = v.into_iter().map(|i| i.into()).collect();
9107 self
9108 }
9109
9110 /// Sets the value of [active_version][crate::model::InstancesListServerCertificatesResponse::active_version].
9111 ///
9112 /// # Example
9113 /// ```ignore,no_run
9114 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9115 /// let x = InstancesListServerCertificatesResponse::new().set_active_version("example");
9116 /// ```
9117 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9118 self.active_version = v.into();
9119 self
9120 }
9121
9122 /// Sets the value of [kind][crate::model::InstancesListServerCertificatesResponse::kind].
9123 ///
9124 /// # Example
9125 /// ```ignore,no_run
9126 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9127 /// let x = InstancesListServerCertificatesResponse::new().set_kind("example");
9128 /// ```
9129 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9130 self.kind = v.into();
9131 self
9132 }
9133}
9134
9135impl wkt::message::Message for InstancesListServerCertificatesResponse {
9136 fn typename() -> &'static str {
9137 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
9138 }
9139}
9140
9141/// Instances ListEntraIdCertificates response.
9142#[derive(Clone, Default, PartialEq)]
9143#[non_exhaustive]
9144pub struct InstancesListEntraIdCertificatesResponse {
9145 /// List of Entra ID certificates for the instance.
9146 pub certs: std::vec::Vec<crate::model::SslCert>,
9147
9148 /// The `sha1_fingerprint` of the active certificate from `certs`.
9149 pub active_version: std::string::String,
9150
9151 /// This is always `sql#instancesListEntraIdCertificates`.
9152 pub kind: std::string::String,
9153
9154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9155}
9156
9157impl InstancesListEntraIdCertificatesResponse {
9158 /// Creates a new default instance.
9159 pub fn new() -> Self {
9160 std::default::Default::default()
9161 }
9162
9163 /// Sets the value of [certs][crate::model::InstancesListEntraIdCertificatesResponse::certs].
9164 ///
9165 /// # Example
9166 /// ```ignore,no_run
9167 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9168 /// use google_cloud_sql_v1::model::SslCert;
9169 /// let x = InstancesListEntraIdCertificatesResponse::new()
9170 /// .set_certs([
9171 /// SslCert::default()/* use setters */,
9172 /// SslCert::default()/* use (different) setters */,
9173 /// ]);
9174 /// ```
9175 pub fn set_certs<T, V>(mut self, v: T) -> Self
9176 where
9177 T: std::iter::IntoIterator<Item = V>,
9178 V: std::convert::Into<crate::model::SslCert>,
9179 {
9180 use std::iter::Iterator;
9181 self.certs = v.into_iter().map(|i| i.into()).collect();
9182 self
9183 }
9184
9185 /// Sets the value of [active_version][crate::model::InstancesListEntraIdCertificatesResponse::active_version].
9186 ///
9187 /// # Example
9188 /// ```ignore,no_run
9189 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9190 /// let x = InstancesListEntraIdCertificatesResponse::new().set_active_version("example");
9191 /// ```
9192 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9193 self.active_version = v.into();
9194 self
9195 }
9196
9197 /// Sets the value of [kind][crate::model::InstancesListEntraIdCertificatesResponse::kind].
9198 ///
9199 /// # Example
9200 /// ```ignore,no_run
9201 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9202 /// let x = InstancesListEntraIdCertificatesResponse::new().set_kind("example");
9203 /// ```
9204 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9205 self.kind = v.into();
9206 self
9207 }
9208}
9209
9210impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
9211 fn typename() -> &'static str {
9212 "type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
9213 }
9214}
9215
9216/// Database instance restore backup request.
9217#[derive(Clone, Default, PartialEq)]
9218#[non_exhaustive]
9219pub struct InstancesRestoreBackupRequest {
9220 /// Parameters required to perform the restore backup operation.
9221 pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
9222
9223 /// The name of the backup that's used to restore a Cloud SQL instance:
9224 /// Format: projects/{project-id}/backups/{backup-uid}. Only one of
9225 /// restore_backup_context, backup, backupdr_backup can be passed to the input.
9226 pub backup: std::string::String,
9227
9228 /// The name of the backup that's used to restore a Cloud SQL instance:
9229 /// Format:
9230 /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
9231 /// Only one of restore_backup_context, backup, backupdr_backup can be
9232 /// passed to the input.
9233 pub backupdr_backup: std::string::String,
9234
9235 /// Optional. By using this parameter, Cloud SQL overrides any instance
9236 /// settings stored in the backup you are restoring from. You can't change the
9237 /// instance's major database version and you can only increase the disk size.
9238 /// You can use this field to restore new instances only. This field is not
9239 /// applicable for restore to existing instances.
9240 pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
9241
9242 /// Optional. This field has the same purpose as restore_instance_settings,
9243 /// changes any instance settings stored in the backup you are restoring from.
9244 /// With the difference that these fields are cleared in the settings.
9245 pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
9246
9247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9248}
9249
9250impl InstancesRestoreBackupRequest {
9251 /// Creates a new default instance.
9252 pub fn new() -> Self {
9253 std::default::Default::default()
9254 }
9255
9256 /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9257 ///
9258 /// # Example
9259 /// ```ignore,no_run
9260 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9261 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9262 /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
9263 /// ```
9264 pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
9265 where
9266 T: std::convert::Into<crate::model::RestoreBackupContext>,
9267 {
9268 self.restore_backup_context = std::option::Option::Some(v.into());
9269 self
9270 }
9271
9272 /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9273 ///
9274 /// # Example
9275 /// ```ignore,no_run
9276 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9277 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9278 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
9279 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
9280 /// ```
9281 pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
9282 where
9283 T: std::convert::Into<crate::model::RestoreBackupContext>,
9284 {
9285 self.restore_backup_context = v.map(|x| x.into());
9286 self
9287 }
9288
9289 /// Sets the value of [backup][crate::model::InstancesRestoreBackupRequest::backup].
9290 ///
9291 /// # Example
9292 /// ```ignore,no_run
9293 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9294 /// # let project_id = "project_id";
9295 /// # let backup_id = "backup_id";
9296 /// let x = InstancesRestoreBackupRequest::new().set_backup(format!("projects/{project_id}/backups/{backup_id}"));
9297 /// ```
9298 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9299 self.backup = v.into();
9300 self
9301 }
9302
9303 /// Sets the value of [backupdr_backup][crate::model::InstancesRestoreBackupRequest::backupdr_backup].
9304 ///
9305 /// # Example
9306 /// ```ignore,no_run
9307 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9308 /// let x = InstancesRestoreBackupRequest::new().set_backupdr_backup("example");
9309 /// ```
9310 pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9311 self.backupdr_backup = v.into();
9312 self
9313 }
9314
9315 /// Sets the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9316 ///
9317 /// # Example
9318 /// ```ignore,no_run
9319 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9320 /// use google_cloud_sql_v1::model::DatabaseInstance;
9321 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_settings(DatabaseInstance::default()/* use setters */);
9322 /// ```
9323 pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
9324 where
9325 T: std::convert::Into<crate::model::DatabaseInstance>,
9326 {
9327 self.restore_instance_settings = std::option::Option::Some(v.into());
9328 self
9329 }
9330
9331 /// Sets or clears the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9332 ///
9333 /// # Example
9334 /// ```ignore,no_run
9335 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9336 /// use google_cloud_sql_v1::model::DatabaseInstance;
9337 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(Some(DatabaseInstance::default()/* use setters */));
9338 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(None::<DatabaseInstance>);
9339 /// ```
9340 pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
9341 where
9342 T: std::convert::Into<crate::model::DatabaseInstance>,
9343 {
9344 self.restore_instance_settings = v.map(|x| x.into());
9345 self
9346 }
9347
9348 /// Sets the value of [restore_instance_clear_overrides_field_names][crate::model::InstancesRestoreBackupRequest::restore_instance_clear_overrides_field_names].
9349 ///
9350 /// # Example
9351 /// ```ignore,no_run
9352 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9353 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_clear_overrides_field_names(["a", "b", "c"]);
9354 /// ```
9355 pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
9356 where
9357 T: std::iter::IntoIterator<Item = V>,
9358 V: std::convert::Into<std::string::String>,
9359 {
9360 use std::iter::Iterator;
9361 self.restore_instance_clear_overrides_field_names =
9362 v.into_iter().map(|i| i.into()).collect();
9363 self
9364 }
9365}
9366
9367impl wkt::message::Message for InstancesRestoreBackupRequest {
9368 fn typename() -> &'static str {
9369 "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
9370 }
9371}
9372
9373/// Rotate server CA request.
9374#[derive(Clone, Default, PartialEq)]
9375#[non_exhaustive]
9376pub struct InstancesRotateServerCaRequest {
9377 /// Contains details about the rotate server CA operation.
9378 pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
9379
9380 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9381}
9382
9383impl InstancesRotateServerCaRequest {
9384 /// Creates a new default instance.
9385 pub fn new() -> Self {
9386 std::default::Default::default()
9387 }
9388
9389 /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9390 ///
9391 /// # Example
9392 /// ```ignore,no_run
9393 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9394 /// use google_cloud_sql_v1::model::RotateServerCaContext;
9395 /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
9396 /// ```
9397 pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
9398 where
9399 T: std::convert::Into<crate::model::RotateServerCaContext>,
9400 {
9401 self.rotate_server_ca_context = std::option::Option::Some(v.into());
9402 self
9403 }
9404
9405 /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9406 ///
9407 /// # Example
9408 /// ```ignore,no_run
9409 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9410 /// use google_cloud_sql_v1::model::RotateServerCaContext;
9411 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
9412 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
9413 /// ```
9414 pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
9415 where
9416 T: std::convert::Into<crate::model::RotateServerCaContext>,
9417 {
9418 self.rotate_server_ca_context = v.map(|x| x.into());
9419 self
9420 }
9421}
9422
9423impl wkt::message::Message for InstancesRotateServerCaRequest {
9424 fn typename() -> &'static str {
9425 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
9426 }
9427}
9428
9429/// Rotate server certificate request.
9430#[derive(Clone, Default, PartialEq)]
9431#[non_exhaustive]
9432pub struct InstancesRotateServerCertificateRequest {
9433 /// Optional. Contains details about the rotate server certificate operation.
9434 pub rotate_server_certificate_context:
9435 std::option::Option<crate::model::RotateServerCertificateContext>,
9436
9437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9438}
9439
9440impl InstancesRotateServerCertificateRequest {
9441 /// Creates a new default instance.
9442 pub fn new() -> Self {
9443 std::default::Default::default()
9444 }
9445
9446 /// Sets the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9447 ///
9448 /// # Example
9449 /// ```ignore,no_run
9450 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9451 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9452 /// let x = InstancesRotateServerCertificateRequest::new().set_rotate_server_certificate_context(RotateServerCertificateContext::default()/* use setters */);
9453 /// ```
9454 pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
9455 where
9456 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9457 {
9458 self.rotate_server_certificate_context = std::option::Option::Some(v.into());
9459 self
9460 }
9461
9462 /// Sets or clears the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9463 ///
9464 /// # Example
9465 /// ```ignore,no_run
9466 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9467 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9468 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(Some(RotateServerCertificateContext::default()/* use setters */));
9469 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(None::<RotateServerCertificateContext>);
9470 /// ```
9471 pub fn set_or_clear_rotate_server_certificate_context<T>(
9472 mut self,
9473 v: std::option::Option<T>,
9474 ) -> Self
9475 where
9476 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9477 {
9478 self.rotate_server_certificate_context = v.map(|x| x.into());
9479 self
9480 }
9481}
9482
9483impl wkt::message::Message for InstancesRotateServerCertificateRequest {
9484 fn typename() -> &'static str {
9485 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
9486 }
9487}
9488
9489/// Rotate Entra ID certificate request.
9490#[derive(Clone, Default, PartialEq)]
9491#[non_exhaustive]
9492pub struct InstancesRotateEntraIdCertificateRequest {
9493 /// Optional. Contains details about the rotate server certificate operation.
9494 pub rotate_entra_id_certificate_context:
9495 std::option::Option<crate::model::RotateEntraIdCertificateContext>,
9496
9497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9498}
9499
9500impl InstancesRotateEntraIdCertificateRequest {
9501 /// Creates a new default instance.
9502 pub fn new() -> Self {
9503 std::default::Default::default()
9504 }
9505
9506 /// Sets the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9507 ///
9508 /// # Example
9509 /// ```ignore,no_run
9510 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9511 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9512 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_rotate_entra_id_certificate_context(RotateEntraIdCertificateContext::default()/* use setters */);
9513 /// ```
9514 pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
9515 where
9516 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9517 {
9518 self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
9519 self
9520 }
9521
9522 /// Sets or clears the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9523 ///
9524 /// # Example
9525 /// ```ignore,no_run
9526 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9527 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9528 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(Some(RotateEntraIdCertificateContext::default()/* use setters */));
9529 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(None::<RotateEntraIdCertificateContext>);
9530 /// ```
9531 pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
9532 mut self,
9533 v: std::option::Option<T>,
9534 ) -> Self
9535 where
9536 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9537 {
9538 self.rotate_entra_id_certificate_context = v.map(|x| x.into());
9539 self
9540 }
9541}
9542
9543impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
9544 fn typename() -> &'static str {
9545 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
9546 }
9547}
9548
9549/// Instance truncate log request.
9550#[derive(Clone, Default, PartialEq)]
9551#[non_exhaustive]
9552pub struct InstancesTruncateLogRequest {
9553 /// Contains details about the truncate log operation.
9554 pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
9555
9556 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9557}
9558
9559impl InstancesTruncateLogRequest {
9560 /// Creates a new default instance.
9561 pub fn new() -> Self {
9562 std::default::Default::default()
9563 }
9564
9565 /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9566 ///
9567 /// # Example
9568 /// ```ignore,no_run
9569 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9570 /// use google_cloud_sql_v1::model::TruncateLogContext;
9571 /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
9572 /// ```
9573 pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
9574 where
9575 T: std::convert::Into<crate::model::TruncateLogContext>,
9576 {
9577 self.truncate_log_context = std::option::Option::Some(v.into());
9578 self
9579 }
9580
9581 /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9582 ///
9583 /// # Example
9584 /// ```ignore,no_run
9585 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9586 /// use google_cloud_sql_v1::model::TruncateLogContext;
9587 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
9588 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
9589 /// ```
9590 pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
9591 where
9592 T: std::convert::Into<crate::model::TruncateLogContext>,
9593 {
9594 self.truncate_log_context = v.map(|x| x.into());
9595 self
9596 }
9597}
9598
9599impl wkt::message::Message for InstancesTruncateLogRequest {
9600 fn typename() -> &'static str {
9601 "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
9602 }
9603}
9604
9605/// Request to acquire a lease for SSRS.
9606#[derive(Clone, Default, PartialEq)]
9607#[non_exhaustive]
9608pub struct InstancesAcquireSsrsLeaseRequest {
9609 /// Contains details about the acquire SSRS lease operation.
9610 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
9611
9612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9613}
9614
9615impl InstancesAcquireSsrsLeaseRequest {
9616 /// Creates a new default instance.
9617 pub fn new() -> Self {
9618 std::default::Default::default()
9619 }
9620
9621 /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9622 ///
9623 /// # Example
9624 /// ```ignore,no_run
9625 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9626 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9627 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
9628 /// ```
9629 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
9630 where
9631 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9632 {
9633 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
9634 self
9635 }
9636
9637 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9638 ///
9639 /// # Example
9640 /// ```ignore,no_run
9641 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9642 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9643 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
9644 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
9645 /// ```
9646 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
9647 where
9648 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9649 {
9650 self.acquire_ssrs_lease_context = v.map(|x| x.into());
9651 self
9652 }
9653}
9654
9655impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
9656 fn typename() -> &'static str {
9657 "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
9658 }
9659}
9660
9661/// Request for Pre-checks for MVU
9662#[derive(Clone, Default, PartialEq)]
9663#[non_exhaustive]
9664pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
9665 /// Required. Cloud SQL instance ID. This does not include the project ID.
9666 pub instance: std::string::String,
9667
9668 /// Required. Project ID of the project that contains the instance.
9669 pub project: std::string::String,
9670
9671 /// Required. The context for request to perform the pre-check major version
9672 /// upgrade operation.
9673 pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9674
9675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9676}
9677
9678impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
9679 /// Creates a new default instance.
9680 pub fn new() -> Self {
9681 std::default::Default::default()
9682 }
9683
9684 /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
9685 ///
9686 /// # Example
9687 /// ```ignore,no_run
9688 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9689 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_instance("example");
9690 /// ```
9691 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9692 self.instance = v.into();
9693 self
9694 }
9695
9696 /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
9697 ///
9698 /// # Example
9699 /// ```ignore,no_run
9700 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9701 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_project("example");
9702 /// ```
9703 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9704 self.project = v.into();
9705 self
9706 }
9707
9708 /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9709 ///
9710 /// # Example
9711 /// ```ignore,no_run
9712 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9713 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9714 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_body(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */);
9715 /// ```
9716 pub fn set_body<T>(mut self, v: T) -> Self
9717 where
9718 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9719 {
9720 self.body = std::option::Option::Some(v.into());
9721 self
9722 }
9723
9724 /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9725 ///
9726 /// # Example
9727 /// ```ignore,no_run
9728 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9729 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9730 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(Some(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */));
9731 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(None::<InstancesPreCheckMajorVersionUpgradeRequest>);
9732 /// ```
9733 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9734 where
9735 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9736 {
9737 self.body = v.map(|x| x.into());
9738 self
9739 }
9740}
9741
9742impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
9743 fn typename() -> &'static str {
9744 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
9745 }
9746}
9747
9748/// Instance verify external sync settings response.
9749#[derive(Clone, Default, PartialEq)]
9750#[non_exhaustive]
9751pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
9752 /// This is always `sql#migrationSettingErrorList`.
9753 pub kind: std::string::String,
9754
9755 /// List of migration violations.
9756 pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9757
9758 /// List of migration warnings.
9759 pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9760
9761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9762}
9763
9764impl SqlInstancesVerifyExternalSyncSettingsResponse {
9765 /// Creates a new default instance.
9766 pub fn new() -> Self {
9767 std::default::Default::default()
9768 }
9769
9770 /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
9771 ///
9772 /// # Example
9773 /// ```ignore,no_run
9774 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9775 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new().set_kind("example");
9776 /// ```
9777 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9778 self.kind = v.into();
9779 self
9780 }
9781
9782 /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
9783 ///
9784 /// # Example
9785 /// ```ignore,no_run
9786 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9787 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9788 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9789 /// .set_errors([
9790 /// SqlExternalSyncSettingError::default()/* use setters */,
9791 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
9792 /// ]);
9793 /// ```
9794 pub fn set_errors<T, V>(mut self, v: T) -> Self
9795 where
9796 T: std::iter::IntoIterator<Item = V>,
9797 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9798 {
9799 use std::iter::Iterator;
9800 self.errors = v.into_iter().map(|i| i.into()).collect();
9801 self
9802 }
9803
9804 /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
9805 ///
9806 /// # Example
9807 /// ```ignore,no_run
9808 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9809 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9810 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9811 /// .set_warnings([
9812 /// SqlExternalSyncSettingError::default()/* use setters */,
9813 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
9814 /// ]);
9815 /// ```
9816 pub fn set_warnings<T, V>(mut self, v: T) -> Self
9817 where
9818 T: std::iter::IntoIterator<Item = V>,
9819 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9820 {
9821 use std::iter::Iterator;
9822 self.warnings = v.into_iter().map(|i| i.into()).collect();
9823 self
9824 }
9825}
9826
9827impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
9828 fn typename() -> &'static str {
9829 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
9830 }
9831}
9832
9833/// Instance get disk shrink config response.
9834#[derive(Clone, Default, PartialEq)]
9835#[non_exhaustive]
9836pub struct SqlInstancesGetDiskShrinkConfigResponse {
9837 /// This is always `sql#getDiskShrinkConfig`.
9838 pub kind: std::string::String,
9839
9840 /// The minimum size to which a disk can be shrunk in GigaBytes.
9841 pub minimal_target_size_gb: i64,
9842
9843 /// Additional message to customers.
9844 pub message: std::string::String,
9845
9846 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9847}
9848
9849impl SqlInstancesGetDiskShrinkConfigResponse {
9850 /// Creates a new default instance.
9851 pub fn new() -> Self {
9852 std::default::Default::default()
9853 }
9854
9855 /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
9856 ///
9857 /// # Example
9858 /// ```ignore,no_run
9859 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9860 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
9861 /// ```
9862 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9863 self.kind = v.into();
9864 self
9865 }
9866
9867 /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
9868 ///
9869 /// # Example
9870 /// ```ignore,no_run
9871 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9872 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
9873 /// ```
9874 pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9875 self.minimal_target_size_gb = v.into();
9876 self
9877 }
9878
9879 /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
9880 ///
9881 /// # Example
9882 /// ```ignore,no_run
9883 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9884 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
9885 /// ```
9886 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9887 self.message = v.into();
9888 self
9889 }
9890}
9891
9892impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
9893 fn typename() -> &'static str {
9894 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
9895 }
9896}
9897
9898/// Instance get latest recovery time request.
9899#[derive(Clone, Default, PartialEq)]
9900#[non_exhaustive]
9901pub struct SqlInstancesGetLatestRecoveryTimeRequest {
9902 /// Cloud SQL instance ID. This does not include the project ID.
9903 pub instance: std::string::String,
9904
9905 /// Project ID of the project that contains the instance.
9906 pub project: std::string::String,
9907
9908 /// The timestamp used to identify the time when the source instance is
9909 /// deleted. If this instance is deleted, then you must set the timestamp.
9910 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9911
9912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9913}
9914
9915impl SqlInstancesGetLatestRecoveryTimeRequest {
9916 /// Creates a new default instance.
9917 pub fn new() -> Self {
9918 std::default::Default::default()
9919 }
9920
9921 /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
9922 ///
9923 /// # Example
9924 /// ```ignore,no_run
9925 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9926 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
9927 /// ```
9928 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9929 self.instance = v.into();
9930 self
9931 }
9932
9933 /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
9934 ///
9935 /// # Example
9936 /// ```ignore,no_run
9937 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9938 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
9939 /// ```
9940 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9941 self.project = v.into();
9942 self
9943 }
9944
9945 /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9946 ///
9947 /// # Example
9948 /// ```ignore,no_run
9949 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9950 /// use wkt::Timestamp;
9951 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
9952 /// ```
9953 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
9954 where
9955 T: std::convert::Into<wkt::Timestamp>,
9956 {
9957 self.source_instance_deletion_time = std::option::Option::Some(v.into());
9958 self
9959 }
9960
9961 /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9962 ///
9963 /// # Example
9964 /// ```ignore,no_run
9965 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9966 /// use wkt::Timestamp;
9967 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
9968 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
9969 /// ```
9970 pub fn set_or_clear_source_instance_deletion_time<T>(
9971 mut self,
9972 v: std::option::Option<T>,
9973 ) -> Self
9974 where
9975 T: std::convert::Into<wkt::Timestamp>,
9976 {
9977 self.source_instance_deletion_time = v.map(|x| x.into());
9978 self
9979 }
9980}
9981
9982impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
9983 fn typename() -> &'static str {
9984 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
9985 }
9986}
9987
9988/// Instance get latest recovery time response.
9989#[derive(Clone, Default, PartialEq)]
9990#[non_exhaustive]
9991pub struct SqlInstancesGetLatestRecoveryTimeResponse {
9992 /// This is always `sql#getLatestRecoveryTime`.
9993 pub kind: std::string::String,
9994
9995 /// Timestamp, identifies the latest recovery time of the source instance.
9996 pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
9997
9998 /// Timestamp, identifies the earliest recovery time of the source instance.
9999 pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
10000
10001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10002}
10003
10004impl SqlInstancesGetLatestRecoveryTimeResponse {
10005 /// Creates a new default instance.
10006 pub fn new() -> Self {
10007 std::default::Default::default()
10008 }
10009
10010 /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
10011 ///
10012 /// # Example
10013 /// ```ignore,no_run
10014 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10015 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
10016 /// ```
10017 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10018 self.kind = v.into();
10019 self
10020 }
10021
10022 /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
10023 ///
10024 /// # Example
10025 /// ```ignore,no_run
10026 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10027 /// use wkt::Timestamp;
10028 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
10029 /// ```
10030 pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
10031 where
10032 T: std::convert::Into<wkt::Timestamp>,
10033 {
10034 self.latest_recovery_time = std::option::Option::Some(v.into());
10035 self
10036 }
10037
10038 /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
10039 ///
10040 /// # Example
10041 /// ```ignore,no_run
10042 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10043 /// use wkt::Timestamp;
10044 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
10045 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
10046 /// ```
10047 pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
10048 where
10049 T: std::convert::Into<wkt::Timestamp>,
10050 {
10051 self.latest_recovery_time = v.map(|x| x.into());
10052 self
10053 }
10054
10055 /// Sets the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
10056 ///
10057 /// # Example
10058 /// ```ignore,no_run
10059 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10060 /// use wkt::Timestamp;
10061 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_earliest_recovery_time(Timestamp::default()/* use setters */);
10062 /// ```
10063 pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
10064 where
10065 T: std::convert::Into<wkt::Timestamp>,
10066 {
10067 self.earliest_recovery_time = std::option::Option::Some(v.into());
10068 self
10069 }
10070
10071 /// Sets or clears the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
10072 ///
10073 /// # Example
10074 /// ```ignore,no_run
10075 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10076 /// use wkt::Timestamp;
10077 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(Some(Timestamp::default()/* use setters */));
10078 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(None::<Timestamp>);
10079 /// ```
10080 pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
10081 where
10082 T: std::convert::Into<wkt::Timestamp>,
10083 {
10084 self.earliest_recovery_time = v.map(|x| x.into());
10085 self
10086 }
10087}
10088
10089impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
10090 fn typename() -> &'static str {
10091 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
10092 }
10093}
10094
10095/// Database instance clone context.
10096#[derive(Clone, Default, PartialEq)]
10097#[non_exhaustive]
10098pub struct CloneContext {
10099 /// This is always `sql#cloneContext`.
10100 pub kind: std::string::String,
10101
10102 /// Reserved for future use.
10103 pub pitr_timestamp_ms: i64,
10104
10105 /// Required. Name of the Cloud SQL instance to be created as a clone.
10106 pub destination_instance_name: std::string::String,
10107
10108 /// Binary log coordinates, if specified, identify the position up to which the
10109 /// source instance is cloned. If not specified, the source instance is
10110 /// cloned up to the most recent binary log coordinates.
10111 pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
10112
10113 /// Timestamp, if specified, identifies the time to which the source instance
10114 /// is cloned.
10115 pub point_in_time: std::option::Option<wkt::Timestamp>,
10116
10117 /// The name of the allocated ip range for the private ip Cloud SQL instance.
10118 /// For example: "google-managed-services-default". If set, the cloned instance
10119 /// ip will be created in the allocated range. The range name must comply with
10120 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
10121 /// must be 1-63 characters long and match the regular expression
10122 /// [a-z]([-a-z0-9]*[a-z0-9])?.
10123 /// Reserved for future use.
10124 pub allocated_ip_range: std::string::String,
10125
10126 /// (SQL Server only) Clone only the specified databases from the source
10127 /// instance. Clone all databases if empty.
10128 pub database_names: std::vec::Vec<std::string::String>,
10129
10130 /// Optional. Copy clone and point-in-time recovery clone of an instance to the
10131 /// specified zone. If no zone is specified, clone to the same primary zone as
10132 /// the source instance. This field applies to all DB types.
10133 pub preferred_zone: std::option::Option<std::string::String>,
10134
10135 /// Optional. Copy clone and point-in-time recovery clone of a regional
10136 /// instance in the specified zones. If not specified, clone to the same
10137 /// secondary zone as the source instance. This value cannot be the same as the
10138 /// preferred_zone field. This field applies to all DB types.
10139 pub preferred_secondary_zone: std::option::Option<std::string::String>,
10140
10141 /// The timestamp used to identify the time when the source instance is
10142 /// deleted. If this instance is deleted, then you must set the timestamp.
10143 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
10144
10145 /// Optional. The project ID of the destination project where the cloned
10146 /// instance will be created. To perform a cross-project clone, this field is
10147 /// required. If not specified, the clone is created in the same project
10148 /// as the source instance.
10149 pub destination_project: std::option::Option<std::string::String>,
10150
10151 /// Optional. The fully qualified URI of the VPC network to which the cloned
10152 /// instance will be connected via private services access for private IP. For
10153 /// example:`projects/my-network-project/global/networks/my-network`. This
10154 /// field is only required for cross-project cloning.
10155 pub destination_network: std::option::Option<std::string::String>,
10156
10157 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10158}
10159
10160impl CloneContext {
10161 /// Creates a new default instance.
10162 pub fn new() -> Self {
10163 std::default::Default::default()
10164 }
10165
10166 /// Sets the value of [kind][crate::model::CloneContext::kind].
10167 ///
10168 /// # Example
10169 /// ```ignore,no_run
10170 /// # use google_cloud_sql_v1::model::CloneContext;
10171 /// let x = CloneContext::new().set_kind("example");
10172 /// ```
10173 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10174 self.kind = v.into();
10175 self
10176 }
10177
10178 /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
10179 ///
10180 /// # Example
10181 /// ```ignore,no_run
10182 /// # use google_cloud_sql_v1::model::CloneContext;
10183 /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
10184 /// ```
10185 pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10186 self.pitr_timestamp_ms = v.into();
10187 self
10188 }
10189
10190 /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
10191 ///
10192 /// # Example
10193 /// ```ignore,no_run
10194 /// # use google_cloud_sql_v1::model::CloneContext;
10195 /// let x = CloneContext::new().set_destination_instance_name("example");
10196 /// ```
10197 pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
10198 mut self,
10199 v: T,
10200 ) -> Self {
10201 self.destination_instance_name = v.into();
10202 self
10203 }
10204
10205 /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10206 ///
10207 /// # Example
10208 /// ```ignore,no_run
10209 /// # use google_cloud_sql_v1::model::CloneContext;
10210 /// use google_cloud_sql_v1::model::BinLogCoordinates;
10211 /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
10212 /// ```
10213 pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
10214 where
10215 T: std::convert::Into<crate::model::BinLogCoordinates>,
10216 {
10217 self.bin_log_coordinates = std::option::Option::Some(v.into());
10218 self
10219 }
10220
10221 /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10222 ///
10223 /// # Example
10224 /// ```ignore,no_run
10225 /// # use google_cloud_sql_v1::model::CloneContext;
10226 /// use google_cloud_sql_v1::model::BinLogCoordinates;
10227 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
10228 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
10229 /// ```
10230 pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
10231 where
10232 T: std::convert::Into<crate::model::BinLogCoordinates>,
10233 {
10234 self.bin_log_coordinates = v.map(|x| x.into());
10235 self
10236 }
10237
10238 /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
10239 ///
10240 /// # Example
10241 /// ```ignore,no_run
10242 /// # use google_cloud_sql_v1::model::CloneContext;
10243 /// use wkt::Timestamp;
10244 /// let x = CloneContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10245 /// ```
10246 pub fn set_point_in_time<T>(mut self, v: T) -> Self
10247 where
10248 T: std::convert::Into<wkt::Timestamp>,
10249 {
10250 self.point_in_time = std::option::Option::Some(v.into());
10251 self
10252 }
10253
10254 /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
10255 ///
10256 /// # Example
10257 /// ```ignore,no_run
10258 /// # use google_cloud_sql_v1::model::CloneContext;
10259 /// use wkt::Timestamp;
10260 /// let x = CloneContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10261 /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10262 /// ```
10263 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10264 where
10265 T: std::convert::Into<wkt::Timestamp>,
10266 {
10267 self.point_in_time = v.map(|x| x.into());
10268 self
10269 }
10270
10271 /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
10272 ///
10273 /// # Example
10274 /// ```ignore,no_run
10275 /// # use google_cloud_sql_v1::model::CloneContext;
10276 /// let x = CloneContext::new().set_allocated_ip_range("example");
10277 /// ```
10278 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10279 mut self,
10280 v: T,
10281 ) -> Self {
10282 self.allocated_ip_range = v.into();
10283 self
10284 }
10285
10286 /// Sets the value of [database_names][crate::model::CloneContext::database_names].
10287 ///
10288 /// # Example
10289 /// ```ignore,no_run
10290 /// # use google_cloud_sql_v1::model::CloneContext;
10291 /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
10292 /// ```
10293 pub fn set_database_names<T, V>(mut self, v: T) -> Self
10294 where
10295 T: std::iter::IntoIterator<Item = V>,
10296 V: std::convert::Into<std::string::String>,
10297 {
10298 use std::iter::Iterator;
10299 self.database_names = v.into_iter().map(|i| i.into()).collect();
10300 self
10301 }
10302
10303 /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10304 ///
10305 /// # Example
10306 /// ```ignore,no_run
10307 /// # use google_cloud_sql_v1::model::CloneContext;
10308 /// let x = CloneContext::new().set_preferred_zone("example");
10309 /// ```
10310 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10311 where
10312 T: std::convert::Into<std::string::String>,
10313 {
10314 self.preferred_zone = std::option::Option::Some(v.into());
10315 self
10316 }
10317
10318 /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10319 ///
10320 /// # Example
10321 /// ```ignore,no_run
10322 /// # use google_cloud_sql_v1::model::CloneContext;
10323 /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
10324 /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
10325 /// ```
10326 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10327 where
10328 T: std::convert::Into<std::string::String>,
10329 {
10330 self.preferred_zone = v.map(|x| x.into());
10331 self
10332 }
10333
10334 /// Sets the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10335 ///
10336 /// # Example
10337 /// ```ignore,no_run
10338 /// # use google_cloud_sql_v1::model::CloneContext;
10339 /// let x = CloneContext::new().set_preferred_secondary_zone("example");
10340 /// ```
10341 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10342 where
10343 T: std::convert::Into<std::string::String>,
10344 {
10345 self.preferred_secondary_zone = std::option::Option::Some(v.into());
10346 self
10347 }
10348
10349 /// Sets or clears the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10350 ///
10351 /// # Example
10352 /// ```ignore,no_run
10353 /// # use google_cloud_sql_v1::model::CloneContext;
10354 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10355 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10356 /// ```
10357 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10358 where
10359 T: std::convert::Into<std::string::String>,
10360 {
10361 self.preferred_secondary_zone = v.map(|x| x.into());
10362 self
10363 }
10364
10365 /// Sets the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10366 ///
10367 /// # Example
10368 /// ```ignore,no_run
10369 /// # use google_cloud_sql_v1::model::CloneContext;
10370 /// use wkt::Timestamp;
10371 /// let x = CloneContext::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
10372 /// ```
10373 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
10374 where
10375 T: std::convert::Into<wkt::Timestamp>,
10376 {
10377 self.source_instance_deletion_time = std::option::Option::Some(v.into());
10378 self
10379 }
10380
10381 /// Sets or clears the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10382 ///
10383 /// # Example
10384 /// ```ignore,no_run
10385 /// # use google_cloud_sql_v1::model::CloneContext;
10386 /// use wkt::Timestamp;
10387 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
10388 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
10389 /// ```
10390 pub fn set_or_clear_source_instance_deletion_time<T>(
10391 mut self,
10392 v: std::option::Option<T>,
10393 ) -> Self
10394 where
10395 T: std::convert::Into<wkt::Timestamp>,
10396 {
10397 self.source_instance_deletion_time = v.map(|x| x.into());
10398 self
10399 }
10400
10401 /// Sets the value of [destination_project][crate::model::CloneContext::destination_project].
10402 ///
10403 /// # Example
10404 /// ```ignore,no_run
10405 /// # use google_cloud_sql_v1::model::CloneContext;
10406 /// let x = CloneContext::new().set_destination_project("example");
10407 /// ```
10408 pub fn set_destination_project<T>(mut self, v: T) -> Self
10409 where
10410 T: std::convert::Into<std::string::String>,
10411 {
10412 self.destination_project = std::option::Option::Some(v.into());
10413 self
10414 }
10415
10416 /// Sets or clears the value of [destination_project][crate::model::CloneContext::destination_project].
10417 ///
10418 /// # Example
10419 /// ```ignore,no_run
10420 /// # use google_cloud_sql_v1::model::CloneContext;
10421 /// let x = CloneContext::new().set_or_clear_destination_project(Some("example"));
10422 /// let x = CloneContext::new().set_or_clear_destination_project(None::<String>);
10423 /// ```
10424 pub fn set_or_clear_destination_project<T>(mut self, v: std::option::Option<T>) -> Self
10425 where
10426 T: std::convert::Into<std::string::String>,
10427 {
10428 self.destination_project = v.map(|x| x.into());
10429 self
10430 }
10431
10432 /// Sets the value of [destination_network][crate::model::CloneContext::destination_network].
10433 ///
10434 /// # Example
10435 /// ```ignore,no_run
10436 /// # use google_cloud_sql_v1::model::CloneContext;
10437 /// let x = CloneContext::new().set_destination_network("example");
10438 /// ```
10439 pub fn set_destination_network<T>(mut self, v: T) -> Self
10440 where
10441 T: std::convert::Into<std::string::String>,
10442 {
10443 self.destination_network = std::option::Option::Some(v.into());
10444 self
10445 }
10446
10447 /// Sets or clears the value of [destination_network][crate::model::CloneContext::destination_network].
10448 ///
10449 /// # Example
10450 /// ```ignore,no_run
10451 /// # use google_cloud_sql_v1::model::CloneContext;
10452 /// let x = CloneContext::new().set_or_clear_destination_network(Some("example"));
10453 /// let x = CloneContext::new().set_or_clear_destination_network(None::<String>);
10454 /// ```
10455 pub fn set_or_clear_destination_network<T>(mut self, v: std::option::Option<T>) -> Self
10456 where
10457 T: std::convert::Into<std::string::String>,
10458 {
10459 self.destination_network = v.map(|x| x.into());
10460 self
10461 }
10462}
10463
10464impl wkt::message::Message for CloneContext {
10465 fn typename() -> &'static str {
10466 "type.googleapis.com/google.cloud.sql.v1.CloneContext"
10467 }
10468}
10469
10470/// The context to perform a point-in-time recovery of an instance managed by
10471/// Backup and Disaster Recovery (DR) Service.
10472#[derive(Clone, Default, PartialEq)]
10473#[non_exhaustive]
10474pub struct PointInTimeRestoreContext {
10475 /// The Backup and Disaster Recovery (DR) Service Datasource URI.
10476 /// Format:
10477 /// projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
10478 pub datasource: std::option::Option<std::string::String>,
10479
10480 /// Required. The date and time to which you want to restore the instance.
10481 pub point_in_time: std::option::Option<wkt::Timestamp>,
10482
10483 /// Target instance name.
10484 pub target_instance: std::option::Option<std::string::String>,
10485
10486 /// Optional. The resource link for the VPC network from which the Cloud SQL
10487 /// instance is accessible for private IP. For example,
10488 /// `/projects/myProject/global/networks/default`.
10489 pub private_network: std::option::Option<std::string::String>,
10490
10491 /// Optional. The name of the allocated IP range for the internal IP Cloud SQL
10492 /// instance. For example: "google-managed-services-default". If you set this,
10493 /// then Cloud SQL creates the IP address for the cloned instance in the
10494 /// allocated range. This range must comply with [RFC
10495 /// 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
10496 /// name must be 1-63 characters long and match the regular expression
10497 /// [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
10498 pub allocated_ip_range: std::option::Option<std::string::String>,
10499
10500 /// Optional. Point-in-time recovery of an instance to the specified zone. If
10501 /// no zone is specified, then clone to the same primary zone as the source
10502 /// instance.
10503 pub preferred_zone: std::option::Option<std::string::String>,
10504
10505 /// Optional. Point-in-time recovery of a regional instance in the specified
10506 /// zones. If not specified, clone to the same secondary zone as the source
10507 /// instance. This value cannot be the same as the preferred_zone field.
10508 pub preferred_secondary_zone: std::option::Option<std::string::String>,
10509
10510 /// Optional. Specifies the instance settings that will be overridden from the
10511 /// source instance. This field is only applicable for cross project PITRs.
10512 pub target_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
10513
10514 /// Optional. Specifies the instance settings that will be cleared from the
10515 /// source instance. This field is only applicable for cross project PITRs.
10516 pub target_instance_clear_settings_field_names: std::vec::Vec<std::string::String>,
10517
10518 /// Optional. The region of the target instance where the datasource will be
10519 /// restored. For example: "us-central1".
10520 pub region: std::option::Option<std::string::String>,
10521
10522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10523}
10524
10525impl PointInTimeRestoreContext {
10526 /// Creates a new default instance.
10527 pub fn new() -> Self {
10528 std::default::Default::default()
10529 }
10530
10531 /// Sets the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10532 ///
10533 /// # Example
10534 /// ```ignore,no_run
10535 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10536 /// let x = PointInTimeRestoreContext::new().set_datasource("example");
10537 /// ```
10538 pub fn set_datasource<T>(mut self, v: T) -> Self
10539 where
10540 T: std::convert::Into<std::string::String>,
10541 {
10542 self.datasource = std::option::Option::Some(v.into());
10543 self
10544 }
10545
10546 /// Sets or clears the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10547 ///
10548 /// # Example
10549 /// ```ignore,no_run
10550 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10551 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(Some("example"));
10552 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(None::<String>);
10553 /// ```
10554 pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
10555 where
10556 T: std::convert::Into<std::string::String>,
10557 {
10558 self.datasource = v.map(|x| x.into());
10559 self
10560 }
10561
10562 /// Sets the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10563 ///
10564 /// # Example
10565 /// ```ignore,no_run
10566 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10567 /// use wkt::Timestamp;
10568 /// let x = PointInTimeRestoreContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10569 /// ```
10570 pub fn set_point_in_time<T>(mut self, v: T) -> Self
10571 where
10572 T: std::convert::Into<wkt::Timestamp>,
10573 {
10574 self.point_in_time = std::option::Option::Some(v.into());
10575 self
10576 }
10577
10578 /// Sets or clears the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10579 ///
10580 /// # Example
10581 /// ```ignore,no_run
10582 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10583 /// use wkt::Timestamp;
10584 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10585 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10586 /// ```
10587 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10588 where
10589 T: std::convert::Into<wkt::Timestamp>,
10590 {
10591 self.point_in_time = v.map(|x| x.into());
10592 self
10593 }
10594
10595 /// Sets the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10596 ///
10597 /// # Example
10598 /// ```ignore,no_run
10599 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10600 /// let x = PointInTimeRestoreContext::new().set_target_instance("example");
10601 /// ```
10602 pub fn set_target_instance<T>(mut self, v: T) -> Self
10603 where
10604 T: std::convert::Into<std::string::String>,
10605 {
10606 self.target_instance = std::option::Option::Some(v.into());
10607 self
10608 }
10609
10610 /// Sets or clears the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10611 ///
10612 /// # Example
10613 /// ```ignore,no_run
10614 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10615 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(Some("example"));
10616 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(None::<String>);
10617 /// ```
10618 pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
10619 where
10620 T: std::convert::Into<std::string::String>,
10621 {
10622 self.target_instance = v.map(|x| x.into());
10623 self
10624 }
10625
10626 /// Sets the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10627 ///
10628 /// # Example
10629 /// ```ignore,no_run
10630 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10631 /// let x = PointInTimeRestoreContext::new().set_private_network("example");
10632 /// ```
10633 pub fn set_private_network<T>(mut self, v: T) -> Self
10634 where
10635 T: std::convert::Into<std::string::String>,
10636 {
10637 self.private_network = std::option::Option::Some(v.into());
10638 self
10639 }
10640
10641 /// Sets or clears the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10642 ///
10643 /// # Example
10644 /// ```ignore,no_run
10645 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10646 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(Some("example"));
10647 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(None::<String>);
10648 /// ```
10649 pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
10650 where
10651 T: std::convert::Into<std::string::String>,
10652 {
10653 self.private_network = v.map(|x| x.into());
10654 self
10655 }
10656
10657 /// Sets the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10658 ///
10659 /// # Example
10660 /// ```ignore,no_run
10661 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10662 /// let x = PointInTimeRestoreContext::new().set_allocated_ip_range("example");
10663 /// ```
10664 pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
10665 where
10666 T: std::convert::Into<std::string::String>,
10667 {
10668 self.allocated_ip_range = std::option::Option::Some(v.into());
10669 self
10670 }
10671
10672 /// Sets or clears the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10673 ///
10674 /// # Example
10675 /// ```ignore,no_run
10676 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10677 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(Some("example"));
10678 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(None::<String>);
10679 /// ```
10680 pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
10681 where
10682 T: std::convert::Into<std::string::String>,
10683 {
10684 self.allocated_ip_range = v.map(|x| x.into());
10685 self
10686 }
10687
10688 /// Sets the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10689 ///
10690 /// # Example
10691 /// ```ignore,no_run
10692 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10693 /// let x = PointInTimeRestoreContext::new().set_preferred_zone("example");
10694 /// ```
10695 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10696 where
10697 T: std::convert::Into<std::string::String>,
10698 {
10699 self.preferred_zone = std::option::Option::Some(v.into());
10700 self
10701 }
10702
10703 /// Sets or clears the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10704 ///
10705 /// # Example
10706 /// ```ignore,no_run
10707 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10708 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(Some("example"));
10709 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(None::<String>);
10710 /// ```
10711 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10712 where
10713 T: std::convert::Into<std::string::String>,
10714 {
10715 self.preferred_zone = v.map(|x| x.into());
10716 self
10717 }
10718
10719 /// Sets the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10720 ///
10721 /// # Example
10722 /// ```ignore,no_run
10723 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10724 /// let x = PointInTimeRestoreContext::new().set_preferred_secondary_zone("example");
10725 /// ```
10726 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10727 where
10728 T: std::convert::Into<std::string::String>,
10729 {
10730 self.preferred_secondary_zone = std::option::Option::Some(v.into());
10731 self
10732 }
10733
10734 /// Sets or clears the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10735 ///
10736 /// # Example
10737 /// ```ignore,no_run
10738 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10739 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10740 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10741 /// ```
10742 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10743 where
10744 T: std::convert::Into<std::string::String>,
10745 {
10746 self.preferred_secondary_zone = v.map(|x| x.into());
10747 self
10748 }
10749
10750 /// Sets the value of [target_instance_settings][crate::model::PointInTimeRestoreContext::target_instance_settings].
10751 ///
10752 /// # Example
10753 /// ```ignore,no_run
10754 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10755 /// use google_cloud_sql_v1::model::DatabaseInstance;
10756 /// let x = PointInTimeRestoreContext::new().set_target_instance_settings(DatabaseInstance::default()/* use setters */);
10757 /// ```
10758 pub fn set_target_instance_settings<T>(mut self, v: T) -> Self
10759 where
10760 T: std::convert::Into<crate::model::DatabaseInstance>,
10761 {
10762 self.target_instance_settings = std::option::Option::Some(v.into());
10763 self
10764 }
10765
10766 /// Sets or clears the value of [target_instance_settings][crate::model::PointInTimeRestoreContext::target_instance_settings].
10767 ///
10768 /// # Example
10769 /// ```ignore,no_run
10770 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10771 /// use google_cloud_sql_v1::model::DatabaseInstance;
10772 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance_settings(Some(DatabaseInstance::default()/* use setters */));
10773 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance_settings(None::<DatabaseInstance>);
10774 /// ```
10775 pub fn set_or_clear_target_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
10776 where
10777 T: std::convert::Into<crate::model::DatabaseInstance>,
10778 {
10779 self.target_instance_settings = v.map(|x| x.into());
10780 self
10781 }
10782
10783 /// Sets the value of [target_instance_clear_settings_field_names][crate::model::PointInTimeRestoreContext::target_instance_clear_settings_field_names].
10784 ///
10785 /// # Example
10786 /// ```ignore,no_run
10787 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10788 /// let x = PointInTimeRestoreContext::new().set_target_instance_clear_settings_field_names(["a", "b", "c"]);
10789 /// ```
10790 pub fn set_target_instance_clear_settings_field_names<T, V>(mut self, v: T) -> Self
10791 where
10792 T: std::iter::IntoIterator<Item = V>,
10793 V: std::convert::Into<std::string::String>,
10794 {
10795 use std::iter::Iterator;
10796 self.target_instance_clear_settings_field_names = v.into_iter().map(|i| i.into()).collect();
10797 self
10798 }
10799
10800 /// Sets the value of [region][crate::model::PointInTimeRestoreContext::region].
10801 ///
10802 /// # Example
10803 /// ```ignore,no_run
10804 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10805 /// let x = PointInTimeRestoreContext::new().set_region("example");
10806 /// ```
10807 pub fn set_region<T>(mut self, v: T) -> Self
10808 where
10809 T: std::convert::Into<std::string::String>,
10810 {
10811 self.region = std::option::Option::Some(v.into());
10812 self
10813 }
10814
10815 /// Sets or clears the value of [region][crate::model::PointInTimeRestoreContext::region].
10816 ///
10817 /// # Example
10818 /// ```ignore,no_run
10819 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10820 /// let x = PointInTimeRestoreContext::new().set_or_clear_region(Some("example"));
10821 /// let x = PointInTimeRestoreContext::new().set_or_clear_region(None::<String>);
10822 /// ```
10823 pub fn set_or_clear_region<T>(mut self, v: std::option::Option<T>) -> Self
10824 where
10825 T: std::convert::Into<std::string::String>,
10826 {
10827 self.region = v.map(|x| x.into());
10828 self
10829 }
10830}
10831
10832impl wkt::message::Message for PointInTimeRestoreContext {
10833 fn typename() -> &'static str {
10834 "type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
10835 }
10836}
10837
10838/// Binary log coordinates.
10839#[derive(Clone, Default, PartialEq)]
10840#[non_exhaustive]
10841pub struct BinLogCoordinates {
10842 /// Name of the binary log file for a Cloud SQL instance.
10843 pub bin_log_file_name: std::string::String,
10844
10845 /// Position (offset) within the binary log file.
10846 pub bin_log_position: i64,
10847
10848 /// This is always `sql#binLogCoordinates`.
10849 pub kind: std::string::String,
10850
10851 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10852}
10853
10854impl BinLogCoordinates {
10855 /// Creates a new default instance.
10856 pub fn new() -> Self {
10857 std::default::Default::default()
10858 }
10859
10860 /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
10861 ///
10862 /// # Example
10863 /// ```ignore,no_run
10864 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10865 /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
10866 /// ```
10867 pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
10868 mut self,
10869 v: T,
10870 ) -> Self {
10871 self.bin_log_file_name = v.into();
10872 self
10873 }
10874
10875 /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
10876 ///
10877 /// # Example
10878 /// ```ignore,no_run
10879 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10880 /// let x = BinLogCoordinates::new().set_bin_log_position(42);
10881 /// ```
10882 pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10883 self.bin_log_position = v.into();
10884 self
10885 }
10886
10887 /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
10888 ///
10889 /// # Example
10890 /// ```ignore,no_run
10891 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10892 /// let x = BinLogCoordinates::new().set_kind("example");
10893 /// ```
10894 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10895 self.kind = v.into();
10896 self
10897 }
10898}
10899
10900impl wkt::message::Message for BinLogCoordinates {
10901 fn typename() -> &'static str {
10902 "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
10903 }
10904}
10905
10906/// A Cloud SQL instance resource.
10907#[derive(Clone, Default, PartialEq)]
10908#[non_exhaustive]
10909pub struct DatabaseInstance {
10910 /// This is always `sql#instance`.
10911 pub kind: std::string::String,
10912
10913 /// The current serving state of the Cloud SQL instance.
10914 pub state: crate::model::database_instance::SqlInstanceState,
10915
10916 /// The database engine type and version. The `databaseVersion` field cannot
10917 /// be changed after instance creation.
10918 pub database_version: crate::model::SqlDatabaseVersion,
10919
10920 /// The user settings.
10921 pub settings: std::option::Option<crate::model::Settings>,
10922
10923 /// This field is deprecated and will be removed from a future version of the
10924 /// API. Use the `settings.settingsVersion` field instead.
10925 pub etag: std::string::String,
10926
10927 /// The name and status of the failover replica.
10928 pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
10929
10930 /// The name of the instance which will act as primary in the replication
10931 /// setup.
10932 pub master_instance_name: std::string::String,
10933
10934 /// The replicas of the instance.
10935 pub replica_names: std::vec::Vec<std::string::String>,
10936
10937 /// The maximum disk size of the instance in bytes.
10938 #[deprecated]
10939 pub max_disk_size: std::option::Option<wkt::Int64Value>,
10940
10941 /// The current disk usage of the instance in bytes. This property has been
10942 /// deprecated. Use the
10943 /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
10944 /// Monitoring API instead. Please see [this
10945 /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
10946 /// for details.
10947 #[deprecated]
10948 pub current_disk_size: std::option::Option<wkt::Int64Value>,
10949
10950 /// The assigned IP addresses for the instance.
10951 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
10952
10953 /// SSL configuration.
10954 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
10955
10956 /// The instance type.
10957 pub instance_type: crate::model::SqlInstanceType,
10958
10959 /// The project ID of the project containing the Cloud SQL instance. The Google
10960 /// apps domain is prefixed if applicable.
10961 pub project: std::string::String,
10962
10963 /// The IPv6 address assigned to the instance.
10964 /// (Deprecated) This property was applicable only
10965 /// to First Generation instances.
10966 #[deprecated]
10967 pub ipv6_address: std::string::String,
10968
10969 /// The service account email address assigned to the instance.\This
10970 /// property is read-only.
10971 pub service_account_email_address: std::string::String,
10972
10973 /// Configuration specific to on-premises instances.
10974 pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
10975
10976 /// Configuration specific to failover replicas and read replicas.
10977 pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
10978
10979 /// The backend type.
10980 /// `SECOND_GEN`: Cloud SQL database instance.
10981 /// `EXTERNAL`: A database server that is not managed by Google.
10982 ///
10983 /// This property is read-only; use the `tier` property in the `settings`
10984 /// object to determine the database type.
10985 pub backend_type: crate::model::SqlBackendType,
10986
10987 /// The URI of this resource.
10988 pub self_link: std::string::String,
10989
10990 /// If the instance state is SUSPENDED, the reason for the suspension.
10991 pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
10992
10993 /// Connection name of the Cloud SQL instance used in connection strings.
10994 pub connection_name: std::string::String,
10995
10996 /// Name of the Cloud SQL instance. This does not include the project ID.
10997 pub name: std::string::String,
10998
10999 /// The geographical region of the Cloud SQL instance.
11000 ///
11001 /// It can be one of the
11002 /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
11003 /// where Cloud SQL operates:
11004 ///
11005 /// For example, `asia-east1`, `europe-west1`, and `us-central1`.
11006 /// The default value is `us-central1`.
11007 pub region: std::string::String,
11008
11009 /// The Compute Engine zone that the instance is currently serving from. This
11010 /// value could be different from the zone that was specified when the instance
11011 /// was created if the instance has failed over to its secondary zone. WARNING:
11012 /// Changing this might restart the instance.
11013 pub gce_zone: std::string::String,
11014
11015 /// The Compute Engine zone that the failover instance is currently serving
11016 /// from for a regional instance. This value could be different
11017 /// from the zone that was specified when the instance
11018 /// was created if the instance has failed over to its secondary/failover zone.
11019 pub secondary_gce_zone: std::string::String,
11020
11021 /// Disk encryption configuration specific to an instance.
11022 pub disk_encryption_configuration:
11023 std::option::Option<crate::model::DiskEncryptionConfiguration>,
11024
11025 /// Disk encryption status specific to an instance.
11026 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
11027
11028 /// Initial root password. Use only on creation. You must set root passwords
11029 /// before you can connect to PostgreSQL instances.
11030 pub root_password: std::string::String,
11031
11032 /// The start time of any upcoming scheduled maintenance for this instance.
11033 pub scheduled_maintenance:
11034 std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
11035
11036 /// This status indicates whether the instance satisfies PZS.
11037 ///
11038 /// The status is reserved for future use.
11039 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
11040
11041 /// Output only. Stores the current database version running on the instance
11042 /// including minor version such as `MYSQL_8_0_18`.
11043 pub database_installed_version: std::string::String,
11044
11045 /// This field represents the report generated by the proactive database
11046 /// wellness job for OutOfDisk issues.
11047 ///
11048 /// * Writers:
11049 /// * the proactive database wellness job for OOD.
11050 /// * Readers:
11051 /// * the proactive database wellness job
11052 pub out_of_disk_report:
11053 std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
11054
11055 /// Output only. The time when the instance was created in
11056 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
11057 /// `2012-11-15T16:19:00.094Z`.
11058 pub create_time: std::option::Option<wkt::Timestamp>,
11059
11060 /// Output only. List all maintenance versions applicable on the instance
11061 pub available_maintenance_versions: std::vec::Vec<std::string::String>,
11062
11063 /// The current software version on the instance.
11064 pub maintenance_version: std::string::String,
11065
11066 /// Output only. All database versions that are available for upgrade.
11067 pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
11068
11069 #[allow(missing_docs)]
11070 pub sql_network_architecture:
11071 std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
11072
11073 /// Output only. The link to service attachment of PSC instance.
11074 pub psc_service_attachment_link: std::option::Option<std::string::String>,
11075
11076 /// Output only. The dns name of the instance.
11077 pub dns_name: std::option::Option<std::string::String>,
11078
11079 /// Output only. DEPRECATED: please use write_endpoint instead.
11080 #[deprecated]
11081 pub primary_dns_name: std::option::Option<std::string::String>,
11082
11083 /// Output only. The dns name of the primary instance in a replication group.
11084 pub write_endpoint: std::option::Option<std::string::String>,
11085
11086 /// Optional. A primary instance and disaster recovery (DR) replica pair.
11087 /// A DR replica is a cross-region replica that you designate
11088 /// for failover in the event that the primary instance
11089 /// experiences regional failure.
11090 /// Applicable to MySQL and PostgreSQL.
11091 pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
11092
11093 /// Gemini instance configuration.
11094 pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
11095
11096 /// Output only. This status indicates whether the instance satisfies PZI.
11097 ///
11098 /// The status is reserved for future use.
11099 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
11100
11101 /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
11102 /// recovery log files from a data disk to Cloud Storage.
11103 pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
11104
11105 /// Input only. Determines whether an in-place major version upgrade of
11106 /// replicas happens when an in-place major version upgrade of a primary
11107 /// instance is initiated.
11108 pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
11109
11110 /// Optional. Input only. Immutable. Tag keys and tag values that are bound to
11111 /// this instance. You must represent each item in the map as:
11112 /// `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
11113 ///
11114 /// For example, a single resource can have the following tags:
11115 ///
11116 /// ```norust
11117 /// "123/environment": "production",
11118 /// "123/costCenter": "marketing",
11119 /// ```
11120 ///
11121 /// For more information on tag creation and management, see
11122 /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview>.
11123 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
11124
11125 /// The number of read pool nodes in a read pool.
11126 pub node_count: std::option::Option<i32>,
11127
11128 /// Output only. Entries containing information about each read pool node of
11129 /// the read pool.
11130 pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
11131
11132 /// Output only. The list of DNS names used by this instance.
11133 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
11134
11135 /// Optional. If true, instance metadata is sent to the Database Center. If
11136 /// false, instance metadata is not sent to the Database Center.
11137 pub database_center_integration_enabled: std::option::Option<wkt::BoolValue>,
11138
11139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11140}
11141
11142impl DatabaseInstance {
11143 /// Creates a new default instance.
11144 pub fn new() -> Self {
11145 std::default::Default::default()
11146 }
11147
11148 /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
11149 ///
11150 /// # Example
11151 /// ```ignore,no_run
11152 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11153 /// let x = DatabaseInstance::new().set_kind("example");
11154 /// ```
11155 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11156 self.kind = v.into();
11157 self
11158 }
11159
11160 /// Sets the value of [state][crate::model::DatabaseInstance::state].
11161 ///
11162 /// # Example
11163 /// ```ignore,no_run
11164 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11165 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
11166 /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
11167 /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
11168 /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
11169 /// ```
11170 pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
11171 mut self,
11172 v: T,
11173 ) -> Self {
11174 self.state = v.into();
11175 self
11176 }
11177
11178 /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
11179 ///
11180 /// # Example
11181 /// ```ignore,no_run
11182 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11183 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
11184 /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
11185 /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
11186 /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
11187 /// ```
11188 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
11189 mut self,
11190 v: T,
11191 ) -> Self {
11192 self.database_version = v.into();
11193 self
11194 }
11195
11196 /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
11197 ///
11198 /// # Example
11199 /// ```ignore,no_run
11200 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11201 /// use google_cloud_sql_v1::model::Settings;
11202 /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
11203 /// ```
11204 pub fn set_settings<T>(mut self, v: T) -> Self
11205 where
11206 T: std::convert::Into<crate::model::Settings>,
11207 {
11208 self.settings = std::option::Option::Some(v.into());
11209 self
11210 }
11211
11212 /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
11213 ///
11214 /// # Example
11215 /// ```ignore,no_run
11216 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11217 /// use google_cloud_sql_v1::model::Settings;
11218 /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
11219 /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
11220 /// ```
11221 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
11222 where
11223 T: std::convert::Into<crate::model::Settings>,
11224 {
11225 self.settings = v.map(|x| x.into());
11226 self
11227 }
11228
11229 /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
11230 ///
11231 /// # Example
11232 /// ```ignore,no_run
11233 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11234 /// let x = DatabaseInstance::new().set_etag("example");
11235 /// ```
11236 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11237 self.etag = v.into();
11238 self
11239 }
11240
11241 /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11242 ///
11243 /// # Example
11244 /// ```ignore,no_run
11245 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11246 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11247 /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
11248 /// ```
11249 pub fn set_failover_replica<T>(mut self, v: T) -> Self
11250 where
11251 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11252 {
11253 self.failover_replica = std::option::Option::Some(v.into());
11254 self
11255 }
11256
11257 /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11258 ///
11259 /// # Example
11260 /// ```ignore,no_run
11261 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11262 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11263 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
11264 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
11265 /// ```
11266 pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
11267 where
11268 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11269 {
11270 self.failover_replica = v.map(|x| x.into());
11271 self
11272 }
11273
11274 /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
11275 ///
11276 /// # Example
11277 /// ```ignore,no_run
11278 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11279 /// let x = DatabaseInstance::new().set_master_instance_name("example");
11280 /// ```
11281 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
11282 mut self,
11283 v: T,
11284 ) -> Self {
11285 self.master_instance_name = v.into();
11286 self
11287 }
11288
11289 /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
11290 ///
11291 /// # Example
11292 /// ```ignore,no_run
11293 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11294 /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
11295 /// ```
11296 pub fn set_replica_names<T, V>(mut self, v: T) -> Self
11297 where
11298 T: std::iter::IntoIterator<Item = V>,
11299 V: std::convert::Into<std::string::String>,
11300 {
11301 use std::iter::Iterator;
11302 self.replica_names = v.into_iter().map(|i| i.into()).collect();
11303 self
11304 }
11305
11306 /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11307 ///
11308 /// # Example
11309 /// ```ignore,no_run
11310 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11311 /// use wkt::Int64Value;
11312 /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
11313 /// ```
11314 #[deprecated]
11315 pub fn set_max_disk_size<T>(mut self, v: T) -> Self
11316 where
11317 T: std::convert::Into<wkt::Int64Value>,
11318 {
11319 self.max_disk_size = std::option::Option::Some(v.into());
11320 self
11321 }
11322
11323 /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11324 ///
11325 /// # Example
11326 /// ```ignore,no_run
11327 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11328 /// use wkt::Int64Value;
11329 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
11330 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
11331 /// ```
11332 #[deprecated]
11333 pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11334 where
11335 T: std::convert::Into<wkt::Int64Value>,
11336 {
11337 self.max_disk_size = v.map(|x| x.into());
11338 self
11339 }
11340
11341 /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11342 ///
11343 /// # Example
11344 /// ```ignore,no_run
11345 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11346 /// use wkt::Int64Value;
11347 /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
11348 /// ```
11349 #[deprecated]
11350 pub fn set_current_disk_size<T>(mut self, v: T) -> Self
11351 where
11352 T: std::convert::Into<wkt::Int64Value>,
11353 {
11354 self.current_disk_size = std::option::Option::Some(v.into());
11355 self
11356 }
11357
11358 /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11359 ///
11360 /// # Example
11361 /// ```ignore,no_run
11362 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11363 /// use wkt::Int64Value;
11364 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
11365 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
11366 /// ```
11367 #[deprecated]
11368 pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11369 where
11370 T: std::convert::Into<wkt::Int64Value>,
11371 {
11372 self.current_disk_size = v.map(|x| x.into());
11373 self
11374 }
11375
11376 /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
11377 ///
11378 /// # Example
11379 /// ```ignore,no_run
11380 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11381 /// use google_cloud_sql_v1::model::IpMapping;
11382 /// let x = DatabaseInstance::new()
11383 /// .set_ip_addresses([
11384 /// IpMapping::default()/* use setters */,
11385 /// IpMapping::default()/* use (different) setters */,
11386 /// ]);
11387 /// ```
11388 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
11389 where
11390 T: std::iter::IntoIterator<Item = V>,
11391 V: std::convert::Into<crate::model::IpMapping>,
11392 {
11393 use std::iter::Iterator;
11394 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
11395 self
11396 }
11397
11398 /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11399 ///
11400 /// # Example
11401 /// ```ignore,no_run
11402 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11403 /// use google_cloud_sql_v1::model::SslCert;
11404 /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
11405 /// ```
11406 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
11407 where
11408 T: std::convert::Into<crate::model::SslCert>,
11409 {
11410 self.server_ca_cert = std::option::Option::Some(v.into());
11411 self
11412 }
11413
11414 /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11415 ///
11416 /// # Example
11417 /// ```ignore,no_run
11418 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11419 /// use google_cloud_sql_v1::model::SslCert;
11420 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
11421 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
11422 /// ```
11423 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
11424 where
11425 T: std::convert::Into<crate::model::SslCert>,
11426 {
11427 self.server_ca_cert = v.map(|x| x.into());
11428 self
11429 }
11430
11431 /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
11432 ///
11433 /// # Example
11434 /// ```ignore,no_run
11435 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11436 /// use google_cloud_sql_v1::model::SqlInstanceType;
11437 /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
11438 /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
11439 /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
11440 /// ```
11441 pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
11442 mut self,
11443 v: T,
11444 ) -> Self {
11445 self.instance_type = v.into();
11446 self
11447 }
11448
11449 /// Sets the value of [project][crate::model::DatabaseInstance::project].
11450 ///
11451 /// # Example
11452 /// ```ignore,no_run
11453 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11454 /// let x = DatabaseInstance::new().set_project("example");
11455 /// ```
11456 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11457 self.project = v.into();
11458 self
11459 }
11460
11461 /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
11462 ///
11463 /// # Example
11464 /// ```ignore,no_run
11465 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11466 /// let x = DatabaseInstance::new().set_ipv6_address("example");
11467 /// ```
11468 #[deprecated]
11469 pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11470 self.ipv6_address = v.into();
11471 self
11472 }
11473
11474 /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
11475 ///
11476 /// # Example
11477 /// ```ignore,no_run
11478 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11479 /// let x = DatabaseInstance::new().set_service_account_email_address("example");
11480 /// ```
11481 pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
11482 mut self,
11483 v: T,
11484 ) -> Self {
11485 self.service_account_email_address = v.into();
11486 self
11487 }
11488
11489 /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11490 ///
11491 /// # Example
11492 /// ```ignore,no_run
11493 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11494 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11495 /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
11496 /// ```
11497 pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
11498 where
11499 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11500 {
11501 self.on_premises_configuration = std::option::Option::Some(v.into());
11502 self
11503 }
11504
11505 /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11506 ///
11507 /// # Example
11508 /// ```ignore,no_run
11509 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11510 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11511 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
11512 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
11513 /// ```
11514 pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11515 where
11516 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11517 {
11518 self.on_premises_configuration = v.map(|x| x.into());
11519 self
11520 }
11521
11522 /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11523 ///
11524 /// # Example
11525 /// ```ignore,no_run
11526 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11527 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11528 /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
11529 /// ```
11530 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
11531 where
11532 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11533 {
11534 self.replica_configuration = std::option::Option::Some(v.into());
11535 self
11536 }
11537
11538 /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11539 ///
11540 /// # Example
11541 /// ```ignore,no_run
11542 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11543 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11544 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
11545 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
11546 /// ```
11547 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11548 where
11549 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11550 {
11551 self.replica_configuration = v.map(|x| x.into());
11552 self
11553 }
11554
11555 /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
11556 ///
11557 /// # Example
11558 /// ```ignore,no_run
11559 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11560 /// use google_cloud_sql_v1::model::SqlBackendType;
11561 /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
11562 /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
11563 /// ```
11564 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
11565 mut self,
11566 v: T,
11567 ) -> Self {
11568 self.backend_type = v.into();
11569 self
11570 }
11571
11572 /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
11573 ///
11574 /// # Example
11575 /// ```ignore,no_run
11576 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11577 /// let x = DatabaseInstance::new().set_self_link("example");
11578 /// ```
11579 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11580 self.self_link = v.into();
11581 self
11582 }
11583
11584 /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
11585 ///
11586 /// # Example
11587 /// ```ignore,no_run
11588 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11589 /// use google_cloud_sql_v1::model::SqlSuspensionReason;
11590 /// let x = DatabaseInstance::new().set_suspension_reason([
11591 /// SqlSuspensionReason::BillingIssue,
11592 /// SqlSuspensionReason::LegalIssue,
11593 /// SqlSuspensionReason::OperationalIssue,
11594 /// ]);
11595 /// ```
11596 pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
11597 where
11598 T: std::iter::IntoIterator<Item = V>,
11599 V: std::convert::Into<crate::model::SqlSuspensionReason>,
11600 {
11601 use std::iter::Iterator;
11602 self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
11603 self
11604 }
11605
11606 /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
11607 ///
11608 /// # Example
11609 /// ```ignore,no_run
11610 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11611 /// let x = DatabaseInstance::new().set_connection_name("example");
11612 /// ```
11613 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11614 self.connection_name = v.into();
11615 self
11616 }
11617
11618 /// Sets the value of [name][crate::model::DatabaseInstance::name].
11619 ///
11620 /// # Example
11621 /// ```ignore,no_run
11622 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11623 /// let x = DatabaseInstance::new().set_name("example");
11624 /// ```
11625 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11626 self.name = v.into();
11627 self
11628 }
11629
11630 /// Sets the value of [region][crate::model::DatabaseInstance::region].
11631 ///
11632 /// # Example
11633 /// ```ignore,no_run
11634 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11635 /// let x = DatabaseInstance::new().set_region("example");
11636 /// ```
11637 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11638 self.region = v.into();
11639 self
11640 }
11641
11642 /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
11643 ///
11644 /// # Example
11645 /// ```ignore,no_run
11646 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11647 /// let x = DatabaseInstance::new().set_gce_zone("example");
11648 /// ```
11649 pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11650 self.gce_zone = v.into();
11651 self
11652 }
11653
11654 /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
11655 ///
11656 /// # Example
11657 /// ```ignore,no_run
11658 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11659 /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
11660 /// ```
11661 pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
11662 mut self,
11663 v: T,
11664 ) -> Self {
11665 self.secondary_gce_zone = v.into();
11666 self
11667 }
11668
11669 /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11670 ///
11671 /// # Example
11672 /// ```ignore,no_run
11673 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11674 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11675 /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
11676 /// ```
11677 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
11678 where
11679 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11680 {
11681 self.disk_encryption_configuration = std::option::Option::Some(v.into());
11682 self
11683 }
11684
11685 /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11686 ///
11687 /// # Example
11688 /// ```ignore,no_run
11689 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11690 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11691 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
11692 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
11693 /// ```
11694 pub fn set_or_clear_disk_encryption_configuration<T>(
11695 mut self,
11696 v: std::option::Option<T>,
11697 ) -> Self
11698 where
11699 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11700 {
11701 self.disk_encryption_configuration = v.map(|x| x.into());
11702 self
11703 }
11704
11705 /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11706 ///
11707 /// # Example
11708 /// ```ignore,no_run
11709 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11710 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11711 /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
11712 /// ```
11713 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
11714 where
11715 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11716 {
11717 self.disk_encryption_status = std::option::Option::Some(v.into());
11718 self
11719 }
11720
11721 /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11722 ///
11723 /// # Example
11724 /// ```ignore,no_run
11725 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11726 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11727 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
11728 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
11729 /// ```
11730 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
11731 where
11732 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11733 {
11734 self.disk_encryption_status = v.map(|x| x.into());
11735 self
11736 }
11737
11738 /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
11739 ///
11740 /// # Example
11741 /// ```ignore,no_run
11742 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11743 /// let x = DatabaseInstance::new().set_root_password("example");
11744 /// ```
11745 pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11746 self.root_password = v.into();
11747 self
11748 }
11749
11750 /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11751 ///
11752 /// # Example
11753 /// ```ignore,no_run
11754 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11755 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11756 /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
11757 /// ```
11758 pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
11759 where
11760 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11761 {
11762 self.scheduled_maintenance = std::option::Option::Some(v.into());
11763 self
11764 }
11765
11766 /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11767 ///
11768 /// # Example
11769 /// ```ignore,no_run
11770 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11771 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11772 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
11773 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
11774 /// ```
11775 pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
11776 where
11777 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11778 {
11779 self.scheduled_maintenance = v.map(|x| x.into());
11780 self
11781 }
11782
11783 /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11784 ///
11785 /// # Example
11786 /// ```ignore,no_run
11787 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11788 /// use wkt::BoolValue;
11789 /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
11790 /// ```
11791 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11792 where
11793 T: std::convert::Into<wkt::BoolValue>,
11794 {
11795 self.satisfies_pzs = std::option::Option::Some(v.into());
11796 self
11797 }
11798
11799 /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11800 ///
11801 /// # Example
11802 /// ```ignore,no_run
11803 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11804 /// use wkt::BoolValue;
11805 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
11806 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
11807 /// ```
11808 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11809 where
11810 T: std::convert::Into<wkt::BoolValue>,
11811 {
11812 self.satisfies_pzs = v.map(|x| x.into());
11813 self
11814 }
11815
11816 /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
11817 ///
11818 /// # Example
11819 /// ```ignore,no_run
11820 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11821 /// let x = DatabaseInstance::new().set_database_installed_version("example");
11822 /// ```
11823 pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
11824 mut self,
11825 v: T,
11826 ) -> Self {
11827 self.database_installed_version = v.into();
11828 self
11829 }
11830
11831 /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11832 ///
11833 /// # Example
11834 /// ```ignore,no_run
11835 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11836 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11837 /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
11838 /// ```
11839 pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
11840 where
11841 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11842 {
11843 self.out_of_disk_report = std::option::Option::Some(v.into());
11844 self
11845 }
11846
11847 /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11848 ///
11849 /// # Example
11850 /// ```ignore,no_run
11851 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11852 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11853 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
11854 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
11855 /// ```
11856 pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
11857 where
11858 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11859 {
11860 self.out_of_disk_report = v.map(|x| x.into());
11861 self
11862 }
11863
11864 /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
11865 ///
11866 /// # Example
11867 /// ```ignore,no_run
11868 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11869 /// use wkt::Timestamp;
11870 /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
11871 /// ```
11872 pub fn set_create_time<T>(mut self, v: T) -> Self
11873 where
11874 T: std::convert::Into<wkt::Timestamp>,
11875 {
11876 self.create_time = std::option::Option::Some(v.into());
11877 self
11878 }
11879
11880 /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
11881 ///
11882 /// # Example
11883 /// ```ignore,no_run
11884 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11885 /// use wkt::Timestamp;
11886 /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11887 /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
11888 /// ```
11889 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11890 where
11891 T: std::convert::Into<wkt::Timestamp>,
11892 {
11893 self.create_time = v.map(|x| x.into());
11894 self
11895 }
11896
11897 /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
11898 ///
11899 /// # Example
11900 /// ```ignore,no_run
11901 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11902 /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
11903 /// ```
11904 pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
11905 where
11906 T: std::iter::IntoIterator<Item = V>,
11907 V: std::convert::Into<std::string::String>,
11908 {
11909 use std::iter::Iterator;
11910 self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
11911 self
11912 }
11913
11914 /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
11915 ///
11916 /// # Example
11917 /// ```ignore,no_run
11918 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11919 /// let x = DatabaseInstance::new().set_maintenance_version("example");
11920 /// ```
11921 pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
11922 mut self,
11923 v: T,
11924 ) -> Self {
11925 self.maintenance_version = v.into();
11926 self
11927 }
11928
11929 /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
11930 ///
11931 /// # Example
11932 /// ```ignore,no_run
11933 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11934 /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
11935 /// let x = DatabaseInstance::new()
11936 /// .set_upgradable_database_versions([
11937 /// AvailableDatabaseVersion::default()/* use setters */,
11938 /// AvailableDatabaseVersion::default()/* use (different) setters */,
11939 /// ]);
11940 /// ```
11941 pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
11942 where
11943 T: std::iter::IntoIterator<Item = V>,
11944 V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
11945 {
11946 use std::iter::Iterator;
11947 self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
11948 self
11949 }
11950
11951 /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11952 ///
11953 /// # Example
11954 /// ```ignore,no_run
11955 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11956 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11957 /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
11958 /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
11959 /// ```
11960 pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
11961 where
11962 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11963 {
11964 self.sql_network_architecture = std::option::Option::Some(v.into());
11965 self
11966 }
11967
11968 /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11969 ///
11970 /// # Example
11971 /// ```ignore,no_run
11972 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11973 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11974 /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
11975 /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
11976 /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
11977 /// ```
11978 pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
11979 where
11980 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11981 {
11982 self.sql_network_architecture = v.map(|x| x.into());
11983 self
11984 }
11985
11986 /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11987 ///
11988 /// # Example
11989 /// ```ignore,no_run
11990 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11991 /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
11992 /// ```
11993 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
11994 where
11995 T: std::convert::Into<std::string::String>,
11996 {
11997 self.psc_service_attachment_link = std::option::Option::Some(v.into());
11998 self
11999 }
12000
12001 /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
12002 ///
12003 /// # Example
12004 /// ```ignore,no_run
12005 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12006 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
12007 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
12008 /// ```
12009 pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
12010 where
12011 T: std::convert::Into<std::string::String>,
12012 {
12013 self.psc_service_attachment_link = v.map(|x| x.into());
12014 self
12015 }
12016
12017 /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
12018 ///
12019 /// # Example
12020 /// ```ignore,no_run
12021 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12022 /// let x = DatabaseInstance::new().set_dns_name("example");
12023 /// ```
12024 pub fn set_dns_name<T>(mut self, v: T) -> Self
12025 where
12026 T: std::convert::Into<std::string::String>,
12027 {
12028 self.dns_name = std::option::Option::Some(v.into());
12029 self
12030 }
12031
12032 /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
12033 ///
12034 /// # Example
12035 /// ```ignore,no_run
12036 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12037 /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
12038 /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
12039 /// ```
12040 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12041 where
12042 T: std::convert::Into<std::string::String>,
12043 {
12044 self.dns_name = v.map(|x| x.into());
12045 self
12046 }
12047
12048 /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
12049 ///
12050 /// # Example
12051 /// ```ignore,no_run
12052 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12053 /// let x = DatabaseInstance::new().set_primary_dns_name("example");
12054 /// ```
12055 #[deprecated]
12056 pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
12057 where
12058 T: std::convert::Into<std::string::String>,
12059 {
12060 self.primary_dns_name = std::option::Option::Some(v.into());
12061 self
12062 }
12063
12064 /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
12065 ///
12066 /// # Example
12067 /// ```ignore,no_run
12068 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12069 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
12070 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
12071 /// ```
12072 #[deprecated]
12073 pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12074 where
12075 T: std::convert::Into<std::string::String>,
12076 {
12077 self.primary_dns_name = v.map(|x| x.into());
12078 self
12079 }
12080
12081 /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
12082 ///
12083 /// # Example
12084 /// ```ignore,no_run
12085 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12086 /// let x = DatabaseInstance::new().set_write_endpoint("example");
12087 /// ```
12088 pub fn set_write_endpoint<T>(mut self, v: T) -> Self
12089 where
12090 T: std::convert::Into<std::string::String>,
12091 {
12092 self.write_endpoint = std::option::Option::Some(v.into());
12093 self
12094 }
12095
12096 /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
12097 ///
12098 /// # Example
12099 /// ```ignore,no_run
12100 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12101 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
12102 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
12103 /// ```
12104 pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
12105 where
12106 T: std::convert::Into<std::string::String>,
12107 {
12108 self.write_endpoint = v.map(|x| x.into());
12109 self
12110 }
12111
12112 /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
12113 ///
12114 /// # Example
12115 /// ```ignore,no_run
12116 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12117 /// use google_cloud_sql_v1::model::ReplicationCluster;
12118 /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
12119 /// ```
12120 pub fn set_replication_cluster<T>(mut self, v: T) -> Self
12121 where
12122 T: std::convert::Into<crate::model::ReplicationCluster>,
12123 {
12124 self.replication_cluster = std::option::Option::Some(v.into());
12125 self
12126 }
12127
12128 /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
12129 ///
12130 /// # Example
12131 /// ```ignore,no_run
12132 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12133 /// use google_cloud_sql_v1::model::ReplicationCluster;
12134 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
12135 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
12136 /// ```
12137 pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
12138 where
12139 T: std::convert::Into<crate::model::ReplicationCluster>,
12140 {
12141 self.replication_cluster = v.map(|x| x.into());
12142 self
12143 }
12144
12145 /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12146 ///
12147 /// # Example
12148 /// ```ignore,no_run
12149 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12150 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12151 /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
12152 /// ```
12153 pub fn set_gemini_config<T>(mut self, v: T) -> Self
12154 where
12155 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12156 {
12157 self.gemini_config = std::option::Option::Some(v.into());
12158 self
12159 }
12160
12161 /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12162 ///
12163 /// # Example
12164 /// ```ignore,no_run
12165 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12166 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12167 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
12168 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
12169 /// ```
12170 pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
12171 where
12172 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12173 {
12174 self.gemini_config = v.map(|x| x.into());
12175 self
12176 }
12177
12178 /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12179 ///
12180 /// # Example
12181 /// ```ignore,no_run
12182 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12183 /// use wkt::BoolValue;
12184 /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
12185 /// ```
12186 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
12187 where
12188 T: std::convert::Into<wkt::BoolValue>,
12189 {
12190 self.satisfies_pzi = std::option::Option::Some(v.into());
12191 self
12192 }
12193
12194 /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12195 ///
12196 /// # Example
12197 /// ```ignore,no_run
12198 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12199 /// use wkt::BoolValue;
12200 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
12201 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
12202 /// ```
12203 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
12204 where
12205 T: std::convert::Into<wkt::BoolValue>,
12206 {
12207 self.satisfies_pzi = v.map(|x| x.into());
12208 self
12209 }
12210
12211 /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12212 ///
12213 /// # Example
12214 /// ```ignore,no_run
12215 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12216 /// use wkt::BoolValue;
12217 /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
12218 /// ```
12219 pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
12220 where
12221 T: std::convert::Into<wkt::BoolValue>,
12222 {
12223 self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
12224 self
12225 }
12226
12227 /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12228 ///
12229 /// # Example
12230 /// ```ignore,no_run
12231 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12232 /// use wkt::BoolValue;
12233 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
12234 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
12235 /// ```
12236 pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
12237 mut self,
12238 v: std::option::Option<T>,
12239 ) -> Self
12240 where
12241 T: std::convert::Into<wkt::BoolValue>,
12242 {
12243 self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
12244 self
12245 }
12246
12247 /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12248 ///
12249 /// # Example
12250 /// ```ignore,no_run
12251 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12252 /// use wkt::BoolValue;
12253 /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
12254 /// ```
12255 pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
12256 where
12257 T: std::convert::Into<wkt::BoolValue>,
12258 {
12259 self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
12260 self
12261 }
12262
12263 /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12264 ///
12265 /// # Example
12266 /// ```ignore,no_run
12267 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12268 /// use wkt::BoolValue;
12269 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
12270 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
12271 /// ```
12272 pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
12273 mut self,
12274 v: std::option::Option<T>,
12275 ) -> Self
12276 where
12277 T: std::convert::Into<wkt::BoolValue>,
12278 {
12279 self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
12280 self
12281 }
12282
12283 /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
12284 ///
12285 /// # Example
12286 /// ```ignore,no_run
12287 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12288 /// let x = DatabaseInstance::new().set_tags([
12289 /// ("key0", "abc"),
12290 /// ("key1", "xyz"),
12291 /// ]);
12292 /// ```
12293 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
12294 where
12295 T: std::iter::IntoIterator<Item = (K, V)>,
12296 K: std::convert::Into<std::string::String>,
12297 V: std::convert::Into<std::string::String>,
12298 {
12299 use std::iter::Iterator;
12300 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12301 self
12302 }
12303
12304 /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
12305 ///
12306 /// # Example
12307 /// ```ignore,no_run
12308 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12309 /// let x = DatabaseInstance::new().set_node_count(42);
12310 /// ```
12311 pub fn set_node_count<T>(mut self, v: T) -> Self
12312 where
12313 T: std::convert::Into<i32>,
12314 {
12315 self.node_count = std::option::Option::Some(v.into());
12316 self
12317 }
12318
12319 /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
12320 ///
12321 /// # Example
12322 /// ```ignore,no_run
12323 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12324 /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
12325 /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
12326 /// ```
12327 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
12328 where
12329 T: std::convert::Into<i32>,
12330 {
12331 self.node_count = v.map(|x| x.into());
12332 self
12333 }
12334
12335 /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
12336 ///
12337 /// # Example
12338 /// ```ignore,no_run
12339 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12340 /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12341 /// let x = DatabaseInstance::new()
12342 /// .set_nodes([
12343 /// PoolNodeConfig::default()/* use setters */,
12344 /// PoolNodeConfig::default()/* use (different) setters */,
12345 /// ]);
12346 /// ```
12347 pub fn set_nodes<T, V>(mut self, v: T) -> Self
12348 where
12349 T: std::iter::IntoIterator<Item = V>,
12350 V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
12351 {
12352 use std::iter::Iterator;
12353 self.nodes = v.into_iter().map(|i| i.into()).collect();
12354 self
12355 }
12356
12357 /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
12358 ///
12359 /// # Example
12360 /// ```ignore,no_run
12361 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12362 /// use google_cloud_sql_v1::model::DnsNameMapping;
12363 /// let x = DatabaseInstance::new()
12364 /// .set_dns_names([
12365 /// DnsNameMapping::default()/* use setters */,
12366 /// DnsNameMapping::default()/* use (different) setters */,
12367 /// ]);
12368 /// ```
12369 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12370 where
12371 T: std::iter::IntoIterator<Item = V>,
12372 V: std::convert::Into<crate::model::DnsNameMapping>,
12373 {
12374 use std::iter::Iterator;
12375 self.dns_names = v.into_iter().map(|i| i.into()).collect();
12376 self
12377 }
12378
12379 /// Sets the value of [database_center_integration_enabled][crate::model::DatabaseInstance::database_center_integration_enabled].
12380 ///
12381 /// # Example
12382 /// ```ignore,no_run
12383 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12384 /// use wkt::BoolValue;
12385 /// let x = DatabaseInstance::new().set_database_center_integration_enabled(BoolValue::default()/* use setters */);
12386 /// ```
12387 pub fn set_database_center_integration_enabled<T>(mut self, v: T) -> Self
12388 where
12389 T: std::convert::Into<wkt::BoolValue>,
12390 {
12391 self.database_center_integration_enabled = std::option::Option::Some(v.into());
12392 self
12393 }
12394
12395 /// Sets or clears the value of [database_center_integration_enabled][crate::model::DatabaseInstance::database_center_integration_enabled].
12396 ///
12397 /// # Example
12398 /// ```ignore,no_run
12399 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12400 /// use wkt::BoolValue;
12401 /// let x = DatabaseInstance::new().set_or_clear_database_center_integration_enabled(Some(BoolValue::default()/* use setters */));
12402 /// let x = DatabaseInstance::new().set_or_clear_database_center_integration_enabled(None::<BoolValue>);
12403 /// ```
12404 pub fn set_or_clear_database_center_integration_enabled<T>(
12405 mut self,
12406 v: std::option::Option<T>,
12407 ) -> Self
12408 where
12409 T: std::convert::Into<wkt::BoolValue>,
12410 {
12411 self.database_center_integration_enabled = v.map(|x| x.into());
12412 self
12413 }
12414}
12415
12416impl wkt::message::Message for DatabaseInstance {
12417 fn typename() -> &'static str {
12418 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
12419 }
12420}
12421
12422/// Defines additional types related to [DatabaseInstance].
12423pub mod database_instance {
12424 #[allow(unused_imports)]
12425 use super::*;
12426
12427 #[allow(missing_docs)]
12428 #[derive(Clone, Default, PartialEq)]
12429 #[non_exhaustive]
12430 pub struct SqlFailoverReplica {
12431 /// The name of the failover replica. If specified at instance creation, a
12432 /// failover replica is created for the instance. The name
12433 /// doesn't include the project ID.
12434 pub name: std::string::String,
12435
12436 /// The availability status of the failover replica. A false status indicates
12437 /// that the failover replica is out of sync. The primary instance can only
12438 /// failover to the failover replica when the status is true.
12439 pub available: std::option::Option<wkt::BoolValue>,
12440
12441 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12442 }
12443
12444 impl SqlFailoverReplica {
12445 /// Creates a new default instance.
12446 pub fn new() -> Self {
12447 std::default::Default::default()
12448 }
12449
12450 /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
12451 ///
12452 /// # Example
12453 /// ```ignore,no_run
12454 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12455 /// let x = SqlFailoverReplica::new().set_name("example");
12456 /// ```
12457 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12458 self.name = v.into();
12459 self
12460 }
12461
12462 /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12463 ///
12464 /// # Example
12465 /// ```ignore,no_run
12466 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12467 /// use wkt::BoolValue;
12468 /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
12469 /// ```
12470 pub fn set_available<T>(mut self, v: T) -> Self
12471 where
12472 T: std::convert::Into<wkt::BoolValue>,
12473 {
12474 self.available = std::option::Option::Some(v.into());
12475 self
12476 }
12477
12478 /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12479 ///
12480 /// # Example
12481 /// ```ignore,no_run
12482 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12483 /// use wkt::BoolValue;
12484 /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
12485 /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
12486 /// ```
12487 pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
12488 where
12489 T: std::convert::Into<wkt::BoolValue>,
12490 {
12491 self.available = v.map(|x| x.into());
12492 self
12493 }
12494 }
12495
12496 impl wkt::message::Message for SqlFailoverReplica {
12497 fn typename() -> &'static str {
12498 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
12499 }
12500 }
12501
12502 /// Any scheduled maintenance for this instance.
12503 #[derive(Clone, Default, PartialEq)]
12504 #[non_exhaustive]
12505 pub struct SqlScheduledMaintenance {
12506 /// The start time of any upcoming scheduled maintenance for this instance.
12507 pub start_time: std::option::Option<wkt::Timestamp>,
12508
12509 #[allow(missing_docs)]
12510 #[deprecated]
12511 pub can_defer: bool,
12512
12513 /// If the scheduled maintenance can be rescheduled.
12514 pub can_reschedule: bool,
12515
12516 /// Maintenance cannot be rescheduled to start beyond this deadline.
12517 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
12518
12519 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12520 }
12521
12522 impl SqlScheduledMaintenance {
12523 /// Creates a new default instance.
12524 pub fn new() -> Self {
12525 std::default::Default::default()
12526 }
12527
12528 /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12529 ///
12530 /// # Example
12531 /// ```ignore,no_run
12532 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12533 /// use wkt::Timestamp;
12534 /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
12535 /// ```
12536 pub fn set_start_time<T>(mut self, v: T) -> Self
12537 where
12538 T: std::convert::Into<wkt::Timestamp>,
12539 {
12540 self.start_time = std::option::Option::Some(v.into());
12541 self
12542 }
12543
12544 /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12545 ///
12546 /// # Example
12547 /// ```ignore,no_run
12548 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12549 /// use wkt::Timestamp;
12550 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12551 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
12552 /// ```
12553 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12554 where
12555 T: std::convert::Into<wkt::Timestamp>,
12556 {
12557 self.start_time = v.map(|x| x.into());
12558 self
12559 }
12560
12561 /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
12562 ///
12563 /// # Example
12564 /// ```ignore,no_run
12565 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12566 /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
12567 /// ```
12568 #[deprecated]
12569 pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12570 self.can_defer = v.into();
12571 self
12572 }
12573
12574 /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
12575 ///
12576 /// # Example
12577 /// ```ignore,no_run
12578 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12579 /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
12580 /// ```
12581 pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12582 self.can_reschedule = v.into();
12583 self
12584 }
12585
12586 /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12587 ///
12588 /// # Example
12589 /// ```ignore,no_run
12590 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12591 /// use wkt::Timestamp;
12592 /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
12593 /// ```
12594 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
12595 where
12596 T: std::convert::Into<wkt::Timestamp>,
12597 {
12598 self.schedule_deadline_time = std::option::Option::Some(v.into());
12599 self
12600 }
12601
12602 /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12603 ///
12604 /// # Example
12605 /// ```ignore,no_run
12606 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12607 /// use wkt::Timestamp;
12608 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
12609 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
12610 /// ```
12611 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
12612 where
12613 T: std::convert::Into<wkt::Timestamp>,
12614 {
12615 self.schedule_deadline_time = v.map(|x| x.into());
12616 self
12617 }
12618 }
12619
12620 impl wkt::message::Message for SqlScheduledMaintenance {
12621 fn typename() -> &'static str {
12622 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
12623 }
12624 }
12625
12626 /// This message wraps up the information written by out-of-disk detection job.
12627 #[derive(Clone, Default, PartialEq)]
12628 #[non_exhaustive]
12629 pub struct SqlOutOfDiskReport {
12630 /// This field represents the state generated by the proactive database
12631 /// wellness job for OutOfDisk issues.
12632 ///
12633 /// * Writers:
12634 /// * the proactive database wellness job for OOD.
12635 /// * Readers:
12636 /// * the proactive database wellness job
12637 pub sql_out_of_disk_state: std::option::Option<
12638 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12639 >,
12640
12641 /// The minimum recommended increase size in GigaBytes
12642 /// This field is consumed by the frontend
12643 ///
12644 /// * Writers:
12645 /// * the proactive database wellness job for OOD.
12646 /// * Readers:
12647 pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
12648
12649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12650 }
12651
12652 impl SqlOutOfDiskReport {
12653 /// Creates a new default instance.
12654 pub fn new() -> Self {
12655 std::default::Default::default()
12656 }
12657
12658 /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12659 ///
12660 /// # Example
12661 /// ```ignore,no_run
12662 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12663 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12664 /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
12665 /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
12666 /// ```
12667 pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
12668 where
12669 T: std::convert::Into<
12670 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12671 >,
12672 {
12673 self.sql_out_of_disk_state = std::option::Option::Some(v.into());
12674 self
12675 }
12676
12677 /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12678 ///
12679 /// # Example
12680 /// ```ignore,no_run
12681 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12682 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12683 /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
12684 /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
12685 /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
12686 /// ```
12687 pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
12688 where
12689 T: std::convert::Into<
12690 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12691 >,
12692 {
12693 self.sql_out_of_disk_state = v.map(|x| x.into());
12694 self
12695 }
12696
12697 /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12698 ///
12699 /// # Example
12700 /// ```ignore,no_run
12701 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12702 /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
12703 /// ```
12704 pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
12705 where
12706 T: std::convert::Into<i32>,
12707 {
12708 self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
12709 self
12710 }
12711
12712 /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12713 ///
12714 /// # Example
12715 /// ```ignore,no_run
12716 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12717 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
12718 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
12719 /// ```
12720 pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
12721 mut self,
12722 v: std::option::Option<T>,
12723 ) -> Self
12724 where
12725 T: std::convert::Into<i32>,
12726 {
12727 self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
12728 self
12729 }
12730 }
12731
12732 impl wkt::message::Message for SqlOutOfDiskReport {
12733 fn typename() -> &'static str {
12734 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
12735 }
12736 }
12737
12738 /// Defines additional types related to [SqlOutOfDiskReport].
12739 pub mod sql_out_of_disk_report {
12740 #[allow(unused_imports)]
12741 use super::*;
12742
12743 /// This enum lists all possible states regarding out-of-disk issues.
12744 ///
12745 /// # Working with unknown values
12746 ///
12747 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12748 /// additional enum variants at any time. Adding new variants is not considered
12749 /// a breaking change. Applications should write their code in anticipation of:
12750 ///
12751 /// - New values appearing in future releases of the client library, **and**
12752 /// - New values received dynamically, without application changes.
12753 ///
12754 /// Please consult the [Working with enums] section in the user guide for some
12755 /// guidelines.
12756 ///
12757 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12758 #[derive(Clone, Debug, PartialEq)]
12759 #[non_exhaustive]
12760 pub enum SqlOutOfDiskState {
12761 /// Unspecified state
12762 Unspecified,
12763 /// The instance has plenty space on data disk
12764 Normal,
12765 /// Data disk is almost used up. It is shutdown to prevent data
12766 /// corruption.
12767 SoftShutdown,
12768 /// If set, the enum was initialized with an unknown value.
12769 ///
12770 /// Applications can examine the value using [SqlOutOfDiskState::value] or
12771 /// [SqlOutOfDiskState::name].
12772 UnknownValue(sql_out_of_disk_state::UnknownValue),
12773 }
12774
12775 #[doc(hidden)]
12776 pub mod sql_out_of_disk_state {
12777 #[allow(unused_imports)]
12778 use super::*;
12779 #[derive(Clone, Debug, PartialEq)]
12780 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12781 }
12782
12783 impl SqlOutOfDiskState {
12784 /// Gets the enum value.
12785 ///
12786 /// Returns `None` if the enum contains an unknown value deserialized from
12787 /// the string representation of enums.
12788 pub fn value(&self) -> std::option::Option<i32> {
12789 match self {
12790 Self::Unspecified => std::option::Option::Some(0),
12791 Self::Normal => std::option::Option::Some(1),
12792 Self::SoftShutdown => std::option::Option::Some(2),
12793 Self::UnknownValue(u) => u.0.value(),
12794 }
12795 }
12796
12797 /// Gets the enum value as a string.
12798 ///
12799 /// Returns `None` if the enum contains an unknown value deserialized from
12800 /// the integer representation of enums.
12801 pub fn name(&self) -> std::option::Option<&str> {
12802 match self {
12803 Self::Unspecified => {
12804 std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
12805 }
12806 Self::Normal => std::option::Option::Some("NORMAL"),
12807 Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
12808 Self::UnknownValue(u) => u.0.name(),
12809 }
12810 }
12811 }
12812
12813 impl std::default::Default for SqlOutOfDiskState {
12814 fn default() -> Self {
12815 use std::convert::From;
12816 Self::from(0)
12817 }
12818 }
12819
12820 impl std::fmt::Display for SqlOutOfDiskState {
12821 fn fmt(
12822 &self,
12823 f: &mut std::fmt::Formatter<'_>,
12824 ) -> std::result::Result<(), std::fmt::Error> {
12825 wkt::internal::display_enum(f, self.name(), self.value())
12826 }
12827 }
12828
12829 impl std::convert::From<i32> for SqlOutOfDiskState {
12830 fn from(value: i32) -> Self {
12831 match value {
12832 0 => Self::Unspecified,
12833 1 => Self::Normal,
12834 2 => Self::SoftShutdown,
12835 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12836 wkt::internal::UnknownEnumValue::Integer(value),
12837 )),
12838 }
12839 }
12840 }
12841
12842 impl std::convert::From<&str> for SqlOutOfDiskState {
12843 fn from(value: &str) -> Self {
12844 use std::string::ToString;
12845 match value {
12846 "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
12847 "NORMAL" => Self::Normal,
12848 "SOFT_SHUTDOWN" => Self::SoftShutdown,
12849 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12850 wkt::internal::UnknownEnumValue::String(value.to_string()),
12851 )),
12852 }
12853 }
12854 }
12855
12856 impl serde::ser::Serialize for SqlOutOfDiskState {
12857 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12858 where
12859 S: serde::Serializer,
12860 {
12861 match self {
12862 Self::Unspecified => serializer.serialize_i32(0),
12863 Self::Normal => serializer.serialize_i32(1),
12864 Self::SoftShutdown => serializer.serialize_i32(2),
12865 Self::UnknownValue(u) => u.0.serialize(serializer),
12866 }
12867 }
12868 }
12869
12870 impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
12871 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12872 where
12873 D: serde::Deserializer<'de>,
12874 {
12875 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
12876 ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
12877 ))
12878 }
12879 }
12880 }
12881
12882 /// Details of a single read pool node of a read pool.
12883 #[derive(Clone, Default, PartialEq)]
12884 #[non_exhaustive]
12885 pub struct PoolNodeConfig {
12886 /// Output only. The name of the read pool node, to be used for retrieving
12887 /// metrics and logs.
12888 pub name: std::option::Option<std::string::String>,
12889
12890 /// Output only. The zone of the read pool node.
12891 pub gce_zone: std::option::Option<std::string::String>,
12892
12893 /// Output only. Mappings containing IP addresses that can be used to connect
12894 /// to the read pool node.
12895 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
12896
12897 /// Output only. The DNS name of the read pool node.
12898 pub dns_name: std::option::Option<std::string::String>,
12899
12900 /// Output only. The current state of the read pool node.
12901 pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
12902
12903 /// Output only. The list of DNS names used by this read pool node.
12904 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
12905
12906 /// Output only. The Private Service Connect (PSC) service attachment of the
12907 /// read pool node.
12908 pub psc_service_attachment_link: std::option::Option<std::string::String>,
12909
12910 /// Output only. The list of settings for requested automatically-setup
12911 /// Private Service Connect (PSC) consumer endpoints that can be used to
12912 /// connect to this read pool node.
12913 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
12914
12915 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12916 }
12917
12918 impl PoolNodeConfig {
12919 /// Creates a new default instance.
12920 pub fn new() -> Self {
12921 std::default::Default::default()
12922 }
12923
12924 /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12925 ///
12926 /// # Example
12927 /// ```ignore,no_run
12928 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12929 /// let x = PoolNodeConfig::new().set_name("example");
12930 /// ```
12931 pub fn set_name<T>(mut self, v: T) -> Self
12932 where
12933 T: std::convert::Into<std::string::String>,
12934 {
12935 self.name = std::option::Option::Some(v.into());
12936 self
12937 }
12938
12939 /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12940 ///
12941 /// # Example
12942 /// ```ignore,no_run
12943 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12944 /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
12945 /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
12946 /// ```
12947 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
12948 where
12949 T: std::convert::Into<std::string::String>,
12950 {
12951 self.name = v.map(|x| x.into());
12952 self
12953 }
12954
12955 /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12956 ///
12957 /// # Example
12958 /// ```ignore,no_run
12959 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12960 /// let x = PoolNodeConfig::new().set_gce_zone("example");
12961 /// ```
12962 pub fn set_gce_zone<T>(mut self, v: T) -> Self
12963 where
12964 T: std::convert::Into<std::string::String>,
12965 {
12966 self.gce_zone = std::option::Option::Some(v.into());
12967 self
12968 }
12969
12970 /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12971 ///
12972 /// # Example
12973 /// ```ignore,no_run
12974 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12975 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
12976 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
12977 /// ```
12978 pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
12979 where
12980 T: std::convert::Into<std::string::String>,
12981 {
12982 self.gce_zone = v.map(|x| x.into());
12983 self
12984 }
12985
12986 /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
12987 ///
12988 /// # Example
12989 /// ```ignore,no_run
12990 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12991 /// use google_cloud_sql_v1::model::IpMapping;
12992 /// let x = PoolNodeConfig::new()
12993 /// .set_ip_addresses([
12994 /// IpMapping::default()/* use setters */,
12995 /// IpMapping::default()/* use (different) setters */,
12996 /// ]);
12997 /// ```
12998 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12999 where
13000 T: std::iter::IntoIterator<Item = V>,
13001 V: std::convert::Into<crate::model::IpMapping>,
13002 {
13003 use std::iter::Iterator;
13004 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
13005 self
13006 }
13007
13008 /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
13009 ///
13010 /// # Example
13011 /// ```ignore,no_run
13012 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13013 /// let x = PoolNodeConfig::new().set_dns_name("example");
13014 /// ```
13015 pub fn set_dns_name<T>(mut self, v: T) -> Self
13016 where
13017 T: std::convert::Into<std::string::String>,
13018 {
13019 self.dns_name = std::option::Option::Some(v.into());
13020 self
13021 }
13022
13023 /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
13024 ///
13025 /// # Example
13026 /// ```ignore,no_run
13027 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13028 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
13029 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
13030 /// ```
13031 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
13032 where
13033 T: std::convert::Into<std::string::String>,
13034 {
13035 self.dns_name = v.map(|x| x.into());
13036 self
13037 }
13038
13039 /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
13040 ///
13041 /// # Example
13042 /// ```ignore,no_run
13043 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13044 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
13045 /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
13046 /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
13047 /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
13048 /// ```
13049 pub fn set_state<T>(mut self, v: T) -> Self
13050 where
13051 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
13052 {
13053 self.state = std::option::Option::Some(v.into());
13054 self
13055 }
13056
13057 /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
13058 ///
13059 /// # Example
13060 /// ```ignore,no_run
13061 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13062 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
13063 /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
13064 /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
13065 /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
13066 /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
13067 /// ```
13068 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
13069 where
13070 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
13071 {
13072 self.state = v.map(|x| x.into());
13073 self
13074 }
13075
13076 /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
13077 ///
13078 /// # Example
13079 /// ```ignore,no_run
13080 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13081 /// use google_cloud_sql_v1::model::DnsNameMapping;
13082 /// let x = PoolNodeConfig::new()
13083 /// .set_dns_names([
13084 /// DnsNameMapping::default()/* use setters */,
13085 /// DnsNameMapping::default()/* use (different) setters */,
13086 /// ]);
13087 /// ```
13088 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
13089 where
13090 T: std::iter::IntoIterator<Item = V>,
13091 V: std::convert::Into<crate::model::DnsNameMapping>,
13092 {
13093 use std::iter::Iterator;
13094 self.dns_names = v.into_iter().map(|i| i.into()).collect();
13095 self
13096 }
13097
13098 /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
13099 ///
13100 /// # Example
13101 /// ```ignore,no_run
13102 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13103 /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
13104 /// ```
13105 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
13106 where
13107 T: std::convert::Into<std::string::String>,
13108 {
13109 self.psc_service_attachment_link = std::option::Option::Some(v.into());
13110 self
13111 }
13112
13113 /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
13114 ///
13115 /// # Example
13116 /// ```ignore,no_run
13117 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13118 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
13119 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
13120 /// ```
13121 pub fn set_or_clear_psc_service_attachment_link<T>(
13122 mut self,
13123 v: std::option::Option<T>,
13124 ) -> Self
13125 where
13126 T: std::convert::Into<std::string::String>,
13127 {
13128 self.psc_service_attachment_link = v.map(|x| x.into());
13129 self
13130 }
13131
13132 /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
13133 ///
13134 /// # Example
13135 /// ```ignore,no_run
13136 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13137 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
13138 /// let x = PoolNodeConfig::new()
13139 /// .set_psc_auto_connections([
13140 /// PscAutoConnectionConfig::default()/* use setters */,
13141 /// PscAutoConnectionConfig::default()/* use (different) setters */,
13142 /// ]);
13143 /// ```
13144 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
13145 where
13146 T: std::iter::IntoIterator<Item = V>,
13147 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
13148 {
13149 use std::iter::Iterator;
13150 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
13151 self
13152 }
13153 }
13154
13155 impl wkt::message::Message for PoolNodeConfig {
13156 fn typename() -> &'static str {
13157 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
13158 }
13159 }
13160
13161 /// The current serving state of the database instance.
13162 ///
13163 /// # Working with unknown values
13164 ///
13165 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13166 /// additional enum variants at any time. Adding new variants is not considered
13167 /// a breaking change. Applications should write their code in anticipation of:
13168 ///
13169 /// - New values appearing in future releases of the client library, **and**
13170 /// - New values received dynamically, without application changes.
13171 ///
13172 /// Please consult the [Working with enums] section in the user guide for some
13173 /// guidelines.
13174 ///
13175 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13176 #[derive(Clone, Debug, PartialEq)]
13177 #[non_exhaustive]
13178 pub enum SqlInstanceState {
13179 /// The state of the instance is unknown.
13180 Unspecified,
13181 /// The instance is running, or has been stopped by owner.
13182 Runnable,
13183 /// The instance is not available, for example due to problems with billing.
13184 Suspended,
13185 /// The instance is being deleted.
13186 PendingDelete,
13187 /// The instance is being created.
13188 PendingCreate,
13189 /// The instance is down for maintenance.
13190 Maintenance,
13191 /// The creation of the instance failed or a fatal error occurred during
13192 /// maintenance.
13193 Failed,
13194 /// Deprecated
13195 #[deprecated]
13196 OnlineMaintenance,
13197 /// (Applicable to read pool nodes only.) The read pool node needs to be
13198 /// repaired. The database might be unavailable.
13199 Repairing,
13200 /// If set, the enum was initialized with an unknown value.
13201 ///
13202 /// Applications can examine the value using [SqlInstanceState::value] or
13203 /// [SqlInstanceState::name].
13204 UnknownValue(sql_instance_state::UnknownValue),
13205 }
13206
13207 #[doc(hidden)]
13208 pub mod sql_instance_state {
13209 #[allow(unused_imports)]
13210 use super::*;
13211 #[derive(Clone, Debug, PartialEq)]
13212 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13213 }
13214
13215 impl SqlInstanceState {
13216 /// Gets the enum value.
13217 ///
13218 /// Returns `None` if the enum contains an unknown value deserialized from
13219 /// the string representation of enums.
13220 pub fn value(&self) -> std::option::Option<i32> {
13221 match self {
13222 Self::Unspecified => std::option::Option::Some(0),
13223 Self::Runnable => std::option::Option::Some(1),
13224 Self::Suspended => std::option::Option::Some(2),
13225 Self::PendingDelete => std::option::Option::Some(3),
13226 Self::PendingCreate => std::option::Option::Some(4),
13227 Self::Maintenance => std::option::Option::Some(5),
13228 Self::Failed => std::option::Option::Some(6),
13229 Self::OnlineMaintenance => std::option::Option::Some(7),
13230 Self::Repairing => std::option::Option::Some(8),
13231 Self::UnknownValue(u) => u.0.value(),
13232 }
13233 }
13234
13235 /// Gets the enum value as a string.
13236 ///
13237 /// Returns `None` if the enum contains an unknown value deserialized from
13238 /// the integer representation of enums.
13239 pub fn name(&self) -> std::option::Option<&str> {
13240 match self {
13241 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
13242 Self::Runnable => std::option::Option::Some("RUNNABLE"),
13243 Self::Suspended => std::option::Option::Some("SUSPENDED"),
13244 Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
13245 Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
13246 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
13247 Self::Failed => std::option::Option::Some("FAILED"),
13248 Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
13249 Self::Repairing => std::option::Option::Some("REPAIRING"),
13250 Self::UnknownValue(u) => u.0.name(),
13251 }
13252 }
13253 }
13254
13255 impl std::default::Default for SqlInstanceState {
13256 fn default() -> Self {
13257 use std::convert::From;
13258 Self::from(0)
13259 }
13260 }
13261
13262 impl std::fmt::Display for SqlInstanceState {
13263 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13264 wkt::internal::display_enum(f, self.name(), self.value())
13265 }
13266 }
13267
13268 impl std::convert::From<i32> for SqlInstanceState {
13269 fn from(value: i32) -> Self {
13270 match value {
13271 0 => Self::Unspecified,
13272 1 => Self::Runnable,
13273 2 => Self::Suspended,
13274 3 => Self::PendingDelete,
13275 4 => Self::PendingCreate,
13276 5 => Self::Maintenance,
13277 6 => Self::Failed,
13278 7 => Self::OnlineMaintenance,
13279 8 => Self::Repairing,
13280 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13281 wkt::internal::UnknownEnumValue::Integer(value),
13282 )),
13283 }
13284 }
13285 }
13286
13287 impl std::convert::From<&str> for SqlInstanceState {
13288 fn from(value: &str) -> Self {
13289 use std::string::ToString;
13290 match value {
13291 "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
13292 "RUNNABLE" => Self::Runnable,
13293 "SUSPENDED" => Self::Suspended,
13294 "PENDING_DELETE" => Self::PendingDelete,
13295 "PENDING_CREATE" => Self::PendingCreate,
13296 "MAINTENANCE" => Self::Maintenance,
13297 "FAILED" => Self::Failed,
13298 "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
13299 "REPAIRING" => Self::Repairing,
13300 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13301 wkt::internal::UnknownEnumValue::String(value.to_string()),
13302 )),
13303 }
13304 }
13305 }
13306
13307 impl serde::ser::Serialize for SqlInstanceState {
13308 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13309 where
13310 S: serde::Serializer,
13311 {
13312 match self {
13313 Self::Unspecified => serializer.serialize_i32(0),
13314 Self::Runnable => serializer.serialize_i32(1),
13315 Self::Suspended => serializer.serialize_i32(2),
13316 Self::PendingDelete => serializer.serialize_i32(3),
13317 Self::PendingCreate => serializer.serialize_i32(4),
13318 Self::Maintenance => serializer.serialize_i32(5),
13319 Self::Failed => serializer.serialize_i32(6),
13320 Self::OnlineMaintenance => serializer.serialize_i32(7),
13321 Self::Repairing => serializer.serialize_i32(8),
13322 Self::UnknownValue(u) => u.0.serialize(serializer),
13323 }
13324 }
13325 }
13326
13327 impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
13328 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13329 where
13330 D: serde::Deserializer<'de>,
13331 {
13332 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
13333 ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
13334 ))
13335 }
13336 }
13337
13338 /// The SQL network architecture for the instance.
13339 ///
13340 /// # Working with unknown values
13341 ///
13342 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13343 /// additional enum variants at any time. Adding new variants is not considered
13344 /// a breaking change. Applications should write their code in anticipation of:
13345 ///
13346 /// - New values appearing in future releases of the client library, **and**
13347 /// - New values received dynamically, without application changes.
13348 ///
13349 /// Please consult the [Working with enums] section in the user guide for some
13350 /// guidelines.
13351 ///
13352 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13353 #[derive(Clone, Debug, PartialEq)]
13354 #[non_exhaustive]
13355 pub enum SqlNetworkArchitecture {
13356 #[allow(missing_docs)]
13357 Unspecified,
13358 /// The instance uses the new network architecture.
13359 NewNetworkArchitecture,
13360 /// The instance uses the old network architecture.
13361 OldNetworkArchitecture,
13362 /// If set, the enum was initialized with an unknown value.
13363 ///
13364 /// Applications can examine the value using [SqlNetworkArchitecture::value] or
13365 /// [SqlNetworkArchitecture::name].
13366 UnknownValue(sql_network_architecture::UnknownValue),
13367 }
13368
13369 #[doc(hidden)]
13370 pub mod sql_network_architecture {
13371 #[allow(unused_imports)]
13372 use super::*;
13373 #[derive(Clone, Debug, PartialEq)]
13374 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13375 }
13376
13377 impl SqlNetworkArchitecture {
13378 /// Gets the enum value.
13379 ///
13380 /// Returns `None` if the enum contains an unknown value deserialized from
13381 /// the string representation of enums.
13382 pub fn value(&self) -> std::option::Option<i32> {
13383 match self {
13384 Self::Unspecified => std::option::Option::Some(0),
13385 Self::NewNetworkArchitecture => std::option::Option::Some(1),
13386 Self::OldNetworkArchitecture => std::option::Option::Some(2),
13387 Self::UnknownValue(u) => u.0.value(),
13388 }
13389 }
13390
13391 /// Gets the enum value as a string.
13392 ///
13393 /// Returns `None` if the enum contains an unknown value deserialized from
13394 /// the integer representation of enums.
13395 pub fn name(&self) -> std::option::Option<&str> {
13396 match self {
13397 Self::Unspecified => {
13398 std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
13399 }
13400 Self::NewNetworkArchitecture => {
13401 std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
13402 }
13403 Self::OldNetworkArchitecture => {
13404 std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
13405 }
13406 Self::UnknownValue(u) => u.0.name(),
13407 }
13408 }
13409 }
13410
13411 impl std::default::Default for SqlNetworkArchitecture {
13412 fn default() -> Self {
13413 use std::convert::From;
13414 Self::from(0)
13415 }
13416 }
13417
13418 impl std::fmt::Display for SqlNetworkArchitecture {
13419 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13420 wkt::internal::display_enum(f, self.name(), self.value())
13421 }
13422 }
13423
13424 impl std::convert::From<i32> for SqlNetworkArchitecture {
13425 fn from(value: i32) -> Self {
13426 match value {
13427 0 => Self::Unspecified,
13428 1 => Self::NewNetworkArchitecture,
13429 2 => Self::OldNetworkArchitecture,
13430 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13431 wkt::internal::UnknownEnumValue::Integer(value),
13432 )),
13433 }
13434 }
13435 }
13436
13437 impl std::convert::From<&str> for SqlNetworkArchitecture {
13438 fn from(value: &str) -> Self {
13439 use std::string::ToString;
13440 match value {
13441 "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
13442 "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
13443 "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
13444 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13445 wkt::internal::UnknownEnumValue::String(value.to_string()),
13446 )),
13447 }
13448 }
13449 }
13450
13451 impl serde::ser::Serialize for SqlNetworkArchitecture {
13452 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13453 where
13454 S: serde::Serializer,
13455 {
13456 match self {
13457 Self::Unspecified => serializer.serialize_i32(0),
13458 Self::NewNetworkArchitecture => serializer.serialize_i32(1),
13459 Self::OldNetworkArchitecture => serializer.serialize_i32(2),
13460 Self::UnknownValue(u) => u.0.serialize(serializer),
13461 }
13462 }
13463 }
13464
13465 impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
13466 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13467 where
13468 D: serde::Deserializer<'de>,
13469 {
13470 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
13471 ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
13472 ))
13473 }
13474 }
13475}
13476
13477/// Gemini instance configuration.
13478#[derive(Clone, Default, PartialEq)]
13479#[non_exhaustive]
13480pub struct GeminiInstanceConfig {
13481 /// Output only. Whether Gemini is enabled.
13482 pub entitled: std::option::Option<bool>,
13483
13484 /// Output only. Whether the vacuum management is enabled.
13485 pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
13486
13487 /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
13488 pub oom_session_cancel_enabled: std::option::Option<bool>,
13489
13490 /// Output only. Whether the active query is enabled.
13491 pub active_query_enabled: std::option::Option<bool>,
13492
13493 /// Output only. Whether the index advisor is enabled.
13494 pub index_advisor_enabled: std::option::Option<bool>,
13495
13496 /// Output only. Whether the flag recommender is enabled.
13497 pub flag_recommender_enabled: std::option::Option<bool>,
13498
13499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13500}
13501
13502impl GeminiInstanceConfig {
13503 /// Creates a new default instance.
13504 pub fn new() -> Self {
13505 std::default::Default::default()
13506 }
13507
13508 /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13509 ///
13510 /// # Example
13511 /// ```ignore,no_run
13512 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13513 /// let x = GeminiInstanceConfig::new().set_entitled(true);
13514 /// ```
13515 pub fn set_entitled<T>(mut self, v: T) -> Self
13516 where
13517 T: std::convert::Into<bool>,
13518 {
13519 self.entitled = std::option::Option::Some(v.into());
13520 self
13521 }
13522
13523 /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13524 ///
13525 /// # Example
13526 /// ```ignore,no_run
13527 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13528 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
13529 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
13530 /// ```
13531 pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
13532 where
13533 T: std::convert::Into<bool>,
13534 {
13535 self.entitled = v.map(|x| x.into());
13536 self
13537 }
13538
13539 /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13540 ///
13541 /// # Example
13542 /// ```ignore,no_run
13543 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13544 /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
13545 /// ```
13546 pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
13547 where
13548 T: std::convert::Into<bool>,
13549 {
13550 self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
13551 self
13552 }
13553
13554 /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13555 ///
13556 /// # Example
13557 /// ```ignore,no_run
13558 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13559 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
13560 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
13561 /// ```
13562 pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13563 where
13564 T: std::convert::Into<bool>,
13565 {
13566 self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
13567 self
13568 }
13569
13570 /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13571 ///
13572 /// # Example
13573 /// ```ignore,no_run
13574 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13575 /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
13576 /// ```
13577 pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
13578 where
13579 T: std::convert::Into<bool>,
13580 {
13581 self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
13582 self
13583 }
13584
13585 /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13586 ///
13587 /// # Example
13588 /// ```ignore,no_run
13589 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13590 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
13591 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
13592 /// ```
13593 pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13594 where
13595 T: std::convert::Into<bool>,
13596 {
13597 self.oom_session_cancel_enabled = v.map(|x| x.into());
13598 self
13599 }
13600
13601 /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13602 ///
13603 /// # Example
13604 /// ```ignore,no_run
13605 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13606 /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
13607 /// ```
13608 pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
13609 where
13610 T: std::convert::Into<bool>,
13611 {
13612 self.active_query_enabled = std::option::Option::Some(v.into());
13613 self
13614 }
13615
13616 /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13617 ///
13618 /// # Example
13619 /// ```ignore,no_run
13620 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13621 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
13622 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
13623 /// ```
13624 pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13625 where
13626 T: std::convert::Into<bool>,
13627 {
13628 self.active_query_enabled = v.map(|x| x.into());
13629 self
13630 }
13631
13632 /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13633 ///
13634 /// # Example
13635 /// ```ignore,no_run
13636 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13637 /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
13638 /// ```
13639 pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
13640 where
13641 T: std::convert::Into<bool>,
13642 {
13643 self.index_advisor_enabled = std::option::Option::Some(v.into());
13644 self
13645 }
13646
13647 /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13648 ///
13649 /// # Example
13650 /// ```ignore,no_run
13651 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13652 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
13653 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
13654 /// ```
13655 pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13656 where
13657 T: std::convert::Into<bool>,
13658 {
13659 self.index_advisor_enabled = v.map(|x| x.into());
13660 self
13661 }
13662
13663 /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13664 ///
13665 /// # Example
13666 /// ```ignore,no_run
13667 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13668 /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
13669 /// ```
13670 pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
13671 where
13672 T: std::convert::Into<bool>,
13673 {
13674 self.flag_recommender_enabled = std::option::Option::Some(v.into());
13675 self
13676 }
13677
13678 /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13679 ///
13680 /// # Example
13681 /// ```ignore,no_run
13682 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13683 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
13684 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
13685 /// ```
13686 pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13687 where
13688 T: std::convert::Into<bool>,
13689 {
13690 self.flag_recommender_enabled = v.map(|x| x.into());
13691 self
13692 }
13693}
13694
13695impl wkt::message::Message for GeminiInstanceConfig {
13696 fn typename() -> &'static str {
13697 "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
13698 }
13699}
13700
13701/// A primary instance and disaster recovery (DR) replica pair.
13702/// A DR replica is a cross-region replica that you designate for failover in
13703/// the event that the primary instance experiences regional failure.
13704/// Applicable to MySQL and PostgreSQL.
13705#[derive(Clone, Default, PartialEq)]
13706#[non_exhaustive]
13707pub struct ReplicationCluster {
13708 /// Output only. If set, this field indicates this instance has a private
13709 /// service access (PSA) DNS endpoint that is pointing to the primary instance
13710 /// of the cluster. If this instance is the primary, then the DNS endpoint
13711 /// points to this instance. After a switchover or replica failover operation,
13712 /// this DNS endpoint points to the promoted instance. This is a read-only
13713 /// field, returned to the user as information. This field can exist even if a
13714 /// standalone instance doesn't have a DR replica yet or the DR replica is
13715 /// deleted.
13716 pub psa_write_endpoint: std::string::String,
13717
13718 /// Optional. If the instance is a primary instance, then this field identifies
13719 /// the disaster recovery (DR) replica. A DR replica is an optional
13720 /// configuration for Enterprise Plus edition instances. If the instance is a
13721 /// read replica, then the field is not set. Set this field to a replica name
13722 /// to designate a DR replica for a primary instance. Remove the replica name
13723 /// to remove the DR replica designation.
13724 pub failover_dr_replica_name: std::string::String,
13725
13726 /// Output only. Read-only field that indicates whether the replica is a DR
13727 /// replica. This field is not set if the instance is a primary instance.
13728 pub dr_replica: bool,
13729
13730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13731}
13732
13733impl ReplicationCluster {
13734 /// Creates a new default instance.
13735 pub fn new() -> Self {
13736 std::default::Default::default()
13737 }
13738
13739 /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
13740 ///
13741 /// # Example
13742 /// ```ignore,no_run
13743 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13744 /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
13745 /// ```
13746 pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
13747 mut self,
13748 v: T,
13749 ) -> Self {
13750 self.psa_write_endpoint = v.into();
13751 self
13752 }
13753
13754 /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
13755 ///
13756 /// # Example
13757 /// ```ignore,no_run
13758 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13759 /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
13760 /// ```
13761 pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
13762 mut self,
13763 v: T,
13764 ) -> Self {
13765 self.failover_dr_replica_name = v.into();
13766 self
13767 }
13768
13769 /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
13770 ///
13771 /// # Example
13772 /// ```ignore,no_run
13773 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13774 /// let x = ReplicationCluster::new().set_dr_replica(true);
13775 /// ```
13776 pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13777 self.dr_replica = v.into();
13778 self
13779 }
13780}
13781
13782impl wkt::message::Message for ReplicationCluster {
13783 fn typename() -> &'static str {
13784 "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
13785 }
13786}
13787
13788/// An available database version. It can be a major or a minor version.
13789#[derive(Clone, Default, PartialEq)]
13790#[non_exhaustive]
13791pub struct AvailableDatabaseVersion {
13792 /// The version's major version name.
13793 pub major_version: std::option::Option<std::string::String>,
13794
13795 /// The database version name. For MySQL 8.0, this string provides the database
13796 /// major and minor version.
13797 pub name: std::option::Option<std::string::String>,
13798
13799 /// The database version's display name.
13800 pub display_name: std::option::Option<std::string::String>,
13801
13802 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13803}
13804
13805impl AvailableDatabaseVersion {
13806 /// Creates a new default instance.
13807 pub fn new() -> Self {
13808 std::default::Default::default()
13809 }
13810
13811 /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13812 ///
13813 /// # Example
13814 /// ```ignore,no_run
13815 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13816 /// let x = AvailableDatabaseVersion::new().set_major_version("example");
13817 /// ```
13818 pub fn set_major_version<T>(mut self, v: T) -> Self
13819 where
13820 T: std::convert::Into<std::string::String>,
13821 {
13822 self.major_version = std::option::Option::Some(v.into());
13823 self
13824 }
13825
13826 /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13827 ///
13828 /// # Example
13829 /// ```ignore,no_run
13830 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13831 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
13832 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
13833 /// ```
13834 pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
13835 where
13836 T: std::convert::Into<std::string::String>,
13837 {
13838 self.major_version = v.map(|x| x.into());
13839 self
13840 }
13841
13842 /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
13843 ///
13844 /// # Example
13845 /// ```ignore,no_run
13846 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13847 /// let x = AvailableDatabaseVersion::new().set_name("example");
13848 /// ```
13849 pub fn set_name<T>(mut self, v: T) -> Self
13850 where
13851 T: std::convert::Into<std::string::String>,
13852 {
13853 self.name = std::option::Option::Some(v.into());
13854 self
13855 }
13856
13857 /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
13858 ///
13859 /// # Example
13860 /// ```ignore,no_run
13861 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13862 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
13863 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
13864 /// ```
13865 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13866 where
13867 T: std::convert::Into<std::string::String>,
13868 {
13869 self.name = v.map(|x| x.into());
13870 self
13871 }
13872
13873 /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13874 ///
13875 /// # Example
13876 /// ```ignore,no_run
13877 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13878 /// let x = AvailableDatabaseVersion::new().set_display_name("example");
13879 /// ```
13880 pub fn set_display_name<T>(mut self, v: T) -> Self
13881 where
13882 T: std::convert::Into<std::string::String>,
13883 {
13884 self.display_name = std::option::Option::Some(v.into());
13885 self
13886 }
13887
13888 /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13889 ///
13890 /// # Example
13891 /// ```ignore,no_run
13892 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13893 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
13894 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
13895 /// ```
13896 pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
13897 where
13898 T: std::convert::Into<std::string::String>,
13899 {
13900 self.display_name = v.map(|x| x.into());
13901 self
13902 }
13903}
13904
13905impl wkt::message::Message for AvailableDatabaseVersion {
13906 fn typename() -> &'static str {
13907 "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
13908 }
13909}
13910
13911/// Reschedule options for maintenance windows.
13912#[derive(Clone, Default, PartialEq)]
13913#[non_exhaustive]
13914pub struct SqlInstancesRescheduleMaintenanceRequestBody {
13915 /// Required. The type of the reschedule the user wants.
13916 pub reschedule: std::option::Option<
13917 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13918 >,
13919
13920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13921}
13922
13923impl SqlInstancesRescheduleMaintenanceRequestBody {
13924 /// Creates a new default instance.
13925 pub fn new() -> Self {
13926 std::default::Default::default()
13927 }
13928
13929 /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13930 ///
13931 /// # Example
13932 /// ```ignore,no_run
13933 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13934 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13935 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
13936 /// ```
13937 pub fn set_reschedule<T>(mut self, v: T) -> Self
13938 where
13939 T: std::convert::Into<
13940 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13941 >,
13942 {
13943 self.reschedule = std::option::Option::Some(v.into());
13944 self
13945 }
13946
13947 /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13948 ///
13949 /// # Example
13950 /// ```ignore,no_run
13951 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13952 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13953 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
13954 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
13955 /// ```
13956 pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
13957 where
13958 T: std::convert::Into<
13959 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13960 >,
13961 {
13962 self.reschedule = v.map(|x| x.into());
13963 self
13964 }
13965}
13966
13967impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
13968 fn typename() -> &'static str {
13969 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
13970 }
13971}
13972
13973/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
13974pub mod sql_instances_reschedule_maintenance_request_body {
13975 #[allow(unused_imports)]
13976 use super::*;
13977
13978 #[allow(missing_docs)]
13979 #[derive(Clone, Default, PartialEq)]
13980 #[non_exhaustive]
13981 pub struct Reschedule {
13982 /// Required. The type of the reschedule.
13983 pub reschedule_type:
13984 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13985
13986 /// Optional. Timestamp when the maintenance shall be rescheduled to if
13987 /// reschedule_type=SPECIFIC_TIME, in
13988 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
13989 /// `2012-11-15T16:19:00.094Z`.
13990 pub schedule_time: std::option::Option<wkt::Timestamp>,
13991
13992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13993 }
13994
13995 impl Reschedule {
13996 /// Creates a new default instance.
13997 pub fn new() -> Self {
13998 std::default::Default::default()
13999 }
14000
14001 /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
14002 ///
14003 /// # Example
14004 /// ```ignore,no_run
14005 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14006 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
14007 /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
14008 /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
14009 /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
14010 /// ```
14011 pub fn set_reschedule_type<
14012 T: std::convert::Into<
14013 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
14014 >,
14015 >(
14016 mut self,
14017 v: T,
14018 ) -> Self {
14019 self.reschedule_type = v.into();
14020 self
14021 }
14022
14023 /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
14024 ///
14025 /// # Example
14026 /// ```ignore,no_run
14027 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14028 /// use wkt::Timestamp;
14029 /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
14030 /// ```
14031 pub fn set_schedule_time<T>(mut self, v: T) -> Self
14032 where
14033 T: std::convert::Into<wkt::Timestamp>,
14034 {
14035 self.schedule_time = std::option::Option::Some(v.into());
14036 self
14037 }
14038
14039 /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
14040 ///
14041 /// # Example
14042 /// ```ignore,no_run
14043 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14044 /// use wkt::Timestamp;
14045 /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
14046 /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
14047 /// ```
14048 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
14049 where
14050 T: std::convert::Into<wkt::Timestamp>,
14051 {
14052 self.schedule_time = v.map(|x| x.into());
14053 self
14054 }
14055 }
14056
14057 impl wkt::message::Message for Reschedule {
14058 fn typename() -> &'static str {
14059 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
14060 }
14061 }
14062
14063 /// Enum for [RescheduleType].
14064 ///
14065 /// # Working with unknown values
14066 ///
14067 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14068 /// additional enum variants at any time. Adding new variants is not considered
14069 /// a breaking change. Applications should write their code in anticipation of:
14070 ///
14071 /// - New values appearing in future releases of the client library, **and**
14072 /// - New values received dynamically, without application changes.
14073 ///
14074 /// Please consult the [Working with enums] section in the user guide for some
14075 /// guidelines.
14076 ///
14077 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14078 #[derive(Clone, Debug, PartialEq)]
14079 #[non_exhaustive]
14080 pub enum RescheduleType {
14081 #[allow(missing_docs)]
14082 Unspecified,
14083 /// Reschedules maintenance to happen now (within 5 minutes).
14084 Immediate,
14085 /// Reschedules maintenance to occur within one week from the originally
14086 /// scheduled day and time.
14087 NextAvailableWindow,
14088 /// Reschedules maintenance to a specific time and day.
14089 SpecificTime,
14090 /// If set, the enum was initialized with an unknown value.
14091 ///
14092 /// Applications can examine the value using [RescheduleType::value] or
14093 /// [RescheduleType::name].
14094 UnknownValue(reschedule_type::UnknownValue),
14095 }
14096
14097 #[doc(hidden)]
14098 pub mod reschedule_type {
14099 #[allow(unused_imports)]
14100 use super::*;
14101 #[derive(Clone, Debug, PartialEq)]
14102 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14103 }
14104
14105 impl RescheduleType {
14106 /// Gets the enum value.
14107 ///
14108 /// Returns `None` if the enum contains an unknown value deserialized from
14109 /// the string representation of enums.
14110 pub fn value(&self) -> std::option::Option<i32> {
14111 match self {
14112 Self::Unspecified => std::option::Option::Some(0),
14113 Self::Immediate => std::option::Option::Some(1),
14114 Self::NextAvailableWindow => std::option::Option::Some(2),
14115 Self::SpecificTime => std::option::Option::Some(3),
14116 Self::UnknownValue(u) => u.0.value(),
14117 }
14118 }
14119
14120 /// Gets the enum value as a string.
14121 ///
14122 /// Returns `None` if the enum contains an unknown value deserialized from
14123 /// the integer representation of enums.
14124 pub fn name(&self) -> std::option::Option<&str> {
14125 match self {
14126 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
14127 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
14128 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
14129 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
14130 Self::UnknownValue(u) => u.0.name(),
14131 }
14132 }
14133 }
14134
14135 impl std::default::Default for RescheduleType {
14136 fn default() -> Self {
14137 use std::convert::From;
14138 Self::from(0)
14139 }
14140 }
14141
14142 impl std::fmt::Display for RescheduleType {
14143 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14144 wkt::internal::display_enum(f, self.name(), self.value())
14145 }
14146 }
14147
14148 impl std::convert::From<i32> for RescheduleType {
14149 fn from(value: i32) -> Self {
14150 match value {
14151 0 => Self::Unspecified,
14152 1 => Self::Immediate,
14153 2 => Self::NextAvailableWindow,
14154 3 => Self::SpecificTime,
14155 _ => Self::UnknownValue(reschedule_type::UnknownValue(
14156 wkt::internal::UnknownEnumValue::Integer(value),
14157 )),
14158 }
14159 }
14160 }
14161
14162 impl std::convert::From<&str> for RescheduleType {
14163 fn from(value: &str) -> Self {
14164 use std::string::ToString;
14165 match value {
14166 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
14167 "IMMEDIATE" => Self::Immediate,
14168 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
14169 "SPECIFIC_TIME" => Self::SpecificTime,
14170 _ => Self::UnknownValue(reschedule_type::UnknownValue(
14171 wkt::internal::UnknownEnumValue::String(value.to_string()),
14172 )),
14173 }
14174 }
14175 }
14176
14177 impl serde::ser::Serialize for RescheduleType {
14178 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14179 where
14180 S: serde::Serializer,
14181 {
14182 match self {
14183 Self::Unspecified => serializer.serialize_i32(0),
14184 Self::Immediate => serializer.serialize_i32(1),
14185 Self::NextAvailableWindow => serializer.serialize_i32(2),
14186 Self::SpecificTime => serializer.serialize_i32(3),
14187 Self::UnknownValue(u) => u.0.serialize(serializer),
14188 }
14189 }
14190 }
14191
14192 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
14193 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14194 where
14195 D: serde::Deserializer<'de>,
14196 {
14197 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
14198 ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
14199 ))
14200 }
14201 }
14202}
14203
14204/// Database instance demote primary instance context.
14205#[derive(Clone, Default, PartialEq)]
14206#[non_exhaustive]
14207pub struct DemoteMasterContext {
14208 /// This is always `sql#demoteMasterContext`.
14209 pub kind: std::string::String,
14210
14211 /// Verify the GTID consistency for demote operation. Default value:
14212 /// `True`. Setting this flag to `false` enables you to bypass the GTID
14213 /// consistency check between on-premises primary instance and Cloud SQL
14214 /// instance during the demotion operation but also exposes you to the risk of
14215 /// future replication failures. Change the value only if you know the reason
14216 /// for the GTID divergence and are confident that doing so will not cause any
14217 /// replication issues.
14218 pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
14219
14220 /// The name of the instance which will act as on-premises primary instance
14221 /// in the replication setup.
14222 pub master_instance_name: std::string::String,
14223
14224 /// Configuration specific to read-replicas replicating from the on-premises
14225 /// primary instance.
14226 pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
14227
14228 /// Flag to skip replication setup on the instance.
14229 pub skip_replication_setup: bool,
14230
14231 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14232}
14233
14234impl DemoteMasterContext {
14235 /// Creates a new default instance.
14236 pub fn new() -> Self {
14237 std::default::Default::default()
14238 }
14239
14240 /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
14241 ///
14242 /// # Example
14243 /// ```ignore,no_run
14244 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14245 /// let x = DemoteMasterContext::new().set_kind("example");
14246 /// ```
14247 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14248 self.kind = v.into();
14249 self
14250 }
14251
14252 /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
14253 ///
14254 /// # Example
14255 /// ```ignore,no_run
14256 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14257 /// use wkt::BoolValue;
14258 /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
14259 /// ```
14260 pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
14261 where
14262 T: std::convert::Into<wkt::BoolValue>,
14263 {
14264 self.verify_gtid_consistency = std::option::Option::Some(v.into());
14265 self
14266 }
14267
14268 /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
14269 ///
14270 /// # Example
14271 /// ```ignore,no_run
14272 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14273 /// use wkt::BoolValue;
14274 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
14275 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
14276 /// ```
14277 pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
14278 where
14279 T: std::convert::Into<wkt::BoolValue>,
14280 {
14281 self.verify_gtid_consistency = v.map(|x| x.into());
14282 self
14283 }
14284
14285 /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
14286 ///
14287 /// # Example
14288 /// ```ignore,no_run
14289 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14290 /// let x = DemoteMasterContext::new().set_master_instance_name("example");
14291 /// ```
14292 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
14293 mut self,
14294 v: T,
14295 ) -> Self {
14296 self.master_instance_name = v.into();
14297 self
14298 }
14299
14300 /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14301 ///
14302 /// # Example
14303 /// ```ignore,no_run
14304 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14305 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14306 /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
14307 /// ```
14308 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
14309 where
14310 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14311 {
14312 self.replica_configuration = std::option::Option::Some(v.into());
14313 self
14314 }
14315
14316 /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14317 ///
14318 /// # Example
14319 /// ```ignore,no_run
14320 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14321 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14322 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
14323 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
14324 /// ```
14325 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
14326 where
14327 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14328 {
14329 self.replica_configuration = v.map(|x| x.into());
14330 self
14331 }
14332
14333 /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
14334 ///
14335 /// # Example
14336 /// ```ignore,no_run
14337 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14338 /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
14339 /// ```
14340 pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14341 self.skip_replication_setup = v.into();
14342 self
14343 }
14344}
14345
14346impl wkt::message::Message for DemoteMasterContext {
14347 fn typename() -> &'static str {
14348 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
14349 }
14350}
14351
14352/// This context is used to demote an existing standalone instance to be
14353/// a Cloud SQL read replica for an external database server.
14354#[derive(Clone, Default, PartialEq)]
14355#[non_exhaustive]
14356pub struct DemoteContext {
14357 /// This is always `sql#demoteContext`.
14358 pub kind: std::string::String,
14359
14360 /// Required. The name of the instance which acts as the on-premises primary
14361 /// instance in the replication setup.
14362 pub source_representative_instance_name: std::string::String,
14363
14364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14365}
14366
14367impl DemoteContext {
14368 /// Creates a new default instance.
14369 pub fn new() -> Self {
14370 std::default::Default::default()
14371 }
14372
14373 /// Sets the value of [kind][crate::model::DemoteContext::kind].
14374 ///
14375 /// # Example
14376 /// ```ignore,no_run
14377 /// # use google_cloud_sql_v1::model::DemoteContext;
14378 /// let x = DemoteContext::new().set_kind("example");
14379 /// ```
14380 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14381 self.kind = v.into();
14382 self
14383 }
14384
14385 /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
14386 ///
14387 /// # Example
14388 /// ```ignore,no_run
14389 /// # use google_cloud_sql_v1::model::DemoteContext;
14390 /// let x = DemoteContext::new().set_source_representative_instance_name("example");
14391 /// ```
14392 pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
14393 mut self,
14394 v: T,
14395 ) -> Self {
14396 self.source_representative_instance_name = v.into();
14397 self
14398 }
14399}
14400
14401impl wkt::message::Message for DemoteContext {
14402 fn typename() -> &'static str {
14403 "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
14404 }
14405}
14406
14407/// Database instance failover context.
14408#[derive(Clone, Default, PartialEq)]
14409#[non_exhaustive]
14410pub struct FailoverContext {
14411 /// The current settings version of this instance. Request will be rejected if
14412 /// this version doesn't match the current settings version.
14413 pub settings_version: i64,
14414
14415 /// This is always `sql#failoverContext`.
14416 pub kind: std::string::String,
14417
14418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14419}
14420
14421impl FailoverContext {
14422 /// Creates a new default instance.
14423 pub fn new() -> Self {
14424 std::default::Default::default()
14425 }
14426
14427 /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
14428 ///
14429 /// # Example
14430 /// ```ignore,no_run
14431 /// # use google_cloud_sql_v1::model::FailoverContext;
14432 /// let x = FailoverContext::new().set_settings_version(42);
14433 /// ```
14434 pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14435 self.settings_version = v.into();
14436 self
14437 }
14438
14439 /// Sets the value of [kind][crate::model::FailoverContext::kind].
14440 ///
14441 /// # Example
14442 /// ```ignore,no_run
14443 /// # use google_cloud_sql_v1::model::FailoverContext;
14444 /// let x = FailoverContext::new().set_kind("example");
14445 /// ```
14446 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14447 self.kind = v.into();
14448 self
14449 }
14450}
14451
14452impl wkt::message::Message for FailoverContext {
14453 fn typename() -> &'static str {
14454 "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
14455 }
14456}
14457
14458/// Database instance restore from backup context.
14459/// Backup context contains source instance id and project id.
14460#[derive(Clone, Default, PartialEq)]
14461#[non_exhaustive]
14462pub struct RestoreBackupContext {
14463 /// This is always `sql#restoreBackupContext`.
14464 pub kind: std::string::String,
14465
14466 /// The ID of the backup run to restore from.
14467 pub backup_run_id: i64,
14468
14469 /// The ID of the instance that the backup was taken from.
14470 pub instance_id: std::string::String,
14471
14472 /// The full project ID of the source instance.
14473 pub project: std::string::String,
14474
14475 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14476}
14477
14478impl RestoreBackupContext {
14479 /// Creates a new default instance.
14480 pub fn new() -> Self {
14481 std::default::Default::default()
14482 }
14483
14484 /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
14485 ///
14486 /// # Example
14487 /// ```ignore,no_run
14488 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14489 /// let x = RestoreBackupContext::new().set_kind("example");
14490 /// ```
14491 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14492 self.kind = v.into();
14493 self
14494 }
14495
14496 /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
14497 ///
14498 /// # Example
14499 /// ```ignore,no_run
14500 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14501 /// let x = RestoreBackupContext::new().set_backup_run_id(42);
14502 /// ```
14503 pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14504 self.backup_run_id = v.into();
14505 self
14506 }
14507
14508 /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
14509 ///
14510 /// # Example
14511 /// ```ignore,no_run
14512 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14513 /// let x = RestoreBackupContext::new().set_instance_id("example");
14514 /// ```
14515 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14516 self.instance_id = v.into();
14517 self
14518 }
14519
14520 /// Sets the value of [project][crate::model::RestoreBackupContext::project].
14521 ///
14522 /// # Example
14523 /// ```ignore,no_run
14524 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14525 /// let x = RestoreBackupContext::new().set_project("example");
14526 /// ```
14527 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14528 self.project = v.into();
14529 self
14530 }
14531}
14532
14533impl wkt::message::Message for RestoreBackupContext {
14534 fn typename() -> &'static str {
14535 "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
14536 }
14537}
14538
14539/// Instance rotate server CA context.
14540#[derive(Clone, Default, PartialEq)]
14541#[non_exhaustive]
14542pub struct RotateServerCaContext {
14543 /// This is always `sql#rotateServerCaContext`.
14544 pub kind: std::string::String,
14545
14546 /// The fingerprint of the next version to be rotated to. If left unspecified,
14547 /// will be rotated to the most recently added server CA version.
14548 pub next_version: std::string::String,
14549
14550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14551}
14552
14553impl RotateServerCaContext {
14554 /// Creates a new default instance.
14555 pub fn new() -> Self {
14556 std::default::Default::default()
14557 }
14558
14559 /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
14560 ///
14561 /// # Example
14562 /// ```ignore,no_run
14563 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14564 /// let x = RotateServerCaContext::new().set_kind("example");
14565 /// ```
14566 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14567 self.kind = v.into();
14568 self
14569 }
14570
14571 /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
14572 ///
14573 /// # Example
14574 /// ```ignore,no_run
14575 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14576 /// let x = RotateServerCaContext::new().set_next_version("example");
14577 /// ```
14578 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14579 self.next_version = v.into();
14580 self
14581 }
14582}
14583
14584impl wkt::message::Message for RotateServerCaContext {
14585 fn typename() -> &'static str {
14586 "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
14587 }
14588}
14589
14590/// Instance rotate server certificate context.
14591#[derive(Clone, Default, PartialEq)]
14592#[non_exhaustive]
14593pub struct RotateServerCertificateContext {
14594 /// Optional. This is always `sql#rotateServerCertificateContext`.
14595 pub kind: std::string::String,
14596
14597 /// The fingerprint of the next version to be rotated to. If left unspecified,
14598 /// will be rotated to the most recently added server certificate version.
14599 pub next_version: std::string::String,
14600
14601 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14602}
14603
14604impl RotateServerCertificateContext {
14605 /// Creates a new default instance.
14606 pub fn new() -> Self {
14607 std::default::Default::default()
14608 }
14609
14610 /// Sets the value of [kind][crate::model::RotateServerCertificateContext::kind].
14611 ///
14612 /// # Example
14613 /// ```ignore,no_run
14614 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14615 /// let x = RotateServerCertificateContext::new().set_kind("example");
14616 /// ```
14617 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14618 self.kind = v.into();
14619 self
14620 }
14621
14622 /// Sets the value of [next_version][crate::model::RotateServerCertificateContext::next_version].
14623 ///
14624 /// # Example
14625 /// ```ignore,no_run
14626 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14627 /// let x = RotateServerCertificateContext::new().set_next_version("example");
14628 /// ```
14629 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14630 self.next_version = v.into();
14631 self
14632 }
14633}
14634
14635impl wkt::message::Message for RotateServerCertificateContext {
14636 fn typename() -> &'static str {
14637 "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
14638 }
14639}
14640
14641/// Instance rotate Entra ID certificate context.
14642#[derive(Clone, Default, PartialEq)]
14643#[non_exhaustive]
14644pub struct RotateEntraIdCertificateContext {
14645 /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
14646 pub kind: std::string::String,
14647
14648 /// Optional. The fingerprint of the next version to be rotated to. If left
14649 /// unspecified, will be rotated to the most recently added server certificate
14650 /// version.
14651 pub next_version: std::string::String,
14652
14653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14654}
14655
14656impl RotateEntraIdCertificateContext {
14657 /// Creates a new default instance.
14658 pub fn new() -> Self {
14659 std::default::Default::default()
14660 }
14661
14662 /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
14663 ///
14664 /// # Example
14665 /// ```ignore,no_run
14666 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14667 /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
14668 /// ```
14669 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14670 self.kind = v.into();
14671 self
14672 }
14673
14674 /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
14675 ///
14676 /// # Example
14677 /// ```ignore,no_run
14678 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14679 /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
14680 /// ```
14681 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14682 self.next_version = v.into();
14683 self
14684 }
14685}
14686
14687impl wkt::message::Message for RotateEntraIdCertificateContext {
14688 fn typename() -> &'static str {
14689 "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
14690 }
14691}
14692
14693/// Database Instance truncate log context.
14694#[derive(Clone, Default, PartialEq)]
14695#[non_exhaustive]
14696pub struct TruncateLogContext {
14697 /// This is always `sql#truncateLogContext`.
14698 pub kind: std::string::String,
14699
14700 /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
14701 /// `MYSQL_SLOW_TABLE`.
14702 pub log_type: std::string::String,
14703
14704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14705}
14706
14707impl TruncateLogContext {
14708 /// Creates a new default instance.
14709 pub fn new() -> Self {
14710 std::default::Default::default()
14711 }
14712
14713 /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
14714 ///
14715 /// # Example
14716 /// ```ignore,no_run
14717 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14718 /// let x = TruncateLogContext::new().set_kind("example");
14719 /// ```
14720 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14721 self.kind = v.into();
14722 self
14723 }
14724
14725 /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
14726 ///
14727 /// # Example
14728 /// ```ignore,no_run
14729 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14730 /// let x = TruncateLogContext::new().set_log_type("example");
14731 /// ```
14732 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14733 self.log_type = v.into();
14734 self
14735 }
14736}
14737
14738impl wkt::message::Message for TruncateLogContext {
14739 fn typename() -> &'static str {
14740 "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
14741 }
14742}
14743
14744/// External primary instance migration setting error/warning.
14745#[derive(Clone, Default, PartialEq)]
14746#[non_exhaustive]
14747pub struct SqlExternalSyncSettingError {
14748 /// Can be `sql#externalSyncSettingError` or
14749 /// `sql#externalSyncSettingWarning`.
14750 pub kind: std::string::String,
14751
14752 /// Identifies the specific error that occurred.
14753 pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14754
14755 /// Additional information about the error encountered.
14756 pub detail: std::string::String,
14757
14758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14759}
14760
14761impl SqlExternalSyncSettingError {
14762 /// Creates a new default instance.
14763 pub fn new() -> Self {
14764 std::default::Default::default()
14765 }
14766
14767 /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
14768 ///
14769 /// # Example
14770 /// ```ignore,no_run
14771 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14772 /// let x = SqlExternalSyncSettingError::new().set_kind("example");
14773 /// ```
14774 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14775 self.kind = v.into();
14776 self
14777 }
14778
14779 /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
14780 ///
14781 /// # Example
14782 /// ```ignore,no_run
14783 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14784 /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
14785 /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
14786 /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
14787 /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
14788 /// ```
14789 pub fn set_type<
14790 T: std::convert::Into<
14791 crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14792 >,
14793 >(
14794 mut self,
14795 v: T,
14796 ) -> Self {
14797 self.r#type = v.into();
14798 self
14799 }
14800
14801 /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
14802 ///
14803 /// # Example
14804 /// ```ignore,no_run
14805 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14806 /// let x = SqlExternalSyncSettingError::new().set_detail("example");
14807 /// ```
14808 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14809 self.detail = v.into();
14810 self
14811 }
14812}
14813
14814impl wkt::message::Message for SqlExternalSyncSettingError {
14815 fn typename() -> &'static str {
14816 "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
14817 }
14818}
14819
14820/// Defines additional types related to [SqlExternalSyncSettingError].
14821pub mod sql_external_sync_setting_error {
14822 #[allow(unused_imports)]
14823 use super::*;
14824
14825 /// Enum for [SqlExternalSyncSettingErrorType].
14826 ///
14827 /// # Working with unknown values
14828 ///
14829 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14830 /// additional enum variants at any time. Adding new variants is not considered
14831 /// a breaking change. Applications should write their code in anticipation of:
14832 ///
14833 /// - New values appearing in future releases of the client library, **and**
14834 /// - New values received dynamically, without application changes.
14835 ///
14836 /// Please consult the [Working with enums] section in the user guide for some
14837 /// guidelines.
14838 ///
14839 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14840 #[derive(Clone, Debug, PartialEq)]
14841 #[non_exhaustive]
14842 pub enum SqlExternalSyncSettingErrorType {
14843 #[allow(missing_docs)]
14844 Unspecified,
14845 #[allow(missing_docs)]
14846 ConnectionFailure,
14847 #[allow(missing_docs)]
14848 BinlogNotEnabled,
14849 #[allow(missing_docs)]
14850 IncompatibleDatabaseVersion,
14851 #[allow(missing_docs)]
14852 ReplicaAlreadySetup,
14853 /// The replication user is missing privileges that are required.
14854 InsufficientPrivilege,
14855 /// Unsupported migration type.
14856 UnsupportedMigrationType,
14857 /// No pglogical extension installed on databases, applicable for postgres.
14858 NoPglogicalInstalled,
14859 /// pglogical node already exists on databases, applicable for postgres.
14860 PglogicalNodeAlreadyExists,
14861 /// The value of parameter wal_level is not set to logical.
14862 InvalidWalLevel,
14863 /// The value of parameter shared_preload_libraries does not include
14864 /// pglogical.
14865 InvalidSharedPreloadLibrary,
14866 /// The value of parameter max_replication_slots is not sufficient.
14867 InsufficientMaxReplicationSlots,
14868 /// The value of parameter max_wal_senders is not sufficient.
14869 InsufficientMaxWalSenders,
14870 /// The value of parameter max_worker_processes is not sufficient.
14871 InsufficientMaxWorkerProcesses,
14872 /// Extensions installed are either not supported or having unsupported
14873 /// versions.
14874 UnsupportedExtensions,
14875 /// The value of parameter rds.logical_replication is not set to 1.
14876 InvalidRdsLogicalReplication,
14877 /// The primary instance logging setup doesn't allow EM sync.
14878 InvalidLoggingSetup,
14879 /// The primary instance database parameter setup doesn't allow EM sync.
14880 InvalidDbParam,
14881 /// The gtid_mode is not supported, applicable for MySQL.
14882 UnsupportedGtidMode,
14883 /// SQL Server Agent is not running.
14884 SqlserverAgentNotRunning,
14885 /// The table definition is not support due to missing primary key or replica
14886 /// identity, applicable for postgres. Note that this is a warning and won't
14887 /// block the migration.
14888 UnsupportedTableDefinition,
14889 /// The customer has a definer that will break EM setup.
14890 UnsupportedDefiner,
14891 /// SQL Server @@SERVERNAME does not match actual host name.
14892 SqlserverServernameMismatch,
14893 /// The primary instance has been setup and will fail the setup.
14894 PrimaryAlreadySetup,
14895 /// The primary instance has unsupported binary log format.
14896 UnsupportedBinlogFormat,
14897 /// The primary instance's binary log retention setting.
14898 BinlogRetentionSetting,
14899 /// The primary instance has tables with unsupported storage engine.
14900 UnsupportedStorageEngine,
14901 /// Source has tables with limited support
14902 /// eg: PostgreSQL tables without primary keys.
14903 LimitedSupportTables,
14904 /// The replica instance contains existing data.
14905 ExistingDataInReplica,
14906 /// The replication user is missing privileges that are optional.
14907 MissingOptionalPrivileges,
14908 /// Additional BACKUP_ADMIN privilege is granted to the replication user
14909 /// which may lock source MySQL 8 instance for DDLs during initial sync.
14910 RiskyBackupAdminPrivilege,
14911 /// The Cloud Storage bucket is missing necessary permissions.
14912 InsufficientGcsPermissions,
14913 /// The Cloud Storage bucket has an error in the file or contains invalid
14914 /// file information.
14915 InvalidFileInfo,
14916 /// The source instance has unsupported database settings for migration.
14917 UnsupportedDatabaseSettings,
14918 /// The replication user is missing parallel import specific privileges.
14919 /// (e.g. LOCK TABLES) for MySQL.
14920 MysqlParallelImportInsufficientPrivilege,
14921 /// The global variable local_infile is off on external server replica.
14922 LocalInfileOff,
14923 /// This code instructs customers to turn on point-in-time recovery manually
14924 /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
14925 TurnOnPitrAfterPromote,
14926 /// The minor version of replica database is incompatible with the source.
14927 IncompatibleDatabaseMinorVersion,
14928 /// This warning message indicates that Cloud SQL uses the maximum number of
14929 /// subscriptions to migrate data from the source to the destination.
14930 SourceMaxSubscriptions,
14931 /// Unable to verify definers on the source for MySQL.
14932 UnableToVerifyDefiners,
14933 /// If a time out occurs while the subscription counts are calculated, then
14934 /// this value is set to 1. Otherwise, this value is set to 2.
14935 SubscriptionCalculationStatus,
14936 /// Count of subscriptions needed to sync source data for PostgreSQL
14937 /// database.
14938 PgSubscriptionCount,
14939 /// Final parallel level that is used to do migration.
14940 PgSyncParallelLevel,
14941 /// The disk size of the replica instance is smaller than the data size of
14942 /// the source instance.
14943 InsufficientDiskSize,
14944 /// The data size of the source instance is greater than 1 TB, the number of
14945 /// cores of the replica instance is less than 8, and the memory of the
14946 /// replica is less than 32 GB.
14947 InsufficientMachineTier,
14948 /// The warning message indicates the unsupported extensions will not be
14949 /// migrated to the destination.
14950 UnsupportedExtensionsNotMigrated,
14951 /// The warning message indicates the pg_cron extension and settings will not
14952 /// be migrated to the destination.
14953 ExtensionsNotMigrated,
14954 /// The error message indicates that pg_cron flags are enabled on the
14955 /// destination which is not supported during the migration.
14956 PgCronFlagEnabledInReplica,
14957 /// This error message indicates that the specified extensions are not
14958 /// enabled on destination instance. For example, before you can migrate
14959 /// data to the destination instance, you must enable the PGAudit extension
14960 /// on the instance.
14961 ExtensionsNotEnabledInReplica,
14962 /// The source database has generated columns that can't be migrated. Please
14963 /// change them to regular columns before migration.
14964 UnsupportedColumns,
14965 /// The source database has users that aren't created in the replica.
14966 /// First, create all users, which are in the pg_user_mappings table
14967 /// of the source database, in the destination instance. Then, perform the
14968 /// migration.
14969 UsersNotCreatedInReplica,
14970 /// The selected objects include system objects that aren't supported for
14971 /// migration.
14972 UnsupportedSystemObjects,
14973 /// The source database has tables with the FULL or NOTHING replica identity.
14974 /// Before starting your migration, either remove the identity or change it
14975 /// to DEFAULT. Note that this is an error and will block the migration.
14976 UnsupportedTablesWithReplicaIdentity,
14977 /// The selected objects don't exist on the source instance.
14978 SelectedObjectsNotExistOnSource,
14979 /// PSC only destination instance does not have a network attachment URI.
14980 PscOnlyInstanceWithNoNetworkAttachmentUri,
14981 /// Selected objects reference unselected objects. Based on their object type
14982 /// (foreign key constraint or view), selected objects will fail during
14983 /// migration.
14984 SelectedObjectsReferenceUnselectedObjects,
14985 /// The migration will delete existing data in the replica; set
14986 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14987 /// in the request to acknowledge this. This is an error. MySQL only.
14988 ///
14989 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14990 PromptDeleteExisting,
14991 /// The migration will delete existing data in the replica;
14992 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14993 /// was set in the request acknowledging this. This is a warning rather than
14994 /// an error. MySQL only.
14995 ///
14996 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14997 WillDeleteExisting,
14998 /// The replication user is missing specific privileges to setup DDL
14999 /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
15000 PgDdlReplicationInsufficientPrivilege,
15001 /// If set, the enum was initialized with an unknown value.
15002 ///
15003 /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
15004 /// [SqlExternalSyncSettingErrorType::name].
15005 UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
15006 }
15007
15008 #[doc(hidden)]
15009 pub mod sql_external_sync_setting_error_type {
15010 #[allow(unused_imports)]
15011 use super::*;
15012 #[derive(Clone, Debug, PartialEq)]
15013 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15014 }
15015
15016 impl SqlExternalSyncSettingErrorType {
15017 /// Gets the enum value.
15018 ///
15019 /// Returns `None` if the enum contains an unknown value deserialized from
15020 /// the string representation of enums.
15021 pub fn value(&self) -> std::option::Option<i32> {
15022 match self {
15023 Self::Unspecified => std::option::Option::Some(0),
15024 Self::ConnectionFailure => std::option::Option::Some(1),
15025 Self::BinlogNotEnabled => std::option::Option::Some(2),
15026 Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
15027 Self::ReplicaAlreadySetup => std::option::Option::Some(4),
15028 Self::InsufficientPrivilege => std::option::Option::Some(5),
15029 Self::UnsupportedMigrationType => std::option::Option::Some(6),
15030 Self::NoPglogicalInstalled => std::option::Option::Some(7),
15031 Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
15032 Self::InvalidWalLevel => std::option::Option::Some(9),
15033 Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
15034 Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
15035 Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
15036 Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
15037 Self::UnsupportedExtensions => std::option::Option::Some(14),
15038 Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
15039 Self::InvalidLoggingSetup => std::option::Option::Some(16),
15040 Self::InvalidDbParam => std::option::Option::Some(17),
15041 Self::UnsupportedGtidMode => std::option::Option::Some(18),
15042 Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
15043 Self::UnsupportedTableDefinition => std::option::Option::Some(20),
15044 Self::UnsupportedDefiner => std::option::Option::Some(21),
15045 Self::SqlserverServernameMismatch => std::option::Option::Some(22),
15046 Self::PrimaryAlreadySetup => std::option::Option::Some(23),
15047 Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
15048 Self::BinlogRetentionSetting => std::option::Option::Some(25),
15049 Self::UnsupportedStorageEngine => std::option::Option::Some(26),
15050 Self::LimitedSupportTables => std::option::Option::Some(27),
15051 Self::ExistingDataInReplica => std::option::Option::Some(28),
15052 Self::MissingOptionalPrivileges => std::option::Option::Some(29),
15053 Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
15054 Self::InsufficientGcsPermissions => std::option::Option::Some(31),
15055 Self::InvalidFileInfo => std::option::Option::Some(32),
15056 Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
15057 Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
15058 Self::LocalInfileOff => std::option::Option::Some(35),
15059 Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
15060 Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
15061 Self::SourceMaxSubscriptions => std::option::Option::Some(38),
15062 Self::UnableToVerifyDefiners => std::option::Option::Some(39),
15063 Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
15064 Self::PgSubscriptionCount => std::option::Option::Some(41),
15065 Self::PgSyncParallelLevel => std::option::Option::Some(42),
15066 Self::InsufficientDiskSize => std::option::Option::Some(43),
15067 Self::InsufficientMachineTier => std::option::Option::Some(44),
15068 Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
15069 Self::ExtensionsNotMigrated => std::option::Option::Some(46),
15070 Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
15071 Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
15072 Self::UnsupportedColumns => std::option::Option::Some(49),
15073 Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
15074 Self::UnsupportedSystemObjects => std::option::Option::Some(51),
15075 Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
15076 Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
15077 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
15078 Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
15079 Self::PromptDeleteExisting => std::option::Option::Some(56),
15080 Self::WillDeleteExisting => std::option::Option::Some(57),
15081 Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
15082 Self::UnknownValue(u) => u.0.value(),
15083 }
15084 }
15085
15086 /// Gets the enum value as a string.
15087 ///
15088 /// Returns `None` if the enum contains an unknown value deserialized from
15089 /// the integer representation of enums.
15090 pub fn name(&self) -> std::option::Option<&str> {
15091 match self {
15092 Self::Unspecified => {
15093 std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
15094 }
15095 Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
15096 Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
15097 Self::IncompatibleDatabaseVersion => {
15098 std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
15099 }
15100 Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
15101 Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
15102 Self::UnsupportedMigrationType => {
15103 std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
15104 }
15105 Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
15106 Self::PglogicalNodeAlreadyExists => {
15107 std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
15108 }
15109 Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
15110 Self::InvalidSharedPreloadLibrary => {
15111 std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
15112 }
15113 Self::InsufficientMaxReplicationSlots => {
15114 std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
15115 }
15116 Self::InsufficientMaxWalSenders => {
15117 std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
15118 }
15119 Self::InsufficientMaxWorkerProcesses => {
15120 std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
15121 }
15122 Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
15123 Self::InvalidRdsLogicalReplication => {
15124 std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
15125 }
15126 Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
15127 Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
15128 Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
15129 Self::SqlserverAgentNotRunning => {
15130 std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
15131 }
15132 Self::UnsupportedTableDefinition => {
15133 std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
15134 }
15135 Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
15136 Self::SqlserverServernameMismatch => {
15137 std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
15138 }
15139 Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
15140 Self::UnsupportedBinlogFormat => {
15141 std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
15142 }
15143 Self::BinlogRetentionSetting => {
15144 std::option::Option::Some("BINLOG_RETENTION_SETTING")
15145 }
15146 Self::UnsupportedStorageEngine => {
15147 std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
15148 }
15149 Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
15150 Self::ExistingDataInReplica => {
15151 std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
15152 }
15153 Self::MissingOptionalPrivileges => {
15154 std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
15155 }
15156 Self::RiskyBackupAdminPrivilege => {
15157 std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
15158 }
15159 Self::InsufficientGcsPermissions => {
15160 std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
15161 }
15162 Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
15163 Self::UnsupportedDatabaseSettings => {
15164 std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
15165 }
15166 Self::MysqlParallelImportInsufficientPrivilege => {
15167 std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
15168 }
15169 Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
15170 Self::TurnOnPitrAfterPromote => {
15171 std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
15172 }
15173 Self::IncompatibleDatabaseMinorVersion => {
15174 std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
15175 }
15176 Self::SourceMaxSubscriptions => {
15177 std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
15178 }
15179 Self::UnableToVerifyDefiners => {
15180 std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
15181 }
15182 Self::SubscriptionCalculationStatus => {
15183 std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
15184 }
15185 Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
15186 Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
15187 Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
15188 Self::InsufficientMachineTier => {
15189 std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
15190 }
15191 Self::UnsupportedExtensionsNotMigrated => {
15192 std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
15193 }
15194 Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
15195 Self::PgCronFlagEnabledInReplica => {
15196 std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
15197 }
15198 Self::ExtensionsNotEnabledInReplica => {
15199 std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
15200 }
15201 Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
15202 Self::UsersNotCreatedInReplica => {
15203 std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
15204 }
15205 Self::UnsupportedSystemObjects => {
15206 std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
15207 }
15208 Self::UnsupportedTablesWithReplicaIdentity => {
15209 std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
15210 }
15211 Self::SelectedObjectsNotExistOnSource => {
15212 std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
15213 }
15214 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
15215 std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
15216 }
15217 Self::SelectedObjectsReferenceUnselectedObjects => {
15218 std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
15219 }
15220 Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
15221 Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
15222 Self::PgDdlReplicationInsufficientPrivilege => {
15223 std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
15224 }
15225 Self::UnknownValue(u) => u.0.name(),
15226 }
15227 }
15228 }
15229
15230 impl std::default::Default for SqlExternalSyncSettingErrorType {
15231 fn default() -> Self {
15232 use std::convert::From;
15233 Self::from(0)
15234 }
15235 }
15236
15237 impl std::fmt::Display for SqlExternalSyncSettingErrorType {
15238 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15239 wkt::internal::display_enum(f, self.name(), self.value())
15240 }
15241 }
15242
15243 impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
15244 fn from(value: i32) -> Self {
15245 match value {
15246 0 => Self::Unspecified,
15247 1 => Self::ConnectionFailure,
15248 2 => Self::BinlogNotEnabled,
15249 3 => Self::IncompatibleDatabaseVersion,
15250 4 => Self::ReplicaAlreadySetup,
15251 5 => Self::InsufficientPrivilege,
15252 6 => Self::UnsupportedMigrationType,
15253 7 => Self::NoPglogicalInstalled,
15254 8 => Self::PglogicalNodeAlreadyExists,
15255 9 => Self::InvalidWalLevel,
15256 10 => Self::InvalidSharedPreloadLibrary,
15257 11 => Self::InsufficientMaxReplicationSlots,
15258 12 => Self::InsufficientMaxWalSenders,
15259 13 => Self::InsufficientMaxWorkerProcesses,
15260 14 => Self::UnsupportedExtensions,
15261 15 => Self::InvalidRdsLogicalReplication,
15262 16 => Self::InvalidLoggingSetup,
15263 17 => Self::InvalidDbParam,
15264 18 => Self::UnsupportedGtidMode,
15265 19 => Self::SqlserverAgentNotRunning,
15266 20 => Self::UnsupportedTableDefinition,
15267 21 => Self::UnsupportedDefiner,
15268 22 => Self::SqlserverServernameMismatch,
15269 23 => Self::PrimaryAlreadySetup,
15270 24 => Self::UnsupportedBinlogFormat,
15271 25 => Self::BinlogRetentionSetting,
15272 26 => Self::UnsupportedStorageEngine,
15273 27 => Self::LimitedSupportTables,
15274 28 => Self::ExistingDataInReplica,
15275 29 => Self::MissingOptionalPrivileges,
15276 30 => Self::RiskyBackupAdminPrivilege,
15277 31 => Self::InsufficientGcsPermissions,
15278 32 => Self::InvalidFileInfo,
15279 33 => Self::UnsupportedDatabaseSettings,
15280 34 => Self::MysqlParallelImportInsufficientPrivilege,
15281 35 => Self::LocalInfileOff,
15282 36 => Self::TurnOnPitrAfterPromote,
15283 37 => Self::IncompatibleDatabaseMinorVersion,
15284 38 => Self::SourceMaxSubscriptions,
15285 39 => Self::UnableToVerifyDefiners,
15286 40 => Self::SubscriptionCalculationStatus,
15287 41 => Self::PgSubscriptionCount,
15288 42 => Self::PgSyncParallelLevel,
15289 43 => Self::InsufficientDiskSize,
15290 44 => Self::InsufficientMachineTier,
15291 45 => Self::UnsupportedExtensionsNotMigrated,
15292 46 => Self::ExtensionsNotMigrated,
15293 47 => Self::PgCronFlagEnabledInReplica,
15294 48 => Self::ExtensionsNotEnabledInReplica,
15295 49 => Self::UnsupportedColumns,
15296 50 => Self::UsersNotCreatedInReplica,
15297 51 => Self::UnsupportedSystemObjects,
15298 52 => Self::UnsupportedTablesWithReplicaIdentity,
15299 53 => Self::SelectedObjectsNotExistOnSource,
15300 54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
15301 55 => Self::SelectedObjectsReferenceUnselectedObjects,
15302 56 => Self::PromptDeleteExisting,
15303 57 => Self::WillDeleteExisting,
15304 58 => Self::PgDdlReplicationInsufficientPrivilege,
15305 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15306 wkt::internal::UnknownEnumValue::Integer(value),
15307 )),
15308 }
15309 }
15310 }
15311
15312 impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
15313 fn from(value: &str) -> Self {
15314 use std::string::ToString;
15315 match value {
15316 "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
15317 "CONNECTION_FAILURE" => Self::ConnectionFailure,
15318 "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
15319 "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
15320 "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
15321 "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
15322 "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
15323 "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
15324 "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
15325 "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
15326 "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
15327 "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
15328 "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
15329 "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
15330 "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
15331 "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
15332 "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
15333 "INVALID_DB_PARAM" => Self::InvalidDbParam,
15334 "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
15335 "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
15336 "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
15337 "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
15338 "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
15339 "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
15340 "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
15341 "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
15342 "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
15343 "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
15344 "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
15345 "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
15346 "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
15347 "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
15348 "INVALID_FILE_INFO" => Self::InvalidFileInfo,
15349 "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
15350 "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
15351 Self::MysqlParallelImportInsufficientPrivilege
15352 }
15353 "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
15354 "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
15355 "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
15356 "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
15357 "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
15358 "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
15359 "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
15360 "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
15361 "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
15362 "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
15363 "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
15364 "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
15365 "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
15366 "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
15367 "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
15368 "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
15369 "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
15370 "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
15371 Self::UnsupportedTablesWithReplicaIdentity
15372 }
15373 "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
15374 "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
15375 Self::PscOnlyInstanceWithNoNetworkAttachmentUri
15376 }
15377 "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
15378 Self::SelectedObjectsReferenceUnselectedObjects
15379 }
15380 "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
15381 "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
15382 "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
15383 Self::PgDdlReplicationInsufficientPrivilege
15384 }
15385 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15386 wkt::internal::UnknownEnumValue::String(value.to_string()),
15387 )),
15388 }
15389 }
15390 }
15391
15392 impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
15393 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15394 where
15395 S: serde::Serializer,
15396 {
15397 match self {
15398 Self::Unspecified => serializer.serialize_i32(0),
15399 Self::ConnectionFailure => serializer.serialize_i32(1),
15400 Self::BinlogNotEnabled => serializer.serialize_i32(2),
15401 Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
15402 Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
15403 Self::InsufficientPrivilege => serializer.serialize_i32(5),
15404 Self::UnsupportedMigrationType => serializer.serialize_i32(6),
15405 Self::NoPglogicalInstalled => serializer.serialize_i32(7),
15406 Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
15407 Self::InvalidWalLevel => serializer.serialize_i32(9),
15408 Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
15409 Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
15410 Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
15411 Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
15412 Self::UnsupportedExtensions => serializer.serialize_i32(14),
15413 Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
15414 Self::InvalidLoggingSetup => serializer.serialize_i32(16),
15415 Self::InvalidDbParam => serializer.serialize_i32(17),
15416 Self::UnsupportedGtidMode => serializer.serialize_i32(18),
15417 Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
15418 Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
15419 Self::UnsupportedDefiner => serializer.serialize_i32(21),
15420 Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
15421 Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
15422 Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
15423 Self::BinlogRetentionSetting => serializer.serialize_i32(25),
15424 Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
15425 Self::LimitedSupportTables => serializer.serialize_i32(27),
15426 Self::ExistingDataInReplica => serializer.serialize_i32(28),
15427 Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
15428 Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
15429 Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
15430 Self::InvalidFileInfo => serializer.serialize_i32(32),
15431 Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
15432 Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
15433 Self::LocalInfileOff => serializer.serialize_i32(35),
15434 Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
15435 Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
15436 Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
15437 Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
15438 Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
15439 Self::PgSubscriptionCount => serializer.serialize_i32(41),
15440 Self::PgSyncParallelLevel => serializer.serialize_i32(42),
15441 Self::InsufficientDiskSize => serializer.serialize_i32(43),
15442 Self::InsufficientMachineTier => serializer.serialize_i32(44),
15443 Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
15444 Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
15445 Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
15446 Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
15447 Self::UnsupportedColumns => serializer.serialize_i32(49),
15448 Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
15449 Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
15450 Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
15451 Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
15452 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
15453 Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
15454 Self::PromptDeleteExisting => serializer.serialize_i32(56),
15455 Self::WillDeleteExisting => serializer.serialize_i32(57),
15456 Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
15457 Self::UnknownValue(u) => u.0.serialize(serializer),
15458 }
15459 }
15460 }
15461
15462 impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
15463 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15464 where
15465 D: serde::Deserializer<'de>,
15466 {
15467 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
15468 SqlExternalSyncSettingErrorType,
15469 >::new(
15470 ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
15471 ))
15472 }
15473 }
15474}
15475
15476/// A list of objects that the user selects for replication from an external
15477/// source instance.
15478#[derive(Clone, Default, PartialEq)]
15479#[non_exhaustive]
15480pub struct SelectedObjects {
15481 /// Required. The name of the database to migrate.
15482 pub database: std::string::String,
15483
15484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15485}
15486
15487impl SelectedObjects {
15488 /// Creates a new default instance.
15489 pub fn new() -> Self {
15490 std::default::Default::default()
15491 }
15492
15493 /// Sets the value of [database][crate::model::SelectedObjects::database].
15494 ///
15495 /// # Example
15496 /// ```ignore,no_run
15497 /// # use google_cloud_sql_v1::model::SelectedObjects;
15498 /// let x = SelectedObjects::new().set_database("example");
15499 /// ```
15500 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15501 self.database = v.into();
15502 self
15503 }
15504}
15505
15506impl wkt::message::Message for SelectedObjects {
15507 fn typename() -> &'static str {
15508 "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
15509 }
15510}
15511
15512/// On-premises instance configuration.
15513#[derive(Clone, Default, PartialEq)]
15514#[non_exhaustive]
15515pub struct OnPremisesConfiguration {
15516 /// The host and port of the on-premises instance in host:port format
15517 pub host_port: std::string::String,
15518
15519 /// This is always `sql#onPremisesConfiguration`.
15520 pub kind: std::string::String,
15521
15522 /// The username for connecting to on-premises instance.
15523 pub username: std::string::String,
15524
15525 /// The password for connecting to on-premises instance.
15526 pub password: std::string::String,
15527
15528 /// PEM representation of the trusted CA's x509 certificate.
15529 pub ca_certificate: std::string::String,
15530
15531 /// PEM representation of the replica's x509 certificate.
15532 pub client_certificate: std::string::String,
15533
15534 /// PEM representation of the replica's private key. The corresponding public
15535 /// key is encoded in the client's certificate.
15536 pub client_key: std::string::String,
15537
15538 /// The dump file to create the Cloud SQL replica.
15539 pub dump_file_path: std::string::String,
15540
15541 /// The reference to Cloud SQL instance if the source is Cloud SQL.
15542 pub source_instance: std::option::Option<crate::model::InstanceReference>,
15543
15544 /// Optional. A list of objects that the user selects for replication from an
15545 /// external source instance.
15546 pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
15547
15548 /// Optional. SSL option for replica connection to the on-premises source.
15549 pub ssl_option: crate::model::on_premises_configuration::SslOption,
15550
15551 /// Output only. Indicates whether the resource is managed by Database
15552 /// Migration Service.
15553 pub dms_managed: bool,
15554
15555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15556}
15557
15558impl OnPremisesConfiguration {
15559 /// Creates a new default instance.
15560 pub fn new() -> Self {
15561 std::default::Default::default()
15562 }
15563
15564 /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
15565 ///
15566 /// # Example
15567 /// ```ignore,no_run
15568 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15569 /// let x = OnPremisesConfiguration::new().set_host_port("example");
15570 /// ```
15571 pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15572 self.host_port = v.into();
15573 self
15574 }
15575
15576 /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
15577 ///
15578 /// # Example
15579 /// ```ignore,no_run
15580 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15581 /// let x = OnPremisesConfiguration::new().set_kind("example");
15582 /// ```
15583 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15584 self.kind = v.into();
15585 self
15586 }
15587
15588 /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
15589 ///
15590 /// # Example
15591 /// ```ignore,no_run
15592 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15593 /// let x = OnPremisesConfiguration::new().set_username("example");
15594 /// ```
15595 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15596 self.username = v.into();
15597 self
15598 }
15599
15600 /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
15601 ///
15602 /// # Example
15603 /// ```ignore,no_run
15604 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15605 /// let x = OnPremisesConfiguration::new().set_password("example");
15606 /// ```
15607 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15608 self.password = v.into();
15609 self
15610 }
15611
15612 /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
15613 ///
15614 /// # Example
15615 /// ```ignore,no_run
15616 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15617 /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
15618 /// ```
15619 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15620 self.ca_certificate = v.into();
15621 self
15622 }
15623
15624 /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
15625 ///
15626 /// # Example
15627 /// ```ignore,no_run
15628 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15629 /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
15630 /// ```
15631 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15632 mut self,
15633 v: T,
15634 ) -> Self {
15635 self.client_certificate = v.into();
15636 self
15637 }
15638
15639 /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
15640 ///
15641 /// # Example
15642 /// ```ignore,no_run
15643 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15644 /// let x = OnPremisesConfiguration::new().set_client_key("example");
15645 /// ```
15646 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15647 self.client_key = v.into();
15648 self
15649 }
15650
15651 /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
15652 ///
15653 /// # Example
15654 /// ```ignore,no_run
15655 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15656 /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
15657 /// ```
15658 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15659 self.dump_file_path = v.into();
15660 self
15661 }
15662
15663 /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15664 ///
15665 /// # Example
15666 /// ```ignore,no_run
15667 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15668 /// use google_cloud_sql_v1::model::InstanceReference;
15669 /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
15670 /// ```
15671 pub fn set_source_instance<T>(mut self, v: T) -> Self
15672 where
15673 T: std::convert::Into<crate::model::InstanceReference>,
15674 {
15675 self.source_instance = std::option::Option::Some(v.into());
15676 self
15677 }
15678
15679 /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15680 ///
15681 /// # Example
15682 /// ```ignore,no_run
15683 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15684 /// use google_cloud_sql_v1::model::InstanceReference;
15685 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
15686 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
15687 /// ```
15688 pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
15689 where
15690 T: std::convert::Into<crate::model::InstanceReference>,
15691 {
15692 self.source_instance = v.map(|x| x.into());
15693 self
15694 }
15695
15696 /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
15697 ///
15698 /// # Example
15699 /// ```ignore,no_run
15700 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15701 /// use google_cloud_sql_v1::model::SelectedObjects;
15702 /// let x = OnPremisesConfiguration::new()
15703 /// .set_selected_objects([
15704 /// SelectedObjects::default()/* use setters */,
15705 /// SelectedObjects::default()/* use (different) setters */,
15706 /// ]);
15707 /// ```
15708 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
15709 where
15710 T: std::iter::IntoIterator<Item = V>,
15711 V: std::convert::Into<crate::model::SelectedObjects>,
15712 {
15713 use std::iter::Iterator;
15714 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
15715 self
15716 }
15717
15718 /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
15719 ///
15720 /// # Example
15721 /// ```ignore,no_run
15722 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15723 /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
15724 /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
15725 /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
15726 /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
15727 /// ```
15728 pub fn set_ssl_option<
15729 T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
15730 >(
15731 mut self,
15732 v: T,
15733 ) -> Self {
15734 self.ssl_option = v.into();
15735 self
15736 }
15737
15738 /// Sets the value of [dms_managed][crate::model::OnPremisesConfiguration::dms_managed].
15739 ///
15740 /// # Example
15741 /// ```ignore,no_run
15742 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15743 /// let x = OnPremisesConfiguration::new().set_dms_managed(true);
15744 /// ```
15745 pub fn set_dms_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15746 self.dms_managed = v.into();
15747 self
15748 }
15749}
15750
15751impl wkt::message::Message for OnPremisesConfiguration {
15752 fn typename() -> &'static str {
15753 "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
15754 }
15755}
15756
15757/// Defines additional types related to [OnPremisesConfiguration].
15758pub mod on_premises_configuration {
15759 #[allow(unused_imports)]
15760 use super::*;
15761
15762 /// SslOption defines the SSL mode to be used for replica connection to the
15763 /// on-premises source.
15764 ///
15765 /// # Working with unknown values
15766 ///
15767 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15768 /// additional enum variants at any time. Adding new variants is not considered
15769 /// a breaking change. Applications should write their code in anticipation of:
15770 ///
15771 /// - New values appearing in future releases of the client library, **and**
15772 /// - New values received dynamically, without application changes.
15773 ///
15774 /// Please consult the [Working with enums] section in the user guide for some
15775 /// guidelines.
15776 ///
15777 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15778 #[derive(Clone, Debug, PartialEq)]
15779 #[non_exhaustive]
15780 pub enum SslOption {
15781 /// Unknown SSL option i.e. SSL option not specified by user.
15782 Unspecified,
15783 /// SSL is not used for replica connection to the on-premises source.
15784 Disable,
15785 /// SSL is required for replica connection to the on-premises source.
15786 Require,
15787 /// Verify CA is required for replica connection to the on-premises source.
15788 VerifyCa,
15789 /// If set, the enum was initialized with an unknown value.
15790 ///
15791 /// Applications can examine the value using [SslOption::value] or
15792 /// [SslOption::name].
15793 UnknownValue(ssl_option::UnknownValue),
15794 }
15795
15796 #[doc(hidden)]
15797 pub mod ssl_option {
15798 #[allow(unused_imports)]
15799 use super::*;
15800 #[derive(Clone, Debug, PartialEq)]
15801 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15802 }
15803
15804 impl SslOption {
15805 /// Gets the enum value.
15806 ///
15807 /// Returns `None` if the enum contains an unknown value deserialized from
15808 /// the string representation of enums.
15809 pub fn value(&self) -> std::option::Option<i32> {
15810 match self {
15811 Self::Unspecified => std::option::Option::Some(0),
15812 Self::Disable => std::option::Option::Some(1),
15813 Self::Require => std::option::Option::Some(2),
15814 Self::VerifyCa => std::option::Option::Some(3),
15815 Self::UnknownValue(u) => u.0.value(),
15816 }
15817 }
15818
15819 /// Gets the enum value as a string.
15820 ///
15821 /// Returns `None` if the enum contains an unknown value deserialized from
15822 /// the integer representation of enums.
15823 pub fn name(&self) -> std::option::Option<&str> {
15824 match self {
15825 Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
15826 Self::Disable => std::option::Option::Some("DISABLE"),
15827 Self::Require => std::option::Option::Some("REQUIRE"),
15828 Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
15829 Self::UnknownValue(u) => u.0.name(),
15830 }
15831 }
15832 }
15833
15834 impl std::default::Default for SslOption {
15835 fn default() -> Self {
15836 use std::convert::From;
15837 Self::from(0)
15838 }
15839 }
15840
15841 impl std::fmt::Display for SslOption {
15842 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15843 wkt::internal::display_enum(f, self.name(), self.value())
15844 }
15845 }
15846
15847 impl std::convert::From<i32> for SslOption {
15848 fn from(value: i32) -> Self {
15849 match value {
15850 0 => Self::Unspecified,
15851 1 => Self::Disable,
15852 2 => Self::Require,
15853 3 => Self::VerifyCa,
15854 _ => Self::UnknownValue(ssl_option::UnknownValue(
15855 wkt::internal::UnknownEnumValue::Integer(value),
15856 )),
15857 }
15858 }
15859 }
15860
15861 impl std::convert::From<&str> for SslOption {
15862 fn from(value: &str) -> Self {
15863 use std::string::ToString;
15864 match value {
15865 "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
15866 "DISABLE" => Self::Disable,
15867 "REQUIRE" => Self::Require,
15868 "VERIFY_CA" => Self::VerifyCa,
15869 _ => Self::UnknownValue(ssl_option::UnknownValue(
15870 wkt::internal::UnknownEnumValue::String(value.to_string()),
15871 )),
15872 }
15873 }
15874 }
15875
15876 impl serde::ser::Serialize for SslOption {
15877 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15878 where
15879 S: serde::Serializer,
15880 {
15881 match self {
15882 Self::Unspecified => serializer.serialize_i32(0),
15883 Self::Disable => serializer.serialize_i32(1),
15884 Self::Require => serializer.serialize_i32(2),
15885 Self::VerifyCa => serializer.serialize_i32(3),
15886 Self::UnknownValue(u) => u.0.serialize(serializer),
15887 }
15888 }
15889 }
15890
15891 impl<'de> serde::de::Deserialize<'de> for SslOption {
15892 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15893 where
15894 D: serde::Deserializer<'de>,
15895 {
15896 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
15897 ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
15898 ))
15899 }
15900 }
15901}
15902
15903/// Read-replica configuration for connecting to the primary instance.
15904#[derive(Clone, Default, PartialEq)]
15905#[non_exhaustive]
15906pub struct ReplicaConfiguration {
15907 /// This is always `sql#replicaConfiguration`.
15908 pub kind: std::string::String,
15909
15910 /// MySQL specific configuration when replicating from a MySQL on-premises
15911 /// primary instance. Replication configuration information such as the
15912 /// username, password, certificates, and keys are not stored in the instance
15913 /// metadata. The configuration information is used only to set up the
15914 /// replication connection and is stored by MySQL in a file named
15915 /// `master.info` in the data directory.
15916 pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
15917
15918 /// Specifies if the replica is the failover target. If the field is set to
15919 /// `true`, the replica will be designated as a failover replica. In case the
15920 /// primary instance fails, the replica instance will be promoted as the new
15921 /// primary instance. Only one replica can be specified as failover target, and
15922 /// the replica has to be in different zone with the primary instance.
15923 pub failover_target: std::option::Option<wkt::BoolValue>,
15924
15925 /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
15926 /// cascadable replica is a SQL Server cross region replica that supports
15927 /// replica(s) under it.
15928 pub cascadable_replica: std::option::Option<wkt::BoolValue>,
15929
15930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15931}
15932
15933impl ReplicaConfiguration {
15934 /// Creates a new default instance.
15935 pub fn new() -> Self {
15936 std::default::Default::default()
15937 }
15938
15939 /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
15940 ///
15941 /// # Example
15942 /// ```ignore,no_run
15943 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15944 /// let x = ReplicaConfiguration::new().set_kind("example");
15945 /// ```
15946 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15947 self.kind = v.into();
15948 self
15949 }
15950
15951 /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15952 ///
15953 /// # Example
15954 /// ```ignore,no_run
15955 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15956 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15957 /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
15958 /// ```
15959 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
15960 where
15961 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15962 {
15963 self.mysql_replica_configuration = std::option::Option::Some(v.into());
15964 self
15965 }
15966
15967 /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15968 ///
15969 /// # Example
15970 /// ```ignore,no_run
15971 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15972 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15973 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
15974 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
15975 /// ```
15976 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15977 where
15978 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15979 {
15980 self.mysql_replica_configuration = v.map(|x| x.into());
15981 self
15982 }
15983
15984 /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15985 ///
15986 /// # Example
15987 /// ```ignore,no_run
15988 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15989 /// use wkt::BoolValue;
15990 /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
15991 /// ```
15992 pub fn set_failover_target<T>(mut self, v: T) -> Self
15993 where
15994 T: std::convert::Into<wkt::BoolValue>,
15995 {
15996 self.failover_target = std::option::Option::Some(v.into());
15997 self
15998 }
15999
16000 /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
16001 ///
16002 /// # Example
16003 /// ```ignore,no_run
16004 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16005 /// use wkt::BoolValue;
16006 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
16007 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
16008 /// ```
16009 pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
16010 where
16011 T: std::convert::Into<wkt::BoolValue>,
16012 {
16013 self.failover_target = v.map(|x| x.into());
16014 self
16015 }
16016
16017 /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
16018 ///
16019 /// # Example
16020 /// ```ignore,no_run
16021 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16022 /// use wkt::BoolValue;
16023 /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
16024 /// ```
16025 pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
16026 where
16027 T: std::convert::Into<wkt::BoolValue>,
16028 {
16029 self.cascadable_replica = std::option::Option::Some(v.into());
16030 self
16031 }
16032
16033 /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
16034 ///
16035 /// # Example
16036 /// ```ignore,no_run
16037 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16038 /// use wkt::BoolValue;
16039 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
16040 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
16041 /// ```
16042 pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
16043 where
16044 T: std::convert::Into<wkt::BoolValue>,
16045 {
16046 self.cascadable_replica = v.map(|x| x.into());
16047 self
16048 }
16049}
16050
16051impl wkt::message::Message for ReplicaConfiguration {
16052 fn typename() -> &'static str {
16053 "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
16054 }
16055}
16056
16057/// Execute SQL statements request.
16058#[derive(Clone, Default, PartialEq)]
16059#[non_exhaustive]
16060pub struct SqlInstancesExecuteSqlRequest {
16061 /// Required. Database instance ID. This does not include the project ID.
16062 pub instance: std::string::String,
16063
16064 /// Required. Project ID of the project that contains the instance.
16065 pub project: std::string::String,
16066
16067 /// The request body.
16068 pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
16069
16070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16071}
16072
16073impl SqlInstancesExecuteSqlRequest {
16074 /// Creates a new default instance.
16075 pub fn new() -> Self {
16076 std::default::Default::default()
16077 }
16078
16079 /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
16080 ///
16081 /// # Example
16082 /// ```ignore,no_run
16083 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16084 /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
16085 /// ```
16086 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16087 self.instance = v.into();
16088 self
16089 }
16090
16091 /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
16092 ///
16093 /// # Example
16094 /// ```ignore,no_run
16095 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16096 /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
16097 /// ```
16098 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16099 self.project = v.into();
16100 self
16101 }
16102
16103 /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
16104 ///
16105 /// # Example
16106 /// ```ignore,no_run
16107 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16108 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
16109 /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
16110 /// ```
16111 pub fn set_body<T>(mut self, v: T) -> Self
16112 where
16113 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
16114 {
16115 self.body = std::option::Option::Some(v.into());
16116 self
16117 }
16118
16119 /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
16120 ///
16121 /// # Example
16122 /// ```ignore,no_run
16123 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16124 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
16125 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
16126 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
16127 /// ```
16128 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16129 where
16130 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
16131 {
16132 self.body = v.map(|x| x.into());
16133 self
16134 }
16135}
16136
16137impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
16138 fn typename() -> &'static str {
16139 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
16140 }
16141}
16142
16143/// The request payload used to execute SQL statements.
16144#[derive(Clone, Default, PartialEq)]
16145#[non_exhaustive]
16146pub struct ExecuteSqlPayload {
16147 /// Optional. The name of an existing database user to connect to the database.
16148 /// When `auto_iam_authn` is set to true, this field is ignored and the API
16149 /// caller's IAM user is used.
16150 pub user: std::string::String,
16151
16152 /// Required. SQL statements to run on the database. It can be a single
16153 /// statement or a sequence of statements separated by semicolons.
16154 pub sql_statement: std::string::String,
16155
16156 /// Optional. Name of the database on which the statement will be executed.
16157 pub database: std::string::String,
16158
16159 /// Optional. The maximum number of rows returned per SQL statement.
16160 pub row_limit: i64,
16161
16162 /// Optional. Controls how the API should respond when the SQL execution result
16163 /// is incomplete due to the size limit or another error. The default mode is
16164 /// to throw an error.
16165 pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
16166
16167 /// Optional. Specifies the name of the application that is making the request.
16168 /// This field is used for telemetry. Only alphanumeric characters, dashes, and
16169 /// underscores are allowed. The maximum length is 32 characters.
16170 pub application: std::string::String,
16171
16172 /// Credentials for the database connection.
16173 pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
16174
16175 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16176}
16177
16178impl ExecuteSqlPayload {
16179 /// Creates a new default instance.
16180 pub fn new() -> Self {
16181 std::default::Default::default()
16182 }
16183
16184 /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
16185 ///
16186 /// # Example
16187 /// ```ignore,no_run
16188 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16189 /// let x = ExecuteSqlPayload::new().set_user("example");
16190 /// ```
16191 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16192 self.user = v.into();
16193 self
16194 }
16195
16196 /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
16197 ///
16198 /// # Example
16199 /// ```ignore,no_run
16200 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16201 /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
16202 /// ```
16203 pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16204 self.sql_statement = v.into();
16205 self
16206 }
16207
16208 /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
16209 ///
16210 /// # Example
16211 /// ```ignore,no_run
16212 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16213 /// let x = ExecuteSqlPayload::new().set_database("example");
16214 /// ```
16215 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16216 self.database = v.into();
16217 self
16218 }
16219
16220 /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
16221 ///
16222 /// # Example
16223 /// ```ignore,no_run
16224 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16225 /// let x = ExecuteSqlPayload::new().set_row_limit(42);
16226 /// ```
16227 pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16228 self.row_limit = v.into();
16229 self
16230 }
16231
16232 /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
16233 ///
16234 /// # Example
16235 /// ```ignore,no_run
16236 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16237 /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
16238 /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
16239 /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
16240 /// ```
16241 pub fn set_partial_result_mode<
16242 T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
16243 >(
16244 mut self,
16245 v: T,
16246 ) -> Self {
16247 self.partial_result_mode = v.into();
16248 self
16249 }
16250
16251 /// Sets the value of [application][crate::model::ExecuteSqlPayload::application].
16252 ///
16253 /// # Example
16254 /// ```ignore,no_run
16255 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16256 /// let x = ExecuteSqlPayload::new().set_application("example");
16257 /// ```
16258 pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16259 self.application = v.into();
16260 self
16261 }
16262
16263 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
16264 ///
16265 /// Note that all the setters affecting `user_password` are mutually
16266 /// exclusive.
16267 ///
16268 /// # Example
16269 /// ```ignore,no_run
16270 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16271 /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
16272 /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::PasswordSecretVersion("example".to_string())));
16273 /// ```
16274 pub fn set_user_password<
16275 T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
16276 >(
16277 mut self,
16278 v: T,
16279 ) -> Self {
16280 self.user_password = v.into();
16281 self
16282 }
16283
16284 /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16285 /// if it holds a `PasswordSecretVersion`, `None` if the field is not set or
16286 /// holds a different branch.
16287 pub fn password_secret_version(&self) -> std::option::Option<&std::string::String> {
16288 #[allow(unreachable_patterns)]
16289 self.user_password.as_ref().and_then(|v| match v {
16290 crate::model::execute_sql_payload::UserPassword::PasswordSecretVersion(v) => {
16291 std::option::Option::Some(v)
16292 }
16293 _ => std::option::Option::None,
16294 })
16295 }
16296
16297 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16298 /// to hold a `PasswordSecretVersion`.
16299 ///
16300 /// Note that all the setters affecting `user_password` are
16301 /// mutually exclusive.
16302 ///
16303 /// # Example
16304 /// ```ignore,no_run
16305 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16306 /// let x = ExecuteSqlPayload::new().set_password_secret_version("example");
16307 /// assert!(x.password_secret_version().is_some());
16308 /// assert!(x.auto_iam_authn().is_none());
16309 /// ```
16310 pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
16311 mut self,
16312 v: T,
16313 ) -> Self {
16314 self.user_password = std::option::Option::Some(
16315 crate::model::execute_sql_payload::UserPassword::PasswordSecretVersion(v.into()),
16316 );
16317 self
16318 }
16319
16320 /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16321 /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
16322 /// holds a different branch.
16323 pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
16324 #[allow(unreachable_patterns)]
16325 self.user_password.as_ref().and_then(|v| match v {
16326 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
16327 std::option::Option::Some(v)
16328 }
16329 _ => std::option::Option::None,
16330 })
16331 }
16332
16333 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16334 /// to hold a `AutoIamAuthn`.
16335 ///
16336 /// Note that all the setters affecting `user_password` are
16337 /// mutually exclusive.
16338 ///
16339 /// # Example
16340 /// ```ignore,no_run
16341 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16342 /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
16343 /// assert!(x.auto_iam_authn().is_some());
16344 /// assert!(x.password_secret_version().is_none());
16345 /// ```
16346 pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16347 self.user_password = std::option::Option::Some(
16348 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
16349 );
16350 self
16351 }
16352}
16353
16354impl wkt::message::Message for ExecuteSqlPayload {
16355 fn typename() -> &'static str {
16356 "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
16357 }
16358}
16359
16360/// Defines additional types related to [ExecuteSqlPayload].
16361pub mod execute_sql_payload {
16362 #[allow(unused_imports)]
16363 use super::*;
16364
16365 /// Controls how the API should respond when the SQL execution result exceeds
16366 /// 10 MB.
16367 ///
16368 /// # Working with unknown values
16369 ///
16370 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16371 /// additional enum variants at any time. Adding new variants is not considered
16372 /// a breaking change. Applications should write their code in anticipation of:
16373 ///
16374 /// - New values appearing in future releases of the client library, **and**
16375 /// - New values received dynamically, without application changes.
16376 ///
16377 /// Please consult the [Working with enums] section in the user guide for some
16378 /// guidelines.
16379 ///
16380 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16381 #[derive(Clone, Debug, PartialEq)]
16382 #[non_exhaustive]
16383 pub enum PartialResultMode {
16384 /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
16385 Unspecified,
16386 /// Throw an error if the result exceeds 10 MB or if only a partial result
16387 /// can be retrieved. Don't return the result.
16388 FailPartialResult,
16389 /// Return a truncated result and set `partial_result` to true if the result
16390 /// exceeds 10 MB or if only a partial result can be retrieved due to error.
16391 /// Don't throw an error.
16392 AllowPartialResult,
16393 /// If set, the enum was initialized with an unknown value.
16394 ///
16395 /// Applications can examine the value using [PartialResultMode::value] or
16396 /// [PartialResultMode::name].
16397 UnknownValue(partial_result_mode::UnknownValue),
16398 }
16399
16400 #[doc(hidden)]
16401 pub mod partial_result_mode {
16402 #[allow(unused_imports)]
16403 use super::*;
16404 #[derive(Clone, Debug, PartialEq)]
16405 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16406 }
16407
16408 impl PartialResultMode {
16409 /// Gets the enum value.
16410 ///
16411 /// Returns `None` if the enum contains an unknown value deserialized from
16412 /// the string representation of enums.
16413 pub fn value(&self) -> std::option::Option<i32> {
16414 match self {
16415 Self::Unspecified => std::option::Option::Some(0),
16416 Self::FailPartialResult => std::option::Option::Some(1),
16417 Self::AllowPartialResult => std::option::Option::Some(2),
16418 Self::UnknownValue(u) => u.0.value(),
16419 }
16420 }
16421
16422 /// Gets the enum value as a string.
16423 ///
16424 /// Returns `None` if the enum contains an unknown value deserialized from
16425 /// the integer representation of enums.
16426 pub fn name(&self) -> std::option::Option<&str> {
16427 match self {
16428 Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
16429 Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
16430 Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
16431 Self::UnknownValue(u) => u.0.name(),
16432 }
16433 }
16434 }
16435
16436 impl std::default::Default for PartialResultMode {
16437 fn default() -> Self {
16438 use std::convert::From;
16439 Self::from(0)
16440 }
16441 }
16442
16443 impl std::fmt::Display for PartialResultMode {
16444 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16445 wkt::internal::display_enum(f, self.name(), self.value())
16446 }
16447 }
16448
16449 impl std::convert::From<i32> for PartialResultMode {
16450 fn from(value: i32) -> Self {
16451 match value {
16452 0 => Self::Unspecified,
16453 1 => Self::FailPartialResult,
16454 2 => Self::AllowPartialResult,
16455 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16456 wkt::internal::UnknownEnumValue::Integer(value),
16457 )),
16458 }
16459 }
16460 }
16461
16462 impl std::convert::From<&str> for PartialResultMode {
16463 fn from(value: &str) -> Self {
16464 use std::string::ToString;
16465 match value {
16466 "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
16467 "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
16468 "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
16469 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16470 wkt::internal::UnknownEnumValue::String(value.to_string()),
16471 )),
16472 }
16473 }
16474 }
16475
16476 impl serde::ser::Serialize for PartialResultMode {
16477 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16478 where
16479 S: serde::Serializer,
16480 {
16481 match self {
16482 Self::Unspecified => serializer.serialize_i32(0),
16483 Self::FailPartialResult => serializer.serialize_i32(1),
16484 Self::AllowPartialResult => serializer.serialize_i32(2),
16485 Self::UnknownValue(u) => u.0.serialize(serializer),
16486 }
16487 }
16488 }
16489
16490 impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
16491 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16492 where
16493 D: serde::Deserializer<'de>,
16494 {
16495 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
16496 ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
16497 ))
16498 }
16499 }
16500
16501 /// Credentials for the database connection.
16502 #[derive(Clone, Debug, PartialEq)]
16503 #[non_exhaustive]
16504 pub enum UserPassword {
16505 /// Optional. The resource name of the Secret Manager secret holding the
16506 /// password for the user to log into the database. The secret should be
16507 /// created using the regional endpoint (for API) or from the Regional
16508 /// Secrets page (for UI), and stored in the same region as the Cloud SQL
16509 /// instance. The expected resource name format is
16510 /// `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}`.
16511 /// Used together with the `user` field.
16512 /// The secret resource name will not be stored.
16513 PasswordSecretVersion(std::string::String),
16514 /// Optional. When set to `true`, the API caller identity associated with the
16515 /// request is used for database authentication. The API caller must be an
16516 /// IAM user in the database.
16517 AutoIamAuthn(bool),
16518 }
16519}
16520
16521/// Execute SQL statements response.
16522#[derive(Clone, Default, PartialEq)]
16523#[non_exhaustive]
16524pub struct SqlInstancesExecuteSqlResponse {
16525 /// A list of notices and warnings generated during query execution.
16526 /// For PostgreSQL, this includes all notices and warnings.
16527 /// For MySQL, this includes warnings generated by the last executed statement.
16528 /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
16529 /// be executed after each statement.
16530 pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
16531
16532 /// The additional metadata information regarding the execution of the SQL
16533 /// statements.
16534 pub metadata: std::option::Option<crate::model::Metadata>,
16535
16536 /// The list of results after executing all the SQL statements.
16537 pub results: std::vec::Vec<crate::model::QueryResult>,
16538
16539 /// Contains the error from the database if the SQL execution failed.
16540 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16541
16542 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16543}
16544
16545impl SqlInstancesExecuteSqlResponse {
16546 /// Creates a new default instance.
16547 pub fn new() -> Self {
16548 std::default::Default::default()
16549 }
16550
16551 /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
16552 ///
16553 /// # Example
16554 /// ```ignore,no_run
16555 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16556 /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16557 /// let x = SqlInstancesExecuteSqlResponse::new()
16558 /// .set_messages([
16559 /// Message::default()/* use setters */,
16560 /// Message::default()/* use (different) setters */,
16561 /// ]);
16562 /// ```
16563 pub fn set_messages<T, V>(mut self, v: T) -> Self
16564 where
16565 T: std::iter::IntoIterator<Item = V>,
16566 V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
16567 {
16568 use std::iter::Iterator;
16569 self.messages = v.into_iter().map(|i| i.into()).collect();
16570 self
16571 }
16572
16573 /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16574 ///
16575 /// # Example
16576 /// ```ignore,no_run
16577 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16578 /// use google_cloud_sql_v1::model::Metadata;
16579 /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
16580 /// ```
16581 pub fn set_metadata<T>(mut self, v: T) -> Self
16582 where
16583 T: std::convert::Into<crate::model::Metadata>,
16584 {
16585 self.metadata = std::option::Option::Some(v.into());
16586 self
16587 }
16588
16589 /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16590 ///
16591 /// # Example
16592 /// ```ignore,no_run
16593 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16594 /// use google_cloud_sql_v1::model::Metadata;
16595 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
16596 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
16597 /// ```
16598 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16599 where
16600 T: std::convert::Into<crate::model::Metadata>,
16601 {
16602 self.metadata = v.map(|x| x.into());
16603 self
16604 }
16605
16606 /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
16607 ///
16608 /// # Example
16609 /// ```ignore,no_run
16610 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16611 /// use google_cloud_sql_v1::model::QueryResult;
16612 /// let x = SqlInstancesExecuteSqlResponse::new()
16613 /// .set_results([
16614 /// QueryResult::default()/* use setters */,
16615 /// QueryResult::default()/* use (different) setters */,
16616 /// ]);
16617 /// ```
16618 pub fn set_results<T, V>(mut self, v: T) -> Self
16619 where
16620 T: std::iter::IntoIterator<Item = V>,
16621 V: std::convert::Into<crate::model::QueryResult>,
16622 {
16623 use std::iter::Iterator;
16624 self.results = v.into_iter().map(|i| i.into()).collect();
16625 self
16626 }
16627
16628 /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16629 ///
16630 /// # Example
16631 /// ```ignore,no_run
16632 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16633 /// use google_cloud_rpc::model::Status;
16634 /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
16635 /// ```
16636 pub fn set_status<T>(mut self, v: T) -> Self
16637 where
16638 T: std::convert::Into<google_cloud_rpc::model::Status>,
16639 {
16640 self.status = std::option::Option::Some(v.into());
16641 self
16642 }
16643
16644 /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16645 ///
16646 /// # Example
16647 /// ```ignore,no_run
16648 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16649 /// use google_cloud_rpc::model::Status;
16650 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
16651 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
16652 /// ```
16653 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16654 where
16655 T: std::convert::Into<google_cloud_rpc::model::Status>,
16656 {
16657 self.status = v.map(|x| x.into());
16658 self
16659 }
16660}
16661
16662impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
16663 fn typename() -> &'static str {
16664 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
16665 }
16666}
16667
16668/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
16669pub mod sql_instances_execute_sql_response {
16670 #[allow(unused_imports)]
16671 use super::*;
16672
16673 /// Represents a notice or warning message from the database.
16674 #[derive(Clone, Default, PartialEq)]
16675 #[non_exhaustive]
16676 pub struct Message {
16677 /// The full message string.
16678 /// For PostgreSQL, this is a formatted string that may include severity,
16679 /// code, and the notice/warning message.
16680 /// For MySQL, this contains the warning message.
16681 pub message: std::option::Option<std::string::String>,
16682
16683 /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
16684 /// MySQL).
16685 pub severity: std::option::Option<std::string::String>,
16686
16687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16688 }
16689
16690 impl Message {
16691 /// Creates a new default instance.
16692 pub fn new() -> Self {
16693 std::default::Default::default()
16694 }
16695
16696 /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16697 ///
16698 /// # Example
16699 /// ```ignore,no_run
16700 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16701 /// let x = Message::new().set_message("example");
16702 /// ```
16703 pub fn set_message<T>(mut self, v: T) -> Self
16704 where
16705 T: std::convert::Into<std::string::String>,
16706 {
16707 self.message = std::option::Option::Some(v.into());
16708 self
16709 }
16710
16711 /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16712 ///
16713 /// # Example
16714 /// ```ignore,no_run
16715 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16716 /// let x = Message::new().set_or_clear_message(Some("example"));
16717 /// let x = Message::new().set_or_clear_message(None::<String>);
16718 /// ```
16719 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
16720 where
16721 T: std::convert::Into<std::string::String>,
16722 {
16723 self.message = v.map(|x| x.into());
16724 self
16725 }
16726
16727 /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16728 ///
16729 /// # Example
16730 /// ```ignore,no_run
16731 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16732 /// let x = Message::new().set_severity("example");
16733 /// ```
16734 pub fn set_severity<T>(mut self, v: T) -> Self
16735 where
16736 T: std::convert::Into<std::string::String>,
16737 {
16738 self.severity = std::option::Option::Some(v.into());
16739 self
16740 }
16741
16742 /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16743 ///
16744 /// # Example
16745 /// ```ignore,no_run
16746 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16747 /// let x = Message::new().set_or_clear_severity(Some("example"));
16748 /// let x = Message::new().set_or_clear_severity(None::<String>);
16749 /// ```
16750 pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
16751 where
16752 T: std::convert::Into<std::string::String>,
16753 {
16754 self.severity = v.map(|x| x.into());
16755 self
16756 }
16757 }
16758
16759 impl wkt::message::Message for Message {
16760 fn typename() -> &'static str {
16761 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
16762 }
16763 }
16764}
16765
16766/// QueryResult contains the result of executing a single SQL statement.
16767#[derive(Clone, Default, PartialEq)]
16768#[non_exhaustive]
16769pub struct QueryResult {
16770 /// List of columns included in the result. This also includes the data type
16771 /// of the column.
16772 pub columns: std::vec::Vec<crate::model::Column>,
16773
16774 /// Rows returned by the SQL statement.
16775 pub rows: std::vec::Vec<crate::model::Row>,
16776
16777 /// Message related to the SQL execution result.
16778 pub message: std::string::String,
16779
16780 /// Set to true if the SQL execution's result is truncated due to size limits
16781 /// or an error retrieving results.
16782 pub partial_result: bool,
16783
16784 /// If results were truncated due to an error, details of that error.
16785 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16786
16787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16788}
16789
16790impl QueryResult {
16791 /// Creates a new default instance.
16792 pub fn new() -> Self {
16793 std::default::Default::default()
16794 }
16795
16796 /// Sets the value of [columns][crate::model::QueryResult::columns].
16797 ///
16798 /// # Example
16799 /// ```ignore,no_run
16800 /// # use google_cloud_sql_v1::model::QueryResult;
16801 /// use google_cloud_sql_v1::model::Column;
16802 /// let x = QueryResult::new()
16803 /// .set_columns([
16804 /// Column::default()/* use setters */,
16805 /// Column::default()/* use (different) setters */,
16806 /// ]);
16807 /// ```
16808 pub fn set_columns<T, V>(mut self, v: T) -> Self
16809 where
16810 T: std::iter::IntoIterator<Item = V>,
16811 V: std::convert::Into<crate::model::Column>,
16812 {
16813 use std::iter::Iterator;
16814 self.columns = v.into_iter().map(|i| i.into()).collect();
16815 self
16816 }
16817
16818 /// Sets the value of [rows][crate::model::QueryResult::rows].
16819 ///
16820 /// # Example
16821 /// ```ignore,no_run
16822 /// # use google_cloud_sql_v1::model::QueryResult;
16823 /// use google_cloud_sql_v1::model::Row;
16824 /// let x = QueryResult::new()
16825 /// .set_rows([
16826 /// Row::default()/* use setters */,
16827 /// Row::default()/* use (different) setters */,
16828 /// ]);
16829 /// ```
16830 pub fn set_rows<T, V>(mut self, v: T) -> Self
16831 where
16832 T: std::iter::IntoIterator<Item = V>,
16833 V: std::convert::Into<crate::model::Row>,
16834 {
16835 use std::iter::Iterator;
16836 self.rows = v.into_iter().map(|i| i.into()).collect();
16837 self
16838 }
16839
16840 /// Sets the value of [message][crate::model::QueryResult::message].
16841 ///
16842 /// # Example
16843 /// ```ignore,no_run
16844 /// # use google_cloud_sql_v1::model::QueryResult;
16845 /// let x = QueryResult::new().set_message("example");
16846 /// ```
16847 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16848 self.message = v.into();
16849 self
16850 }
16851
16852 /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
16853 ///
16854 /// # Example
16855 /// ```ignore,no_run
16856 /// # use google_cloud_sql_v1::model::QueryResult;
16857 /// let x = QueryResult::new().set_partial_result(true);
16858 /// ```
16859 pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16860 self.partial_result = v.into();
16861 self
16862 }
16863
16864 /// Sets the value of [status][crate::model::QueryResult::status].
16865 ///
16866 /// # Example
16867 /// ```ignore,no_run
16868 /// # use google_cloud_sql_v1::model::QueryResult;
16869 /// use google_cloud_rpc::model::Status;
16870 /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
16871 /// ```
16872 pub fn set_status<T>(mut self, v: T) -> Self
16873 where
16874 T: std::convert::Into<google_cloud_rpc::model::Status>,
16875 {
16876 self.status = std::option::Option::Some(v.into());
16877 self
16878 }
16879
16880 /// Sets or clears the value of [status][crate::model::QueryResult::status].
16881 ///
16882 /// # Example
16883 /// ```ignore,no_run
16884 /// # use google_cloud_sql_v1::model::QueryResult;
16885 /// use google_cloud_rpc::model::Status;
16886 /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
16887 /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
16888 /// ```
16889 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16890 where
16891 T: std::convert::Into<google_cloud_rpc::model::Status>,
16892 {
16893 self.status = v.map(|x| x.into());
16894 self
16895 }
16896}
16897
16898impl wkt::message::Message for QueryResult {
16899 fn typename() -> &'static str {
16900 "type.googleapis.com/google.cloud.sql.v1.QueryResult"
16901 }
16902}
16903
16904/// Contains the name and datatype of a column.
16905#[derive(Clone, Default, PartialEq)]
16906#[non_exhaustive]
16907pub struct Column {
16908 /// Name of the column.
16909 pub name: std::string::String,
16910
16911 /// Datatype of the column.
16912 pub r#type: std::string::String,
16913
16914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16915}
16916
16917impl Column {
16918 /// Creates a new default instance.
16919 pub fn new() -> Self {
16920 std::default::Default::default()
16921 }
16922
16923 /// Sets the value of [name][crate::model::Column::name].
16924 ///
16925 /// # Example
16926 /// ```ignore,no_run
16927 /// # use google_cloud_sql_v1::model::Column;
16928 /// let x = Column::new().set_name("example");
16929 /// ```
16930 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16931 self.name = v.into();
16932 self
16933 }
16934
16935 /// Sets the value of [r#type][crate::model::Column::type].
16936 ///
16937 /// # Example
16938 /// ```ignore,no_run
16939 /// # use google_cloud_sql_v1::model::Column;
16940 /// let x = Column::new().set_type("example");
16941 /// ```
16942 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16943 self.r#type = v.into();
16944 self
16945 }
16946}
16947
16948impl wkt::message::Message for Column {
16949 fn typename() -> &'static str {
16950 "type.googleapis.com/google.cloud.sql.v1.Column"
16951 }
16952}
16953
16954/// Contains the values for a row.
16955#[derive(Clone, Default, PartialEq)]
16956#[non_exhaustive]
16957pub struct Row {
16958 /// The values for the row.
16959 pub values: std::vec::Vec<crate::model::Value>,
16960
16961 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16962}
16963
16964impl Row {
16965 /// Creates a new default instance.
16966 pub fn new() -> Self {
16967 std::default::Default::default()
16968 }
16969
16970 /// Sets the value of [values][crate::model::Row::values].
16971 ///
16972 /// # Example
16973 /// ```ignore,no_run
16974 /// # use google_cloud_sql_v1::model::Row;
16975 /// use google_cloud_sql_v1::model::Value;
16976 /// let x = Row::new()
16977 /// .set_values([
16978 /// Value::default()/* use setters */,
16979 /// Value::default()/* use (different) setters */,
16980 /// ]);
16981 /// ```
16982 pub fn set_values<T, V>(mut self, v: T) -> Self
16983 where
16984 T: std::iter::IntoIterator<Item = V>,
16985 V: std::convert::Into<crate::model::Value>,
16986 {
16987 use std::iter::Iterator;
16988 self.values = v.into_iter().map(|i| i.into()).collect();
16989 self
16990 }
16991}
16992
16993impl wkt::message::Message for Row {
16994 fn typename() -> &'static str {
16995 "type.googleapis.com/google.cloud.sql.v1.Row"
16996 }
16997}
16998
16999/// The cell value of the table.
17000#[derive(Clone, Default, PartialEq)]
17001#[non_exhaustive]
17002pub struct Value {
17003 /// The cell value in string format.
17004 pub value: std::string::String,
17005
17006 /// If cell value is null, then this flag will be set to true.
17007 pub null_value: bool,
17008
17009 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17010}
17011
17012impl Value {
17013 /// Creates a new default instance.
17014 pub fn new() -> Self {
17015 std::default::Default::default()
17016 }
17017
17018 /// Sets the value of [value][crate::model::Value::value].
17019 ///
17020 /// # Example
17021 /// ```ignore,no_run
17022 /// # use google_cloud_sql_v1::model::Value;
17023 /// let x = Value::new().set_value("example");
17024 /// ```
17025 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17026 self.value = v.into();
17027 self
17028 }
17029
17030 /// Sets the value of [null_value][crate::model::Value::null_value].
17031 ///
17032 /// # Example
17033 /// ```ignore,no_run
17034 /// # use google_cloud_sql_v1::model::Value;
17035 /// let x = Value::new().set_null_value(true);
17036 /// ```
17037 pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17038 self.null_value = v.into();
17039 self
17040 }
17041}
17042
17043impl wkt::message::Message for Value {
17044 fn typename() -> &'static str {
17045 "type.googleapis.com/google.cloud.sql.v1.Value"
17046 }
17047}
17048
17049/// The additional metadata information regarding the execution of the SQL
17050/// statements.
17051#[derive(Clone, Default, PartialEq)]
17052#[non_exhaustive]
17053pub struct Metadata {
17054 /// The time taken to execute the SQL statements.
17055 pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
17056
17057 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17058}
17059
17060impl Metadata {
17061 /// Creates a new default instance.
17062 pub fn new() -> Self {
17063 std::default::Default::default()
17064 }
17065
17066 /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
17067 ///
17068 /// # Example
17069 /// ```ignore,no_run
17070 /// # use google_cloud_sql_v1::model::Metadata;
17071 /// use wkt::Duration;
17072 /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
17073 /// ```
17074 pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
17075 where
17076 T: std::convert::Into<wkt::Duration>,
17077 {
17078 self.sql_statement_execution_time = std::option::Option::Some(v.into());
17079 self
17080 }
17081
17082 /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
17083 ///
17084 /// # Example
17085 /// ```ignore,no_run
17086 /// # use google_cloud_sql_v1::model::Metadata;
17087 /// use wkt::Duration;
17088 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
17089 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
17090 /// ```
17091 pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
17092 where
17093 T: std::convert::Into<wkt::Duration>,
17094 {
17095 self.sql_statement_execution_time = v.map(|x| x.into());
17096 self
17097 }
17098}
17099
17100impl wkt::message::Message for Metadata {
17101 fn typename() -> &'static str {
17102 "type.googleapis.com/google.cloud.sql.v1.Metadata"
17103 }
17104}
17105
17106/// Request to acquire a lease for SSRS.
17107#[derive(Clone, Default, PartialEq)]
17108#[non_exhaustive]
17109pub struct SqlInstancesAcquireSsrsLeaseRequest {
17110 /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
17111 /// composed of lowercase letters, numbers, and hyphens, and it must start with
17112 /// a letter. The total length must be 98 characters or less (Example:
17113 /// instance-id).
17114 pub instance: std::string::String,
17115
17116 /// Required. Project ID of the project that contains the instance (Example:
17117 /// project-id).
17118 pub project: std::string::String,
17119
17120 /// Required. The request body.
17121 pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
17122
17123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17124}
17125
17126impl SqlInstancesAcquireSsrsLeaseRequest {
17127 /// Creates a new default instance.
17128 pub fn new() -> Self {
17129 std::default::Default::default()
17130 }
17131
17132 /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
17133 ///
17134 /// # Example
17135 /// ```ignore,no_run
17136 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17137 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
17138 /// ```
17139 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17140 self.instance = v.into();
17141 self
17142 }
17143
17144 /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
17145 ///
17146 /// # Example
17147 /// ```ignore,no_run
17148 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17149 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
17150 /// ```
17151 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17152 self.project = v.into();
17153 self
17154 }
17155
17156 /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
17157 ///
17158 /// # Example
17159 /// ```ignore,no_run
17160 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17161 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
17162 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
17163 /// ```
17164 pub fn set_body<T>(mut self, v: T) -> Self
17165 where
17166 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
17167 {
17168 self.body = std::option::Option::Some(v.into());
17169 self
17170 }
17171
17172 /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
17173 ///
17174 /// # Example
17175 /// ```ignore,no_run
17176 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17177 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
17178 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
17179 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
17180 /// ```
17181 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
17182 where
17183 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
17184 {
17185 self.body = v.map(|x| x.into());
17186 self
17187 }
17188}
17189
17190impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
17191 fn typename() -> &'static str {
17192 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
17193 }
17194}
17195
17196/// Response for the acquire SSRS lease request.
17197#[derive(Clone, Default, PartialEq)]
17198#[non_exhaustive]
17199pub struct SqlInstancesAcquireSsrsLeaseResponse {
17200 /// The unique identifier for this operation.
17201 pub operation_id: std::string::String,
17202
17203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17204}
17205
17206impl SqlInstancesAcquireSsrsLeaseResponse {
17207 /// Creates a new default instance.
17208 pub fn new() -> Self {
17209 std::default::Default::default()
17210 }
17211
17212 /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
17213 ///
17214 /// # Example
17215 /// ```ignore,no_run
17216 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
17217 /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
17218 /// ```
17219 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17220 self.operation_id = v.into();
17221 self
17222 }
17223}
17224
17225impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
17226 fn typename() -> &'static str {
17227 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
17228 }
17229}
17230
17231/// Request to release a lease for SSRS.
17232#[derive(Clone, Default, PartialEq)]
17233#[non_exhaustive]
17234pub struct SqlInstancesReleaseSsrsLeaseRequest {
17235 /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
17236 /// The instance ID contains lowercase letters, numbers, and hyphens, and it
17237 /// must start with a letter. This ID can have a maximum length of 98
17238 /// characters.
17239 pub instance: std::string::String,
17240
17241 /// Required. The project ID that contains the instance.
17242 pub project: std::string::String,
17243
17244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17245}
17246
17247impl SqlInstancesReleaseSsrsLeaseRequest {
17248 /// Creates a new default instance.
17249 pub fn new() -> Self {
17250 std::default::Default::default()
17251 }
17252
17253 /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
17254 ///
17255 /// # Example
17256 /// ```ignore,no_run
17257 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
17258 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
17259 /// ```
17260 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17261 self.instance = v.into();
17262 self
17263 }
17264
17265 /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
17266 ///
17267 /// # Example
17268 /// ```ignore,no_run
17269 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
17270 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
17271 /// ```
17272 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17273 self.project = v.into();
17274 self
17275 }
17276}
17277
17278impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
17279 fn typename() -> &'static str {
17280 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
17281 }
17282}
17283
17284/// Response for the release SSRS lease request.
17285#[derive(Clone, Default, PartialEq)]
17286#[non_exhaustive]
17287pub struct SqlInstancesReleaseSsrsLeaseResponse {
17288 /// The unique identifier for this operation.
17289 pub operation_id: std::string::String,
17290
17291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17292}
17293
17294impl SqlInstancesReleaseSsrsLeaseResponse {
17295 /// Creates a new default instance.
17296 pub fn new() -> Self {
17297 std::default::Default::default()
17298 }
17299
17300 /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
17301 ///
17302 /// # Example
17303 /// ```ignore,no_run
17304 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
17305 /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
17306 /// ```
17307 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17308 self.operation_id = v.into();
17309 self
17310 }
17311}
17312
17313impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
17314 fn typename() -> &'static str {
17315 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
17316 }
17317}
17318
17319/// Request to perform a point in time restore on a Google Cloud Backup and
17320/// Disaster Recovery managed instance.
17321#[derive(Clone, Default, PartialEq)]
17322#[non_exhaustive]
17323pub struct SqlInstancesPointInTimeRestoreRequest {
17324 /// Required. The parent resource where you created this instance.
17325 /// Format: projects/{project}
17326 pub parent: std::string::String,
17327
17328 /// Required. The context for request to perform a PITR on a Google Cloud
17329 /// Backup and Disaster Recovery managed instance.
17330 pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
17331
17332 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17333}
17334
17335impl SqlInstancesPointInTimeRestoreRequest {
17336 /// Creates a new default instance.
17337 pub fn new() -> Self {
17338 std::default::Default::default()
17339 }
17340
17341 /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
17342 ///
17343 /// # Example
17344 /// ```ignore,no_run
17345 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17346 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
17347 /// ```
17348 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17349 self.parent = v.into();
17350 self
17351 }
17352
17353 /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17354 ///
17355 /// # Example
17356 /// ```ignore,no_run
17357 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17358 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17359 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
17360 /// ```
17361 pub fn set_context<T>(mut self, v: T) -> Self
17362 where
17363 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17364 {
17365 self.context = std::option::Option::Some(v.into());
17366 self
17367 }
17368
17369 /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17370 ///
17371 /// # Example
17372 /// ```ignore,no_run
17373 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17374 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17375 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
17376 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
17377 /// ```
17378 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
17379 where
17380 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17381 {
17382 self.context = v.map(|x| x.into());
17383 self
17384 }
17385}
17386
17387impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
17388 fn typename() -> &'static str {
17389 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
17390 }
17391}
17392
17393/// Operations get request.
17394#[derive(Clone, Default, PartialEq)]
17395#[non_exhaustive]
17396pub struct SqlOperationsGetRequest {
17397 /// Required. Instance operation ID.
17398 pub operation: std::string::String,
17399
17400 /// Required. Project ID of the project that contains the instance.
17401 pub project: std::string::String,
17402
17403 /// Optional. Region of the Cloud SQL instance.
17404 pub location: std::string::String,
17405
17406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17407}
17408
17409impl SqlOperationsGetRequest {
17410 /// Creates a new default instance.
17411 pub fn new() -> Self {
17412 std::default::Default::default()
17413 }
17414
17415 /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
17416 ///
17417 /// # Example
17418 /// ```ignore,no_run
17419 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17420 /// let x = SqlOperationsGetRequest::new().set_operation("example");
17421 /// ```
17422 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17423 self.operation = v.into();
17424 self
17425 }
17426
17427 /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
17428 ///
17429 /// # Example
17430 /// ```ignore,no_run
17431 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17432 /// let x = SqlOperationsGetRequest::new().set_project("example");
17433 /// ```
17434 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17435 self.project = v.into();
17436 self
17437 }
17438
17439 /// Sets the value of [location][crate::model::SqlOperationsGetRequest::location].
17440 ///
17441 /// # Example
17442 /// ```ignore,no_run
17443 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17444 /// let x = SqlOperationsGetRequest::new().set_location("example");
17445 /// ```
17446 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17447 self.location = v.into();
17448 self
17449 }
17450}
17451
17452impl wkt::message::Message for SqlOperationsGetRequest {
17453 fn typename() -> &'static str {
17454 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
17455 }
17456}
17457
17458/// Operations list request.
17459#[derive(Clone, Default, PartialEq)]
17460#[non_exhaustive]
17461pub struct SqlOperationsListRequest {
17462 /// Cloud SQL instance ID. This does not include the project ID.
17463 pub instance: std::string::String,
17464
17465 /// Maximum number of operations per response.
17466 pub max_results: u32,
17467
17468 /// A previously-returned page token representing part of the larger set of
17469 /// results to view.
17470 pub page_token: std::string::String,
17471
17472 /// Project ID of the project that contains the instance.
17473 pub project: std::string::String,
17474
17475 /// Optional. Region of the Cloud SQL instance.
17476 pub location: std::string::String,
17477
17478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17479}
17480
17481impl SqlOperationsListRequest {
17482 /// Creates a new default instance.
17483 pub fn new() -> Self {
17484 std::default::Default::default()
17485 }
17486
17487 /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
17488 ///
17489 /// # Example
17490 /// ```ignore,no_run
17491 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17492 /// let x = SqlOperationsListRequest::new().set_instance("example");
17493 /// ```
17494 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17495 self.instance = v.into();
17496 self
17497 }
17498
17499 /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
17500 ///
17501 /// # Example
17502 /// ```ignore,no_run
17503 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17504 /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
17505 /// ```
17506 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
17507 self.max_results = v.into();
17508 self
17509 }
17510
17511 /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
17512 ///
17513 /// # Example
17514 /// ```ignore,no_run
17515 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17516 /// let x = SqlOperationsListRequest::new().set_page_token("example");
17517 /// ```
17518 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17519 self.page_token = v.into();
17520 self
17521 }
17522
17523 /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
17524 ///
17525 /// # Example
17526 /// ```ignore,no_run
17527 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17528 /// let x = SqlOperationsListRequest::new().set_project("example");
17529 /// ```
17530 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17531 self.project = v.into();
17532 self
17533 }
17534
17535 /// Sets the value of [location][crate::model::SqlOperationsListRequest::location].
17536 ///
17537 /// # Example
17538 /// ```ignore,no_run
17539 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17540 /// let x = SqlOperationsListRequest::new().set_location("example");
17541 /// ```
17542 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17543 self.location = v.into();
17544 self
17545 }
17546}
17547
17548impl wkt::message::Message for SqlOperationsListRequest {
17549 fn typename() -> &'static str {
17550 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
17551 }
17552}
17553
17554/// Operations list response.
17555#[derive(Clone, Default, PartialEq)]
17556#[non_exhaustive]
17557pub struct OperationsListResponse {
17558 /// This is always `sql#operationsList`.
17559 pub kind: std::string::String,
17560
17561 /// List of operation resources.
17562 pub items: std::vec::Vec<crate::model::Operation>,
17563
17564 /// The continuation token, used to page through large result sets. Provide
17565 /// this value in a subsequent request to return the next page of results.
17566 pub next_page_token: std::string::String,
17567
17568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17569}
17570
17571impl OperationsListResponse {
17572 /// Creates a new default instance.
17573 pub fn new() -> Self {
17574 std::default::Default::default()
17575 }
17576
17577 /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
17578 ///
17579 /// # Example
17580 /// ```ignore,no_run
17581 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17582 /// let x = OperationsListResponse::new().set_kind("example");
17583 /// ```
17584 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17585 self.kind = v.into();
17586 self
17587 }
17588
17589 /// Sets the value of [items][crate::model::OperationsListResponse::items].
17590 ///
17591 /// # Example
17592 /// ```ignore,no_run
17593 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17594 /// use google_cloud_sql_v1::model::Operation;
17595 /// let x = OperationsListResponse::new()
17596 /// .set_items([
17597 /// Operation::default()/* use setters */,
17598 /// Operation::default()/* use (different) setters */,
17599 /// ]);
17600 /// ```
17601 pub fn set_items<T, V>(mut self, v: T) -> Self
17602 where
17603 T: std::iter::IntoIterator<Item = V>,
17604 V: std::convert::Into<crate::model::Operation>,
17605 {
17606 use std::iter::Iterator;
17607 self.items = v.into_iter().map(|i| i.into()).collect();
17608 self
17609 }
17610
17611 /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
17612 ///
17613 /// # Example
17614 /// ```ignore,no_run
17615 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17616 /// let x = OperationsListResponse::new().set_next_page_token("example");
17617 /// ```
17618 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17619 self.next_page_token = v.into();
17620 self
17621 }
17622}
17623
17624impl wkt::message::Message for OperationsListResponse {
17625 fn typename() -> &'static str {
17626 "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
17627 }
17628}
17629
17630#[doc(hidden)]
17631impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
17632 type PageItem = crate::model::Operation;
17633
17634 fn items(self) -> std::vec::Vec<Self::PageItem> {
17635 self.items
17636 }
17637
17638 fn next_page_token(&self) -> std::string::String {
17639 use std::clone::Clone;
17640 self.next_page_token.clone()
17641 }
17642}
17643
17644/// Operations cancel request.
17645#[derive(Clone, Default, PartialEq)]
17646#[non_exhaustive]
17647pub struct SqlOperationsCancelRequest {
17648 /// Instance operation ID.
17649 pub operation: std::string::String,
17650
17651 /// Project ID of the project that contains the instance.
17652 pub project: std::string::String,
17653
17654 /// Optional. Region of the Cloud SQL instance.
17655 pub location: std::string::String,
17656
17657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17658}
17659
17660impl SqlOperationsCancelRequest {
17661 /// Creates a new default instance.
17662 pub fn new() -> Self {
17663 std::default::Default::default()
17664 }
17665
17666 /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
17667 ///
17668 /// # Example
17669 /// ```ignore,no_run
17670 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17671 /// let x = SqlOperationsCancelRequest::new().set_operation("example");
17672 /// ```
17673 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17674 self.operation = v.into();
17675 self
17676 }
17677
17678 /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
17679 ///
17680 /// # Example
17681 /// ```ignore,no_run
17682 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17683 /// let x = SqlOperationsCancelRequest::new().set_project("example");
17684 /// ```
17685 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17686 self.project = v.into();
17687 self
17688 }
17689
17690 /// Sets the value of [location][crate::model::SqlOperationsCancelRequest::location].
17691 ///
17692 /// # Example
17693 /// ```ignore,no_run
17694 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17695 /// let x = SqlOperationsCancelRequest::new().set_location("example");
17696 /// ```
17697 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17698 self.location = v.into();
17699 self
17700 }
17701}
17702
17703impl wkt::message::Message for SqlOperationsCancelRequest {
17704 fn typename() -> &'static str {
17705 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
17706 }
17707}
17708
17709/// An entry for an Access Control list.
17710#[derive(Clone, Default, PartialEq)]
17711#[non_exhaustive]
17712pub struct AclEntry {
17713 /// The allowlisted value for the access control list.
17714 pub value: std::string::String,
17715
17716 /// The time when this access control entry expires in
17717 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
17718 /// `2012-11-15T16:19:00.094Z`.
17719 pub expiration_time: std::option::Option<wkt::Timestamp>,
17720
17721 /// Optional. A label to identify this entry.
17722 pub name: std::string::String,
17723
17724 /// This is always `sql#aclEntry`.
17725 pub kind: std::string::String,
17726
17727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17728}
17729
17730impl AclEntry {
17731 /// Creates a new default instance.
17732 pub fn new() -> Self {
17733 std::default::Default::default()
17734 }
17735
17736 /// Sets the value of [value][crate::model::AclEntry::value].
17737 ///
17738 /// # Example
17739 /// ```ignore,no_run
17740 /// # use google_cloud_sql_v1::model::AclEntry;
17741 /// let x = AclEntry::new().set_value("example");
17742 /// ```
17743 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17744 self.value = v.into();
17745 self
17746 }
17747
17748 /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
17749 ///
17750 /// # Example
17751 /// ```ignore,no_run
17752 /// # use google_cloud_sql_v1::model::AclEntry;
17753 /// use wkt::Timestamp;
17754 /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
17755 /// ```
17756 pub fn set_expiration_time<T>(mut self, v: T) -> Self
17757 where
17758 T: std::convert::Into<wkt::Timestamp>,
17759 {
17760 self.expiration_time = std::option::Option::Some(v.into());
17761 self
17762 }
17763
17764 /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
17765 ///
17766 /// # Example
17767 /// ```ignore,no_run
17768 /// # use google_cloud_sql_v1::model::AclEntry;
17769 /// use wkt::Timestamp;
17770 /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
17771 /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
17772 /// ```
17773 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
17774 where
17775 T: std::convert::Into<wkt::Timestamp>,
17776 {
17777 self.expiration_time = v.map(|x| x.into());
17778 self
17779 }
17780
17781 /// Sets the value of [name][crate::model::AclEntry::name].
17782 ///
17783 /// # Example
17784 /// ```ignore,no_run
17785 /// # use google_cloud_sql_v1::model::AclEntry;
17786 /// let x = AclEntry::new().set_name("example");
17787 /// ```
17788 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17789 self.name = v.into();
17790 self
17791 }
17792
17793 /// Sets the value of [kind][crate::model::AclEntry::kind].
17794 ///
17795 /// # Example
17796 /// ```ignore,no_run
17797 /// # use google_cloud_sql_v1::model::AclEntry;
17798 /// let x = AclEntry::new().set_kind("example");
17799 /// ```
17800 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17801 self.kind = v.into();
17802 self
17803 }
17804}
17805
17806impl wkt::message::Message for AclEntry {
17807 fn typename() -> &'static str {
17808 "type.googleapis.com/google.cloud.sql.v1.AclEntry"
17809 }
17810}
17811
17812/// An Admin API warning message.
17813#[derive(Clone, Default, PartialEq)]
17814#[non_exhaustive]
17815pub struct ApiWarning {
17816 /// Code to uniquely identify the warning type.
17817 pub code: crate::model::api_warning::SqlApiWarningCode,
17818
17819 /// The warning message.
17820 pub message: std::string::String,
17821
17822 /// The region name for REGION_UNREACHABLE warning.
17823 pub region: std::string::String,
17824
17825 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17826}
17827
17828impl ApiWarning {
17829 /// Creates a new default instance.
17830 pub fn new() -> Self {
17831 std::default::Default::default()
17832 }
17833
17834 /// Sets the value of [code][crate::model::ApiWarning::code].
17835 ///
17836 /// # Example
17837 /// ```ignore,no_run
17838 /// # use google_cloud_sql_v1::model::ApiWarning;
17839 /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
17840 /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
17841 /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
17842 /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
17843 /// ```
17844 pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
17845 mut self,
17846 v: T,
17847 ) -> Self {
17848 self.code = v.into();
17849 self
17850 }
17851
17852 /// Sets the value of [message][crate::model::ApiWarning::message].
17853 ///
17854 /// # Example
17855 /// ```ignore,no_run
17856 /// # use google_cloud_sql_v1::model::ApiWarning;
17857 /// let x = ApiWarning::new().set_message("example");
17858 /// ```
17859 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17860 self.message = v.into();
17861 self
17862 }
17863
17864 /// Sets the value of [region][crate::model::ApiWarning::region].
17865 ///
17866 /// # Example
17867 /// ```ignore,no_run
17868 /// # use google_cloud_sql_v1::model::ApiWarning;
17869 /// let x = ApiWarning::new().set_region("example");
17870 /// ```
17871 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17872 self.region = v.into();
17873 self
17874 }
17875}
17876
17877impl wkt::message::Message for ApiWarning {
17878 fn typename() -> &'static str {
17879 "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
17880 }
17881}
17882
17883/// Defines additional types related to [ApiWarning].
17884pub mod api_warning {
17885 #[allow(unused_imports)]
17886 use super::*;
17887
17888 /// Enum for [SqlApiWarningCode].
17889 ///
17890 /// # Working with unknown values
17891 ///
17892 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17893 /// additional enum variants at any time. Adding new variants is not considered
17894 /// a breaking change. Applications should write their code in anticipation of:
17895 ///
17896 /// - New values appearing in future releases of the client library, **and**
17897 /// - New values received dynamically, without application changes.
17898 ///
17899 /// Please consult the [Working with enums] section in the user guide for some
17900 /// guidelines.
17901 ///
17902 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17903 #[derive(Clone, Debug, PartialEq)]
17904 #[non_exhaustive]
17905 pub enum SqlApiWarningCode {
17906 /// An unknown or unset warning type from Cloud SQL API.
17907 Unspecified,
17908 /// Warning when one or more regions are not reachable. The returned result
17909 /// set may be incomplete.
17910 RegionUnreachable,
17911 /// Warning when user provided maxResults parameter exceeds the limit. The
17912 /// returned result set may be incomplete.
17913 MaxResultsExceedsLimit,
17914 /// Warning when user tries to create/update a user with credentials that
17915 /// have previously been compromised by a public data breach.
17916 CompromisedCredentials,
17917 /// Warning when the operation succeeds but some non-critical workflow state
17918 /// failed.
17919 InternalStateFailure,
17920 /// If set, the enum was initialized with an unknown value.
17921 ///
17922 /// Applications can examine the value using [SqlApiWarningCode::value] or
17923 /// [SqlApiWarningCode::name].
17924 UnknownValue(sql_api_warning_code::UnknownValue),
17925 }
17926
17927 #[doc(hidden)]
17928 pub mod sql_api_warning_code {
17929 #[allow(unused_imports)]
17930 use super::*;
17931 #[derive(Clone, Debug, PartialEq)]
17932 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17933 }
17934
17935 impl SqlApiWarningCode {
17936 /// Gets the enum value.
17937 ///
17938 /// Returns `None` if the enum contains an unknown value deserialized from
17939 /// the string representation of enums.
17940 pub fn value(&self) -> std::option::Option<i32> {
17941 match self {
17942 Self::Unspecified => std::option::Option::Some(0),
17943 Self::RegionUnreachable => std::option::Option::Some(1),
17944 Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
17945 Self::CompromisedCredentials => std::option::Option::Some(3),
17946 Self::InternalStateFailure => std::option::Option::Some(4),
17947 Self::UnknownValue(u) => u.0.value(),
17948 }
17949 }
17950
17951 /// Gets the enum value as a string.
17952 ///
17953 /// Returns `None` if the enum contains an unknown value deserialized from
17954 /// the integer representation of enums.
17955 pub fn name(&self) -> std::option::Option<&str> {
17956 match self {
17957 Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
17958 Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
17959 Self::MaxResultsExceedsLimit => {
17960 std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
17961 }
17962 Self::CompromisedCredentials => {
17963 std::option::Option::Some("COMPROMISED_CREDENTIALS")
17964 }
17965 Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
17966 Self::UnknownValue(u) => u.0.name(),
17967 }
17968 }
17969 }
17970
17971 impl std::default::Default for SqlApiWarningCode {
17972 fn default() -> Self {
17973 use std::convert::From;
17974 Self::from(0)
17975 }
17976 }
17977
17978 impl std::fmt::Display for SqlApiWarningCode {
17979 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17980 wkt::internal::display_enum(f, self.name(), self.value())
17981 }
17982 }
17983
17984 impl std::convert::From<i32> for SqlApiWarningCode {
17985 fn from(value: i32) -> Self {
17986 match value {
17987 0 => Self::Unspecified,
17988 1 => Self::RegionUnreachable,
17989 2 => Self::MaxResultsExceedsLimit,
17990 3 => Self::CompromisedCredentials,
17991 4 => Self::InternalStateFailure,
17992 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17993 wkt::internal::UnknownEnumValue::Integer(value),
17994 )),
17995 }
17996 }
17997 }
17998
17999 impl std::convert::From<&str> for SqlApiWarningCode {
18000 fn from(value: &str) -> Self {
18001 use std::string::ToString;
18002 match value {
18003 "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
18004 "REGION_UNREACHABLE" => Self::RegionUnreachable,
18005 "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
18006 "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
18007 "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
18008 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
18009 wkt::internal::UnknownEnumValue::String(value.to_string()),
18010 )),
18011 }
18012 }
18013 }
18014
18015 impl serde::ser::Serialize for SqlApiWarningCode {
18016 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18017 where
18018 S: serde::Serializer,
18019 {
18020 match self {
18021 Self::Unspecified => serializer.serialize_i32(0),
18022 Self::RegionUnreachable => serializer.serialize_i32(1),
18023 Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
18024 Self::CompromisedCredentials => serializer.serialize_i32(3),
18025 Self::InternalStateFailure => serializer.serialize_i32(4),
18026 Self::UnknownValue(u) => u.0.serialize(serializer),
18027 }
18028 }
18029 }
18030
18031 impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
18032 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18033 where
18034 D: serde::Deserializer<'de>,
18035 {
18036 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
18037 ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
18038 ))
18039 }
18040 }
18041}
18042
18043/// We currently only support backup retention by specifying the number
18044/// of backups we will retain.
18045#[derive(Clone, Default, PartialEq)]
18046#[non_exhaustive]
18047pub struct BackupRetentionSettings {
18048 /// The unit that 'retained_backups' represents.
18049 pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
18050
18051 /// Depending on the value of retention_unit, this is used to determine
18052 /// if a backup needs to be deleted. If retention_unit is 'COUNT', we will
18053 /// retain this many backups.
18054 pub retained_backups: std::option::Option<wkt::Int32Value>,
18055
18056 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18057}
18058
18059impl BackupRetentionSettings {
18060 /// Creates a new default instance.
18061 pub fn new() -> Self {
18062 std::default::Default::default()
18063 }
18064
18065 /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
18066 ///
18067 /// # Example
18068 /// ```ignore,no_run
18069 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
18070 /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
18071 /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
18072 /// ```
18073 pub fn set_retention_unit<
18074 T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
18075 >(
18076 mut self,
18077 v: T,
18078 ) -> Self {
18079 self.retention_unit = v.into();
18080 self
18081 }
18082
18083 /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
18084 ///
18085 /// # Example
18086 /// ```ignore,no_run
18087 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
18088 /// use wkt::Int32Value;
18089 /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
18090 /// ```
18091 pub fn set_retained_backups<T>(mut self, v: T) -> Self
18092 where
18093 T: std::convert::Into<wkt::Int32Value>,
18094 {
18095 self.retained_backups = std::option::Option::Some(v.into());
18096 self
18097 }
18098
18099 /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
18100 ///
18101 /// # Example
18102 /// ```ignore,no_run
18103 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
18104 /// use wkt::Int32Value;
18105 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
18106 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
18107 /// ```
18108 pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
18109 where
18110 T: std::convert::Into<wkt::Int32Value>,
18111 {
18112 self.retained_backups = v.map(|x| x.into());
18113 self
18114 }
18115}
18116
18117impl wkt::message::Message for BackupRetentionSettings {
18118 fn typename() -> &'static str {
18119 "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
18120 }
18121}
18122
18123/// Defines additional types related to [BackupRetentionSettings].
18124pub mod backup_retention_settings {
18125 #[allow(unused_imports)]
18126 use super::*;
18127
18128 /// The units that retained_backups specifies, we only support COUNT.
18129 ///
18130 /// # Working with unknown values
18131 ///
18132 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18133 /// additional enum variants at any time. Adding new variants is not considered
18134 /// a breaking change. Applications should write their code in anticipation of:
18135 ///
18136 /// - New values appearing in future releases of the client library, **and**
18137 /// - New values received dynamically, without application changes.
18138 ///
18139 /// Please consult the [Working with enums] section in the user guide for some
18140 /// guidelines.
18141 ///
18142 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18143 #[derive(Clone, Debug, PartialEq)]
18144 #[non_exhaustive]
18145 pub enum RetentionUnit {
18146 /// Backup retention unit is unspecified, will be treated as COUNT.
18147 Unspecified,
18148 /// Retention will be by count, eg. "retain the most recent 7 backups".
18149 Count,
18150 /// If set, the enum was initialized with an unknown value.
18151 ///
18152 /// Applications can examine the value using [RetentionUnit::value] or
18153 /// [RetentionUnit::name].
18154 UnknownValue(retention_unit::UnknownValue),
18155 }
18156
18157 #[doc(hidden)]
18158 pub mod retention_unit {
18159 #[allow(unused_imports)]
18160 use super::*;
18161 #[derive(Clone, Debug, PartialEq)]
18162 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18163 }
18164
18165 impl RetentionUnit {
18166 /// Gets the enum value.
18167 ///
18168 /// Returns `None` if the enum contains an unknown value deserialized from
18169 /// the string representation of enums.
18170 pub fn value(&self) -> std::option::Option<i32> {
18171 match self {
18172 Self::Unspecified => std::option::Option::Some(0),
18173 Self::Count => std::option::Option::Some(1),
18174 Self::UnknownValue(u) => u.0.value(),
18175 }
18176 }
18177
18178 /// Gets the enum value as a string.
18179 ///
18180 /// Returns `None` if the enum contains an unknown value deserialized from
18181 /// the integer representation of enums.
18182 pub fn name(&self) -> std::option::Option<&str> {
18183 match self {
18184 Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
18185 Self::Count => std::option::Option::Some("COUNT"),
18186 Self::UnknownValue(u) => u.0.name(),
18187 }
18188 }
18189 }
18190
18191 impl std::default::Default for RetentionUnit {
18192 fn default() -> Self {
18193 use std::convert::From;
18194 Self::from(0)
18195 }
18196 }
18197
18198 impl std::fmt::Display for RetentionUnit {
18199 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18200 wkt::internal::display_enum(f, self.name(), self.value())
18201 }
18202 }
18203
18204 impl std::convert::From<i32> for RetentionUnit {
18205 fn from(value: i32) -> Self {
18206 match value {
18207 0 => Self::Unspecified,
18208 1 => Self::Count,
18209 _ => Self::UnknownValue(retention_unit::UnknownValue(
18210 wkt::internal::UnknownEnumValue::Integer(value),
18211 )),
18212 }
18213 }
18214 }
18215
18216 impl std::convert::From<&str> for RetentionUnit {
18217 fn from(value: &str) -> Self {
18218 use std::string::ToString;
18219 match value {
18220 "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
18221 "COUNT" => Self::Count,
18222 _ => Self::UnknownValue(retention_unit::UnknownValue(
18223 wkt::internal::UnknownEnumValue::String(value.to_string()),
18224 )),
18225 }
18226 }
18227 }
18228
18229 impl serde::ser::Serialize for RetentionUnit {
18230 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18231 where
18232 S: serde::Serializer,
18233 {
18234 match self {
18235 Self::Unspecified => serializer.serialize_i32(0),
18236 Self::Count => serializer.serialize_i32(1),
18237 Self::UnknownValue(u) => u.0.serialize(serializer),
18238 }
18239 }
18240 }
18241
18242 impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
18243 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18244 where
18245 D: serde::Deserializer<'de>,
18246 {
18247 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
18248 ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
18249 ))
18250 }
18251 }
18252}
18253
18254/// Database instance backup configuration.
18255#[derive(Clone, Default, PartialEq)]
18256#[non_exhaustive]
18257pub struct BackupConfiguration {
18258 /// Start time for the daily backup configuration in UTC timezone in the 24
18259 /// hour format - `HH:MM`.
18260 pub start_time: std::string::String,
18261
18262 /// Whether this configuration is enabled.
18263 pub enabled: std::option::Option<wkt::BoolValue>,
18264
18265 /// This is always `sql#backupConfiguration`.
18266 pub kind: std::string::String,
18267
18268 /// (MySQL only) Whether binary log is enabled. If backup configuration is
18269 /// disabled, binarylog must be disabled as well.
18270 pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
18271
18272 /// Optional. Deprecated: replication_log_archiving_enabled is deprecated and
18273 /// will be removed from a future version of the API. Use
18274 /// [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
18275 /// instead.
18276 ///
18277 /// [google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]: crate::model::BackupConfiguration::point_in_time_recovery_enabled
18278 #[deprecated]
18279 pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
18280
18281 /// Location of the backup
18282 pub location: std::string::String,
18283
18284 /// Whether point in time recovery is enabled.
18285 pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
18286
18287 /// Backup retention settings.
18288 pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
18289
18290 /// The number of days of transaction logs we retain for point in time
18291 /// restore, from 1-7.
18292 pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
18293
18294 /// Output only. This value contains the storage location of transactional logs
18295 /// used to perform point-in-time recovery (PITR) for the database.
18296 pub transactional_log_storage_state:
18297 std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
18298
18299 /// Output only. Backup tier that manages the backups for the instance.
18300 pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
18301
18302 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18303}
18304
18305impl BackupConfiguration {
18306 /// Creates a new default instance.
18307 pub fn new() -> Self {
18308 std::default::Default::default()
18309 }
18310
18311 /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
18312 ///
18313 /// # Example
18314 /// ```ignore,no_run
18315 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18316 /// let x = BackupConfiguration::new().set_start_time("example");
18317 /// ```
18318 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18319 self.start_time = v.into();
18320 self
18321 }
18322
18323 /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
18324 ///
18325 /// # Example
18326 /// ```ignore,no_run
18327 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18328 /// use wkt::BoolValue;
18329 /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
18330 /// ```
18331 pub fn set_enabled<T>(mut self, v: T) -> Self
18332 where
18333 T: std::convert::Into<wkt::BoolValue>,
18334 {
18335 self.enabled = std::option::Option::Some(v.into());
18336 self
18337 }
18338
18339 /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
18340 ///
18341 /// # Example
18342 /// ```ignore,no_run
18343 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18344 /// use wkt::BoolValue;
18345 /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
18346 /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
18347 /// ```
18348 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
18349 where
18350 T: std::convert::Into<wkt::BoolValue>,
18351 {
18352 self.enabled = v.map(|x| x.into());
18353 self
18354 }
18355
18356 /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
18357 ///
18358 /// # Example
18359 /// ```ignore,no_run
18360 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18361 /// let x = BackupConfiguration::new().set_kind("example");
18362 /// ```
18363 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18364 self.kind = v.into();
18365 self
18366 }
18367
18368 /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
18369 ///
18370 /// # Example
18371 /// ```ignore,no_run
18372 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18373 /// use wkt::BoolValue;
18374 /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
18375 /// ```
18376 pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
18377 where
18378 T: std::convert::Into<wkt::BoolValue>,
18379 {
18380 self.binary_log_enabled = std::option::Option::Some(v.into());
18381 self
18382 }
18383
18384 /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
18385 ///
18386 /// # Example
18387 /// ```ignore,no_run
18388 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18389 /// use wkt::BoolValue;
18390 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
18391 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
18392 /// ```
18393 pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
18394 where
18395 T: std::convert::Into<wkt::BoolValue>,
18396 {
18397 self.binary_log_enabled = v.map(|x| x.into());
18398 self
18399 }
18400
18401 /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18402 ///
18403 /// # Example
18404 /// ```ignore,no_run
18405 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18406 /// use wkt::BoolValue;
18407 /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
18408 /// ```
18409 #[deprecated]
18410 pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
18411 where
18412 T: std::convert::Into<wkt::BoolValue>,
18413 {
18414 self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
18415 self
18416 }
18417
18418 /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18419 ///
18420 /// # Example
18421 /// ```ignore,no_run
18422 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18423 /// use wkt::BoolValue;
18424 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
18425 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
18426 /// ```
18427 #[deprecated]
18428 pub fn set_or_clear_replication_log_archiving_enabled<T>(
18429 mut self,
18430 v: std::option::Option<T>,
18431 ) -> Self
18432 where
18433 T: std::convert::Into<wkt::BoolValue>,
18434 {
18435 self.replication_log_archiving_enabled = v.map(|x| x.into());
18436 self
18437 }
18438
18439 /// Sets the value of [location][crate::model::BackupConfiguration::location].
18440 ///
18441 /// # Example
18442 /// ```ignore,no_run
18443 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18444 /// let x = BackupConfiguration::new().set_location("example");
18445 /// ```
18446 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18447 self.location = v.into();
18448 self
18449 }
18450
18451 /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18452 ///
18453 /// # Example
18454 /// ```ignore,no_run
18455 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18456 /// use wkt::BoolValue;
18457 /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
18458 /// ```
18459 pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
18460 where
18461 T: std::convert::Into<wkt::BoolValue>,
18462 {
18463 self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
18464 self
18465 }
18466
18467 /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18468 ///
18469 /// # Example
18470 /// ```ignore,no_run
18471 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18472 /// use wkt::BoolValue;
18473 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
18474 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
18475 /// ```
18476 pub fn set_or_clear_point_in_time_recovery_enabled<T>(
18477 mut self,
18478 v: std::option::Option<T>,
18479 ) -> Self
18480 where
18481 T: std::convert::Into<wkt::BoolValue>,
18482 {
18483 self.point_in_time_recovery_enabled = v.map(|x| x.into());
18484 self
18485 }
18486
18487 /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18488 ///
18489 /// # Example
18490 /// ```ignore,no_run
18491 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18492 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18493 /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
18494 /// ```
18495 pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
18496 where
18497 T: std::convert::Into<crate::model::BackupRetentionSettings>,
18498 {
18499 self.backup_retention_settings = std::option::Option::Some(v.into());
18500 self
18501 }
18502
18503 /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18504 ///
18505 /// # Example
18506 /// ```ignore,no_run
18507 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18508 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18509 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
18510 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
18511 /// ```
18512 pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
18513 where
18514 T: std::convert::Into<crate::model::BackupRetentionSettings>,
18515 {
18516 self.backup_retention_settings = v.map(|x| x.into());
18517 self
18518 }
18519
18520 /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18521 ///
18522 /// # Example
18523 /// ```ignore,no_run
18524 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18525 /// use wkt::Int32Value;
18526 /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
18527 /// ```
18528 pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
18529 where
18530 T: std::convert::Into<wkt::Int32Value>,
18531 {
18532 self.transaction_log_retention_days = std::option::Option::Some(v.into());
18533 self
18534 }
18535
18536 /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18537 ///
18538 /// # Example
18539 /// ```ignore,no_run
18540 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18541 /// use wkt::Int32Value;
18542 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
18543 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
18544 /// ```
18545 pub fn set_or_clear_transaction_log_retention_days<T>(
18546 mut self,
18547 v: std::option::Option<T>,
18548 ) -> Self
18549 where
18550 T: std::convert::Into<wkt::Int32Value>,
18551 {
18552 self.transaction_log_retention_days = v.map(|x| x.into());
18553 self
18554 }
18555
18556 /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18557 ///
18558 /// # Example
18559 /// ```ignore,no_run
18560 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18561 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18562 /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
18563 /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
18564 /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
18565 /// ```
18566 pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
18567 where
18568 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18569 {
18570 self.transactional_log_storage_state = std::option::Option::Some(v.into());
18571 self
18572 }
18573
18574 /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18575 ///
18576 /// # Example
18577 /// ```ignore,no_run
18578 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18579 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18580 /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
18581 /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
18582 /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
18583 /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
18584 /// ```
18585 pub fn set_or_clear_transactional_log_storage_state<T>(
18586 mut self,
18587 v: std::option::Option<T>,
18588 ) -> Self
18589 where
18590 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18591 {
18592 self.transactional_log_storage_state = v.map(|x| x.into());
18593 self
18594 }
18595
18596 /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18597 ///
18598 /// # Example
18599 /// ```ignore,no_run
18600 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18601 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18602 /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
18603 /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
18604 /// ```
18605 pub fn set_backup_tier<T>(mut self, v: T) -> Self
18606 where
18607 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18608 {
18609 self.backup_tier = std::option::Option::Some(v.into());
18610 self
18611 }
18612
18613 /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18614 ///
18615 /// # Example
18616 /// ```ignore,no_run
18617 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18618 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18619 /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
18620 /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
18621 /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
18622 /// ```
18623 pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
18624 where
18625 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18626 {
18627 self.backup_tier = v.map(|x| x.into());
18628 self
18629 }
18630}
18631
18632impl wkt::message::Message for BackupConfiguration {
18633 fn typename() -> &'static str {
18634 "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
18635 }
18636}
18637
18638/// Defines additional types related to [BackupConfiguration].
18639pub mod backup_configuration {
18640 #[allow(unused_imports)]
18641 use super::*;
18642
18643 /// This value contains the storage location of the transactional logs
18644 /// used to perform point-in-time recovery (PITR) for the database.
18645 ///
18646 /// # Working with unknown values
18647 ///
18648 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18649 /// additional enum variants at any time. Adding new variants is not considered
18650 /// a breaking change. Applications should write their code in anticipation of:
18651 ///
18652 /// - New values appearing in future releases of the client library, **and**
18653 /// - New values received dynamically, without application changes.
18654 ///
18655 /// Please consult the [Working with enums] section in the user guide for some
18656 /// guidelines.
18657 ///
18658 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18659 #[derive(Clone, Debug, PartialEq)]
18660 #[non_exhaustive]
18661 pub enum TransactionalLogStorageState {
18662 /// Unspecified.
18663 Unspecified,
18664 /// The transaction logs used for PITR for the instance are stored
18665 /// on a data disk.
18666 Disk,
18667 /// The transaction logs used for PITR for the instance are switching from
18668 /// being stored on a data disk to being stored in Cloud Storage.
18669 /// Only applicable to MySQL.
18670 SwitchingToCloudStorage,
18671 /// The transaction logs used for PITR for the instance are now stored
18672 /// in Cloud Storage. Previously, they were stored on a data disk.
18673 /// Only applicable to MySQL.
18674 SwitchedToCloudStorage,
18675 /// The transaction logs used for PITR for the instance are stored in
18676 /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
18677 CloudStorage,
18678 /// If set, the enum was initialized with an unknown value.
18679 ///
18680 /// Applications can examine the value using [TransactionalLogStorageState::value] or
18681 /// [TransactionalLogStorageState::name].
18682 UnknownValue(transactional_log_storage_state::UnknownValue),
18683 }
18684
18685 #[doc(hidden)]
18686 pub mod transactional_log_storage_state {
18687 #[allow(unused_imports)]
18688 use super::*;
18689 #[derive(Clone, Debug, PartialEq)]
18690 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18691 }
18692
18693 impl TransactionalLogStorageState {
18694 /// Gets the enum value.
18695 ///
18696 /// Returns `None` if the enum contains an unknown value deserialized from
18697 /// the string representation of enums.
18698 pub fn value(&self) -> std::option::Option<i32> {
18699 match self {
18700 Self::Unspecified => std::option::Option::Some(0),
18701 Self::Disk => std::option::Option::Some(1),
18702 Self::SwitchingToCloudStorage => std::option::Option::Some(2),
18703 Self::SwitchedToCloudStorage => std::option::Option::Some(3),
18704 Self::CloudStorage => std::option::Option::Some(4),
18705 Self::UnknownValue(u) => u.0.value(),
18706 }
18707 }
18708
18709 /// Gets the enum value as a string.
18710 ///
18711 /// Returns `None` if the enum contains an unknown value deserialized from
18712 /// the integer representation of enums.
18713 pub fn name(&self) -> std::option::Option<&str> {
18714 match self {
18715 Self::Unspecified => {
18716 std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
18717 }
18718 Self::Disk => std::option::Option::Some("DISK"),
18719 Self::SwitchingToCloudStorage => {
18720 std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
18721 }
18722 Self::SwitchedToCloudStorage => {
18723 std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
18724 }
18725 Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
18726 Self::UnknownValue(u) => u.0.name(),
18727 }
18728 }
18729 }
18730
18731 impl std::default::Default for TransactionalLogStorageState {
18732 fn default() -> Self {
18733 use std::convert::From;
18734 Self::from(0)
18735 }
18736 }
18737
18738 impl std::fmt::Display for TransactionalLogStorageState {
18739 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18740 wkt::internal::display_enum(f, self.name(), self.value())
18741 }
18742 }
18743
18744 impl std::convert::From<i32> for TransactionalLogStorageState {
18745 fn from(value: i32) -> Self {
18746 match value {
18747 0 => Self::Unspecified,
18748 1 => Self::Disk,
18749 2 => Self::SwitchingToCloudStorage,
18750 3 => Self::SwitchedToCloudStorage,
18751 4 => Self::CloudStorage,
18752 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18753 wkt::internal::UnknownEnumValue::Integer(value),
18754 )),
18755 }
18756 }
18757 }
18758
18759 impl std::convert::From<&str> for TransactionalLogStorageState {
18760 fn from(value: &str) -> Self {
18761 use std::string::ToString;
18762 match value {
18763 "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
18764 "DISK" => Self::Disk,
18765 "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
18766 "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
18767 "CLOUD_STORAGE" => Self::CloudStorage,
18768 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18769 wkt::internal::UnknownEnumValue::String(value.to_string()),
18770 )),
18771 }
18772 }
18773 }
18774
18775 impl serde::ser::Serialize for TransactionalLogStorageState {
18776 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18777 where
18778 S: serde::Serializer,
18779 {
18780 match self {
18781 Self::Unspecified => serializer.serialize_i32(0),
18782 Self::Disk => serializer.serialize_i32(1),
18783 Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
18784 Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
18785 Self::CloudStorage => serializer.serialize_i32(4),
18786 Self::UnknownValue(u) => u.0.serialize(serializer),
18787 }
18788 }
18789 }
18790
18791 impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
18792 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18793 where
18794 D: serde::Deserializer<'de>,
18795 {
18796 deserializer.deserialize_any(
18797 wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
18798 ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
18799 ),
18800 )
18801 }
18802 }
18803
18804 /// Backup tier that manages the backups for the instance.
18805 ///
18806 /// # Working with unknown values
18807 ///
18808 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18809 /// additional enum variants at any time. Adding new variants is not considered
18810 /// a breaking change. Applications should write their code in anticipation of:
18811 ///
18812 /// - New values appearing in future releases of the client library, **and**
18813 /// - New values received dynamically, without application changes.
18814 ///
18815 /// Please consult the [Working with enums] section in the user guide for some
18816 /// guidelines.
18817 ///
18818 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18819 #[derive(Clone, Debug, PartialEq)]
18820 #[non_exhaustive]
18821 pub enum BackupTier {
18822 /// Unspecified.
18823 Unspecified,
18824 /// Instance is managed by Cloud SQL.
18825 Standard,
18826 /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
18827 #[deprecated]
18828 Advanced,
18829 /// Instance is managed by Google Cloud Backup and DR Service.
18830 Enhanced,
18831 /// If set, the enum was initialized with an unknown value.
18832 ///
18833 /// Applications can examine the value using [BackupTier::value] or
18834 /// [BackupTier::name].
18835 UnknownValue(backup_tier::UnknownValue),
18836 }
18837
18838 #[doc(hidden)]
18839 pub mod backup_tier {
18840 #[allow(unused_imports)]
18841 use super::*;
18842 #[derive(Clone, Debug, PartialEq)]
18843 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18844 }
18845
18846 impl BackupTier {
18847 /// Gets the enum value.
18848 ///
18849 /// Returns `None` if the enum contains an unknown value deserialized from
18850 /// the string representation of enums.
18851 pub fn value(&self) -> std::option::Option<i32> {
18852 match self {
18853 Self::Unspecified => std::option::Option::Some(0),
18854 Self::Standard => std::option::Option::Some(1),
18855 Self::Advanced => std::option::Option::Some(2),
18856 Self::Enhanced => std::option::Option::Some(3),
18857 Self::UnknownValue(u) => u.0.value(),
18858 }
18859 }
18860
18861 /// Gets the enum value as a string.
18862 ///
18863 /// Returns `None` if the enum contains an unknown value deserialized from
18864 /// the integer representation of enums.
18865 pub fn name(&self) -> std::option::Option<&str> {
18866 match self {
18867 Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
18868 Self::Standard => std::option::Option::Some("STANDARD"),
18869 Self::Advanced => std::option::Option::Some("ADVANCED"),
18870 Self::Enhanced => std::option::Option::Some("ENHANCED"),
18871 Self::UnknownValue(u) => u.0.name(),
18872 }
18873 }
18874 }
18875
18876 impl std::default::Default for BackupTier {
18877 fn default() -> Self {
18878 use std::convert::From;
18879 Self::from(0)
18880 }
18881 }
18882
18883 impl std::fmt::Display for BackupTier {
18884 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18885 wkt::internal::display_enum(f, self.name(), self.value())
18886 }
18887 }
18888
18889 impl std::convert::From<i32> for BackupTier {
18890 fn from(value: i32) -> Self {
18891 match value {
18892 0 => Self::Unspecified,
18893 1 => Self::Standard,
18894 2 => Self::Advanced,
18895 3 => Self::Enhanced,
18896 _ => Self::UnknownValue(backup_tier::UnknownValue(
18897 wkt::internal::UnknownEnumValue::Integer(value),
18898 )),
18899 }
18900 }
18901 }
18902
18903 impl std::convert::From<&str> for BackupTier {
18904 fn from(value: &str) -> Self {
18905 use std::string::ToString;
18906 match value {
18907 "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
18908 "STANDARD" => Self::Standard,
18909 "ADVANCED" => Self::Advanced,
18910 "ENHANCED" => Self::Enhanced,
18911 _ => Self::UnknownValue(backup_tier::UnknownValue(
18912 wkt::internal::UnknownEnumValue::String(value.to_string()),
18913 )),
18914 }
18915 }
18916 }
18917
18918 impl serde::ser::Serialize for BackupTier {
18919 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18920 where
18921 S: serde::Serializer,
18922 {
18923 match self {
18924 Self::Unspecified => serializer.serialize_i32(0),
18925 Self::Standard => serializer.serialize_i32(1),
18926 Self::Advanced => serializer.serialize_i32(2),
18927 Self::Enhanced => serializer.serialize_i32(3),
18928 Self::UnknownValue(u) => u.0.serialize(serializer),
18929 }
18930 }
18931 }
18932
18933 impl<'de> serde::de::Deserialize<'de> for BackupTier {
18934 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18935 where
18936 D: serde::Deserializer<'de>,
18937 {
18938 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
18939 ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
18940 ))
18941 }
18942 }
18943}
18944
18945/// Perform disk shrink context.
18946#[derive(Clone, Default, PartialEq)]
18947#[non_exhaustive]
18948pub struct PerformDiskShrinkContext {
18949 /// The target disk shrink size in GigaBytes.
18950 pub target_size_gb: i64,
18951
18952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18953}
18954
18955impl PerformDiskShrinkContext {
18956 /// Creates a new default instance.
18957 pub fn new() -> Self {
18958 std::default::Default::default()
18959 }
18960
18961 /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
18962 ///
18963 /// # Example
18964 /// ```ignore,no_run
18965 /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
18966 /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
18967 /// ```
18968 pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18969 self.target_size_gb = v.into();
18970 self
18971 }
18972}
18973
18974impl wkt::message::Message for PerformDiskShrinkContext {
18975 fn typename() -> &'static str {
18976 "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
18977 }
18978}
18979
18980/// Structured PreCheckResponse containing message, type, and required
18981/// actions.
18982#[derive(Clone, Default, PartialEq)]
18983#[non_exhaustive]
18984pub struct PreCheckResponse {
18985 /// The message to be displayed to the user.
18986 pub message: std::option::Option<std::string::String>,
18987
18988 /// The type of message whether it is an info, warning, or error.
18989 pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
18990
18991 /// The actions that the user needs to take. Use repeated for multiple
18992 /// actions.
18993 pub actions_required: std::vec::Vec<std::string::String>,
18994
18995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18996}
18997
18998impl PreCheckResponse {
18999 /// Creates a new default instance.
19000 pub fn new() -> Self {
19001 std::default::Default::default()
19002 }
19003
19004 /// Sets the value of [message][crate::model::PreCheckResponse::message].
19005 ///
19006 /// # Example
19007 /// ```ignore,no_run
19008 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19009 /// let x = PreCheckResponse::new().set_message("example");
19010 /// ```
19011 pub fn set_message<T>(mut self, v: T) -> Self
19012 where
19013 T: std::convert::Into<std::string::String>,
19014 {
19015 self.message = std::option::Option::Some(v.into());
19016 self
19017 }
19018
19019 /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
19020 ///
19021 /// # Example
19022 /// ```ignore,no_run
19023 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19024 /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
19025 /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
19026 /// ```
19027 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
19028 where
19029 T: std::convert::Into<std::string::String>,
19030 {
19031 self.message = v.map(|x| x.into());
19032 self
19033 }
19034
19035 /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
19036 ///
19037 /// # Example
19038 /// ```ignore,no_run
19039 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19040 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
19041 /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
19042 /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
19043 /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
19044 /// ```
19045 pub fn set_message_type<T>(mut self, v: T) -> Self
19046 where
19047 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
19048 {
19049 self.message_type = std::option::Option::Some(v.into());
19050 self
19051 }
19052
19053 /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
19054 ///
19055 /// # Example
19056 /// ```ignore,no_run
19057 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19058 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
19059 /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
19060 /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
19061 /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
19062 /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
19063 /// ```
19064 pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
19065 where
19066 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
19067 {
19068 self.message_type = v.map(|x| x.into());
19069 self
19070 }
19071
19072 /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
19073 ///
19074 /// # Example
19075 /// ```ignore,no_run
19076 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19077 /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
19078 /// ```
19079 pub fn set_actions_required<T, V>(mut self, v: T) -> Self
19080 where
19081 T: std::iter::IntoIterator<Item = V>,
19082 V: std::convert::Into<std::string::String>,
19083 {
19084 use std::iter::Iterator;
19085 self.actions_required = v.into_iter().map(|i| i.into()).collect();
19086 self
19087 }
19088}
19089
19090impl wkt::message::Message for PreCheckResponse {
19091 fn typename() -> &'static str {
19092 "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
19093 }
19094}
19095
19096/// Defines additional types related to [PreCheckResponse].
19097pub mod pre_check_response {
19098 #[allow(unused_imports)]
19099 use super::*;
19100
19101 /// The type of message which can be an info, a warning, or an error that
19102 /// requires user intervention.
19103 ///
19104 /// # Working with unknown values
19105 ///
19106 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19107 /// additional enum variants at any time. Adding new variants is not considered
19108 /// a breaking change. Applications should write their code in anticipation of:
19109 ///
19110 /// - New values appearing in future releases of the client library, **and**
19111 /// - New values received dynamically, without application changes.
19112 ///
19113 /// Please consult the [Working with enums] section in the user guide for some
19114 /// guidelines.
19115 ///
19116 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19117 #[derive(Clone, Debug, PartialEq)]
19118 #[non_exhaustive]
19119 pub enum MessageType {
19120 /// Default unspecified value to prevent unintended behavior changes.
19121 Unspecified,
19122 /// General informational messages that don't require action.
19123 Info,
19124 /// Warnings that might impact the upgrade but don't block it.
19125 Warning,
19126 /// Errors that a user must resolve before proceeding with the upgrade.
19127 Error,
19128 /// If set, the enum was initialized with an unknown value.
19129 ///
19130 /// Applications can examine the value using [MessageType::value] or
19131 /// [MessageType::name].
19132 UnknownValue(message_type::UnknownValue),
19133 }
19134
19135 #[doc(hidden)]
19136 pub mod message_type {
19137 #[allow(unused_imports)]
19138 use super::*;
19139 #[derive(Clone, Debug, PartialEq)]
19140 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19141 }
19142
19143 impl MessageType {
19144 /// Gets the enum value.
19145 ///
19146 /// Returns `None` if the enum contains an unknown value deserialized from
19147 /// the string representation of enums.
19148 pub fn value(&self) -> std::option::Option<i32> {
19149 match self {
19150 Self::Unspecified => std::option::Option::Some(0),
19151 Self::Info => std::option::Option::Some(1),
19152 Self::Warning => std::option::Option::Some(2),
19153 Self::Error => std::option::Option::Some(3),
19154 Self::UnknownValue(u) => u.0.value(),
19155 }
19156 }
19157
19158 /// Gets the enum value as a string.
19159 ///
19160 /// Returns `None` if the enum contains an unknown value deserialized from
19161 /// the integer representation of enums.
19162 pub fn name(&self) -> std::option::Option<&str> {
19163 match self {
19164 Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
19165 Self::Info => std::option::Option::Some("INFO"),
19166 Self::Warning => std::option::Option::Some("WARNING"),
19167 Self::Error => std::option::Option::Some("ERROR"),
19168 Self::UnknownValue(u) => u.0.name(),
19169 }
19170 }
19171 }
19172
19173 impl std::default::Default for MessageType {
19174 fn default() -> Self {
19175 use std::convert::From;
19176 Self::from(0)
19177 }
19178 }
19179
19180 impl std::fmt::Display for MessageType {
19181 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19182 wkt::internal::display_enum(f, self.name(), self.value())
19183 }
19184 }
19185
19186 impl std::convert::From<i32> for MessageType {
19187 fn from(value: i32) -> Self {
19188 match value {
19189 0 => Self::Unspecified,
19190 1 => Self::Info,
19191 2 => Self::Warning,
19192 3 => Self::Error,
19193 _ => Self::UnknownValue(message_type::UnknownValue(
19194 wkt::internal::UnknownEnumValue::Integer(value),
19195 )),
19196 }
19197 }
19198 }
19199
19200 impl std::convert::From<&str> for MessageType {
19201 fn from(value: &str) -> Self {
19202 use std::string::ToString;
19203 match value {
19204 "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
19205 "INFO" => Self::Info,
19206 "WARNING" => Self::Warning,
19207 "ERROR" => Self::Error,
19208 _ => Self::UnknownValue(message_type::UnknownValue(
19209 wkt::internal::UnknownEnumValue::String(value.to_string()),
19210 )),
19211 }
19212 }
19213 }
19214
19215 impl serde::ser::Serialize for MessageType {
19216 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19217 where
19218 S: serde::Serializer,
19219 {
19220 match self {
19221 Self::Unspecified => serializer.serialize_i32(0),
19222 Self::Info => serializer.serialize_i32(1),
19223 Self::Warning => serializer.serialize_i32(2),
19224 Self::Error => serializer.serialize_i32(3),
19225 Self::UnknownValue(u) => u.0.serialize(serializer),
19226 }
19227 }
19228 }
19229
19230 impl<'de> serde::de::Deserialize<'de> for MessageType {
19231 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19232 where
19233 D: serde::Deserializer<'de>,
19234 {
19235 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
19236 ".google.cloud.sql.v1.PreCheckResponse.MessageType",
19237 ))
19238 }
19239 }
19240}
19241
19242/// Pre-check major version upgrade context.
19243#[derive(Clone, Default, PartialEq)]
19244#[non_exhaustive]
19245pub struct PreCheckMajorVersionUpgradeContext {
19246 /// Required. The target database version to upgrade to.
19247 pub target_database_version: crate::model::SqlDatabaseVersion,
19248
19249 /// Output only. The responses from the precheck operation.
19250 pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
19251
19252 /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
19253 pub kind: std::string::String,
19254
19255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19256}
19257
19258impl PreCheckMajorVersionUpgradeContext {
19259 /// Creates a new default instance.
19260 pub fn new() -> Self {
19261 std::default::Default::default()
19262 }
19263
19264 /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
19265 ///
19266 /// # Example
19267 /// ```ignore,no_run
19268 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
19269 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
19270 /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
19271 /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
19272 /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
19273 /// ```
19274 pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
19275 mut self,
19276 v: T,
19277 ) -> Self {
19278 self.target_database_version = v.into();
19279 self
19280 }
19281
19282 /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
19283 ///
19284 /// # Example
19285 /// ```ignore,no_run
19286 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
19287 /// use google_cloud_sql_v1::model::PreCheckResponse;
19288 /// let x = PreCheckMajorVersionUpgradeContext::new()
19289 /// .set_pre_check_response([
19290 /// PreCheckResponse::default()/* use setters */,
19291 /// PreCheckResponse::default()/* use (different) setters */,
19292 /// ]);
19293 /// ```
19294 pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
19295 where
19296 T: std::iter::IntoIterator<Item = V>,
19297 V: std::convert::Into<crate::model::PreCheckResponse>,
19298 {
19299 use std::iter::Iterator;
19300 self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
19301 self
19302 }
19303
19304 /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
19305 ///
19306 /// # Example
19307 /// ```ignore,no_run
19308 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
19309 /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
19310 /// ```
19311 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19312 self.kind = v.into();
19313 self
19314 }
19315}
19316
19317impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
19318 fn typename() -> &'static str {
19319 "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
19320 }
19321}
19322
19323/// Backup context.
19324#[derive(Clone, Default, PartialEq)]
19325#[non_exhaustive]
19326pub struct BackupContext {
19327 /// The identifier of the backup.
19328 pub backup_id: i64,
19329
19330 /// This is always `sql#backupContext`.
19331 pub kind: std::string::String,
19332
19333 /// The name of the backup.
19334 /// Format: projects/{project}/backups/{backup}
19335 pub name: std::string::String,
19336
19337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19338}
19339
19340impl BackupContext {
19341 /// Creates a new default instance.
19342 pub fn new() -> Self {
19343 std::default::Default::default()
19344 }
19345
19346 /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
19347 ///
19348 /// # Example
19349 /// ```ignore,no_run
19350 /// # use google_cloud_sql_v1::model::BackupContext;
19351 /// let x = BackupContext::new().set_backup_id(42);
19352 /// ```
19353 pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19354 self.backup_id = v.into();
19355 self
19356 }
19357
19358 /// Sets the value of [kind][crate::model::BackupContext::kind].
19359 ///
19360 /// # Example
19361 /// ```ignore,no_run
19362 /// # use google_cloud_sql_v1::model::BackupContext;
19363 /// let x = BackupContext::new().set_kind("example");
19364 /// ```
19365 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19366 self.kind = v.into();
19367 self
19368 }
19369
19370 /// Sets the value of [name][crate::model::BackupContext::name].
19371 ///
19372 /// # Example
19373 /// ```ignore,no_run
19374 /// # use google_cloud_sql_v1::model::BackupContext;
19375 /// let x = BackupContext::new().set_name("example");
19376 /// ```
19377 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19378 self.name = v.into();
19379 self
19380 }
19381}
19382
19383impl wkt::message::Message for BackupContext {
19384 fn typename() -> &'static str {
19385 "type.googleapis.com/google.cloud.sql.v1.BackupContext"
19386 }
19387}
19388
19389/// Represents a SQL database on the Cloud SQL instance.
19390#[derive(Clone, Default, PartialEq)]
19391#[non_exhaustive]
19392pub struct Database {
19393 /// This is always `sql#database`.
19394 pub kind: std::string::String,
19395
19396 /// The Cloud SQL charset value.
19397 pub charset: std::string::String,
19398
19399 /// The Cloud SQL collation value.
19400 pub collation: std::string::String,
19401
19402 /// This field is deprecated and will be removed from a future version of the
19403 /// API.
19404 pub etag: std::string::String,
19405
19406 /// The name of the database in the Cloud SQL instance. This does not include
19407 /// the project ID or instance name.
19408 pub name: std::string::String,
19409
19410 /// The name of the Cloud SQL instance. This does not include the project ID.
19411 pub instance: std::string::String,
19412
19413 /// The URI of this resource.
19414 pub self_link: std::string::String,
19415
19416 /// The project ID of the project containing the Cloud SQL database. The Google
19417 /// apps domain is prefixed if applicable.
19418 pub project: std::string::String,
19419
19420 #[allow(missing_docs)]
19421 pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
19422
19423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19424}
19425
19426impl Database {
19427 /// Creates a new default instance.
19428 pub fn new() -> Self {
19429 std::default::Default::default()
19430 }
19431
19432 /// Sets the value of [kind][crate::model::Database::kind].
19433 ///
19434 /// # Example
19435 /// ```ignore,no_run
19436 /// # use google_cloud_sql_v1::model::Database;
19437 /// let x = Database::new().set_kind("example");
19438 /// ```
19439 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19440 self.kind = v.into();
19441 self
19442 }
19443
19444 /// Sets the value of [charset][crate::model::Database::charset].
19445 ///
19446 /// # Example
19447 /// ```ignore,no_run
19448 /// # use google_cloud_sql_v1::model::Database;
19449 /// let x = Database::new().set_charset("example");
19450 /// ```
19451 pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19452 self.charset = v.into();
19453 self
19454 }
19455
19456 /// Sets the value of [collation][crate::model::Database::collation].
19457 ///
19458 /// # Example
19459 /// ```ignore,no_run
19460 /// # use google_cloud_sql_v1::model::Database;
19461 /// let x = Database::new().set_collation("example");
19462 /// ```
19463 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19464 self.collation = v.into();
19465 self
19466 }
19467
19468 /// Sets the value of [etag][crate::model::Database::etag].
19469 ///
19470 /// # Example
19471 /// ```ignore,no_run
19472 /// # use google_cloud_sql_v1::model::Database;
19473 /// let x = Database::new().set_etag("example");
19474 /// ```
19475 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19476 self.etag = v.into();
19477 self
19478 }
19479
19480 /// Sets the value of [name][crate::model::Database::name].
19481 ///
19482 /// # Example
19483 /// ```ignore,no_run
19484 /// # use google_cloud_sql_v1::model::Database;
19485 /// let x = Database::new().set_name("example");
19486 /// ```
19487 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19488 self.name = v.into();
19489 self
19490 }
19491
19492 /// Sets the value of [instance][crate::model::Database::instance].
19493 ///
19494 /// # Example
19495 /// ```ignore,no_run
19496 /// # use google_cloud_sql_v1::model::Database;
19497 /// let x = Database::new().set_instance("example");
19498 /// ```
19499 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19500 self.instance = v.into();
19501 self
19502 }
19503
19504 /// Sets the value of [self_link][crate::model::Database::self_link].
19505 ///
19506 /// # Example
19507 /// ```ignore,no_run
19508 /// # use google_cloud_sql_v1::model::Database;
19509 /// let x = Database::new().set_self_link("example");
19510 /// ```
19511 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19512 self.self_link = v.into();
19513 self
19514 }
19515
19516 /// Sets the value of [project][crate::model::Database::project].
19517 ///
19518 /// # Example
19519 /// ```ignore,no_run
19520 /// # use google_cloud_sql_v1::model::Database;
19521 /// let x = Database::new().set_project("example");
19522 /// ```
19523 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19524 self.project = v.into();
19525 self
19526 }
19527
19528 /// Sets the value of [database_details][crate::model::Database::database_details].
19529 ///
19530 /// Note that all the setters affecting `database_details` are mutually
19531 /// exclusive.
19532 ///
19533 /// # Example
19534 /// ```ignore,no_run
19535 /// # use google_cloud_sql_v1::model::Database;
19536 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19537 /// let x = Database::new().set_database_details(Some(
19538 /// google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
19539 /// ```
19540 pub fn set_database_details<
19541 T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
19542 >(
19543 mut self,
19544 v: T,
19545 ) -> Self {
19546 self.database_details = v.into();
19547 self
19548 }
19549
19550 /// The value of [database_details][crate::model::Database::database_details]
19551 /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
19552 /// holds a different branch.
19553 pub fn sqlserver_database_details(
19554 &self,
19555 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
19556 #[allow(unreachable_patterns)]
19557 self.database_details.as_ref().and_then(|v| match v {
19558 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
19559 std::option::Option::Some(v)
19560 }
19561 _ => std::option::Option::None,
19562 })
19563 }
19564
19565 /// Sets the value of [database_details][crate::model::Database::database_details]
19566 /// to hold a `SqlserverDatabaseDetails`.
19567 ///
19568 /// Note that all the setters affecting `database_details` are
19569 /// mutually exclusive.
19570 ///
19571 /// # Example
19572 /// ```ignore,no_run
19573 /// # use google_cloud_sql_v1::model::Database;
19574 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19575 /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
19576 /// assert!(x.sqlserver_database_details().is_some());
19577 /// ```
19578 pub fn set_sqlserver_database_details<
19579 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
19580 >(
19581 mut self,
19582 v: T,
19583 ) -> Self {
19584 self.database_details = std::option::Option::Some(
19585 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
19586 );
19587 self
19588 }
19589}
19590
19591impl wkt::message::Message for Database {
19592 fn typename() -> &'static str {
19593 "type.googleapis.com/google.cloud.sql.v1.Database"
19594 }
19595}
19596
19597/// Defines additional types related to [Database].
19598pub mod database {
19599 #[allow(unused_imports)]
19600 use super::*;
19601
19602 #[allow(missing_docs)]
19603 #[derive(Clone, Debug, PartialEq)]
19604 #[non_exhaustive]
19605 pub enum DatabaseDetails {
19606 #[allow(missing_docs)]
19607 SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
19608 }
19609}
19610
19611/// Represents a Sql Server database on the Cloud SQL instance.
19612#[derive(Clone, Default, PartialEq)]
19613#[non_exhaustive]
19614pub struct SqlServerDatabaseDetails {
19615 /// The version of SQL Server with which the database is to be made compatible
19616 pub compatibility_level: i32,
19617
19618 /// The recovery model of a SQL Server database
19619 pub recovery_model: std::string::String,
19620
19621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19622}
19623
19624impl SqlServerDatabaseDetails {
19625 /// Creates a new default instance.
19626 pub fn new() -> Self {
19627 std::default::Default::default()
19628 }
19629
19630 /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
19631 ///
19632 /// # Example
19633 /// ```ignore,no_run
19634 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19635 /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
19636 /// ```
19637 pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19638 self.compatibility_level = v.into();
19639 self
19640 }
19641
19642 /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
19643 ///
19644 /// # Example
19645 /// ```ignore,no_run
19646 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19647 /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
19648 /// ```
19649 pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19650 self.recovery_model = v.into();
19651 self
19652 }
19653}
19654
19655impl wkt::message::Message for SqlServerDatabaseDetails {
19656 fn typename() -> &'static str {
19657 "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
19658 }
19659}
19660
19661/// Database flags for Cloud SQL instances.
19662#[derive(Clone, Default, PartialEq)]
19663#[non_exhaustive]
19664pub struct DatabaseFlags {
19665 /// The name of the flag. These flags are passed at instance startup, so
19666 /// include both server options and system variables. Flags are
19667 /// specified with underscores, not hyphens. For more information, see
19668 /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
19669 /// in the Cloud SQL documentation.
19670 pub name: std::string::String,
19671
19672 /// The value of the flag. Boolean flags are set to `on` for true
19673 /// and `off` for false. This field must be omitted if the flag
19674 /// doesn't take a value.
19675 pub value: std::string::String,
19676
19677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19678}
19679
19680impl DatabaseFlags {
19681 /// Creates a new default instance.
19682 pub fn new() -> Self {
19683 std::default::Default::default()
19684 }
19685
19686 /// Sets the value of [name][crate::model::DatabaseFlags::name].
19687 ///
19688 /// # Example
19689 /// ```ignore,no_run
19690 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19691 /// let x = DatabaseFlags::new().set_name("example");
19692 /// ```
19693 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19694 self.name = v.into();
19695 self
19696 }
19697
19698 /// Sets the value of [value][crate::model::DatabaseFlags::value].
19699 ///
19700 /// # Example
19701 /// ```ignore,no_run
19702 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19703 /// let x = DatabaseFlags::new().set_value("example");
19704 /// ```
19705 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19706 self.value = v.into();
19707 self
19708 }
19709}
19710
19711impl wkt::message::Message for DatabaseFlags {
19712 fn typename() -> &'static str {
19713 "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
19714 }
19715}
19716
19717/// MySQL-specific external server sync settings.
19718#[derive(Clone, Default, PartialEq)]
19719#[non_exhaustive]
19720pub struct MySqlSyncConfig {
19721 /// Flags to use for the initial dump.
19722 pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
19723
19724 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19725}
19726
19727impl MySqlSyncConfig {
19728 /// Creates a new default instance.
19729 pub fn new() -> Self {
19730 std::default::Default::default()
19731 }
19732
19733 /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
19734 ///
19735 /// # Example
19736 /// ```ignore,no_run
19737 /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
19738 /// use google_cloud_sql_v1::model::SyncFlags;
19739 /// let x = MySqlSyncConfig::new()
19740 /// .set_initial_sync_flags([
19741 /// SyncFlags::default()/* use setters */,
19742 /// SyncFlags::default()/* use (different) setters */,
19743 /// ]);
19744 /// ```
19745 pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
19746 where
19747 T: std::iter::IntoIterator<Item = V>,
19748 V: std::convert::Into<crate::model::SyncFlags>,
19749 {
19750 use std::iter::Iterator;
19751 self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
19752 self
19753 }
19754}
19755
19756impl wkt::message::Message for MySqlSyncConfig {
19757 fn typename() -> &'static str {
19758 "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
19759 }
19760}
19761
19762/// Initial sync flags for certain Cloud SQL APIs.
19763/// Currently used for the MySQL external server initial dump.
19764#[derive(Clone, Default, PartialEq)]
19765#[non_exhaustive]
19766pub struct SyncFlags {
19767 /// The name of the flag.
19768 pub name: std::string::String,
19769
19770 /// The value of the flag. This field must be omitted if the flag
19771 /// doesn't take a value.
19772 pub value: std::string::String,
19773
19774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19775}
19776
19777impl SyncFlags {
19778 /// Creates a new default instance.
19779 pub fn new() -> Self {
19780 std::default::Default::default()
19781 }
19782
19783 /// Sets the value of [name][crate::model::SyncFlags::name].
19784 ///
19785 /// # Example
19786 /// ```ignore,no_run
19787 /// # use google_cloud_sql_v1::model::SyncFlags;
19788 /// let x = SyncFlags::new().set_name("example");
19789 /// ```
19790 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19791 self.name = v.into();
19792 self
19793 }
19794
19795 /// Sets the value of [value][crate::model::SyncFlags::value].
19796 ///
19797 /// # Example
19798 /// ```ignore,no_run
19799 /// # use google_cloud_sql_v1::model::SyncFlags;
19800 /// let x = SyncFlags::new().set_value("example");
19801 /// ```
19802 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19803 self.value = v.into();
19804 self
19805 }
19806}
19807
19808impl wkt::message::Message for SyncFlags {
19809 fn typename() -> &'static str {
19810 "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
19811 }
19812}
19813
19814/// Reference to another Cloud SQL instance.
19815#[derive(Clone, Default, PartialEq)]
19816#[non_exhaustive]
19817pub struct InstanceReference {
19818 /// The name of the Cloud SQL instance being referenced.
19819 /// This does not include the project ID.
19820 pub name: std::string::String,
19821
19822 /// The region of the Cloud SQL instance being referenced.
19823 pub region: std::string::String,
19824
19825 /// The project ID of the Cloud SQL instance being referenced.
19826 /// The default is the same project ID as the instance references it.
19827 pub project: std::string::String,
19828
19829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19830}
19831
19832impl InstanceReference {
19833 /// Creates a new default instance.
19834 pub fn new() -> Self {
19835 std::default::Default::default()
19836 }
19837
19838 /// Sets the value of [name][crate::model::InstanceReference::name].
19839 ///
19840 /// # Example
19841 /// ```ignore,no_run
19842 /// # use google_cloud_sql_v1::model::InstanceReference;
19843 /// let x = InstanceReference::new().set_name("example");
19844 /// ```
19845 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19846 self.name = v.into();
19847 self
19848 }
19849
19850 /// Sets the value of [region][crate::model::InstanceReference::region].
19851 ///
19852 /// # Example
19853 /// ```ignore,no_run
19854 /// # use google_cloud_sql_v1::model::InstanceReference;
19855 /// let x = InstanceReference::new().set_region("example");
19856 /// ```
19857 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19858 self.region = v.into();
19859 self
19860 }
19861
19862 /// Sets the value of [project][crate::model::InstanceReference::project].
19863 ///
19864 /// # Example
19865 /// ```ignore,no_run
19866 /// # use google_cloud_sql_v1::model::InstanceReference;
19867 /// let x = InstanceReference::new().set_project("example");
19868 /// ```
19869 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19870 self.project = v.into();
19871 self
19872 }
19873}
19874
19875impl wkt::message::Message for InstanceReference {
19876 fn typename() -> &'static str {
19877 "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
19878 }
19879}
19880
19881/// Read-replica configuration for connecting to the on-premises primary
19882/// instance.
19883#[derive(Clone, Default, PartialEq)]
19884#[non_exhaustive]
19885pub struct DemoteMasterConfiguration {
19886 /// This is always `sql#demoteMasterConfiguration`.
19887 pub kind: std::string::String,
19888
19889 /// MySQL specific configuration when replicating from a MySQL on-premises
19890 /// primary instance. Replication configuration information such as the
19891 /// username, password, certificates, and keys are not stored in the instance
19892 /// metadata. The configuration information is used only to set up the
19893 /// replication connection and is stored by MySQL in a file named
19894 /// `master.info` in the data directory.
19895 pub mysql_replica_configuration:
19896 std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19897
19898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19899}
19900
19901impl DemoteMasterConfiguration {
19902 /// Creates a new default instance.
19903 pub fn new() -> Self {
19904 std::default::Default::default()
19905 }
19906
19907 /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
19908 ///
19909 /// # Example
19910 /// ```ignore,no_run
19911 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19912 /// let x = DemoteMasterConfiguration::new().set_kind("example");
19913 /// ```
19914 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19915 self.kind = v.into();
19916 self
19917 }
19918
19919 /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19920 ///
19921 /// # Example
19922 /// ```ignore,no_run
19923 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19924 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19925 /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
19926 /// ```
19927 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
19928 where
19929 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19930 {
19931 self.mysql_replica_configuration = std::option::Option::Some(v.into());
19932 self
19933 }
19934
19935 /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19936 ///
19937 /// # Example
19938 /// ```ignore,no_run
19939 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19940 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19941 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
19942 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
19943 /// ```
19944 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
19945 where
19946 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19947 {
19948 self.mysql_replica_configuration = v.map(|x| x.into());
19949 self
19950 }
19951}
19952
19953impl wkt::message::Message for DemoteMasterConfiguration {
19954 fn typename() -> &'static str {
19955 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
19956 }
19957}
19958
19959/// Read-replica configuration specific to MySQL databases.
19960#[derive(Clone, Default, PartialEq)]
19961#[non_exhaustive]
19962pub struct DemoteMasterMySqlReplicaConfiguration {
19963 /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
19964 pub kind: std::string::String,
19965
19966 /// The username for the replication connection.
19967 pub username: std::string::String,
19968
19969 /// The password for the replication connection.
19970 pub password: std::string::String,
19971
19972 /// PEM representation of the replica's private key. The corresponding public
19973 /// key is encoded in the client's certificate. The format of the replica's
19974 /// private key can be either PKCS #1 or PKCS #8.
19975 pub client_key: std::string::String,
19976
19977 /// PEM representation of the replica's x509 certificate.
19978 pub client_certificate: std::string::String,
19979
19980 /// PEM representation of the trusted CA's x509 certificate.
19981 pub ca_certificate: std::string::String,
19982
19983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19984}
19985
19986impl DemoteMasterMySqlReplicaConfiguration {
19987 /// Creates a new default instance.
19988 pub fn new() -> Self {
19989 std::default::Default::default()
19990 }
19991
19992 /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
19993 ///
19994 /// # Example
19995 /// ```ignore,no_run
19996 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19997 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
19998 /// ```
19999 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20000 self.kind = v.into();
20001 self
20002 }
20003
20004 /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
20005 ///
20006 /// # Example
20007 /// ```ignore,no_run
20008 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20009 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
20010 /// ```
20011 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20012 self.username = v.into();
20013 self
20014 }
20015
20016 /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
20017 ///
20018 /// # Example
20019 /// ```ignore,no_run
20020 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20021 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
20022 /// ```
20023 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20024 self.password = v.into();
20025 self
20026 }
20027
20028 /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
20029 ///
20030 /// # Example
20031 /// ```ignore,no_run
20032 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20033 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
20034 /// ```
20035 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20036 self.client_key = v.into();
20037 self
20038 }
20039
20040 /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
20041 ///
20042 /// # Example
20043 /// ```ignore,no_run
20044 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20045 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
20046 /// ```
20047 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
20048 mut self,
20049 v: T,
20050 ) -> Self {
20051 self.client_certificate = v.into();
20052 self
20053 }
20054
20055 /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
20056 ///
20057 /// # Example
20058 /// ```ignore,no_run
20059 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20060 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
20061 /// ```
20062 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20063 self.ca_certificate = v.into();
20064 self
20065 }
20066}
20067
20068impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
20069 fn typename() -> &'static str {
20070 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
20071 }
20072}
20073
20074/// Database instance export context.
20075#[derive(Clone, Default, PartialEq)]
20076#[non_exhaustive]
20077pub struct ExportContext {
20078 /// The path to the file in Google Cloud Storage where the export will be
20079 /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
20080 /// already exists, the request succeeds, but the operation fails. If
20081 /// `fileType` is `SQL` and the filename ends with .gz,
20082 /// the contents are compressed.
20083 pub uri: std::string::String,
20084
20085 /// Databases to be exported. <br /> `MySQL instances:` If
20086 /// `fileType` is `SQL` and no database is specified, all
20087 /// databases are exported, except for the `mysql` system database.
20088 /// If `fileType` is `CSV`, you can specify one database,
20089 /// either by using this property or by using the
20090 /// `csvExportOptions.selectQuery` property, which takes precedence
20091 /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
20092 /// database by name, all user databases in the instance are exported.
20093 /// This excludes system databases and Cloud SQL databases used to manage
20094 /// internal operations. Exporting all user databases is only available for
20095 /// directory-formatted parallel export. If `fileType` is `CSV`,
20096 /// this database must match the one specified in the
20097 /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
20098 /// instances:` You must specify one database to be exported, and the
20099 /// `fileType` must be `BAK`.
20100 pub databases: std::vec::Vec<std::string::String>,
20101
20102 /// This is always `sql#exportContext`.
20103 pub kind: std::string::String,
20104
20105 /// Options for exporting data as SQL statements.
20106 pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
20107
20108 /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
20109 /// instances only.
20110 pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
20111
20112 /// The file type for the specified uri.
20113 pub file_type: crate::model::SqlFileType,
20114
20115 /// Whether to perform a serverless export.
20116 pub offload: std::option::Option<wkt::BoolValue>,
20117
20118 /// Options for exporting data as BAK files.
20119 pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
20120
20121 /// Optional. Export parameters specific to SQL Server TDE certificates
20122 pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
20123
20124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20125}
20126
20127impl ExportContext {
20128 /// Creates a new default instance.
20129 pub fn new() -> Self {
20130 std::default::Default::default()
20131 }
20132
20133 /// Sets the value of [uri][crate::model::ExportContext::uri].
20134 ///
20135 /// # Example
20136 /// ```ignore,no_run
20137 /// # use google_cloud_sql_v1::model::ExportContext;
20138 /// let x = ExportContext::new().set_uri("example");
20139 /// ```
20140 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20141 self.uri = v.into();
20142 self
20143 }
20144
20145 /// Sets the value of [databases][crate::model::ExportContext::databases].
20146 ///
20147 /// # Example
20148 /// ```ignore,no_run
20149 /// # use google_cloud_sql_v1::model::ExportContext;
20150 /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
20151 /// ```
20152 pub fn set_databases<T, V>(mut self, v: T) -> Self
20153 where
20154 T: std::iter::IntoIterator<Item = V>,
20155 V: std::convert::Into<std::string::String>,
20156 {
20157 use std::iter::Iterator;
20158 self.databases = v.into_iter().map(|i| i.into()).collect();
20159 self
20160 }
20161
20162 /// Sets the value of [kind][crate::model::ExportContext::kind].
20163 ///
20164 /// # Example
20165 /// ```ignore,no_run
20166 /// # use google_cloud_sql_v1::model::ExportContext;
20167 /// let x = ExportContext::new().set_kind("example");
20168 /// ```
20169 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20170 self.kind = v.into();
20171 self
20172 }
20173
20174 /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
20175 ///
20176 /// # Example
20177 /// ```ignore,no_run
20178 /// # use google_cloud_sql_v1::model::ExportContext;
20179 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20180 /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
20181 /// ```
20182 pub fn set_sql_export_options<T>(mut self, v: T) -> Self
20183 where
20184 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
20185 {
20186 self.sql_export_options = std::option::Option::Some(v.into());
20187 self
20188 }
20189
20190 /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
20191 ///
20192 /// # Example
20193 /// ```ignore,no_run
20194 /// # use google_cloud_sql_v1::model::ExportContext;
20195 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20196 /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
20197 /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
20198 /// ```
20199 pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20200 where
20201 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
20202 {
20203 self.sql_export_options = v.map(|x| x.into());
20204 self
20205 }
20206
20207 /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
20208 ///
20209 /// # Example
20210 /// ```ignore,no_run
20211 /// # use google_cloud_sql_v1::model::ExportContext;
20212 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20213 /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
20214 /// ```
20215 pub fn set_csv_export_options<T>(mut self, v: T) -> Self
20216 where
20217 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
20218 {
20219 self.csv_export_options = std::option::Option::Some(v.into());
20220 self
20221 }
20222
20223 /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
20224 ///
20225 /// # Example
20226 /// ```ignore,no_run
20227 /// # use google_cloud_sql_v1::model::ExportContext;
20228 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20229 /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
20230 /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
20231 /// ```
20232 pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20233 where
20234 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
20235 {
20236 self.csv_export_options = v.map(|x| x.into());
20237 self
20238 }
20239
20240 /// Sets the value of [file_type][crate::model::ExportContext::file_type].
20241 ///
20242 /// # Example
20243 /// ```ignore,no_run
20244 /// # use google_cloud_sql_v1::model::ExportContext;
20245 /// use google_cloud_sql_v1::model::SqlFileType;
20246 /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
20247 /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
20248 /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
20249 /// ```
20250 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
20251 self.file_type = v.into();
20252 self
20253 }
20254
20255 /// Sets the value of [offload][crate::model::ExportContext::offload].
20256 ///
20257 /// # Example
20258 /// ```ignore,no_run
20259 /// # use google_cloud_sql_v1::model::ExportContext;
20260 /// use wkt::BoolValue;
20261 /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
20262 /// ```
20263 pub fn set_offload<T>(mut self, v: T) -> Self
20264 where
20265 T: std::convert::Into<wkt::BoolValue>,
20266 {
20267 self.offload = std::option::Option::Some(v.into());
20268 self
20269 }
20270
20271 /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
20272 ///
20273 /// # Example
20274 /// ```ignore,no_run
20275 /// # use google_cloud_sql_v1::model::ExportContext;
20276 /// use wkt::BoolValue;
20277 /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
20278 /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
20279 /// ```
20280 pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
20281 where
20282 T: std::convert::Into<wkt::BoolValue>,
20283 {
20284 self.offload = v.map(|x| x.into());
20285 self
20286 }
20287
20288 /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
20289 ///
20290 /// # Example
20291 /// ```ignore,no_run
20292 /// # use google_cloud_sql_v1::model::ExportContext;
20293 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20294 /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
20295 /// ```
20296 pub fn set_bak_export_options<T>(mut self, v: T) -> Self
20297 where
20298 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
20299 {
20300 self.bak_export_options = std::option::Option::Some(v.into());
20301 self
20302 }
20303
20304 /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
20305 ///
20306 /// # Example
20307 /// ```ignore,no_run
20308 /// # use google_cloud_sql_v1::model::ExportContext;
20309 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20310 /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
20311 /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
20312 /// ```
20313 pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20314 where
20315 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
20316 {
20317 self.bak_export_options = v.map(|x| x.into());
20318 self
20319 }
20320
20321 /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
20322 ///
20323 /// # Example
20324 /// ```ignore,no_run
20325 /// # use google_cloud_sql_v1::model::ExportContext;
20326 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20327 /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
20328 /// ```
20329 pub fn set_tde_export_options<T>(mut self, v: T) -> Self
20330 where
20331 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
20332 {
20333 self.tde_export_options = std::option::Option::Some(v.into());
20334 self
20335 }
20336
20337 /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
20338 ///
20339 /// # Example
20340 /// ```ignore,no_run
20341 /// # use google_cloud_sql_v1::model::ExportContext;
20342 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20343 /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
20344 /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
20345 /// ```
20346 pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20347 where
20348 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
20349 {
20350 self.tde_export_options = v.map(|x| x.into());
20351 self
20352 }
20353}
20354
20355impl wkt::message::Message for ExportContext {
20356 fn typename() -> &'static str {
20357 "type.googleapis.com/google.cloud.sql.v1.ExportContext"
20358 }
20359}
20360
20361/// Defines additional types related to [ExportContext].
20362pub mod export_context {
20363 #[allow(unused_imports)]
20364 use super::*;
20365
20366 #[allow(missing_docs)]
20367 #[derive(Clone, Default, PartialEq)]
20368 #[non_exhaustive]
20369 pub struct SqlCsvExportOptions {
20370 /// The select query used to extract the data.
20371 pub select_query: std::string::String,
20372
20373 /// Specifies the character that should appear before a data character that
20374 /// needs to be escaped.
20375 pub escape_character: std::string::String,
20376
20377 /// Specifies the quoting character to be used when a data value is quoted.
20378 pub quote_character: std::string::String,
20379
20380 /// Specifies the character that separates columns within each row (line) of
20381 /// the file.
20382 pub fields_terminated_by: std::string::String,
20383
20384 /// This is used to separate lines. If a line does not contain all fields,
20385 /// the rest of the columns are set to their default values.
20386 pub lines_terminated_by: std::string::String,
20387
20388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20389 }
20390
20391 impl SqlCsvExportOptions {
20392 /// Creates a new default instance.
20393 pub fn new() -> Self {
20394 std::default::Default::default()
20395 }
20396
20397 /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
20398 ///
20399 /// # Example
20400 /// ```ignore,no_run
20401 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20402 /// let x = SqlCsvExportOptions::new().set_select_query("example");
20403 /// ```
20404 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
20405 mut self,
20406 v: T,
20407 ) -> Self {
20408 self.select_query = v.into();
20409 self
20410 }
20411
20412 /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
20413 ///
20414 /// # Example
20415 /// ```ignore,no_run
20416 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20417 /// let x = SqlCsvExportOptions::new().set_escape_character("example");
20418 /// ```
20419 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
20420 mut self,
20421 v: T,
20422 ) -> Self {
20423 self.escape_character = v.into();
20424 self
20425 }
20426
20427 /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
20428 ///
20429 /// # Example
20430 /// ```ignore,no_run
20431 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20432 /// let x = SqlCsvExportOptions::new().set_quote_character("example");
20433 /// ```
20434 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
20435 mut self,
20436 v: T,
20437 ) -> Self {
20438 self.quote_character = v.into();
20439 self
20440 }
20441
20442 /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
20443 ///
20444 /// # Example
20445 /// ```ignore,no_run
20446 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20447 /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
20448 /// ```
20449 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
20450 mut self,
20451 v: T,
20452 ) -> Self {
20453 self.fields_terminated_by = v.into();
20454 self
20455 }
20456
20457 /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
20458 ///
20459 /// # Example
20460 /// ```ignore,no_run
20461 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20462 /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
20463 /// ```
20464 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
20465 mut self,
20466 v: T,
20467 ) -> Self {
20468 self.lines_terminated_by = v.into();
20469 self
20470 }
20471 }
20472
20473 impl wkt::message::Message for SqlCsvExportOptions {
20474 fn typename() -> &'static str {
20475 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
20476 }
20477 }
20478
20479 #[allow(missing_docs)]
20480 #[derive(Clone, Default, PartialEq)]
20481 #[non_exhaustive]
20482 pub struct SqlExportOptions {
20483 /// Tables to export, or that were exported, from the specified database. If
20484 /// you specify tables, specify one and only one database. For PostgreSQL
20485 /// instances, you can specify only one table.
20486 pub tables: std::vec::Vec<std::string::String>,
20487
20488 /// Export only schemas.
20489 pub schema_only: std::option::Option<wkt::BoolValue>,
20490
20491 #[allow(missing_docs)]
20492 pub mysql_export_options: std::option::Option<
20493 crate::model::export_context::sql_export_options::MysqlExportOptions,
20494 >,
20495
20496 /// Optional. The number of threads to use for parallel export.
20497 pub threads: std::option::Option<wkt::Int32Value>,
20498
20499 /// Optional. Whether or not the export should be parallel.
20500 pub parallel: std::option::Option<wkt::BoolValue>,
20501
20502 /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
20503 pub postgres_export_options: std::option::Option<
20504 crate::model::export_context::sql_export_options::PostgresExportOptions,
20505 >,
20506
20507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20508 }
20509
20510 impl SqlExportOptions {
20511 /// Creates a new default instance.
20512 pub fn new() -> Self {
20513 std::default::Default::default()
20514 }
20515
20516 /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
20517 ///
20518 /// # Example
20519 /// ```ignore,no_run
20520 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20521 /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
20522 /// ```
20523 pub fn set_tables<T, V>(mut self, v: T) -> Self
20524 where
20525 T: std::iter::IntoIterator<Item = V>,
20526 V: std::convert::Into<std::string::String>,
20527 {
20528 use std::iter::Iterator;
20529 self.tables = v.into_iter().map(|i| i.into()).collect();
20530 self
20531 }
20532
20533 /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
20534 ///
20535 /// # Example
20536 /// ```ignore,no_run
20537 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20538 /// use wkt::BoolValue;
20539 /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
20540 /// ```
20541 pub fn set_schema_only<T>(mut self, v: T) -> Self
20542 where
20543 T: std::convert::Into<wkt::BoolValue>,
20544 {
20545 self.schema_only = std::option::Option::Some(v.into());
20546 self
20547 }
20548
20549 /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
20550 ///
20551 /// # Example
20552 /// ```ignore,no_run
20553 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20554 /// use wkt::BoolValue;
20555 /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
20556 /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
20557 /// ```
20558 pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
20559 where
20560 T: std::convert::Into<wkt::BoolValue>,
20561 {
20562 self.schema_only = v.map(|x| x.into());
20563 self
20564 }
20565
20566 /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
20567 ///
20568 /// # Example
20569 /// ```ignore,no_run
20570 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20571 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20572 /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
20573 /// ```
20574 pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
20575 where
20576 T: std::convert::Into<
20577 crate::model::export_context::sql_export_options::MysqlExportOptions,
20578 >,
20579 {
20580 self.mysql_export_options = std::option::Option::Some(v.into());
20581 self
20582 }
20583
20584 /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
20585 ///
20586 /// # Example
20587 /// ```ignore,no_run
20588 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20589 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20590 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
20591 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
20592 /// ```
20593 pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20594 where
20595 T: std::convert::Into<
20596 crate::model::export_context::sql_export_options::MysqlExportOptions,
20597 >,
20598 {
20599 self.mysql_export_options = v.map(|x| x.into());
20600 self
20601 }
20602
20603 /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20604 ///
20605 /// # Example
20606 /// ```ignore,no_run
20607 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20608 /// use wkt::Int32Value;
20609 /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
20610 /// ```
20611 pub fn set_threads<T>(mut self, v: T) -> Self
20612 where
20613 T: std::convert::Into<wkt::Int32Value>,
20614 {
20615 self.threads = std::option::Option::Some(v.into());
20616 self
20617 }
20618
20619 /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20620 ///
20621 /// # Example
20622 /// ```ignore,no_run
20623 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20624 /// use wkt::Int32Value;
20625 /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20626 /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
20627 /// ```
20628 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20629 where
20630 T: std::convert::Into<wkt::Int32Value>,
20631 {
20632 self.threads = v.map(|x| x.into());
20633 self
20634 }
20635
20636 /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20637 ///
20638 /// # Example
20639 /// ```ignore,no_run
20640 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20641 /// use wkt::BoolValue;
20642 /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20643 /// ```
20644 pub fn set_parallel<T>(mut self, v: T) -> Self
20645 where
20646 T: std::convert::Into<wkt::BoolValue>,
20647 {
20648 self.parallel = std::option::Option::Some(v.into());
20649 self
20650 }
20651
20652 /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20653 ///
20654 /// # Example
20655 /// ```ignore,no_run
20656 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20657 /// use wkt::BoolValue;
20658 /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20659 /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20660 /// ```
20661 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20662 where
20663 T: std::convert::Into<wkt::BoolValue>,
20664 {
20665 self.parallel = v.map(|x| x.into());
20666 self
20667 }
20668
20669 /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20670 ///
20671 /// # Example
20672 /// ```ignore,no_run
20673 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20674 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20675 /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
20676 /// ```
20677 pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
20678 where
20679 T: std::convert::Into<
20680 crate::model::export_context::sql_export_options::PostgresExportOptions,
20681 >,
20682 {
20683 self.postgres_export_options = std::option::Option::Some(v.into());
20684 self
20685 }
20686
20687 /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20688 ///
20689 /// # Example
20690 /// ```ignore,no_run
20691 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20692 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20693 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
20694 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
20695 /// ```
20696 pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20697 where
20698 T: std::convert::Into<
20699 crate::model::export_context::sql_export_options::PostgresExportOptions,
20700 >,
20701 {
20702 self.postgres_export_options = v.map(|x| x.into());
20703 self
20704 }
20705 }
20706
20707 impl wkt::message::Message for SqlExportOptions {
20708 fn typename() -> &'static str {
20709 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
20710 }
20711 }
20712
20713 /// Defines additional types related to [SqlExportOptions].
20714 pub mod sql_export_options {
20715 #[allow(unused_imports)]
20716 use super::*;
20717
20718 /// Options for exporting from MySQL.
20719 #[derive(Clone, Default, PartialEq)]
20720 #[non_exhaustive]
20721 pub struct MysqlExportOptions {
20722 /// Option to include SQL statement required to set up replication. If set
20723 /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
20724 /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
20725 /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
20726 /// has no effect. If set to any value other than `1`, --set-gtid-purged
20727 /// is set to OFF.
20728 pub master_data: std::option::Option<wkt::Int32Value>,
20729
20730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20731 }
20732
20733 impl MysqlExportOptions {
20734 /// Creates a new default instance.
20735 pub fn new() -> Self {
20736 std::default::Default::default()
20737 }
20738
20739 /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20740 ///
20741 /// # Example
20742 /// ```ignore,no_run
20743 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20744 /// use wkt::Int32Value;
20745 /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
20746 /// ```
20747 pub fn set_master_data<T>(mut self, v: T) -> Self
20748 where
20749 T: std::convert::Into<wkt::Int32Value>,
20750 {
20751 self.master_data = std::option::Option::Some(v.into());
20752 self
20753 }
20754
20755 /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20756 ///
20757 /// # Example
20758 /// ```ignore,no_run
20759 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20760 /// use wkt::Int32Value;
20761 /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
20762 /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
20763 /// ```
20764 pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
20765 where
20766 T: std::convert::Into<wkt::Int32Value>,
20767 {
20768 self.master_data = v.map(|x| x.into());
20769 self
20770 }
20771 }
20772
20773 impl wkt::message::Message for MysqlExportOptions {
20774 fn typename() -> &'static str {
20775 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
20776 }
20777 }
20778
20779 /// Options for exporting from a Cloud SQL for PostgreSQL instance.
20780 #[derive(Clone, Default, PartialEq)]
20781 #[non_exhaustive]
20782 pub struct PostgresExportOptions {
20783 /// Optional. Use this option to include DROP \<code\><object>\</code\>
20784 /// SQL statements. Use these statements to delete database objects before
20785 /// running the import operation.
20786 pub clean: std::option::Option<wkt::BoolValue>,
20787
20788 /// Optional. Option to include an IF EXISTS SQL statement with each DROP
20789 /// statement produced by clean.
20790 pub if_exists: std::option::Option<wkt::BoolValue>,
20791
20792 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20793 }
20794
20795 impl PostgresExportOptions {
20796 /// Creates a new default instance.
20797 pub fn new() -> Self {
20798 std::default::Default::default()
20799 }
20800
20801 /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20802 ///
20803 /// # Example
20804 /// ```ignore,no_run
20805 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20806 /// use wkt::BoolValue;
20807 /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
20808 /// ```
20809 pub fn set_clean<T>(mut self, v: T) -> Self
20810 where
20811 T: std::convert::Into<wkt::BoolValue>,
20812 {
20813 self.clean = std::option::Option::Some(v.into());
20814 self
20815 }
20816
20817 /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20818 ///
20819 /// # Example
20820 /// ```ignore,no_run
20821 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20822 /// use wkt::BoolValue;
20823 /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20824 /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
20825 /// ```
20826 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20827 where
20828 T: std::convert::Into<wkt::BoolValue>,
20829 {
20830 self.clean = v.map(|x| x.into());
20831 self
20832 }
20833
20834 /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20835 ///
20836 /// # Example
20837 /// ```ignore,no_run
20838 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20839 /// use wkt::BoolValue;
20840 /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
20841 /// ```
20842 pub fn set_if_exists<T>(mut self, v: T) -> Self
20843 where
20844 T: std::convert::Into<wkt::BoolValue>,
20845 {
20846 self.if_exists = std::option::Option::Some(v.into());
20847 self
20848 }
20849
20850 /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20851 ///
20852 /// # Example
20853 /// ```ignore,no_run
20854 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20855 /// use wkt::BoolValue;
20856 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
20857 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
20858 /// ```
20859 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
20860 where
20861 T: std::convert::Into<wkt::BoolValue>,
20862 {
20863 self.if_exists = v.map(|x| x.into());
20864 self
20865 }
20866 }
20867
20868 impl wkt::message::Message for PostgresExportOptions {
20869 fn typename() -> &'static str {
20870 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
20871 }
20872 }
20873 }
20874
20875 /// Options for exporting BAK files (SQL Server-only)
20876 #[derive(Clone, Default, PartialEq)]
20877 #[non_exhaustive]
20878 pub struct SqlBakExportOptions {
20879 /// Whether or not the export should be striped.
20880 pub striped: std::option::Option<wkt::BoolValue>,
20881
20882 /// Option for specifying how many stripes to use for the export.
20883 /// If blank, and the value of the striped field is true,
20884 /// the number of stripes is automatically chosen.
20885 pub stripe_count: std::option::Option<wkt::Int32Value>,
20886
20887 /// Type of this bak file will be export, FULL or DIFF, SQL Server only
20888 pub bak_type: crate::model::BakType,
20889
20890 /// Deprecated: copy_only is deprecated. Use differential_base instead
20891 #[deprecated]
20892 pub copy_only: std::option::Option<wkt::BoolValue>,
20893
20894 /// Whether or not the backup can be used as a differential base
20895 /// copy_only backup can not be served as differential base
20896 pub differential_base: std::option::Option<wkt::BoolValue>,
20897
20898 /// Optional. The begin timestamp when transaction log will be included in
20899 /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
20900 /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20901 /// available logs from the beginning of retention period will be included.
20902 /// Only applied to Cloud SQL for SQL Server.
20903 pub export_log_start_time: std::option::Option<wkt::Timestamp>,
20904
20905 /// Optional. The end timestamp when transaction log will be included in the
20906 /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
20907 /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20908 /// available logs until current time will be included. Only applied to Cloud
20909 /// SQL for SQL Server.
20910 pub export_log_end_time: std::option::Option<wkt::Timestamp>,
20911
20912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20913 }
20914
20915 impl SqlBakExportOptions {
20916 /// Creates a new default instance.
20917 pub fn new() -> Self {
20918 std::default::Default::default()
20919 }
20920
20921 /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20922 ///
20923 /// # Example
20924 /// ```ignore,no_run
20925 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20926 /// use wkt::BoolValue;
20927 /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
20928 /// ```
20929 pub fn set_striped<T>(mut self, v: T) -> Self
20930 where
20931 T: std::convert::Into<wkt::BoolValue>,
20932 {
20933 self.striped = std::option::Option::Some(v.into());
20934 self
20935 }
20936
20937 /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20938 ///
20939 /// # Example
20940 /// ```ignore,no_run
20941 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20942 /// use wkt::BoolValue;
20943 /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
20944 /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
20945 /// ```
20946 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
20947 where
20948 T: std::convert::Into<wkt::BoolValue>,
20949 {
20950 self.striped = v.map(|x| x.into());
20951 self
20952 }
20953
20954 /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20955 ///
20956 /// # Example
20957 /// ```ignore,no_run
20958 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20959 /// use wkt::Int32Value;
20960 /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
20961 /// ```
20962 pub fn set_stripe_count<T>(mut self, v: T) -> Self
20963 where
20964 T: std::convert::Into<wkt::Int32Value>,
20965 {
20966 self.stripe_count = std::option::Option::Some(v.into());
20967 self
20968 }
20969
20970 /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20971 ///
20972 /// # Example
20973 /// ```ignore,no_run
20974 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20975 /// use wkt::Int32Value;
20976 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
20977 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
20978 /// ```
20979 pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
20980 where
20981 T: std::convert::Into<wkt::Int32Value>,
20982 {
20983 self.stripe_count = v.map(|x| x.into());
20984 self
20985 }
20986
20987 /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
20988 ///
20989 /// # Example
20990 /// ```ignore,no_run
20991 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20992 /// use google_cloud_sql_v1::model::BakType;
20993 /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
20994 /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
20995 /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
20996 /// ```
20997 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
20998 self.bak_type = v.into();
20999 self
21000 }
21001
21002 /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
21003 ///
21004 /// # Example
21005 /// ```ignore,no_run
21006 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21007 /// use wkt::BoolValue;
21008 /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
21009 /// ```
21010 #[deprecated]
21011 pub fn set_copy_only<T>(mut self, v: T) -> Self
21012 where
21013 T: std::convert::Into<wkt::BoolValue>,
21014 {
21015 self.copy_only = std::option::Option::Some(v.into());
21016 self
21017 }
21018
21019 /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
21020 ///
21021 /// # Example
21022 /// ```ignore,no_run
21023 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21024 /// use wkt::BoolValue;
21025 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
21026 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
21027 /// ```
21028 #[deprecated]
21029 pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
21030 where
21031 T: std::convert::Into<wkt::BoolValue>,
21032 {
21033 self.copy_only = v.map(|x| x.into());
21034 self
21035 }
21036
21037 /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
21038 ///
21039 /// # Example
21040 /// ```ignore,no_run
21041 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21042 /// use wkt::BoolValue;
21043 /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
21044 /// ```
21045 pub fn set_differential_base<T>(mut self, v: T) -> Self
21046 where
21047 T: std::convert::Into<wkt::BoolValue>,
21048 {
21049 self.differential_base = std::option::Option::Some(v.into());
21050 self
21051 }
21052
21053 /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
21054 ///
21055 /// # Example
21056 /// ```ignore,no_run
21057 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21058 /// use wkt::BoolValue;
21059 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
21060 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
21061 /// ```
21062 pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
21063 where
21064 T: std::convert::Into<wkt::BoolValue>,
21065 {
21066 self.differential_base = v.map(|x| x.into());
21067 self
21068 }
21069
21070 /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
21071 ///
21072 /// # Example
21073 /// ```ignore,no_run
21074 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21075 /// use wkt::Timestamp;
21076 /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
21077 /// ```
21078 pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
21079 where
21080 T: std::convert::Into<wkt::Timestamp>,
21081 {
21082 self.export_log_start_time = std::option::Option::Some(v.into());
21083 self
21084 }
21085
21086 /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
21087 ///
21088 /// # Example
21089 /// ```ignore,no_run
21090 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21091 /// use wkt::Timestamp;
21092 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
21093 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
21094 /// ```
21095 pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
21096 where
21097 T: std::convert::Into<wkt::Timestamp>,
21098 {
21099 self.export_log_start_time = v.map(|x| x.into());
21100 self
21101 }
21102
21103 /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
21104 ///
21105 /// # Example
21106 /// ```ignore,no_run
21107 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21108 /// use wkt::Timestamp;
21109 /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
21110 /// ```
21111 pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
21112 where
21113 T: std::convert::Into<wkt::Timestamp>,
21114 {
21115 self.export_log_end_time = std::option::Option::Some(v.into());
21116 self
21117 }
21118
21119 /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
21120 ///
21121 /// # Example
21122 /// ```ignore,no_run
21123 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21124 /// use wkt::Timestamp;
21125 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
21126 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
21127 /// ```
21128 pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
21129 where
21130 T: std::convert::Into<wkt::Timestamp>,
21131 {
21132 self.export_log_end_time = v.map(|x| x.into());
21133 self
21134 }
21135 }
21136
21137 impl wkt::message::Message for SqlBakExportOptions {
21138 fn typename() -> &'static str {
21139 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
21140 }
21141 }
21142
21143 #[allow(missing_docs)]
21144 #[derive(Clone, Default, PartialEq)]
21145 #[non_exhaustive]
21146 pub struct SqlTdeExportOptions {
21147 /// Required. Path to the TDE certificate public key
21148 /// in the form gs://bucketName/fileName.
21149 /// The instance must have write access to the bucket.
21150 /// Applicable only for SQL Server instances.
21151 pub certificate_path: std::string::String,
21152
21153 /// Required. Path to the TDE certificate private key
21154 /// in the form gs://bucketName/fileName.
21155 /// The instance must have write access to the location.
21156 /// Applicable only for SQL Server instances.
21157 pub private_key_path: std::string::String,
21158
21159 /// Required. Password that encrypts the private key.
21160 pub private_key_password: std::string::String,
21161
21162 /// Required. Certificate name.
21163 /// Applicable only for SQL Server instances.
21164 pub name: std::string::String,
21165
21166 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21167 }
21168
21169 impl SqlTdeExportOptions {
21170 /// Creates a new default instance.
21171 pub fn new() -> Self {
21172 std::default::Default::default()
21173 }
21174
21175 /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
21176 ///
21177 /// # Example
21178 /// ```ignore,no_run
21179 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21180 /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
21181 /// ```
21182 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
21183 mut self,
21184 v: T,
21185 ) -> Self {
21186 self.certificate_path = v.into();
21187 self
21188 }
21189
21190 /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
21191 ///
21192 /// # Example
21193 /// ```ignore,no_run
21194 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21195 /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
21196 /// ```
21197 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
21198 mut self,
21199 v: T,
21200 ) -> Self {
21201 self.private_key_path = v.into();
21202 self
21203 }
21204
21205 /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
21206 ///
21207 /// # Example
21208 /// ```ignore,no_run
21209 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21210 /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
21211 /// ```
21212 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
21213 mut self,
21214 v: T,
21215 ) -> Self {
21216 self.private_key_password = v.into();
21217 self
21218 }
21219
21220 /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
21221 ///
21222 /// # Example
21223 /// ```ignore,no_run
21224 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21225 /// let x = SqlTdeExportOptions::new().set_name("example");
21226 /// ```
21227 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21228 self.name = v.into();
21229 self
21230 }
21231 }
21232
21233 impl wkt::message::Message for SqlTdeExportOptions {
21234 fn typename() -> &'static str {
21235 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
21236 }
21237 }
21238}
21239
21240/// Database instance import context.
21241#[derive(Clone, Default, PartialEq)]
21242#[non_exhaustive]
21243pub struct ImportContext {
21244 /// Path to the import file in Cloud Storage, in the form
21245 /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
21246 /// when `fileType` is `SQL`. The instance must have
21247 /// write permissions to the bucket and read access to the file.
21248 pub uri: std::string::String,
21249
21250 /// The target database for the import. If `fileType` is `SQL`, this field
21251 /// is required only if the import file does not specify a database, and is
21252 /// overridden by any database specification in the import file. For entire
21253 /// instance parallel import operations, the database is overridden by the
21254 /// database name stored in subdirectory name. If
21255 /// `fileType` is `CSV`, one database must be specified.
21256 pub database: std::string::String,
21257
21258 /// This is always `sql#importContext`.
21259 pub kind: std::string::String,
21260
21261 /// The file type for the specified uri.\`SQL`: The file
21262 /// contains SQL statements. \`CSV`: The file contains CSV data.
21263 pub file_type: crate::model::SqlFileType,
21264
21265 /// Options for importing data as CSV.
21266 pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
21267
21268 /// The PostgreSQL user for this import operation. PostgreSQL instances only.
21269 pub import_user: std::string::String,
21270
21271 /// Import parameters specific to SQL Server .BAK files
21272 pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
21273
21274 /// Optional. Options for importing data from SQL statements.
21275 pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
21276
21277 /// Optional. Import parameters specific to SQL Server TDE certificates
21278 pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
21279
21280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21281}
21282
21283impl ImportContext {
21284 /// Creates a new default instance.
21285 pub fn new() -> Self {
21286 std::default::Default::default()
21287 }
21288
21289 /// Sets the value of [uri][crate::model::ImportContext::uri].
21290 ///
21291 /// # Example
21292 /// ```ignore,no_run
21293 /// # use google_cloud_sql_v1::model::ImportContext;
21294 /// let x = ImportContext::new().set_uri("example");
21295 /// ```
21296 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21297 self.uri = v.into();
21298 self
21299 }
21300
21301 /// Sets the value of [database][crate::model::ImportContext::database].
21302 ///
21303 /// # Example
21304 /// ```ignore,no_run
21305 /// # use google_cloud_sql_v1::model::ImportContext;
21306 /// let x = ImportContext::new().set_database("example");
21307 /// ```
21308 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21309 self.database = v.into();
21310 self
21311 }
21312
21313 /// Sets the value of [kind][crate::model::ImportContext::kind].
21314 ///
21315 /// # Example
21316 /// ```ignore,no_run
21317 /// # use google_cloud_sql_v1::model::ImportContext;
21318 /// let x = ImportContext::new().set_kind("example");
21319 /// ```
21320 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21321 self.kind = v.into();
21322 self
21323 }
21324
21325 /// Sets the value of [file_type][crate::model::ImportContext::file_type].
21326 ///
21327 /// # Example
21328 /// ```ignore,no_run
21329 /// # use google_cloud_sql_v1::model::ImportContext;
21330 /// use google_cloud_sql_v1::model::SqlFileType;
21331 /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
21332 /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
21333 /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
21334 /// ```
21335 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
21336 self.file_type = v.into();
21337 self
21338 }
21339
21340 /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
21341 ///
21342 /// # Example
21343 /// ```ignore,no_run
21344 /// # use google_cloud_sql_v1::model::ImportContext;
21345 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21346 /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
21347 /// ```
21348 pub fn set_csv_import_options<T>(mut self, v: T) -> Self
21349 where
21350 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
21351 {
21352 self.csv_import_options = std::option::Option::Some(v.into());
21353 self
21354 }
21355
21356 /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
21357 ///
21358 /// # Example
21359 /// ```ignore,no_run
21360 /// # use google_cloud_sql_v1::model::ImportContext;
21361 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21362 /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
21363 /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
21364 /// ```
21365 pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21366 where
21367 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
21368 {
21369 self.csv_import_options = v.map(|x| x.into());
21370 self
21371 }
21372
21373 /// Sets the value of [import_user][crate::model::ImportContext::import_user].
21374 ///
21375 /// # Example
21376 /// ```ignore,no_run
21377 /// # use google_cloud_sql_v1::model::ImportContext;
21378 /// let x = ImportContext::new().set_import_user("example");
21379 /// ```
21380 pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21381 self.import_user = v.into();
21382 self
21383 }
21384
21385 /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
21386 ///
21387 /// # Example
21388 /// ```ignore,no_run
21389 /// # use google_cloud_sql_v1::model::ImportContext;
21390 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21391 /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
21392 /// ```
21393 pub fn set_bak_import_options<T>(mut self, v: T) -> Self
21394 where
21395 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
21396 {
21397 self.bak_import_options = std::option::Option::Some(v.into());
21398 self
21399 }
21400
21401 /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
21402 ///
21403 /// # Example
21404 /// ```ignore,no_run
21405 /// # use google_cloud_sql_v1::model::ImportContext;
21406 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21407 /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
21408 /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
21409 /// ```
21410 pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21411 where
21412 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
21413 {
21414 self.bak_import_options = v.map(|x| x.into());
21415 self
21416 }
21417
21418 /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21419 ///
21420 /// # Example
21421 /// ```ignore,no_run
21422 /// # use google_cloud_sql_v1::model::ImportContext;
21423 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21424 /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
21425 /// ```
21426 pub fn set_sql_import_options<T>(mut self, v: T) -> Self
21427 where
21428 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21429 {
21430 self.sql_import_options = std::option::Option::Some(v.into());
21431 self
21432 }
21433
21434 /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21435 ///
21436 /// # Example
21437 /// ```ignore,no_run
21438 /// # use google_cloud_sql_v1::model::ImportContext;
21439 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21440 /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
21441 /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
21442 /// ```
21443 pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21444 where
21445 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21446 {
21447 self.sql_import_options = v.map(|x| x.into());
21448 self
21449 }
21450
21451 /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21452 ///
21453 /// # Example
21454 /// ```ignore,no_run
21455 /// # use google_cloud_sql_v1::model::ImportContext;
21456 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21457 /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
21458 /// ```
21459 pub fn set_tde_import_options<T>(mut self, v: T) -> Self
21460 where
21461 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21462 {
21463 self.tde_import_options = std::option::Option::Some(v.into());
21464 self
21465 }
21466
21467 /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21468 ///
21469 /// # Example
21470 /// ```ignore,no_run
21471 /// # use google_cloud_sql_v1::model::ImportContext;
21472 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21473 /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
21474 /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
21475 /// ```
21476 pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21477 where
21478 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21479 {
21480 self.tde_import_options = v.map(|x| x.into());
21481 self
21482 }
21483}
21484
21485impl wkt::message::Message for ImportContext {
21486 fn typename() -> &'static str {
21487 "type.googleapis.com/google.cloud.sql.v1.ImportContext"
21488 }
21489}
21490
21491/// Defines additional types related to [ImportContext].
21492pub mod import_context {
21493 #[allow(unused_imports)]
21494 use super::*;
21495
21496 #[allow(missing_docs)]
21497 #[derive(Clone, Default, PartialEq)]
21498 #[non_exhaustive]
21499 pub struct SqlImportOptions {
21500 /// Optional. The number of threads to use for parallel import.
21501 pub threads: std::option::Option<wkt::Int32Value>,
21502
21503 /// Optional. Whether or not the import should be parallel.
21504 pub parallel: std::option::Option<wkt::BoolValue>,
21505
21506 /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
21507 pub postgres_import_options: std::option::Option<
21508 crate::model::import_context::sql_import_options::PostgresImportOptions,
21509 >,
21510
21511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21512 }
21513
21514 impl SqlImportOptions {
21515 /// Creates a new default instance.
21516 pub fn new() -> Self {
21517 std::default::Default::default()
21518 }
21519
21520 /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21521 ///
21522 /// # Example
21523 /// ```ignore,no_run
21524 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21525 /// use wkt::Int32Value;
21526 /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
21527 /// ```
21528 pub fn set_threads<T>(mut self, v: T) -> Self
21529 where
21530 T: std::convert::Into<wkt::Int32Value>,
21531 {
21532 self.threads = std::option::Option::Some(v.into());
21533 self
21534 }
21535
21536 /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21537 ///
21538 /// # Example
21539 /// ```ignore,no_run
21540 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21541 /// use wkt::Int32Value;
21542 /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
21543 /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
21544 /// ```
21545 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
21546 where
21547 T: std::convert::Into<wkt::Int32Value>,
21548 {
21549 self.threads = v.map(|x| x.into());
21550 self
21551 }
21552
21553 /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21554 ///
21555 /// # Example
21556 /// ```ignore,no_run
21557 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21558 /// use wkt::BoolValue;
21559 /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
21560 /// ```
21561 pub fn set_parallel<T>(mut self, v: T) -> Self
21562 where
21563 T: std::convert::Into<wkt::BoolValue>,
21564 {
21565 self.parallel = std::option::Option::Some(v.into());
21566 self
21567 }
21568
21569 /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21570 ///
21571 /// # Example
21572 /// ```ignore,no_run
21573 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21574 /// use wkt::BoolValue;
21575 /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
21576 /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
21577 /// ```
21578 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
21579 where
21580 T: std::convert::Into<wkt::BoolValue>,
21581 {
21582 self.parallel = v.map(|x| x.into());
21583 self
21584 }
21585
21586 /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21587 ///
21588 /// # Example
21589 /// ```ignore,no_run
21590 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21591 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21592 /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
21593 /// ```
21594 pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
21595 where
21596 T: std::convert::Into<
21597 crate::model::import_context::sql_import_options::PostgresImportOptions,
21598 >,
21599 {
21600 self.postgres_import_options = std::option::Option::Some(v.into());
21601 self
21602 }
21603
21604 /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21605 ///
21606 /// # Example
21607 /// ```ignore,no_run
21608 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21609 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21610 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
21611 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
21612 /// ```
21613 pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21614 where
21615 T: std::convert::Into<
21616 crate::model::import_context::sql_import_options::PostgresImportOptions,
21617 >,
21618 {
21619 self.postgres_import_options = v.map(|x| x.into());
21620 self
21621 }
21622 }
21623
21624 impl wkt::message::Message for SqlImportOptions {
21625 fn typename() -> &'static str {
21626 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
21627 }
21628 }
21629
21630 /// Defines additional types related to [SqlImportOptions].
21631 pub mod sql_import_options {
21632 #[allow(unused_imports)]
21633 use super::*;
21634
21635 #[allow(missing_docs)]
21636 #[derive(Clone, Default, PartialEq)]
21637 #[non_exhaustive]
21638 pub struct PostgresImportOptions {
21639 /// Optional. The --clean flag for the pg_restore utility. This flag
21640 /// applies only if you enabled Cloud SQL to import files in parallel.
21641 pub clean: std::option::Option<wkt::BoolValue>,
21642
21643 /// Optional. The --if-exists flag for the pg_restore utility. This flag
21644 /// applies only if you enabled Cloud SQL to import files in parallel.
21645 pub if_exists: std::option::Option<wkt::BoolValue>,
21646
21647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21648 }
21649
21650 impl PostgresImportOptions {
21651 /// Creates a new default instance.
21652 pub fn new() -> Self {
21653 std::default::Default::default()
21654 }
21655
21656 /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21657 ///
21658 /// # Example
21659 /// ```ignore,no_run
21660 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21661 /// use wkt::BoolValue;
21662 /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
21663 /// ```
21664 pub fn set_clean<T>(mut self, v: T) -> Self
21665 where
21666 T: std::convert::Into<wkt::BoolValue>,
21667 {
21668 self.clean = std::option::Option::Some(v.into());
21669 self
21670 }
21671
21672 /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21673 ///
21674 /// # Example
21675 /// ```ignore,no_run
21676 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21677 /// use wkt::BoolValue;
21678 /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
21679 /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
21680 /// ```
21681 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
21682 where
21683 T: std::convert::Into<wkt::BoolValue>,
21684 {
21685 self.clean = v.map(|x| x.into());
21686 self
21687 }
21688
21689 /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21690 ///
21691 /// # Example
21692 /// ```ignore,no_run
21693 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21694 /// use wkt::BoolValue;
21695 /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21696 /// ```
21697 pub fn set_if_exists<T>(mut self, v: T) -> Self
21698 where
21699 T: std::convert::Into<wkt::BoolValue>,
21700 {
21701 self.if_exists = std::option::Option::Some(v.into());
21702 self
21703 }
21704
21705 /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21706 ///
21707 /// # Example
21708 /// ```ignore,no_run
21709 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21710 /// use wkt::BoolValue;
21711 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21712 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21713 /// ```
21714 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21715 where
21716 T: std::convert::Into<wkt::BoolValue>,
21717 {
21718 self.if_exists = v.map(|x| x.into());
21719 self
21720 }
21721 }
21722
21723 impl wkt::message::Message for PostgresImportOptions {
21724 fn typename() -> &'static str {
21725 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
21726 }
21727 }
21728 }
21729
21730 #[allow(missing_docs)]
21731 #[derive(Clone, Default, PartialEq)]
21732 #[non_exhaustive]
21733 pub struct SqlCsvImportOptions {
21734 /// The table to which CSV data is imported.
21735 pub table: std::string::String,
21736
21737 /// The columns to which CSV data is imported. If not specified, all columns
21738 /// of the database table are loaded with CSV data.
21739 pub columns: std::vec::Vec<std::string::String>,
21740
21741 /// Specifies the character that should appear before a data character that
21742 /// needs to be escaped.
21743 pub escape_character: std::string::String,
21744
21745 /// Specifies the quoting character to be used when a data value is quoted.
21746 pub quote_character: std::string::String,
21747
21748 /// Specifies the character that separates columns within each row (line) of
21749 /// the file.
21750 pub fields_terminated_by: std::string::String,
21751
21752 /// This is used to separate lines. If a line does not contain all fields,
21753 /// the rest of the columns are set to their default values.
21754 pub lines_terminated_by: std::string::String,
21755
21756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21757 }
21758
21759 impl SqlCsvImportOptions {
21760 /// Creates a new default instance.
21761 pub fn new() -> Self {
21762 std::default::Default::default()
21763 }
21764
21765 /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
21766 ///
21767 /// # Example
21768 /// ```ignore,no_run
21769 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21770 /// let x = SqlCsvImportOptions::new().set_table("example");
21771 /// ```
21772 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21773 self.table = v.into();
21774 self
21775 }
21776
21777 /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
21778 ///
21779 /// # Example
21780 /// ```ignore,no_run
21781 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21782 /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
21783 /// ```
21784 pub fn set_columns<T, V>(mut self, v: T) -> Self
21785 where
21786 T: std::iter::IntoIterator<Item = V>,
21787 V: std::convert::Into<std::string::String>,
21788 {
21789 use std::iter::Iterator;
21790 self.columns = v.into_iter().map(|i| i.into()).collect();
21791 self
21792 }
21793
21794 /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
21795 ///
21796 /// # Example
21797 /// ```ignore,no_run
21798 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21799 /// let x = SqlCsvImportOptions::new().set_escape_character("example");
21800 /// ```
21801 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21802 mut self,
21803 v: T,
21804 ) -> Self {
21805 self.escape_character = v.into();
21806 self
21807 }
21808
21809 /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
21810 ///
21811 /// # Example
21812 /// ```ignore,no_run
21813 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21814 /// let x = SqlCsvImportOptions::new().set_quote_character("example");
21815 /// ```
21816 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21817 mut self,
21818 v: T,
21819 ) -> Self {
21820 self.quote_character = v.into();
21821 self
21822 }
21823
21824 /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
21825 ///
21826 /// # Example
21827 /// ```ignore,no_run
21828 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21829 /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
21830 /// ```
21831 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21832 mut self,
21833 v: T,
21834 ) -> Self {
21835 self.fields_terminated_by = v.into();
21836 self
21837 }
21838
21839 /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
21840 ///
21841 /// # Example
21842 /// ```ignore,no_run
21843 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21844 /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
21845 /// ```
21846 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21847 mut self,
21848 v: T,
21849 ) -> Self {
21850 self.lines_terminated_by = v.into();
21851 self
21852 }
21853 }
21854
21855 impl wkt::message::Message for SqlCsvImportOptions {
21856 fn typename() -> &'static str {
21857 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
21858 }
21859 }
21860
21861 #[allow(missing_docs)]
21862 #[derive(Clone, Default, PartialEq)]
21863 #[non_exhaustive]
21864 pub struct SqlBakImportOptions {
21865 #[allow(missing_docs)]
21866 pub encryption_options: std::option::Option<
21867 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21868 >,
21869
21870 /// Whether or not the backup set being restored is striped.
21871 /// Applies only to Cloud SQL for SQL Server.
21872 pub striped: std::option::Option<wkt::BoolValue>,
21873
21874 /// Whether or not the backup importing will restore database
21875 /// with NORECOVERY option.
21876 /// Applies only to Cloud SQL for SQL Server.
21877 pub no_recovery: std::option::Option<wkt::BoolValue>,
21878
21879 /// Whether or not the backup importing request will just bring database
21880 /// online without downloading Bak content only one of "no_recovery" and
21881 /// "recovery_only" can be true otherwise error will return. Applies only to
21882 /// Cloud SQL for SQL Server.
21883 pub recovery_only: std::option::Option<wkt::BoolValue>,
21884
21885 /// Type of the bak content, FULL or DIFF
21886 pub bak_type: crate::model::BakType,
21887
21888 /// Optional. The timestamp when the import should stop. This timestamp is in
21889 /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
21890 /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
21891 /// keyword and applies to Cloud SQL for SQL Server only.
21892 pub stop_at: std::option::Option<wkt::Timestamp>,
21893
21894 /// Optional. The marked transaction where the import should stop. This field
21895 /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
21896 /// Server only.
21897 pub stop_at_mark: std::string::String,
21898
21899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21900 }
21901
21902 impl SqlBakImportOptions {
21903 /// Creates a new default instance.
21904 pub fn new() -> Self {
21905 std::default::Default::default()
21906 }
21907
21908 /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21909 ///
21910 /// # Example
21911 /// ```ignore,no_run
21912 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21913 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21914 /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
21915 /// ```
21916 pub fn set_encryption_options<T>(mut self, v: T) -> Self
21917 where
21918 T: std::convert::Into<
21919 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21920 >,
21921 {
21922 self.encryption_options = std::option::Option::Some(v.into());
21923 self
21924 }
21925
21926 /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21927 ///
21928 /// # Example
21929 /// ```ignore,no_run
21930 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21931 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21932 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
21933 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
21934 /// ```
21935 pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
21936 where
21937 T: std::convert::Into<
21938 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21939 >,
21940 {
21941 self.encryption_options = v.map(|x| x.into());
21942 self
21943 }
21944
21945 /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21946 ///
21947 /// # Example
21948 /// ```ignore,no_run
21949 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21950 /// use wkt::BoolValue;
21951 /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
21952 /// ```
21953 pub fn set_striped<T>(mut self, v: T) -> Self
21954 where
21955 T: std::convert::Into<wkt::BoolValue>,
21956 {
21957 self.striped = std::option::Option::Some(v.into());
21958 self
21959 }
21960
21961 /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21962 ///
21963 /// # Example
21964 /// ```ignore,no_run
21965 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21966 /// use wkt::BoolValue;
21967 /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21968 /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
21969 /// ```
21970 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21971 where
21972 T: std::convert::Into<wkt::BoolValue>,
21973 {
21974 self.striped = v.map(|x| x.into());
21975 self
21976 }
21977
21978 /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21979 ///
21980 /// # Example
21981 /// ```ignore,no_run
21982 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21983 /// use wkt::BoolValue;
21984 /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
21985 /// ```
21986 pub fn set_no_recovery<T>(mut self, v: T) -> Self
21987 where
21988 T: std::convert::Into<wkt::BoolValue>,
21989 {
21990 self.no_recovery = std::option::Option::Some(v.into());
21991 self
21992 }
21993
21994 /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21995 ///
21996 /// # Example
21997 /// ```ignore,no_run
21998 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21999 /// use wkt::BoolValue;
22000 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
22001 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
22002 /// ```
22003 pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
22004 where
22005 T: std::convert::Into<wkt::BoolValue>,
22006 {
22007 self.no_recovery = v.map(|x| x.into());
22008 self
22009 }
22010
22011 /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
22012 ///
22013 /// # Example
22014 /// ```ignore,no_run
22015 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22016 /// use wkt::BoolValue;
22017 /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
22018 /// ```
22019 pub fn set_recovery_only<T>(mut self, v: T) -> Self
22020 where
22021 T: std::convert::Into<wkt::BoolValue>,
22022 {
22023 self.recovery_only = std::option::Option::Some(v.into());
22024 self
22025 }
22026
22027 /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
22028 ///
22029 /// # Example
22030 /// ```ignore,no_run
22031 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22032 /// use wkt::BoolValue;
22033 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
22034 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
22035 /// ```
22036 pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
22037 where
22038 T: std::convert::Into<wkt::BoolValue>,
22039 {
22040 self.recovery_only = v.map(|x| x.into());
22041 self
22042 }
22043
22044 /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
22045 ///
22046 /// # Example
22047 /// ```ignore,no_run
22048 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22049 /// use google_cloud_sql_v1::model::BakType;
22050 /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
22051 /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
22052 /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
22053 /// ```
22054 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
22055 self.bak_type = v.into();
22056 self
22057 }
22058
22059 /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
22060 ///
22061 /// # Example
22062 /// ```ignore,no_run
22063 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22064 /// use wkt::Timestamp;
22065 /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
22066 /// ```
22067 pub fn set_stop_at<T>(mut self, v: T) -> Self
22068 where
22069 T: std::convert::Into<wkt::Timestamp>,
22070 {
22071 self.stop_at = std::option::Option::Some(v.into());
22072 self
22073 }
22074
22075 /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
22076 ///
22077 /// # Example
22078 /// ```ignore,no_run
22079 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22080 /// use wkt::Timestamp;
22081 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
22082 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
22083 /// ```
22084 pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
22085 where
22086 T: std::convert::Into<wkt::Timestamp>,
22087 {
22088 self.stop_at = v.map(|x| x.into());
22089 self
22090 }
22091
22092 /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
22093 ///
22094 /// # Example
22095 /// ```ignore,no_run
22096 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22097 /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
22098 /// ```
22099 pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
22100 mut self,
22101 v: T,
22102 ) -> Self {
22103 self.stop_at_mark = v.into();
22104 self
22105 }
22106 }
22107
22108 impl wkt::message::Message for SqlBakImportOptions {
22109 fn typename() -> &'static str {
22110 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
22111 }
22112 }
22113
22114 /// Defines additional types related to [SqlBakImportOptions].
22115 pub mod sql_bak_import_options {
22116 #[allow(unused_imports)]
22117 use super::*;
22118
22119 #[allow(missing_docs)]
22120 #[derive(Clone, Default, PartialEq)]
22121 #[non_exhaustive]
22122 pub struct EncryptionOptions {
22123 /// Path to the Certificate (.cer) in Cloud Storage, in the form
22124 /// `gs://bucketName/fileName`. The instance must have
22125 /// write permissions to the bucket and read access to the file.
22126 pub cert_path: std::string::String,
22127
22128 /// Path to the Certificate Private Key (.pvk) in Cloud Storage, in the
22129 /// form `gs://bucketName/fileName`. The instance must have
22130 /// write permissions to the bucket and read access to the file.
22131 pub pvk_path: std::string::String,
22132
22133 /// Password that encrypts the private key
22134 pub pvk_password: std::string::String,
22135
22136 /// Optional. Whether the imported file remains encrypted.
22137 pub keep_encrypted: std::option::Option<wkt::BoolValue>,
22138
22139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22140 }
22141
22142 impl EncryptionOptions {
22143 /// Creates a new default instance.
22144 pub fn new() -> Self {
22145 std::default::Default::default()
22146 }
22147
22148 /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
22149 ///
22150 /// # Example
22151 /// ```ignore,no_run
22152 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22153 /// let x = EncryptionOptions::new().set_cert_path("example");
22154 /// ```
22155 pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
22156 mut self,
22157 v: T,
22158 ) -> Self {
22159 self.cert_path = v.into();
22160 self
22161 }
22162
22163 /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
22164 ///
22165 /// # Example
22166 /// ```ignore,no_run
22167 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22168 /// let x = EncryptionOptions::new().set_pvk_path("example");
22169 /// ```
22170 pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
22171 mut self,
22172 v: T,
22173 ) -> Self {
22174 self.pvk_path = v.into();
22175 self
22176 }
22177
22178 /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
22179 ///
22180 /// # Example
22181 /// ```ignore,no_run
22182 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22183 /// let x = EncryptionOptions::new().set_pvk_password("example");
22184 /// ```
22185 pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
22186 mut self,
22187 v: T,
22188 ) -> Self {
22189 self.pvk_password = v.into();
22190 self
22191 }
22192
22193 /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
22194 ///
22195 /// # Example
22196 /// ```ignore,no_run
22197 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22198 /// use wkt::BoolValue;
22199 /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
22200 /// ```
22201 pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
22202 where
22203 T: std::convert::Into<wkt::BoolValue>,
22204 {
22205 self.keep_encrypted = std::option::Option::Some(v.into());
22206 self
22207 }
22208
22209 /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
22210 ///
22211 /// # Example
22212 /// ```ignore,no_run
22213 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22214 /// use wkt::BoolValue;
22215 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
22216 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
22217 /// ```
22218 pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
22219 where
22220 T: std::convert::Into<wkt::BoolValue>,
22221 {
22222 self.keep_encrypted = v.map(|x| x.into());
22223 self
22224 }
22225 }
22226
22227 impl wkt::message::Message for EncryptionOptions {
22228 fn typename() -> &'static str {
22229 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
22230 }
22231 }
22232 }
22233
22234 #[allow(missing_docs)]
22235 #[derive(Clone, Default, PartialEq)]
22236 #[non_exhaustive]
22237 pub struct SqlTdeImportOptions {
22238 /// Required. Path to the TDE certificate public key
22239 /// in the form gs://bucketName/fileName.
22240 /// The instance must have read access to the file.
22241 /// Applicable only for SQL Server instances.
22242 pub certificate_path: std::string::String,
22243
22244 /// Required. Path to the TDE certificate private key
22245 /// in the form gs://bucketName/fileName.
22246 /// The instance must have read access to the file.
22247 /// Applicable only for SQL Server instances.
22248 pub private_key_path: std::string::String,
22249
22250 /// Required. Password that encrypts the private key.
22251 pub private_key_password: std::string::String,
22252
22253 /// Required. Certificate name.
22254 /// Applicable only for SQL Server instances.
22255 pub name: std::string::String,
22256
22257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22258 }
22259
22260 impl SqlTdeImportOptions {
22261 /// Creates a new default instance.
22262 pub fn new() -> Self {
22263 std::default::Default::default()
22264 }
22265
22266 /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
22267 ///
22268 /// # Example
22269 /// ```ignore,no_run
22270 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22271 /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
22272 /// ```
22273 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
22274 mut self,
22275 v: T,
22276 ) -> Self {
22277 self.certificate_path = v.into();
22278 self
22279 }
22280
22281 /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
22282 ///
22283 /// # Example
22284 /// ```ignore,no_run
22285 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22286 /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
22287 /// ```
22288 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
22289 mut self,
22290 v: T,
22291 ) -> Self {
22292 self.private_key_path = v.into();
22293 self
22294 }
22295
22296 /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
22297 ///
22298 /// # Example
22299 /// ```ignore,no_run
22300 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22301 /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
22302 /// ```
22303 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
22304 mut self,
22305 v: T,
22306 ) -> Self {
22307 self.private_key_password = v.into();
22308 self
22309 }
22310
22311 /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
22312 ///
22313 /// # Example
22314 /// ```ignore,no_run
22315 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22316 /// let x = SqlTdeImportOptions::new().set_name("example");
22317 /// ```
22318 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22319 self.name = v.into();
22320 self
22321 }
22322 }
22323
22324 impl wkt::message::Message for SqlTdeImportOptions {
22325 fn typename() -> &'static str {
22326 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
22327 }
22328 }
22329}
22330
22331/// IP Management configuration.
22332#[derive(Clone, Default, PartialEq)]
22333#[non_exhaustive]
22334pub struct IpConfiguration {
22335 /// Whether the instance is assigned a public IP address or not.
22336 pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
22337
22338 /// The resource link for the VPC network from which the Cloud SQL instance is
22339 /// accessible for private IP. For example,
22340 /// `/projects/myProject/global/networks/default`. This setting can
22341 /// be updated, but it cannot be removed after it is set.
22342 pub private_network: std::string::String,
22343
22344 /// Use `ssl_mode` instead.
22345 ///
22346 /// Whether SSL/TLS connections over IP are enforced.
22347 /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
22348 /// For SSL/TLS connections, the client certificate won't be verified. If
22349 /// set to true, then only allow connections encrypted with SSL/TLS and with
22350 /// valid client certificates. If you want to enforce SSL/TLS without enforcing
22351 /// the requirement for valid client certificates, then use the `ssl_mode` flag
22352 /// instead of the `require_ssl` flag.
22353 pub require_ssl: std::option::Option<wkt::BoolValue>,
22354
22355 /// The list of external networks that are allowed to connect to the instance
22356 /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
22357 /// example: `157.197.200.0/24`).
22358 pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
22359
22360 /// The name of the allocated ip range for the private ip Cloud SQL instance.
22361 /// For example: "google-managed-services-default". If set, the instance ip
22362 /// will be created in the allocated range. The range name must comply with
22363 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
22364 /// must be 1-63 characters long and match the regular expression
22365 /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
22366 pub allocated_ip_range: std::string::String,
22367
22368 /// Controls connectivity to private IP instances from Google services,
22369 /// such as BigQuery.
22370 pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
22371
22372 /// Specify how SSL/TLS is enforced in database connections. If you must use
22373 /// the `require_ssl` flag for backward compatibility, then only the following
22374 /// value pairs are valid:
22375 ///
22376 /// For PostgreSQL and MySQL:
22377 ///
22378 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
22379 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
22380 /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
22381 ///
22382 /// For SQL Server:
22383 ///
22384 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
22385 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
22386 ///
22387 /// The value of `ssl_mode` has priority over the value of `require_ssl`.
22388 ///
22389 /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
22390 /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
22391 /// connections, while `require_ssl=false` means accept both non-SSL
22392 /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
22393 /// `ssl_mode` and accepts only SSL connections.
22394 pub ssl_mode: crate::model::ip_configuration::SslMode,
22395
22396 /// PSC settings for this instance.
22397 pub psc_config: std::option::Option<crate::model::PscConfig>,
22398
22399 /// Specify what type of CA is used for the server certificate.
22400 pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
22401
22402 /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
22403 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
22404
22405 /// Optional. The resource name of the server CA pool for an instance with
22406 /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
22407 /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
22408 pub server_ca_pool: std::option::Option<std::string::String>,
22409
22410 /// Optional. Controls the automatic server certificate rotation feature. This
22411 /// feature is disabled by default. When enabled, the server certificate will
22412 /// be automatically rotated during Cloud SQL scheduled maintenance or
22413 /// self-service maintenance updates up to six months before it expires. This
22414 /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
22415 /// or CUSTOMER_MANAGED_CAS_CA.
22416 pub server_certificate_rotation_mode:
22417 std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
22418
22419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22420}
22421
22422impl IpConfiguration {
22423 /// Creates a new default instance.
22424 pub fn new() -> Self {
22425 std::default::Default::default()
22426 }
22427
22428 /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22429 ///
22430 /// # Example
22431 /// ```ignore,no_run
22432 /// # use google_cloud_sql_v1::model::IpConfiguration;
22433 /// use wkt::BoolValue;
22434 /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
22435 /// ```
22436 pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
22437 where
22438 T: std::convert::Into<wkt::BoolValue>,
22439 {
22440 self.ipv4_enabled = std::option::Option::Some(v.into());
22441 self
22442 }
22443
22444 /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22445 ///
22446 /// # Example
22447 /// ```ignore,no_run
22448 /// # use google_cloud_sql_v1::model::IpConfiguration;
22449 /// use wkt::BoolValue;
22450 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
22451 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
22452 /// ```
22453 pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22454 where
22455 T: std::convert::Into<wkt::BoolValue>,
22456 {
22457 self.ipv4_enabled = v.map(|x| x.into());
22458 self
22459 }
22460
22461 /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
22462 ///
22463 /// # Example
22464 /// ```ignore,no_run
22465 /// # use google_cloud_sql_v1::model::IpConfiguration;
22466 /// let x = IpConfiguration::new().set_private_network("example");
22467 /// ```
22468 pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22469 self.private_network = v.into();
22470 self
22471 }
22472
22473 /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22474 ///
22475 /// # Example
22476 /// ```ignore,no_run
22477 /// # use google_cloud_sql_v1::model::IpConfiguration;
22478 /// use wkt::BoolValue;
22479 /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
22480 /// ```
22481 pub fn set_require_ssl<T>(mut self, v: T) -> Self
22482 where
22483 T: std::convert::Into<wkt::BoolValue>,
22484 {
22485 self.require_ssl = std::option::Option::Some(v.into());
22486 self
22487 }
22488
22489 /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22490 ///
22491 /// # Example
22492 /// ```ignore,no_run
22493 /// # use google_cloud_sql_v1::model::IpConfiguration;
22494 /// use wkt::BoolValue;
22495 /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
22496 /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
22497 /// ```
22498 pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
22499 where
22500 T: std::convert::Into<wkt::BoolValue>,
22501 {
22502 self.require_ssl = v.map(|x| x.into());
22503 self
22504 }
22505
22506 /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
22507 ///
22508 /// # Example
22509 /// ```ignore,no_run
22510 /// # use google_cloud_sql_v1::model::IpConfiguration;
22511 /// use google_cloud_sql_v1::model::AclEntry;
22512 /// let x = IpConfiguration::new()
22513 /// .set_authorized_networks([
22514 /// AclEntry::default()/* use setters */,
22515 /// AclEntry::default()/* use (different) setters */,
22516 /// ]);
22517 /// ```
22518 pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
22519 where
22520 T: std::iter::IntoIterator<Item = V>,
22521 V: std::convert::Into<crate::model::AclEntry>,
22522 {
22523 use std::iter::Iterator;
22524 self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
22525 self
22526 }
22527
22528 /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
22529 ///
22530 /// # Example
22531 /// ```ignore,no_run
22532 /// # use google_cloud_sql_v1::model::IpConfiguration;
22533 /// let x = IpConfiguration::new().set_allocated_ip_range("example");
22534 /// ```
22535 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
22536 mut self,
22537 v: T,
22538 ) -> Self {
22539 self.allocated_ip_range = v.into();
22540 self
22541 }
22542
22543 /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22544 ///
22545 /// # Example
22546 /// ```ignore,no_run
22547 /// # use google_cloud_sql_v1::model::IpConfiguration;
22548 /// use wkt::BoolValue;
22549 /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
22550 /// ```
22551 pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
22552 where
22553 T: std::convert::Into<wkt::BoolValue>,
22554 {
22555 self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
22556 self
22557 }
22558
22559 /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22560 ///
22561 /// # Example
22562 /// ```ignore,no_run
22563 /// # use google_cloud_sql_v1::model::IpConfiguration;
22564 /// use wkt::BoolValue;
22565 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
22566 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
22567 /// ```
22568 pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
22569 mut self,
22570 v: std::option::Option<T>,
22571 ) -> Self
22572 where
22573 T: std::convert::Into<wkt::BoolValue>,
22574 {
22575 self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
22576 self
22577 }
22578
22579 /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
22580 ///
22581 /// # Example
22582 /// ```ignore,no_run
22583 /// # use google_cloud_sql_v1::model::IpConfiguration;
22584 /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
22585 /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
22586 /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
22587 /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
22588 /// ```
22589 pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
22590 mut self,
22591 v: T,
22592 ) -> Self {
22593 self.ssl_mode = v.into();
22594 self
22595 }
22596
22597 /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
22598 ///
22599 /// # Example
22600 /// ```ignore,no_run
22601 /// # use google_cloud_sql_v1::model::IpConfiguration;
22602 /// use google_cloud_sql_v1::model::PscConfig;
22603 /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
22604 /// ```
22605 pub fn set_psc_config<T>(mut self, v: T) -> Self
22606 where
22607 T: std::convert::Into<crate::model::PscConfig>,
22608 {
22609 self.psc_config = std::option::Option::Some(v.into());
22610 self
22611 }
22612
22613 /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
22614 ///
22615 /// # Example
22616 /// ```ignore,no_run
22617 /// # use google_cloud_sql_v1::model::IpConfiguration;
22618 /// use google_cloud_sql_v1::model::PscConfig;
22619 /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
22620 /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
22621 /// ```
22622 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
22623 where
22624 T: std::convert::Into<crate::model::PscConfig>,
22625 {
22626 self.psc_config = v.map(|x| x.into());
22627 self
22628 }
22629
22630 /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22631 ///
22632 /// # Example
22633 /// ```ignore,no_run
22634 /// # use google_cloud_sql_v1::model::IpConfiguration;
22635 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22636 /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
22637 /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
22638 /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
22639 /// ```
22640 pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
22641 where
22642 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22643 {
22644 self.server_ca_mode = std::option::Option::Some(v.into());
22645 self
22646 }
22647
22648 /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22649 ///
22650 /// # Example
22651 /// ```ignore,no_run
22652 /// # use google_cloud_sql_v1::model::IpConfiguration;
22653 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22654 /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
22655 /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
22656 /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
22657 /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
22658 /// ```
22659 pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
22660 where
22661 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22662 {
22663 self.server_ca_mode = v.map(|x| x.into());
22664 self
22665 }
22666
22667 /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
22668 ///
22669 /// # Example
22670 /// ```ignore,no_run
22671 /// # use google_cloud_sql_v1::model::IpConfiguration;
22672 /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
22673 /// ```
22674 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
22675 where
22676 T: std::iter::IntoIterator<Item = V>,
22677 V: std::convert::Into<std::string::String>,
22678 {
22679 use std::iter::Iterator;
22680 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
22681 self
22682 }
22683
22684 /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22685 ///
22686 /// # Example
22687 /// ```ignore,no_run
22688 /// # use google_cloud_sql_v1::model::IpConfiguration;
22689 /// let x = IpConfiguration::new().set_server_ca_pool("example");
22690 /// ```
22691 pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
22692 where
22693 T: std::convert::Into<std::string::String>,
22694 {
22695 self.server_ca_pool = std::option::Option::Some(v.into());
22696 self
22697 }
22698
22699 /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22700 ///
22701 /// # Example
22702 /// ```ignore,no_run
22703 /// # use google_cloud_sql_v1::model::IpConfiguration;
22704 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
22705 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
22706 /// ```
22707 pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
22708 where
22709 T: std::convert::Into<std::string::String>,
22710 {
22711 self.server_ca_pool = v.map(|x| x.into());
22712 self
22713 }
22714
22715 /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22716 ///
22717 /// # Example
22718 /// ```ignore,no_run
22719 /// # use google_cloud_sql_v1::model::IpConfiguration;
22720 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22721 /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
22722 /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
22723 /// ```
22724 pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
22725 where
22726 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22727 {
22728 self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
22729 self
22730 }
22731
22732 /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22733 ///
22734 /// # Example
22735 /// ```ignore,no_run
22736 /// # use google_cloud_sql_v1::model::IpConfiguration;
22737 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22738 /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
22739 /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
22740 /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
22741 /// ```
22742 pub fn set_or_clear_server_certificate_rotation_mode<T>(
22743 mut self,
22744 v: std::option::Option<T>,
22745 ) -> Self
22746 where
22747 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22748 {
22749 self.server_certificate_rotation_mode = v.map(|x| x.into());
22750 self
22751 }
22752}
22753
22754impl wkt::message::Message for IpConfiguration {
22755 fn typename() -> &'static str {
22756 "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
22757 }
22758}
22759
22760/// Defines additional types related to [IpConfiguration].
22761pub mod ip_configuration {
22762 #[allow(unused_imports)]
22763 use super::*;
22764
22765 /// The SSL options for database connections.
22766 ///
22767 /// # Working with unknown values
22768 ///
22769 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22770 /// additional enum variants at any time. Adding new variants is not considered
22771 /// a breaking change. Applications should write their code in anticipation of:
22772 ///
22773 /// - New values appearing in future releases of the client library, **and**
22774 /// - New values received dynamically, without application changes.
22775 ///
22776 /// Please consult the [Working with enums] section in the user guide for some
22777 /// guidelines.
22778 ///
22779 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22780 #[derive(Clone, Debug, PartialEq)]
22781 #[non_exhaustive]
22782 pub enum SslMode {
22783 /// The SSL mode is unknown.
22784 Unspecified,
22785 /// Allow non-SSL/non-TLS and SSL/TLS connections.
22786 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22787 /// isn't verified.
22788 ///
22789 /// When this value is used, the legacy `require_ssl` flag must be false or
22790 /// cleared to avoid a conflict between the values of the two flags.
22791 AllowUnencryptedAndEncrypted,
22792 /// Only allow connections encrypted with SSL/TLS.
22793 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22794 /// isn't verified.
22795 ///
22796 /// When this value is used, the legacy `require_ssl` flag must be false or
22797 /// cleared to avoid a conflict between the values of the two flags.
22798 EncryptedOnly,
22799 /// Only allow connections encrypted with SSL/TLS and with valid
22800 /// client certificates.
22801 ///
22802 /// When this value is used, the legacy `require_ssl` flag must be true or
22803 /// cleared to avoid the conflict between values of two flags.
22804 /// PostgreSQL clients or users that connect using IAM database
22805 /// authentication must use either the
22806 /// [Cloud SQL Auth
22807 /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
22808 /// [Cloud SQL
22809 /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
22810 /// to enforce client identity verification.
22811 ///
22812 /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
22813 TrustedClientCertificateRequired,
22814 /// If set, the enum was initialized with an unknown value.
22815 ///
22816 /// Applications can examine the value using [SslMode::value] or
22817 /// [SslMode::name].
22818 UnknownValue(ssl_mode::UnknownValue),
22819 }
22820
22821 #[doc(hidden)]
22822 pub mod ssl_mode {
22823 #[allow(unused_imports)]
22824 use super::*;
22825 #[derive(Clone, Debug, PartialEq)]
22826 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22827 }
22828
22829 impl SslMode {
22830 /// Gets the enum value.
22831 ///
22832 /// Returns `None` if the enum contains an unknown value deserialized from
22833 /// the string representation of enums.
22834 pub fn value(&self) -> std::option::Option<i32> {
22835 match self {
22836 Self::Unspecified => std::option::Option::Some(0),
22837 Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
22838 Self::EncryptedOnly => std::option::Option::Some(2),
22839 Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
22840 Self::UnknownValue(u) => u.0.value(),
22841 }
22842 }
22843
22844 /// Gets the enum value as a string.
22845 ///
22846 /// Returns `None` if the enum contains an unknown value deserialized from
22847 /// the integer representation of enums.
22848 pub fn name(&self) -> std::option::Option<&str> {
22849 match self {
22850 Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
22851 Self::AllowUnencryptedAndEncrypted => {
22852 std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
22853 }
22854 Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
22855 Self::TrustedClientCertificateRequired => {
22856 std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
22857 }
22858 Self::UnknownValue(u) => u.0.name(),
22859 }
22860 }
22861 }
22862
22863 impl std::default::Default for SslMode {
22864 fn default() -> Self {
22865 use std::convert::From;
22866 Self::from(0)
22867 }
22868 }
22869
22870 impl std::fmt::Display for SslMode {
22871 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22872 wkt::internal::display_enum(f, self.name(), self.value())
22873 }
22874 }
22875
22876 impl std::convert::From<i32> for SslMode {
22877 fn from(value: i32) -> Self {
22878 match value {
22879 0 => Self::Unspecified,
22880 1 => Self::AllowUnencryptedAndEncrypted,
22881 2 => Self::EncryptedOnly,
22882 3 => Self::TrustedClientCertificateRequired,
22883 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22884 wkt::internal::UnknownEnumValue::Integer(value),
22885 )),
22886 }
22887 }
22888 }
22889
22890 impl std::convert::From<&str> for SslMode {
22891 fn from(value: &str) -> Self {
22892 use std::string::ToString;
22893 match value {
22894 "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
22895 "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
22896 "ENCRYPTED_ONLY" => Self::EncryptedOnly,
22897 "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
22898 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22899 wkt::internal::UnknownEnumValue::String(value.to_string()),
22900 )),
22901 }
22902 }
22903 }
22904
22905 impl serde::ser::Serialize for SslMode {
22906 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22907 where
22908 S: serde::Serializer,
22909 {
22910 match self {
22911 Self::Unspecified => serializer.serialize_i32(0),
22912 Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
22913 Self::EncryptedOnly => serializer.serialize_i32(2),
22914 Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
22915 Self::UnknownValue(u) => u.0.serialize(serializer),
22916 }
22917 }
22918 }
22919
22920 impl<'de> serde::de::Deserialize<'de> for SslMode {
22921 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22922 where
22923 D: serde::Deserializer<'de>,
22924 {
22925 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
22926 ".google.cloud.sql.v1.IpConfiguration.SslMode",
22927 ))
22928 }
22929 }
22930
22931 /// Various Certificate Authority (CA) modes for certificate signing.
22932 ///
22933 /// # Working with unknown values
22934 ///
22935 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22936 /// additional enum variants at any time. Adding new variants is not considered
22937 /// a breaking change. Applications should write their code in anticipation of:
22938 ///
22939 /// - New values appearing in future releases of the client library, **and**
22940 /// - New values received dynamically, without application changes.
22941 ///
22942 /// Please consult the [Working with enums] section in the user guide for some
22943 /// guidelines.
22944 ///
22945 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22946 #[derive(Clone, Debug, PartialEq)]
22947 #[non_exhaustive]
22948 pub enum CaMode {
22949 /// CA mode is unspecified. It is effectively the same as
22950 /// `GOOGLE_MANAGED_INTERNAL_CA`.
22951 Unspecified,
22952 /// Google-managed self-signed internal CA.
22953 GoogleManagedInternalCa,
22954 /// Google-managed regional CA part of root CA hierarchy hosted on Google
22955 /// Cloud's Certificate Authority Service (CAS).
22956 GoogleManagedCasCa,
22957 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
22958 /// Service (CAS).
22959 CustomerManagedCasCa,
22960 /// If set, the enum was initialized with an unknown value.
22961 ///
22962 /// Applications can examine the value using [CaMode::value] or
22963 /// [CaMode::name].
22964 UnknownValue(ca_mode::UnknownValue),
22965 }
22966
22967 #[doc(hidden)]
22968 pub mod ca_mode {
22969 #[allow(unused_imports)]
22970 use super::*;
22971 #[derive(Clone, Debug, PartialEq)]
22972 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22973 }
22974
22975 impl CaMode {
22976 /// Gets the enum value.
22977 ///
22978 /// Returns `None` if the enum contains an unknown value deserialized from
22979 /// the string representation of enums.
22980 pub fn value(&self) -> std::option::Option<i32> {
22981 match self {
22982 Self::Unspecified => std::option::Option::Some(0),
22983 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
22984 Self::GoogleManagedCasCa => std::option::Option::Some(2),
22985 Self::CustomerManagedCasCa => std::option::Option::Some(3),
22986 Self::UnknownValue(u) => u.0.value(),
22987 }
22988 }
22989
22990 /// Gets the enum value as a string.
22991 ///
22992 /// Returns `None` if the enum contains an unknown value deserialized from
22993 /// the integer representation of enums.
22994 pub fn name(&self) -> std::option::Option<&str> {
22995 match self {
22996 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
22997 Self::GoogleManagedInternalCa => {
22998 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
22999 }
23000 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
23001 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
23002 Self::UnknownValue(u) => u.0.name(),
23003 }
23004 }
23005 }
23006
23007 impl std::default::Default for CaMode {
23008 fn default() -> Self {
23009 use std::convert::From;
23010 Self::from(0)
23011 }
23012 }
23013
23014 impl std::fmt::Display for CaMode {
23015 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23016 wkt::internal::display_enum(f, self.name(), self.value())
23017 }
23018 }
23019
23020 impl std::convert::From<i32> for CaMode {
23021 fn from(value: i32) -> Self {
23022 match value {
23023 0 => Self::Unspecified,
23024 1 => Self::GoogleManagedInternalCa,
23025 2 => Self::GoogleManagedCasCa,
23026 3 => Self::CustomerManagedCasCa,
23027 _ => Self::UnknownValue(ca_mode::UnknownValue(
23028 wkt::internal::UnknownEnumValue::Integer(value),
23029 )),
23030 }
23031 }
23032 }
23033
23034 impl std::convert::From<&str> for CaMode {
23035 fn from(value: &str) -> Self {
23036 use std::string::ToString;
23037 match value {
23038 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
23039 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
23040 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
23041 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
23042 _ => Self::UnknownValue(ca_mode::UnknownValue(
23043 wkt::internal::UnknownEnumValue::String(value.to_string()),
23044 )),
23045 }
23046 }
23047 }
23048
23049 impl serde::ser::Serialize for CaMode {
23050 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23051 where
23052 S: serde::Serializer,
23053 {
23054 match self {
23055 Self::Unspecified => serializer.serialize_i32(0),
23056 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
23057 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
23058 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
23059 Self::UnknownValue(u) => u.0.serialize(serializer),
23060 }
23061 }
23062 }
23063
23064 impl<'de> serde::de::Deserialize<'de> for CaMode {
23065 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23066 where
23067 D: serde::Deserializer<'de>,
23068 {
23069 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
23070 ".google.cloud.sql.v1.IpConfiguration.CaMode",
23071 ))
23072 }
23073 }
23074
23075 /// Settings for automatic server certificate rotation.
23076 ///
23077 /// # Working with unknown values
23078 ///
23079 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23080 /// additional enum variants at any time. Adding new variants is not considered
23081 /// a breaking change. Applications should write their code in anticipation of:
23082 ///
23083 /// - New values appearing in future releases of the client library, **and**
23084 /// - New values received dynamically, without application changes.
23085 ///
23086 /// Please consult the [Working with enums] section in the user guide for some
23087 /// guidelines.
23088 ///
23089 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23090 #[derive(Clone, Debug, PartialEq)]
23091 #[non_exhaustive]
23092 pub enum ServerCertificateRotationMode {
23093 /// Unspecified: no automatic server certificate rotation.
23094 Unspecified,
23095 /// No automatic server certificate rotation. The user must [manage server
23096 /// certificate
23097 /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
23098 /// on their side.
23099 NoAutomaticRotation,
23100 /// Automatic server certificate rotation during Cloud SQL scheduled
23101 /// maintenance or self-service maintenance updates. Requires
23102 /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
23103 /// `CUSTOMER_MANAGED_CAS_CA`.
23104 AutomaticRotationDuringMaintenance,
23105 /// If set, the enum was initialized with an unknown value.
23106 ///
23107 /// Applications can examine the value using [ServerCertificateRotationMode::value] or
23108 /// [ServerCertificateRotationMode::name].
23109 UnknownValue(server_certificate_rotation_mode::UnknownValue),
23110 }
23111
23112 #[doc(hidden)]
23113 pub mod server_certificate_rotation_mode {
23114 #[allow(unused_imports)]
23115 use super::*;
23116 #[derive(Clone, Debug, PartialEq)]
23117 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23118 }
23119
23120 impl ServerCertificateRotationMode {
23121 /// Gets the enum value.
23122 ///
23123 /// Returns `None` if the enum contains an unknown value deserialized from
23124 /// the string representation of enums.
23125 pub fn value(&self) -> std::option::Option<i32> {
23126 match self {
23127 Self::Unspecified => std::option::Option::Some(0),
23128 Self::NoAutomaticRotation => std::option::Option::Some(1),
23129 Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
23130 Self::UnknownValue(u) => u.0.value(),
23131 }
23132 }
23133
23134 /// Gets the enum value as a string.
23135 ///
23136 /// Returns `None` if the enum contains an unknown value deserialized from
23137 /// the integer representation of enums.
23138 pub fn name(&self) -> std::option::Option<&str> {
23139 match self {
23140 Self::Unspecified => {
23141 std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
23142 }
23143 Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
23144 Self::AutomaticRotationDuringMaintenance => {
23145 std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
23146 }
23147 Self::UnknownValue(u) => u.0.name(),
23148 }
23149 }
23150 }
23151
23152 impl std::default::Default for ServerCertificateRotationMode {
23153 fn default() -> Self {
23154 use std::convert::From;
23155 Self::from(0)
23156 }
23157 }
23158
23159 impl std::fmt::Display for ServerCertificateRotationMode {
23160 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23161 wkt::internal::display_enum(f, self.name(), self.value())
23162 }
23163 }
23164
23165 impl std::convert::From<i32> for ServerCertificateRotationMode {
23166 fn from(value: i32) -> Self {
23167 match value {
23168 0 => Self::Unspecified,
23169 1 => Self::NoAutomaticRotation,
23170 2 => Self::AutomaticRotationDuringMaintenance,
23171 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
23172 wkt::internal::UnknownEnumValue::Integer(value),
23173 )),
23174 }
23175 }
23176 }
23177
23178 impl std::convert::From<&str> for ServerCertificateRotationMode {
23179 fn from(value: &str) -> Self {
23180 use std::string::ToString;
23181 match value {
23182 "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
23183 "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
23184 "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
23185 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
23186 wkt::internal::UnknownEnumValue::String(value.to_string()),
23187 )),
23188 }
23189 }
23190 }
23191
23192 impl serde::ser::Serialize for ServerCertificateRotationMode {
23193 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23194 where
23195 S: serde::Serializer,
23196 {
23197 match self {
23198 Self::Unspecified => serializer.serialize_i32(0),
23199 Self::NoAutomaticRotation => serializer.serialize_i32(1),
23200 Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
23201 Self::UnknownValue(u) => u.0.serialize(serializer),
23202 }
23203 }
23204 }
23205
23206 impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
23207 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23208 where
23209 D: serde::Deserializer<'de>,
23210 {
23211 deserializer.deserialize_any(
23212 wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
23213 ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
23214 ),
23215 )
23216 }
23217 }
23218}
23219
23220/// PSC settings for a Cloud SQL instance.
23221#[derive(Clone, Default, PartialEq)]
23222#[non_exhaustive]
23223pub struct PscConfig {
23224 /// Whether PSC connectivity is enabled for this instance.
23225 pub psc_enabled: std::option::Option<bool>,
23226
23227 /// Optional. The list of consumer projects that are allow-listed for PSC
23228 /// connections to this instance. This instance can be connected to with PSC
23229 /// from any network in these projects.
23230 ///
23231 /// Each consumer project in this list may be represented by a project number
23232 /// (numeric) or by a project id (alphanumeric).
23233 pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
23234
23235 /// Optional. The list of settings for requested Private Service Connect
23236 /// consumer endpoints that can be used to connect to this Cloud SQL instance.
23237 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
23238
23239 /// Optional. The network attachment of the consumer network that the
23240 /// Private Service Connect enabled Cloud SQL instance is
23241 /// authorized to connect via PSC interface.
23242 /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
23243 pub network_attachment_uri: std::string::String,
23244
23245 /// Optional. Indicates whether Private Service Connect DNS automation is
23246 /// enabled for this instance. When enabled, Cloud SQL provisions a universal
23247 /// DNS record across all networks configured with Private Service Connect
23248 /// auto-connections. This will default to true for new instances when
23249 /// Private Service Connect is enabled.
23250 pub psc_auto_dns_enabled: std::option::Option<bool>,
23251
23252 /// Optional. Indicates whether Private Service Connect write endpoint DNS
23253 /// automation is enabled for this instance. When enabled, Cloud SQL provisions
23254 /// a universal global DNS record across all networks configured with Private
23255 /// Service Connect auto-connections that points to the cluster primary
23256 /// instance. This feature is only supported for Enterprise Plus edition. This
23257 /// will default to true for new Enterprise Plus instances when
23258 /// `psc_auto_dns_enabled` is enabled.
23259 pub psc_write_endpoint_dns_enabled: std::option::Option<bool>,
23260
23261 /// Optional. Whether to set up the PSC service connection policy
23262 /// automatically.
23263 pub psc_auto_connection_policy_enabled: std::option::Option<bool>,
23264
23265 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23266}
23267
23268impl PscConfig {
23269 /// Creates a new default instance.
23270 pub fn new() -> Self {
23271 std::default::Default::default()
23272 }
23273
23274 /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
23275 ///
23276 /// # Example
23277 /// ```ignore,no_run
23278 /// # use google_cloud_sql_v1::model::PscConfig;
23279 /// let x = PscConfig::new().set_psc_enabled(true);
23280 /// ```
23281 pub fn set_psc_enabled<T>(mut self, v: T) -> Self
23282 where
23283 T: std::convert::Into<bool>,
23284 {
23285 self.psc_enabled = std::option::Option::Some(v.into());
23286 self
23287 }
23288
23289 /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
23290 ///
23291 /// # Example
23292 /// ```ignore,no_run
23293 /// # use google_cloud_sql_v1::model::PscConfig;
23294 /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
23295 /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
23296 /// ```
23297 pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
23298 where
23299 T: std::convert::Into<bool>,
23300 {
23301 self.psc_enabled = v.map(|x| x.into());
23302 self
23303 }
23304
23305 /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
23306 ///
23307 /// # Example
23308 /// ```ignore,no_run
23309 /// # use google_cloud_sql_v1::model::PscConfig;
23310 /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
23311 /// ```
23312 pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
23313 where
23314 T: std::iter::IntoIterator<Item = V>,
23315 V: std::convert::Into<std::string::String>,
23316 {
23317 use std::iter::Iterator;
23318 self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
23319 self
23320 }
23321
23322 /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
23323 ///
23324 /// # Example
23325 /// ```ignore,no_run
23326 /// # use google_cloud_sql_v1::model::PscConfig;
23327 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23328 /// let x = PscConfig::new()
23329 /// .set_psc_auto_connections([
23330 /// PscAutoConnectionConfig::default()/* use setters */,
23331 /// PscAutoConnectionConfig::default()/* use (different) setters */,
23332 /// ]);
23333 /// ```
23334 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
23335 where
23336 T: std::iter::IntoIterator<Item = V>,
23337 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
23338 {
23339 use std::iter::Iterator;
23340 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
23341 self
23342 }
23343
23344 /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
23345 ///
23346 /// # Example
23347 /// ```ignore,no_run
23348 /// # use google_cloud_sql_v1::model::PscConfig;
23349 /// let x = PscConfig::new().set_network_attachment_uri("example");
23350 /// ```
23351 pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
23352 mut self,
23353 v: T,
23354 ) -> Self {
23355 self.network_attachment_uri = v.into();
23356 self
23357 }
23358
23359 /// Sets the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
23360 ///
23361 /// # Example
23362 /// ```ignore,no_run
23363 /// # use google_cloud_sql_v1::model::PscConfig;
23364 /// let x = PscConfig::new().set_psc_auto_dns_enabled(true);
23365 /// ```
23366 pub fn set_psc_auto_dns_enabled<T>(mut self, v: T) -> Self
23367 where
23368 T: std::convert::Into<bool>,
23369 {
23370 self.psc_auto_dns_enabled = std::option::Option::Some(v.into());
23371 self
23372 }
23373
23374 /// Sets or clears the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
23375 ///
23376 /// # Example
23377 /// ```ignore,no_run
23378 /// # use google_cloud_sql_v1::model::PscConfig;
23379 /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(Some(false));
23380 /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(None::<bool>);
23381 /// ```
23382 pub fn set_or_clear_psc_auto_dns_enabled<T>(mut self, v: std::option::Option<T>) -> Self
23383 where
23384 T: std::convert::Into<bool>,
23385 {
23386 self.psc_auto_dns_enabled = v.map(|x| x.into());
23387 self
23388 }
23389
23390 /// Sets the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
23391 ///
23392 /// # Example
23393 /// ```ignore,no_run
23394 /// # use google_cloud_sql_v1::model::PscConfig;
23395 /// let x = PscConfig::new().set_psc_write_endpoint_dns_enabled(true);
23396 /// ```
23397 pub fn set_psc_write_endpoint_dns_enabled<T>(mut self, v: T) -> Self
23398 where
23399 T: std::convert::Into<bool>,
23400 {
23401 self.psc_write_endpoint_dns_enabled = std::option::Option::Some(v.into());
23402 self
23403 }
23404
23405 /// Sets or clears the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
23406 ///
23407 /// # Example
23408 /// ```ignore,no_run
23409 /// # use google_cloud_sql_v1::model::PscConfig;
23410 /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(Some(false));
23411 /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(None::<bool>);
23412 /// ```
23413 pub fn set_or_clear_psc_write_endpoint_dns_enabled<T>(
23414 mut self,
23415 v: std::option::Option<T>,
23416 ) -> Self
23417 where
23418 T: std::convert::Into<bool>,
23419 {
23420 self.psc_write_endpoint_dns_enabled = v.map(|x| x.into());
23421 self
23422 }
23423
23424 /// Sets the value of [psc_auto_connection_policy_enabled][crate::model::PscConfig::psc_auto_connection_policy_enabled].
23425 ///
23426 /// # Example
23427 /// ```ignore,no_run
23428 /// # use google_cloud_sql_v1::model::PscConfig;
23429 /// let x = PscConfig::new().set_psc_auto_connection_policy_enabled(true);
23430 /// ```
23431 pub fn set_psc_auto_connection_policy_enabled<T>(mut self, v: T) -> Self
23432 where
23433 T: std::convert::Into<bool>,
23434 {
23435 self.psc_auto_connection_policy_enabled = std::option::Option::Some(v.into());
23436 self
23437 }
23438
23439 /// Sets or clears the value of [psc_auto_connection_policy_enabled][crate::model::PscConfig::psc_auto_connection_policy_enabled].
23440 ///
23441 /// # Example
23442 /// ```ignore,no_run
23443 /// # use google_cloud_sql_v1::model::PscConfig;
23444 /// let x = PscConfig::new().set_or_clear_psc_auto_connection_policy_enabled(Some(false));
23445 /// let x = PscConfig::new().set_or_clear_psc_auto_connection_policy_enabled(None::<bool>);
23446 /// ```
23447 pub fn set_or_clear_psc_auto_connection_policy_enabled<T>(
23448 mut self,
23449 v: std::option::Option<T>,
23450 ) -> Self
23451 where
23452 T: std::convert::Into<bool>,
23453 {
23454 self.psc_auto_connection_policy_enabled = v.map(|x| x.into());
23455 self
23456 }
23457}
23458
23459impl wkt::message::Message for PscConfig {
23460 fn typename() -> &'static str {
23461 "type.googleapis.com/google.cloud.sql.v1.PscConfig"
23462 }
23463}
23464
23465/// Settings for an automatically-setup Private Service Connect consumer endpoint
23466/// that is used to connect to a Cloud SQL instance.
23467#[derive(Clone, Default, PartialEq)]
23468#[non_exhaustive]
23469pub struct PscAutoConnectionConfig {
23470 /// Optional. This is the project ID of consumer service project of this
23471 /// consumer endpoint.
23472 ///
23473 /// This is only applicable if `consumer_network` is a shared VPC
23474 /// network.
23475 pub consumer_project: std::string::String,
23476
23477 /// Optional. The consumer network of this consumer endpoint. This must be a
23478 /// resource path that includes both the host project and the network name.
23479 ///
23480 /// For example, `projects/project1/global/networks/network1`.
23481 ///
23482 /// The consumer host project of this network might be different from the
23483 /// consumer service project.
23484 pub consumer_network: std::string::String,
23485
23486 /// The IP address of the consumer endpoint.
23487 pub ip_address: std::option::Option<std::string::String>,
23488
23489 /// The connection status of the consumer endpoint.
23490 pub status: std::option::Option<std::string::String>,
23491
23492 /// The connection policy status of the consumer network.
23493 pub consumer_network_status: std::option::Option<std::string::String>,
23494
23495 /// Output only. The service connection policy created automatically for the
23496 /// consumer network when `psc_auto_connection_policy_enabled` is true. It is
23497 /// in the format of:
23498 /// `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
23499 /// The `policy_id` is in format of `$NETWORK-$RANDOM`.
23500 pub service_connection_policy: std::option::Option<std::string::String>,
23501
23502 /// Output only. The status of service connection policy creation.
23503 pub service_connection_policy_creation_result: std::option::Option<std::string::String>,
23504
23505 /// Output only. The status of automated DNS provisioning.
23506 pub instance_auto_dns_status: std::option::Option<crate::model::AutoDnsStatus>,
23507
23508 /// Output only. The status of automated DNS provisioning for the write
23509 /// endpoint.
23510 pub write_endpoint_auto_dns_status: std::option::Option<crate::model::AutoDnsStatus>,
23511
23512 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23513}
23514
23515impl PscAutoConnectionConfig {
23516 /// Creates a new default instance.
23517 pub fn new() -> Self {
23518 std::default::Default::default()
23519 }
23520
23521 /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
23522 ///
23523 /// # Example
23524 /// ```ignore,no_run
23525 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23526 /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
23527 /// ```
23528 pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
23529 mut self,
23530 v: T,
23531 ) -> Self {
23532 self.consumer_project = v.into();
23533 self
23534 }
23535
23536 /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
23537 ///
23538 /// # Example
23539 /// ```ignore,no_run
23540 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23541 /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
23542 /// ```
23543 pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
23544 mut self,
23545 v: T,
23546 ) -> Self {
23547 self.consumer_network = v.into();
23548 self
23549 }
23550
23551 /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23552 ///
23553 /// # Example
23554 /// ```ignore,no_run
23555 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23556 /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
23557 /// ```
23558 pub fn set_ip_address<T>(mut self, v: T) -> Self
23559 where
23560 T: std::convert::Into<std::string::String>,
23561 {
23562 self.ip_address = std::option::Option::Some(v.into());
23563 self
23564 }
23565
23566 /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23567 ///
23568 /// # Example
23569 /// ```ignore,no_run
23570 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23571 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
23572 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
23573 /// ```
23574 pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
23575 where
23576 T: std::convert::Into<std::string::String>,
23577 {
23578 self.ip_address = v.map(|x| x.into());
23579 self
23580 }
23581
23582 /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
23583 ///
23584 /// # Example
23585 /// ```ignore,no_run
23586 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23587 /// let x = PscAutoConnectionConfig::new().set_status("example");
23588 /// ```
23589 pub fn set_status<T>(mut self, v: T) -> Self
23590 where
23591 T: std::convert::Into<std::string::String>,
23592 {
23593 self.status = std::option::Option::Some(v.into());
23594 self
23595 }
23596
23597 /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
23598 ///
23599 /// # Example
23600 /// ```ignore,no_run
23601 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23602 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
23603 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
23604 /// ```
23605 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
23606 where
23607 T: std::convert::Into<std::string::String>,
23608 {
23609 self.status = v.map(|x| x.into());
23610 self
23611 }
23612
23613 /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23614 ///
23615 /// # Example
23616 /// ```ignore,no_run
23617 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23618 /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
23619 /// ```
23620 pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
23621 where
23622 T: std::convert::Into<std::string::String>,
23623 {
23624 self.consumer_network_status = std::option::Option::Some(v.into());
23625 self
23626 }
23627
23628 /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23629 ///
23630 /// # Example
23631 /// ```ignore,no_run
23632 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23633 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
23634 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
23635 /// ```
23636 pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
23637 where
23638 T: std::convert::Into<std::string::String>,
23639 {
23640 self.consumer_network_status = v.map(|x| x.into());
23641 self
23642 }
23643
23644 /// Sets the value of [service_connection_policy][crate::model::PscAutoConnectionConfig::service_connection_policy].
23645 ///
23646 /// # Example
23647 /// ```ignore,no_run
23648 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23649 /// let x = PscAutoConnectionConfig::new().set_service_connection_policy("example");
23650 /// ```
23651 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
23652 where
23653 T: std::convert::Into<std::string::String>,
23654 {
23655 self.service_connection_policy = std::option::Option::Some(v.into());
23656 self
23657 }
23658
23659 /// Sets or clears the value of [service_connection_policy][crate::model::PscAutoConnectionConfig::service_connection_policy].
23660 ///
23661 /// # Example
23662 /// ```ignore,no_run
23663 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23664 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy(Some("example"));
23665 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy(None::<String>);
23666 /// ```
23667 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
23668 where
23669 T: std::convert::Into<std::string::String>,
23670 {
23671 self.service_connection_policy = v.map(|x| x.into());
23672 self
23673 }
23674
23675 /// Sets the value of [service_connection_policy_creation_result][crate::model::PscAutoConnectionConfig::service_connection_policy_creation_result].
23676 ///
23677 /// # Example
23678 /// ```ignore,no_run
23679 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23680 /// let x = PscAutoConnectionConfig::new().set_service_connection_policy_creation_result("example");
23681 /// ```
23682 pub fn set_service_connection_policy_creation_result<T>(mut self, v: T) -> Self
23683 where
23684 T: std::convert::Into<std::string::String>,
23685 {
23686 self.service_connection_policy_creation_result = std::option::Option::Some(v.into());
23687 self
23688 }
23689
23690 /// Sets or clears the value of [service_connection_policy_creation_result][crate::model::PscAutoConnectionConfig::service_connection_policy_creation_result].
23691 ///
23692 /// # Example
23693 /// ```ignore,no_run
23694 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23695 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy_creation_result(Some("example"));
23696 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy_creation_result(None::<String>);
23697 /// ```
23698 pub fn set_or_clear_service_connection_policy_creation_result<T>(
23699 mut self,
23700 v: std::option::Option<T>,
23701 ) -> Self
23702 where
23703 T: std::convert::Into<std::string::String>,
23704 {
23705 self.service_connection_policy_creation_result = v.map(|x| x.into());
23706 self
23707 }
23708
23709 /// Sets the value of [instance_auto_dns_status][crate::model::PscAutoConnectionConfig::instance_auto_dns_status].
23710 ///
23711 /// # Example
23712 /// ```ignore,no_run
23713 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23714 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23715 /// let x0 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsOk);
23716 /// let x1 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsFailed);
23717 /// let x2 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsUnknown);
23718 /// ```
23719 pub fn set_instance_auto_dns_status<T>(mut self, v: T) -> Self
23720 where
23721 T: std::convert::Into<crate::model::AutoDnsStatus>,
23722 {
23723 self.instance_auto_dns_status = std::option::Option::Some(v.into());
23724 self
23725 }
23726
23727 /// Sets or clears the value of [instance_auto_dns_status][crate::model::PscAutoConnectionConfig::instance_auto_dns_status].
23728 ///
23729 /// # Example
23730 /// ```ignore,no_run
23731 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23732 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23733 /// let x0 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsOk));
23734 /// let x1 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsFailed));
23735 /// let x2 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsUnknown));
23736 /// let x_none = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(None::<AutoDnsStatus>);
23737 /// ```
23738 pub fn set_or_clear_instance_auto_dns_status<T>(mut self, v: std::option::Option<T>) -> Self
23739 where
23740 T: std::convert::Into<crate::model::AutoDnsStatus>,
23741 {
23742 self.instance_auto_dns_status = v.map(|x| x.into());
23743 self
23744 }
23745
23746 /// Sets the value of [write_endpoint_auto_dns_status][crate::model::PscAutoConnectionConfig::write_endpoint_auto_dns_status].
23747 ///
23748 /// # Example
23749 /// ```ignore,no_run
23750 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23751 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23752 /// let x0 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsOk);
23753 /// let x1 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsFailed);
23754 /// let x2 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsUnknown);
23755 /// ```
23756 pub fn set_write_endpoint_auto_dns_status<T>(mut self, v: T) -> Self
23757 where
23758 T: std::convert::Into<crate::model::AutoDnsStatus>,
23759 {
23760 self.write_endpoint_auto_dns_status = std::option::Option::Some(v.into());
23761 self
23762 }
23763
23764 /// Sets or clears the value of [write_endpoint_auto_dns_status][crate::model::PscAutoConnectionConfig::write_endpoint_auto_dns_status].
23765 ///
23766 /// # Example
23767 /// ```ignore,no_run
23768 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23769 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23770 /// let x0 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsOk));
23771 /// let x1 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsFailed));
23772 /// let x2 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsUnknown));
23773 /// let x_none = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(None::<AutoDnsStatus>);
23774 /// ```
23775 pub fn set_or_clear_write_endpoint_auto_dns_status<T>(
23776 mut self,
23777 v: std::option::Option<T>,
23778 ) -> Self
23779 where
23780 T: std::convert::Into<crate::model::AutoDnsStatus>,
23781 {
23782 self.write_endpoint_auto_dns_status = v.map(|x| x.into());
23783 self
23784 }
23785}
23786
23787impl wkt::message::Message for PscAutoConnectionConfig {
23788 fn typename() -> &'static str {
23789 "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
23790 }
23791}
23792
23793/// Preferred location. This specifies where a Cloud SQL instance is located.
23794/// Note that if the preferred location is not available, the instance will be
23795/// located as close as possible within the region. Only one location may be
23796/// specified.
23797#[derive(Clone, Default, PartialEq)]
23798#[non_exhaustive]
23799pub struct LocationPreference {
23800 /// The App Engine application to follow, it must be in the same region as the
23801 /// Cloud SQL instance. WARNING: Changing this might restart the instance.
23802 #[deprecated]
23803 pub follow_gae_application: std::string::String,
23804
23805 /// The preferred Compute Engine zone (for example: us-central1-a,
23806 /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
23807 pub zone: std::string::String,
23808
23809 /// The preferred Compute Engine zone for the secondary/failover
23810 /// (for example: us-central1-a, us-central1-b, etc.).
23811 /// To disable this field, set it to 'no_secondary_zone'.
23812 pub secondary_zone: std::string::String,
23813
23814 /// This is always `sql#locationPreference`.
23815 pub kind: std::string::String,
23816
23817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23818}
23819
23820impl LocationPreference {
23821 /// Creates a new default instance.
23822 pub fn new() -> Self {
23823 std::default::Default::default()
23824 }
23825
23826 /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
23827 ///
23828 /// # Example
23829 /// ```ignore,no_run
23830 /// # use google_cloud_sql_v1::model::LocationPreference;
23831 /// let x = LocationPreference::new().set_follow_gae_application("example");
23832 /// ```
23833 #[deprecated]
23834 pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
23835 mut self,
23836 v: T,
23837 ) -> Self {
23838 self.follow_gae_application = v.into();
23839 self
23840 }
23841
23842 /// Sets the value of [zone][crate::model::LocationPreference::zone].
23843 ///
23844 /// # Example
23845 /// ```ignore,no_run
23846 /// # use google_cloud_sql_v1::model::LocationPreference;
23847 /// let x = LocationPreference::new().set_zone("example");
23848 /// ```
23849 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23850 self.zone = v.into();
23851 self
23852 }
23853
23854 /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
23855 ///
23856 /// # Example
23857 /// ```ignore,no_run
23858 /// # use google_cloud_sql_v1::model::LocationPreference;
23859 /// let x = LocationPreference::new().set_secondary_zone("example");
23860 /// ```
23861 pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23862 self.secondary_zone = v.into();
23863 self
23864 }
23865
23866 /// Sets the value of [kind][crate::model::LocationPreference::kind].
23867 ///
23868 /// # Example
23869 /// ```ignore,no_run
23870 /// # use google_cloud_sql_v1::model::LocationPreference;
23871 /// let x = LocationPreference::new().set_kind("example");
23872 /// ```
23873 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23874 self.kind = v.into();
23875 self
23876 }
23877}
23878
23879impl wkt::message::Message for LocationPreference {
23880 fn typename() -> &'static str {
23881 "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
23882 }
23883}
23884
23885/// Maintenance window. This specifies when a Cloud SQL instance is
23886/// restarted for system maintenance purposes.
23887#[derive(Clone, Default, PartialEq)]
23888#[non_exhaustive]
23889pub struct MaintenanceWindow {
23890 /// Hour of day - 0 to 23. Specify in the UTC time zone.
23891 pub hour: std::option::Option<wkt::Int32Value>,
23892
23893 /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
23894 /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
23895 /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
23896 pub day: std::option::Option<wkt::Int32Value>,
23897
23898 /// Maintenance timing settings: `canary`, `stable`, or `week5`.
23899 /// For more information, see [About maintenance on Cloud SQL
23900 /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
23901 pub update_track: crate::model::SqlUpdateTrack,
23902
23903 /// This is always `sql#maintenanceWindow`.
23904 pub kind: std::string::String,
23905
23906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23907}
23908
23909impl MaintenanceWindow {
23910 /// Creates a new default instance.
23911 pub fn new() -> Self {
23912 std::default::Default::default()
23913 }
23914
23915 /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
23916 ///
23917 /// # Example
23918 /// ```ignore,no_run
23919 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23920 /// use wkt::Int32Value;
23921 /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
23922 /// ```
23923 pub fn set_hour<T>(mut self, v: T) -> Self
23924 where
23925 T: std::convert::Into<wkt::Int32Value>,
23926 {
23927 self.hour = std::option::Option::Some(v.into());
23928 self
23929 }
23930
23931 /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
23932 ///
23933 /// # Example
23934 /// ```ignore,no_run
23935 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23936 /// use wkt::Int32Value;
23937 /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
23938 /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
23939 /// ```
23940 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
23941 where
23942 T: std::convert::Into<wkt::Int32Value>,
23943 {
23944 self.hour = v.map(|x| x.into());
23945 self
23946 }
23947
23948 /// Sets the value of [day][crate::model::MaintenanceWindow::day].
23949 ///
23950 /// # Example
23951 /// ```ignore,no_run
23952 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23953 /// use wkt::Int32Value;
23954 /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
23955 /// ```
23956 pub fn set_day<T>(mut self, v: T) -> Self
23957 where
23958 T: std::convert::Into<wkt::Int32Value>,
23959 {
23960 self.day = std::option::Option::Some(v.into());
23961 self
23962 }
23963
23964 /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
23965 ///
23966 /// # Example
23967 /// ```ignore,no_run
23968 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23969 /// use wkt::Int32Value;
23970 /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
23971 /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
23972 /// ```
23973 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
23974 where
23975 T: std::convert::Into<wkt::Int32Value>,
23976 {
23977 self.day = v.map(|x| x.into());
23978 self
23979 }
23980
23981 /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
23982 ///
23983 /// # Example
23984 /// ```ignore,no_run
23985 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23986 /// use google_cloud_sql_v1::model::SqlUpdateTrack;
23987 /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
23988 /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
23989 /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
23990 /// ```
23991 pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
23992 mut self,
23993 v: T,
23994 ) -> Self {
23995 self.update_track = v.into();
23996 self
23997 }
23998
23999 /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
24000 ///
24001 /// # Example
24002 /// ```ignore,no_run
24003 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
24004 /// let x = MaintenanceWindow::new().set_kind("example");
24005 /// ```
24006 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24007 self.kind = v.into();
24008 self
24009 }
24010}
24011
24012impl wkt::message::Message for MaintenanceWindow {
24013 fn typename() -> &'static str {
24014 "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
24015 }
24016}
24017
24018/// Deny maintenance Periods. This specifies a date range during when all CSA
24019/// rollout will be denied.
24020#[derive(Clone, Default, PartialEq)]
24021#[non_exhaustive]
24022pub struct DenyMaintenancePeriod {
24023 /// "deny maintenance period" start date. If the year of the start date is
24024 /// empty, the year of the end date also must be empty. In this case, it means
24025 /// the deny maintenance period recurs every year. The date is in format
24026 /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
24027 pub start_date: std::string::String,
24028
24029 /// "deny maintenance period" end date. If the year of the end date is empty,
24030 /// the year of the start date also must be empty. In this case, it means the
24031 /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
24032 /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
24033 pub end_date: std::string::String,
24034
24035 /// Time in UTC when the "deny maintenance period" starts on start_date and
24036 /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
24037 pub time: std::string::String,
24038
24039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24040}
24041
24042impl DenyMaintenancePeriod {
24043 /// Creates a new default instance.
24044 pub fn new() -> Self {
24045 std::default::Default::default()
24046 }
24047
24048 /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
24049 ///
24050 /// # Example
24051 /// ```ignore,no_run
24052 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
24053 /// let x = DenyMaintenancePeriod::new().set_start_date("example");
24054 /// ```
24055 pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24056 self.start_date = v.into();
24057 self
24058 }
24059
24060 /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
24061 ///
24062 /// # Example
24063 /// ```ignore,no_run
24064 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
24065 /// let x = DenyMaintenancePeriod::new().set_end_date("example");
24066 /// ```
24067 pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24068 self.end_date = v.into();
24069 self
24070 }
24071
24072 /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
24073 ///
24074 /// # Example
24075 /// ```ignore,no_run
24076 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
24077 /// let x = DenyMaintenancePeriod::new().set_time("example");
24078 /// ```
24079 pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24080 self.time = v.into();
24081 self
24082 }
24083}
24084
24085impl wkt::message::Message for DenyMaintenancePeriod {
24086 fn typename() -> &'static str {
24087 "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
24088 }
24089}
24090
24091/// Insights configuration. This specifies when Cloud SQL Insights feature is
24092/// enabled and optional configuration.
24093#[derive(Clone, Default, PartialEq)]
24094#[non_exhaustive]
24095pub struct InsightsConfig {
24096 /// Whether Query Insights feature is enabled.
24097 pub query_insights_enabled: bool,
24098
24099 /// Whether Query Insights will record client address when enabled.
24100 pub record_client_address: bool,
24101
24102 /// Whether Query Insights will record application tags from query when
24103 /// enabled.
24104 pub record_application_tags: bool,
24105
24106 /// Maximum query length stored in bytes. Default value: 1024 bytes.
24107 /// Range: 256-4500 bytes. Query lengths greater than this field value will be
24108 /// truncated to this value. When unset, query length will be the default
24109 /// value. Changing query length will restart the database.
24110 pub query_string_length: std::option::Option<wkt::Int32Value>,
24111
24112 /// Number of query execution plans captured by Insights per minute
24113 /// for all queries combined. Default is 5.
24114 pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
24115
24116 /// Optional. Whether enhanced query insights feature is enabled.
24117 pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
24118
24119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24120}
24121
24122impl InsightsConfig {
24123 /// Creates a new default instance.
24124 pub fn new() -> Self {
24125 std::default::Default::default()
24126 }
24127
24128 /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
24129 ///
24130 /// # Example
24131 /// ```ignore,no_run
24132 /// # use google_cloud_sql_v1::model::InsightsConfig;
24133 /// let x = InsightsConfig::new().set_query_insights_enabled(true);
24134 /// ```
24135 pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24136 self.query_insights_enabled = v.into();
24137 self
24138 }
24139
24140 /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
24141 ///
24142 /// # Example
24143 /// ```ignore,no_run
24144 /// # use google_cloud_sql_v1::model::InsightsConfig;
24145 /// let x = InsightsConfig::new().set_record_client_address(true);
24146 /// ```
24147 pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24148 self.record_client_address = v.into();
24149 self
24150 }
24151
24152 /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
24153 ///
24154 /// # Example
24155 /// ```ignore,no_run
24156 /// # use google_cloud_sql_v1::model::InsightsConfig;
24157 /// let x = InsightsConfig::new().set_record_application_tags(true);
24158 /// ```
24159 pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24160 self.record_application_tags = v.into();
24161 self
24162 }
24163
24164 /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
24165 ///
24166 /// # Example
24167 /// ```ignore,no_run
24168 /// # use google_cloud_sql_v1::model::InsightsConfig;
24169 /// use wkt::Int32Value;
24170 /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
24171 /// ```
24172 pub fn set_query_string_length<T>(mut self, v: T) -> Self
24173 where
24174 T: std::convert::Into<wkt::Int32Value>,
24175 {
24176 self.query_string_length = std::option::Option::Some(v.into());
24177 self
24178 }
24179
24180 /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
24181 ///
24182 /// # Example
24183 /// ```ignore,no_run
24184 /// # use google_cloud_sql_v1::model::InsightsConfig;
24185 /// use wkt::Int32Value;
24186 /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
24187 /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
24188 /// ```
24189 pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
24190 where
24191 T: std::convert::Into<wkt::Int32Value>,
24192 {
24193 self.query_string_length = v.map(|x| x.into());
24194 self
24195 }
24196
24197 /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
24198 ///
24199 /// # Example
24200 /// ```ignore,no_run
24201 /// # use google_cloud_sql_v1::model::InsightsConfig;
24202 /// use wkt::Int32Value;
24203 /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
24204 /// ```
24205 pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
24206 where
24207 T: std::convert::Into<wkt::Int32Value>,
24208 {
24209 self.query_plans_per_minute = std::option::Option::Some(v.into());
24210 self
24211 }
24212
24213 /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
24214 ///
24215 /// # Example
24216 /// ```ignore,no_run
24217 /// # use google_cloud_sql_v1::model::InsightsConfig;
24218 /// use wkt::Int32Value;
24219 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
24220 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
24221 /// ```
24222 pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
24223 where
24224 T: std::convert::Into<wkt::Int32Value>,
24225 {
24226 self.query_plans_per_minute = v.map(|x| x.into());
24227 self
24228 }
24229
24230 /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
24231 ///
24232 /// # Example
24233 /// ```ignore,no_run
24234 /// # use google_cloud_sql_v1::model::InsightsConfig;
24235 /// use wkt::BoolValue;
24236 /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
24237 /// ```
24238 pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
24239 where
24240 T: std::convert::Into<wkt::BoolValue>,
24241 {
24242 self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
24243 self
24244 }
24245
24246 /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
24247 ///
24248 /// # Example
24249 /// ```ignore,no_run
24250 /// # use google_cloud_sql_v1::model::InsightsConfig;
24251 /// use wkt::BoolValue;
24252 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
24253 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
24254 /// ```
24255 pub fn set_or_clear_enhanced_query_insights_enabled<T>(
24256 mut self,
24257 v: std::option::Option<T>,
24258 ) -> Self
24259 where
24260 T: std::convert::Into<wkt::BoolValue>,
24261 {
24262 self.enhanced_query_insights_enabled = v.map(|x| x.into());
24263 self
24264 }
24265}
24266
24267impl wkt::message::Message for InsightsConfig {
24268 fn typename() -> &'static str {
24269 "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
24270 }
24271}
24272
24273/// Read-replica configuration specific to MySQL databases.
24274#[derive(Clone, Default, PartialEq)]
24275#[non_exhaustive]
24276pub struct MySqlReplicaConfiguration {
24277 /// Path to a SQL dump file in Google Cloud Storage from which the replica
24278 /// instance is to be created. The URI is in the form gs://bucketName/fileName.
24279 /// Compressed gzip files (.gz) are also supported.
24280 /// Dumps have the binlog co-ordinates from which replication
24281 /// begins. This can be accomplished by setting --master-data to 1 when using
24282 /// mysqldump.
24283 pub dump_file_path: std::string::String,
24284
24285 /// The username for the replication connection.
24286 pub username: std::string::String,
24287
24288 /// The password for the replication connection.
24289 pub password: std::string::String,
24290
24291 /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
24292 pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
24293
24294 /// Interval in milliseconds between replication heartbeats.
24295 pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
24296
24297 /// PEM representation of the trusted CA's x509 certificate.
24298 pub ca_certificate: std::string::String,
24299
24300 /// PEM representation of the replica's x509 certificate.
24301 pub client_certificate: std::string::String,
24302
24303 /// PEM representation of the replica's private key. The corresponding public
24304 /// key is encoded in the client's certificate.
24305 pub client_key: std::string::String,
24306
24307 /// A list of permissible ciphers to use for SSL encryption.
24308 pub ssl_cipher: std::string::String,
24309
24310 /// Whether or not to check the primary instance's Common Name value in the
24311 /// certificate that it sends during the SSL handshake.
24312 pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
24313
24314 /// This is always `sql#mysqlReplicaConfiguration`.
24315 pub kind: std::string::String,
24316
24317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24318}
24319
24320impl MySqlReplicaConfiguration {
24321 /// Creates a new default instance.
24322 pub fn new() -> Self {
24323 std::default::Default::default()
24324 }
24325
24326 /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
24327 ///
24328 /// # Example
24329 /// ```ignore,no_run
24330 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24331 /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
24332 /// ```
24333 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24334 self.dump_file_path = v.into();
24335 self
24336 }
24337
24338 /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
24339 ///
24340 /// # Example
24341 /// ```ignore,no_run
24342 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24343 /// let x = MySqlReplicaConfiguration::new().set_username("example");
24344 /// ```
24345 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24346 self.username = v.into();
24347 self
24348 }
24349
24350 /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
24351 ///
24352 /// # Example
24353 /// ```ignore,no_run
24354 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24355 /// let x = MySqlReplicaConfiguration::new().set_password("example");
24356 /// ```
24357 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24358 self.password = v.into();
24359 self
24360 }
24361
24362 /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
24363 ///
24364 /// # Example
24365 /// ```ignore,no_run
24366 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24367 /// use wkt::Int32Value;
24368 /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
24369 /// ```
24370 pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
24371 where
24372 T: std::convert::Into<wkt::Int32Value>,
24373 {
24374 self.connect_retry_interval = std::option::Option::Some(v.into());
24375 self
24376 }
24377
24378 /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
24379 ///
24380 /// # Example
24381 /// ```ignore,no_run
24382 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24383 /// use wkt::Int32Value;
24384 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
24385 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
24386 /// ```
24387 pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
24388 where
24389 T: std::convert::Into<wkt::Int32Value>,
24390 {
24391 self.connect_retry_interval = v.map(|x| x.into());
24392 self
24393 }
24394
24395 /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
24396 ///
24397 /// # Example
24398 /// ```ignore,no_run
24399 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24400 /// use wkt::Int64Value;
24401 /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
24402 /// ```
24403 pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
24404 where
24405 T: std::convert::Into<wkt::Int64Value>,
24406 {
24407 self.master_heartbeat_period = std::option::Option::Some(v.into());
24408 self
24409 }
24410
24411 /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
24412 ///
24413 /// # Example
24414 /// ```ignore,no_run
24415 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24416 /// use wkt::Int64Value;
24417 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
24418 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
24419 /// ```
24420 pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
24421 where
24422 T: std::convert::Into<wkt::Int64Value>,
24423 {
24424 self.master_heartbeat_period = v.map(|x| x.into());
24425 self
24426 }
24427
24428 /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
24429 ///
24430 /// # Example
24431 /// ```ignore,no_run
24432 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24433 /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
24434 /// ```
24435 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24436 self.ca_certificate = v.into();
24437 self
24438 }
24439
24440 /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
24441 ///
24442 /// # Example
24443 /// ```ignore,no_run
24444 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24445 /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
24446 /// ```
24447 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
24448 mut self,
24449 v: T,
24450 ) -> Self {
24451 self.client_certificate = v.into();
24452 self
24453 }
24454
24455 /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
24456 ///
24457 /// # Example
24458 /// ```ignore,no_run
24459 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24460 /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
24461 /// ```
24462 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24463 self.client_key = v.into();
24464 self
24465 }
24466
24467 /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
24468 ///
24469 /// # Example
24470 /// ```ignore,no_run
24471 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24472 /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
24473 /// ```
24474 pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24475 self.ssl_cipher = v.into();
24476 self
24477 }
24478
24479 /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
24480 ///
24481 /// # Example
24482 /// ```ignore,no_run
24483 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24484 /// use wkt::BoolValue;
24485 /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
24486 /// ```
24487 pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
24488 where
24489 T: std::convert::Into<wkt::BoolValue>,
24490 {
24491 self.verify_server_certificate = std::option::Option::Some(v.into());
24492 self
24493 }
24494
24495 /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
24496 ///
24497 /// # Example
24498 /// ```ignore,no_run
24499 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24500 /// use wkt::BoolValue;
24501 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
24502 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
24503 /// ```
24504 pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
24505 where
24506 T: std::convert::Into<wkt::BoolValue>,
24507 {
24508 self.verify_server_certificate = v.map(|x| x.into());
24509 self
24510 }
24511
24512 /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
24513 ///
24514 /// # Example
24515 /// ```ignore,no_run
24516 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24517 /// let x = MySqlReplicaConfiguration::new().set_kind("example");
24518 /// ```
24519 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24520 self.kind = v.into();
24521 self
24522 }
24523}
24524
24525impl wkt::message::Message for MySqlReplicaConfiguration {
24526 fn typename() -> &'static str {
24527 "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
24528 }
24529}
24530
24531/// Disk encryption configuration for an instance.
24532#[derive(Clone, Default, PartialEq)]
24533#[non_exhaustive]
24534pub struct DiskEncryptionConfiguration {
24535 /// Resource name of KMS key for disk encryption
24536 pub kms_key_name: std::string::String,
24537
24538 /// This is always `sql#diskEncryptionConfiguration`.
24539 pub kind: std::string::String,
24540
24541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24542}
24543
24544impl DiskEncryptionConfiguration {
24545 /// Creates a new default instance.
24546 pub fn new() -> Self {
24547 std::default::Default::default()
24548 }
24549
24550 /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
24551 ///
24552 /// # Example
24553 /// ```ignore,no_run
24554 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
24555 /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
24556 /// ```
24557 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24558 self.kms_key_name = v.into();
24559 self
24560 }
24561
24562 /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
24563 ///
24564 /// # Example
24565 /// ```ignore,no_run
24566 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
24567 /// let x = DiskEncryptionConfiguration::new().set_kind("example");
24568 /// ```
24569 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24570 self.kind = v.into();
24571 self
24572 }
24573}
24574
24575impl wkt::message::Message for DiskEncryptionConfiguration {
24576 fn typename() -> &'static str {
24577 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
24578 }
24579}
24580
24581/// Disk encryption status for an instance.
24582#[derive(Clone, Default, PartialEq)]
24583#[non_exhaustive]
24584pub struct DiskEncryptionStatus {
24585 /// KMS key version used to encrypt the Cloud SQL instance resource
24586 pub kms_key_version_name: std::string::String,
24587
24588 /// This is always `sql#diskEncryptionStatus`.
24589 pub kind: std::string::String,
24590
24591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24592}
24593
24594impl DiskEncryptionStatus {
24595 /// Creates a new default instance.
24596 pub fn new() -> Self {
24597 std::default::Default::default()
24598 }
24599
24600 /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
24601 ///
24602 /// # Example
24603 /// ```ignore,no_run
24604 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
24605 /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
24606 /// ```
24607 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
24608 mut self,
24609 v: T,
24610 ) -> Self {
24611 self.kms_key_version_name = v.into();
24612 self
24613 }
24614
24615 /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
24616 ///
24617 /// # Example
24618 /// ```ignore,no_run
24619 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
24620 /// let x = DiskEncryptionStatus::new().set_kind("example");
24621 /// ```
24622 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24623 self.kind = v.into();
24624 self
24625 }
24626}
24627
24628impl wkt::message::Message for DiskEncryptionStatus {
24629 fn typename() -> &'static str {
24630 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
24631 }
24632}
24633
24634/// Database instance IP mapping
24635#[derive(Clone, Default, PartialEq)]
24636#[non_exhaustive]
24637pub struct IpMapping {
24638 /// The type of this IP address. A `PRIMARY` address is a public address that
24639 /// can accept incoming connections. A `PRIVATE` address is a private address
24640 /// that can accept incoming connections. An `OUTGOING` address is the source
24641 /// address of connections originating from the instance, if supported.
24642 pub r#type: crate::model::SqlIpAddressType,
24643
24644 /// The IP address assigned.
24645 pub ip_address: std::string::String,
24646
24647 /// The due time for this IP to be retired in
24648 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
24649 /// `2012-11-15T16:19:00.094Z`. This field is only available when
24650 /// the IP is scheduled to be retired.
24651 pub time_to_retire: std::option::Option<wkt::Timestamp>,
24652
24653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24654}
24655
24656impl IpMapping {
24657 /// Creates a new default instance.
24658 pub fn new() -> Self {
24659 std::default::Default::default()
24660 }
24661
24662 /// Sets the value of [r#type][crate::model::IpMapping::type].
24663 ///
24664 /// # Example
24665 /// ```ignore,no_run
24666 /// # use google_cloud_sql_v1::model::IpMapping;
24667 /// use google_cloud_sql_v1::model::SqlIpAddressType;
24668 /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
24669 /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
24670 /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
24671 /// ```
24672 pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
24673 self.r#type = v.into();
24674 self
24675 }
24676
24677 /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
24678 ///
24679 /// # Example
24680 /// ```ignore,no_run
24681 /// # use google_cloud_sql_v1::model::IpMapping;
24682 /// let x = IpMapping::new().set_ip_address("example");
24683 /// ```
24684 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24685 self.ip_address = v.into();
24686 self
24687 }
24688
24689 /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24690 ///
24691 /// # Example
24692 /// ```ignore,no_run
24693 /// # use google_cloud_sql_v1::model::IpMapping;
24694 /// use wkt::Timestamp;
24695 /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
24696 /// ```
24697 pub fn set_time_to_retire<T>(mut self, v: T) -> Self
24698 where
24699 T: std::convert::Into<wkt::Timestamp>,
24700 {
24701 self.time_to_retire = std::option::Option::Some(v.into());
24702 self
24703 }
24704
24705 /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24706 ///
24707 /// # Example
24708 /// ```ignore,no_run
24709 /// # use google_cloud_sql_v1::model::IpMapping;
24710 /// use wkt::Timestamp;
24711 /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
24712 /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
24713 /// ```
24714 pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
24715 where
24716 T: std::convert::Into<wkt::Timestamp>,
24717 {
24718 self.time_to_retire = v.map(|x| x.into());
24719 self
24720 }
24721}
24722
24723impl wkt::message::Message for IpMapping {
24724 fn typename() -> &'static str {
24725 "type.googleapis.com/google.cloud.sql.v1.IpMapping"
24726 }
24727}
24728
24729/// The sub operation type based on the operation type.
24730#[derive(Clone, Default, PartialEq)]
24731#[non_exhaustive]
24732pub struct SqlSubOperationType {
24733 /// Sub operation details corresponding to the operation type.
24734 pub sub_operation_details:
24735 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24736
24737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24738}
24739
24740impl SqlSubOperationType {
24741 /// Creates a new default instance.
24742 pub fn new() -> Self {
24743 std::default::Default::default()
24744 }
24745
24746 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
24747 ///
24748 /// Note that all the setters affecting `sub_operation_details` are mutually
24749 /// exclusive.
24750 ///
24751 /// # Example
24752 /// ```ignore,no_run
24753 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24754 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24755 /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
24756 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
24757 /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
24758 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
24759 /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
24760 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
24761 /// ```
24762 pub fn set_sub_operation_details<
24763 T: std::convert::Into<
24764 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24765 >,
24766 >(
24767 mut self,
24768 v: T,
24769 ) -> Self {
24770 self.sub_operation_details = v.into();
24771 self
24772 }
24773
24774 /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24775 /// if it holds a `MaintenanceType`, `None` if the field is not set or
24776 /// holds a different branch.
24777 pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
24778 #[allow(unreachable_patterns)]
24779 self.sub_operation_details.as_ref().and_then(|v| match v {
24780 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
24781 std::option::Option::Some(v)
24782 }
24783 _ => std::option::Option::None,
24784 })
24785 }
24786
24787 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24788 /// to hold a `MaintenanceType`.
24789 ///
24790 /// Note that all the setters affecting `sub_operation_details` are
24791 /// mutually exclusive.
24792 ///
24793 /// # Example
24794 /// ```ignore,no_run
24795 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24796 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24797 /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
24798 /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
24799 /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
24800 /// assert!(x0.maintenance_type().is_some());
24801 /// assert!(x1.maintenance_type().is_some());
24802 /// assert!(x2.maintenance_type().is_some());
24803 /// ```
24804 pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
24805 mut self,
24806 v: T,
24807 ) -> Self {
24808 self.sub_operation_details = std::option::Option::Some(
24809 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
24810 );
24811 self
24812 }
24813}
24814
24815impl wkt::message::Message for SqlSubOperationType {
24816 fn typename() -> &'static str {
24817 "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
24818 }
24819}
24820
24821/// Defines additional types related to [SqlSubOperationType].
24822pub mod sql_sub_operation_type {
24823 #[allow(unused_imports)]
24824 use super::*;
24825
24826 /// Sub operation details corresponding to the operation type.
24827 #[derive(Clone, Debug, PartialEq)]
24828 #[non_exhaustive]
24829 pub enum SubOperationDetails {
24830 /// The type of maintenance to be performed on the instance.
24831 MaintenanceType(crate::model::SqlMaintenanceType),
24832 }
24833}
24834
24835/// An Operation resource. For successful operations that return an
24836/// Operation resource, only the fields relevant to the operation are populated
24837/// in the resource.
24838#[derive(Clone, Default, PartialEq)]
24839#[non_exhaustive]
24840pub struct Operation {
24841 /// This is always `sql#operation`.
24842 pub kind: std::string::String,
24843
24844 #[allow(missing_docs)]
24845 pub target_link: std::string::String,
24846
24847 /// The status of an operation.
24848 pub status: crate::model::operation::SqlOperationStatus,
24849
24850 /// The email address of the user who initiated this operation.
24851 pub user: std::string::String,
24852
24853 /// The time this operation was enqueued in UTC timezone in [RFC
24854 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24855 /// `2012-11-15T16:19:00.094Z`.
24856 pub insert_time: std::option::Option<wkt::Timestamp>,
24857
24858 /// The time this operation actually started in UTC timezone in [RFC
24859 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24860 /// `2012-11-15T16:19:00.094Z`.
24861 pub start_time: std::option::Option<wkt::Timestamp>,
24862
24863 /// The time this operation finished in UTC timezone in [RFC
24864 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24865 /// `2012-11-15T16:19:00.094Z`.
24866 pub end_time: std::option::Option<wkt::Timestamp>,
24867
24868 /// If errors occurred during processing of this operation, this field will be
24869 /// populated.
24870 pub error: std::option::Option<crate::model::OperationErrors>,
24871
24872 /// An Admin API warning message.
24873 pub api_warning: std::option::Option<crate::model::ApiWarning>,
24874
24875 /// The type of the operation. Valid values are:
24876 ///
24877 /// * `CREATE`
24878 /// * `DELETE`
24879 /// * `UPDATE`
24880 /// * `RESTART`
24881 /// * `IMPORT`
24882 /// * `EXPORT`
24883 /// * `BACKUP_VOLUME`
24884 /// * `RESTORE_VOLUME`
24885 /// * `CREATE_USER`
24886 /// * `DELETE_USER`
24887 /// * `CREATE_DATABASE`
24888 /// * `DELETE_DATABASE`
24889 pub operation_type: crate::model::operation::SqlOperationType,
24890
24891 /// The context for import operation, if applicable.
24892 pub import_context: std::option::Option<crate::model::ImportContext>,
24893
24894 /// The context for export operation, if applicable.
24895 pub export_context: std::option::Option<crate::model::ExportContext>,
24896
24897 /// The context for backup operation, if applicable.
24898 pub backup_context: std::option::Option<crate::model::BackupContext>,
24899
24900 /// This field is only populated when the operation_type is
24901 /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
24902 /// The PreCheckMajorVersionUpgradeContext message itself contains the details
24903 /// for that pre-check, such as the target database version for the upgrade
24904 /// and the results of the check (including any warnings or errors found).
24905 pub pre_check_major_version_upgrade_context:
24906 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
24907
24908 /// An identifier that uniquely identifies the operation. You can use this
24909 /// identifier to retrieve the Operations resource that has information about
24910 /// the operation.
24911 pub name: std::string::String,
24912
24913 /// Name of the resource on which this operation runs.
24914 pub target_id: std::string::String,
24915
24916 /// The URI of this resource.
24917 pub self_link: std::string::String,
24918
24919 /// The project ID of the target instance related to this operation.
24920 pub target_project: std::string::String,
24921
24922 /// The context for acquire SSRS lease operation, if applicable.
24923 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
24924
24925 /// Optional. The sub operation based on the operation type.
24926 pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
24927
24928 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24929}
24930
24931impl Operation {
24932 /// Creates a new default instance.
24933 pub fn new() -> Self {
24934 std::default::Default::default()
24935 }
24936
24937 /// Sets the value of [kind][crate::model::Operation::kind].
24938 ///
24939 /// # Example
24940 /// ```ignore,no_run
24941 /// # use google_cloud_sql_v1::model::Operation;
24942 /// let x = Operation::new().set_kind("example");
24943 /// ```
24944 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24945 self.kind = v.into();
24946 self
24947 }
24948
24949 /// Sets the value of [target_link][crate::model::Operation::target_link].
24950 ///
24951 /// # Example
24952 /// ```ignore,no_run
24953 /// # use google_cloud_sql_v1::model::Operation;
24954 /// let x = Operation::new().set_target_link("example");
24955 /// ```
24956 pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24957 self.target_link = v.into();
24958 self
24959 }
24960
24961 /// Sets the value of [status][crate::model::Operation::status].
24962 ///
24963 /// # Example
24964 /// ```ignore,no_run
24965 /// # use google_cloud_sql_v1::model::Operation;
24966 /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
24967 /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
24968 /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
24969 /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
24970 /// ```
24971 pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
24972 mut self,
24973 v: T,
24974 ) -> Self {
24975 self.status = v.into();
24976 self
24977 }
24978
24979 /// Sets the value of [user][crate::model::Operation::user].
24980 ///
24981 /// # Example
24982 /// ```ignore,no_run
24983 /// # use google_cloud_sql_v1::model::Operation;
24984 /// let x = Operation::new().set_user("example");
24985 /// ```
24986 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24987 self.user = v.into();
24988 self
24989 }
24990
24991 /// Sets the value of [insert_time][crate::model::Operation::insert_time].
24992 ///
24993 /// # Example
24994 /// ```ignore,no_run
24995 /// # use google_cloud_sql_v1::model::Operation;
24996 /// use wkt::Timestamp;
24997 /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
24998 /// ```
24999 pub fn set_insert_time<T>(mut self, v: T) -> Self
25000 where
25001 T: std::convert::Into<wkt::Timestamp>,
25002 {
25003 self.insert_time = std::option::Option::Some(v.into());
25004 self
25005 }
25006
25007 /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
25008 ///
25009 /// # Example
25010 /// ```ignore,no_run
25011 /// # use google_cloud_sql_v1::model::Operation;
25012 /// use wkt::Timestamp;
25013 /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
25014 /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
25015 /// ```
25016 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
25017 where
25018 T: std::convert::Into<wkt::Timestamp>,
25019 {
25020 self.insert_time = v.map(|x| x.into());
25021 self
25022 }
25023
25024 /// Sets the value of [start_time][crate::model::Operation::start_time].
25025 ///
25026 /// # Example
25027 /// ```ignore,no_run
25028 /// # use google_cloud_sql_v1::model::Operation;
25029 /// use wkt::Timestamp;
25030 /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
25031 /// ```
25032 pub fn set_start_time<T>(mut self, v: T) -> Self
25033 where
25034 T: std::convert::Into<wkt::Timestamp>,
25035 {
25036 self.start_time = std::option::Option::Some(v.into());
25037 self
25038 }
25039
25040 /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
25041 ///
25042 /// # Example
25043 /// ```ignore,no_run
25044 /// # use google_cloud_sql_v1::model::Operation;
25045 /// use wkt::Timestamp;
25046 /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
25047 /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
25048 /// ```
25049 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
25050 where
25051 T: std::convert::Into<wkt::Timestamp>,
25052 {
25053 self.start_time = v.map(|x| x.into());
25054 self
25055 }
25056
25057 /// Sets the value of [end_time][crate::model::Operation::end_time].
25058 ///
25059 /// # Example
25060 /// ```ignore,no_run
25061 /// # use google_cloud_sql_v1::model::Operation;
25062 /// use wkt::Timestamp;
25063 /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
25064 /// ```
25065 pub fn set_end_time<T>(mut self, v: T) -> Self
25066 where
25067 T: std::convert::Into<wkt::Timestamp>,
25068 {
25069 self.end_time = std::option::Option::Some(v.into());
25070 self
25071 }
25072
25073 /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
25074 ///
25075 /// # Example
25076 /// ```ignore,no_run
25077 /// # use google_cloud_sql_v1::model::Operation;
25078 /// use wkt::Timestamp;
25079 /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
25080 /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
25081 /// ```
25082 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
25083 where
25084 T: std::convert::Into<wkt::Timestamp>,
25085 {
25086 self.end_time = v.map(|x| x.into());
25087 self
25088 }
25089
25090 /// Sets the value of [error][crate::model::Operation::error].
25091 ///
25092 /// # Example
25093 /// ```ignore,no_run
25094 /// # use google_cloud_sql_v1::model::Operation;
25095 /// use google_cloud_sql_v1::model::OperationErrors;
25096 /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
25097 /// ```
25098 pub fn set_error<T>(mut self, v: T) -> Self
25099 where
25100 T: std::convert::Into<crate::model::OperationErrors>,
25101 {
25102 self.error = std::option::Option::Some(v.into());
25103 self
25104 }
25105
25106 /// Sets or clears the value of [error][crate::model::Operation::error].
25107 ///
25108 /// # Example
25109 /// ```ignore,no_run
25110 /// # use google_cloud_sql_v1::model::Operation;
25111 /// use google_cloud_sql_v1::model::OperationErrors;
25112 /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
25113 /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
25114 /// ```
25115 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
25116 where
25117 T: std::convert::Into<crate::model::OperationErrors>,
25118 {
25119 self.error = v.map(|x| x.into());
25120 self
25121 }
25122
25123 /// Sets the value of [api_warning][crate::model::Operation::api_warning].
25124 ///
25125 /// # Example
25126 /// ```ignore,no_run
25127 /// # use google_cloud_sql_v1::model::Operation;
25128 /// use google_cloud_sql_v1::model::ApiWarning;
25129 /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
25130 /// ```
25131 pub fn set_api_warning<T>(mut self, v: T) -> Self
25132 where
25133 T: std::convert::Into<crate::model::ApiWarning>,
25134 {
25135 self.api_warning = std::option::Option::Some(v.into());
25136 self
25137 }
25138
25139 /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
25140 ///
25141 /// # Example
25142 /// ```ignore,no_run
25143 /// # use google_cloud_sql_v1::model::Operation;
25144 /// use google_cloud_sql_v1::model::ApiWarning;
25145 /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
25146 /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
25147 /// ```
25148 pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
25149 where
25150 T: std::convert::Into<crate::model::ApiWarning>,
25151 {
25152 self.api_warning = v.map(|x| x.into());
25153 self
25154 }
25155
25156 /// Sets the value of [operation_type][crate::model::Operation::operation_type].
25157 ///
25158 /// # Example
25159 /// ```ignore,no_run
25160 /// # use google_cloud_sql_v1::model::Operation;
25161 /// use google_cloud_sql_v1::model::operation::SqlOperationType;
25162 /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
25163 /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
25164 /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
25165 /// ```
25166 pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
25167 mut self,
25168 v: T,
25169 ) -> Self {
25170 self.operation_type = v.into();
25171 self
25172 }
25173
25174 /// Sets the value of [import_context][crate::model::Operation::import_context].
25175 ///
25176 /// # Example
25177 /// ```ignore,no_run
25178 /// # use google_cloud_sql_v1::model::Operation;
25179 /// use google_cloud_sql_v1::model::ImportContext;
25180 /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
25181 /// ```
25182 pub fn set_import_context<T>(mut self, v: T) -> Self
25183 where
25184 T: std::convert::Into<crate::model::ImportContext>,
25185 {
25186 self.import_context = std::option::Option::Some(v.into());
25187 self
25188 }
25189
25190 /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
25191 ///
25192 /// # Example
25193 /// ```ignore,no_run
25194 /// # use google_cloud_sql_v1::model::Operation;
25195 /// use google_cloud_sql_v1::model::ImportContext;
25196 /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
25197 /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
25198 /// ```
25199 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
25200 where
25201 T: std::convert::Into<crate::model::ImportContext>,
25202 {
25203 self.import_context = v.map(|x| x.into());
25204 self
25205 }
25206
25207 /// Sets the value of [export_context][crate::model::Operation::export_context].
25208 ///
25209 /// # Example
25210 /// ```ignore,no_run
25211 /// # use google_cloud_sql_v1::model::Operation;
25212 /// use google_cloud_sql_v1::model::ExportContext;
25213 /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
25214 /// ```
25215 pub fn set_export_context<T>(mut self, v: T) -> Self
25216 where
25217 T: std::convert::Into<crate::model::ExportContext>,
25218 {
25219 self.export_context = std::option::Option::Some(v.into());
25220 self
25221 }
25222
25223 /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
25224 ///
25225 /// # Example
25226 /// ```ignore,no_run
25227 /// # use google_cloud_sql_v1::model::Operation;
25228 /// use google_cloud_sql_v1::model::ExportContext;
25229 /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
25230 /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
25231 /// ```
25232 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
25233 where
25234 T: std::convert::Into<crate::model::ExportContext>,
25235 {
25236 self.export_context = v.map(|x| x.into());
25237 self
25238 }
25239
25240 /// Sets the value of [backup_context][crate::model::Operation::backup_context].
25241 ///
25242 /// # Example
25243 /// ```ignore,no_run
25244 /// # use google_cloud_sql_v1::model::Operation;
25245 /// use google_cloud_sql_v1::model::BackupContext;
25246 /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
25247 /// ```
25248 pub fn set_backup_context<T>(mut self, v: T) -> Self
25249 where
25250 T: std::convert::Into<crate::model::BackupContext>,
25251 {
25252 self.backup_context = std::option::Option::Some(v.into());
25253 self
25254 }
25255
25256 /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
25257 ///
25258 /// # Example
25259 /// ```ignore,no_run
25260 /// # use google_cloud_sql_v1::model::Operation;
25261 /// use google_cloud_sql_v1::model::BackupContext;
25262 /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
25263 /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
25264 /// ```
25265 pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
25266 where
25267 T: std::convert::Into<crate::model::BackupContext>,
25268 {
25269 self.backup_context = v.map(|x| x.into());
25270 self
25271 }
25272
25273 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
25274 ///
25275 /// # Example
25276 /// ```ignore,no_run
25277 /// # use google_cloud_sql_v1::model::Operation;
25278 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
25279 /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
25280 /// ```
25281 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
25282 where
25283 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
25284 {
25285 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
25286 self
25287 }
25288
25289 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
25290 ///
25291 /// # Example
25292 /// ```ignore,no_run
25293 /// # use google_cloud_sql_v1::model::Operation;
25294 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
25295 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
25296 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
25297 /// ```
25298 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
25299 mut self,
25300 v: std::option::Option<T>,
25301 ) -> Self
25302 where
25303 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
25304 {
25305 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
25306 self
25307 }
25308
25309 /// Sets the value of [name][crate::model::Operation::name].
25310 ///
25311 /// # Example
25312 /// ```ignore,no_run
25313 /// # use google_cloud_sql_v1::model::Operation;
25314 /// let x = Operation::new().set_name("example");
25315 /// ```
25316 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25317 self.name = v.into();
25318 self
25319 }
25320
25321 /// Sets the value of [target_id][crate::model::Operation::target_id].
25322 ///
25323 /// # Example
25324 /// ```ignore,no_run
25325 /// # use google_cloud_sql_v1::model::Operation;
25326 /// let x = Operation::new().set_target_id("example");
25327 /// ```
25328 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25329 self.target_id = v.into();
25330 self
25331 }
25332
25333 /// Sets the value of [self_link][crate::model::Operation::self_link].
25334 ///
25335 /// # Example
25336 /// ```ignore,no_run
25337 /// # use google_cloud_sql_v1::model::Operation;
25338 /// let x = Operation::new().set_self_link("example");
25339 /// ```
25340 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25341 self.self_link = v.into();
25342 self
25343 }
25344
25345 /// Sets the value of [target_project][crate::model::Operation::target_project].
25346 ///
25347 /// # Example
25348 /// ```ignore,no_run
25349 /// # use google_cloud_sql_v1::model::Operation;
25350 /// let x = Operation::new().set_target_project("example");
25351 /// ```
25352 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25353 self.target_project = v.into();
25354 self
25355 }
25356
25357 /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
25358 ///
25359 /// # Example
25360 /// ```ignore,no_run
25361 /// # use google_cloud_sql_v1::model::Operation;
25362 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
25363 /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
25364 /// ```
25365 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
25366 where
25367 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
25368 {
25369 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
25370 self
25371 }
25372
25373 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
25374 ///
25375 /// # Example
25376 /// ```ignore,no_run
25377 /// # use google_cloud_sql_v1::model::Operation;
25378 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
25379 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
25380 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
25381 /// ```
25382 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
25383 where
25384 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
25385 {
25386 self.acquire_ssrs_lease_context = v.map(|x| x.into());
25387 self
25388 }
25389
25390 /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
25391 ///
25392 /// # Example
25393 /// ```ignore,no_run
25394 /// # use google_cloud_sql_v1::model::Operation;
25395 /// use google_cloud_sql_v1::model::SqlSubOperationType;
25396 /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
25397 /// ```
25398 pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
25399 where
25400 T: std::convert::Into<crate::model::SqlSubOperationType>,
25401 {
25402 self.sub_operation_type = std::option::Option::Some(v.into());
25403 self
25404 }
25405
25406 /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
25407 ///
25408 /// # Example
25409 /// ```ignore,no_run
25410 /// # use google_cloud_sql_v1::model::Operation;
25411 /// use google_cloud_sql_v1::model::SqlSubOperationType;
25412 /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
25413 /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
25414 /// ```
25415 pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
25416 where
25417 T: std::convert::Into<crate::model::SqlSubOperationType>,
25418 {
25419 self.sub_operation_type = v.map(|x| x.into());
25420 self
25421 }
25422}
25423
25424impl wkt::message::Message for Operation {
25425 fn typename() -> &'static str {
25426 "type.googleapis.com/google.cloud.sql.v1.Operation"
25427 }
25428}
25429
25430/// Defines additional types related to [Operation].
25431pub mod operation {
25432 #[allow(unused_imports)]
25433 use super::*;
25434
25435 /// The type of Cloud SQL operation.
25436 ///
25437 /// # Working with unknown values
25438 ///
25439 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25440 /// additional enum variants at any time. Adding new variants is not considered
25441 /// a breaking change. Applications should write their code in anticipation of:
25442 ///
25443 /// - New values appearing in future releases of the client library, **and**
25444 /// - New values received dynamically, without application changes.
25445 ///
25446 /// Please consult the [Working with enums] section in the user guide for some
25447 /// guidelines.
25448 ///
25449 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25450 #[derive(Clone, Debug, PartialEq)]
25451 #[non_exhaustive]
25452 pub enum SqlOperationType {
25453 /// Unknown operation type.
25454 Unspecified,
25455 /// Imports data into a Cloud SQL instance.
25456 Import,
25457 /// Exports data from a Cloud SQL instance to a Cloud Storage
25458 /// bucket.
25459 Export,
25460 /// Creates a new Cloud SQL instance.
25461 Create,
25462 /// Updates the settings of a Cloud SQL instance.
25463 Update,
25464 /// Deletes a Cloud SQL instance.
25465 Delete,
25466 /// Restarts the Cloud SQL instance.
25467 Restart,
25468 #[allow(missing_docs)]
25469 #[deprecated]
25470 Backup,
25471 #[allow(missing_docs)]
25472 #[deprecated]
25473 Snapshot,
25474 /// Performs instance backup.
25475 BackupVolume,
25476 /// Deletes an instance backup.
25477 DeleteVolume,
25478 /// Restores an instance backup.
25479 RestoreVolume,
25480 /// Injects a privileged user in mysql for MOB instances.
25481 InjectUser,
25482 /// Clones a Cloud SQL instance.
25483 Clone,
25484 /// Stops replication on a Cloud SQL read replica instance.
25485 StopReplica,
25486 /// Starts replication on a Cloud SQL read replica instance.
25487 StartReplica,
25488 /// Promotes a Cloud SQL replica instance.
25489 PromoteReplica,
25490 /// Creates a Cloud SQL replica instance.
25491 CreateReplica,
25492 /// Creates a new user in a Cloud SQL instance.
25493 CreateUser,
25494 /// Deletes a user from a Cloud SQL instance.
25495 DeleteUser,
25496 /// Updates an existing user in a Cloud SQL instance. If a user with the
25497 /// specified username doesn't exist, a new user is created.
25498 UpdateUser,
25499 /// Creates a database in the Cloud SQL instance.
25500 CreateDatabase,
25501 /// Deletes a database in the Cloud SQL instance.
25502 DeleteDatabase,
25503 /// Updates a database in the Cloud SQL instance.
25504 UpdateDatabase,
25505 /// Performs failover of an HA-enabled Cloud SQL
25506 /// failover replica.
25507 Failover,
25508 /// Deletes the backup taken by a backup run.
25509 DeleteBackup,
25510 #[allow(missing_docs)]
25511 RecreateReplica,
25512 /// Truncates a general or slow log table in MySQL.
25513 TruncateLog,
25514 /// Demotes the stand-alone instance to be a Cloud SQL
25515 /// read replica for an external database server.
25516 DemoteMaster,
25517 /// Indicates that the instance is currently in maintenance. Maintenance
25518 /// typically causes the instance to be unavailable for 1-3 minutes.
25519 Maintenance,
25520 /// This field is deprecated, and will be removed in future version of API.
25521 #[deprecated]
25522 EnablePrivateIp,
25523 #[allow(missing_docs)]
25524 #[deprecated]
25525 DeferMaintenance,
25526 /// Creates clone instance.
25527 #[deprecated]
25528 CreateClone,
25529 /// Reschedule maintenance to another time.
25530 RescheduleMaintenance,
25531 /// Starts external sync of a Cloud SQL EM replica to an external primary
25532 /// instance.
25533 StartExternalSync,
25534 /// Recovers logs from an instance's old data disk.
25535 LogCleanup,
25536 /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
25537 /// recovery.
25538 AutoRestart,
25539 /// Re-encrypts CMEK instances with latest key version.
25540 Reencrypt,
25541 /// Switches the roles of the primary and replica pair. The target instance
25542 /// should be the replica.
25543 Switchover,
25544 /// Update a backup.
25545 UpdateBackup,
25546 /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
25547 AcquireSsrsLease,
25548 /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
25549 ReleaseSsrsLease,
25550 /// Reconfigures old primary after a promote replica operation. Effect of a
25551 /// promote operation to the old primary is executed in this operation,
25552 /// asynchronously from the promote replica operation executed to the
25553 /// replica.
25554 ReconfigureOldPrimary,
25555 /// Indicates that the instance, its read replicas, and its cascading
25556 /// replicas are in maintenance. Maintenance typically gets initiated on
25557 /// groups of replicas first, followed by the primary instance. For each
25558 /// instance, maintenance typically causes the instance to be unavailable for
25559 /// 1-3 minutes.
25560 #[deprecated]
25561 ClusterMaintenance,
25562 /// Indicates that the instance (and any of its replicas) are currently in
25563 /// maintenance. This is initiated as a self-service request by using SSM.
25564 /// Maintenance typically causes the instance to be unavailable for 1-3
25565 /// minutes.
25566 #[deprecated]
25567 SelfServiceMaintenance,
25568 /// Switches a primary instance to a replica. This operation runs as part of
25569 /// a switchover operation to the original primary instance.
25570 SwitchoverToReplica,
25571 /// Updates the major version of a Cloud SQL instance.
25572 MajorVersionUpgrade,
25573 /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
25574 #[deprecated]
25575 AdvancedBackup,
25576 /// Changes the BackupTier of a Cloud SQL instance.
25577 ManageBackup,
25578 /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
25579 EnhancedBackup,
25580 /// Repairs entire read pool or specified read pool nodes in the read pool.
25581 RepairReadPool,
25582 /// Creates a Cloud SQL read pool instance.
25583 CreateReadPool,
25584 /// Pre-checks the major version upgrade operation.
25585 PreCheckMajorVersionUpgrade,
25586 /// This operation type represents individual steps in a multi-step setup
25587 /// migration workflow: including configuration, replication,
25588 /// switchover/back, and data reseeding, as defined by operation's intent.
25589 SetupMigration,
25590 /// If set, the enum was initialized with an unknown value.
25591 ///
25592 /// Applications can examine the value using [SqlOperationType::value] or
25593 /// [SqlOperationType::name].
25594 UnknownValue(sql_operation_type::UnknownValue),
25595 }
25596
25597 #[doc(hidden)]
25598 pub mod sql_operation_type {
25599 #[allow(unused_imports)]
25600 use super::*;
25601 #[derive(Clone, Debug, PartialEq)]
25602 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25603 }
25604
25605 impl SqlOperationType {
25606 /// Gets the enum value.
25607 ///
25608 /// Returns `None` if the enum contains an unknown value deserialized from
25609 /// the string representation of enums.
25610 pub fn value(&self) -> std::option::Option<i32> {
25611 match self {
25612 Self::Unspecified => std::option::Option::Some(0),
25613 Self::Import => std::option::Option::Some(1),
25614 Self::Export => std::option::Option::Some(2),
25615 Self::Create => std::option::Option::Some(3),
25616 Self::Update => std::option::Option::Some(4),
25617 Self::Delete => std::option::Option::Some(5),
25618 Self::Restart => std::option::Option::Some(6),
25619 Self::Backup => std::option::Option::Some(7),
25620 Self::Snapshot => std::option::Option::Some(8),
25621 Self::BackupVolume => std::option::Option::Some(9),
25622 Self::DeleteVolume => std::option::Option::Some(10),
25623 Self::RestoreVolume => std::option::Option::Some(11),
25624 Self::InjectUser => std::option::Option::Some(12),
25625 Self::Clone => std::option::Option::Some(14),
25626 Self::StopReplica => std::option::Option::Some(15),
25627 Self::StartReplica => std::option::Option::Some(16),
25628 Self::PromoteReplica => std::option::Option::Some(17),
25629 Self::CreateReplica => std::option::Option::Some(18),
25630 Self::CreateUser => std::option::Option::Some(19),
25631 Self::DeleteUser => std::option::Option::Some(20),
25632 Self::UpdateUser => std::option::Option::Some(21),
25633 Self::CreateDatabase => std::option::Option::Some(22),
25634 Self::DeleteDatabase => std::option::Option::Some(23),
25635 Self::UpdateDatabase => std::option::Option::Some(24),
25636 Self::Failover => std::option::Option::Some(25),
25637 Self::DeleteBackup => std::option::Option::Some(26),
25638 Self::RecreateReplica => std::option::Option::Some(27),
25639 Self::TruncateLog => std::option::Option::Some(28),
25640 Self::DemoteMaster => std::option::Option::Some(29),
25641 Self::Maintenance => std::option::Option::Some(30),
25642 Self::EnablePrivateIp => std::option::Option::Some(31),
25643 Self::DeferMaintenance => std::option::Option::Some(32),
25644 Self::CreateClone => std::option::Option::Some(33),
25645 Self::RescheduleMaintenance => std::option::Option::Some(34),
25646 Self::StartExternalSync => std::option::Option::Some(35),
25647 Self::LogCleanup => std::option::Option::Some(36),
25648 Self::AutoRestart => std::option::Option::Some(37),
25649 Self::Reencrypt => std::option::Option::Some(38),
25650 Self::Switchover => std::option::Option::Some(39),
25651 Self::UpdateBackup => std::option::Option::Some(40),
25652 Self::AcquireSsrsLease => std::option::Option::Some(42),
25653 Self::ReleaseSsrsLease => std::option::Option::Some(43),
25654 Self::ReconfigureOldPrimary => std::option::Option::Some(44),
25655 Self::ClusterMaintenance => std::option::Option::Some(45),
25656 Self::SelfServiceMaintenance => std::option::Option::Some(46),
25657 Self::SwitchoverToReplica => std::option::Option::Some(47),
25658 Self::MajorVersionUpgrade => std::option::Option::Some(48),
25659 Self::AdvancedBackup => std::option::Option::Some(49),
25660 Self::ManageBackup => std::option::Option::Some(50),
25661 Self::EnhancedBackup => std::option::Option::Some(51),
25662 Self::RepairReadPool => std::option::Option::Some(52),
25663 Self::CreateReadPool => std::option::Option::Some(53),
25664 Self::PreCheckMajorVersionUpgrade => std::option::Option::Some(54),
25665 Self::SetupMigration => std::option::Option::Some(55),
25666 Self::UnknownValue(u) => u.0.value(),
25667 }
25668 }
25669
25670 /// Gets the enum value as a string.
25671 ///
25672 /// Returns `None` if the enum contains an unknown value deserialized from
25673 /// the integer representation of enums.
25674 pub fn name(&self) -> std::option::Option<&str> {
25675 match self {
25676 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
25677 Self::Import => std::option::Option::Some("IMPORT"),
25678 Self::Export => std::option::Option::Some("EXPORT"),
25679 Self::Create => std::option::Option::Some("CREATE"),
25680 Self::Update => std::option::Option::Some("UPDATE"),
25681 Self::Delete => std::option::Option::Some("DELETE"),
25682 Self::Restart => std::option::Option::Some("RESTART"),
25683 Self::Backup => std::option::Option::Some("BACKUP"),
25684 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
25685 Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
25686 Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
25687 Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
25688 Self::InjectUser => std::option::Option::Some("INJECT_USER"),
25689 Self::Clone => std::option::Option::Some("CLONE"),
25690 Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
25691 Self::StartReplica => std::option::Option::Some("START_REPLICA"),
25692 Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
25693 Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
25694 Self::CreateUser => std::option::Option::Some("CREATE_USER"),
25695 Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
25696 Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
25697 Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
25698 Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
25699 Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
25700 Self::Failover => std::option::Option::Some("FAILOVER"),
25701 Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
25702 Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
25703 Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
25704 Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
25705 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
25706 Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
25707 Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
25708 Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
25709 Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
25710 Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
25711 Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
25712 Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
25713 Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
25714 Self::Switchover => std::option::Option::Some("SWITCHOVER"),
25715 Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
25716 Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
25717 Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
25718 Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
25719 Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
25720 Self::SelfServiceMaintenance => {
25721 std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
25722 }
25723 Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
25724 Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
25725 Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
25726 Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
25727 Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
25728 Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
25729 Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
25730 Self::PreCheckMajorVersionUpgrade => {
25731 std::option::Option::Some("PRE_CHECK_MAJOR_VERSION_UPGRADE")
25732 }
25733 Self::SetupMigration => std::option::Option::Some("SETUP_MIGRATION"),
25734 Self::UnknownValue(u) => u.0.name(),
25735 }
25736 }
25737 }
25738
25739 impl std::default::Default for SqlOperationType {
25740 fn default() -> Self {
25741 use std::convert::From;
25742 Self::from(0)
25743 }
25744 }
25745
25746 impl std::fmt::Display for SqlOperationType {
25747 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25748 wkt::internal::display_enum(f, self.name(), self.value())
25749 }
25750 }
25751
25752 impl std::convert::From<i32> for SqlOperationType {
25753 fn from(value: i32) -> Self {
25754 match value {
25755 0 => Self::Unspecified,
25756 1 => Self::Import,
25757 2 => Self::Export,
25758 3 => Self::Create,
25759 4 => Self::Update,
25760 5 => Self::Delete,
25761 6 => Self::Restart,
25762 7 => Self::Backup,
25763 8 => Self::Snapshot,
25764 9 => Self::BackupVolume,
25765 10 => Self::DeleteVolume,
25766 11 => Self::RestoreVolume,
25767 12 => Self::InjectUser,
25768 14 => Self::Clone,
25769 15 => Self::StopReplica,
25770 16 => Self::StartReplica,
25771 17 => Self::PromoteReplica,
25772 18 => Self::CreateReplica,
25773 19 => Self::CreateUser,
25774 20 => Self::DeleteUser,
25775 21 => Self::UpdateUser,
25776 22 => Self::CreateDatabase,
25777 23 => Self::DeleteDatabase,
25778 24 => Self::UpdateDatabase,
25779 25 => Self::Failover,
25780 26 => Self::DeleteBackup,
25781 27 => Self::RecreateReplica,
25782 28 => Self::TruncateLog,
25783 29 => Self::DemoteMaster,
25784 30 => Self::Maintenance,
25785 31 => Self::EnablePrivateIp,
25786 32 => Self::DeferMaintenance,
25787 33 => Self::CreateClone,
25788 34 => Self::RescheduleMaintenance,
25789 35 => Self::StartExternalSync,
25790 36 => Self::LogCleanup,
25791 37 => Self::AutoRestart,
25792 38 => Self::Reencrypt,
25793 39 => Self::Switchover,
25794 40 => Self::UpdateBackup,
25795 42 => Self::AcquireSsrsLease,
25796 43 => Self::ReleaseSsrsLease,
25797 44 => Self::ReconfigureOldPrimary,
25798 45 => Self::ClusterMaintenance,
25799 46 => Self::SelfServiceMaintenance,
25800 47 => Self::SwitchoverToReplica,
25801 48 => Self::MajorVersionUpgrade,
25802 49 => Self::AdvancedBackup,
25803 50 => Self::ManageBackup,
25804 51 => Self::EnhancedBackup,
25805 52 => Self::RepairReadPool,
25806 53 => Self::CreateReadPool,
25807 54 => Self::PreCheckMajorVersionUpgrade,
25808 55 => Self::SetupMigration,
25809 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25810 wkt::internal::UnknownEnumValue::Integer(value),
25811 )),
25812 }
25813 }
25814 }
25815
25816 impl std::convert::From<&str> for SqlOperationType {
25817 fn from(value: &str) -> Self {
25818 use std::string::ToString;
25819 match value {
25820 "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
25821 "IMPORT" => Self::Import,
25822 "EXPORT" => Self::Export,
25823 "CREATE" => Self::Create,
25824 "UPDATE" => Self::Update,
25825 "DELETE" => Self::Delete,
25826 "RESTART" => Self::Restart,
25827 "BACKUP" => Self::Backup,
25828 "SNAPSHOT" => Self::Snapshot,
25829 "BACKUP_VOLUME" => Self::BackupVolume,
25830 "DELETE_VOLUME" => Self::DeleteVolume,
25831 "RESTORE_VOLUME" => Self::RestoreVolume,
25832 "INJECT_USER" => Self::InjectUser,
25833 "CLONE" => Self::Clone,
25834 "STOP_REPLICA" => Self::StopReplica,
25835 "START_REPLICA" => Self::StartReplica,
25836 "PROMOTE_REPLICA" => Self::PromoteReplica,
25837 "CREATE_REPLICA" => Self::CreateReplica,
25838 "CREATE_USER" => Self::CreateUser,
25839 "DELETE_USER" => Self::DeleteUser,
25840 "UPDATE_USER" => Self::UpdateUser,
25841 "CREATE_DATABASE" => Self::CreateDatabase,
25842 "DELETE_DATABASE" => Self::DeleteDatabase,
25843 "UPDATE_DATABASE" => Self::UpdateDatabase,
25844 "FAILOVER" => Self::Failover,
25845 "DELETE_BACKUP" => Self::DeleteBackup,
25846 "RECREATE_REPLICA" => Self::RecreateReplica,
25847 "TRUNCATE_LOG" => Self::TruncateLog,
25848 "DEMOTE_MASTER" => Self::DemoteMaster,
25849 "MAINTENANCE" => Self::Maintenance,
25850 "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
25851 "DEFER_MAINTENANCE" => Self::DeferMaintenance,
25852 "CREATE_CLONE" => Self::CreateClone,
25853 "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
25854 "START_EXTERNAL_SYNC" => Self::StartExternalSync,
25855 "LOG_CLEANUP" => Self::LogCleanup,
25856 "AUTO_RESTART" => Self::AutoRestart,
25857 "REENCRYPT" => Self::Reencrypt,
25858 "SWITCHOVER" => Self::Switchover,
25859 "UPDATE_BACKUP" => Self::UpdateBackup,
25860 "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
25861 "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
25862 "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
25863 "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
25864 "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
25865 "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
25866 "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
25867 "ADVANCED_BACKUP" => Self::AdvancedBackup,
25868 "MANAGE_BACKUP" => Self::ManageBackup,
25869 "ENHANCED_BACKUP" => Self::EnhancedBackup,
25870 "REPAIR_READ_POOL" => Self::RepairReadPool,
25871 "CREATE_READ_POOL" => Self::CreateReadPool,
25872 "PRE_CHECK_MAJOR_VERSION_UPGRADE" => Self::PreCheckMajorVersionUpgrade,
25873 "SETUP_MIGRATION" => Self::SetupMigration,
25874 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25875 wkt::internal::UnknownEnumValue::String(value.to_string()),
25876 )),
25877 }
25878 }
25879 }
25880
25881 impl serde::ser::Serialize for SqlOperationType {
25882 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25883 where
25884 S: serde::Serializer,
25885 {
25886 match self {
25887 Self::Unspecified => serializer.serialize_i32(0),
25888 Self::Import => serializer.serialize_i32(1),
25889 Self::Export => serializer.serialize_i32(2),
25890 Self::Create => serializer.serialize_i32(3),
25891 Self::Update => serializer.serialize_i32(4),
25892 Self::Delete => serializer.serialize_i32(5),
25893 Self::Restart => serializer.serialize_i32(6),
25894 Self::Backup => serializer.serialize_i32(7),
25895 Self::Snapshot => serializer.serialize_i32(8),
25896 Self::BackupVolume => serializer.serialize_i32(9),
25897 Self::DeleteVolume => serializer.serialize_i32(10),
25898 Self::RestoreVolume => serializer.serialize_i32(11),
25899 Self::InjectUser => serializer.serialize_i32(12),
25900 Self::Clone => serializer.serialize_i32(14),
25901 Self::StopReplica => serializer.serialize_i32(15),
25902 Self::StartReplica => serializer.serialize_i32(16),
25903 Self::PromoteReplica => serializer.serialize_i32(17),
25904 Self::CreateReplica => serializer.serialize_i32(18),
25905 Self::CreateUser => serializer.serialize_i32(19),
25906 Self::DeleteUser => serializer.serialize_i32(20),
25907 Self::UpdateUser => serializer.serialize_i32(21),
25908 Self::CreateDatabase => serializer.serialize_i32(22),
25909 Self::DeleteDatabase => serializer.serialize_i32(23),
25910 Self::UpdateDatabase => serializer.serialize_i32(24),
25911 Self::Failover => serializer.serialize_i32(25),
25912 Self::DeleteBackup => serializer.serialize_i32(26),
25913 Self::RecreateReplica => serializer.serialize_i32(27),
25914 Self::TruncateLog => serializer.serialize_i32(28),
25915 Self::DemoteMaster => serializer.serialize_i32(29),
25916 Self::Maintenance => serializer.serialize_i32(30),
25917 Self::EnablePrivateIp => serializer.serialize_i32(31),
25918 Self::DeferMaintenance => serializer.serialize_i32(32),
25919 Self::CreateClone => serializer.serialize_i32(33),
25920 Self::RescheduleMaintenance => serializer.serialize_i32(34),
25921 Self::StartExternalSync => serializer.serialize_i32(35),
25922 Self::LogCleanup => serializer.serialize_i32(36),
25923 Self::AutoRestart => serializer.serialize_i32(37),
25924 Self::Reencrypt => serializer.serialize_i32(38),
25925 Self::Switchover => serializer.serialize_i32(39),
25926 Self::UpdateBackup => serializer.serialize_i32(40),
25927 Self::AcquireSsrsLease => serializer.serialize_i32(42),
25928 Self::ReleaseSsrsLease => serializer.serialize_i32(43),
25929 Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
25930 Self::ClusterMaintenance => serializer.serialize_i32(45),
25931 Self::SelfServiceMaintenance => serializer.serialize_i32(46),
25932 Self::SwitchoverToReplica => serializer.serialize_i32(47),
25933 Self::MajorVersionUpgrade => serializer.serialize_i32(48),
25934 Self::AdvancedBackup => serializer.serialize_i32(49),
25935 Self::ManageBackup => serializer.serialize_i32(50),
25936 Self::EnhancedBackup => serializer.serialize_i32(51),
25937 Self::RepairReadPool => serializer.serialize_i32(52),
25938 Self::CreateReadPool => serializer.serialize_i32(53),
25939 Self::PreCheckMajorVersionUpgrade => serializer.serialize_i32(54),
25940 Self::SetupMigration => serializer.serialize_i32(55),
25941 Self::UnknownValue(u) => u.0.serialize(serializer),
25942 }
25943 }
25944 }
25945
25946 impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
25947 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25948 where
25949 D: serde::Deserializer<'de>,
25950 {
25951 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
25952 ".google.cloud.sql.v1.Operation.SqlOperationType",
25953 ))
25954 }
25955 }
25956
25957 /// The status of an operation.
25958 ///
25959 /// # Working with unknown values
25960 ///
25961 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25962 /// additional enum variants at any time. Adding new variants is not considered
25963 /// a breaking change. Applications should write their code in anticipation of:
25964 ///
25965 /// - New values appearing in future releases of the client library, **and**
25966 /// - New values received dynamically, without application changes.
25967 ///
25968 /// Please consult the [Working with enums] section in the user guide for some
25969 /// guidelines.
25970 ///
25971 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25972 #[derive(Clone, Debug, PartialEq)]
25973 #[non_exhaustive]
25974 pub enum SqlOperationStatus {
25975 /// The state of the operation is unknown.
25976 Unspecified,
25977 /// The operation has been queued, but has not started yet.
25978 Pending,
25979 /// The operation is running.
25980 Running,
25981 /// The operation completed.
25982 Done,
25983 /// If set, the enum was initialized with an unknown value.
25984 ///
25985 /// Applications can examine the value using [SqlOperationStatus::value] or
25986 /// [SqlOperationStatus::name].
25987 UnknownValue(sql_operation_status::UnknownValue),
25988 }
25989
25990 #[doc(hidden)]
25991 pub mod sql_operation_status {
25992 #[allow(unused_imports)]
25993 use super::*;
25994 #[derive(Clone, Debug, PartialEq)]
25995 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25996 }
25997
25998 impl SqlOperationStatus {
25999 /// Gets the enum value.
26000 ///
26001 /// Returns `None` if the enum contains an unknown value deserialized from
26002 /// the string representation of enums.
26003 pub fn value(&self) -> std::option::Option<i32> {
26004 match self {
26005 Self::Unspecified => std::option::Option::Some(0),
26006 Self::Pending => std::option::Option::Some(1),
26007 Self::Running => std::option::Option::Some(2),
26008 Self::Done => std::option::Option::Some(3),
26009 Self::UnknownValue(u) => u.0.value(),
26010 }
26011 }
26012
26013 /// Gets the enum value as a string.
26014 ///
26015 /// Returns `None` if the enum contains an unknown value deserialized from
26016 /// the integer representation of enums.
26017 pub fn name(&self) -> std::option::Option<&str> {
26018 match self {
26019 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
26020 Self::Pending => std::option::Option::Some("PENDING"),
26021 Self::Running => std::option::Option::Some("RUNNING"),
26022 Self::Done => std::option::Option::Some("DONE"),
26023 Self::UnknownValue(u) => u.0.name(),
26024 }
26025 }
26026 }
26027
26028 impl std::default::Default for SqlOperationStatus {
26029 fn default() -> Self {
26030 use std::convert::From;
26031 Self::from(0)
26032 }
26033 }
26034
26035 impl std::fmt::Display for SqlOperationStatus {
26036 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26037 wkt::internal::display_enum(f, self.name(), self.value())
26038 }
26039 }
26040
26041 impl std::convert::From<i32> for SqlOperationStatus {
26042 fn from(value: i32) -> Self {
26043 match value {
26044 0 => Self::Unspecified,
26045 1 => Self::Pending,
26046 2 => Self::Running,
26047 3 => Self::Done,
26048 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
26049 wkt::internal::UnknownEnumValue::Integer(value),
26050 )),
26051 }
26052 }
26053 }
26054
26055 impl std::convert::From<&str> for SqlOperationStatus {
26056 fn from(value: &str) -> Self {
26057 use std::string::ToString;
26058 match value {
26059 "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
26060 "PENDING" => Self::Pending,
26061 "RUNNING" => Self::Running,
26062 "DONE" => Self::Done,
26063 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
26064 wkt::internal::UnknownEnumValue::String(value.to_string()),
26065 )),
26066 }
26067 }
26068 }
26069
26070 impl serde::ser::Serialize for SqlOperationStatus {
26071 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26072 where
26073 S: serde::Serializer,
26074 {
26075 match self {
26076 Self::Unspecified => serializer.serialize_i32(0),
26077 Self::Pending => serializer.serialize_i32(1),
26078 Self::Running => serializer.serialize_i32(2),
26079 Self::Done => serializer.serialize_i32(3),
26080 Self::UnknownValue(u) => u.0.serialize(serializer),
26081 }
26082 }
26083 }
26084
26085 impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
26086 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26087 where
26088 D: serde::Deserializer<'de>,
26089 {
26090 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
26091 ".google.cloud.sql.v1.Operation.SqlOperationStatus",
26092 ))
26093 }
26094 }
26095}
26096
26097/// Database instance operation error.
26098#[derive(Clone, Default, PartialEq)]
26099#[non_exhaustive]
26100pub struct OperationError {
26101 /// This is always `sql#operationError`.
26102 pub kind: std::string::String,
26103
26104 /// Identifies the specific error that occurred.
26105 pub code: std::string::String,
26106
26107 /// Additional information about the error encountered.
26108 pub message: std::string::String,
26109
26110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26111}
26112
26113impl OperationError {
26114 /// Creates a new default instance.
26115 pub fn new() -> Self {
26116 std::default::Default::default()
26117 }
26118
26119 /// Sets the value of [kind][crate::model::OperationError::kind].
26120 ///
26121 /// # Example
26122 /// ```ignore,no_run
26123 /// # use google_cloud_sql_v1::model::OperationError;
26124 /// let x = OperationError::new().set_kind("example");
26125 /// ```
26126 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26127 self.kind = v.into();
26128 self
26129 }
26130
26131 /// Sets the value of [code][crate::model::OperationError::code].
26132 ///
26133 /// # Example
26134 /// ```ignore,no_run
26135 /// # use google_cloud_sql_v1::model::OperationError;
26136 /// let x = OperationError::new().set_code("example");
26137 /// ```
26138 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26139 self.code = v.into();
26140 self
26141 }
26142
26143 /// Sets the value of [message][crate::model::OperationError::message].
26144 ///
26145 /// # Example
26146 /// ```ignore,no_run
26147 /// # use google_cloud_sql_v1::model::OperationError;
26148 /// let x = OperationError::new().set_message("example");
26149 /// ```
26150 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26151 self.message = v.into();
26152 self
26153 }
26154}
26155
26156impl wkt::message::Message for OperationError {
26157 fn typename() -> &'static str {
26158 "type.googleapis.com/google.cloud.sql.v1.OperationError"
26159 }
26160}
26161
26162/// Database instance operation errors list wrapper.
26163#[derive(Clone, Default, PartialEq)]
26164#[non_exhaustive]
26165pub struct OperationErrors {
26166 /// This is always `sql#operationErrors`.
26167 pub kind: std::string::String,
26168
26169 /// The list of errors encountered while processing this operation.
26170 pub errors: std::vec::Vec<crate::model::OperationError>,
26171
26172 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26173}
26174
26175impl OperationErrors {
26176 /// Creates a new default instance.
26177 pub fn new() -> Self {
26178 std::default::Default::default()
26179 }
26180
26181 /// Sets the value of [kind][crate::model::OperationErrors::kind].
26182 ///
26183 /// # Example
26184 /// ```ignore,no_run
26185 /// # use google_cloud_sql_v1::model::OperationErrors;
26186 /// let x = OperationErrors::new().set_kind("example");
26187 /// ```
26188 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26189 self.kind = v.into();
26190 self
26191 }
26192
26193 /// Sets the value of [errors][crate::model::OperationErrors::errors].
26194 ///
26195 /// # Example
26196 /// ```ignore,no_run
26197 /// # use google_cloud_sql_v1::model::OperationErrors;
26198 /// use google_cloud_sql_v1::model::OperationError;
26199 /// let x = OperationErrors::new()
26200 /// .set_errors([
26201 /// OperationError::default()/* use setters */,
26202 /// OperationError::default()/* use (different) setters */,
26203 /// ]);
26204 /// ```
26205 pub fn set_errors<T, V>(mut self, v: T) -> Self
26206 where
26207 T: std::iter::IntoIterator<Item = V>,
26208 V: std::convert::Into<crate::model::OperationError>,
26209 {
26210 use std::iter::Iterator;
26211 self.errors = v.into_iter().map(|i| i.into()).collect();
26212 self
26213 }
26214}
26215
26216impl wkt::message::Message for OperationErrors {
26217 fn typename() -> &'static str {
26218 "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
26219 }
26220}
26221
26222/// Database instance local user password validation policy.
26223/// This message defines the password policy for local database users.
26224/// When enabled, it enforces constraints on password complexity, length,
26225/// and reuse. Keep this policy enabled to help prevent unauthorized access.
26226#[derive(Clone, Default, PartialEq)]
26227#[non_exhaustive]
26228pub struct PasswordValidationPolicy {
26229 /// Minimum number of characters allowed.
26230 pub min_length: std::option::Option<wkt::Int32Value>,
26231
26232 /// The complexity of the password.
26233 pub complexity: crate::model::password_validation_policy::Complexity,
26234
26235 /// Number of previous passwords that cannot be reused.
26236 pub reuse_interval: std::option::Option<wkt::Int32Value>,
26237
26238 /// Disallow username as a part of the password.
26239 pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
26240
26241 /// Minimum interval after which the password can be changed. This flag is only
26242 /// supported for PostgreSQL.
26243 pub password_change_interval: std::option::Option<wkt::Duration>,
26244
26245 /// Whether to enable the password policy or not. When enabled, passwords must
26246 /// meet complexity requirements. Keep this policy enabled to help prevent
26247 /// unauthorized access. Disabling this policy allows weak passwords.
26248 pub enable_password_policy: std::option::Option<wkt::BoolValue>,
26249
26250 /// This field is deprecated and will be removed in a future version of the
26251 /// API.
26252 #[deprecated]
26253 pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
26254
26255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26256}
26257
26258impl PasswordValidationPolicy {
26259 /// Creates a new default instance.
26260 pub fn new() -> Self {
26261 std::default::Default::default()
26262 }
26263
26264 /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
26265 ///
26266 /// # Example
26267 /// ```ignore,no_run
26268 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26269 /// use wkt::Int32Value;
26270 /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
26271 /// ```
26272 pub fn set_min_length<T>(mut self, v: T) -> Self
26273 where
26274 T: std::convert::Into<wkt::Int32Value>,
26275 {
26276 self.min_length = std::option::Option::Some(v.into());
26277 self
26278 }
26279
26280 /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
26281 ///
26282 /// # Example
26283 /// ```ignore,no_run
26284 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26285 /// use wkt::Int32Value;
26286 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
26287 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
26288 /// ```
26289 pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
26290 where
26291 T: std::convert::Into<wkt::Int32Value>,
26292 {
26293 self.min_length = v.map(|x| x.into());
26294 self
26295 }
26296
26297 /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
26298 ///
26299 /// # Example
26300 /// ```ignore,no_run
26301 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26302 /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
26303 /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
26304 /// ```
26305 pub fn set_complexity<
26306 T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
26307 >(
26308 mut self,
26309 v: T,
26310 ) -> Self {
26311 self.complexity = v.into();
26312 self
26313 }
26314
26315 /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
26316 ///
26317 /// # Example
26318 /// ```ignore,no_run
26319 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26320 /// use wkt::Int32Value;
26321 /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
26322 /// ```
26323 pub fn set_reuse_interval<T>(mut self, v: T) -> Self
26324 where
26325 T: std::convert::Into<wkt::Int32Value>,
26326 {
26327 self.reuse_interval = std::option::Option::Some(v.into());
26328 self
26329 }
26330
26331 /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
26332 ///
26333 /// # Example
26334 /// ```ignore,no_run
26335 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26336 /// use wkt::Int32Value;
26337 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
26338 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
26339 /// ```
26340 pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
26341 where
26342 T: std::convert::Into<wkt::Int32Value>,
26343 {
26344 self.reuse_interval = v.map(|x| x.into());
26345 self
26346 }
26347
26348 /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
26349 ///
26350 /// # Example
26351 /// ```ignore,no_run
26352 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26353 /// use wkt::BoolValue;
26354 /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
26355 /// ```
26356 pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
26357 where
26358 T: std::convert::Into<wkt::BoolValue>,
26359 {
26360 self.disallow_username_substring = std::option::Option::Some(v.into());
26361 self
26362 }
26363
26364 /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
26365 ///
26366 /// # Example
26367 /// ```ignore,no_run
26368 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26369 /// use wkt::BoolValue;
26370 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
26371 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
26372 /// ```
26373 pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
26374 where
26375 T: std::convert::Into<wkt::BoolValue>,
26376 {
26377 self.disallow_username_substring = v.map(|x| x.into());
26378 self
26379 }
26380
26381 /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
26382 ///
26383 /// # Example
26384 /// ```ignore,no_run
26385 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26386 /// use wkt::Duration;
26387 /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
26388 /// ```
26389 pub fn set_password_change_interval<T>(mut self, v: T) -> Self
26390 where
26391 T: std::convert::Into<wkt::Duration>,
26392 {
26393 self.password_change_interval = std::option::Option::Some(v.into());
26394 self
26395 }
26396
26397 /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
26398 ///
26399 /// # Example
26400 /// ```ignore,no_run
26401 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26402 /// use wkt::Duration;
26403 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
26404 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
26405 /// ```
26406 pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
26407 where
26408 T: std::convert::Into<wkt::Duration>,
26409 {
26410 self.password_change_interval = v.map(|x| x.into());
26411 self
26412 }
26413
26414 /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
26415 ///
26416 /// # Example
26417 /// ```ignore,no_run
26418 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26419 /// use wkt::BoolValue;
26420 /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
26421 /// ```
26422 pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
26423 where
26424 T: std::convert::Into<wkt::BoolValue>,
26425 {
26426 self.enable_password_policy = std::option::Option::Some(v.into());
26427 self
26428 }
26429
26430 /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
26431 ///
26432 /// # Example
26433 /// ```ignore,no_run
26434 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26435 /// use wkt::BoolValue;
26436 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
26437 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
26438 /// ```
26439 pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
26440 where
26441 T: std::convert::Into<wkt::BoolValue>,
26442 {
26443 self.enable_password_policy = v.map(|x| x.into());
26444 self
26445 }
26446
26447 /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
26448 ///
26449 /// # Example
26450 /// ```ignore,no_run
26451 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26452 /// use wkt::BoolValue;
26453 /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
26454 /// ```
26455 #[deprecated]
26456 pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
26457 where
26458 T: std::convert::Into<wkt::BoolValue>,
26459 {
26460 self.disallow_compromised_credentials = std::option::Option::Some(v.into());
26461 self
26462 }
26463
26464 /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
26465 ///
26466 /// # Example
26467 /// ```ignore,no_run
26468 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26469 /// use wkt::BoolValue;
26470 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
26471 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
26472 /// ```
26473 #[deprecated]
26474 pub fn set_or_clear_disallow_compromised_credentials<T>(
26475 mut self,
26476 v: std::option::Option<T>,
26477 ) -> Self
26478 where
26479 T: std::convert::Into<wkt::BoolValue>,
26480 {
26481 self.disallow_compromised_credentials = v.map(|x| x.into());
26482 self
26483 }
26484}
26485
26486impl wkt::message::Message for PasswordValidationPolicy {
26487 fn typename() -> &'static str {
26488 "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
26489 }
26490}
26491
26492/// Defines additional types related to [PasswordValidationPolicy].
26493pub mod password_validation_policy {
26494 #[allow(unused_imports)]
26495 use super::*;
26496
26497 /// The complexity choices of the password.
26498 ///
26499 /// # Working with unknown values
26500 ///
26501 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26502 /// additional enum variants at any time. Adding new variants is not considered
26503 /// a breaking change. Applications should write their code in anticipation of:
26504 ///
26505 /// - New values appearing in future releases of the client library, **and**
26506 /// - New values received dynamically, without application changes.
26507 ///
26508 /// Please consult the [Working with enums] section in the user guide for some
26509 /// guidelines.
26510 ///
26511 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26512 #[derive(Clone, Debug, PartialEq)]
26513 #[non_exhaustive]
26514 pub enum Complexity {
26515 /// Complexity check is not specified.
26516 Unspecified,
26517 /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
26518 /// characters.
26519 Default,
26520 /// If set, the enum was initialized with an unknown value.
26521 ///
26522 /// Applications can examine the value using [Complexity::value] or
26523 /// [Complexity::name].
26524 UnknownValue(complexity::UnknownValue),
26525 }
26526
26527 #[doc(hidden)]
26528 pub mod complexity {
26529 #[allow(unused_imports)]
26530 use super::*;
26531 #[derive(Clone, Debug, PartialEq)]
26532 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26533 }
26534
26535 impl Complexity {
26536 /// Gets the enum value.
26537 ///
26538 /// Returns `None` if the enum contains an unknown value deserialized from
26539 /// the string representation of enums.
26540 pub fn value(&self) -> std::option::Option<i32> {
26541 match self {
26542 Self::Unspecified => std::option::Option::Some(0),
26543 Self::Default => std::option::Option::Some(1),
26544 Self::UnknownValue(u) => u.0.value(),
26545 }
26546 }
26547
26548 /// Gets the enum value as a string.
26549 ///
26550 /// Returns `None` if the enum contains an unknown value deserialized from
26551 /// the integer representation of enums.
26552 pub fn name(&self) -> std::option::Option<&str> {
26553 match self {
26554 Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
26555 Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
26556 Self::UnknownValue(u) => u.0.name(),
26557 }
26558 }
26559 }
26560
26561 impl std::default::Default for Complexity {
26562 fn default() -> Self {
26563 use std::convert::From;
26564 Self::from(0)
26565 }
26566 }
26567
26568 impl std::fmt::Display for Complexity {
26569 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26570 wkt::internal::display_enum(f, self.name(), self.value())
26571 }
26572 }
26573
26574 impl std::convert::From<i32> for Complexity {
26575 fn from(value: i32) -> Self {
26576 match value {
26577 0 => Self::Unspecified,
26578 1 => Self::Default,
26579 _ => Self::UnknownValue(complexity::UnknownValue(
26580 wkt::internal::UnknownEnumValue::Integer(value),
26581 )),
26582 }
26583 }
26584 }
26585
26586 impl std::convert::From<&str> for Complexity {
26587 fn from(value: &str) -> Self {
26588 use std::string::ToString;
26589 match value {
26590 "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
26591 "COMPLEXITY_DEFAULT" => Self::Default,
26592 _ => Self::UnknownValue(complexity::UnknownValue(
26593 wkt::internal::UnknownEnumValue::String(value.to_string()),
26594 )),
26595 }
26596 }
26597 }
26598
26599 impl serde::ser::Serialize for Complexity {
26600 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26601 where
26602 S: serde::Serializer,
26603 {
26604 match self {
26605 Self::Unspecified => serializer.serialize_i32(0),
26606 Self::Default => serializer.serialize_i32(1),
26607 Self::UnknownValue(u) => u.0.serialize(serializer),
26608 }
26609 }
26610 }
26611
26612 impl<'de> serde::de::Deserialize<'de> for Complexity {
26613 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26614 where
26615 D: serde::Deserializer<'de>,
26616 {
26617 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
26618 ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
26619 ))
26620 }
26621 }
26622}
26623
26624/// Data cache configurations.
26625#[derive(Clone, Default, PartialEq)]
26626#[non_exhaustive]
26627pub struct DataCacheConfig {
26628 /// Whether data cache is enabled for the instance.
26629 pub data_cache_enabled: bool,
26630
26631 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26632}
26633
26634impl DataCacheConfig {
26635 /// Creates a new default instance.
26636 pub fn new() -> Self {
26637 std::default::Default::default()
26638 }
26639
26640 /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
26641 ///
26642 /// # Example
26643 /// ```ignore,no_run
26644 /// # use google_cloud_sql_v1::model::DataCacheConfig;
26645 /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
26646 /// ```
26647 pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26648 self.data_cache_enabled = v.into();
26649 self
26650 }
26651}
26652
26653impl wkt::message::Message for DataCacheConfig {
26654 fn typename() -> &'static str {
26655 "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
26656 }
26657}
26658
26659/// Config used to determine the final backup settings for the instance.
26660#[derive(Clone, Default, PartialEq)]
26661#[non_exhaustive]
26662pub struct FinalBackupConfig {
26663 /// Whether the final backup is enabled for the instance.
26664 pub enabled: std::option::Option<bool>,
26665
26666 /// The number of days to retain the final backup after the instance deletion.
26667 /// The final backup will be purged at (time_of_instance_deletion +
26668 /// retention_days).
26669 pub retention_days: std::option::Option<i32>,
26670
26671 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26672}
26673
26674impl FinalBackupConfig {
26675 /// Creates a new default instance.
26676 pub fn new() -> Self {
26677 std::default::Default::default()
26678 }
26679
26680 /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
26681 ///
26682 /// # Example
26683 /// ```ignore,no_run
26684 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26685 /// let x = FinalBackupConfig::new().set_enabled(true);
26686 /// ```
26687 pub fn set_enabled<T>(mut self, v: T) -> Self
26688 where
26689 T: std::convert::Into<bool>,
26690 {
26691 self.enabled = std::option::Option::Some(v.into());
26692 self
26693 }
26694
26695 /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
26696 ///
26697 /// # Example
26698 /// ```ignore,no_run
26699 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26700 /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
26701 /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
26702 /// ```
26703 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26704 where
26705 T: std::convert::Into<bool>,
26706 {
26707 self.enabled = v.map(|x| x.into());
26708 self
26709 }
26710
26711 /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26712 ///
26713 /// # Example
26714 /// ```ignore,no_run
26715 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26716 /// let x = FinalBackupConfig::new().set_retention_days(42);
26717 /// ```
26718 pub fn set_retention_days<T>(mut self, v: T) -> Self
26719 where
26720 T: std::convert::Into<i32>,
26721 {
26722 self.retention_days = std::option::Option::Some(v.into());
26723 self
26724 }
26725
26726 /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26727 ///
26728 /// # Example
26729 /// ```ignore,no_run
26730 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26731 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
26732 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
26733 /// ```
26734 pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
26735 where
26736 T: std::convert::Into<i32>,
26737 {
26738 self.retention_days = v.map(|x| x.into());
26739 self
26740 }
26741}
26742
26743impl wkt::message::Message for FinalBackupConfig {
26744 fn typename() -> &'static str {
26745 "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
26746 }
26747}
26748
26749/// Database instance settings.
26750#[derive(Clone, Default, PartialEq)]
26751#[non_exhaustive]
26752pub struct Settings {
26753 /// The version of instance settings. This is a required field for update
26754 /// method to make sure concurrent updates are handled properly. During update,
26755 /// use the most recent settingsVersion value for this instance and do not try
26756 /// to update this value.
26757 pub settings_version: std::option::Option<wkt::Int64Value>,
26758
26759 /// The App Engine app IDs that can access this instance.
26760 /// (Deprecated) Applied to First Generation instances only.
26761 #[deprecated]
26762 pub authorized_gae_applications: std::vec::Vec<std::string::String>,
26763
26764 /// The tier (or machine type) for this instance, for example
26765 /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
26766 pub tier: std::string::String,
26767
26768 /// This is always `sql#settings`.
26769 pub kind: std::string::String,
26770
26771 /// User-provided labels, represented as a dictionary where each label is a
26772 /// single key value pair.
26773 pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
26774
26775 /// Availability type. Potential values:
26776 ///
26777 /// * `ZONAL`: The instance serves data from only one zone. Outages in that
26778 /// zone affect data accessibility.
26779 /// * `REGIONAL`: The instance can serve data from more than one zone in a
26780 /// region (it is highly available)./
26781 ///
26782 /// For more information, see [Overview of the High Availability
26783 /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
26784 pub availability_type: crate::model::SqlAvailabilityType,
26785
26786 /// The pricing plan for this instance. This can be either `PER_USE` or
26787 /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
26788 pub pricing_plan: crate::model::SqlPricingPlan,
26789
26790 /// The type of replication this instance uses. This can be either
26791 /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
26792 /// applicable to First Generation instances.
26793 #[deprecated]
26794 pub replication_type: crate::model::SqlReplicationType,
26795
26796 /// The maximum size to which storage capacity can be automatically increased.
26797 /// The default value is 0, which specifies that there is no limit.
26798 pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
26799
26800 /// The activation policy specifies when the instance is activated; it is
26801 /// applicable only when the instance state is RUNNABLE. Valid values:
26802 ///
26803 /// * `ALWAYS`: The instance is on, and remains so even in the absence of
26804 /// connection requests.
26805 /// * `NEVER`: The instance is off; it is not activated, even if a
26806 /// connection request arrives.
26807 pub activation_policy: crate::model::settings::SqlActivationPolicy,
26808
26809 /// The settings for IP Management. This allows to enable or disable the
26810 /// instance IP and manage which external networks can connect to the instance.
26811 /// The IPv4 address cannot be disabled for Second Generation instances.
26812 pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
26813
26814 /// Configuration to increase storage size automatically. The default value is
26815 /// true.
26816 pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
26817
26818 /// The location preference settings. This allows the instance to be located as
26819 /// near as possible to either an App Engine app or Compute Engine zone for
26820 /// better performance. App Engine co-location was only applicable to First
26821 /// Generation instances.
26822 pub location_preference: std::option::Option<crate::model::LocationPreference>,
26823
26824 /// The database flags passed to the instance at startup.
26825 pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
26826
26827 /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
26828 /// First Generation instances.
26829 pub data_disk_type: crate::model::SqlDataDiskType,
26830
26831 /// The maintenance window for this instance. This specifies when the instance
26832 /// can be restarted for maintenance purposes.
26833 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
26834
26835 /// The daily backup configuration for the instance.
26836 pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
26837
26838 /// Configuration specific to read replica instances. Indicates whether
26839 /// replication is enabled or not. WARNING: Changing this restarts the
26840 /// instance.
26841 pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
26842
26843 /// Configuration specific to read replica instances. Indicates whether
26844 /// database flags for crash-safe replication are enabled. This property was
26845 /// only applicable to First Generation instances.
26846 #[deprecated]
26847 pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
26848
26849 /// The size of data disk, in GB. The data disk size minimum is 10GB.
26850 pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
26851
26852 /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
26853 pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
26854
26855 /// The name of server Instance collation.
26856 pub collation: std::string::String,
26857
26858 /// Deny maintenance periods
26859 pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
26860
26861 /// Insights configuration, for now relevant only for Postgres.
26862 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
26863
26864 /// The local user password validation policy of the instance.
26865 pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
26866
26867 /// SQL Server specific audit configuration.
26868 pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
26869
26870 /// Optional. The edition type of the Cloud SQL instance.
26871 pub edition: crate::model::settings::Edition,
26872
26873 /// Specifies if connections must use Cloud SQL connectors.
26874 /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
26875 /// can be connected without Cloud SQL
26876 /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
26877 /// Connectors).
26878 ///
26879 /// Note that using REQUIRED disables all existing authorized networks. If
26880 /// this field is not specified when creating a new instance, NOT_REQUIRED is
26881 /// used. If this field is not specified when patching or updating an existing
26882 /// instance, it is left unchanged in the instance.
26883 pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
26884
26885 /// Configuration to protect against accidental instance deletion.
26886 pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
26887
26888 /// Server timezone, relevant only for Cloud SQL for SQL Server.
26889 pub time_zone: std::string::String,
26890
26891 /// Specifies advanced machine configuration for the instances relevant only
26892 /// for SQL Server.
26893 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
26894
26895 /// Configuration for data cache.
26896 pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
26897
26898 /// Optional. Configuration value for recreation of replica after certain
26899 /// replication lag
26900 pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
26901
26902 /// Optional. When this parameter is set to true, Cloud SQL instances can
26903 /// connect to Vertex AI to pass requests for real-time predictions and
26904 /// insights to the AI. The default value is false. This applies only to Cloud
26905 /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
26906 pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
26907
26908 /// Optional. By default, Cloud SQL instances have schema extraction disabled
26909 /// for Dataplex. When this parameter is set to true, schema extraction for
26910 /// Dataplex on Cloud SQL instances is activated.
26911 pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
26912
26913 /// Optional. When this parameter is set to true, Cloud SQL retains backups of
26914 /// the instance even after the instance is deleted. The ON_DEMAND backup will
26915 /// be retained until customer deletes the backup or the project. The AUTOMATED
26916 /// backup will be retained based on the backups retention setting.
26917 pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
26918
26919 /// Optional. Provisioned number of I/O operations per second for the data
26920 /// disk. This field is only used for hyperdisk-balanced disk types.
26921 pub data_disk_provisioned_iops: std::option::Option<i64>,
26922
26923 /// Optional. Provisioned throughput measured in MiB per second for the data
26924 /// disk. This field is only used for hyperdisk-balanced disk types.
26925 pub data_disk_provisioned_throughput: std::option::Option<i64>,
26926
26927 /// Optional. The managed connection pooling configuration for the instance.
26928 pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
26929
26930 /// Optional. The final backup configuration for the instance.
26931 pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
26932
26933 /// Optional. The read pool auto-scale configuration for the instance.
26934 pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
26935
26936 /// Optional. Whether the replica is in accelerated mode. This feature is in
26937 /// private preview and requires allowlisting to take effect.
26938 pub accelerated_replica_mode: std::option::Option<wkt::BoolValue>,
26939
26940 /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
26941 /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
26942 /// versions. The MySQL version must be 8.0.35 or higher.
26943 pub auto_upgrade_enabled: std::option::Option<bool>,
26944
26945 /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
26946 pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
26947
26948 /// This parameter controls whether to allow using ExecuteSql API to connect to
26949 /// the instance. Not allowed by default.
26950 pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
26951
26952 /// Optional. Configuration for Performance Capture, provides diagnostic
26953 /// metrics during high load situations.
26954 pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
26955
26956 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26957}
26958
26959impl Settings {
26960 /// Creates a new default instance.
26961 pub fn new() -> Self {
26962 std::default::Default::default()
26963 }
26964
26965 /// Sets the value of [settings_version][crate::model::Settings::settings_version].
26966 ///
26967 /// # Example
26968 /// ```ignore,no_run
26969 /// # use google_cloud_sql_v1::model::Settings;
26970 /// use wkt::Int64Value;
26971 /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
26972 /// ```
26973 pub fn set_settings_version<T>(mut self, v: T) -> Self
26974 where
26975 T: std::convert::Into<wkt::Int64Value>,
26976 {
26977 self.settings_version = std::option::Option::Some(v.into());
26978 self
26979 }
26980
26981 /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
26982 ///
26983 /// # Example
26984 /// ```ignore,no_run
26985 /// # use google_cloud_sql_v1::model::Settings;
26986 /// use wkt::Int64Value;
26987 /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
26988 /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
26989 /// ```
26990 pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
26991 where
26992 T: std::convert::Into<wkt::Int64Value>,
26993 {
26994 self.settings_version = v.map(|x| x.into());
26995 self
26996 }
26997
26998 /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
26999 ///
27000 /// # Example
27001 /// ```ignore,no_run
27002 /// # use google_cloud_sql_v1::model::Settings;
27003 /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
27004 /// ```
27005 #[deprecated]
27006 pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
27007 where
27008 T: std::iter::IntoIterator<Item = V>,
27009 V: std::convert::Into<std::string::String>,
27010 {
27011 use std::iter::Iterator;
27012 self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
27013 self
27014 }
27015
27016 /// Sets the value of [tier][crate::model::Settings::tier].
27017 ///
27018 /// # Example
27019 /// ```ignore,no_run
27020 /// # use google_cloud_sql_v1::model::Settings;
27021 /// let x = Settings::new().set_tier("example");
27022 /// ```
27023 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27024 self.tier = v.into();
27025 self
27026 }
27027
27028 /// Sets the value of [kind][crate::model::Settings::kind].
27029 ///
27030 /// # Example
27031 /// ```ignore,no_run
27032 /// # use google_cloud_sql_v1::model::Settings;
27033 /// let x = Settings::new().set_kind("example");
27034 /// ```
27035 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27036 self.kind = v.into();
27037 self
27038 }
27039
27040 /// Sets the value of [user_labels][crate::model::Settings::user_labels].
27041 ///
27042 /// # Example
27043 /// ```ignore,no_run
27044 /// # use google_cloud_sql_v1::model::Settings;
27045 /// let x = Settings::new().set_user_labels([
27046 /// ("key0", "abc"),
27047 /// ("key1", "xyz"),
27048 /// ]);
27049 /// ```
27050 pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
27051 where
27052 T: std::iter::IntoIterator<Item = (K, V)>,
27053 K: std::convert::Into<std::string::String>,
27054 V: std::convert::Into<std::string::String>,
27055 {
27056 use std::iter::Iterator;
27057 self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
27058 self
27059 }
27060
27061 /// Sets the value of [availability_type][crate::model::Settings::availability_type].
27062 ///
27063 /// # Example
27064 /// ```ignore,no_run
27065 /// # use google_cloud_sql_v1::model::Settings;
27066 /// use google_cloud_sql_v1::model::SqlAvailabilityType;
27067 /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
27068 /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
27069 /// ```
27070 pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
27071 mut self,
27072 v: T,
27073 ) -> Self {
27074 self.availability_type = v.into();
27075 self
27076 }
27077
27078 /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
27079 ///
27080 /// # Example
27081 /// ```ignore,no_run
27082 /// # use google_cloud_sql_v1::model::Settings;
27083 /// use google_cloud_sql_v1::model::SqlPricingPlan;
27084 /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
27085 /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
27086 /// ```
27087 pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
27088 mut self,
27089 v: T,
27090 ) -> Self {
27091 self.pricing_plan = v.into();
27092 self
27093 }
27094
27095 /// Sets the value of [replication_type][crate::model::Settings::replication_type].
27096 ///
27097 /// # Example
27098 /// ```ignore,no_run
27099 /// # use google_cloud_sql_v1::model::Settings;
27100 /// use google_cloud_sql_v1::model::SqlReplicationType;
27101 /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
27102 /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
27103 /// ```
27104 #[deprecated]
27105 pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
27106 mut self,
27107 v: T,
27108 ) -> Self {
27109 self.replication_type = v.into();
27110 self
27111 }
27112
27113 /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
27114 ///
27115 /// # Example
27116 /// ```ignore,no_run
27117 /// # use google_cloud_sql_v1::model::Settings;
27118 /// use wkt::Int64Value;
27119 /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
27120 /// ```
27121 pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
27122 where
27123 T: std::convert::Into<wkt::Int64Value>,
27124 {
27125 self.storage_auto_resize_limit = std::option::Option::Some(v.into());
27126 self
27127 }
27128
27129 /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
27130 ///
27131 /// # Example
27132 /// ```ignore,no_run
27133 /// # use google_cloud_sql_v1::model::Settings;
27134 /// use wkt::Int64Value;
27135 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
27136 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
27137 /// ```
27138 pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
27139 where
27140 T: std::convert::Into<wkt::Int64Value>,
27141 {
27142 self.storage_auto_resize_limit = v.map(|x| x.into());
27143 self
27144 }
27145
27146 /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
27147 ///
27148 /// # Example
27149 /// ```ignore,no_run
27150 /// # use google_cloud_sql_v1::model::Settings;
27151 /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
27152 /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
27153 /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
27154 /// ```
27155 pub fn set_activation_policy<
27156 T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
27157 >(
27158 mut self,
27159 v: T,
27160 ) -> Self {
27161 self.activation_policy = v.into();
27162 self
27163 }
27164
27165 /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
27166 ///
27167 /// # Example
27168 /// ```ignore,no_run
27169 /// # use google_cloud_sql_v1::model::Settings;
27170 /// use google_cloud_sql_v1::model::IpConfiguration;
27171 /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
27172 /// ```
27173 pub fn set_ip_configuration<T>(mut self, v: T) -> Self
27174 where
27175 T: std::convert::Into<crate::model::IpConfiguration>,
27176 {
27177 self.ip_configuration = std::option::Option::Some(v.into());
27178 self
27179 }
27180
27181 /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
27182 ///
27183 /// # Example
27184 /// ```ignore,no_run
27185 /// # use google_cloud_sql_v1::model::Settings;
27186 /// use google_cloud_sql_v1::model::IpConfiguration;
27187 /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
27188 /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
27189 /// ```
27190 pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
27191 where
27192 T: std::convert::Into<crate::model::IpConfiguration>,
27193 {
27194 self.ip_configuration = v.map(|x| x.into());
27195 self
27196 }
27197
27198 /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
27199 ///
27200 /// # Example
27201 /// ```ignore,no_run
27202 /// # use google_cloud_sql_v1::model::Settings;
27203 /// use wkt::BoolValue;
27204 /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
27205 /// ```
27206 pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
27207 where
27208 T: std::convert::Into<wkt::BoolValue>,
27209 {
27210 self.storage_auto_resize = std::option::Option::Some(v.into());
27211 self
27212 }
27213
27214 /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
27215 ///
27216 /// # Example
27217 /// ```ignore,no_run
27218 /// # use google_cloud_sql_v1::model::Settings;
27219 /// use wkt::BoolValue;
27220 /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
27221 /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
27222 /// ```
27223 pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
27224 where
27225 T: std::convert::Into<wkt::BoolValue>,
27226 {
27227 self.storage_auto_resize = v.map(|x| x.into());
27228 self
27229 }
27230
27231 /// Sets the value of [location_preference][crate::model::Settings::location_preference].
27232 ///
27233 /// # Example
27234 /// ```ignore,no_run
27235 /// # use google_cloud_sql_v1::model::Settings;
27236 /// use google_cloud_sql_v1::model::LocationPreference;
27237 /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
27238 /// ```
27239 pub fn set_location_preference<T>(mut self, v: T) -> Self
27240 where
27241 T: std::convert::Into<crate::model::LocationPreference>,
27242 {
27243 self.location_preference = std::option::Option::Some(v.into());
27244 self
27245 }
27246
27247 /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
27248 ///
27249 /// # Example
27250 /// ```ignore,no_run
27251 /// # use google_cloud_sql_v1::model::Settings;
27252 /// use google_cloud_sql_v1::model::LocationPreference;
27253 /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
27254 /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
27255 /// ```
27256 pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
27257 where
27258 T: std::convert::Into<crate::model::LocationPreference>,
27259 {
27260 self.location_preference = v.map(|x| x.into());
27261 self
27262 }
27263
27264 /// Sets the value of [database_flags][crate::model::Settings::database_flags].
27265 ///
27266 /// # Example
27267 /// ```ignore,no_run
27268 /// # use google_cloud_sql_v1::model::Settings;
27269 /// use google_cloud_sql_v1::model::DatabaseFlags;
27270 /// let x = Settings::new()
27271 /// .set_database_flags([
27272 /// DatabaseFlags::default()/* use setters */,
27273 /// DatabaseFlags::default()/* use (different) setters */,
27274 /// ]);
27275 /// ```
27276 pub fn set_database_flags<T, V>(mut self, v: T) -> Self
27277 where
27278 T: std::iter::IntoIterator<Item = V>,
27279 V: std::convert::Into<crate::model::DatabaseFlags>,
27280 {
27281 use std::iter::Iterator;
27282 self.database_flags = v.into_iter().map(|i| i.into()).collect();
27283 self
27284 }
27285
27286 /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
27287 ///
27288 /// # Example
27289 /// ```ignore,no_run
27290 /// # use google_cloud_sql_v1::model::Settings;
27291 /// use google_cloud_sql_v1::model::SqlDataDiskType;
27292 /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
27293 /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
27294 /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
27295 /// ```
27296 pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
27297 mut self,
27298 v: T,
27299 ) -> Self {
27300 self.data_disk_type = v.into();
27301 self
27302 }
27303
27304 /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
27305 ///
27306 /// # Example
27307 /// ```ignore,no_run
27308 /// # use google_cloud_sql_v1::model::Settings;
27309 /// use google_cloud_sql_v1::model::MaintenanceWindow;
27310 /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
27311 /// ```
27312 pub fn set_maintenance_window<T>(mut self, v: T) -> Self
27313 where
27314 T: std::convert::Into<crate::model::MaintenanceWindow>,
27315 {
27316 self.maintenance_window = std::option::Option::Some(v.into());
27317 self
27318 }
27319
27320 /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
27321 ///
27322 /// # Example
27323 /// ```ignore,no_run
27324 /// # use google_cloud_sql_v1::model::Settings;
27325 /// use google_cloud_sql_v1::model::MaintenanceWindow;
27326 /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
27327 /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
27328 /// ```
27329 pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
27330 where
27331 T: std::convert::Into<crate::model::MaintenanceWindow>,
27332 {
27333 self.maintenance_window = v.map(|x| x.into());
27334 self
27335 }
27336
27337 /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
27338 ///
27339 /// # Example
27340 /// ```ignore,no_run
27341 /// # use google_cloud_sql_v1::model::Settings;
27342 /// use google_cloud_sql_v1::model::BackupConfiguration;
27343 /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
27344 /// ```
27345 pub fn set_backup_configuration<T>(mut self, v: T) -> Self
27346 where
27347 T: std::convert::Into<crate::model::BackupConfiguration>,
27348 {
27349 self.backup_configuration = std::option::Option::Some(v.into());
27350 self
27351 }
27352
27353 /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
27354 ///
27355 /// # Example
27356 /// ```ignore,no_run
27357 /// # use google_cloud_sql_v1::model::Settings;
27358 /// use google_cloud_sql_v1::model::BackupConfiguration;
27359 /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
27360 /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
27361 /// ```
27362 pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
27363 where
27364 T: std::convert::Into<crate::model::BackupConfiguration>,
27365 {
27366 self.backup_configuration = v.map(|x| x.into());
27367 self
27368 }
27369
27370 /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
27371 ///
27372 /// # Example
27373 /// ```ignore,no_run
27374 /// # use google_cloud_sql_v1::model::Settings;
27375 /// use wkt::BoolValue;
27376 /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
27377 /// ```
27378 pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
27379 where
27380 T: std::convert::Into<wkt::BoolValue>,
27381 {
27382 self.database_replication_enabled = std::option::Option::Some(v.into());
27383 self
27384 }
27385
27386 /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
27387 ///
27388 /// # Example
27389 /// ```ignore,no_run
27390 /// # use google_cloud_sql_v1::model::Settings;
27391 /// use wkt::BoolValue;
27392 /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
27393 /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
27394 /// ```
27395 pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27396 where
27397 T: std::convert::Into<wkt::BoolValue>,
27398 {
27399 self.database_replication_enabled = v.map(|x| x.into());
27400 self
27401 }
27402
27403 /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
27404 ///
27405 /// # Example
27406 /// ```ignore,no_run
27407 /// # use google_cloud_sql_v1::model::Settings;
27408 /// use wkt::BoolValue;
27409 /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
27410 /// ```
27411 #[deprecated]
27412 pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
27413 where
27414 T: std::convert::Into<wkt::BoolValue>,
27415 {
27416 self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
27417 self
27418 }
27419
27420 /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
27421 ///
27422 /// # Example
27423 /// ```ignore,no_run
27424 /// # use google_cloud_sql_v1::model::Settings;
27425 /// use wkt::BoolValue;
27426 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
27427 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
27428 /// ```
27429 #[deprecated]
27430 pub fn set_or_clear_crash_safe_replication_enabled<T>(
27431 mut self,
27432 v: std::option::Option<T>,
27433 ) -> Self
27434 where
27435 T: std::convert::Into<wkt::BoolValue>,
27436 {
27437 self.crash_safe_replication_enabled = v.map(|x| x.into());
27438 self
27439 }
27440
27441 /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
27442 ///
27443 /// # Example
27444 /// ```ignore,no_run
27445 /// # use google_cloud_sql_v1::model::Settings;
27446 /// use wkt::Int64Value;
27447 /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
27448 /// ```
27449 pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
27450 where
27451 T: std::convert::Into<wkt::Int64Value>,
27452 {
27453 self.data_disk_size_gb = std::option::Option::Some(v.into());
27454 self
27455 }
27456
27457 /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
27458 ///
27459 /// # Example
27460 /// ```ignore,no_run
27461 /// # use google_cloud_sql_v1::model::Settings;
27462 /// use wkt::Int64Value;
27463 /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
27464 /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
27465 /// ```
27466 pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
27467 where
27468 T: std::convert::Into<wkt::Int64Value>,
27469 {
27470 self.data_disk_size_gb = v.map(|x| x.into());
27471 self
27472 }
27473
27474 /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
27475 ///
27476 /// # Example
27477 /// ```ignore,no_run
27478 /// # use google_cloud_sql_v1::model::Settings;
27479 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
27480 /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
27481 /// ```
27482 pub fn set_active_directory_config<T>(mut self, v: T) -> Self
27483 where
27484 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
27485 {
27486 self.active_directory_config = std::option::Option::Some(v.into());
27487 self
27488 }
27489
27490 /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
27491 ///
27492 /// # Example
27493 /// ```ignore,no_run
27494 /// # use google_cloud_sql_v1::model::Settings;
27495 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
27496 /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
27497 /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
27498 /// ```
27499 pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
27500 where
27501 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
27502 {
27503 self.active_directory_config = v.map(|x| x.into());
27504 self
27505 }
27506
27507 /// Sets the value of [collation][crate::model::Settings::collation].
27508 ///
27509 /// # Example
27510 /// ```ignore,no_run
27511 /// # use google_cloud_sql_v1::model::Settings;
27512 /// let x = Settings::new().set_collation("example");
27513 /// ```
27514 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27515 self.collation = v.into();
27516 self
27517 }
27518
27519 /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
27520 ///
27521 /// # Example
27522 /// ```ignore,no_run
27523 /// # use google_cloud_sql_v1::model::Settings;
27524 /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
27525 /// let x = Settings::new()
27526 /// .set_deny_maintenance_periods([
27527 /// DenyMaintenancePeriod::default()/* use setters */,
27528 /// DenyMaintenancePeriod::default()/* use (different) setters */,
27529 /// ]);
27530 /// ```
27531 pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
27532 where
27533 T: std::iter::IntoIterator<Item = V>,
27534 V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
27535 {
27536 use std::iter::Iterator;
27537 self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
27538 self
27539 }
27540
27541 /// Sets the value of [insights_config][crate::model::Settings::insights_config].
27542 ///
27543 /// # Example
27544 /// ```ignore,no_run
27545 /// # use google_cloud_sql_v1::model::Settings;
27546 /// use google_cloud_sql_v1::model::InsightsConfig;
27547 /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
27548 /// ```
27549 pub fn set_insights_config<T>(mut self, v: T) -> Self
27550 where
27551 T: std::convert::Into<crate::model::InsightsConfig>,
27552 {
27553 self.insights_config = std::option::Option::Some(v.into());
27554 self
27555 }
27556
27557 /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
27558 ///
27559 /// # Example
27560 /// ```ignore,no_run
27561 /// # use google_cloud_sql_v1::model::Settings;
27562 /// use google_cloud_sql_v1::model::InsightsConfig;
27563 /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
27564 /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
27565 /// ```
27566 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
27567 where
27568 T: std::convert::Into<crate::model::InsightsConfig>,
27569 {
27570 self.insights_config = v.map(|x| x.into());
27571 self
27572 }
27573
27574 /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
27575 ///
27576 /// # Example
27577 /// ```ignore,no_run
27578 /// # use google_cloud_sql_v1::model::Settings;
27579 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
27580 /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
27581 /// ```
27582 pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
27583 where
27584 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
27585 {
27586 self.password_validation_policy = std::option::Option::Some(v.into());
27587 self
27588 }
27589
27590 /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
27591 ///
27592 /// # Example
27593 /// ```ignore,no_run
27594 /// # use google_cloud_sql_v1::model::Settings;
27595 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
27596 /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
27597 /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
27598 /// ```
27599 pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
27600 where
27601 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
27602 {
27603 self.password_validation_policy = v.map(|x| x.into());
27604 self
27605 }
27606
27607 /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
27608 ///
27609 /// # Example
27610 /// ```ignore,no_run
27611 /// # use google_cloud_sql_v1::model::Settings;
27612 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
27613 /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
27614 /// ```
27615 pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
27616 where
27617 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
27618 {
27619 self.sql_server_audit_config = std::option::Option::Some(v.into());
27620 self
27621 }
27622
27623 /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
27624 ///
27625 /// # Example
27626 /// ```ignore,no_run
27627 /// # use google_cloud_sql_v1::model::Settings;
27628 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
27629 /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
27630 /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
27631 /// ```
27632 pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
27633 where
27634 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
27635 {
27636 self.sql_server_audit_config = v.map(|x| x.into());
27637 self
27638 }
27639
27640 /// Sets the value of [edition][crate::model::Settings::edition].
27641 ///
27642 /// # Example
27643 /// ```ignore,no_run
27644 /// # use google_cloud_sql_v1::model::Settings;
27645 /// use google_cloud_sql_v1::model::settings::Edition;
27646 /// let x0 = Settings::new().set_edition(Edition::Enterprise);
27647 /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
27648 /// let x2 = Settings::new().set_edition(Edition::Developer);
27649 /// ```
27650 pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
27651 mut self,
27652 v: T,
27653 ) -> Self {
27654 self.edition = v.into();
27655 self
27656 }
27657
27658 /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
27659 ///
27660 /// # Example
27661 /// ```ignore,no_run
27662 /// # use google_cloud_sql_v1::model::Settings;
27663 /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
27664 /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
27665 /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
27666 /// ```
27667 pub fn set_connector_enforcement<
27668 T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
27669 >(
27670 mut self,
27671 v: T,
27672 ) -> Self {
27673 self.connector_enforcement = v.into();
27674 self
27675 }
27676
27677 /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
27678 ///
27679 /// # Example
27680 /// ```ignore,no_run
27681 /// # use google_cloud_sql_v1::model::Settings;
27682 /// use wkt::BoolValue;
27683 /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
27684 /// ```
27685 pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
27686 where
27687 T: std::convert::Into<wkt::BoolValue>,
27688 {
27689 self.deletion_protection_enabled = std::option::Option::Some(v.into());
27690 self
27691 }
27692
27693 /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
27694 ///
27695 /// # Example
27696 /// ```ignore,no_run
27697 /// # use google_cloud_sql_v1::model::Settings;
27698 /// use wkt::BoolValue;
27699 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
27700 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
27701 /// ```
27702 pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27703 where
27704 T: std::convert::Into<wkt::BoolValue>,
27705 {
27706 self.deletion_protection_enabled = v.map(|x| x.into());
27707 self
27708 }
27709
27710 /// Sets the value of [time_zone][crate::model::Settings::time_zone].
27711 ///
27712 /// # Example
27713 /// ```ignore,no_run
27714 /// # use google_cloud_sql_v1::model::Settings;
27715 /// let x = Settings::new().set_time_zone("example");
27716 /// ```
27717 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27718 self.time_zone = v.into();
27719 self
27720 }
27721
27722 /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27723 ///
27724 /// # Example
27725 /// ```ignore,no_run
27726 /// # use google_cloud_sql_v1::model::Settings;
27727 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27728 /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
27729 /// ```
27730 pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
27731 where
27732 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27733 {
27734 self.advanced_machine_features = std::option::Option::Some(v.into());
27735 self
27736 }
27737
27738 /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27739 ///
27740 /// # Example
27741 /// ```ignore,no_run
27742 /// # use google_cloud_sql_v1::model::Settings;
27743 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27744 /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
27745 /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
27746 /// ```
27747 pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
27748 where
27749 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27750 {
27751 self.advanced_machine_features = v.map(|x| x.into());
27752 self
27753 }
27754
27755 /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
27756 ///
27757 /// # Example
27758 /// ```ignore,no_run
27759 /// # use google_cloud_sql_v1::model::Settings;
27760 /// use google_cloud_sql_v1::model::DataCacheConfig;
27761 /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
27762 /// ```
27763 pub fn set_data_cache_config<T>(mut self, v: T) -> Self
27764 where
27765 T: std::convert::Into<crate::model::DataCacheConfig>,
27766 {
27767 self.data_cache_config = std::option::Option::Some(v.into());
27768 self
27769 }
27770
27771 /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
27772 ///
27773 /// # Example
27774 /// ```ignore,no_run
27775 /// # use google_cloud_sql_v1::model::Settings;
27776 /// use google_cloud_sql_v1::model::DataCacheConfig;
27777 /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
27778 /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
27779 /// ```
27780 pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
27781 where
27782 T: std::convert::Into<crate::model::DataCacheConfig>,
27783 {
27784 self.data_cache_config = v.map(|x| x.into());
27785 self
27786 }
27787
27788 /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27789 ///
27790 /// # Example
27791 /// ```ignore,no_run
27792 /// # use google_cloud_sql_v1::model::Settings;
27793 /// use wkt::Int32Value;
27794 /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
27795 /// ```
27796 pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
27797 where
27798 T: std::convert::Into<wkt::Int32Value>,
27799 {
27800 self.replication_lag_max_seconds = std::option::Option::Some(v.into());
27801 self
27802 }
27803
27804 /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27805 ///
27806 /// # Example
27807 /// ```ignore,no_run
27808 /// # use google_cloud_sql_v1::model::Settings;
27809 /// use wkt::Int32Value;
27810 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
27811 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
27812 /// ```
27813 pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
27814 where
27815 T: std::convert::Into<wkt::Int32Value>,
27816 {
27817 self.replication_lag_max_seconds = v.map(|x| x.into());
27818 self
27819 }
27820
27821 /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27822 ///
27823 /// # Example
27824 /// ```ignore,no_run
27825 /// # use google_cloud_sql_v1::model::Settings;
27826 /// use wkt::BoolValue;
27827 /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
27828 /// ```
27829 pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
27830 where
27831 T: std::convert::Into<wkt::BoolValue>,
27832 {
27833 self.enable_google_ml_integration = std::option::Option::Some(v.into());
27834 self
27835 }
27836
27837 /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27838 ///
27839 /// # Example
27840 /// ```ignore,no_run
27841 /// # use google_cloud_sql_v1::model::Settings;
27842 /// use wkt::BoolValue;
27843 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
27844 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
27845 /// ```
27846 pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
27847 where
27848 T: std::convert::Into<wkt::BoolValue>,
27849 {
27850 self.enable_google_ml_integration = v.map(|x| x.into());
27851 self
27852 }
27853
27854 /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27855 ///
27856 /// # Example
27857 /// ```ignore,no_run
27858 /// # use google_cloud_sql_v1::model::Settings;
27859 /// use wkt::BoolValue;
27860 /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
27861 /// ```
27862 pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
27863 where
27864 T: std::convert::Into<wkt::BoolValue>,
27865 {
27866 self.enable_dataplex_integration = std::option::Option::Some(v.into());
27867 self
27868 }
27869
27870 /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27871 ///
27872 /// # Example
27873 /// ```ignore,no_run
27874 /// # use google_cloud_sql_v1::model::Settings;
27875 /// use wkt::BoolValue;
27876 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
27877 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
27878 /// ```
27879 pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
27880 where
27881 T: std::convert::Into<wkt::BoolValue>,
27882 {
27883 self.enable_dataplex_integration = v.map(|x| x.into());
27884 self
27885 }
27886
27887 /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27888 ///
27889 /// # Example
27890 /// ```ignore,no_run
27891 /// # use google_cloud_sql_v1::model::Settings;
27892 /// use wkt::BoolValue;
27893 /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
27894 /// ```
27895 pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
27896 where
27897 T: std::convert::Into<wkt::BoolValue>,
27898 {
27899 self.retain_backups_on_delete = std::option::Option::Some(v.into());
27900 self
27901 }
27902
27903 /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27904 ///
27905 /// # Example
27906 /// ```ignore,no_run
27907 /// # use google_cloud_sql_v1::model::Settings;
27908 /// use wkt::BoolValue;
27909 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
27910 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
27911 /// ```
27912 pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
27913 where
27914 T: std::convert::Into<wkt::BoolValue>,
27915 {
27916 self.retain_backups_on_delete = v.map(|x| x.into());
27917 self
27918 }
27919
27920 /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27921 ///
27922 /// # Example
27923 /// ```ignore,no_run
27924 /// # use google_cloud_sql_v1::model::Settings;
27925 /// let x = Settings::new().set_data_disk_provisioned_iops(42);
27926 /// ```
27927 pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
27928 where
27929 T: std::convert::Into<i64>,
27930 {
27931 self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
27932 self
27933 }
27934
27935 /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27936 ///
27937 /// # Example
27938 /// ```ignore,no_run
27939 /// # use google_cloud_sql_v1::model::Settings;
27940 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
27941 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
27942 /// ```
27943 pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
27944 where
27945 T: std::convert::Into<i64>,
27946 {
27947 self.data_disk_provisioned_iops = v.map(|x| x.into());
27948 self
27949 }
27950
27951 /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27952 ///
27953 /// # Example
27954 /// ```ignore,no_run
27955 /// # use google_cloud_sql_v1::model::Settings;
27956 /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
27957 /// ```
27958 pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
27959 where
27960 T: std::convert::Into<i64>,
27961 {
27962 self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
27963 self
27964 }
27965
27966 /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27967 ///
27968 /// # Example
27969 /// ```ignore,no_run
27970 /// # use google_cloud_sql_v1::model::Settings;
27971 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
27972 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
27973 /// ```
27974 pub fn set_or_clear_data_disk_provisioned_throughput<T>(
27975 mut self,
27976 v: std::option::Option<T>,
27977 ) -> Self
27978 where
27979 T: std::convert::Into<i64>,
27980 {
27981 self.data_disk_provisioned_throughput = v.map(|x| x.into());
27982 self
27983 }
27984
27985 /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27986 ///
27987 /// # Example
27988 /// ```ignore,no_run
27989 /// # use google_cloud_sql_v1::model::Settings;
27990 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27991 /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
27992 /// ```
27993 pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
27994 where
27995 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27996 {
27997 self.connection_pool_config = std::option::Option::Some(v.into());
27998 self
27999 }
28000
28001 /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
28002 ///
28003 /// # Example
28004 /// ```ignore,no_run
28005 /// # use google_cloud_sql_v1::model::Settings;
28006 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
28007 /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
28008 /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
28009 /// ```
28010 pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
28011 where
28012 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
28013 {
28014 self.connection_pool_config = v.map(|x| x.into());
28015 self
28016 }
28017
28018 /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
28019 ///
28020 /// # Example
28021 /// ```ignore,no_run
28022 /// # use google_cloud_sql_v1::model::Settings;
28023 /// use google_cloud_sql_v1::model::FinalBackupConfig;
28024 /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
28025 /// ```
28026 pub fn set_final_backup_config<T>(mut self, v: T) -> Self
28027 where
28028 T: std::convert::Into<crate::model::FinalBackupConfig>,
28029 {
28030 self.final_backup_config = std::option::Option::Some(v.into());
28031 self
28032 }
28033
28034 /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
28035 ///
28036 /// # Example
28037 /// ```ignore,no_run
28038 /// # use google_cloud_sql_v1::model::Settings;
28039 /// use google_cloud_sql_v1::model::FinalBackupConfig;
28040 /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
28041 /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
28042 /// ```
28043 pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
28044 where
28045 T: std::convert::Into<crate::model::FinalBackupConfig>,
28046 {
28047 self.final_backup_config = v.map(|x| x.into());
28048 self
28049 }
28050
28051 /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
28052 ///
28053 /// # Example
28054 /// ```ignore,no_run
28055 /// # use google_cloud_sql_v1::model::Settings;
28056 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28057 /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
28058 /// ```
28059 pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
28060 where
28061 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
28062 {
28063 self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
28064 self
28065 }
28066
28067 /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
28068 ///
28069 /// # Example
28070 /// ```ignore,no_run
28071 /// # use google_cloud_sql_v1::model::Settings;
28072 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28073 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
28074 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
28075 /// ```
28076 pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
28077 where
28078 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
28079 {
28080 self.read_pool_auto_scale_config = v.map(|x| x.into());
28081 self
28082 }
28083
28084 /// Sets the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
28085 ///
28086 /// # Example
28087 /// ```ignore,no_run
28088 /// # use google_cloud_sql_v1::model::Settings;
28089 /// use wkt::BoolValue;
28090 /// let x = Settings::new().set_accelerated_replica_mode(BoolValue::default()/* use setters */);
28091 /// ```
28092 pub fn set_accelerated_replica_mode<T>(mut self, v: T) -> Self
28093 where
28094 T: std::convert::Into<wkt::BoolValue>,
28095 {
28096 self.accelerated_replica_mode = std::option::Option::Some(v.into());
28097 self
28098 }
28099
28100 /// Sets or clears the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
28101 ///
28102 /// # Example
28103 /// ```ignore,no_run
28104 /// # use google_cloud_sql_v1::model::Settings;
28105 /// use wkt::BoolValue;
28106 /// let x = Settings::new().set_or_clear_accelerated_replica_mode(Some(BoolValue::default()/* use setters */));
28107 /// let x = Settings::new().set_or_clear_accelerated_replica_mode(None::<BoolValue>);
28108 /// ```
28109 pub fn set_or_clear_accelerated_replica_mode<T>(mut self, v: std::option::Option<T>) -> Self
28110 where
28111 T: std::convert::Into<wkt::BoolValue>,
28112 {
28113 self.accelerated_replica_mode = v.map(|x| x.into());
28114 self
28115 }
28116
28117 /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
28118 ///
28119 /// # Example
28120 /// ```ignore,no_run
28121 /// # use google_cloud_sql_v1::model::Settings;
28122 /// let x = Settings::new().set_auto_upgrade_enabled(true);
28123 /// ```
28124 pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
28125 where
28126 T: std::convert::Into<bool>,
28127 {
28128 self.auto_upgrade_enabled = std::option::Option::Some(v.into());
28129 self
28130 }
28131
28132 /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
28133 ///
28134 /// # Example
28135 /// ```ignore,no_run
28136 /// # use google_cloud_sql_v1::model::Settings;
28137 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
28138 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
28139 /// ```
28140 pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28141 where
28142 T: std::convert::Into<bool>,
28143 {
28144 self.auto_upgrade_enabled = v.map(|x| x.into());
28145 self
28146 }
28147
28148 /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
28149 ///
28150 /// # Example
28151 /// ```ignore,no_run
28152 /// # use google_cloud_sql_v1::model::Settings;
28153 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
28154 /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
28155 /// ```
28156 pub fn set_entraid_config<T>(mut self, v: T) -> Self
28157 where
28158 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
28159 {
28160 self.entraid_config = std::option::Option::Some(v.into());
28161 self
28162 }
28163
28164 /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
28165 ///
28166 /// # Example
28167 /// ```ignore,no_run
28168 /// # use google_cloud_sql_v1::model::Settings;
28169 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
28170 /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
28171 /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
28172 /// ```
28173 pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
28174 where
28175 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
28176 {
28177 self.entraid_config = v.map(|x| x.into());
28178 self
28179 }
28180
28181 /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
28182 ///
28183 /// # Example
28184 /// ```ignore,no_run
28185 /// # use google_cloud_sql_v1::model::Settings;
28186 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
28187 /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
28188 /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
28189 /// ```
28190 pub fn set_data_api_access<T>(mut self, v: T) -> Self
28191 where
28192 T: std::convert::Into<crate::model::settings::DataApiAccess>,
28193 {
28194 self.data_api_access = std::option::Option::Some(v.into());
28195 self
28196 }
28197
28198 /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
28199 ///
28200 /// # Example
28201 /// ```ignore,no_run
28202 /// # use google_cloud_sql_v1::model::Settings;
28203 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
28204 /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
28205 /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
28206 /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
28207 /// ```
28208 pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
28209 where
28210 T: std::convert::Into<crate::model::settings::DataApiAccess>,
28211 {
28212 self.data_api_access = v.map(|x| x.into());
28213 self
28214 }
28215
28216 /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
28217 ///
28218 /// # Example
28219 /// ```ignore,no_run
28220 /// # use google_cloud_sql_v1::model::Settings;
28221 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28222 /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
28223 /// ```
28224 pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
28225 where
28226 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
28227 {
28228 self.performance_capture_config = std::option::Option::Some(v.into());
28229 self
28230 }
28231
28232 /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
28233 ///
28234 /// # Example
28235 /// ```ignore,no_run
28236 /// # use google_cloud_sql_v1::model::Settings;
28237 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28238 /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
28239 /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
28240 /// ```
28241 pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
28242 where
28243 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
28244 {
28245 self.performance_capture_config = v.map(|x| x.into());
28246 self
28247 }
28248}
28249
28250impl wkt::message::Message for Settings {
28251 fn typename() -> &'static str {
28252 "type.googleapis.com/google.cloud.sql.v1.Settings"
28253 }
28254}
28255
28256/// Defines additional types related to [Settings].
28257pub mod settings {
28258 #[allow(unused_imports)]
28259 use super::*;
28260
28261 /// Specifies when the instance is activated.
28262 ///
28263 /// # Working with unknown values
28264 ///
28265 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28266 /// additional enum variants at any time. Adding new variants is not considered
28267 /// a breaking change. Applications should write their code in anticipation of:
28268 ///
28269 /// - New values appearing in future releases of the client library, **and**
28270 /// - New values received dynamically, without application changes.
28271 ///
28272 /// Please consult the [Working with enums] section in the user guide for some
28273 /// guidelines.
28274 ///
28275 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28276 #[derive(Clone, Debug, PartialEq)]
28277 #[non_exhaustive]
28278 pub enum SqlActivationPolicy {
28279 /// Unknown activation plan.
28280 Unspecified,
28281 /// The instance is always up and running.
28282 Always,
28283 /// The instance never starts.
28284 Never,
28285 /// The instance starts upon receiving requests.
28286 #[deprecated]
28287 OnDemand,
28288 /// If set, the enum was initialized with an unknown value.
28289 ///
28290 /// Applications can examine the value using [SqlActivationPolicy::value] or
28291 /// [SqlActivationPolicy::name].
28292 UnknownValue(sql_activation_policy::UnknownValue),
28293 }
28294
28295 #[doc(hidden)]
28296 pub mod sql_activation_policy {
28297 #[allow(unused_imports)]
28298 use super::*;
28299 #[derive(Clone, Debug, PartialEq)]
28300 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28301 }
28302
28303 impl SqlActivationPolicy {
28304 /// Gets the enum value.
28305 ///
28306 /// Returns `None` if the enum contains an unknown value deserialized from
28307 /// the string representation of enums.
28308 pub fn value(&self) -> std::option::Option<i32> {
28309 match self {
28310 Self::Unspecified => std::option::Option::Some(0),
28311 Self::Always => std::option::Option::Some(1),
28312 Self::Never => std::option::Option::Some(2),
28313 Self::OnDemand => std::option::Option::Some(3),
28314 Self::UnknownValue(u) => u.0.value(),
28315 }
28316 }
28317
28318 /// Gets the enum value as a string.
28319 ///
28320 /// Returns `None` if the enum contains an unknown value deserialized from
28321 /// the integer representation of enums.
28322 pub fn name(&self) -> std::option::Option<&str> {
28323 match self {
28324 Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
28325 Self::Always => std::option::Option::Some("ALWAYS"),
28326 Self::Never => std::option::Option::Some("NEVER"),
28327 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
28328 Self::UnknownValue(u) => u.0.name(),
28329 }
28330 }
28331 }
28332
28333 impl std::default::Default for SqlActivationPolicy {
28334 fn default() -> Self {
28335 use std::convert::From;
28336 Self::from(0)
28337 }
28338 }
28339
28340 impl std::fmt::Display for SqlActivationPolicy {
28341 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28342 wkt::internal::display_enum(f, self.name(), self.value())
28343 }
28344 }
28345
28346 impl std::convert::From<i32> for SqlActivationPolicy {
28347 fn from(value: i32) -> Self {
28348 match value {
28349 0 => Self::Unspecified,
28350 1 => Self::Always,
28351 2 => Self::Never,
28352 3 => Self::OnDemand,
28353 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
28354 wkt::internal::UnknownEnumValue::Integer(value),
28355 )),
28356 }
28357 }
28358 }
28359
28360 impl std::convert::From<&str> for SqlActivationPolicy {
28361 fn from(value: &str) -> Self {
28362 use std::string::ToString;
28363 match value {
28364 "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
28365 "ALWAYS" => Self::Always,
28366 "NEVER" => Self::Never,
28367 "ON_DEMAND" => Self::OnDemand,
28368 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
28369 wkt::internal::UnknownEnumValue::String(value.to_string()),
28370 )),
28371 }
28372 }
28373 }
28374
28375 impl serde::ser::Serialize for SqlActivationPolicy {
28376 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28377 where
28378 S: serde::Serializer,
28379 {
28380 match self {
28381 Self::Unspecified => serializer.serialize_i32(0),
28382 Self::Always => serializer.serialize_i32(1),
28383 Self::Never => serializer.serialize_i32(2),
28384 Self::OnDemand => serializer.serialize_i32(3),
28385 Self::UnknownValue(u) => u.0.serialize(serializer),
28386 }
28387 }
28388 }
28389
28390 impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
28391 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28392 where
28393 D: serde::Deserializer<'de>,
28394 {
28395 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
28396 ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
28397 ))
28398 }
28399 }
28400
28401 /// The list of Cloud SQL editions available to users.
28402 ///
28403 /// # Working with unknown values
28404 ///
28405 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28406 /// additional enum variants at any time. Adding new variants is not considered
28407 /// a breaking change. Applications should write their code in anticipation of:
28408 ///
28409 /// - New values appearing in future releases of the client library, **and**
28410 /// - New values received dynamically, without application changes.
28411 ///
28412 /// Please consult the [Working with enums] section in the user guide for some
28413 /// guidelines.
28414 ///
28415 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28416 #[derive(Clone, Debug, PartialEq)]
28417 #[non_exhaustive]
28418 pub enum Edition {
28419 /// The instance did not specify the edition.
28420 Unspecified,
28421 /// The instance is an enterprise edition.
28422 Enterprise,
28423 /// The instance is an Enterprise Plus edition.
28424 EnterprisePlus,
28425 /// This instance is a Cloud SQL developer edition instance.
28426 Developer,
28427 /// If set, the enum was initialized with an unknown value.
28428 ///
28429 /// Applications can examine the value using [Edition::value] or
28430 /// [Edition::name].
28431 UnknownValue(edition::UnknownValue),
28432 }
28433
28434 #[doc(hidden)]
28435 pub mod edition {
28436 #[allow(unused_imports)]
28437 use super::*;
28438 #[derive(Clone, Debug, PartialEq)]
28439 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28440 }
28441
28442 impl Edition {
28443 /// Gets the enum value.
28444 ///
28445 /// Returns `None` if the enum contains an unknown value deserialized from
28446 /// the string representation of enums.
28447 pub fn value(&self) -> std::option::Option<i32> {
28448 match self {
28449 Self::Unspecified => std::option::Option::Some(0),
28450 Self::Enterprise => std::option::Option::Some(2),
28451 Self::EnterprisePlus => std::option::Option::Some(3),
28452 Self::Developer => std::option::Option::Some(5),
28453 Self::UnknownValue(u) => u.0.value(),
28454 }
28455 }
28456
28457 /// Gets the enum value as a string.
28458 ///
28459 /// Returns `None` if the enum contains an unknown value deserialized from
28460 /// the integer representation of enums.
28461 pub fn name(&self) -> std::option::Option<&str> {
28462 match self {
28463 Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
28464 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
28465 Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
28466 Self::Developer => std::option::Option::Some("DEVELOPER"),
28467 Self::UnknownValue(u) => u.0.name(),
28468 }
28469 }
28470 }
28471
28472 impl std::default::Default for Edition {
28473 fn default() -> Self {
28474 use std::convert::From;
28475 Self::from(0)
28476 }
28477 }
28478
28479 impl std::fmt::Display for Edition {
28480 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28481 wkt::internal::display_enum(f, self.name(), self.value())
28482 }
28483 }
28484
28485 impl std::convert::From<i32> for Edition {
28486 fn from(value: i32) -> Self {
28487 match value {
28488 0 => Self::Unspecified,
28489 2 => Self::Enterprise,
28490 3 => Self::EnterprisePlus,
28491 5 => Self::Developer,
28492 _ => Self::UnknownValue(edition::UnknownValue(
28493 wkt::internal::UnknownEnumValue::Integer(value),
28494 )),
28495 }
28496 }
28497 }
28498
28499 impl std::convert::From<&str> for Edition {
28500 fn from(value: &str) -> Self {
28501 use std::string::ToString;
28502 match value {
28503 "EDITION_UNSPECIFIED" => Self::Unspecified,
28504 "ENTERPRISE" => Self::Enterprise,
28505 "ENTERPRISE_PLUS" => Self::EnterprisePlus,
28506 "DEVELOPER" => Self::Developer,
28507 _ => Self::UnknownValue(edition::UnknownValue(
28508 wkt::internal::UnknownEnumValue::String(value.to_string()),
28509 )),
28510 }
28511 }
28512 }
28513
28514 impl serde::ser::Serialize for Edition {
28515 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28516 where
28517 S: serde::Serializer,
28518 {
28519 match self {
28520 Self::Unspecified => serializer.serialize_i32(0),
28521 Self::Enterprise => serializer.serialize_i32(2),
28522 Self::EnterprisePlus => serializer.serialize_i32(3),
28523 Self::Developer => serializer.serialize_i32(5),
28524 Self::UnknownValue(u) => u.0.serialize(serializer),
28525 }
28526 }
28527 }
28528
28529 impl<'de> serde::de::Deserialize<'de> for Edition {
28530 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28531 where
28532 D: serde::Deserializer<'de>,
28533 {
28534 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
28535 ".google.cloud.sql.v1.Settings.Edition",
28536 ))
28537 }
28538 }
28539
28540 /// The options for enforcing Cloud SQL connectors in the instance.
28541 ///
28542 /// # Working with unknown values
28543 ///
28544 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28545 /// additional enum variants at any time. Adding new variants is not considered
28546 /// a breaking change. Applications should write their code in anticipation of:
28547 ///
28548 /// - New values appearing in future releases of the client library, **and**
28549 /// - New values received dynamically, without application changes.
28550 ///
28551 /// Please consult the [Working with enums] section in the user guide for some
28552 /// guidelines.
28553 ///
28554 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28555 #[derive(Clone, Debug, PartialEq)]
28556 #[non_exhaustive]
28557 pub enum ConnectorEnforcement {
28558 /// The requirement for Cloud SQL connectors is unknown.
28559 Unspecified,
28560 /// Do not require Cloud SQL connectors.
28561 NotRequired,
28562 /// Require all connections to use Cloud SQL connectors, including the
28563 /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
28564 /// Note: This disables all existing authorized networks.
28565 Required,
28566 /// If set, the enum was initialized with an unknown value.
28567 ///
28568 /// Applications can examine the value using [ConnectorEnforcement::value] or
28569 /// [ConnectorEnforcement::name].
28570 UnknownValue(connector_enforcement::UnknownValue),
28571 }
28572
28573 #[doc(hidden)]
28574 pub mod connector_enforcement {
28575 #[allow(unused_imports)]
28576 use super::*;
28577 #[derive(Clone, Debug, PartialEq)]
28578 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28579 }
28580
28581 impl ConnectorEnforcement {
28582 /// Gets the enum value.
28583 ///
28584 /// Returns `None` if the enum contains an unknown value deserialized from
28585 /// the string representation of enums.
28586 pub fn value(&self) -> std::option::Option<i32> {
28587 match self {
28588 Self::Unspecified => std::option::Option::Some(0),
28589 Self::NotRequired => std::option::Option::Some(1),
28590 Self::Required => std::option::Option::Some(2),
28591 Self::UnknownValue(u) => u.0.value(),
28592 }
28593 }
28594
28595 /// Gets the enum value as a string.
28596 ///
28597 /// Returns `None` if the enum contains an unknown value deserialized from
28598 /// the integer representation of enums.
28599 pub fn name(&self) -> std::option::Option<&str> {
28600 match self {
28601 Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
28602 Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
28603 Self::Required => std::option::Option::Some("REQUIRED"),
28604 Self::UnknownValue(u) => u.0.name(),
28605 }
28606 }
28607 }
28608
28609 impl std::default::Default for ConnectorEnforcement {
28610 fn default() -> Self {
28611 use std::convert::From;
28612 Self::from(0)
28613 }
28614 }
28615
28616 impl std::fmt::Display for ConnectorEnforcement {
28617 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28618 wkt::internal::display_enum(f, self.name(), self.value())
28619 }
28620 }
28621
28622 impl std::convert::From<i32> for ConnectorEnforcement {
28623 fn from(value: i32) -> Self {
28624 match value {
28625 0 => Self::Unspecified,
28626 1 => Self::NotRequired,
28627 2 => Self::Required,
28628 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
28629 wkt::internal::UnknownEnumValue::Integer(value),
28630 )),
28631 }
28632 }
28633 }
28634
28635 impl std::convert::From<&str> for ConnectorEnforcement {
28636 fn from(value: &str) -> Self {
28637 use std::string::ToString;
28638 match value {
28639 "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
28640 "NOT_REQUIRED" => Self::NotRequired,
28641 "REQUIRED" => Self::Required,
28642 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
28643 wkt::internal::UnknownEnumValue::String(value.to_string()),
28644 )),
28645 }
28646 }
28647 }
28648
28649 impl serde::ser::Serialize for ConnectorEnforcement {
28650 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28651 where
28652 S: serde::Serializer,
28653 {
28654 match self {
28655 Self::Unspecified => serializer.serialize_i32(0),
28656 Self::NotRequired => serializer.serialize_i32(1),
28657 Self::Required => serializer.serialize_i32(2),
28658 Self::UnknownValue(u) => u.0.serialize(serializer),
28659 }
28660 }
28661 }
28662
28663 impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
28664 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28665 where
28666 D: serde::Deserializer<'de>,
28667 {
28668 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
28669 ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
28670 ))
28671 }
28672 }
28673
28674 /// ExecuteSql API's access to the instance.
28675 ///
28676 /// # Working with unknown values
28677 ///
28678 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28679 /// additional enum variants at any time. Adding new variants is not considered
28680 /// a breaking change. Applications should write their code in anticipation of:
28681 ///
28682 /// - New values appearing in future releases of the client library, **and**
28683 /// - New values received dynamically, without application changes.
28684 ///
28685 /// Please consult the [Working with enums] section in the user guide for some
28686 /// guidelines.
28687 ///
28688 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28689 #[derive(Clone, Debug, PartialEq)]
28690 #[non_exhaustive]
28691 pub enum DataApiAccess {
28692 /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
28693 Unspecified,
28694 /// Disallow using ExecuteSql API to connect to the instance.
28695 DisallowDataApi,
28696 /// Allow using ExecuteSql API to connect to the instance. For private IP
28697 /// instances, this allows authorized users to access the instance from
28698 /// the public internet using ExecuteSql API.
28699 AllowDataApi,
28700 /// If set, the enum was initialized with an unknown value.
28701 ///
28702 /// Applications can examine the value using [DataApiAccess::value] or
28703 /// [DataApiAccess::name].
28704 UnknownValue(data_api_access::UnknownValue),
28705 }
28706
28707 #[doc(hidden)]
28708 pub mod data_api_access {
28709 #[allow(unused_imports)]
28710 use super::*;
28711 #[derive(Clone, Debug, PartialEq)]
28712 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28713 }
28714
28715 impl DataApiAccess {
28716 /// Gets the enum value.
28717 ///
28718 /// Returns `None` if the enum contains an unknown value deserialized from
28719 /// the string representation of enums.
28720 pub fn value(&self) -> std::option::Option<i32> {
28721 match self {
28722 Self::Unspecified => std::option::Option::Some(0),
28723 Self::DisallowDataApi => std::option::Option::Some(1),
28724 Self::AllowDataApi => std::option::Option::Some(2),
28725 Self::UnknownValue(u) => u.0.value(),
28726 }
28727 }
28728
28729 /// Gets the enum value as a string.
28730 ///
28731 /// Returns `None` if the enum contains an unknown value deserialized from
28732 /// the integer representation of enums.
28733 pub fn name(&self) -> std::option::Option<&str> {
28734 match self {
28735 Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
28736 Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
28737 Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
28738 Self::UnknownValue(u) => u.0.name(),
28739 }
28740 }
28741 }
28742
28743 impl std::default::Default for DataApiAccess {
28744 fn default() -> Self {
28745 use std::convert::From;
28746 Self::from(0)
28747 }
28748 }
28749
28750 impl std::fmt::Display for DataApiAccess {
28751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28752 wkt::internal::display_enum(f, self.name(), self.value())
28753 }
28754 }
28755
28756 impl std::convert::From<i32> for DataApiAccess {
28757 fn from(value: i32) -> Self {
28758 match value {
28759 0 => Self::Unspecified,
28760 1 => Self::DisallowDataApi,
28761 2 => Self::AllowDataApi,
28762 _ => Self::UnknownValue(data_api_access::UnknownValue(
28763 wkt::internal::UnknownEnumValue::Integer(value),
28764 )),
28765 }
28766 }
28767 }
28768
28769 impl std::convert::From<&str> for DataApiAccess {
28770 fn from(value: &str) -> Self {
28771 use std::string::ToString;
28772 match value {
28773 "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
28774 "DISALLOW_DATA_API" => Self::DisallowDataApi,
28775 "ALLOW_DATA_API" => Self::AllowDataApi,
28776 _ => Self::UnknownValue(data_api_access::UnknownValue(
28777 wkt::internal::UnknownEnumValue::String(value.to_string()),
28778 )),
28779 }
28780 }
28781 }
28782
28783 impl serde::ser::Serialize for DataApiAccess {
28784 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28785 where
28786 S: serde::Serializer,
28787 {
28788 match self {
28789 Self::Unspecified => serializer.serialize_i32(0),
28790 Self::DisallowDataApi => serializer.serialize_i32(1),
28791 Self::AllowDataApi => serializer.serialize_i32(2),
28792 Self::UnknownValue(u) => u.0.serialize(serializer),
28793 }
28794 }
28795 }
28796
28797 impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
28798 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28799 where
28800 D: serde::Deserializer<'de>,
28801 {
28802 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
28803 ".google.cloud.sql.v1.Settings.DataApiAccess",
28804 ))
28805 }
28806 }
28807}
28808
28809/// Performance capture configuration.
28810#[derive(Clone, Default, PartialEq)]
28811#[non_exhaustive]
28812pub struct PerformanceCaptureConfig {
28813 /// Optional. Enables or disables the performance capture feature.
28814 pub enabled: std::option::Option<bool>,
28815
28816 /// Optional. Specifies the interval in seconds between consecutive probes that
28817 /// check if any trigger condition thresholds have been reached.
28818 pub probing_interval_seconds: std::option::Option<i32>,
28819
28820 /// Optional. Specifies the minimum number of consecutive probe threshold that
28821 /// triggers performance capture.
28822 pub probe_threshold: std::option::Option<i32>,
28823
28824 /// Optional. Specifies the minimum number of MySQL `Threads_running` to
28825 /// trigger the performance capture on the primary instance.
28826 pub running_threads_threshold: std::option::Option<i32>,
28827
28828 /// Optional. Specifies the minimum number of seconds replica must be lagging
28829 /// behind primary instance to trigger the performance capture on replica.
28830 pub seconds_behind_source_threshold: std::option::Option<i32>,
28831
28832 /// Optional. Specifies the amount of time in seconds that a transaction needs
28833 /// to have been open before the watcher starts recording it.
28834 pub transaction_duration_threshold: std::option::Option<i32>,
28835
28836 /// Optional. Specifies the minimum percentage of CPU utilization to trigger
28837 /// the performance capture. Valid integers range from `10` to `99`. Enter `0`
28838 /// to disable the check.
28839 pub cpu_utilization_threshold_percent: std::option::Option<i32>,
28840
28841 /// Optional. Specifies the minimum percentage of memory usage to trigger the
28842 /// performance capture.
28843 /// Valid integers range from `10` to `99`. Enter `0` to disable the check.
28844 pub memory_usage_threshold_percent: std::option::Option<i32>,
28845
28846 /// Optional. Specifies the minimum allowed number of transactions in lock wait
28847 /// state to trigger the performance capture. Valid integers range from `10` to
28848 /// `10000`. Enter `0` to disable the check.
28849 pub transaction_lock_wait_threshold_count: std::option::Option<i32>,
28850
28851 /// Optional. Specifies the minimum allowed number of semaphore waits to
28852 /// trigger the performance capture. Valid integers range from `10` to `10000`.
28853 /// Enter `0` to disable the check.
28854 pub semaphore_wait_threshold_count: std::option::Option<i32>,
28855
28856 /// Optional. Specifies the minimum number of undo log entries in the history
28857 /// list length to trigger the performance capture. Valid integers range from
28858 /// `10000` to `10000000`. Enter `0` to disable the check.
28859 pub history_list_length_threshold_count: std::option::Option<i32>,
28860
28861 /// Optional. Specifies the amount of time in seconds that a transaction needs
28862 /// to have been open before the watcher starts terminating it. Valid integers
28863 /// range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
28864 /// (i.e., > 0), this value must be greater than or equal to
28865 /// `transaction_duration_threshold`. Configurations where
28866 /// `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
28867 /// will be rejected.
28868 pub transaction_kill_threshold_seconds: std::option::Option<i32>,
28869
28870 /// Optional. Specifies a customer-defined list of users to exclude from
28871 /// transaction termination. Entries can be in the format 'user@host' or just
28872 /// 'user'. A standalone 'user' implies 'user@%', excluding the user from any
28873 /// host. Wildcard '%' is allowed in the host part of the 'user@host' format.
28874 /// Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
28875 pub transaction_kill_excluded_user_hosts: std::vec::Vec<std::string::String>,
28876
28877 /// Optional. Determines which transactions are allowed to be terminated when
28878 /// they exceed `transaction_kill_threshold_seconds`. This allows protecting
28879 /// write-heavy transactions from auto-termination if desired. Defaults to
28880 /// `READ_ONLY_TRANSACTIONS` if unspecified.
28881 pub transaction_kill_type:
28882 std::option::Option<crate::model::performance_capture_config::TransactionKillType>,
28883
28884 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28885}
28886
28887impl PerformanceCaptureConfig {
28888 /// Creates a new default instance.
28889 pub fn new() -> Self {
28890 std::default::Default::default()
28891 }
28892
28893 /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28894 ///
28895 /// # Example
28896 /// ```ignore,no_run
28897 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28898 /// let x = PerformanceCaptureConfig::new().set_enabled(true);
28899 /// ```
28900 pub fn set_enabled<T>(mut self, v: T) -> Self
28901 where
28902 T: std::convert::Into<bool>,
28903 {
28904 self.enabled = std::option::Option::Some(v.into());
28905 self
28906 }
28907
28908 /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28909 ///
28910 /// # Example
28911 /// ```ignore,no_run
28912 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28913 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
28914 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
28915 /// ```
28916 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28917 where
28918 T: std::convert::Into<bool>,
28919 {
28920 self.enabled = v.map(|x| x.into());
28921 self
28922 }
28923
28924 /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28925 ///
28926 /// # Example
28927 /// ```ignore,no_run
28928 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28929 /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
28930 /// ```
28931 pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
28932 where
28933 T: std::convert::Into<i32>,
28934 {
28935 self.probing_interval_seconds = std::option::Option::Some(v.into());
28936 self
28937 }
28938
28939 /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28940 ///
28941 /// # Example
28942 /// ```ignore,no_run
28943 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28944 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
28945 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
28946 /// ```
28947 pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28948 where
28949 T: std::convert::Into<i32>,
28950 {
28951 self.probing_interval_seconds = v.map(|x| x.into());
28952 self
28953 }
28954
28955 /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28956 ///
28957 /// # Example
28958 /// ```ignore,no_run
28959 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28960 /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
28961 /// ```
28962 pub fn set_probe_threshold<T>(mut self, v: T) -> Self
28963 where
28964 T: std::convert::Into<i32>,
28965 {
28966 self.probe_threshold = std::option::Option::Some(v.into());
28967 self
28968 }
28969
28970 /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28971 ///
28972 /// # Example
28973 /// ```ignore,no_run
28974 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28975 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
28976 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
28977 /// ```
28978 pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
28979 where
28980 T: std::convert::Into<i32>,
28981 {
28982 self.probe_threshold = v.map(|x| x.into());
28983 self
28984 }
28985
28986 /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
28987 ///
28988 /// # Example
28989 /// ```ignore,no_run
28990 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28991 /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
28992 /// ```
28993 pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
28994 where
28995 T: std::convert::Into<i32>,
28996 {
28997 self.running_threads_threshold = std::option::Option::Some(v.into());
28998 self
28999 }
29000
29001 /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
29002 ///
29003 /// # Example
29004 /// ```ignore,no_run
29005 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29006 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
29007 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
29008 /// ```
29009 pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
29010 where
29011 T: std::convert::Into<i32>,
29012 {
29013 self.running_threads_threshold = v.map(|x| x.into());
29014 self
29015 }
29016
29017 /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
29018 ///
29019 /// # Example
29020 /// ```ignore,no_run
29021 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29022 /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
29023 /// ```
29024 pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
29025 where
29026 T: std::convert::Into<i32>,
29027 {
29028 self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
29029 self
29030 }
29031
29032 /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
29033 ///
29034 /// # Example
29035 /// ```ignore,no_run
29036 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29037 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
29038 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
29039 /// ```
29040 pub fn set_or_clear_seconds_behind_source_threshold<T>(
29041 mut self,
29042 v: std::option::Option<T>,
29043 ) -> Self
29044 where
29045 T: std::convert::Into<i32>,
29046 {
29047 self.seconds_behind_source_threshold = v.map(|x| x.into());
29048 self
29049 }
29050
29051 /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
29052 ///
29053 /// # Example
29054 /// ```ignore,no_run
29055 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29056 /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
29057 /// ```
29058 pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
29059 where
29060 T: std::convert::Into<i32>,
29061 {
29062 self.transaction_duration_threshold = std::option::Option::Some(v.into());
29063 self
29064 }
29065
29066 /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
29067 ///
29068 /// # Example
29069 /// ```ignore,no_run
29070 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29071 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
29072 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
29073 /// ```
29074 pub fn set_or_clear_transaction_duration_threshold<T>(
29075 mut self,
29076 v: std::option::Option<T>,
29077 ) -> Self
29078 where
29079 T: std::convert::Into<i32>,
29080 {
29081 self.transaction_duration_threshold = v.map(|x| x.into());
29082 self
29083 }
29084
29085 /// Sets the value of [cpu_utilization_threshold_percent][crate::model::PerformanceCaptureConfig::cpu_utilization_threshold_percent].
29086 ///
29087 /// # Example
29088 /// ```ignore,no_run
29089 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29090 /// let x = PerformanceCaptureConfig::new().set_cpu_utilization_threshold_percent(42);
29091 /// ```
29092 pub fn set_cpu_utilization_threshold_percent<T>(mut self, v: T) -> Self
29093 where
29094 T: std::convert::Into<i32>,
29095 {
29096 self.cpu_utilization_threshold_percent = std::option::Option::Some(v.into());
29097 self
29098 }
29099
29100 /// Sets or clears the value of [cpu_utilization_threshold_percent][crate::model::PerformanceCaptureConfig::cpu_utilization_threshold_percent].
29101 ///
29102 /// # Example
29103 /// ```ignore,no_run
29104 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29105 /// let x = PerformanceCaptureConfig::new().set_or_clear_cpu_utilization_threshold_percent(Some(42));
29106 /// let x = PerformanceCaptureConfig::new().set_or_clear_cpu_utilization_threshold_percent(None::<i32>);
29107 /// ```
29108 pub fn set_or_clear_cpu_utilization_threshold_percent<T>(
29109 mut self,
29110 v: std::option::Option<T>,
29111 ) -> Self
29112 where
29113 T: std::convert::Into<i32>,
29114 {
29115 self.cpu_utilization_threshold_percent = v.map(|x| x.into());
29116 self
29117 }
29118
29119 /// Sets the value of [memory_usage_threshold_percent][crate::model::PerformanceCaptureConfig::memory_usage_threshold_percent].
29120 ///
29121 /// # Example
29122 /// ```ignore,no_run
29123 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29124 /// let x = PerformanceCaptureConfig::new().set_memory_usage_threshold_percent(42);
29125 /// ```
29126 pub fn set_memory_usage_threshold_percent<T>(mut self, v: T) -> Self
29127 where
29128 T: std::convert::Into<i32>,
29129 {
29130 self.memory_usage_threshold_percent = std::option::Option::Some(v.into());
29131 self
29132 }
29133
29134 /// Sets or clears the value of [memory_usage_threshold_percent][crate::model::PerformanceCaptureConfig::memory_usage_threshold_percent].
29135 ///
29136 /// # Example
29137 /// ```ignore,no_run
29138 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29139 /// let x = PerformanceCaptureConfig::new().set_or_clear_memory_usage_threshold_percent(Some(42));
29140 /// let x = PerformanceCaptureConfig::new().set_or_clear_memory_usage_threshold_percent(None::<i32>);
29141 /// ```
29142 pub fn set_or_clear_memory_usage_threshold_percent<T>(
29143 mut self,
29144 v: std::option::Option<T>,
29145 ) -> Self
29146 where
29147 T: std::convert::Into<i32>,
29148 {
29149 self.memory_usage_threshold_percent = v.map(|x| x.into());
29150 self
29151 }
29152
29153 /// Sets the value of [transaction_lock_wait_threshold_count][crate::model::PerformanceCaptureConfig::transaction_lock_wait_threshold_count].
29154 ///
29155 /// # Example
29156 /// ```ignore,no_run
29157 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29158 /// let x = PerformanceCaptureConfig::new().set_transaction_lock_wait_threshold_count(42);
29159 /// ```
29160 pub fn set_transaction_lock_wait_threshold_count<T>(mut self, v: T) -> Self
29161 where
29162 T: std::convert::Into<i32>,
29163 {
29164 self.transaction_lock_wait_threshold_count = std::option::Option::Some(v.into());
29165 self
29166 }
29167
29168 /// Sets or clears the value of [transaction_lock_wait_threshold_count][crate::model::PerformanceCaptureConfig::transaction_lock_wait_threshold_count].
29169 ///
29170 /// # Example
29171 /// ```ignore,no_run
29172 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29173 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_lock_wait_threshold_count(Some(42));
29174 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_lock_wait_threshold_count(None::<i32>);
29175 /// ```
29176 pub fn set_or_clear_transaction_lock_wait_threshold_count<T>(
29177 mut self,
29178 v: std::option::Option<T>,
29179 ) -> Self
29180 where
29181 T: std::convert::Into<i32>,
29182 {
29183 self.transaction_lock_wait_threshold_count = v.map(|x| x.into());
29184 self
29185 }
29186
29187 /// Sets the value of [semaphore_wait_threshold_count][crate::model::PerformanceCaptureConfig::semaphore_wait_threshold_count].
29188 ///
29189 /// # Example
29190 /// ```ignore,no_run
29191 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29192 /// let x = PerformanceCaptureConfig::new().set_semaphore_wait_threshold_count(42);
29193 /// ```
29194 pub fn set_semaphore_wait_threshold_count<T>(mut self, v: T) -> Self
29195 where
29196 T: std::convert::Into<i32>,
29197 {
29198 self.semaphore_wait_threshold_count = std::option::Option::Some(v.into());
29199 self
29200 }
29201
29202 /// Sets or clears the value of [semaphore_wait_threshold_count][crate::model::PerformanceCaptureConfig::semaphore_wait_threshold_count].
29203 ///
29204 /// # Example
29205 /// ```ignore,no_run
29206 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29207 /// let x = PerformanceCaptureConfig::new().set_or_clear_semaphore_wait_threshold_count(Some(42));
29208 /// let x = PerformanceCaptureConfig::new().set_or_clear_semaphore_wait_threshold_count(None::<i32>);
29209 /// ```
29210 pub fn set_or_clear_semaphore_wait_threshold_count<T>(
29211 mut self,
29212 v: std::option::Option<T>,
29213 ) -> Self
29214 where
29215 T: std::convert::Into<i32>,
29216 {
29217 self.semaphore_wait_threshold_count = v.map(|x| x.into());
29218 self
29219 }
29220
29221 /// Sets the value of [history_list_length_threshold_count][crate::model::PerformanceCaptureConfig::history_list_length_threshold_count].
29222 ///
29223 /// # Example
29224 /// ```ignore,no_run
29225 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29226 /// let x = PerformanceCaptureConfig::new().set_history_list_length_threshold_count(42);
29227 /// ```
29228 pub fn set_history_list_length_threshold_count<T>(mut self, v: T) -> Self
29229 where
29230 T: std::convert::Into<i32>,
29231 {
29232 self.history_list_length_threshold_count = std::option::Option::Some(v.into());
29233 self
29234 }
29235
29236 /// Sets or clears the value of [history_list_length_threshold_count][crate::model::PerformanceCaptureConfig::history_list_length_threshold_count].
29237 ///
29238 /// # Example
29239 /// ```ignore,no_run
29240 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29241 /// let x = PerformanceCaptureConfig::new().set_or_clear_history_list_length_threshold_count(Some(42));
29242 /// let x = PerformanceCaptureConfig::new().set_or_clear_history_list_length_threshold_count(None::<i32>);
29243 /// ```
29244 pub fn set_or_clear_history_list_length_threshold_count<T>(
29245 mut self,
29246 v: std::option::Option<T>,
29247 ) -> Self
29248 where
29249 T: std::convert::Into<i32>,
29250 {
29251 self.history_list_length_threshold_count = v.map(|x| x.into());
29252 self
29253 }
29254
29255 /// Sets the value of [transaction_kill_threshold_seconds][crate::model::PerformanceCaptureConfig::transaction_kill_threshold_seconds].
29256 ///
29257 /// # Example
29258 /// ```ignore,no_run
29259 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29260 /// let x = PerformanceCaptureConfig::new().set_transaction_kill_threshold_seconds(42);
29261 /// ```
29262 pub fn set_transaction_kill_threshold_seconds<T>(mut self, v: T) -> Self
29263 where
29264 T: std::convert::Into<i32>,
29265 {
29266 self.transaction_kill_threshold_seconds = std::option::Option::Some(v.into());
29267 self
29268 }
29269
29270 /// Sets or clears the value of [transaction_kill_threshold_seconds][crate::model::PerformanceCaptureConfig::transaction_kill_threshold_seconds].
29271 ///
29272 /// # Example
29273 /// ```ignore,no_run
29274 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29275 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_threshold_seconds(Some(42));
29276 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_threshold_seconds(None::<i32>);
29277 /// ```
29278 pub fn set_or_clear_transaction_kill_threshold_seconds<T>(
29279 mut self,
29280 v: std::option::Option<T>,
29281 ) -> Self
29282 where
29283 T: std::convert::Into<i32>,
29284 {
29285 self.transaction_kill_threshold_seconds = v.map(|x| x.into());
29286 self
29287 }
29288
29289 /// Sets the value of [transaction_kill_excluded_user_hosts][crate::model::PerformanceCaptureConfig::transaction_kill_excluded_user_hosts].
29290 ///
29291 /// # Example
29292 /// ```ignore,no_run
29293 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29294 /// let x = PerformanceCaptureConfig::new().set_transaction_kill_excluded_user_hosts(["a", "b", "c"]);
29295 /// ```
29296 pub fn set_transaction_kill_excluded_user_hosts<T, V>(mut self, v: T) -> Self
29297 where
29298 T: std::iter::IntoIterator<Item = V>,
29299 V: std::convert::Into<std::string::String>,
29300 {
29301 use std::iter::Iterator;
29302 self.transaction_kill_excluded_user_hosts = v.into_iter().map(|i| i.into()).collect();
29303 self
29304 }
29305
29306 /// Sets the value of [transaction_kill_type][crate::model::PerformanceCaptureConfig::transaction_kill_type].
29307 ///
29308 /// # Example
29309 /// ```ignore,no_run
29310 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29311 /// use google_cloud_sql_v1::model::performance_capture_config::TransactionKillType;
29312 /// let x0 = PerformanceCaptureConfig::new().set_transaction_kill_type(TransactionKillType::ReadOnlyTransactions);
29313 /// let x1 = PerformanceCaptureConfig::new().set_transaction_kill_type(TransactionKillType::AllTransactions);
29314 /// ```
29315 pub fn set_transaction_kill_type<T>(mut self, v: T) -> Self
29316 where
29317 T: std::convert::Into<crate::model::performance_capture_config::TransactionKillType>,
29318 {
29319 self.transaction_kill_type = std::option::Option::Some(v.into());
29320 self
29321 }
29322
29323 /// Sets or clears the value of [transaction_kill_type][crate::model::PerformanceCaptureConfig::transaction_kill_type].
29324 ///
29325 /// # Example
29326 /// ```ignore,no_run
29327 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29328 /// use google_cloud_sql_v1::model::performance_capture_config::TransactionKillType;
29329 /// let x0 = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(Some(TransactionKillType::ReadOnlyTransactions));
29330 /// let x1 = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(Some(TransactionKillType::AllTransactions));
29331 /// let x_none = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(None::<TransactionKillType>);
29332 /// ```
29333 pub fn set_or_clear_transaction_kill_type<T>(mut self, v: std::option::Option<T>) -> Self
29334 where
29335 T: std::convert::Into<crate::model::performance_capture_config::TransactionKillType>,
29336 {
29337 self.transaction_kill_type = v.map(|x| x.into());
29338 self
29339 }
29340}
29341
29342impl wkt::message::Message for PerformanceCaptureConfig {
29343 fn typename() -> &'static str {
29344 "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
29345 }
29346}
29347
29348/// Defines additional types related to [PerformanceCaptureConfig].
29349pub mod performance_capture_config {
29350 #[allow(unused_imports)]
29351 use super::*;
29352
29353 /// Defines the categories of long-running transactions eligible for automatic
29354 /// termination by the Performance Capture.
29355 ///
29356 /// # Working with unknown values
29357 ///
29358 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29359 /// additional enum variants at any time. Adding new variants is not considered
29360 /// a breaking change. Applications should write their code in anticipation of:
29361 ///
29362 /// - New values appearing in future releases of the client library, **and**
29363 /// - New values received dynamically, without application changes.
29364 ///
29365 /// Please consult the [Working with enums] section in the user guide for some
29366 /// guidelines.
29367 ///
29368 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29369 #[derive(Clone, Debug, PartialEq)]
29370 #[non_exhaustive]
29371 pub enum TransactionKillType {
29372 /// Unspecified.
29373 Unspecified,
29374 /// Only read-only transactions are eligible for termination.
29375 ReadOnlyTransactions,
29376 /// All transactions are eligible for termination, including those with write
29377 /// operations (such as INSERT, UPDATE, DELETE, or DDL).
29378 AllTransactions,
29379 /// If set, the enum was initialized with an unknown value.
29380 ///
29381 /// Applications can examine the value using [TransactionKillType::value] or
29382 /// [TransactionKillType::name].
29383 UnknownValue(transaction_kill_type::UnknownValue),
29384 }
29385
29386 #[doc(hidden)]
29387 pub mod transaction_kill_type {
29388 #[allow(unused_imports)]
29389 use super::*;
29390 #[derive(Clone, Debug, PartialEq)]
29391 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29392 }
29393
29394 impl TransactionKillType {
29395 /// Gets the enum value.
29396 ///
29397 /// Returns `None` if the enum contains an unknown value deserialized from
29398 /// the string representation of enums.
29399 pub fn value(&self) -> std::option::Option<i32> {
29400 match self {
29401 Self::Unspecified => std::option::Option::Some(0),
29402 Self::ReadOnlyTransactions => std::option::Option::Some(1),
29403 Self::AllTransactions => std::option::Option::Some(2),
29404 Self::UnknownValue(u) => u.0.value(),
29405 }
29406 }
29407
29408 /// Gets the enum value as a string.
29409 ///
29410 /// Returns `None` if the enum contains an unknown value deserialized from
29411 /// the integer representation of enums.
29412 pub fn name(&self) -> std::option::Option<&str> {
29413 match self {
29414 Self::Unspecified => std::option::Option::Some("TRANSACTION_KILL_TYPE_UNSPECIFIED"),
29415 Self::ReadOnlyTransactions => std::option::Option::Some("READ_ONLY_TRANSACTIONS"),
29416 Self::AllTransactions => std::option::Option::Some("ALL_TRANSACTIONS"),
29417 Self::UnknownValue(u) => u.0.name(),
29418 }
29419 }
29420 }
29421
29422 impl std::default::Default for TransactionKillType {
29423 fn default() -> Self {
29424 use std::convert::From;
29425 Self::from(0)
29426 }
29427 }
29428
29429 impl std::fmt::Display for TransactionKillType {
29430 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29431 wkt::internal::display_enum(f, self.name(), self.value())
29432 }
29433 }
29434
29435 impl std::convert::From<i32> for TransactionKillType {
29436 fn from(value: i32) -> Self {
29437 match value {
29438 0 => Self::Unspecified,
29439 1 => Self::ReadOnlyTransactions,
29440 2 => Self::AllTransactions,
29441 _ => Self::UnknownValue(transaction_kill_type::UnknownValue(
29442 wkt::internal::UnknownEnumValue::Integer(value),
29443 )),
29444 }
29445 }
29446 }
29447
29448 impl std::convert::From<&str> for TransactionKillType {
29449 fn from(value: &str) -> Self {
29450 use std::string::ToString;
29451 match value {
29452 "TRANSACTION_KILL_TYPE_UNSPECIFIED" => Self::Unspecified,
29453 "READ_ONLY_TRANSACTIONS" => Self::ReadOnlyTransactions,
29454 "ALL_TRANSACTIONS" => Self::AllTransactions,
29455 _ => Self::UnknownValue(transaction_kill_type::UnknownValue(
29456 wkt::internal::UnknownEnumValue::String(value.to_string()),
29457 )),
29458 }
29459 }
29460 }
29461
29462 impl serde::ser::Serialize for TransactionKillType {
29463 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29464 where
29465 S: serde::Serializer,
29466 {
29467 match self {
29468 Self::Unspecified => serializer.serialize_i32(0),
29469 Self::ReadOnlyTransactions => serializer.serialize_i32(1),
29470 Self::AllTransactions => serializer.serialize_i32(2),
29471 Self::UnknownValue(u) => u.0.serialize(serializer),
29472 }
29473 }
29474 }
29475
29476 impl<'de> serde::de::Deserialize<'de> for TransactionKillType {
29477 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29478 where
29479 D: serde::Deserializer<'de>,
29480 {
29481 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransactionKillType>::new(
29482 ".google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType",
29483 ))
29484 }
29485 }
29486}
29487
29488/// Connection pool flags for Cloud SQL instances managed connection pool
29489/// configuration.
29490#[derive(Clone, Default, PartialEq)]
29491#[non_exhaustive]
29492pub struct ConnectionPoolFlags {
29493 /// Required. The name of the flag.
29494 pub name: std::string::String,
29495
29496 /// Required. The value of the flag. Boolean flags are set to `on` for true
29497 /// and `off` for false. This field must be omitted if the flag
29498 /// doesn't take a value.
29499 pub value: std::string::String,
29500
29501 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29502}
29503
29504impl ConnectionPoolFlags {
29505 /// Creates a new default instance.
29506 pub fn new() -> Self {
29507 std::default::Default::default()
29508 }
29509
29510 /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
29511 ///
29512 /// # Example
29513 /// ```ignore,no_run
29514 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
29515 /// let x = ConnectionPoolFlags::new().set_name("example");
29516 /// ```
29517 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29518 self.name = v.into();
29519 self
29520 }
29521
29522 /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
29523 ///
29524 /// # Example
29525 /// ```ignore,no_run
29526 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
29527 /// let x = ConnectionPoolFlags::new().set_value("example");
29528 /// ```
29529 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29530 self.value = v.into();
29531 self
29532 }
29533}
29534
29535impl wkt::message::Message for ConnectionPoolFlags {
29536 fn typename() -> &'static str {
29537 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
29538 }
29539}
29540
29541/// The managed connection pooling configuration.
29542#[derive(Clone, Default, PartialEq)]
29543#[non_exhaustive]
29544pub struct ConnectionPoolConfig {
29545 /// Whether managed connection pooling is enabled.
29546 pub connection_pooling_enabled: std::option::Option<bool>,
29547
29548 /// Optional. List of connection pool configuration flags.
29549 pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
29550
29551 /// Output only. Number of connection poolers.
29552 pub pooler_count: std::option::Option<i32>,
29553
29554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29555}
29556
29557impl ConnectionPoolConfig {
29558 /// Creates a new default instance.
29559 pub fn new() -> Self {
29560 std::default::Default::default()
29561 }
29562
29563 /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
29564 ///
29565 /// # Example
29566 /// ```ignore,no_run
29567 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29568 /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
29569 /// ```
29570 pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
29571 where
29572 T: std::convert::Into<bool>,
29573 {
29574 self.connection_pooling_enabled = std::option::Option::Some(v.into());
29575 self
29576 }
29577
29578 /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
29579 ///
29580 /// # Example
29581 /// ```ignore,no_run
29582 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29583 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
29584 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
29585 /// ```
29586 pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
29587 where
29588 T: std::convert::Into<bool>,
29589 {
29590 self.connection_pooling_enabled = v.map(|x| x.into());
29591 self
29592 }
29593
29594 /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
29595 ///
29596 /// # Example
29597 /// ```ignore,no_run
29598 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29599 /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
29600 /// let x = ConnectionPoolConfig::new()
29601 /// .set_flags([
29602 /// ConnectionPoolFlags::default()/* use setters */,
29603 /// ConnectionPoolFlags::default()/* use (different) setters */,
29604 /// ]);
29605 /// ```
29606 pub fn set_flags<T, V>(mut self, v: T) -> Self
29607 where
29608 T: std::iter::IntoIterator<Item = V>,
29609 V: std::convert::Into<crate::model::ConnectionPoolFlags>,
29610 {
29611 use std::iter::Iterator;
29612 self.flags = v.into_iter().map(|i| i.into()).collect();
29613 self
29614 }
29615
29616 /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
29617 ///
29618 /// # Example
29619 /// ```ignore,no_run
29620 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29621 /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
29622 /// ```
29623 pub fn set_pooler_count<T>(mut self, v: T) -> Self
29624 where
29625 T: std::convert::Into<i32>,
29626 {
29627 self.pooler_count = std::option::Option::Some(v.into());
29628 self
29629 }
29630
29631 /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
29632 ///
29633 /// # Example
29634 /// ```ignore,no_run
29635 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29636 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
29637 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
29638 /// ```
29639 pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
29640 where
29641 T: std::convert::Into<i32>,
29642 {
29643 self.pooler_count = v.map(|x| x.into());
29644 self
29645 }
29646}
29647
29648impl wkt::message::Message for ConnectionPoolConfig {
29649 fn typename() -> &'static str {
29650 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
29651 }
29652}
29653
29654/// The read pool auto-scale configuration.
29655#[derive(Clone, Default, PartialEq)]
29656#[non_exhaustive]
29657pub struct ReadPoolAutoScaleConfig {
29658 /// Indicates whether read pool auto scaling is enabled.
29659 pub enabled: std::option::Option<bool>,
29660
29661 /// Minimum number of read pool nodes to be maintained.
29662 pub min_node_count: std::option::Option<i32>,
29663
29664 /// Maximum number of read pool nodes to be maintained.
29665 pub max_node_count: std::option::Option<i32>,
29666
29667 /// Optional. Target metrics for read pool auto scaling.
29668 pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
29669
29670 /// Indicates whether read pool auto scaling supports scale in operations
29671 /// (removing nodes).
29672 pub disable_scale_in: std::option::Option<bool>,
29673
29674 /// The cooldown period for scale-in operations.
29675 pub scale_in_cooldown_seconds: std::option::Option<i32>,
29676
29677 /// The cooldown period for scale-out operations.
29678 pub scale_out_cooldown_seconds: std::option::Option<i32>,
29679
29680 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29681}
29682
29683impl ReadPoolAutoScaleConfig {
29684 /// Creates a new default instance.
29685 pub fn new() -> Self {
29686 std::default::Default::default()
29687 }
29688
29689 /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
29690 ///
29691 /// # Example
29692 /// ```ignore,no_run
29693 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29694 /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
29695 /// ```
29696 pub fn set_enabled<T>(mut self, v: T) -> Self
29697 where
29698 T: std::convert::Into<bool>,
29699 {
29700 self.enabled = std::option::Option::Some(v.into());
29701 self
29702 }
29703
29704 /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
29705 ///
29706 /// # Example
29707 /// ```ignore,no_run
29708 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29709 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
29710 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
29711 /// ```
29712 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
29713 where
29714 T: std::convert::Into<bool>,
29715 {
29716 self.enabled = v.map(|x| x.into());
29717 self
29718 }
29719
29720 /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
29721 ///
29722 /// # Example
29723 /// ```ignore,no_run
29724 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29725 /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
29726 /// ```
29727 pub fn set_min_node_count<T>(mut self, v: T) -> Self
29728 where
29729 T: std::convert::Into<i32>,
29730 {
29731 self.min_node_count = std::option::Option::Some(v.into());
29732 self
29733 }
29734
29735 /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
29736 ///
29737 /// # Example
29738 /// ```ignore,no_run
29739 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29740 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
29741 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
29742 /// ```
29743 pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
29744 where
29745 T: std::convert::Into<i32>,
29746 {
29747 self.min_node_count = v.map(|x| x.into());
29748 self
29749 }
29750
29751 /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
29752 ///
29753 /// # Example
29754 /// ```ignore,no_run
29755 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29756 /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
29757 /// ```
29758 pub fn set_max_node_count<T>(mut self, v: T) -> Self
29759 where
29760 T: std::convert::Into<i32>,
29761 {
29762 self.max_node_count = std::option::Option::Some(v.into());
29763 self
29764 }
29765
29766 /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
29767 ///
29768 /// # Example
29769 /// ```ignore,no_run
29770 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29771 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
29772 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
29773 /// ```
29774 pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
29775 where
29776 T: std::convert::Into<i32>,
29777 {
29778 self.max_node_count = v.map(|x| x.into());
29779 self
29780 }
29781
29782 /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
29783 ///
29784 /// # Example
29785 /// ```ignore,no_run
29786 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29787 /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29788 /// let x = ReadPoolAutoScaleConfig::new()
29789 /// .set_target_metrics([
29790 /// TargetMetric::default()/* use setters */,
29791 /// TargetMetric::default()/* use (different) setters */,
29792 /// ]);
29793 /// ```
29794 pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
29795 where
29796 T: std::iter::IntoIterator<Item = V>,
29797 V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
29798 {
29799 use std::iter::Iterator;
29800 self.target_metrics = v.into_iter().map(|i| i.into()).collect();
29801 self
29802 }
29803
29804 /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
29805 ///
29806 /// # Example
29807 /// ```ignore,no_run
29808 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29809 /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
29810 /// ```
29811 pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
29812 where
29813 T: std::convert::Into<bool>,
29814 {
29815 self.disable_scale_in = std::option::Option::Some(v.into());
29816 self
29817 }
29818
29819 /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
29820 ///
29821 /// # Example
29822 /// ```ignore,no_run
29823 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29824 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
29825 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
29826 /// ```
29827 pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
29828 where
29829 T: std::convert::Into<bool>,
29830 {
29831 self.disable_scale_in = v.map(|x| x.into());
29832 self
29833 }
29834
29835 /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
29836 ///
29837 /// # Example
29838 /// ```ignore,no_run
29839 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29840 /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
29841 /// ```
29842 pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
29843 where
29844 T: std::convert::Into<i32>,
29845 {
29846 self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
29847 self
29848 }
29849
29850 /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
29851 ///
29852 /// # Example
29853 /// ```ignore,no_run
29854 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29855 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
29856 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
29857 /// ```
29858 pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
29859 where
29860 T: std::convert::Into<i32>,
29861 {
29862 self.scale_in_cooldown_seconds = v.map(|x| x.into());
29863 self
29864 }
29865
29866 /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
29867 ///
29868 /// # Example
29869 /// ```ignore,no_run
29870 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29871 /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
29872 /// ```
29873 pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
29874 where
29875 T: std::convert::Into<i32>,
29876 {
29877 self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
29878 self
29879 }
29880
29881 /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
29882 ///
29883 /// # Example
29884 /// ```ignore,no_run
29885 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29886 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
29887 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
29888 /// ```
29889 pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
29890 where
29891 T: std::convert::Into<i32>,
29892 {
29893 self.scale_out_cooldown_seconds = v.map(|x| x.into());
29894 self
29895 }
29896}
29897
29898impl wkt::message::Message for ReadPoolAutoScaleConfig {
29899 fn typename() -> &'static str {
29900 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
29901 }
29902}
29903
29904/// Defines additional types related to [ReadPoolAutoScaleConfig].
29905pub mod read_pool_auto_scale_config {
29906 #[allow(unused_imports)]
29907 use super::*;
29908
29909 /// Target metric for read pool auto scaling.
29910 #[derive(Clone, Default, PartialEq)]
29911 #[non_exhaustive]
29912 pub struct TargetMetric {
29913 /// The metric name to be used for auto scaling.
29914 pub metric: std::option::Option<std::string::String>,
29915
29916 /// The target value for the metric.
29917 pub target_value: std::option::Option<f32>,
29918
29919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29920 }
29921
29922 impl TargetMetric {
29923 /// Creates a new default instance.
29924 pub fn new() -> Self {
29925 std::default::Default::default()
29926 }
29927
29928 /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
29929 ///
29930 /// # Example
29931 /// ```ignore,no_run
29932 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29933 /// let x = TargetMetric::new().set_metric("example");
29934 /// ```
29935 pub fn set_metric<T>(mut self, v: T) -> Self
29936 where
29937 T: std::convert::Into<std::string::String>,
29938 {
29939 self.metric = std::option::Option::Some(v.into());
29940 self
29941 }
29942
29943 /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
29944 ///
29945 /// # Example
29946 /// ```ignore,no_run
29947 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29948 /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
29949 /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
29950 /// ```
29951 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
29952 where
29953 T: std::convert::Into<std::string::String>,
29954 {
29955 self.metric = v.map(|x| x.into());
29956 self
29957 }
29958
29959 /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
29960 ///
29961 /// # Example
29962 /// ```ignore,no_run
29963 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29964 /// let x = TargetMetric::new().set_target_value(42.0);
29965 /// ```
29966 pub fn set_target_value<T>(mut self, v: T) -> Self
29967 where
29968 T: std::convert::Into<f32>,
29969 {
29970 self.target_value = std::option::Option::Some(v.into());
29971 self
29972 }
29973
29974 /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
29975 ///
29976 /// # Example
29977 /// ```ignore,no_run
29978 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29979 /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
29980 /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
29981 /// ```
29982 pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
29983 where
29984 T: std::convert::Into<f32>,
29985 {
29986 self.target_value = v.map(|x| x.into());
29987 self
29988 }
29989 }
29990
29991 impl wkt::message::Message for TargetMetric {
29992 fn typename() -> &'static str {
29993 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
29994 }
29995 }
29996}
29997
29998/// Specifies options for controlling advanced machine features.
29999#[derive(Clone, Default, PartialEq)]
30000#[non_exhaustive]
30001pub struct AdvancedMachineFeatures {
30002 /// The number of threads per physical core.
30003 pub threads_per_core: i32,
30004
30005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30006}
30007
30008impl AdvancedMachineFeatures {
30009 /// Creates a new default instance.
30010 pub fn new() -> Self {
30011 std::default::Default::default()
30012 }
30013
30014 /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
30015 ///
30016 /// # Example
30017 /// ```ignore,no_run
30018 /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
30019 /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
30020 /// ```
30021 pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
30022 self.threads_per_core = v.into();
30023 self
30024 }
30025}
30026
30027impl wkt::message::Message for AdvancedMachineFeatures {
30028 fn typename() -> &'static str {
30029 "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
30030 }
30031}
30032
30033/// SslCerts Resource
30034#[derive(Clone, Default, PartialEq)]
30035#[non_exhaustive]
30036pub struct SslCert {
30037 /// This is always `sql#sslCert`.
30038 pub kind: std::string::String,
30039
30040 /// Serial number, as extracted from the certificate.
30041 pub cert_serial_number: std::string::String,
30042
30043 /// PEM representation.
30044 pub cert: std::string::String,
30045
30046 /// The time when the certificate was created in [RFC
30047 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
30048 /// `2012-11-15T16:19:00.094Z`
30049 pub create_time: std::option::Option<wkt::Timestamp>,
30050
30051 /// User supplied name. Constrained to [a-zA-Z.-_ ]+.
30052 pub common_name: std::string::String,
30053
30054 /// The time when the certificate expires in [RFC
30055 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
30056 /// `2012-11-15T16:19:00.094Z`.
30057 pub expiration_time: std::option::Option<wkt::Timestamp>,
30058
30059 /// Sha1 Fingerprint.
30060 pub sha1_fingerprint: std::string::String,
30061
30062 /// Name of the database instance.
30063 pub instance: std::string::String,
30064
30065 /// The URI of this resource.
30066 pub self_link: std::string::String,
30067
30068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30069}
30070
30071impl SslCert {
30072 /// Creates a new default instance.
30073 pub fn new() -> Self {
30074 std::default::Default::default()
30075 }
30076
30077 /// Sets the value of [kind][crate::model::SslCert::kind].
30078 ///
30079 /// # Example
30080 /// ```ignore,no_run
30081 /// # use google_cloud_sql_v1::model::SslCert;
30082 /// let x = SslCert::new().set_kind("example");
30083 /// ```
30084 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30085 self.kind = v.into();
30086 self
30087 }
30088
30089 /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
30090 ///
30091 /// # Example
30092 /// ```ignore,no_run
30093 /// # use google_cloud_sql_v1::model::SslCert;
30094 /// let x = SslCert::new().set_cert_serial_number("example");
30095 /// ```
30096 pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
30097 mut self,
30098 v: T,
30099 ) -> Self {
30100 self.cert_serial_number = v.into();
30101 self
30102 }
30103
30104 /// Sets the value of [cert][crate::model::SslCert::cert].
30105 ///
30106 /// # Example
30107 /// ```ignore,no_run
30108 /// # use google_cloud_sql_v1::model::SslCert;
30109 /// let x = SslCert::new().set_cert("example");
30110 /// ```
30111 pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30112 self.cert = v.into();
30113 self
30114 }
30115
30116 /// Sets the value of [create_time][crate::model::SslCert::create_time].
30117 ///
30118 /// # Example
30119 /// ```ignore,no_run
30120 /// # use google_cloud_sql_v1::model::SslCert;
30121 /// use wkt::Timestamp;
30122 /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
30123 /// ```
30124 pub fn set_create_time<T>(mut self, v: T) -> Self
30125 where
30126 T: std::convert::Into<wkt::Timestamp>,
30127 {
30128 self.create_time = std::option::Option::Some(v.into());
30129 self
30130 }
30131
30132 /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
30133 ///
30134 /// # Example
30135 /// ```ignore,no_run
30136 /// # use google_cloud_sql_v1::model::SslCert;
30137 /// use wkt::Timestamp;
30138 /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
30139 /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
30140 /// ```
30141 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
30142 where
30143 T: std::convert::Into<wkt::Timestamp>,
30144 {
30145 self.create_time = v.map(|x| x.into());
30146 self
30147 }
30148
30149 /// Sets the value of [common_name][crate::model::SslCert::common_name].
30150 ///
30151 /// # Example
30152 /// ```ignore,no_run
30153 /// # use google_cloud_sql_v1::model::SslCert;
30154 /// let x = SslCert::new().set_common_name("example");
30155 /// ```
30156 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30157 self.common_name = v.into();
30158 self
30159 }
30160
30161 /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
30162 ///
30163 /// # Example
30164 /// ```ignore,no_run
30165 /// # use google_cloud_sql_v1::model::SslCert;
30166 /// use wkt::Timestamp;
30167 /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
30168 /// ```
30169 pub fn set_expiration_time<T>(mut self, v: T) -> Self
30170 where
30171 T: std::convert::Into<wkt::Timestamp>,
30172 {
30173 self.expiration_time = std::option::Option::Some(v.into());
30174 self
30175 }
30176
30177 /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
30178 ///
30179 /// # Example
30180 /// ```ignore,no_run
30181 /// # use google_cloud_sql_v1::model::SslCert;
30182 /// use wkt::Timestamp;
30183 /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
30184 /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
30185 /// ```
30186 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
30187 where
30188 T: std::convert::Into<wkt::Timestamp>,
30189 {
30190 self.expiration_time = v.map(|x| x.into());
30191 self
30192 }
30193
30194 /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
30195 ///
30196 /// # Example
30197 /// ```ignore,no_run
30198 /// # use google_cloud_sql_v1::model::SslCert;
30199 /// let x = SslCert::new().set_sha1_fingerprint("example");
30200 /// ```
30201 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30202 mut self,
30203 v: T,
30204 ) -> Self {
30205 self.sha1_fingerprint = v.into();
30206 self
30207 }
30208
30209 /// Sets the value of [instance][crate::model::SslCert::instance].
30210 ///
30211 /// # Example
30212 /// ```ignore,no_run
30213 /// # use google_cloud_sql_v1::model::SslCert;
30214 /// let x = SslCert::new().set_instance("example");
30215 /// ```
30216 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30217 self.instance = v.into();
30218 self
30219 }
30220
30221 /// Sets the value of [self_link][crate::model::SslCert::self_link].
30222 ///
30223 /// # Example
30224 /// ```ignore,no_run
30225 /// # use google_cloud_sql_v1::model::SslCert;
30226 /// let x = SslCert::new().set_self_link("example");
30227 /// ```
30228 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30229 self.self_link = v.into();
30230 self
30231 }
30232}
30233
30234impl wkt::message::Message for SslCert {
30235 fn typename() -> &'static str {
30236 "type.googleapis.com/google.cloud.sql.v1.SslCert"
30237 }
30238}
30239
30240/// SslCertDetail.
30241#[derive(Clone, Default, PartialEq)]
30242#[non_exhaustive]
30243pub struct SslCertDetail {
30244 /// The public information about the cert.
30245 pub cert_info: std::option::Option<crate::model::SslCert>,
30246
30247 /// The private key for the client cert, in pem format. Keep private in order
30248 /// to protect your security.
30249 pub cert_private_key: std::string::String,
30250
30251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30252}
30253
30254impl SslCertDetail {
30255 /// Creates a new default instance.
30256 pub fn new() -> Self {
30257 std::default::Default::default()
30258 }
30259
30260 /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
30261 ///
30262 /// # Example
30263 /// ```ignore,no_run
30264 /// # use google_cloud_sql_v1::model::SslCertDetail;
30265 /// use google_cloud_sql_v1::model::SslCert;
30266 /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
30267 /// ```
30268 pub fn set_cert_info<T>(mut self, v: T) -> Self
30269 where
30270 T: std::convert::Into<crate::model::SslCert>,
30271 {
30272 self.cert_info = std::option::Option::Some(v.into());
30273 self
30274 }
30275
30276 /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
30277 ///
30278 /// # Example
30279 /// ```ignore,no_run
30280 /// # use google_cloud_sql_v1::model::SslCertDetail;
30281 /// use google_cloud_sql_v1::model::SslCert;
30282 /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
30283 /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
30284 /// ```
30285 pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
30286 where
30287 T: std::convert::Into<crate::model::SslCert>,
30288 {
30289 self.cert_info = v.map(|x| x.into());
30290 self
30291 }
30292
30293 /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
30294 ///
30295 /// # Example
30296 /// ```ignore,no_run
30297 /// # use google_cloud_sql_v1::model::SslCertDetail;
30298 /// let x = SslCertDetail::new().set_cert_private_key("example");
30299 /// ```
30300 pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
30301 mut self,
30302 v: T,
30303 ) -> Self {
30304 self.cert_private_key = v.into();
30305 self
30306 }
30307}
30308
30309impl wkt::message::Message for SslCertDetail {
30310 fn typename() -> &'static str {
30311 "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
30312 }
30313}
30314
30315/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
30316#[derive(Clone, Default, PartialEq)]
30317#[non_exhaustive]
30318pub struct SqlActiveDirectoryConfig {
30319 /// This is always sql#activeDirectoryConfig.
30320 pub kind: std::string::String,
30321
30322 /// The name of the domain (e.g., mydomain.com).
30323 pub domain: std::string::String,
30324
30325 /// Optional. The mode of the Active Directory configuration.
30326 pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
30327
30328 /// Optional. Domain controller IPv4 addresses used to bootstrap Active
30329 /// Directory.
30330 pub dns_servers: std::vec::Vec<std::string::String>,
30331
30332 /// Optional. The secret manager key storing the administrator credential.
30333 /// (e.g., projects/{project}/secrets/{secret}).
30334 pub admin_credential_secret_name: std::string::String,
30335
30336 /// Optional. The organizational unit distinguished name. This is the full
30337 /// hierarchical path to the organizational unit.
30338 pub organizational_unit: std::string::String,
30339
30340 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30341}
30342
30343impl SqlActiveDirectoryConfig {
30344 /// Creates a new default instance.
30345 pub fn new() -> Self {
30346 std::default::Default::default()
30347 }
30348
30349 /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
30350 ///
30351 /// # Example
30352 /// ```ignore,no_run
30353 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30354 /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
30355 /// ```
30356 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30357 self.kind = v.into();
30358 self
30359 }
30360
30361 /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
30362 ///
30363 /// # Example
30364 /// ```ignore,no_run
30365 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30366 /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
30367 /// ```
30368 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30369 self.domain = v.into();
30370 self
30371 }
30372
30373 /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
30374 ///
30375 /// # Example
30376 /// ```ignore,no_run
30377 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30378 /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
30379 /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
30380 /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
30381 /// ```
30382 pub fn set_mode<
30383 T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
30384 >(
30385 mut self,
30386 v: T,
30387 ) -> Self {
30388 self.mode = v.into();
30389 self
30390 }
30391
30392 /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
30393 ///
30394 /// # Example
30395 /// ```ignore,no_run
30396 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30397 /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
30398 /// ```
30399 pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
30400 where
30401 T: std::iter::IntoIterator<Item = V>,
30402 V: std::convert::Into<std::string::String>,
30403 {
30404 use std::iter::Iterator;
30405 self.dns_servers = v.into_iter().map(|i| i.into()).collect();
30406 self
30407 }
30408
30409 /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
30410 ///
30411 /// # Example
30412 /// ```ignore,no_run
30413 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30414 /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
30415 /// ```
30416 pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
30417 mut self,
30418 v: T,
30419 ) -> Self {
30420 self.admin_credential_secret_name = v.into();
30421 self
30422 }
30423
30424 /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
30425 ///
30426 /// # Example
30427 /// ```ignore,no_run
30428 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30429 /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
30430 /// ```
30431 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
30432 mut self,
30433 v: T,
30434 ) -> Self {
30435 self.organizational_unit = v.into();
30436 self
30437 }
30438}
30439
30440impl wkt::message::Message for SqlActiveDirectoryConfig {
30441 fn typename() -> &'static str {
30442 "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
30443 }
30444}
30445
30446/// Defines additional types related to [SqlActiveDirectoryConfig].
30447pub mod sql_active_directory_config {
30448 #[allow(unused_imports)]
30449 use super::*;
30450
30451 /// The modes of Active Directory configuration.
30452 ///
30453 /// # Working with unknown values
30454 ///
30455 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30456 /// additional enum variants at any time. Adding new variants is not considered
30457 /// a breaking change. Applications should write their code in anticipation of:
30458 ///
30459 /// - New values appearing in future releases of the client library, **and**
30460 /// - New values received dynamically, without application changes.
30461 ///
30462 /// Please consult the [Working with enums] section in the user guide for some
30463 /// guidelines.
30464 ///
30465 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30466 #[derive(Clone, Debug, PartialEq)]
30467 #[non_exhaustive]
30468 pub enum ActiveDirectoryMode {
30469 /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
30470 /// not specified to maintain backward compatibility.
30471 Unspecified,
30472 /// Managed Active Directory mode.
30473 ManagedActiveDirectory,
30474 /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
30475 #[deprecated]
30476 SelfManagedActiveDirectory,
30477 /// Customer-managed Active Directory mode.
30478 CustomerManagedActiveDirectory,
30479 /// If set, the enum was initialized with an unknown value.
30480 ///
30481 /// Applications can examine the value using [ActiveDirectoryMode::value] or
30482 /// [ActiveDirectoryMode::name].
30483 UnknownValue(active_directory_mode::UnknownValue),
30484 }
30485
30486 #[doc(hidden)]
30487 pub mod active_directory_mode {
30488 #[allow(unused_imports)]
30489 use super::*;
30490 #[derive(Clone, Debug, PartialEq)]
30491 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30492 }
30493
30494 impl ActiveDirectoryMode {
30495 /// Gets the enum value.
30496 ///
30497 /// Returns `None` if the enum contains an unknown value deserialized from
30498 /// the string representation of enums.
30499 pub fn value(&self) -> std::option::Option<i32> {
30500 match self {
30501 Self::Unspecified => std::option::Option::Some(0),
30502 Self::ManagedActiveDirectory => std::option::Option::Some(1),
30503 Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
30504 Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
30505 Self::UnknownValue(u) => u.0.value(),
30506 }
30507 }
30508
30509 /// Gets the enum value as a string.
30510 ///
30511 /// Returns `None` if the enum contains an unknown value deserialized from
30512 /// the integer representation of enums.
30513 pub fn name(&self) -> std::option::Option<&str> {
30514 match self {
30515 Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
30516 Self::ManagedActiveDirectory => {
30517 std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
30518 }
30519 Self::SelfManagedActiveDirectory => {
30520 std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
30521 }
30522 Self::CustomerManagedActiveDirectory => {
30523 std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
30524 }
30525 Self::UnknownValue(u) => u.0.name(),
30526 }
30527 }
30528 }
30529
30530 impl std::default::Default for ActiveDirectoryMode {
30531 fn default() -> Self {
30532 use std::convert::From;
30533 Self::from(0)
30534 }
30535 }
30536
30537 impl std::fmt::Display for ActiveDirectoryMode {
30538 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30539 wkt::internal::display_enum(f, self.name(), self.value())
30540 }
30541 }
30542
30543 impl std::convert::From<i32> for ActiveDirectoryMode {
30544 fn from(value: i32) -> Self {
30545 match value {
30546 0 => Self::Unspecified,
30547 1 => Self::ManagedActiveDirectory,
30548 2 => Self::SelfManagedActiveDirectory,
30549 3 => Self::CustomerManagedActiveDirectory,
30550 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
30551 wkt::internal::UnknownEnumValue::Integer(value),
30552 )),
30553 }
30554 }
30555 }
30556
30557 impl std::convert::From<&str> for ActiveDirectoryMode {
30558 fn from(value: &str) -> Self {
30559 use std::string::ToString;
30560 match value {
30561 "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
30562 "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
30563 "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
30564 "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
30565 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
30566 wkt::internal::UnknownEnumValue::String(value.to_string()),
30567 )),
30568 }
30569 }
30570 }
30571
30572 impl serde::ser::Serialize for ActiveDirectoryMode {
30573 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30574 where
30575 S: serde::Serializer,
30576 {
30577 match self {
30578 Self::Unspecified => serializer.serialize_i32(0),
30579 Self::ManagedActiveDirectory => serializer.serialize_i32(1),
30580 Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
30581 Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
30582 Self::UnknownValue(u) => u.0.serialize(serializer),
30583 }
30584 }
30585 }
30586
30587 impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
30588 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30589 where
30590 D: serde::Deserializer<'de>,
30591 {
30592 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
30593 ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
30594 ))
30595 }
30596 }
30597}
30598
30599/// SQL Server specific audit configuration.
30600#[derive(Clone, Default, PartialEq)]
30601#[non_exhaustive]
30602pub struct SqlServerAuditConfig {
30603 /// This is always sql#sqlServerAuditConfig
30604 pub kind: std::string::String,
30605
30606 /// The name of the destination bucket (e.g., gs://mybucket).
30607 pub bucket: std::string::String,
30608
30609 /// How long to keep generated audit files.
30610 pub retention_interval: std::option::Option<wkt::Duration>,
30611
30612 /// How often to upload generated audit files.
30613 pub upload_interval: std::option::Option<wkt::Duration>,
30614
30615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30616}
30617
30618impl SqlServerAuditConfig {
30619 /// Creates a new default instance.
30620 pub fn new() -> Self {
30621 std::default::Default::default()
30622 }
30623
30624 /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
30625 ///
30626 /// # Example
30627 /// ```ignore,no_run
30628 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30629 /// let x = SqlServerAuditConfig::new().set_kind("example");
30630 /// ```
30631 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30632 self.kind = v.into();
30633 self
30634 }
30635
30636 /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
30637 ///
30638 /// # Example
30639 /// ```ignore,no_run
30640 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30641 /// let x = SqlServerAuditConfig::new().set_bucket("example");
30642 /// ```
30643 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30644 self.bucket = v.into();
30645 self
30646 }
30647
30648 /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
30649 ///
30650 /// # Example
30651 /// ```ignore,no_run
30652 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30653 /// use wkt::Duration;
30654 /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
30655 /// ```
30656 pub fn set_retention_interval<T>(mut self, v: T) -> Self
30657 where
30658 T: std::convert::Into<wkt::Duration>,
30659 {
30660 self.retention_interval = std::option::Option::Some(v.into());
30661 self
30662 }
30663
30664 /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
30665 ///
30666 /// # Example
30667 /// ```ignore,no_run
30668 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30669 /// use wkt::Duration;
30670 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
30671 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
30672 /// ```
30673 pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
30674 where
30675 T: std::convert::Into<wkt::Duration>,
30676 {
30677 self.retention_interval = v.map(|x| x.into());
30678 self
30679 }
30680
30681 /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
30682 ///
30683 /// # Example
30684 /// ```ignore,no_run
30685 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30686 /// use wkt::Duration;
30687 /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
30688 /// ```
30689 pub fn set_upload_interval<T>(mut self, v: T) -> Self
30690 where
30691 T: std::convert::Into<wkt::Duration>,
30692 {
30693 self.upload_interval = std::option::Option::Some(v.into());
30694 self
30695 }
30696
30697 /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
30698 ///
30699 /// # Example
30700 /// ```ignore,no_run
30701 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30702 /// use wkt::Duration;
30703 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
30704 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
30705 /// ```
30706 pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
30707 where
30708 T: std::convert::Into<wkt::Duration>,
30709 {
30710 self.upload_interval = v.map(|x| x.into());
30711 self
30712 }
30713}
30714
30715impl wkt::message::Message for SqlServerAuditConfig {
30716 fn typename() -> &'static str {
30717 "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
30718 }
30719}
30720
30721/// SQL Server Entra ID configuration.
30722#[derive(Clone, Default, PartialEq)]
30723#[non_exhaustive]
30724pub struct SqlServerEntraIdConfig {
30725 /// Output only. This is always sql#sqlServerEntraIdConfig
30726 pub kind: std::string::String,
30727
30728 /// Optional. The tenant ID for the Entra ID configuration.
30729 pub tenant_id: std::string::String,
30730
30731 /// Optional. The application ID for the Entra ID configuration.
30732 pub application_id: std::string::String,
30733
30734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30735}
30736
30737impl SqlServerEntraIdConfig {
30738 /// Creates a new default instance.
30739 pub fn new() -> Self {
30740 std::default::Default::default()
30741 }
30742
30743 /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
30744 ///
30745 /// # Example
30746 /// ```ignore,no_run
30747 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
30748 /// let x = SqlServerEntraIdConfig::new().set_kind("example");
30749 /// ```
30750 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30751 self.kind = v.into();
30752 self
30753 }
30754
30755 /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
30756 ///
30757 /// # Example
30758 /// ```ignore,no_run
30759 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
30760 /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
30761 /// ```
30762 pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30763 self.tenant_id = v.into();
30764 self
30765 }
30766
30767 /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
30768 ///
30769 /// # Example
30770 /// ```ignore,no_run
30771 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
30772 /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
30773 /// ```
30774 pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30775 self.application_id = v.into();
30776 self
30777 }
30778}
30779
30780impl wkt::message::Message for SqlServerEntraIdConfig {
30781 fn typename() -> &'static str {
30782 "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
30783 }
30784}
30785
30786/// Acquire SSRS lease context.
30787#[derive(Clone, Default, PartialEq)]
30788#[non_exhaustive]
30789pub struct AcquireSsrsLeaseContext {
30790 /// The username to be used as the setup login to connect to the database
30791 /// server for SSRS setup.
30792 pub setup_login: std::option::Option<std::string::String>,
30793
30794 /// The username to be used as the service login to connect to the report
30795 /// database for SSRS setup.
30796 pub service_login: std::option::Option<std::string::String>,
30797
30798 /// The report database to be used for SSRS setup.
30799 pub report_database: std::option::Option<std::string::String>,
30800
30801 /// Lease duration needed for SSRS setup.
30802 pub duration: std::option::Option<wkt::Duration>,
30803
30804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30805}
30806
30807impl AcquireSsrsLeaseContext {
30808 /// Creates a new default instance.
30809 pub fn new() -> Self {
30810 std::default::Default::default()
30811 }
30812
30813 /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
30814 ///
30815 /// # Example
30816 /// ```ignore,no_run
30817 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30818 /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
30819 /// ```
30820 pub fn set_setup_login<T>(mut self, v: T) -> Self
30821 where
30822 T: std::convert::Into<std::string::String>,
30823 {
30824 self.setup_login = std::option::Option::Some(v.into());
30825 self
30826 }
30827
30828 /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
30829 ///
30830 /// # Example
30831 /// ```ignore,no_run
30832 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30833 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
30834 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
30835 /// ```
30836 pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
30837 where
30838 T: std::convert::Into<std::string::String>,
30839 {
30840 self.setup_login = v.map(|x| x.into());
30841 self
30842 }
30843
30844 /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
30845 ///
30846 /// # Example
30847 /// ```ignore,no_run
30848 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30849 /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
30850 /// ```
30851 pub fn set_service_login<T>(mut self, v: T) -> Self
30852 where
30853 T: std::convert::Into<std::string::String>,
30854 {
30855 self.service_login = std::option::Option::Some(v.into());
30856 self
30857 }
30858
30859 /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
30860 ///
30861 /// # Example
30862 /// ```ignore,no_run
30863 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30864 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
30865 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
30866 /// ```
30867 pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
30868 where
30869 T: std::convert::Into<std::string::String>,
30870 {
30871 self.service_login = v.map(|x| x.into());
30872 self
30873 }
30874
30875 /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
30876 ///
30877 /// # Example
30878 /// ```ignore,no_run
30879 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30880 /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
30881 /// ```
30882 pub fn set_report_database<T>(mut self, v: T) -> Self
30883 where
30884 T: std::convert::Into<std::string::String>,
30885 {
30886 self.report_database = std::option::Option::Some(v.into());
30887 self
30888 }
30889
30890 /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
30891 ///
30892 /// # Example
30893 /// ```ignore,no_run
30894 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30895 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
30896 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
30897 /// ```
30898 pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
30899 where
30900 T: std::convert::Into<std::string::String>,
30901 {
30902 self.report_database = v.map(|x| x.into());
30903 self
30904 }
30905
30906 /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
30907 ///
30908 /// # Example
30909 /// ```ignore,no_run
30910 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30911 /// use wkt::Duration;
30912 /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
30913 /// ```
30914 pub fn set_duration<T>(mut self, v: T) -> Self
30915 where
30916 T: std::convert::Into<wkt::Duration>,
30917 {
30918 self.duration = std::option::Option::Some(v.into());
30919 self
30920 }
30921
30922 /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
30923 ///
30924 /// # Example
30925 /// ```ignore,no_run
30926 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30927 /// use wkt::Duration;
30928 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
30929 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
30930 /// ```
30931 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
30932 where
30933 T: std::convert::Into<wkt::Duration>,
30934 {
30935 self.duration = v.map(|x| x.into());
30936 self
30937 }
30938}
30939
30940impl wkt::message::Message for AcquireSsrsLeaseContext {
30941 fn typename() -> &'static str {
30942 "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
30943 }
30944}
30945
30946/// DNS metadata.
30947#[derive(Clone, Default, PartialEq)]
30948#[non_exhaustive]
30949pub struct DnsNameMapping {
30950 /// Output only. The DNS name.
30951 pub name: std::string::String,
30952
30953 /// Output only. The connection type of the DNS name.
30954 pub connection_type: crate::model::dns_name_mapping::ConnectionType,
30955
30956 /// Output only. The scope that the DNS name applies to.
30957 pub dns_scope: crate::model::dns_name_mapping::DnsScope,
30958
30959 /// Output only. The manager for this DNS record.
30960 pub record_manager: crate::model::dns_name_mapping::RecordManager,
30961
30962 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30963}
30964
30965impl DnsNameMapping {
30966 /// Creates a new default instance.
30967 pub fn new() -> Self {
30968 std::default::Default::default()
30969 }
30970
30971 /// Sets the value of [name][crate::model::DnsNameMapping::name].
30972 ///
30973 /// # Example
30974 /// ```ignore,no_run
30975 /// # use google_cloud_sql_v1::model::DnsNameMapping;
30976 /// let x = DnsNameMapping::new().set_name("example");
30977 /// ```
30978 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30979 self.name = v.into();
30980 self
30981 }
30982
30983 /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
30984 ///
30985 /// # Example
30986 /// ```ignore,no_run
30987 /// # use google_cloud_sql_v1::model::DnsNameMapping;
30988 /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
30989 /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
30990 /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
30991 /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
30992 /// ```
30993 pub fn set_connection_type<
30994 T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
30995 >(
30996 mut self,
30997 v: T,
30998 ) -> Self {
30999 self.connection_type = v.into();
31000 self
31001 }
31002
31003 /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
31004 ///
31005 /// # Example
31006 /// ```ignore,no_run
31007 /// # use google_cloud_sql_v1::model::DnsNameMapping;
31008 /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
31009 /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
31010 /// let x1 = DnsNameMapping::new().set_dns_scope(DnsScope::Cluster);
31011 /// ```
31012 pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
31013 mut self,
31014 v: T,
31015 ) -> Self {
31016 self.dns_scope = v.into();
31017 self
31018 }
31019
31020 /// Sets the value of [record_manager][crate::model::DnsNameMapping::record_manager].
31021 ///
31022 /// # Example
31023 /// ```ignore,no_run
31024 /// # use google_cloud_sql_v1::model::DnsNameMapping;
31025 /// use google_cloud_sql_v1::model::dns_name_mapping::RecordManager;
31026 /// let x0 = DnsNameMapping::new().set_record_manager(RecordManager::Customer);
31027 /// let x1 = DnsNameMapping::new().set_record_manager(RecordManager::CloudSqlAutomation);
31028 /// ```
31029 pub fn set_record_manager<
31030 T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
31031 >(
31032 mut self,
31033 v: T,
31034 ) -> Self {
31035 self.record_manager = v.into();
31036 self
31037 }
31038}
31039
31040impl wkt::message::Message for DnsNameMapping {
31041 fn typename() -> &'static str {
31042 "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
31043 }
31044}
31045
31046/// Defines additional types related to [DnsNameMapping].
31047pub mod dns_name_mapping {
31048 #[allow(unused_imports)]
31049 use super::*;
31050
31051 /// The connection type of the DNS name.
31052 /// This enum is not frozen, and new values may be added in the future.
31053 ///
31054 /// # Working with unknown values
31055 ///
31056 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31057 /// additional enum variants at any time. Adding new variants is not considered
31058 /// a breaking change. Applications should write their code in anticipation of:
31059 ///
31060 /// - New values appearing in future releases of the client library, **and**
31061 /// - New values received dynamically, without application changes.
31062 ///
31063 /// Please consult the [Working with enums] section in the user guide for some
31064 /// guidelines.
31065 ///
31066 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31067 #[derive(Clone, Debug, PartialEq)]
31068 #[non_exhaustive]
31069 pub enum ConnectionType {
31070 /// Unknown connection type.
31071 Unspecified,
31072 /// Public IP.
31073 Public,
31074 /// Private services access (private IP).
31075 PrivateServicesAccess,
31076 /// Private Service Connect.
31077 PrivateServiceConnect,
31078 /// If set, the enum was initialized with an unknown value.
31079 ///
31080 /// Applications can examine the value using [ConnectionType::value] or
31081 /// [ConnectionType::name].
31082 UnknownValue(connection_type::UnknownValue),
31083 }
31084
31085 #[doc(hidden)]
31086 pub mod connection_type {
31087 #[allow(unused_imports)]
31088 use super::*;
31089 #[derive(Clone, Debug, PartialEq)]
31090 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31091 }
31092
31093 impl ConnectionType {
31094 /// Gets the enum value.
31095 ///
31096 /// Returns `None` if the enum contains an unknown value deserialized from
31097 /// the string representation of enums.
31098 pub fn value(&self) -> std::option::Option<i32> {
31099 match self {
31100 Self::Unspecified => std::option::Option::Some(0),
31101 Self::Public => std::option::Option::Some(1),
31102 Self::PrivateServicesAccess => std::option::Option::Some(2),
31103 Self::PrivateServiceConnect => std::option::Option::Some(3),
31104 Self::UnknownValue(u) => u.0.value(),
31105 }
31106 }
31107
31108 /// Gets the enum value as a string.
31109 ///
31110 /// Returns `None` if the enum contains an unknown value deserialized from
31111 /// the integer representation of enums.
31112 pub fn name(&self) -> std::option::Option<&str> {
31113 match self {
31114 Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
31115 Self::Public => std::option::Option::Some("PUBLIC"),
31116 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
31117 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
31118 Self::UnknownValue(u) => u.0.name(),
31119 }
31120 }
31121 }
31122
31123 impl std::default::Default for ConnectionType {
31124 fn default() -> Self {
31125 use std::convert::From;
31126 Self::from(0)
31127 }
31128 }
31129
31130 impl std::fmt::Display for ConnectionType {
31131 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31132 wkt::internal::display_enum(f, self.name(), self.value())
31133 }
31134 }
31135
31136 impl std::convert::From<i32> for ConnectionType {
31137 fn from(value: i32) -> Self {
31138 match value {
31139 0 => Self::Unspecified,
31140 1 => Self::Public,
31141 2 => Self::PrivateServicesAccess,
31142 3 => Self::PrivateServiceConnect,
31143 _ => Self::UnknownValue(connection_type::UnknownValue(
31144 wkt::internal::UnknownEnumValue::Integer(value),
31145 )),
31146 }
31147 }
31148 }
31149
31150 impl std::convert::From<&str> for ConnectionType {
31151 fn from(value: &str) -> Self {
31152 use std::string::ToString;
31153 match value {
31154 "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
31155 "PUBLIC" => Self::Public,
31156 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
31157 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
31158 _ => Self::UnknownValue(connection_type::UnknownValue(
31159 wkt::internal::UnknownEnumValue::String(value.to_string()),
31160 )),
31161 }
31162 }
31163 }
31164
31165 impl serde::ser::Serialize for ConnectionType {
31166 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31167 where
31168 S: serde::Serializer,
31169 {
31170 match self {
31171 Self::Unspecified => serializer.serialize_i32(0),
31172 Self::Public => serializer.serialize_i32(1),
31173 Self::PrivateServicesAccess => serializer.serialize_i32(2),
31174 Self::PrivateServiceConnect => serializer.serialize_i32(3),
31175 Self::UnknownValue(u) => u.0.serialize(serializer),
31176 }
31177 }
31178 }
31179
31180 impl<'de> serde::de::Deserialize<'de> for ConnectionType {
31181 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31182 where
31183 D: serde::Deserializer<'de>,
31184 {
31185 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
31186 ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
31187 ))
31188 }
31189 }
31190
31191 /// The scope that the DNS name applies to.
31192 ///
31193 /// # Working with unknown values
31194 ///
31195 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31196 /// additional enum variants at any time. Adding new variants is not considered
31197 /// a breaking change. Applications should write their code in anticipation of:
31198 ///
31199 /// - New values appearing in future releases of the client library, **and**
31200 /// - New values received dynamically, without application changes.
31201 ///
31202 /// Please consult the [Working with enums] section in the user guide for some
31203 /// guidelines.
31204 ///
31205 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31206 #[derive(Clone, Debug, PartialEq)]
31207 #[non_exhaustive]
31208 pub enum DnsScope {
31209 /// DNS scope not set. This value should not be used.
31210 Unspecified,
31211 /// Indicates an instance-level DNS name.
31212 Instance,
31213 /// Indicates a cluster-level DNS name.
31214 Cluster,
31215 /// If set, the enum was initialized with an unknown value.
31216 ///
31217 /// Applications can examine the value using [DnsScope::value] or
31218 /// [DnsScope::name].
31219 UnknownValue(dns_scope::UnknownValue),
31220 }
31221
31222 #[doc(hidden)]
31223 pub mod dns_scope {
31224 #[allow(unused_imports)]
31225 use super::*;
31226 #[derive(Clone, Debug, PartialEq)]
31227 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31228 }
31229
31230 impl DnsScope {
31231 /// Gets the enum value.
31232 ///
31233 /// Returns `None` if the enum contains an unknown value deserialized from
31234 /// the string representation of enums.
31235 pub fn value(&self) -> std::option::Option<i32> {
31236 match self {
31237 Self::Unspecified => std::option::Option::Some(0),
31238 Self::Instance => std::option::Option::Some(1),
31239 Self::Cluster => std::option::Option::Some(2),
31240 Self::UnknownValue(u) => u.0.value(),
31241 }
31242 }
31243
31244 /// Gets the enum value as a string.
31245 ///
31246 /// Returns `None` if the enum contains an unknown value deserialized from
31247 /// the integer representation of enums.
31248 pub fn name(&self) -> std::option::Option<&str> {
31249 match self {
31250 Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
31251 Self::Instance => std::option::Option::Some("INSTANCE"),
31252 Self::Cluster => std::option::Option::Some("CLUSTER"),
31253 Self::UnknownValue(u) => u.0.name(),
31254 }
31255 }
31256 }
31257
31258 impl std::default::Default for DnsScope {
31259 fn default() -> Self {
31260 use std::convert::From;
31261 Self::from(0)
31262 }
31263 }
31264
31265 impl std::fmt::Display for DnsScope {
31266 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31267 wkt::internal::display_enum(f, self.name(), self.value())
31268 }
31269 }
31270
31271 impl std::convert::From<i32> for DnsScope {
31272 fn from(value: i32) -> Self {
31273 match value {
31274 0 => Self::Unspecified,
31275 1 => Self::Instance,
31276 2 => Self::Cluster,
31277 _ => Self::UnknownValue(dns_scope::UnknownValue(
31278 wkt::internal::UnknownEnumValue::Integer(value),
31279 )),
31280 }
31281 }
31282 }
31283
31284 impl std::convert::From<&str> for DnsScope {
31285 fn from(value: &str) -> Self {
31286 use std::string::ToString;
31287 match value {
31288 "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
31289 "INSTANCE" => Self::Instance,
31290 "CLUSTER" => Self::Cluster,
31291 _ => Self::UnknownValue(dns_scope::UnknownValue(
31292 wkt::internal::UnknownEnumValue::String(value.to_string()),
31293 )),
31294 }
31295 }
31296 }
31297
31298 impl serde::ser::Serialize for DnsScope {
31299 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31300 where
31301 S: serde::Serializer,
31302 {
31303 match self {
31304 Self::Unspecified => serializer.serialize_i32(0),
31305 Self::Instance => serializer.serialize_i32(1),
31306 Self::Cluster => serializer.serialize_i32(2),
31307 Self::UnknownValue(u) => u.0.serialize(serializer),
31308 }
31309 }
31310 }
31311
31312 impl<'de> serde::de::Deserialize<'de> for DnsScope {
31313 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31314 where
31315 D: serde::Deserializer<'de>,
31316 {
31317 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
31318 ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
31319 ))
31320 }
31321 }
31322
31323 /// The system responsible for managing the DNS record.
31324 ///
31325 /// # Working with unknown values
31326 ///
31327 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31328 /// additional enum variants at any time. Adding new variants is not considered
31329 /// a breaking change. Applications should write their code in anticipation of:
31330 ///
31331 /// - New values appearing in future releases of the client library, **and**
31332 /// - New values received dynamically, without application changes.
31333 ///
31334 /// Please consult the [Working with enums] section in the user guide for some
31335 /// guidelines.
31336 ///
31337 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31338 #[derive(Clone, Debug, PartialEq)]
31339 #[non_exhaustive]
31340 pub enum RecordManager {
31341 /// Record manager not set. This value should not be used.
31342 Unspecified,
31343 /// The record may be managed by the customer. It is not automatically
31344 /// managed by Cloud SQL automation.
31345 Customer,
31346 /// The record is managed by Cloud SQL, which will create, update,
31347 /// and delete the DNS records for the zone automatically when
31348 /// the Cloud SQL database instance is created or updated.
31349 CloudSqlAutomation,
31350 /// If set, the enum was initialized with an unknown value.
31351 ///
31352 /// Applications can examine the value using [RecordManager::value] or
31353 /// [RecordManager::name].
31354 UnknownValue(record_manager::UnknownValue),
31355 }
31356
31357 #[doc(hidden)]
31358 pub mod record_manager {
31359 #[allow(unused_imports)]
31360 use super::*;
31361 #[derive(Clone, Debug, PartialEq)]
31362 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31363 }
31364
31365 impl RecordManager {
31366 /// Gets the enum value.
31367 ///
31368 /// Returns `None` if the enum contains an unknown value deserialized from
31369 /// the string representation of enums.
31370 pub fn value(&self) -> std::option::Option<i32> {
31371 match self {
31372 Self::Unspecified => std::option::Option::Some(0),
31373 Self::Customer => std::option::Option::Some(1),
31374 Self::CloudSqlAutomation => std::option::Option::Some(2),
31375 Self::UnknownValue(u) => u.0.value(),
31376 }
31377 }
31378
31379 /// Gets the enum value as a string.
31380 ///
31381 /// Returns `None` if the enum contains an unknown value deserialized from
31382 /// the integer representation of enums.
31383 pub fn name(&self) -> std::option::Option<&str> {
31384 match self {
31385 Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
31386 Self::Customer => std::option::Option::Some("CUSTOMER"),
31387 Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
31388 Self::UnknownValue(u) => u.0.name(),
31389 }
31390 }
31391 }
31392
31393 impl std::default::Default for RecordManager {
31394 fn default() -> Self {
31395 use std::convert::From;
31396 Self::from(0)
31397 }
31398 }
31399
31400 impl std::fmt::Display for RecordManager {
31401 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31402 wkt::internal::display_enum(f, self.name(), self.value())
31403 }
31404 }
31405
31406 impl std::convert::From<i32> for RecordManager {
31407 fn from(value: i32) -> Self {
31408 match value {
31409 0 => Self::Unspecified,
31410 1 => Self::Customer,
31411 2 => Self::CloudSqlAutomation,
31412 _ => Self::UnknownValue(record_manager::UnknownValue(
31413 wkt::internal::UnknownEnumValue::Integer(value),
31414 )),
31415 }
31416 }
31417 }
31418
31419 impl std::convert::From<&str> for RecordManager {
31420 fn from(value: &str) -> Self {
31421 use std::string::ToString;
31422 match value {
31423 "RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
31424 "CUSTOMER" => Self::Customer,
31425 "CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
31426 _ => Self::UnknownValue(record_manager::UnknownValue(
31427 wkt::internal::UnknownEnumValue::String(value.to_string()),
31428 )),
31429 }
31430 }
31431 }
31432
31433 impl serde::ser::Serialize for RecordManager {
31434 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31435 where
31436 S: serde::Serializer,
31437 {
31438 match self {
31439 Self::Unspecified => serializer.serialize_i32(0),
31440 Self::Customer => serializer.serialize_i32(1),
31441 Self::CloudSqlAutomation => serializer.serialize_i32(2),
31442 Self::UnknownValue(u) => u.0.serialize(serializer),
31443 }
31444 }
31445 }
31446
31447 impl<'de> serde::de::Deserialize<'de> for RecordManager {
31448 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31449 where
31450 D: serde::Deserializer<'de>,
31451 {
31452 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
31453 ".google.cloud.sql.v1.DnsNameMapping.RecordManager",
31454 ))
31455 }
31456 }
31457}
31458
31459#[allow(missing_docs)]
31460#[derive(Clone, Default, PartialEq)]
31461#[non_exhaustive]
31462pub struct SqlSslCertsDeleteRequest {
31463 /// Cloud SQL instance ID. This does not include the project ID.
31464 pub instance: std::string::String,
31465
31466 /// Project ID of the project that contains the instance.
31467 pub project: std::string::String,
31468
31469 /// Sha1 FingerPrint.
31470 pub sha1_fingerprint: std::string::String,
31471
31472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31473}
31474
31475impl SqlSslCertsDeleteRequest {
31476 /// Creates a new default instance.
31477 pub fn new() -> Self {
31478 std::default::Default::default()
31479 }
31480
31481 /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
31482 ///
31483 /// # Example
31484 /// ```ignore,no_run
31485 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
31486 /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
31487 /// ```
31488 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31489 self.instance = v.into();
31490 self
31491 }
31492
31493 /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
31494 ///
31495 /// # Example
31496 /// ```ignore,no_run
31497 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
31498 /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
31499 /// ```
31500 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31501 self.project = v.into();
31502 self
31503 }
31504
31505 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
31506 ///
31507 /// # Example
31508 /// ```ignore,no_run
31509 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
31510 /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
31511 /// ```
31512 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
31513 mut self,
31514 v: T,
31515 ) -> Self {
31516 self.sha1_fingerprint = v.into();
31517 self
31518 }
31519}
31520
31521impl wkt::message::Message for SqlSslCertsDeleteRequest {
31522 fn typename() -> &'static str {
31523 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
31524 }
31525}
31526
31527#[allow(missing_docs)]
31528#[derive(Clone, Default, PartialEq)]
31529#[non_exhaustive]
31530pub struct SqlSslCertsGetRequest {
31531 /// Cloud SQL instance ID. This does not include the project ID.
31532 pub instance: std::string::String,
31533
31534 /// Project ID of the project that contains the instance.
31535 pub project: std::string::String,
31536
31537 /// Sha1 FingerPrint.
31538 pub sha1_fingerprint: std::string::String,
31539
31540 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31541}
31542
31543impl SqlSslCertsGetRequest {
31544 /// Creates a new default instance.
31545 pub fn new() -> Self {
31546 std::default::Default::default()
31547 }
31548
31549 /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
31550 ///
31551 /// # Example
31552 /// ```ignore,no_run
31553 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
31554 /// let x = SqlSslCertsGetRequest::new().set_instance("example");
31555 /// ```
31556 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31557 self.instance = v.into();
31558 self
31559 }
31560
31561 /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
31562 ///
31563 /// # Example
31564 /// ```ignore,no_run
31565 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
31566 /// let x = SqlSslCertsGetRequest::new().set_project("example");
31567 /// ```
31568 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31569 self.project = v.into();
31570 self
31571 }
31572
31573 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
31574 ///
31575 /// # Example
31576 /// ```ignore,no_run
31577 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
31578 /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
31579 /// ```
31580 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
31581 mut self,
31582 v: T,
31583 ) -> Self {
31584 self.sha1_fingerprint = v.into();
31585 self
31586 }
31587}
31588
31589impl wkt::message::Message for SqlSslCertsGetRequest {
31590 fn typename() -> &'static str {
31591 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
31592 }
31593}
31594
31595#[allow(missing_docs)]
31596#[derive(Clone, Default, PartialEq)]
31597#[non_exhaustive]
31598pub struct SqlSslCertsInsertRequest {
31599 /// Cloud SQL instance ID. This does not include the project ID.
31600 pub instance: std::string::String,
31601
31602 /// Project ID of the project that contains the instance.
31603 pub project: std::string::String,
31604
31605 #[allow(missing_docs)]
31606 pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
31607
31608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31609}
31610
31611impl SqlSslCertsInsertRequest {
31612 /// Creates a new default instance.
31613 pub fn new() -> Self {
31614 std::default::Default::default()
31615 }
31616
31617 /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
31618 ///
31619 /// # Example
31620 /// ```ignore,no_run
31621 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31622 /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
31623 /// ```
31624 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31625 self.instance = v.into();
31626 self
31627 }
31628
31629 /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
31630 ///
31631 /// # Example
31632 /// ```ignore,no_run
31633 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31634 /// let x = SqlSslCertsInsertRequest::new().set_project("example");
31635 /// ```
31636 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31637 self.project = v.into();
31638 self
31639 }
31640
31641 /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
31642 ///
31643 /// # Example
31644 /// ```ignore,no_run
31645 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31646 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
31647 /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
31648 /// ```
31649 pub fn set_body<T>(mut self, v: T) -> Self
31650 where
31651 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
31652 {
31653 self.body = std::option::Option::Some(v.into());
31654 self
31655 }
31656
31657 /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
31658 ///
31659 /// # Example
31660 /// ```ignore,no_run
31661 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31662 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
31663 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
31664 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
31665 /// ```
31666 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31667 where
31668 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
31669 {
31670 self.body = v.map(|x| x.into());
31671 self
31672 }
31673}
31674
31675impl wkt::message::Message for SqlSslCertsInsertRequest {
31676 fn typename() -> &'static str {
31677 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
31678 }
31679}
31680
31681#[allow(missing_docs)]
31682#[derive(Clone, Default, PartialEq)]
31683#[non_exhaustive]
31684pub struct SqlSslCertsListRequest {
31685 /// Cloud SQL instance ID. This does not include the project ID.
31686 pub instance: std::string::String,
31687
31688 /// Project ID of the project that contains the instance.
31689 pub project: std::string::String,
31690
31691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31692}
31693
31694impl SqlSslCertsListRequest {
31695 /// Creates a new default instance.
31696 pub fn new() -> Self {
31697 std::default::Default::default()
31698 }
31699
31700 /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
31701 ///
31702 /// # Example
31703 /// ```ignore,no_run
31704 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
31705 /// let x = SqlSslCertsListRequest::new().set_instance("example");
31706 /// ```
31707 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31708 self.instance = v.into();
31709 self
31710 }
31711
31712 /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
31713 ///
31714 /// # Example
31715 /// ```ignore,no_run
31716 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
31717 /// let x = SqlSslCertsListRequest::new().set_project("example");
31718 /// ```
31719 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31720 self.project = v.into();
31721 self
31722 }
31723}
31724
31725impl wkt::message::Message for SqlSslCertsListRequest {
31726 fn typename() -> &'static str {
31727 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
31728 }
31729}
31730
31731/// SslCerts insert request.
31732#[derive(Clone, Default, PartialEq)]
31733#[non_exhaustive]
31734pub struct SslCertsInsertRequest {
31735 /// User supplied name. Must be a distinct name from the other certificates
31736 /// for this instance.
31737 pub common_name: std::string::String,
31738
31739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31740}
31741
31742impl SslCertsInsertRequest {
31743 /// Creates a new default instance.
31744 pub fn new() -> Self {
31745 std::default::Default::default()
31746 }
31747
31748 /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
31749 ///
31750 /// # Example
31751 /// ```ignore,no_run
31752 /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
31753 /// let x = SslCertsInsertRequest::new().set_common_name("example");
31754 /// ```
31755 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31756 self.common_name = v.into();
31757 self
31758 }
31759}
31760
31761impl wkt::message::Message for SslCertsInsertRequest {
31762 fn typename() -> &'static str {
31763 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
31764 }
31765}
31766
31767/// SslCert insert response.
31768#[derive(Clone, Default, PartialEq)]
31769#[non_exhaustive]
31770pub struct SslCertsInsertResponse {
31771 /// This is always `sql#sslCertsInsert`.
31772 pub kind: std::string::String,
31773
31774 /// The operation to track the ssl certs insert request.
31775 pub operation: std::option::Option<crate::model::Operation>,
31776
31777 /// The server Certificate Authority's certificate. If this is missing you can
31778 /// force a new one to be generated by calling resetSslConfig method on
31779 /// instances resource.
31780 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
31781
31782 /// The new client certificate and private key.
31783 pub client_cert: std::option::Option<crate::model::SslCertDetail>,
31784
31785 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31786}
31787
31788impl SslCertsInsertResponse {
31789 /// Creates a new default instance.
31790 pub fn new() -> Self {
31791 std::default::Default::default()
31792 }
31793
31794 /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
31795 ///
31796 /// # Example
31797 /// ```ignore,no_run
31798 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31799 /// let x = SslCertsInsertResponse::new().set_kind("example");
31800 /// ```
31801 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31802 self.kind = v.into();
31803 self
31804 }
31805
31806 /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
31807 ///
31808 /// # Example
31809 /// ```ignore,no_run
31810 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31811 /// use google_cloud_sql_v1::model::Operation;
31812 /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
31813 /// ```
31814 pub fn set_operation<T>(mut self, v: T) -> Self
31815 where
31816 T: std::convert::Into<crate::model::Operation>,
31817 {
31818 self.operation = std::option::Option::Some(v.into());
31819 self
31820 }
31821
31822 /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
31823 ///
31824 /// # Example
31825 /// ```ignore,no_run
31826 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31827 /// use google_cloud_sql_v1::model::Operation;
31828 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
31829 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
31830 /// ```
31831 pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
31832 where
31833 T: std::convert::Into<crate::model::Operation>,
31834 {
31835 self.operation = v.map(|x| x.into());
31836 self
31837 }
31838
31839 /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
31840 ///
31841 /// # Example
31842 /// ```ignore,no_run
31843 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31844 /// use google_cloud_sql_v1::model::SslCert;
31845 /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
31846 /// ```
31847 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
31848 where
31849 T: std::convert::Into<crate::model::SslCert>,
31850 {
31851 self.server_ca_cert = std::option::Option::Some(v.into());
31852 self
31853 }
31854
31855 /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
31856 ///
31857 /// # Example
31858 /// ```ignore,no_run
31859 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31860 /// use google_cloud_sql_v1::model::SslCert;
31861 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
31862 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
31863 /// ```
31864 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
31865 where
31866 T: std::convert::Into<crate::model::SslCert>,
31867 {
31868 self.server_ca_cert = v.map(|x| x.into());
31869 self
31870 }
31871
31872 /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
31873 ///
31874 /// # Example
31875 /// ```ignore,no_run
31876 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31877 /// use google_cloud_sql_v1::model::SslCertDetail;
31878 /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
31879 /// ```
31880 pub fn set_client_cert<T>(mut self, v: T) -> Self
31881 where
31882 T: std::convert::Into<crate::model::SslCertDetail>,
31883 {
31884 self.client_cert = std::option::Option::Some(v.into());
31885 self
31886 }
31887
31888 /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
31889 ///
31890 /// # Example
31891 /// ```ignore,no_run
31892 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31893 /// use google_cloud_sql_v1::model::SslCertDetail;
31894 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
31895 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
31896 /// ```
31897 pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
31898 where
31899 T: std::convert::Into<crate::model::SslCertDetail>,
31900 {
31901 self.client_cert = v.map(|x| x.into());
31902 self
31903 }
31904}
31905
31906impl wkt::message::Message for SslCertsInsertResponse {
31907 fn typename() -> &'static str {
31908 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
31909 }
31910}
31911
31912/// SslCerts list response.
31913#[derive(Clone, Default, PartialEq)]
31914#[non_exhaustive]
31915pub struct SslCertsListResponse {
31916 /// This is always `sql#sslCertsList`.
31917 pub kind: std::string::String,
31918
31919 /// List of client certificates for the instance.
31920 pub items: std::vec::Vec<crate::model::SslCert>,
31921
31922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31923}
31924
31925impl SslCertsListResponse {
31926 /// Creates a new default instance.
31927 pub fn new() -> Self {
31928 std::default::Default::default()
31929 }
31930
31931 /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
31932 ///
31933 /// # Example
31934 /// ```ignore,no_run
31935 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
31936 /// let x = SslCertsListResponse::new().set_kind("example");
31937 /// ```
31938 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31939 self.kind = v.into();
31940 self
31941 }
31942
31943 /// Sets the value of [items][crate::model::SslCertsListResponse::items].
31944 ///
31945 /// # Example
31946 /// ```ignore,no_run
31947 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
31948 /// use google_cloud_sql_v1::model::SslCert;
31949 /// let x = SslCertsListResponse::new()
31950 /// .set_items([
31951 /// SslCert::default()/* use setters */,
31952 /// SslCert::default()/* use (different) setters */,
31953 /// ]);
31954 /// ```
31955 pub fn set_items<T, V>(mut self, v: T) -> Self
31956 where
31957 T: std::iter::IntoIterator<Item = V>,
31958 V: std::convert::Into<crate::model::SslCert>,
31959 {
31960 use std::iter::Iterator;
31961 self.items = v.into_iter().map(|i| i.into()).collect();
31962 self
31963 }
31964}
31965
31966impl wkt::message::Message for SslCertsListResponse {
31967 fn typename() -> &'static str {
31968 "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
31969 }
31970}
31971
31972/// Tiers list request.
31973#[derive(Clone, Default, PartialEq)]
31974#[non_exhaustive]
31975pub struct SqlTiersListRequest {
31976 /// Project ID of the project for which to list tiers.
31977 pub project: std::string::String,
31978
31979 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31980}
31981
31982impl SqlTiersListRequest {
31983 /// Creates a new default instance.
31984 pub fn new() -> Self {
31985 std::default::Default::default()
31986 }
31987
31988 /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
31989 ///
31990 /// # Example
31991 /// ```ignore,no_run
31992 /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
31993 /// let x = SqlTiersListRequest::new().set_project("example");
31994 /// ```
31995 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31996 self.project = v.into();
31997 self
31998 }
31999}
32000
32001impl wkt::message::Message for SqlTiersListRequest {
32002 fn typename() -> &'static str {
32003 "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
32004 }
32005}
32006
32007/// Tiers list response.
32008#[derive(Clone, Default, PartialEq)]
32009#[non_exhaustive]
32010pub struct TiersListResponse {
32011 /// This is always `sql#tiersList`.
32012 pub kind: std::string::String,
32013
32014 /// List of tiers.
32015 pub items: std::vec::Vec<crate::model::Tier>,
32016
32017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32018}
32019
32020impl TiersListResponse {
32021 /// Creates a new default instance.
32022 pub fn new() -> Self {
32023 std::default::Default::default()
32024 }
32025
32026 /// Sets the value of [kind][crate::model::TiersListResponse::kind].
32027 ///
32028 /// # Example
32029 /// ```ignore,no_run
32030 /// # use google_cloud_sql_v1::model::TiersListResponse;
32031 /// let x = TiersListResponse::new().set_kind("example");
32032 /// ```
32033 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32034 self.kind = v.into();
32035 self
32036 }
32037
32038 /// Sets the value of [items][crate::model::TiersListResponse::items].
32039 ///
32040 /// # Example
32041 /// ```ignore,no_run
32042 /// # use google_cloud_sql_v1::model::TiersListResponse;
32043 /// use google_cloud_sql_v1::model::Tier;
32044 /// let x = TiersListResponse::new()
32045 /// .set_items([
32046 /// Tier::default()/* use setters */,
32047 /// Tier::default()/* use (different) setters */,
32048 /// ]);
32049 /// ```
32050 pub fn set_items<T, V>(mut self, v: T) -> Self
32051 where
32052 T: std::iter::IntoIterator<Item = V>,
32053 V: std::convert::Into<crate::model::Tier>,
32054 {
32055 use std::iter::Iterator;
32056 self.items = v.into_iter().map(|i| i.into()).collect();
32057 self
32058 }
32059}
32060
32061impl wkt::message::Message for TiersListResponse {
32062 fn typename() -> &'static str {
32063 "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
32064 }
32065}
32066
32067/// A Google Cloud SQL service tier resource.
32068#[derive(Clone, Default, PartialEq)]
32069#[non_exhaustive]
32070pub struct Tier {
32071 /// An identifier for the machine type, for example, `db-custom-1-3840`. For
32072 /// related information, see [Pricing](/sql/pricing).
32073 pub tier: std::string::String,
32074
32075 /// The maximum RAM usage of this tier in bytes.
32076 pub ram: i64,
32077
32078 /// This is always `sql#tier`.
32079 pub kind: std::string::String,
32080
32081 /// The maximum disk size of this tier in bytes.
32082 pub disk_quota: i64,
32083
32084 /// The applicable regions for this tier.
32085 pub region: std::vec::Vec<std::string::String>,
32086
32087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32088}
32089
32090impl Tier {
32091 /// Creates a new default instance.
32092 pub fn new() -> Self {
32093 std::default::Default::default()
32094 }
32095
32096 /// Sets the value of [tier][crate::model::Tier::tier].
32097 ///
32098 /// # Example
32099 /// ```ignore,no_run
32100 /// # use google_cloud_sql_v1::model::Tier;
32101 /// let x = Tier::new().set_tier("example");
32102 /// ```
32103 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32104 self.tier = v.into();
32105 self
32106 }
32107
32108 /// Sets the value of [ram][crate::model::Tier::ram].
32109 ///
32110 /// # Example
32111 /// ```ignore,no_run
32112 /// # use google_cloud_sql_v1::model::Tier;
32113 /// let x = Tier::new().set_ram(42);
32114 /// ```
32115 pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
32116 self.ram = v.into();
32117 self
32118 }
32119
32120 /// Sets the value of [kind][crate::model::Tier::kind].
32121 ///
32122 /// # Example
32123 /// ```ignore,no_run
32124 /// # use google_cloud_sql_v1::model::Tier;
32125 /// let x = Tier::new().set_kind("example");
32126 /// ```
32127 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32128 self.kind = v.into();
32129 self
32130 }
32131
32132 /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
32133 ///
32134 /// # Example
32135 /// ```ignore,no_run
32136 /// # use google_cloud_sql_v1::model::Tier;
32137 /// let x = Tier::new().set_disk_quota(42);
32138 /// ```
32139 pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
32140 self.disk_quota = v.into();
32141 self
32142 }
32143
32144 /// Sets the value of [region][crate::model::Tier::region].
32145 ///
32146 /// # Example
32147 /// ```ignore,no_run
32148 /// # use google_cloud_sql_v1::model::Tier;
32149 /// let x = Tier::new().set_region(["a", "b", "c"]);
32150 /// ```
32151 pub fn set_region<T, V>(mut self, v: T) -> Self
32152 where
32153 T: std::iter::IntoIterator<Item = V>,
32154 V: std::convert::Into<std::string::String>,
32155 {
32156 use std::iter::Iterator;
32157 self.region = v.into_iter().map(|i| i.into()).collect();
32158 self
32159 }
32160}
32161
32162impl wkt::message::Message for Tier {
32163 fn typename() -> &'static str {
32164 "type.googleapis.com/google.cloud.sql.v1.Tier"
32165 }
32166}
32167
32168#[allow(missing_docs)]
32169#[derive(Clone, Default, PartialEq)]
32170#[non_exhaustive]
32171pub struct SqlUsersDeleteRequest {
32172 /// Host of the user in the instance.
32173 pub host: std::string::String,
32174
32175 /// Database instance ID. This does not include the project ID.
32176 pub instance: std::string::String,
32177
32178 /// Name of the user in the instance.
32179 pub name: std::string::String,
32180
32181 /// Project ID of the project that contains the instance.
32182 pub project: std::string::String,
32183
32184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32185}
32186
32187impl SqlUsersDeleteRequest {
32188 /// Creates a new default instance.
32189 pub fn new() -> Self {
32190 std::default::Default::default()
32191 }
32192
32193 /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
32194 ///
32195 /// # Example
32196 /// ```ignore,no_run
32197 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32198 /// let x = SqlUsersDeleteRequest::new().set_host("example");
32199 /// ```
32200 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32201 self.host = v.into();
32202 self
32203 }
32204
32205 /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
32206 ///
32207 /// # Example
32208 /// ```ignore,no_run
32209 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32210 /// let x = SqlUsersDeleteRequest::new().set_instance("example");
32211 /// ```
32212 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32213 self.instance = v.into();
32214 self
32215 }
32216
32217 /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
32218 ///
32219 /// # Example
32220 /// ```ignore,no_run
32221 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32222 /// let x = SqlUsersDeleteRequest::new().set_name("example");
32223 /// ```
32224 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32225 self.name = v.into();
32226 self
32227 }
32228
32229 /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
32230 ///
32231 /// # Example
32232 /// ```ignore,no_run
32233 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32234 /// let x = SqlUsersDeleteRequest::new().set_project("example");
32235 /// ```
32236 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32237 self.project = v.into();
32238 self
32239 }
32240}
32241
32242impl wkt::message::Message for SqlUsersDeleteRequest {
32243 fn typename() -> &'static str {
32244 "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
32245 }
32246}
32247
32248/// Request message for Users Get RPC
32249#[derive(Clone, Default, PartialEq)]
32250#[non_exhaustive]
32251pub struct SqlUsersGetRequest {
32252 /// Database instance ID. This does not include the project ID.
32253 pub instance: std::string::String,
32254
32255 /// User of the instance.
32256 pub name: std::string::String,
32257
32258 /// Project ID of the project that contains the instance.
32259 pub project: std::string::String,
32260
32261 /// Host of a user of the instance.
32262 pub host: std::string::String,
32263
32264 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32265}
32266
32267impl SqlUsersGetRequest {
32268 /// Creates a new default instance.
32269 pub fn new() -> Self {
32270 std::default::Default::default()
32271 }
32272
32273 /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
32274 ///
32275 /// # Example
32276 /// ```ignore,no_run
32277 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32278 /// let x = SqlUsersGetRequest::new().set_instance("example");
32279 /// ```
32280 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32281 self.instance = v.into();
32282 self
32283 }
32284
32285 /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
32286 ///
32287 /// # Example
32288 /// ```ignore,no_run
32289 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32290 /// let x = SqlUsersGetRequest::new().set_name("example");
32291 /// ```
32292 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32293 self.name = v.into();
32294 self
32295 }
32296
32297 /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
32298 ///
32299 /// # Example
32300 /// ```ignore,no_run
32301 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32302 /// let x = SqlUsersGetRequest::new().set_project("example");
32303 /// ```
32304 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32305 self.project = v.into();
32306 self
32307 }
32308
32309 /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
32310 ///
32311 /// # Example
32312 /// ```ignore,no_run
32313 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32314 /// let x = SqlUsersGetRequest::new().set_host("example");
32315 /// ```
32316 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32317 self.host = v.into();
32318 self
32319 }
32320}
32321
32322impl wkt::message::Message for SqlUsersGetRequest {
32323 fn typename() -> &'static str {
32324 "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
32325 }
32326}
32327
32328#[allow(missing_docs)]
32329#[derive(Clone, Default, PartialEq)]
32330#[non_exhaustive]
32331pub struct SqlUsersInsertRequest {
32332 /// Database instance ID. This does not include the project ID.
32333 pub instance: std::string::String,
32334
32335 /// Project ID of the project that contains the instance.
32336 pub project: std::string::String,
32337
32338 #[allow(missing_docs)]
32339 pub body: std::option::Option<crate::model::User>,
32340
32341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32342}
32343
32344impl SqlUsersInsertRequest {
32345 /// Creates a new default instance.
32346 pub fn new() -> Self {
32347 std::default::Default::default()
32348 }
32349
32350 /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
32351 ///
32352 /// # Example
32353 /// ```ignore,no_run
32354 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32355 /// let x = SqlUsersInsertRequest::new().set_instance("example");
32356 /// ```
32357 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32358 self.instance = v.into();
32359 self
32360 }
32361
32362 /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
32363 ///
32364 /// # Example
32365 /// ```ignore,no_run
32366 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32367 /// let x = SqlUsersInsertRequest::new().set_project("example");
32368 /// ```
32369 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32370 self.project = v.into();
32371 self
32372 }
32373
32374 /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
32375 ///
32376 /// # Example
32377 /// ```ignore,no_run
32378 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32379 /// use google_cloud_sql_v1::model::User;
32380 /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
32381 /// ```
32382 pub fn set_body<T>(mut self, v: T) -> Self
32383 where
32384 T: std::convert::Into<crate::model::User>,
32385 {
32386 self.body = std::option::Option::Some(v.into());
32387 self
32388 }
32389
32390 /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
32391 ///
32392 /// # Example
32393 /// ```ignore,no_run
32394 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32395 /// use google_cloud_sql_v1::model::User;
32396 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
32397 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
32398 /// ```
32399 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
32400 where
32401 T: std::convert::Into<crate::model::User>,
32402 {
32403 self.body = v.map(|x| x.into());
32404 self
32405 }
32406}
32407
32408impl wkt::message::Message for SqlUsersInsertRequest {
32409 fn typename() -> &'static str {
32410 "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
32411 }
32412}
32413
32414#[allow(missing_docs)]
32415#[derive(Clone, Default, PartialEq)]
32416#[non_exhaustive]
32417pub struct SqlUsersListRequest {
32418 /// Database instance ID. This does not include the project ID.
32419 pub instance: std::string::String,
32420
32421 /// Project ID of the project that contains the instance.
32422 pub project: std::string::String,
32423
32424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32425}
32426
32427impl SqlUsersListRequest {
32428 /// Creates a new default instance.
32429 pub fn new() -> Self {
32430 std::default::Default::default()
32431 }
32432
32433 /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
32434 ///
32435 /// # Example
32436 /// ```ignore,no_run
32437 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
32438 /// let x = SqlUsersListRequest::new().set_instance("example");
32439 /// ```
32440 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32441 self.instance = v.into();
32442 self
32443 }
32444
32445 /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
32446 ///
32447 /// # Example
32448 /// ```ignore,no_run
32449 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
32450 /// let x = SqlUsersListRequest::new().set_project("example");
32451 /// ```
32452 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32453 self.project = v.into();
32454 self
32455 }
32456}
32457
32458impl wkt::message::Message for SqlUsersListRequest {
32459 fn typename() -> &'static str {
32460 "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
32461 }
32462}
32463
32464#[allow(missing_docs)]
32465#[derive(Clone, Default, PartialEq)]
32466#[non_exhaustive]
32467pub struct SqlUsersUpdateRequest {
32468 /// Optional. Host of the user in the instance.
32469 pub host: std::string::String,
32470
32471 /// Database instance ID. This does not include the project ID.
32472 pub instance: std::string::String,
32473
32474 /// Name of the user in the instance.
32475 pub name: std::string::String,
32476
32477 /// Project ID of the project that contains the instance.
32478 pub project: std::string::String,
32479
32480 /// Optional. List of database roles to grant to the user. body.database_roles
32481 /// will be ignored for update request.
32482 pub database_roles: std::vec::Vec<std::string::String>,
32483
32484 /// Optional. Specifies whether to revoke existing roles that are not present
32485 /// in the `database_roles` field. If `false` or unset, the database roles
32486 /// specified in `database_roles` are added to the user's existing roles.
32487 pub revoke_existing_roles: std::option::Option<bool>,
32488
32489 /// Optional. The server roles to grant to the SQL Server login. Existing
32490 /// server roles will not be revoked if revoke_existing_roles is false.
32491 /// body.server_roles will be ignored for update request.
32492 pub server_roles: std::vec::Vec<std::string::String>,
32493
32494 /// Optional. Specifies whether to revoke existing roles that are not present
32495 /// in the `server_roles` field. If `false` or unset, the server roles
32496 /// specified in `server_roles` are added to the user's existing server roles.
32497 pub revoke_existing_server_roles: std::option::Option<bool>,
32498
32499 #[allow(missing_docs)]
32500 pub body: std::option::Option<crate::model::User>,
32501
32502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32503}
32504
32505impl SqlUsersUpdateRequest {
32506 /// Creates a new default instance.
32507 pub fn new() -> Self {
32508 std::default::Default::default()
32509 }
32510
32511 /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
32512 ///
32513 /// # Example
32514 /// ```ignore,no_run
32515 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32516 /// let x = SqlUsersUpdateRequest::new().set_host("example");
32517 /// ```
32518 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32519 self.host = v.into();
32520 self
32521 }
32522
32523 /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
32524 ///
32525 /// # Example
32526 /// ```ignore,no_run
32527 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32528 /// let x = SqlUsersUpdateRequest::new().set_instance("example");
32529 /// ```
32530 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32531 self.instance = v.into();
32532 self
32533 }
32534
32535 /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
32536 ///
32537 /// # Example
32538 /// ```ignore,no_run
32539 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32540 /// let x = SqlUsersUpdateRequest::new().set_name("example");
32541 /// ```
32542 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32543 self.name = v.into();
32544 self
32545 }
32546
32547 /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
32548 ///
32549 /// # Example
32550 /// ```ignore,no_run
32551 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32552 /// let x = SqlUsersUpdateRequest::new().set_project("example");
32553 /// ```
32554 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32555 self.project = v.into();
32556 self
32557 }
32558
32559 /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
32560 ///
32561 /// # Example
32562 /// ```ignore,no_run
32563 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32564 /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
32565 /// ```
32566 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
32567 where
32568 T: std::iter::IntoIterator<Item = V>,
32569 V: std::convert::Into<std::string::String>,
32570 {
32571 use std::iter::Iterator;
32572 self.database_roles = v.into_iter().map(|i| i.into()).collect();
32573 self
32574 }
32575
32576 /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
32577 ///
32578 /// # Example
32579 /// ```ignore,no_run
32580 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32581 /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_roles(true);
32582 /// ```
32583 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
32584 where
32585 T: std::convert::Into<bool>,
32586 {
32587 self.revoke_existing_roles = std::option::Option::Some(v.into());
32588 self
32589 }
32590
32591 /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
32592 ///
32593 /// # Example
32594 /// ```ignore,no_run
32595 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32596 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(Some(false));
32597 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(None::<bool>);
32598 /// ```
32599 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
32600 where
32601 T: std::convert::Into<bool>,
32602 {
32603 self.revoke_existing_roles = v.map(|x| x.into());
32604 self
32605 }
32606
32607 /// Sets the value of [server_roles][crate::model::SqlUsersUpdateRequest::server_roles].
32608 ///
32609 /// # Example
32610 /// ```ignore,no_run
32611 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32612 /// let x = SqlUsersUpdateRequest::new().set_server_roles(["a", "b", "c"]);
32613 /// ```
32614 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
32615 where
32616 T: std::iter::IntoIterator<Item = V>,
32617 V: std::convert::Into<std::string::String>,
32618 {
32619 use std::iter::Iterator;
32620 self.server_roles = v.into_iter().map(|i| i.into()).collect();
32621 self
32622 }
32623
32624 /// Sets the value of [revoke_existing_server_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_server_roles].
32625 ///
32626 /// # Example
32627 /// ```ignore,no_run
32628 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32629 /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_server_roles(true);
32630 /// ```
32631 pub fn set_revoke_existing_server_roles<T>(mut self, v: T) -> Self
32632 where
32633 T: std::convert::Into<bool>,
32634 {
32635 self.revoke_existing_server_roles = std::option::Option::Some(v.into());
32636 self
32637 }
32638
32639 /// Sets or clears the value of [revoke_existing_server_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_server_roles].
32640 ///
32641 /// # Example
32642 /// ```ignore,no_run
32643 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32644 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_server_roles(Some(false));
32645 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_server_roles(None::<bool>);
32646 /// ```
32647 pub fn set_or_clear_revoke_existing_server_roles<T>(mut self, v: std::option::Option<T>) -> Self
32648 where
32649 T: std::convert::Into<bool>,
32650 {
32651 self.revoke_existing_server_roles = v.map(|x| x.into());
32652 self
32653 }
32654
32655 /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
32656 ///
32657 /// # Example
32658 /// ```ignore,no_run
32659 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32660 /// use google_cloud_sql_v1::model::User;
32661 /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
32662 /// ```
32663 pub fn set_body<T>(mut self, v: T) -> Self
32664 where
32665 T: std::convert::Into<crate::model::User>,
32666 {
32667 self.body = std::option::Option::Some(v.into());
32668 self
32669 }
32670
32671 /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
32672 ///
32673 /// # Example
32674 /// ```ignore,no_run
32675 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32676 /// use google_cloud_sql_v1::model::User;
32677 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
32678 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
32679 /// ```
32680 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
32681 where
32682 T: std::convert::Into<crate::model::User>,
32683 {
32684 self.body = v.map(|x| x.into());
32685 self
32686 }
32687}
32688
32689impl wkt::message::Message for SqlUsersUpdateRequest {
32690 fn typename() -> &'static str {
32691 "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
32692 }
32693}
32694
32695/// User level password validation policy.
32696#[derive(Clone, Default, PartialEq)]
32697#[non_exhaustive]
32698pub struct UserPasswordValidationPolicy {
32699 /// Number of failed login attempts allowed before user get locked.
32700 pub allowed_failed_attempts: i32,
32701
32702 /// Expiration duration after password is updated.
32703 pub password_expiration_duration: std::option::Option<wkt::Duration>,
32704
32705 /// If true, failed login attempts check will be enabled.
32706 pub enable_failed_attempts_check: bool,
32707
32708 /// Output only. Read-only password status.
32709 pub status: std::option::Option<crate::model::PasswordStatus>,
32710
32711 /// If true, the user must specify the current password before changing the
32712 /// password. This flag is supported only for MySQL.
32713 pub enable_password_verification: bool,
32714
32715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32716}
32717
32718impl UserPasswordValidationPolicy {
32719 /// Creates a new default instance.
32720 pub fn new() -> Self {
32721 std::default::Default::default()
32722 }
32723
32724 /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
32725 ///
32726 /// # Example
32727 /// ```ignore,no_run
32728 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32729 /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
32730 /// ```
32731 pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
32732 self.allowed_failed_attempts = v.into();
32733 self
32734 }
32735
32736 /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
32737 ///
32738 /// # Example
32739 /// ```ignore,no_run
32740 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32741 /// use wkt::Duration;
32742 /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
32743 /// ```
32744 pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
32745 where
32746 T: std::convert::Into<wkt::Duration>,
32747 {
32748 self.password_expiration_duration = std::option::Option::Some(v.into());
32749 self
32750 }
32751
32752 /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
32753 ///
32754 /// # Example
32755 /// ```ignore,no_run
32756 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32757 /// use wkt::Duration;
32758 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
32759 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
32760 /// ```
32761 pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
32762 where
32763 T: std::convert::Into<wkt::Duration>,
32764 {
32765 self.password_expiration_duration = v.map(|x| x.into());
32766 self
32767 }
32768
32769 /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
32770 ///
32771 /// # Example
32772 /// ```ignore,no_run
32773 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32774 /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
32775 /// ```
32776 pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32777 self.enable_failed_attempts_check = v.into();
32778 self
32779 }
32780
32781 /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
32782 ///
32783 /// # Example
32784 /// ```ignore,no_run
32785 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32786 /// use google_cloud_sql_v1::model::PasswordStatus;
32787 /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
32788 /// ```
32789 pub fn set_status<T>(mut self, v: T) -> Self
32790 where
32791 T: std::convert::Into<crate::model::PasswordStatus>,
32792 {
32793 self.status = std::option::Option::Some(v.into());
32794 self
32795 }
32796
32797 /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
32798 ///
32799 /// # Example
32800 /// ```ignore,no_run
32801 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32802 /// use google_cloud_sql_v1::model::PasswordStatus;
32803 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
32804 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
32805 /// ```
32806 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
32807 where
32808 T: std::convert::Into<crate::model::PasswordStatus>,
32809 {
32810 self.status = v.map(|x| x.into());
32811 self
32812 }
32813
32814 /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
32815 ///
32816 /// # Example
32817 /// ```ignore,no_run
32818 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32819 /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
32820 /// ```
32821 pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32822 self.enable_password_verification = v.into();
32823 self
32824 }
32825}
32826
32827impl wkt::message::Message for UserPasswordValidationPolicy {
32828 fn typename() -> &'static str {
32829 "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
32830 }
32831}
32832
32833/// Read-only password status.
32834#[derive(Clone, Default, PartialEq)]
32835#[non_exhaustive]
32836pub struct PasswordStatus {
32837 /// If true, user does not have login privileges.
32838 pub locked: bool,
32839
32840 /// The expiration time of the current password.
32841 pub password_expiration_time: std::option::Option<wkt::Timestamp>,
32842
32843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32844}
32845
32846impl PasswordStatus {
32847 /// Creates a new default instance.
32848 pub fn new() -> Self {
32849 std::default::Default::default()
32850 }
32851
32852 /// Sets the value of [locked][crate::model::PasswordStatus::locked].
32853 ///
32854 /// # Example
32855 /// ```ignore,no_run
32856 /// # use google_cloud_sql_v1::model::PasswordStatus;
32857 /// let x = PasswordStatus::new().set_locked(true);
32858 /// ```
32859 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32860 self.locked = v.into();
32861 self
32862 }
32863
32864 /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
32865 ///
32866 /// # Example
32867 /// ```ignore,no_run
32868 /// # use google_cloud_sql_v1::model::PasswordStatus;
32869 /// use wkt::Timestamp;
32870 /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
32871 /// ```
32872 pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
32873 where
32874 T: std::convert::Into<wkt::Timestamp>,
32875 {
32876 self.password_expiration_time = std::option::Option::Some(v.into());
32877 self
32878 }
32879
32880 /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
32881 ///
32882 /// # Example
32883 /// ```ignore,no_run
32884 /// # use google_cloud_sql_v1::model::PasswordStatus;
32885 /// use wkt::Timestamp;
32886 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
32887 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
32888 /// ```
32889 pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
32890 where
32891 T: std::convert::Into<wkt::Timestamp>,
32892 {
32893 self.password_expiration_time = v.map(|x| x.into());
32894 self
32895 }
32896}
32897
32898impl wkt::message::Message for PasswordStatus {
32899 fn typename() -> &'static str {
32900 "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
32901 }
32902}
32903
32904/// A Cloud SQL user resource.
32905#[derive(Clone, Default, PartialEq)]
32906#[non_exhaustive]
32907pub struct User {
32908 /// This is always `sql#user`.
32909 pub kind: std::string::String,
32910
32911 /// The password for the user.
32912 pub password: std::string::String,
32913
32914 /// This field is deprecated and will be removed from a future version of the
32915 /// API.
32916 pub etag: std::string::String,
32917
32918 /// The name of the user in the Cloud SQL instance. Can be omitted for
32919 /// `update` because it is already specified in the URL.
32920 pub name: std::string::String,
32921
32922 /// Optional. The host from which the user can connect. For `insert`
32923 /// operations, host defaults to an empty string. For `update`
32924 /// operations, host is specified as part of the request URL. The host name
32925 /// cannot be updated after insertion. For a MySQL instance, it's required;
32926 /// for a PostgreSQL or SQL Server instance, it's optional.
32927 pub host: std::string::String,
32928
32929 /// The name of the Cloud SQL instance. This does not include the project ID.
32930 /// Can be omitted for `update` because it is already specified on the
32931 /// URL.
32932 pub instance: std::string::String,
32933
32934 /// The project ID of the project containing the Cloud SQL database. The Google
32935 /// apps domain is prefixed if applicable. Can be omitted for `update` because
32936 /// it is already specified on the URL.
32937 pub project: std::string::String,
32938
32939 /// The user type. It determines the method to authenticate the user during
32940 /// login. The default is the database's built-in user type.
32941 pub r#type: crate::model::user::SqlUserType,
32942
32943 /// Optional. The full email for an IAM user. For normal database users, this
32944 /// will not be filled. Only applicable to MySQL database users.
32945 pub iam_email: std::string::String,
32946
32947 /// User level password validation policy.
32948 pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
32949
32950 /// Dual password status for the user.
32951 pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
32952
32953 /// Indicates if a group is active or inactive for IAM database authentication.
32954 pub iam_status: std::option::Option<crate::model::user::IamStatus>,
32955
32956 /// Optional. Role memberships of the user
32957 pub database_roles: std::vec::Vec<std::string::String>,
32958
32959 /// Optional. The server roles for the SQL Server login.
32960 pub server_roles: std::vec::Vec<std::string::String>,
32961
32962 /// User details for specific database type
32963 pub user_details: std::option::Option<crate::model::user::UserDetails>,
32964
32965 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32966}
32967
32968impl User {
32969 /// Creates a new default instance.
32970 pub fn new() -> Self {
32971 std::default::Default::default()
32972 }
32973
32974 /// Sets the value of [kind][crate::model::User::kind].
32975 ///
32976 /// # Example
32977 /// ```ignore,no_run
32978 /// # use google_cloud_sql_v1::model::User;
32979 /// let x = User::new().set_kind("example");
32980 /// ```
32981 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32982 self.kind = v.into();
32983 self
32984 }
32985
32986 /// Sets the value of [password][crate::model::User::password].
32987 ///
32988 /// # Example
32989 /// ```ignore,no_run
32990 /// # use google_cloud_sql_v1::model::User;
32991 /// let x = User::new().set_password("example");
32992 /// ```
32993 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32994 self.password = v.into();
32995 self
32996 }
32997
32998 /// Sets the value of [etag][crate::model::User::etag].
32999 ///
33000 /// # Example
33001 /// ```ignore,no_run
33002 /// # use google_cloud_sql_v1::model::User;
33003 /// let x = User::new().set_etag("example");
33004 /// ```
33005 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33006 self.etag = v.into();
33007 self
33008 }
33009
33010 /// Sets the value of [name][crate::model::User::name].
33011 ///
33012 /// # Example
33013 /// ```ignore,no_run
33014 /// # use google_cloud_sql_v1::model::User;
33015 /// let x = User::new().set_name("example");
33016 /// ```
33017 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33018 self.name = v.into();
33019 self
33020 }
33021
33022 /// Sets the value of [host][crate::model::User::host].
33023 ///
33024 /// # Example
33025 /// ```ignore,no_run
33026 /// # use google_cloud_sql_v1::model::User;
33027 /// let x = User::new().set_host("example");
33028 /// ```
33029 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33030 self.host = v.into();
33031 self
33032 }
33033
33034 /// Sets the value of [instance][crate::model::User::instance].
33035 ///
33036 /// # Example
33037 /// ```ignore,no_run
33038 /// # use google_cloud_sql_v1::model::User;
33039 /// let x = User::new().set_instance("example");
33040 /// ```
33041 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33042 self.instance = v.into();
33043 self
33044 }
33045
33046 /// Sets the value of [project][crate::model::User::project].
33047 ///
33048 /// # Example
33049 /// ```ignore,no_run
33050 /// # use google_cloud_sql_v1::model::User;
33051 /// let x = User::new().set_project("example");
33052 /// ```
33053 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33054 self.project = v.into();
33055 self
33056 }
33057
33058 /// Sets the value of [r#type][crate::model::User::type].
33059 ///
33060 /// # Example
33061 /// ```ignore,no_run
33062 /// # use google_cloud_sql_v1::model::User;
33063 /// use google_cloud_sql_v1::model::user::SqlUserType;
33064 /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
33065 /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
33066 /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
33067 /// ```
33068 pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
33069 mut self,
33070 v: T,
33071 ) -> Self {
33072 self.r#type = v.into();
33073 self
33074 }
33075
33076 /// Sets the value of [iam_email][crate::model::User::iam_email].
33077 ///
33078 /// # Example
33079 /// ```ignore,no_run
33080 /// # use google_cloud_sql_v1::model::User;
33081 /// let x = User::new().set_iam_email("example");
33082 /// ```
33083 pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33084 self.iam_email = v.into();
33085 self
33086 }
33087
33088 /// Sets the value of [password_policy][crate::model::User::password_policy].
33089 ///
33090 /// # Example
33091 /// ```ignore,no_run
33092 /// # use google_cloud_sql_v1::model::User;
33093 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33094 /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
33095 /// ```
33096 pub fn set_password_policy<T>(mut self, v: T) -> Self
33097 where
33098 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
33099 {
33100 self.password_policy = std::option::Option::Some(v.into());
33101 self
33102 }
33103
33104 /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
33105 ///
33106 /// # Example
33107 /// ```ignore,no_run
33108 /// # use google_cloud_sql_v1::model::User;
33109 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33110 /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
33111 /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
33112 /// ```
33113 pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
33114 where
33115 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
33116 {
33117 self.password_policy = v.map(|x| x.into());
33118 self
33119 }
33120
33121 /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
33122 ///
33123 /// # Example
33124 /// ```ignore,no_run
33125 /// # use google_cloud_sql_v1::model::User;
33126 /// use google_cloud_sql_v1::model::user::DualPasswordType;
33127 /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
33128 /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
33129 /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
33130 /// ```
33131 pub fn set_dual_password_type<T>(mut self, v: T) -> Self
33132 where
33133 T: std::convert::Into<crate::model::user::DualPasswordType>,
33134 {
33135 self.dual_password_type = std::option::Option::Some(v.into());
33136 self
33137 }
33138
33139 /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
33140 ///
33141 /// # Example
33142 /// ```ignore,no_run
33143 /// # use google_cloud_sql_v1::model::User;
33144 /// use google_cloud_sql_v1::model::user::DualPasswordType;
33145 /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
33146 /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
33147 /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
33148 /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
33149 /// ```
33150 pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
33151 where
33152 T: std::convert::Into<crate::model::user::DualPasswordType>,
33153 {
33154 self.dual_password_type = v.map(|x| x.into());
33155 self
33156 }
33157
33158 /// Sets the value of [iam_status][crate::model::User::iam_status].
33159 ///
33160 /// # Example
33161 /// ```ignore,no_run
33162 /// # use google_cloud_sql_v1::model::User;
33163 /// use google_cloud_sql_v1::model::user::IamStatus;
33164 /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
33165 /// let x1 = User::new().set_iam_status(IamStatus::Active);
33166 /// ```
33167 pub fn set_iam_status<T>(mut self, v: T) -> Self
33168 where
33169 T: std::convert::Into<crate::model::user::IamStatus>,
33170 {
33171 self.iam_status = std::option::Option::Some(v.into());
33172 self
33173 }
33174
33175 /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
33176 ///
33177 /// # Example
33178 /// ```ignore,no_run
33179 /// # use google_cloud_sql_v1::model::User;
33180 /// use google_cloud_sql_v1::model::user::IamStatus;
33181 /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
33182 /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
33183 /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
33184 /// ```
33185 pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
33186 where
33187 T: std::convert::Into<crate::model::user::IamStatus>,
33188 {
33189 self.iam_status = v.map(|x| x.into());
33190 self
33191 }
33192
33193 /// Sets the value of [database_roles][crate::model::User::database_roles].
33194 ///
33195 /// # Example
33196 /// ```ignore,no_run
33197 /// # use google_cloud_sql_v1::model::User;
33198 /// let x = User::new().set_database_roles(["a", "b", "c"]);
33199 /// ```
33200 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
33201 where
33202 T: std::iter::IntoIterator<Item = V>,
33203 V: std::convert::Into<std::string::String>,
33204 {
33205 use std::iter::Iterator;
33206 self.database_roles = v.into_iter().map(|i| i.into()).collect();
33207 self
33208 }
33209
33210 /// Sets the value of [server_roles][crate::model::User::server_roles].
33211 ///
33212 /// # Example
33213 /// ```ignore,no_run
33214 /// # use google_cloud_sql_v1::model::User;
33215 /// let x = User::new().set_server_roles(["a", "b", "c"]);
33216 /// ```
33217 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
33218 where
33219 T: std::iter::IntoIterator<Item = V>,
33220 V: std::convert::Into<std::string::String>,
33221 {
33222 use std::iter::Iterator;
33223 self.server_roles = v.into_iter().map(|i| i.into()).collect();
33224 self
33225 }
33226
33227 /// Sets the value of [user_details][crate::model::User::user_details].
33228 ///
33229 /// Note that all the setters affecting `user_details` are mutually
33230 /// exclusive.
33231 ///
33232 /// # Example
33233 /// ```ignore,no_run
33234 /// # use google_cloud_sql_v1::model::User;
33235 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
33236 /// let x = User::new().set_user_details(Some(
33237 /// google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
33238 /// ```
33239 pub fn set_user_details<
33240 T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
33241 >(
33242 mut self,
33243 v: T,
33244 ) -> Self {
33245 self.user_details = v.into();
33246 self
33247 }
33248
33249 /// The value of [user_details][crate::model::User::user_details]
33250 /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
33251 /// holds a different branch.
33252 pub fn sqlserver_user_details(
33253 &self,
33254 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
33255 #[allow(unreachable_patterns)]
33256 self.user_details.as_ref().and_then(|v| match v {
33257 crate::model::user::UserDetails::SqlserverUserDetails(v) => {
33258 std::option::Option::Some(v)
33259 }
33260 _ => std::option::Option::None,
33261 })
33262 }
33263
33264 /// Sets the value of [user_details][crate::model::User::user_details]
33265 /// to hold a `SqlserverUserDetails`.
33266 ///
33267 /// Note that all the setters affecting `user_details` are
33268 /// mutually exclusive.
33269 ///
33270 /// # Example
33271 /// ```ignore,no_run
33272 /// # use google_cloud_sql_v1::model::User;
33273 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
33274 /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
33275 /// assert!(x.sqlserver_user_details().is_some());
33276 /// ```
33277 pub fn set_sqlserver_user_details<
33278 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
33279 >(
33280 mut self,
33281 v: T,
33282 ) -> Self {
33283 self.user_details = std::option::Option::Some(
33284 crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
33285 );
33286 self
33287 }
33288}
33289
33290impl wkt::message::Message for User {
33291 fn typename() -> &'static str {
33292 "type.googleapis.com/google.cloud.sql.v1.User"
33293 }
33294}
33295
33296/// Defines additional types related to [User].
33297pub mod user {
33298 #[allow(unused_imports)]
33299 use super::*;
33300
33301 /// The user type.
33302 ///
33303 /// # Working with unknown values
33304 ///
33305 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33306 /// additional enum variants at any time. Adding new variants is not considered
33307 /// a breaking change. Applications should write their code in anticipation of:
33308 ///
33309 /// - New values appearing in future releases of the client library, **and**
33310 /// - New values received dynamically, without application changes.
33311 ///
33312 /// Please consult the [Working with enums] section in the user guide for some
33313 /// guidelines.
33314 ///
33315 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33316 #[derive(Clone, Debug, PartialEq)]
33317 #[non_exhaustive]
33318 pub enum SqlUserType {
33319 /// The database's built-in user type.
33320 BuiltIn,
33321 /// Cloud IAM user.
33322 CloudIamUser,
33323 /// Cloud IAM service account.
33324 CloudIamServiceAccount,
33325 /// Cloud IAM group. Not used for login.
33326 CloudIamGroup,
33327 /// Read-only. Login for a user that belongs to the Cloud IAM group.
33328 CloudIamGroupUser,
33329 /// Read-only. Login for a service account that belongs to the
33330 /// Cloud IAM group.
33331 CloudIamGroupServiceAccount,
33332 /// Cloud IAM workforce identity user managed via workforce identity
33333 /// federation.
33334 CloudIamWorkforceIdentity,
33335 /// Microsoft Entra ID user.
33336 EntraidUser,
33337 /// If set, the enum was initialized with an unknown value.
33338 ///
33339 /// Applications can examine the value using [SqlUserType::value] or
33340 /// [SqlUserType::name].
33341 UnknownValue(sql_user_type::UnknownValue),
33342 }
33343
33344 #[doc(hidden)]
33345 pub mod sql_user_type {
33346 #[allow(unused_imports)]
33347 use super::*;
33348 #[derive(Clone, Debug, PartialEq)]
33349 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33350 }
33351
33352 impl SqlUserType {
33353 /// Gets the enum value.
33354 ///
33355 /// Returns `None` if the enum contains an unknown value deserialized from
33356 /// the string representation of enums.
33357 pub fn value(&self) -> std::option::Option<i32> {
33358 match self {
33359 Self::BuiltIn => std::option::Option::Some(0),
33360 Self::CloudIamUser => std::option::Option::Some(1),
33361 Self::CloudIamServiceAccount => std::option::Option::Some(2),
33362 Self::CloudIamGroup => std::option::Option::Some(3),
33363 Self::CloudIamGroupUser => std::option::Option::Some(4),
33364 Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
33365 Self::CloudIamWorkforceIdentity => std::option::Option::Some(6),
33366 Self::EntraidUser => std::option::Option::Some(7),
33367 Self::UnknownValue(u) => u.0.value(),
33368 }
33369 }
33370
33371 /// Gets the enum value as a string.
33372 ///
33373 /// Returns `None` if the enum contains an unknown value deserialized from
33374 /// the integer representation of enums.
33375 pub fn name(&self) -> std::option::Option<&str> {
33376 match self {
33377 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
33378 Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
33379 Self::CloudIamServiceAccount => {
33380 std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
33381 }
33382 Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
33383 Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
33384 Self::CloudIamGroupServiceAccount => {
33385 std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
33386 }
33387 Self::CloudIamWorkforceIdentity => {
33388 std::option::Option::Some("CLOUD_IAM_WORKFORCE_IDENTITY")
33389 }
33390 Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
33391 Self::UnknownValue(u) => u.0.name(),
33392 }
33393 }
33394 }
33395
33396 impl std::default::Default for SqlUserType {
33397 fn default() -> Self {
33398 use std::convert::From;
33399 Self::from(0)
33400 }
33401 }
33402
33403 impl std::fmt::Display for SqlUserType {
33404 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33405 wkt::internal::display_enum(f, self.name(), self.value())
33406 }
33407 }
33408
33409 impl std::convert::From<i32> for SqlUserType {
33410 fn from(value: i32) -> Self {
33411 match value {
33412 0 => Self::BuiltIn,
33413 1 => Self::CloudIamUser,
33414 2 => Self::CloudIamServiceAccount,
33415 3 => Self::CloudIamGroup,
33416 4 => Self::CloudIamGroupUser,
33417 5 => Self::CloudIamGroupServiceAccount,
33418 6 => Self::CloudIamWorkforceIdentity,
33419 7 => Self::EntraidUser,
33420 _ => Self::UnknownValue(sql_user_type::UnknownValue(
33421 wkt::internal::UnknownEnumValue::Integer(value),
33422 )),
33423 }
33424 }
33425 }
33426
33427 impl std::convert::From<&str> for SqlUserType {
33428 fn from(value: &str) -> Self {
33429 use std::string::ToString;
33430 match value {
33431 "BUILT_IN" => Self::BuiltIn,
33432 "CLOUD_IAM_USER" => Self::CloudIamUser,
33433 "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
33434 "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
33435 "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
33436 "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
33437 "CLOUD_IAM_WORKFORCE_IDENTITY" => Self::CloudIamWorkforceIdentity,
33438 "ENTRAID_USER" => Self::EntraidUser,
33439 _ => Self::UnknownValue(sql_user_type::UnknownValue(
33440 wkt::internal::UnknownEnumValue::String(value.to_string()),
33441 )),
33442 }
33443 }
33444 }
33445
33446 impl serde::ser::Serialize for SqlUserType {
33447 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33448 where
33449 S: serde::Serializer,
33450 {
33451 match self {
33452 Self::BuiltIn => serializer.serialize_i32(0),
33453 Self::CloudIamUser => serializer.serialize_i32(1),
33454 Self::CloudIamServiceAccount => serializer.serialize_i32(2),
33455 Self::CloudIamGroup => serializer.serialize_i32(3),
33456 Self::CloudIamGroupUser => serializer.serialize_i32(4),
33457 Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
33458 Self::CloudIamWorkforceIdentity => serializer.serialize_i32(6),
33459 Self::EntraidUser => serializer.serialize_i32(7),
33460 Self::UnknownValue(u) => u.0.serialize(serializer),
33461 }
33462 }
33463 }
33464
33465 impl<'de> serde::de::Deserialize<'de> for SqlUserType {
33466 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33467 where
33468 D: serde::Deserializer<'de>,
33469 {
33470 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
33471 ".google.cloud.sql.v1.User.SqlUserType",
33472 ))
33473 }
33474 }
33475
33476 /// The type of retained password.
33477 ///
33478 /// # Working with unknown values
33479 ///
33480 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33481 /// additional enum variants at any time. Adding new variants is not considered
33482 /// a breaking change. Applications should write their code in anticipation of:
33483 ///
33484 /// - New values appearing in future releases of the client library, **and**
33485 /// - New values received dynamically, without application changes.
33486 ///
33487 /// Please consult the [Working with enums] section in the user guide for some
33488 /// guidelines.
33489 ///
33490 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33491 #[derive(Clone, Debug, PartialEq)]
33492 #[non_exhaustive]
33493 pub enum DualPasswordType {
33494 /// The default value.
33495 Unspecified,
33496 /// Do not update the user's dual password status.
33497 NoModifyDualPassword,
33498 /// No dual password usable for connecting using this user.
33499 NoDualPassword,
33500 /// Dual password usable for connecting using this user.
33501 DualPassword,
33502 /// If set, the enum was initialized with an unknown value.
33503 ///
33504 /// Applications can examine the value using [DualPasswordType::value] or
33505 /// [DualPasswordType::name].
33506 UnknownValue(dual_password_type::UnknownValue),
33507 }
33508
33509 #[doc(hidden)]
33510 pub mod dual_password_type {
33511 #[allow(unused_imports)]
33512 use super::*;
33513 #[derive(Clone, Debug, PartialEq)]
33514 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33515 }
33516
33517 impl DualPasswordType {
33518 /// Gets the enum value.
33519 ///
33520 /// Returns `None` if the enum contains an unknown value deserialized from
33521 /// the string representation of enums.
33522 pub fn value(&self) -> std::option::Option<i32> {
33523 match self {
33524 Self::Unspecified => std::option::Option::Some(0),
33525 Self::NoModifyDualPassword => std::option::Option::Some(1),
33526 Self::NoDualPassword => std::option::Option::Some(2),
33527 Self::DualPassword => std::option::Option::Some(3),
33528 Self::UnknownValue(u) => u.0.value(),
33529 }
33530 }
33531
33532 /// Gets the enum value as a string.
33533 ///
33534 /// Returns `None` if the enum contains an unknown value deserialized from
33535 /// the integer representation of enums.
33536 pub fn name(&self) -> std::option::Option<&str> {
33537 match self {
33538 Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
33539 Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
33540 Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
33541 Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
33542 Self::UnknownValue(u) => u.0.name(),
33543 }
33544 }
33545 }
33546
33547 impl std::default::Default for DualPasswordType {
33548 fn default() -> Self {
33549 use std::convert::From;
33550 Self::from(0)
33551 }
33552 }
33553
33554 impl std::fmt::Display for DualPasswordType {
33555 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33556 wkt::internal::display_enum(f, self.name(), self.value())
33557 }
33558 }
33559
33560 impl std::convert::From<i32> for DualPasswordType {
33561 fn from(value: i32) -> Self {
33562 match value {
33563 0 => Self::Unspecified,
33564 1 => Self::NoModifyDualPassword,
33565 2 => Self::NoDualPassword,
33566 3 => Self::DualPassword,
33567 _ => Self::UnknownValue(dual_password_type::UnknownValue(
33568 wkt::internal::UnknownEnumValue::Integer(value),
33569 )),
33570 }
33571 }
33572 }
33573
33574 impl std::convert::From<&str> for DualPasswordType {
33575 fn from(value: &str) -> Self {
33576 use std::string::ToString;
33577 match value {
33578 "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
33579 "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
33580 "NO_DUAL_PASSWORD" => Self::NoDualPassword,
33581 "DUAL_PASSWORD" => Self::DualPassword,
33582 _ => Self::UnknownValue(dual_password_type::UnknownValue(
33583 wkt::internal::UnknownEnumValue::String(value.to_string()),
33584 )),
33585 }
33586 }
33587 }
33588
33589 impl serde::ser::Serialize for DualPasswordType {
33590 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33591 where
33592 S: serde::Serializer,
33593 {
33594 match self {
33595 Self::Unspecified => serializer.serialize_i32(0),
33596 Self::NoModifyDualPassword => serializer.serialize_i32(1),
33597 Self::NoDualPassword => serializer.serialize_i32(2),
33598 Self::DualPassword => serializer.serialize_i32(3),
33599 Self::UnknownValue(u) => u.0.serialize(serializer),
33600 }
33601 }
33602 }
33603
33604 impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
33605 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33606 where
33607 D: serde::Deserializer<'de>,
33608 {
33609 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
33610 ".google.cloud.sql.v1.User.DualPasswordType",
33611 ))
33612 }
33613 }
33614
33615 /// Indicates if a group is available for IAM database authentication.
33616 ///
33617 /// # Working with unknown values
33618 ///
33619 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33620 /// additional enum variants at any time. Adding new variants is not considered
33621 /// a breaking change. Applications should write their code in anticipation of:
33622 ///
33623 /// - New values appearing in future releases of the client library, **and**
33624 /// - New values received dynamically, without application changes.
33625 ///
33626 /// Please consult the [Working with enums] section in the user guide for some
33627 /// guidelines.
33628 ///
33629 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33630 #[derive(Clone, Debug, PartialEq)]
33631 #[non_exhaustive]
33632 pub enum IamStatus {
33633 /// The default value for users that are not of type CLOUD_IAM_GROUP.
33634 /// Only CLOUD_IAM_GROUP users will be inactive or active.
33635 /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
33636 /// display whether they are active or inactive as that is not applicable to
33637 /// them.
33638 Unspecified,
33639 /// INACTIVE indicates a group is not available for IAM database
33640 /// authentication.
33641 Inactive,
33642 /// ACTIVE indicates a group is available for IAM database authentication.
33643 Active,
33644 /// If set, the enum was initialized with an unknown value.
33645 ///
33646 /// Applications can examine the value using [IamStatus::value] or
33647 /// [IamStatus::name].
33648 UnknownValue(iam_status::UnknownValue),
33649 }
33650
33651 #[doc(hidden)]
33652 pub mod iam_status {
33653 #[allow(unused_imports)]
33654 use super::*;
33655 #[derive(Clone, Debug, PartialEq)]
33656 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33657 }
33658
33659 impl IamStatus {
33660 /// Gets the enum value.
33661 ///
33662 /// Returns `None` if the enum contains an unknown value deserialized from
33663 /// the string representation of enums.
33664 pub fn value(&self) -> std::option::Option<i32> {
33665 match self {
33666 Self::Unspecified => std::option::Option::Some(0),
33667 Self::Inactive => std::option::Option::Some(1),
33668 Self::Active => std::option::Option::Some(2),
33669 Self::UnknownValue(u) => u.0.value(),
33670 }
33671 }
33672
33673 /// Gets the enum value as a string.
33674 ///
33675 /// Returns `None` if the enum contains an unknown value deserialized from
33676 /// the integer representation of enums.
33677 pub fn name(&self) -> std::option::Option<&str> {
33678 match self {
33679 Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
33680 Self::Inactive => std::option::Option::Some("INACTIVE"),
33681 Self::Active => std::option::Option::Some("ACTIVE"),
33682 Self::UnknownValue(u) => u.0.name(),
33683 }
33684 }
33685 }
33686
33687 impl std::default::Default for IamStatus {
33688 fn default() -> Self {
33689 use std::convert::From;
33690 Self::from(0)
33691 }
33692 }
33693
33694 impl std::fmt::Display for IamStatus {
33695 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33696 wkt::internal::display_enum(f, self.name(), self.value())
33697 }
33698 }
33699
33700 impl std::convert::From<i32> for IamStatus {
33701 fn from(value: i32) -> Self {
33702 match value {
33703 0 => Self::Unspecified,
33704 1 => Self::Inactive,
33705 2 => Self::Active,
33706 _ => Self::UnknownValue(iam_status::UnknownValue(
33707 wkt::internal::UnknownEnumValue::Integer(value),
33708 )),
33709 }
33710 }
33711 }
33712
33713 impl std::convert::From<&str> for IamStatus {
33714 fn from(value: &str) -> Self {
33715 use std::string::ToString;
33716 match value {
33717 "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
33718 "INACTIVE" => Self::Inactive,
33719 "ACTIVE" => Self::Active,
33720 _ => Self::UnknownValue(iam_status::UnknownValue(
33721 wkt::internal::UnknownEnumValue::String(value.to_string()),
33722 )),
33723 }
33724 }
33725 }
33726
33727 impl serde::ser::Serialize for IamStatus {
33728 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33729 where
33730 S: serde::Serializer,
33731 {
33732 match self {
33733 Self::Unspecified => serializer.serialize_i32(0),
33734 Self::Inactive => serializer.serialize_i32(1),
33735 Self::Active => serializer.serialize_i32(2),
33736 Self::UnknownValue(u) => u.0.serialize(serializer),
33737 }
33738 }
33739 }
33740
33741 impl<'de> serde::de::Deserialize<'de> for IamStatus {
33742 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33743 where
33744 D: serde::Deserializer<'de>,
33745 {
33746 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
33747 ".google.cloud.sql.v1.User.IamStatus",
33748 ))
33749 }
33750 }
33751
33752 /// User details for specific database type
33753 #[derive(Clone, Debug, PartialEq)]
33754 #[non_exhaustive]
33755 pub enum UserDetails {
33756 #[allow(missing_docs)]
33757 SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
33758 }
33759}
33760
33761/// Represents a Sql Server user on the Cloud SQL instance.
33762#[derive(Clone, Default, PartialEq)]
33763#[non_exhaustive]
33764pub struct SqlServerUserDetails {
33765 /// If the user has been disabled
33766 pub disabled: bool,
33767
33768 /// The server roles for this user
33769 pub server_roles: std::vec::Vec<std::string::String>,
33770
33771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33772}
33773
33774impl SqlServerUserDetails {
33775 /// Creates a new default instance.
33776 pub fn new() -> Self {
33777 std::default::Default::default()
33778 }
33779
33780 /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
33781 ///
33782 /// # Example
33783 /// ```ignore,no_run
33784 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
33785 /// let x = SqlServerUserDetails::new().set_disabled(true);
33786 /// ```
33787 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33788 self.disabled = v.into();
33789 self
33790 }
33791
33792 /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
33793 ///
33794 /// # Example
33795 /// ```ignore,no_run
33796 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
33797 /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
33798 /// ```
33799 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
33800 where
33801 T: std::iter::IntoIterator<Item = V>,
33802 V: std::convert::Into<std::string::String>,
33803 {
33804 use std::iter::Iterator;
33805 self.server_roles = v.into_iter().map(|i| i.into()).collect();
33806 self
33807 }
33808}
33809
33810impl wkt::message::Message for SqlServerUserDetails {
33811 fn typename() -> &'static str {
33812 "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
33813 }
33814}
33815
33816/// User list response.
33817#[derive(Clone, Default, PartialEq)]
33818#[non_exhaustive]
33819pub struct UsersListResponse {
33820 /// This is always `sql#usersList`.
33821 pub kind: std::string::String,
33822
33823 /// List of user resources in the instance.
33824 pub items: std::vec::Vec<crate::model::User>,
33825
33826 /// Unused.
33827 #[deprecated]
33828 pub next_page_token: std::string::String,
33829
33830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33831}
33832
33833impl UsersListResponse {
33834 /// Creates a new default instance.
33835 pub fn new() -> Self {
33836 std::default::Default::default()
33837 }
33838
33839 /// Sets the value of [kind][crate::model::UsersListResponse::kind].
33840 ///
33841 /// # Example
33842 /// ```ignore,no_run
33843 /// # use google_cloud_sql_v1::model::UsersListResponse;
33844 /// let x = UsersListResponse::new().set_kind("example");
33845 /// ```
33846 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33847 self.kind = v.into();
33848 self
33849 }
33850
33851 /// Sets the value of [items][crate::model::UsersListResponse::items].
33852 ///
33853 /// # Example
33854 /// ```ignore,no_run
33855 /// # use google_cloud_sql_v1::model::UsersListResponse;
33856 /// use google_cloud_sql_v1::model::User;
33857 /// let x = UsersListResponse::new()
33858 /// .set_items([
33859 /// User::default()/* use setters */,
33860 /// User::default()/* use (different) setters */,
33861 /// ]);
33862 /// ```
33863 pub fn set_items<T, V>(mut self, v: T) -> Self
33864 where
33865 T: std::iter::IntoIterator<Item = V>,
33866 V: std::convert::Into<crate::model::User>,
33867 {
33868 use std::iter::Iterator;
33869 self.items = v.into_iter().map(|i| i.into()).collect();
33870 self
33871 }
33872
33873 /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
33874 ///
33875 /// # Example
33876 /// ```ignore,no_run
33877 /// # use google_cloud_sql_v1::model::UsersListResponse;
33878 /// let x = UsersListResponse::new().set_next_page_token("example");
33879 /// ```
33880 #[deprecated]
33881 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33882 self.next_page_token = v.into();
33883 self
33884 }
33885}
33886
33887impl wkt::message::Message for UsersListResponse {
33888 fn typename() -> &'static str {
33889 "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
33890 }
33891}
33892
33893/// The status of a backup run.
33894///
33895/// # Working with unknown values
33896///
33897/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33898/// additional enum variants at any time. Adding new variants is not considered
33899/// a breaking change. Applications should write their code in anticipation of:
33900///
33901/// - New values appearing in future releases of the client library, **and**
33902/// - New values received dynamically, without application changes.
33903///
33904/// Please consult the [Working with enums] section in the user guide for some
33905/// guidelines.
33906///
33907/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33908#[derive(Clone, Debug, PartialEq)]
33909#[non_exhaustive]
33910pub enum SqlBackupRunStatus {
33911 /// The status of the run is unknown.
33912 Unspecified,
33913 /// The backup operation was enqueued.
33914 Enqueued,
33915 /// The backup is overdue across a given backup window. Indicates a
33916 /// problem. Example: Long-running operation in progress during
33917 /// the whole window.
33918 Overdue,
33919 /// The backup is in progress.
33920 Running,
33921 /// The backup failed.
33922 Failed,
33923 /// The backup was successful.
33924 Successful,
33925 /// The backup was skipped (without problems) for a given backup
33926 /// window. Example: Instance was idle.
33927 Skipped,
33928 /// The backup is about to be deleted.
33929 DeletionPending,
33930 /// The backup deletion failed.
33931 DeletionFailed,
33932 /// The backup has been deleted.
33933 Deleted,
33934 /// If set, the enum was initialized with an unknown value.
33935 ///
33936 /// Applications can examine the value using [SqlBackupRunStatus::value] or
33937 /// [SqlBackupRunStatus::name].
33938 UnknownValue(sql_backup_run_status::UnknownValue),
33939}
33940
33941#[doc(hidden)]
33942pub mod sql_backup_run_status {
33943 #[allow(unused_imports)]
33944 use super::*;
33945 #[derive(Clone, Debug, PartialEq)]
33946 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33947}
33948
33949impl SqlBackupRunStatus {
33950 /// Gets the enum value.
33951 ///
33952 /// Returns `None` if the enum contains an unknown value deserialized from
33953 /// the string representation of enums.
33954 pub fn value(&self) -> std::option::Option<i32> {
33955 match self {
33956 Self::Unspecified => std::option::Option::Some(0),
33957 Self::Enqueued => std::option::Option::Some(1),
33958 Self::Overdue => std::option::Option::Some(2),
33959 Self::Running => std::option::Option::Some(3),
33960 Self::Failed => std::option::Option::Some(4),
33961 Self::Successful => std::option::Option::Some(5),
33962 Self::Skipped => std::option::Option::Some(6),
33963 Self::DeletionPending => std::option::Option::Some(7),
33964 Self::DeletionFailed => std::option::Option::Some(8),
33965 Self::Deleted => std::option::Option::Some(9),
33966 Self::UnknownValue(u) => u.0.value(),
33967 }
33968 }
33969
33970 /// Gets the enum value as a string.
33971 ///
33972 /// Returns `None` if the enum contains an unknown value deserialized from
33973 /// the integer representation of enums.
33974 pub fn name(&self) -> std::option::Option<&str> {
33975 match self {
33976 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
33977 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
33978 Self::Overdue => std::option::Option::Some("OVERDUE"),
33979 Self::Running => std::option::Option::Some("RUNNING"),
33980 Self::Failed => std::option::Option::Some("FAILED"),
33981 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
33982 Self::Skipped => std::option::Option::Some("SKIPPED"),
33983 Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
33984 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
33985 Self::Deleted => std::option::Option::Some("DELETED"),
33986 Self::UnknownValue(u) => u.0.name(),
33987 }
33988 }
33989}
33990
33991impl std::default::Default for SqlBackupRunStatus {
33992 fn default() -> Self {
33993 use std::convert::From;
33994 Self::from(0)
33995 }
33996}
33997
33998impl std::fmt::Display for SqlBackupRunStatus {
33999 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34000 wkt::internal::display_enum(f, self.name(), self.value())
34001 }
34002}
34003
34004impl std::convert::From<i32> for SqlBackupRunStatus {
34005 fn from(value: i32) -> Self {
34006 match value {
34007 0 => Self::Unspecified,
34008 1 => Self::Enqueued,
34009 2 => Self::Overdue,
34010 3 => Self::Running,
34011 4 => Self::Failed,
34012 5 => Self::Successful,
34013 6 => Self::Skipped,
34014 7 => Self::DeletionPending,
34015 8 => Self::DeletionFailed,
34016 9 => Self::Deleted,
34017 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
34018 wkt::internal::UnknownEnumValue::Integer(value),
34019 )),
34020 }
34021 }
34022}
34023
34024impl std::convert::From<&str> for SqlBackupRunStatus {
34025 fn from(value: &str) -> Self {
34026 use std::string::ToString;
34027 match value {
34028 "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
34029 "ENQUEUED" => Self::Enqueued,
34030 "OVERDUE" => Self::Overdue,
34031 "RUNNING" => Self::Running,
34032 "FAILED" => Self::Failed,
34033 "SUCCESSFUL" => Self::Successful,
34034 "SKIPPED" => Self::Skipped,
34035 "DELETION_PENDING" => Self::DeletionPending,
34036 "DELETION_FAILED" => Self::DeletionFailed,
34037 "DELETED" => Self::Deleted,
34038 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
34039 wkt::internal::UnknownEnumValue::String(value.to_string()),
34040 )),
34041 }
34042 }
34043}
34044
34045impl serde::ser::Serialize for SqlBackupRunStatus {
34046 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34047 where
34048 S: serde::Serializer,
34049 {
34050 match self {
34051 Self::Unspecified => serializer.serialize_i32(0),
34052 Self::Enqueued => serializer.serialize_i32(1),
34053 Self::Overdue => serializer.serialize_i32(2),
34054 Self::Running => serializer.serialize_i32(3),
34055 Self::Failed => serializer.serialize_i32(4),
34056 Self::Successful => serializer.serialize_i32(5),
34057 Self::Skipped => serializer.serialize_i32(6),
34058 Self::DeletionPending => serializer.serialize_i32(7),
34059 Self::DeletionFailed => serializer.serialize_i32(8),
34060 Self::Deleted => serializer.serialize_i32(9),
34061 Self::UnknownValue(u) => u.0.serialize(serializer),
34062 }
34063 }
34064}
34065
34066impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
34067 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34068 where
34069 D: serde::Deserializer<'de>,
34070 {
34071 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
34072 ".google.cloud.sql.v1.SqlBackupRunStatus",
34073 ))
34074 }
34075}
34076
34077/// Defines the supported backup kinds.
34078///
34079/// # Working with unknown values
34080///
34081/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34082/// additional enum variants at any time. Adding new variants is not considered
34083/// a breaking change. Applications should write their code in anticipation of:
34084///
34085/// - New values appearing in future releases of the client library, **and**
34086/// - New values received dynamically, without application changes.
34087///
34088/// Please consult the [Working with enums] section in the user guide for some
34089/// guidelines.
34090///
34091/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34092#[derive(Clone, Debug, PartialEq)]
34093#[non_exhaustive]
34094pub enum SqlBackupKind {
34095 /// This is an unknown BackupKind.
34096 Unspecified,
34097 /// Snapshot-based backups.
34098 Snapshot,
34099 /// Physical backups.
34100 Physical,
34101 /// If set, the enum was initialized with an unknown value.
34102 ///
34103 /// Applications can examine the value using [SqlBackupKind::value] or
34104 /// [SqlBackupKind::name].
34105 UnknownValue(sql_backup_kind::UnknownValue),
34106}
34107
34108#[doc(hidden)]
34109pub mod sql_backup_kind {
34110 #[allow(unused_imports)]
34111 use super::*;
34112 #[derive(Clone, Debug, PartialEq)]
34113 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34114}
34115
34116impl SqlBackupKind {
34117 /// Gets the enum value.
34118 ///
34119 /// Returns `None` if the enum contains an unknown value deserialized from
34120 /// the string representation of enums.
34121 pub fn value(&self) -> std::option::Option<i32> {
34122 match self {
34123 Self::Unspecified => std::option::Option::Some(0),
34124 Self::Snapshot => std::option::Option::Some(1),
34125 Self::Physical => std::option::Option::Some(2),
34126 Self::UnknownValue(u) => u.0.value(),
34127 }
34128 }
34129
34130 /// Gets the enum value as a string.
34131 ///
34132 /// Returns `None` if the enum contains an unknown value deserialized from
34133 /// the integer representation of enums.
34134 pub fn name(&self) -> std::option::Option<&str> {
34135 match self {
34136 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
34137 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
34138 Self::Physical => std::option::Option::Some("PHYSICAL"),
34139 Self::UnknownValue(u) => u.0.name(),
34140 }
34141 }
34142}
34143
34144impl std::default::Default for SqlBackupKind {
34145 fn default() -> Self {
34146 use std::convert::From;
34147 Self::from(0)
34148 }
34149}
34150
34151impl std::fmt::Display for SqlBackupKind {
34152 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34153 wkt::internal::display_enum(f, self.name(), self.value())
34154 }
34155}
34156
34157impl std::convert::From<i32> for SqlBackupKind {
34158 fn from(value: i32) -> Self {
34159 match value {
34160 0 => Self::Unspecified,
34161 1 => Self::Snapshot,
34162 2 => Self::Physical,
34163 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
34164 wkt::internal::UnknownEnumValue::Integer(value),
34165 )),
34166 }
34167 }
34168}
34169
34170impl std::convert::From<&str> for SqlBackupKind {
34171 fn from(value: &str) -> Self {
34172 use std::string::ToString;
34173 match value {
34174 "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
34175 "SNAPSHOT" => Self::Snapshot,
34176 "PHYSICAL" => Self::Physical,
34177 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
34178 wkt::internal::UnknownEnumValue::String(value.to_string()),
34179 )),
34180 }
34181 }
34182}
34183
34184impl serde::ser::Serialize for SqlBackupKind {
34185 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34186 where
34187 S: serde::Serializer,
34188 {
34189 match self {
34190 Self::Unspecified => serializer.serialize_i32(0),
34191 Self::Snapshot => serializer.serialize_i32(1),
34192 Self::Physical => serializer.serialize_i32(2),
34193 Self::UnknownValue(u) => u.0.serialize(serializer),
34194 }
34195 }
34196}
34197
34198impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
34199 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34200 where
34201 D: serde::Deserializer<'de>,
34202 {
34203 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
34204 ".google.cloud.sql.v1.SqlBackupKind",
34205 ))
34206 }
34207}
34208
34209/// Type of backup (i.e. automated, on demand, etc).
34210///
34211/// # Working with unknown values
34212///
34213/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34214/// additional enum variants at any time. Adding new variants is not considered
34215/// a breaking change. Applications should write their code in anticipation of:
34216///
34217/// - New values appearing in future releases of the client library, **and**
34218/// - New values received dynamically, without application changes.
34219///
34220/// Please consult the [Working with enums] section in the user guide for some
34221/// guidelines.
34222///
34223/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34224#[derive(Clone, Debug, PartialEq)]
34225#[non_exhaustive]
34226pub enum SqlBackupRunType {
34227 /// This is an unknown BackupRun type.
34228 Unspecified,
34229 /// The backup schedule automatically triggers a backup.
34230 Automated,
34231 /// The user manually triggers a backup.
34232 OnDemand,
34233 /// If set, the enum was initialized with an unknown value.
34234 ///
34235 /// Applications can examine the value using [SqlBackupRunType::value] or
34236 /// [SqlBackupRunType::name].
34237 UnknownValue(sql_backup_run_type::UnknownValue),
34238}
34239
34240#[doc(hidden)]
34241pub mod sql_backup_run_type {
34242 #[allow(unused_imports)]
34243 use super::*;
34244 #[derive(Clone, Debug, PartialEq)]
34245 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34246}
34247
34248impl SqlBackupRunType {
34249 /// Gets the enum value.
34250 ///
34251 /// Returns `None` if the enum contains an unknown value deserialized from
34252 /// the string representation of enums.
34253 pub fn value(&self) -> std::option::Option<i32> {
34254 match self {
34255 Self::Unspecified => std::option::Option::Some(0),
34256 Self::Automated => std::option::Option::Some(1),
34257 Self::OnDemand => std::option::Option::Some(2),
34258 Self::UnknownValue(u) => u.0.value(),
34259 }
34260 }
34261
34262 /// Gets the enum value as a string.
34263 ///
34264 /// Returns `None` if the enum contains an unknown value deserialized from
34265 /// the integer representation of enums.
34266 pub fn name(&self) -> std::option::Option<&str> {
34267 match self {
34268 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
34269 Self::Automated => std::option::Option::Some("AUTOMATED"),
34270 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
34271 Self::UnknownValue(u) => u.0.name(),
34272 }
34273 }
34274}
34275
34276impl std::default::Default for SqlBackupRunType {
34277 fn default() -> Self {
34278 use std::convert::From;
34279 Self::from(0)
34280 }
34281}
34282
34283impl std::fmt::Display for SqlBackupRunType {
34284 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34285 wkt::internal::display_enum(f, self.name(), self.value())
34286 }
34287}
34288
34289impl std::convert::From<i32> for SqlBackupRunType {
34290 fn from(value: i32) -> Self {
34291 match value {
34292 0 => Self::Unspecified,
34293 1 => Self::Automated,
34294 2 => Self::OnDemand,
34295 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
34296 wkt::internal::UnknownEnumValue::Integer(value),
34297 )),
34298 }
34299 }
34300}
34301
34302impl std::convert::From<&str> for SqlBackupRunType {
34303 fn from(value: &str) -> Self {
34304 use std::string::ToString;
34305 match value {
34306 "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
34307 "AUTOMATED" => Self::Automated,
34308 "ON_DEMAND" => Self::OnDemand,
34309 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
34310 wkt::internal::UnknownEnumValue::String(value.to_string()),
34311 )),
34312 }
34313 }
34314}
34315
34316impl serde::ser::Serialize for SqlBackupRunType {
34317 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34318 where
34319 S: serde::Serializer,
34320 {
34321 match self {
34322 Self::Unspecified => serializer.serialize_i32(0),
34323 Self::Automated => serializer.serialize_i32(1),
34324 Self::OnDemand => serializer.serialize_i32(2),
34325 Self::UnknownValue(u) => u.0.serialize(serializer),
34326 }
34327 }
34328}
34329
34330impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
34331 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34332 where
34333 D: serde::Deserializer<'de>,
34334 {
34335 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
34336 ".google.cloud.sql.v1.SqlBackupRunType",
34337 ))
34338 }
34339}
34340
34341/// Enum for [SqlFlagType].
34342///
34343/// # Working with unknown values
34344///
34345/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34346/// additional enum variants at any time. Adding new variants is not considered
34347/// a breaking change. Applications should write their code in anticipation of:
34348///
34349/// - New values appearing in future releases of the client library, **and**
34350/// - New values received dynamically, without application changes.
34351///
34352/// Please consult the [Working with enums] section in the user guide for some
34353/// guidelines.
34354///
34355/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34356#[derive(Clone, Debug, PartialEq)]
34357#[non_exhaustive]
34358pub enum SqlFlagType {
34359 /// This is an unknown flag type.
34360 Unspecified,
34361 /// Boolean type flag.
34362 Boolean,
34363 /// String type flag.
34364 String,
34365 /// Integer type flag.
34366 Integer,
34367 /// Flag type used for a server startup option.
34368 None,
34369 /// Type introduced specially for MySQL TimeZone offset. Accept a string value
34370 /// with the format [-12:59, 13:00].
34371 MysqlTimezoneOffset,
34372 /// Float type flag.
34373 Float,
34374 /// Comma-separated list of the strings in a SqlFlagType enum.
34375 RepeatedString,
34376 /// If set, the enum was initialized with an unknown value.
34377 ///
34378 /// Applications can examine the value using [SqlFlagType::value] or
34379 /// [SqlFlagType::name].
34380 UnknownValue(sql_flag_type::UnknownValue),
34381}
34382
34383#[doc(hidden)]
34384pub mod sql_flag_type {
34385 #[allow(unused_imports)]
34386 use super::*;
34387 #[derive(Clone, Debug, PartialEq)]
34388 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34389}
34390
34391impl SqlFlagType {
34392 /// Gets the enum value.
34393 ///
34394 /// Returns `None` if the enum contains an unknown value deserialized from
34395 /// the string representation of enums.
34396 pub fn value(&self) -> std::option::Option<i32> {
34397 match self {
34398 Self::Unspecified => std::option::Option::Some(0),
34399 Self::Boolean => std::option::Option::Some(1),
34400 Self::String => std::option::Option::Some(2),
34401 Self::Integer => std::option::Option::Some(3),
34402 Self::None => std::option::Option::Some(4),
34403 Self::MysqlTimezoneOffset => std::option::Option::Some(5),
34404 Self::Float => std::option::Option::Some(6),
34405 Self::RepeatedString => std::option::Option::Some(7),
34406 Self::UnknownValue(u) => u.0.value(),
34407 }
34408 }
34409
34410 /// Gets the enum value as a string.
34411 ///
34412 /// Returns `None` if the enum contains an unknown value deserialized from
34413 /// the integer representation of enums.
34414 pub fn name(&self) -> std::option::Option<&str> {
34415 match self {
34416 Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
34417 Self::Boolean => std::option::Option::Some("BOOLEAN"),
34418 Self::String => std::option::Option::Some("STRING"),
34419 Self::Integer => std::option::Option::Some("INTEGER"),
34420 Self::None => std::option::Option::Some("NONE"),
34421 Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
34422 Self::Float => std::option::Option::Some("FLOAT"),
34423 Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
34424 Self::UnknownValue(u) => u.0.name(),
34425 }
34426 }
34427}
34428
34429impl std::default::Default for SqlFlagType {
34430 fn default() -> Self {
34431 use std::convert::From;
34432 Self::from(0)
34433 }
34434}
34435
34436impl std::fmt::Display for SqlFlagType {
34437 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34438 wkt::internal::display_enum(f, self.name(), self.value())
34439 }
34440}
34441
34442impl std::convert::From<i32> for SqlFlagType {
34443 fn from(value: i32) -> Self {
34444 match value {
34445 0 => Self::Unspecified,
34446 1 => Self::Boolean,
34447 2 => Self::String,
34448 3 => Self::Integer,
34449 4 => Self::None,
34450 5 => Self::MysqlTimezoneOffset,
34451 6 => Self::Float,
34452 7 => Self::RepeatedString,
34453 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
34454 wkt::internal::UnknownEnumValue::Integer(value),
34455 )),
34456 }
34457 }
34458}
34459
34460impl std::convert::From<&str> for SqlFlagType {
34461 fn from(value: &str) -> Self {
34462 use std::string::ToString;
34463 match value {
34464 "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
34465 "BOOLEAN" => Self::Boolean,
34466 "STRING" => Self::String,
34467 "INTEGER" => Self::Integer,
34468 "NONE" => Self::None,
34469 "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
34470 "FLOAT" => Self::Float,
34471 "REPEATED_STRING" => Self::RepeatedString,
34472 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
34473 wkt::internal::UnknownEnumValue::String(value.to_string()),
34474 )),
34475 }
34476 }
34477}
34478
34479impl serde::ser::Serialize for SqlFlagType {
34480 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34481 where
34482 S: serde::Serializer,
34483 {
34484 match self {
34485 Self::Unspecified => serializer.serialize_i32(0),
34486 Self::Boolean => serializer.serialize_i32(1),
34487 Self::String => serializer.serialize_i32(2),
34488 Self::Integer => serializer.serialize_i32(3),
34489 Self::None => serializer.serialize_i32(4),
34490 Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
34491 Self::Float => serializer.serialize_i32(6),
34492 Self::RepeatedString => serializer.serialize_i32(7),
34493 Self::UnknownValue(u) => u.0.serialize(serializer),
34494 }
34495 }
34496}
34497
34498impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
34499 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34500 where
34501 D: serde::Deserializer<'de>,
34502 {
34503 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
34504 ".google.cloud.sql.v1.SqlFlagType",
34505 ))
34506 }
34507}
34508
34509/// Scopes of a flag describe where the flag is used.
34510///
34511/// # Working with unknown values
34512///
34513/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34514/// additional enum variants at any time. Adding new variants is not considered
34515/// a breaking change. Applications should write their code in anticipation of:
34516///
34517/// - New values appearing in future releases of the client library, **and**
34518/// - New values received dynamically, without application changes.
34519///
34520/// Please consult the [Working with enums] section in the user guide for some
34521/// guidelines.
34522///
34523/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34524#[derive(Clone, Debug, PartialEq)]
34525#[non_exhaustive]
34526pub enum SqlFlagScope {
34527 /// Assume database flags if unspecified
34528 Unspecified,
34529 /// database flags
34530 Database,
34531 /// connection pool configuration flags
34532 ConnectionPool,
34533 /// If set, the enum was initialized with an unknown value.
34534 ///
34535 /// Applications can examine the value using [SqlFlagScope::value] or
34536 /// [SqlFlagScope::name].
34537 UnknownValue(sql_flag_scope::UnknownValue),
34538}
34539
34540#[doc(hidden)]
34541pub mod sql_flag_scope {
34542 #[allow(unused_imports)]
34543 use super::*;
34544 #[derive(Clone, Debug, PartialEq)]
34545 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34546}
34547
34548impl SqlFlagScope {
34549 /// Gets the enum value.
34550 ///
34551 /// Returns `None` if the enum contains an unknown value deserialized from
34552 /// the string representation of enums.
34553 pub fn value(&self) -> std::option::Option<i32> {
34554 match self {
34555 Self::Unspecified => std::option::Option::Some(0),
34556 Self::Database => std::option::Option::Some(1),
34557 Self::ConnectionPool => std::option::Option::Some(2),
34558 Self::UnknownValue(u) => u.0.value(),
34559 }
34560 }
34561
34562 /// Gets the enum value as a string.
34563 ///
34564 /// Returns `None` if the enum contains an unknown value deserialized from
34565 /// the integer representation of enums.
34566 pub fn name(&self) -> std::option::Option<&str> {
34567 match self {
34568 Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
34569 Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
34570 Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
34571 Self::UnknownValue(u) => u.0.name(),
34572 }
34573 }
34574}
34575
34576impl std::default::Default for SqlFlagScope {
34577 fn default() -> Self {
34578 use std::convert::From;
34579 Self::from(0)
34580 }
34581}
34582
34583impl std::fmt::Display for SqlFlagScope {
34584 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34585 wkt::internal::display_enum(f, self.name(), self.value())
34586 }
34587}
34588
34589impl std::convert::From<i32> for SqlFlagScope {
34590 fn from(value: i32) -> Self {
34591 match value {
34592 0 => Self::Unspecified,
34593 1 => Self::Database,
34594 2 => Self::ConnectionPool,
34595 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
34596 wkt::internal::UnknownEnumValue::Integer(value),
34597 )),
34598 }
34599 }
34600}
34601
34602impl std::convert::From<&str> for SqlFlagScope {
34603 fn from(value: &str) -> Self {
34604 use std::string::ToString;
34605 match value {
34606 "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
34607 "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
34608 "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
34609 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
34610 wkt::internal::UnknownEnumValue::String(value.to_string()),
34611 )),
34612 }
34613 }
34614}
34615
34616impl serde::ser::Serialize for SqlFlagScope {
34617 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34618 where
34619 S: serde::Serializer,
34620 {
34621 match self {
34622 Self::Unspecified => serializer.serialize_i32(0),
34623 Self::Database => serializer.serialize_i32(1),
34624 Self::ConnectionPool => serializer.serialize_i32(2),
34625 Self::UnknownValue(u) => u.0.serialize(serializer),
34626 }
34627 }
34628}
34629
34630impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
34631 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34632 where
34633 D: serde::Deserializer<'de>,
34634 {
34635 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
34636 ".google.cloud.sql.v1.SqlFlagScope",
34637 ))
34638 }
34639}
34640
34641/// External Sync parallel level.
34642///
34643/// # Working with unknown values
34644///
34645/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34646/// additional enum variants at any time. Adding new variants is not considered
34647/// a breaking change. Applications should write their code in anticipation of:
34648///
34649/// - New values appearing in future releases of the client library, **and**
34650/// - New values received dynamically, without application changes.
34651///
34652/// Please consult the [Working with enums] section in the user guide for some
34653/// guidelines.
34654///
34655/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34656#[derive(Clone, Debug, PartialEq)]
34657#[non_exhaustive]
34658pub enum ExternalSyncParallelLevel {
34659 /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
34660 Unspecified,
34661 /// Minimal parallel level.
34662 Min,
34663 /// Optimal parallel level.
34664 Optimal,
34665 /// Maximum parallel level.
34666 Max,
34667 /// If set, the enum was initialized with an unknown value.
34668 ///
34669 /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
34670 /// [ExternalSyncParallelLevel::name].
34671 UnknownValue(external_sync_parallel_level::UnknownValue),
34672}
34673
34674#[doc(hidden)]
34675pub mod external_sync_parallel_level {
34676 #[allow(unused_imports)]
34677 use super::*;
34678 #[derive(Clone, Debug, PartialEq)]
34679 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34680}
34681
34682impl ExternalSyncParallelLevel {
34683 /// Gets the enum value.
34684 ///
34685 /// Returns `None` if the enum contains an unknown value deserialized from
34686 /// the string representation of enums.
34687 pub fn value(&self) -> std::option::Option<i32> {
34688 match self {
34689 Self::Unspecified => std::option::Option::Some(0),
34690 Self::Min => std::option::Option::Some(1),
34691 Self::Optimal => std::option::Option::Some(2),
34692 Self::Max => std::option::Option::Some(3),
34693 Self::UnknownValue(u) => u.0.value(),
34694 }
34695 }
34696
34697 /// Gets the enum value as a string.
34698 ///
34699 /// Returns `None` if the enum contains an unknown value deserialized from
34700 /// the integer representation of enums.
34701 pub fn name(&self) -> std::option::Option<&str> {
34702 match self {
34703 Self::Unspecified => {
34704 std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
34705 }
34706 Self::Min => std::option::Option::Some("MIN"),
34707 Self::Optimal => std::option::Option::Some("OPTIMAL"),
34708 Self::Max => std::option::Option::Some("MAX"),
34709 Self::UnknownValue(u) => u.0.name(),
34710 }
34711 }
34712}
34713
34714impl std::default::Default for ExternalSyncParallelLevel {
34715 fn default() -> Self {
34716 use std::convert::From;
34717 Self::from(0)
34718 }
34719}
34720
34721impl std::fmt::Display for ExternalSyncParallelLevel {
34722 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34723 wkt::internal::display_enum(f, self.name(), self.value())
34724 }
34725}
34726
34727impl std::convert::From<i32> for ExternalSyncParallelLevel {
34728 fn from(value: i32) -> Self {
34729 match value {
34730 0 => Self::Unspecified,
34731 1 => Self::Min,
34732 2 => Self::Optimal,
34733 3 => Self::Max,
34734 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
34735 wkt::internal::UnknownEnumValue::Integer(value),
34736 )),
34737 }
34738 }
34739}
34740
34741impl std::convert::From<&str> for ExternalSyncParallelLevel {
34742 fn from(value: &str) -> Self {
34743 use std::string::ToString;
34744 match value {
34745 "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
34746 "MIN" => Self::Min,
34747 "OPTIMAL" => Self::Optimal,
34748 "MAX" => Self::Max,
34749 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
34750 wkt::internal::UnknownEnumValue::String(value.to_string()),
34751 )),
34752 }
34753 }
34754}
34755
34756impl serde::ser::Serialize for ExternalSyncParallelLevel {
34757 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34758 where
34759 S: serde::Serializer,
34760 {
34761 match self {
34762 Self::Unspecified => serializer.serialize_i32(0),
34763 Self::Min => serializer.serialize_i32(1),
34764 Self::Optimal => serializer.serialize_i32(2),
34765 Self::Max => serializer.serialize_i32(3),
34766 Self::UnknownValue(u) => u.0.serialize(serializer),
34767 }
34768 }
34769}
34770
34771impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
34772 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34773 where
34774 D: serde::Deserializer<'de>,
34775 {
34776 deserializer.deserialize_any(
34777 wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
34778 ".google.cloud.sql.v1.ExternalSyncParallelLevel",
34779 ),
34780 )
34781 }
34782}
34783
34784/// Enum for [SqlInstanceType].
34785///
34786/// # Working with unknown values
34787///
34788/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34789/// additional enum variants at any time. Adding new variants is not considered
34790/// a breaking change. Applications should write their code in anticipation of:
34791///
34792/// - New values appearing in future releases of the client library, **and**
34793/// - New values received dynamically, without application changes.
34794///
34795/// Please consult the [Working with enums] section in the user guide for some
34796/// guidelines.
34797///
34798/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34799#[derive(Clone, Debug, PartialEq)]
34800#[non_exhaustive]
34801pub enum SqlInstanceType {
34802 /// This is an unknown Cloud SQL instance type.
34803 Unspecified,
34804 /// A regular Cloud SQL instance that is not replicating from a primary
34805 /// instance.
34806 CloudSqlInstance,
34807 /// An instance running on the customer's premises that is not managed by
34808 /// Cloud SQL.
34809 OnPremisesInstance,
34810 /// A Cloud SQL instance acting as a read-replica.
34811 ReadReplicaInstance,
34812 /// A Cloud SQL read pool.
34813 ReadPoolInstance,
34814 /// If set, the enum was initialized with an unknown value.
34815 ///
34816 /// Applications can examine the value using [SqlInstanceType::value] or
34817 /// [SqlInstanceType::name].
34818 UnknownValue(sql_instance_type::UnknownValue),
34819}
34820
34821#[doc(hidden)]
34822pub mod sql_instance_type {
34823 #[allow(unused_imports)]
34824 use super::*;
34825 #[derive(Clone, Debug, PartialEq)]
34826 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34827}
34828
34829impl SqlInstanceType {
34830 /// Gets the enum value.
34831 ///
34832 /// Returns `None` if the enum contains an unknown value deserialized from
34833 /// the string representation of enums.
34834 pub fn value(&self) -> std::option::Option<i32> {
34835 match self {
34836 Self::Unspecified => std::option::Option::Some(0),
34837 Self::CloudSqlInstance => std::option::Option::Some(1),
34838 Self::OnPremisesInstance => std::option::Option::Some(2),
34839 Self::ReadReplicaInstance => std::option::Option::Some(3),
34840 Self::ReadPoolInstance => std::option::Option::Some(5),
34841 Self::UnknownValue(u) => u.0.value(),
34842 }
34843 }
34844
34845 /// Gets the enum value as a string.
34846 ///
34847 /// Returns `None` if the enum contains an unknown value deserialized from
34848 /// the integer representation of enums.
34849 pub fn name(&self) -> std::option::Option<&str> {
34850 match self {
34851 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
34852 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
34853 Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
34854 Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
34855 Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
34856 Self::UnknownValue(u) => u.0.name(),
34857 }
34858 }
34859}
34860
34861impl std::default::Default for SqlInstanceType {
34862 fn default() -> Self {
34863 use std::convert::From;
34864 Self::from(0)
34865 }
34866}
34867
34868impl std::fmt::Display for SqlInstanceType {
34869 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34870 wkt::internal::display_enum(f, self.name(), self.value())
34871 }
34872}
34873
34874impl std::convert::From<i32> for SqlInstanceType {
34875 fn from(value: i32) -> Self {
34876 match value {
34877 0 => Self::Unspecified,
34878 1 => Self::CloudSqlInstance,
34879 2 => Self::OnPremisesInstance,
34880 3 => Self::ReadReplicaInstance,
34881 5 => Self::ReadPoolInstance,
34882 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
34883 wkt::internal::UnknownEnumValue::Integer(value),
34884 )),
34885 }
34886 }
34887}
34888
34889impl std::convert::From<&str> for SqlInstanceType {
34890 fn from(value: &str) -> Self {
34891 use std::string::ToString;
34892 match value {
34893 "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
34894 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
34895 "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
34896 "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
34897 "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
34898 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
34899 wkt::internal::UnknownEnumValue::String(value.to_string()),
34900 )),
34901 }
34902 }
34903}
34904
34905impl serde::ser::Serialize for SqlInstanceType {
34906 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34907 where
34908 S: serde::Serializer,
34909 {
34910 match self {
34911 Self::Unspecified => serializer.serialize_i32(0),
34912 Self::CloudSqlInstance => serializer.serialize_i32(1),
34913 Self::OnPremisesInstance => serializer.serialize_i32(2),
34914 Self::ReadReplicaInstance => serializer.serialize_i32(3),
34915 Self::ReadPoolInstance => serializer.serialize_i32(5),
34916 Self::UnknownValue(u) => u.0.serialize(serializer),
34917 }
34918 }
34919}
34920
34921impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
34922 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34923 where
34924 D: serde::Deserializer<'de>,
34925 {
34926 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
34927 ".google.cloud.sql.v1.SqlInstanceType",
34928 ))
34929 }
34930}
34931
34932/// The suspension reason of the database instance if the state is SUSPENDED.
34933///
34934/// # Working with unknown values
34935///
34936/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34937/// additional enum variants at any time. Adding new variants is not considered
34938/// a breaking change. Applications should write their code in anticipation of:
34939///
34940/// - New values appearing in future releases of the client library, **and**
34941/// - New values received dynamically, without application changes.
34942///
34943/// Please consult the [Working with enums] section in the user guide for some
34944/// guidelines.
34945///
34946/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34947#[derive(Clone, Debug, PartialEq)]
34948#[non_exhaustive]
34949pub enum SqlSuspensionReason {
34950 /// This is an unknown suspension reason.
34951 Unspecified,
34952 /// The instance is suspended due to billing issues (for example:, account
34953 /// issue)
34954 BillingIssue,
34955 /// The instance is suspended due to illegal content (for example:, child
34956 /// pornography, copyrighted material, etc.).
34957 LegalIssue,
34958 /// The instance is causing operational issues (for example:, causing the
34959 /// database to crash).
34960 OperationalIssue,
34961 /// The KMS key used by the instance is either revoked or denied access to
34962 KmsKeyIssue,
34963 /// The project is suspended due to abuse detected by Ares.
34964 ProjectAbuse,
34965 /// If set, the enum was initialized with an unknown value.
34966 ///
34967 /// Applications can examine the value using [SqlSuspensionReason::value] or
34968 /// [SqlSuspensionReason::name].
34969 UnknownValue(sql_suspension_reason::UnknownValue),
34970}
34971
34972#[doc(hidden)]
34973pub mod sql_suspension_reason {
34974 #[allow(unused_imports)]
34975 use super::*;
34976 #[derive(Clone, Debug, PartialEq)]
34977 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34978}
34979
34980impl SqlSuspensionReason {
34981 /// Gets the enum value.
34982 ///
34983 /// Returns `None` if the enum contains an unknown value deserialized from
34984 /// the string representation of enums.
34985 pub fn value(&self) -> std::option::Option<i32> {
34986 match self {
34987 Self::Unspecified => std::option::Option::Some(0),
34988 Self::BillingIssue => std::option::Option::Some(2),
34989 Self::LegalIssue => std::option::Option::Some(3),
34990 Self::OperationalIssue => std::option::Option::Some(4),
34991 Self::KmsKeyIssue => std::option::Option::Some(5),
34992 Self::ProjectAbuse => std::option::Option::Some(8),
34993 Self::UnknownValue(u) => u.0.value(),
34994 }
34995 }
34996
34997 /// Gets the enum value as a string.
34998 ///
34999 /// Returns `None` if the enum contains an unknown value deserialized from
35000 /// the integer representation of enums.
35001 pub fn name(&self) -> std::option::Option<&str> {
35002 match self {
35003 Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
35004 Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
35005 Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
35006 Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
35007 Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
35008 Self::ProjectAbuse => std::option::Option::Some("PROJECT_ABUSE"),
35009 Self::UnknownValue(u) => u.0.name(),
35010 }
35011 }
35012}
35013
35014impl std::default::Default for SqlSuspensionReason {
35015 fn default() -> Self {
35016 use std::convert::From;
35017 Self::from(0)
35018 }
35019}
35020
35021impl std::fmt::Display for SqlSuspensionReason {
35022 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35023 wkt::internal::display_enum(f, self.name(), self.value())
35024 }
35025}
35026
35027impl std::convert::From<i32> for SqlSuspensionReason {
35028 fn from(value: i32) -> Self {
35029 match value {
35030 0 => Self::Unspecified,
35031 2 => Self::BillingIssue,
35032 3 => Self::LegalIssue,
35033 4 => Self::OperationalIssue,
35034 5 => Self::KmsKeyIssue,
35035 8 => Self::ProjectAbuse,
35036 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
35037 wkt::internal::UnknownEnumValue::Integer(value),
35038 )),
35039 }
35040 }
35041}
35042
35043impl std::convert::From<&str> for SqlSuspensionReason {
35044 fn from(value: &str) -> Self {
35045 use std::string::ToString;
35046 match value {
35047 "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
35048 "BILLING_ISSUE" => Self::BillingIssue,
35049 "LEGAL_ISSUE" => Self::LegalIssue,
35050 "OPERATIONAL_ISSUE" => Self::OperationalIssue,
35051 "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
35052 "PROJECT_ABUSE" => Self::ProjectAbuse,
35053 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
35054 wkt::internal::UnknownEnumValue::String(value.to_string()),
35055 )),
35056 }
35057 }
35058}
35059
35060impl serde::ser::Serialize for SqlSuspensionReason {
35061 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35062 where
35063 S: serde::Serializer,
35064 {
35065 match self {
35066 Self::Unspecified => serializer.serialize_i32(0),
35067 Self::BillingIssue => serializer.serialize_i32(2),
35068 Self::LegalIssue => serializer.serialize_i32(3),
35069 Self::OperationalIssue => serializer.serialize_i32(4),
35070 Self::KmsKeyIssue => serializer.serialize_i32(5),
35071 Self::ProjectAbuse => serializer.serialize_i32(8),
35072 Self::UnknownValue(u) => u.0.serialize(serializer),
35073 }
35074 }
35075}
35076
35077impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
35078 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35079 where
35080 D: serde::Deserializer<'de>,
35081 {
35082 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
35083 ".google.cloud.sql.v1.SqlSuspensionReason",
35084 ))
35085 }
35086}
35087
35088/// Enum for [SqlFileType].
35089///
35090/// # Working with unknown values
35091///
35092/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35093/// additional enum variants at any time. Adding new variants is not considered
35094/// a breaking change. Applications should write their code in anticipation of:
35095///
35096/// - New values appearing in future releases of the client library, **and**
35097/// - New values received dynamically, without application changes.
35098///
35099/// Please consult the [Working with enums] section in the user guide for some
35100/// guidelines.
35101///
35102/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35103#[derive(Clone, Debug, PartialEq)]
35104#[non_exhaustive]
35105pub enum SqlFileType {
35106 /// Unknown file type.
35107 Unspecified,
35108 /// File containing SQL statements.
35109 Sql,
35110 /// File in CSV format.
35111 Csv,
35112 #[allow(missing_docs)]
35113 Bak,
35114 /// TDE certificate.
35115 Tde,
35116 /// If set, the enum was initialized with an unknown value.
35117 ///
35118 /// Applications can examine the value using [SqlFileType::value] or
35119 /// [SqlFileType::name].
35120 UnknownValue(sql_file_type::UnknownValue),
35121}
35122
35123#[doc(hidden)]
35124pub mod sql_file_type {
35125 #[allow(unused_imports)]
35126 use super::*;
35127 #[derive(Clone, Debug, PartialEq)]
35128 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35129}
35130
35131impl SqlFileType {
35132 /// Gets the enum value.
35133 ///
35134 /// Returns `None` if the enum contains an unknown value deserialized from
35135 /// the string representation of enums.
35136 pub fn value(&self) -> std::option::Option<i32> {
35137 match self {
35138 Self::Unspecified => std::option::Option::Some(0),
35139 Self::Sql => std::option::Option::Some(1),
35140 Self::Csv => std::option::Option::Some(2),
35141 Self::Bak => std::option::Option::Some(4),
35142 Self::Tde => std::option::Option::Some(8),
35143 Self::UnknownValue(u) => u.0.value(),
35144 }
35145 }
35146
35147 /// Gets the enum value as a string.
35148 ///
35149 /// Returns `None` if the enum contains an unknown value deserialized from
35150 /// the integer representation of enums.
35151 pub fn name(&self) -> std::option::Option<&str> {
35152 match self {
35153 Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
35154 Self::Sql => std::option::Option::Some("SQL"),
35155 Self::Csv => std::option::Option::Some("CSV"),
35156 Self::Bak => std::option::Option::Some("BAK"),
35157 Self::Tde => std::option::Option::Some("TDE"),
35158 Self::UnknownValue(u) => u.0.name(),
35159 }
35160 }
35161}
35162
35163impl std::default::Default for SqlFileType {
35164 fn default() -> Self {
35165 use std::convert::From;
35166 Self::from(0)
35167 }
35168}
35169
35170impl std::fmt::Display for SqlFileType {
35171 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35172 wkt::internal::display_enum(f, self.name(), self.value())
35173 }
35174}
35175
35176impl std::convert::From<i32> for SqlFileType {
35177 fn from(value: i32) -> Self {
35178 match value {
35179 0 => Self::Unspecified,
35180 1 => Self::Sql,
35181 2 => Self::Csv,
35182 4 => Self::Bak,
35183 8 => Self::Tde,
35184 _ => Self::UnknownValue(sql_file_type::UnknownValue(
35185 wkt::internal::UnknownEnumValue::Integer(value),
35186 )),
35187 }
35188 }
35189}
35190
35191impl std::convert::From<&str> for SqlFileType {
35192 fn from(value: &str) -> Self {
35193 use std::string::ToString;
35194 match value {
35195 "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
35196 "SQL" => Self::Sql,
35197 "CSV" => Self::Csv,
35198 "BAK" => Self::Bak,
35199 "TDE" => Self::Tde,
35200 _ => Self::UnknownValue(sql_file_type::UnknownValue(
35201 wkt::internal::UnknownEnumValue::String(value.to_string()),
35202 )),
35203 }
35204 }
35205}
35206
35207impl serde::ser::Serialize for SqlFileType {
35208 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35209 where
35210 S: serde::Serializer,
35211 {
35212 match self {
35213 Self::Unspecified => serializer.serialize_i32(0),
35214 Self::Sql => serializer.serialize_i32(1),
35215 Self::Csv => serializer.serialize_i32(2),
35216 Self::Bak => serializer.serialize_i32(4),
35217 Self::Tde => serializer.serialize_i32(8),
35218 Self::UnknownValue(u) => u.0.serialize(serializer),
35219 }
35220 }
35221}
35222
35223impl<'de> serde::de::Deserialize<'de> for SqlFileType {
35224 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35225 where
35226 D: serde::Deserializer<'de>,
35227 {
35228 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
35229 ".google.cloud.sql.v1.SqlFileType",
35230 ))
35231 }
35232}
35233
35234/// Enum for [BakType].
35235///
35236/// # Working with unknown values
35237///
35238/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35239/// additional enum variants at any time. Adding new variants is not considered
35240/// a breaking change. Applications should write their code in anticipation of:
35241///
35242/// - New values appearing in future releases of the client library, **and**
35243/// - New values received dynamically, without application changes.
35244///
35245/// Please consult the [Working with enums] section in the user guide for some
35246/// guidelines.
35247///
35248/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35249#[derive(Clone, Debug, PartialEq)]
35250#[non_exhaustive]
35251pub enum BakType {
35252 /// Default type.
35253 Unspecified,
35254 /// Full backup.
35255 Full,
35256 /// Differential backup.
35257 Diff,
35258 /// Transaction Log backup
35259 Tlog,
35260 /// If set, the enum was initialized with an unknown value.
35261 ///
35262 /// Applications can examine the value using [BakType::value] or
35263 /// [BakType::name].
35264 UnknownValue(bak_type::UnknownValue),
35265}
35266
35267#[doc(hidden)]
35268pub mod bak_type {
35269 #[allow(unused_imports)]
35270 use super::*;
35271 #[derive(Clone, Debug, PartialEq)]
35272 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35273}
35274
35275impl BakType {
35276 /// Gets the enum value.
35277 ///
35278 /// Returns `None` if the enum contains an unknown value deserialized from
35279 /// the string representation of enums.
35280 pub fn value(&self) -> std::option::Option<i32> {
35281 match self {
35282 Self::Unspecified => std::option::Option::Some(0),
35283 Self::Full => std::option::Option::Some(1),
35284 Self::Diff => std::option::Option::Some(2),
35285 Self::Tlog => std::option::Option::Some(3),
35286 Self::UnknownValue(u) => u.0.value(),
35287 }
35288 }
35289
35290 /// Gets the enum value as a string.
35291 ///
35292 /// Returns `None` if the enum contains an unknown value deserialized from
35293 /// the integer representation of enums.
35294 pub fn name(&self) -> std::option::Option<&str> {
35295 match self {
35296 Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
35297 Self::Full => std::option::Option::Some("FULL"),
35298 Self::Diff => std::option::Option::Some("DIFF"),
35299 Self::Tlog => std::option::Option::Some("TLOG"),
35300 Self::UnknownValue(u) => u.0.name(),
35301 }
35302 }
35303}
35304
35305impl std::default::Default for BakType {
35306 fn default() -> Self {
35307 use std::convert::From;
35308 Self::from(0)
35309 }
35310}
35311
35312impl std::fmt::Display for BakType {
35313 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35314 wkt::internal::display_enum(f, self.name(), self.value())
35315 }
35316}
35317
35318impl std::convert::From<i32> for BakType {
35319 fn from(value: i32) -> Self {
35320 match value {
35321 0 => Self::Unspecified,
35322 1 => Self::Full,
35323 2 => Self::Diff,
35324 3 => Self::Tlog,
35325 _ => Self::UnknownValue(bak_type::UnknownValue(
35326 wkt::internal::UnknownEnumValue::Integer(value),
35327 )),
35328 }
35329 }
35330}
35331
35332impl std::convert::From<&str> for BakType {
35333 fn from(value: &str) -> Self {
35334 use std::string::ToString;
35335 match value {
35336 "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
35337 "FULL" => Self::Full,
35338 "DIFF" => Self::Diff,
35339 "TLOG" => Self::Tlog,
35340 _ => Self::UnknownValue(bak_type::UnknownValue(
35341 wkt::internal::UnknownEnumValue::String(value.to_string()),
35342 )),
35343 }
35344 }
35345}
35346
35347impl serde::ser::Serialize for BakType {
35348 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35349 where
35350 S: serde::Serializer,
35351 {
35352 match self {
35353 Self::Unspecified => serializer.serialize_i32(0),
35354 Self::Full => serializer.serialize_i32(1),
35355 Self::Diff => serializer.serialize_i32(2),
35356 Self::Tlog => serializer.serialize_i32(3),
35357 Self::UnknownValue(u) => u.0.serialize(serializer),
35358 }
35359 }
35360}
35361
35362impl<'de> serde::de::Deserialize<'de> for BakType {
35363 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35364 where
35365 D: serde::Deserializer<'de>,
35366 {
35367 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
35368 ".google.cloud.sql.v1.BakType",
35369 ))
35370 }
35371}
35372
35373/// The type of maintenance to be performed on the instance.
35374///
35375/// # Working with unknown values
35376///
35377/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35378/// additional enum variants at any time. Adding new variants is not considered
35379/// a breaking change. Applications should write their code in anticipation of:
35380///
35381/// - New values appearing in future releases of the client library, **and**
35382/// - New values received dynamically, without application changes.
35383///
35384/// Please consult the [Working with enums] section in the user guide for some
35385/// guidelines.
35386///
35387/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35388#[derive(Clone, Debug, PartialEq)]
35389#[non_exhaustive]
35390pub enum SqlMaintenanceType {
35391 /// Maintenance type is unspecified.
35392 Unspecified,
35393 /// Indicates that a standalone instance is undergoing maintenance. The
35394 /// instance can be either a primary instance or a replica.
35395 InstanceMaintenance,
35396 /// Indicates that the primary instance and all of its replicas, including
35397 /// cascading replicas, are undergoing maintenance. Maintenance is performed on
35398 /// groups of replicas first, followed by the primary instance.
35399 ReplicaIncludedMaintenance,
35400 /// Indicates that the standalone instance is undergoing maintenance, initiated
35401 /// by self-service. The instance can be either a primary instance or a
35402 /// replica.
35403 InstanceSelfServiceMaintenance,
35404 /// Indicates that the primary instance and all of its replicas are undergoing
35405 /// maintenance, initiated by self-service. Maintenance is performed on groups
35406 /// of replicas first, followed by the primary instance.
35407 ReplicaIncludedSelfServiceMaintenance,
35408 /// If set, the enum was initialized with an unknown value.
35409 ///
35410 /// Applications can examine the value using [SqlMaintenanceType::value] or
35411 /// [SqlMaintenanceType::name].
35412 UnknownValue(sql_maintenance_type::UnknownValue),
35413}
35414
35415#[doc(hidden)]
35416pub mod sql_maintenance_type {
35417 #[allow(unused_imports)]
35418 use super::*;
35419 #[derive(Clone, Debug, PartialEq)]
35420 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35421}
35422
35423impl SqlMaintenanceType {
35424 /// Gets the enum value.
35425 ///
35426 /// Returns `None` if the enum contains an unknown value deserialized from
35427 /// the string representation of enums.
35428 pub fn value(&self) -> std::option::Option<i32> {
35429 match self {
35430 Self::Unspecified => std::option::Option::Some(0),
35431 Self::InstanceMaintenance => std::option::Option::Some(1),
35432 Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
35433 Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
35434 Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
35435 Self::UnknownValue(u) => u.0.value(),
35436 }
35437 }
35438
35439 /// Gets the enum value as a string.
35440 ///
35441 /// Returns `None` if the enum contains an unknown value deserialized from
35442 /// the integer representation of enums.
35443 pub fn name(&self) -> std::option::Option<&str> {
35444 match self {
35445 Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
35446 Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
35447 Self::ReplicaIncludedMaintenance => {
35448 std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
35449 }
35450 Self::InstanceSelfServiceMaintenance => {
35451 std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
35452 }
35453 Self::ReplicaIncludedSelfServiceMaintenance => {
35454 std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
35455 }
35456 Self::UnknownValue(u) => u.0.name(),
35457 }
35458 }
35459}
35460
35461impl std::default::Default for SqlMaintenanceType {
35462 fn default() -> Self {
35463 use std::convert::From;
35464 Self::from(0)
35465 }
35466}
35467
35468impl std::fmt::Display for SqlMaintenanceType {
35469 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35470 wkt::internal::display_enum(f, self.name(), self.value())
35471 }
35472}
35473
35474impl std::convert::From<i32> for SqlMaintenanceType {
35475 fn from(value: i32) -> Self {
35476 match value {
35477 0 => Self::Unspecified,
35478 1 => Self::InstanceMaintenance,
35479 2 => Self::ReplicaIncludedMaintenance,
35480 3 => Self::InstanceSelfServiceMaintenance,
35481 4 => Self::ReplicaIncludedSelfServiceMaintenance,
35482 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
35483 wkt::internal::UnknownEnumValue::Integer(value),
35484 )),
35485 }
35486 }
35487}
35488
35489impl std::convert::From<&str> for SqlMaintenanceType {
35490 fn from(value: &str) -> Self {
35491 use std::string::ToString;
35492 match value {
35493 "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
35494 "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
35495 "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
35496 "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
35497 "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
35498 Self::ReplicaIncludedSelfServiceMaintenance
35499 }
35500 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
35501 wkt::internal::UnknownEnumValue::String(value.to_string()),
35502 )),
35503 }
35504 }
35505}
35506
35507impl serde::ser::Serialize for SqlMaintenanceType {
35508 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35509 where
35510 S: serde::Serializer,
35511 {
35512 match self {
35513 Self::Unspecified => serializer.serialize_i32(0),
35514 Self::InstanceMaintenance => serializer.serialize_i32(1),
35515 Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
35516 Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
35517 Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
35518 Self::UnknownValue(u) => u.0.serialize(serializer),
35519 }
35520 }
35521}
35522
35523impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
35524 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35525 where
35526 D: serde::Deserializer<'de>,
35527 {
35528 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
35529 ".google.cloud.sql.v1.SqlMaintenanceType",
35530 ))
35531 }
35532}
35533
35534/// Enum for [SqlBackendType].
35535///
35536/// # Working with unknown values
35537///
35538/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35539/// additional enum variants at any time. Adding new variants is not considered
35540/// a breaking change. Applications should write their code in anticipation of:
35541///
35542/// - New values appearing in future releases of the client library, **and**
35543/// - New values received dynamically, without application changes.
35544///
35545/// Please consult the [Working with enums] section in the user guide for some
35546/// guidelines.
35547///
35548/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35549#[derive(Clone, Debug, PartialEq)]
35550#[non_exhaustive]
35551pub enum SqlBackendType {
35552 /// This is an unknown backend type for instance.
35553 Unspecified,
35554 /// V1 speckle instance.
35555 #[deprecated]
35556 FirstGen,
35557 /// V2 speckle instance.
35558 SecondGen,
35559 /// On premises instance.
35560 External,
35561 /// If set, the enum was initialized with an unknown value.
35562 ///
35563 /// Applications can examine the value using [SqlBackendType::value] or
35564 /// [SqlBackendType::name].
35565 UnknownValue(sql_backend_type::UnknownValue),
35566}
35567
35568#[doc(hidden)]
35569pub mod sql_backend_type {
35570 #[allow(unused_imports)]
35571 use super::*;
35572 #[derive(Clone, Debug, PartialEq)]
35573 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35574}
35575
35576impl SqlBackendType {
35577 /// Gets the enum value.
35578 ///
35579 /// Returns `None` if the enum contains an unknown value deserialized from
35580 /// the string representation of enums.
35581 pub fn value(&self) -> std::option::Option<i32> {
35582 match self {
35583 Self::Unspecified => std::option::Option::Some(0),
35584 Self::FirstGen => std::option::Option::Some(1),
35585 Self::SecondGen => std::option::Option::Some(2),
35586 Self::External => std::option::Option::Some(3),
35587 Self::UnknownValue(u) => u.0.value(),
35588 }
35589 }
35590
35591 /// Gets the enum value as a string.
35592 ///
35593 /// Returns `None` if the enum contains an unknown value deserialized from
35594 /// the integer representation of enums.
35595 pub fn name(&self) -> std::option::Option<&str> {
35596 match self {
35597 Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
35598 Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
35599 Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
35600 Self::External => std::option::Option::Some("EXTERNAL"),
35601 Self::UnknownValue(u) => u.0.name(),
35602 }
35603 }
35604}
35605
35606impl std::default::Default for SqlBackendType {
35607 fn default() -> Self {
35608 use std::convert::From;
35609 Self::from(0)
35610 }
35611}
35612
35613impl std::fmt::Display for SqlBackendType {
35614 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35615 wkt::internal::display_enum(f, self.name(), self.value())
35616 }
35617}
35618
35619impl std::convert::From<i32> for SqlBackendType {
35620 fn from(value: i32) -> Self {
35621 match value {
35622 0 => Self::Unspecified,
35623 1 => Self::FirstGen,
35624 2 => Self::SecondGen,
35625 3 => Self::External,
35626 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
35627 wkt::internal::UnknownEnumValue::Integer(value),
35628 )),
35629 }
35630 }
35631}
35632
35633impl std::convert::From<&str> for SqlBackendType {
35634 fn from(value: &str) -> Self {
35635 use std::string::ToString;
35636 match value {
35637 "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
35638 "FIRST_GEN" => Self::FirstGen,
35639 "SECOND_GEN" => Self::SecondGen,
35640 "EXTERNAL" => Self::External,
35641 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
35642 wkt::internal::UnknownEnumValue::String(value.to_string()),
35643 )),
35644 }
35645 }
35646}
35647
35648impl serde::ser::Serialize for SqlBackendType {
35649 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35650 where
35651 S: serde::Serializer,
35652 {
35653 match self {
35654 Self::Unspecified => serializer.serialize_i32(0),
35655 Self::FirstGen => serializer.serialize_i32(1),
35656 Self::SecondGen => serializer.serialize_i32(2),
35657 Self::External => serializer.serialize_i32(3),
35658 Self::UnknownValue(u) => u.0.serialize(serializer),
35659 }
35660 }
35661}
35662
35663impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
35664 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35665 where
35666 D: serde::Deserializer<'de>,
35667 {
35668 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
35669 ".google.cloud.sql.v1.SqlBackendType",
35670 ))
35671 }
35672}
35673
35674/// Enum for [SqlIpAddressType].
35675///
35676/// # Working with unknown values
35677///
35678/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35679/// additional enum variants at any time. Adding new variants is not considered
35680/// a breaking change. Applications should write their code in anticipation of:
35681///
35682/// - New values appearing in future releases of the client library, **and**
35683/// - New values received dynamically, without application changes.
35684///
35685/// Please consult the [Working with enums] section in the user guide for some
35686/// guidelines.
35687///
35688/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35689#[derive(Clone, Debug, PartialEq)]
35690#[non_exhaustive]
35691pub enum SqlIpAddressType {
35692 /// This is an unknown IP address type.
35693 Unspecified,
35694 /// IP address the customer is supposed to connect to. Usually this is the
35695 /// load balancer's IP address
35696 Primary,
35697 /// Source IP address of the connection a read replica establishes to its
35698 /// external primary instance. This IP address can be allowlisted by the
35699 /// customer in case it has a firewall that filters incoming connection to its
35700 /// on premises primary instance.
35701 Outgoing,
35702 /// Private IP used when using private IPs and network peering.
35703 Private,
35704 /// V1 IP of a migrated instance. We want the user to
35705 /// decommission this IP as soon as the migration is complete.
35706 /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
35707 Migrated1StGen,
35708 /// If set, the enum was initialized with an unknown value.
35709 ///
35710 /// Applications can examine the value using [SqlIpAddressType::value] or
35711 /// [SqlIpAddressType::name].
35712 UnknownValue(sql_ip_address_type::UnknownValue),
35713}
35714
35715#[doc(hidden)]
35716pub mod sql_ip_address_type {
35717 #[allow(unused_imports)]
35718 use super::*;
35719 #[derive(Clone, Debug, PartialEq)]
35720 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35721}
35722
35723impl SqlIpAddressType {
35724 /// Gets the enum value.
35725 ///
35726 /// Returns `None` if the enum contains an unknown value deserialized from
35727 /// the string representation of enums.
35728 pub fn value(&self) -> std::option::Option<i32> {
35729 match self {
35730 Self::Unspecified => std::option::Option::Some(0),
35731 Self::Primary => std::option::Option::Some(1),
35732 Self::Outgoing => std::option::Option::Some(2),
35733 Self::Private => std::option::Option::Some(3),
35734 Self::Migrated1StGen => std::option::Option::Some(4),
35735 Self::UnknownValue(u) => u.0.value(),
35736 }
35737 }
35738
35739 /// Gets the enum value as a string.
35740 ///
35741 /// Returns `None` if the enum contains an unknown value deserialized from
35742 /// the integer representation of enums.
35743 pub fn name(&self) -> std::option::Option<&str> {
35744 match self {
35745 Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
35746 Self::Primary => std::option::Option::Some("PRIMARY"),
35747 Self::Outgoing => std::option::Option::Some("OUTGOING"),
35748 Self::Private => std::option::Option::Some("PRIVATE"),
35749 Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
35750 Self::UnknownValue(u) => u.0.name(),
35751 }
35752 }
35753}
35754
35755impl std::default::Default for SqlIpAddressType {
35756 fn default() -> Self {
35757 use std::convert::From;
35758 Self::from(0)
35759 }
35760}
35761
35762impl std::fmt::Display for SqlIpAddressType {
35763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35764 wkt::internal::display_enum(f, self.name(), self.value())
35765 }
35766}
35767
35768impl std::convert::From<i32> for SqlIpAddressType {
35769 fn from(value: i32) -> Self {
35770 match value {
35771 0 => Self::Unspecified,
35772 1 => Self::Primary,
35773 2 => Self::Outgoing,
35774 3 => Self::Private,
35775 4 => Self::Migrated1StGen,
35776 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
35777 wkt::internal::UnknownEnumValue::Integer(value),
35778 )),
35779 }
35780 }
35781}
35782
35783impl std::convert::From<&str> for SqlIpAddressType {
35784 fn from(value: &str) -> Self {
35785 use std::string::ToString;
35786 match value {
35787 "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
35788 "PRIMARY" => Self::Primary,
35789 "OUTGOING" => Self::Outgoing,
35790 "PRIVATE" => Self::Private,
35791 "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
35792 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
35793 wkt::internal::UnknownEnumValue::String(value.to_string()),
35794 )),
35795 }
35796 }
35797}
35798
35799impl serde::ser::Serialize for SqlIpAddressType {
35800 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35801 where
35802 S: serde::Serializer,
35803 {
35804 match self {
35805 Self::Unspecified => serializer.serialize_i32(0),
35806 Self::Primary => serializer.serialize_i32(1),
35807 Self::Outgoing => serializer.serialize_i32(2),
35808 Self::Private => serializer.serialize_i32(3),
35809 Self::Migrated1StGen => serializer.serialize_i32(4),
35810 Self::UnknownValue(u) => u.0.serialize(serializer),
35811 }
35812 }
35813}
35814
35815impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
35816 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35817 where
35818 D: serde::Deserializer<'de>,
35819 {
35820 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
35821 ".google.cloud.sql.v1.SqlIpAddressType",
35822 ))
35823 }
35824}
35825
35826/// The database engine type and version.
35827///
35828/// # Working with unknown values
35829///
35830/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35831/// additional enum variants at any time. Adding new variants is not considered
35832/// a breaking change. Applications should write their code in anticipation of:
35833///
35834/// - New values appearing in future releases of the client library, **and**
35835/// - New values received dynamically, without application changes.
35836///
35837/// Please consult the [Working with enums] section in the user guide for some
35838/// guidelines.
35839///
35840/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35841#[derive(Clone, Debug, PartialEq)]
35842#[non_exhaustive]
35843pub enum SqlDatabaseVersion {
35844 /// This is an unknown database version.
35845 Unspecified,
35846 /// The database version is MySQL 5.1.
35847 #[deprecated]
35848 Mysql51,
35849 /// The database version is MySQL 5.5.
35850 #[deprecated]
35851 Mysql55,
35852 /// The database version is MySQL 5.6.
35853 Mysql56,
35854 /// The database version is MySQL 5.7.
35855 Mysql57,
35856 /// The database version is MySQL 8.
35857 Mysql80,
35858 /// The database major version is MySQL 8.0 and the minor version is 18.
35859 Mysql8018,
35860 /// The database major version is MySQL 8.0 and the minor version is 26.
35861 Mysql8026,
35862 /// The database major version is MySQL 8.0 and the minor version is 27.
35863 Mysql8027,
35864 /// The database major version is MySQL 8.0 and the minor version is 28.
35865 Mysql8028,
35866 /// The database major version is MySQL 8.0 and the minor version is 29.
35867 #[deprecated]
35868 Mysql8029,
35869 /// The database major version is MySQL 8.0 and the minor version is 30.
35870 Mysql8030,
35871 /// The database major version is MySQL 8.0 and the minor version is 31.
35872 Mysql8031,
35873 /// The database major version is MySQL 8.0 and the minor version is 32.
35874 Mysql8032,
35875 /// The database major version is MySQL 8.0 and the minor version is 33.
35876 Mysql8033,
35877 /// The database major version is MySQL 8.0 and the minor version is 34.
35878 Mysql8034,
35879 /// The database major version is MySQL 8.0 and the minor version is 35.
35880 Mysql8035,
35881 /// The database major version is MySQL 8.0 and the minor version is 36.
35882 Mysql8036,
35883 /// The database major version is MySQL 8.0 and the minor version is 37.
35884 Mysql8037,
35885 /// The database major version is MySQL 8.0 and the minor version is 39.
35886 Mysql8039,
35887 /// The database major version is MySQL 8.0 and the minor version is 40.
35888 Mysql8040,
35889 /// The database major version is MySQL 8.0 and the minor version is 41.
35890 Mysql8041,
35891 /// The database major version is MySQL 8.0 and the minor version is 42.
35892 Mysql8042,
35893 /// The database major version is MySQL 8.0 and the minor version is 43.
35894 Mysql8043,
35895 /// The database major version is MySQL 8.0 and the minor version is 44.
35896 Mysql8044,
35897 /// The database major version is MySQL 8.0 and the minor version is 45.
35898 Mysql8045,
35899 /// The database major version is MySQL 8.0 and the minor version is 46.
35900 Mysql8046,
35901 /// The database version is MySQL 8.4.
35902 Mysql84,
35903 /// The database version is MySQL 9.7.
35904 Mysql97,
35905 /// The database version is SQL Server 2017 Standard.
35906 Sqlserver2017Standard,
35907 /// The database version is SQL Server 2017 Enterprise.
35908 Sqlserver2017Enterprise,
35909 /// The database version is SQL Server 2017 Express.
35910 Sqlserver2017Express,
35911 /// The database version is SQL Server 2017 Web.
35912 Sqlserver2017Web,
35913 /// The database version is PostgreSQL 9.6.
35914 Postgres96,
35915 /// The database version is PostgreSQL 10.
35916 Postgres10,
35917 /// The database version is PostgreSQL 11.
35918 Postgres11,
35919 /// The database version is PostgreSQL 12.
35920 Postgres12,
35921 /// The database version is PostgreSQL 13.
35922 Postgres13,
35923 /// The database version is PostgreSQL 14.
35924 Postgres14,
35925 /// The database version is PostgreSQL 15.
35926 Postgres15,
35927 /// The database version is PostgreSQL 16.
35928 Postgres16,
35929 /// The database version is PostgreSQL 17.
35930 Postgres17,
35931 /// The database version is PostgreSQL 18.
35932 Postgres18,
35933 /// The database version is PostgreSQL 19.
35934 Postgres19,
35935 /// The database version is PostgreSQL 20.
35936 Postgres20,
35937 /// The database version is SQL Server 2019 Standard.
35938 Sqlserver2019Standard,
35939 /// The database version is SQL Server 2019 Enterprise.
35940 Sqlserver2019Enterprise,
35941 /// The database version is SQL Server 2019 Express.
35942 Sqlserver2019Express,
35943 /// The database version is SQL Server 2019 Web.
35944 Sqlserver2019Web,
35945 /// The database version is SQL Server 2022 Standard.
35946 Sqlserver2022Standard,
35947 /// The database version is SQL Server 2022 Enterprise.
35948 Sqlserver2022Enterprise,
35949 /// The database version is SQL Server 2022 Express.
35950 Sqlserver2022Express,
35951 /// The database version is SQL Server 2022 Web.
35952 Sqlserver2022Web,
35953 /// The database version is SQL Server 2025 Standard.
35954 Sqlserver2025Standard,
35955 /// The database version is SQL Server 2025 Enterprise.
35956 Sqlserver2025Enterprise,
35957 /// The database version is SQL Server 2025 Express.
35958 Sqlserver2025Express,
35959 /// If set, the enum was initialized with an unknown value.
35960 ///
35961 /// Applications can examine the value using [SqlDatabaseVersion::value] or
35962 /// [SqlDatabaseVersion::name].
35963 UnknownValue(sql_database_version::UnknownValue),
35964}
35965
35966#[doc(hidden)]
35967pub mod sql_database_version {
35968 #[allow(unused_imports)]
35969 use super::*;
35970 #[derive(Clone, Debug, PartialEq)]
35971 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35972}
35973
35974impl SqlDatabaseVersion {
35975 /// Gets the enum value.
35976 ///
35977 /// Returns `None` if the enum contains an unknown value deserialized from
35978 /// the string representation of enums.
35979 pub fn value(&self) -> std::option::Option<i32> {
35980 match self {
35981 Self::Unspecified => std::option::Option::Some(0),
35982 Self::Mysql51 => std::option::Option::Some(2),
35983 Self::Mysql55 => std::option::Option::Some(3),
35984 Self::Mysql56 => std::option::Option::Some(5),
35985 Self::Mysql57 => std::option::Option::Some(6),
35986 Self::Mysql80 => std::option::Option::Some(20),
35987 Self::Mysql8018 => std::option::Option::Some(41),
35988 Self::Mysql8026 => std::option::Option::Some(85),
35989 Self::Mysql8027 => std::option::Option::Some(111),
35990 Self::Mysql8028 => std::option::Option::Some(132),
35991 Self::Mysql8029 => std::option::Option::Some(148),
35992 Self::Mysql8030 => std::option::Option::Some(174),
35993 Self::Mysql8031 => std::option::Option::Some(197),
35994 Self::Mysql8032 => std::option::Option::Some(213),
35995 Self::Mysql8033 => std::option::Option::Some(238),
35996 Self::Mysql8034 => std::option::Option::Some(239),
35997 Self::Mysql8035 => std::option::Option::Some(240),
35998 Self::Mysql8036 => std::option::Option::Some(241),
35999 Self::Mysql8037 => std::option::Option::Some(355),
36000 Self::Mysql8039 => std::option::Option::Some(357),
36001 Self::Mysql8040 => std::option::Option::Some(358),
36002 Self::Mysql8041 => std::option::Option::Some(488),
36003 Self::Mysql8042 => std::option::Option::Some(489),
36004 Self::Mysql8043 => std::option::Option::Some(553),
36005 Self::Mysql8044 => std::option::Option::Some(554),
36006 Self::Mysql8045 => std::option::Option::Some(555),
36007 Self::Mysql8046 => std::option::Option::Some(556),
36008 Self::Mysql84 => std::option::Option::Some(398),
36009 Self::Mysql97 => std::option::Option::Some(654),
36010 Self::Sqlserver2017Standard => std::option::Option::Some(11),
36011 Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
36012 Self::Sqlserver2017Express => std::option::Option::Some(15),
36013 Self::Sqlserver2017Web => std::option::Option::Some(16),
36014 Self::Postgres96 => std::option::Option::Some(9),
36015 Self::Postgres10 => std::option::Option::Some(18),
36016 Self::Postgres11 => std::option::Option::Some(10),
36017 Self::Postgres12 => std::option::Option::Some(19),
36018 Self::Postgres13 => std::option::Option::Some(23),
36019 Self::Postgres14 => std::option::Option::Some(110),
36020 Self::Postgres15 => std::option::Option::Some(172),
36021 Self::Postgres16 => std::option::Option::Some(272),
36022 Self::Postgres17 => std::option::Option::Some(408),
36023 Self::Postgres18 => std::option::Option::Some(557),
36024 Self::Postgres19 => std::option::Option::Some(684),
36025 Self::Postgres20 => std::option::Option::Some(781),
36026 Self::Sqlserver2019Standard => std::option::Option::Some(26),
36027 Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
36028 Self::Sqlserver2019Express => std::option::Option::Some(28),
36029 Self::Sqlserver2019Web => std::option::Option::Some(29),
36030 Self::Sqlserver2022Standard => std::option::Option::Some(199),
36031 Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
36032 Self::Sqlserver2022Express => std::option::Option::Some(201),
36033 Self::Sqlserver2022Web => std::option::Option::Some(202),
36034 Self::Sqlserver2025Standard => std::option::Option::Some(549),
36035 Self::Sqlserver2025Enterprise => std::option::Option::Some(550),
36036 Self::Sqlserver2025Express => std::option::Option::Some(551),
36037 Self::UnknownValue(u) => u.0.value(),
36038 }
36039 }
36040
36041 /// Gets the enum value as a string.
36042 ///
36043 /// Returns `None` if the enum contains an unknown value deserialized from
36044 /// the integer representation of enums.
36045 pub fn name(&self) -> std::option::Option<&str> {
36046 match self {
36047 Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
36048 Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
36049 Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
36050 Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
36051 Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
36052 Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
36053 Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
36054 Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
36055 Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
36056 Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
36057 Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
36058 Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
36059 Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
36060 Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
36061 Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
36062 Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
36063 Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
36064 Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
36065 Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
36066 Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
36067 Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
36068 Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
36069 Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
36070 Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
36071 Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
36072 Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
36073 Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
36074 Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
36075 Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
36076 Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
36077 Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
36078 Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
36079 Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
36080 Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
36081 Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
36082 Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
36083 Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
36084 Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
36085 Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
36086 Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
36087 Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
36088 Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
36089 Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
36090 Self::Postgres19 => std::option::Option::Some("POSTGRES_19"),
36091 Self::Postgres20 => std::option::Option::Some("POSTGRES_20"),
36092 Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
36093 Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
36094 Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
36095 Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
36096 Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
36097 Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
36098 Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
36099 Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
36100 Self::Sqlserver2025Standard => std::option::Option::Some("SQLSERVER_2025_STANDARD"),
36101 Self::Sqlserver2025Enterprise => std::option::Option::Some("SQLSERVER_2025_ENTERPRISE"),
36102 Self::Sqlserver2025Express => std::option::Option::Some("SQLSERVER_2025_EXPRESS"),
36103 Self::UnknownValue(u) => u.0.name(),
36104 }
36105 }
36106}
36107
36108impl std::default::Default for SqlDatabaseVersion {
36109 fn default() -> Self {
36110 use std::convert::From;
36111 Self::from(0)
36112 }
36113}
36114
36115impl std::fmt::Display for SqlDatabaseVersion {
36116 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36117 wkt::internal::display_enum(f, self.name(), self.value())
36118 }
36119}
36120
36121impl std::convert::From<i32> for SqlDatabaseVersion {
36122 fn from(value: i32) -> Self {
36123 match value {
36124 0 => Self::Unspecified,
36125 2 => Self::Mysql51,
36126 3 => Self::Mysql55,
36127 5 => Self::Mysql56,
36128 6 => Self::Mysql57,
36129 9 => Self::Postgres96,
36130 10 => Self::Postgres11,
36131 11 => Self::Sqlserver2017Standard,
36132 14 => Self::Sqlserver2017Enterprise,
36133 15 => Self::Sqlserver2017Express,
36134 16 => Self::Sqlserver2017Web,
36135 18 => Self::Postgres10,
36136 19 => Self::Postgres12,
36137 20 => Self::Mysql80,
36138 23 => Self::Postgres13,
36139 26 => Self::Sqlserver2019Standard,
36140 27 => Self::Sqlserver2019Enterprise,
36141 28 => Self::Sqlserver2019Express,
36142 29 => Self::Sqlserver2019Web,
36143 41 => Self::Mysql8018,
36144 85 => Self::Mysql8026,
36145 110 => Self::Postgres14,
36146 111 => Self::Mysql8027,
36147 132 => Self::Mysql8028,
36148 148 => Self::Mysql8029,
36149 172 => Self::Postgres15,
36150 174 => Self::Mysql8030,
36151 197 => Self::Mysql8031,
36152 199 => Self::Sqlserver2022Standard,
36153 200 => Self::Sqlserver2022Enterprise,
36154 201 => Self::Sqlserver2022Express,
36155 202 => Self::Sqlserver2022Web,
36156 213 => Self::Mysql8032,
36157 238 => Self::Mysql8033,
36158 239 => Self::Mysql8034,
36159 240 => Self::Mysql8035,
36160 241 => Self::Mysql8036,
36161 272 => Self::Postgres16,
36162 355 => Self::Mysql8037,
36163 357 => Self::Mysql8039,
36164 358 => Self::Mysql8040,
36165 398 => Self::Mysql84,
36166 408 => Self::Postgres17,
36167 488 => Self::Mysql8041,
36168 489 => Self::Mysql8042,
36169 549 => Self::Sqlserver2025Standard,
36170 550 => Self::Sqlserver2025Enterprise,
36171 551 => Self::Sqlserver2025Express,
36172 553 => Self::Mysql8043,
36173 554 => Self::Mysql8044,
36174 555 => Self::Mysql8045,
36175 556 => Self::Mysql8046,
36176 557 => Self::Postgres18,
36177 654 => Self::Mysql97,
36178 684 => Self::Postgres19,
36179 781 => Self::Postgres20,
36180 _ => Self::UnknownValue(sql_database_version::UnknownValue(
36181 wkt::internal::UnknownEnumValue::Integer(value),
36182 )),
36183 }
36184 }
36185}
36186
36187impl std::convert::From<&str> for SqlDatabaseVersion {
36188 fn from(value: &str) -> Self {
36189 use std::string::ToString;
36190 match value {
36191 "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
36192 "MYSQL_5_1" => Self::Mysql51,
36193 "MYSQL_5_5" => Self::Mysql55,
36194 "MYSQL_5_6" => Self::Mysql56,
36195 "MYSQL_5_7" => Self::Mysql57,
36196 "MYSQL_8_0" => Self::Mysql80,
36197 "MYSQL_8_0_18" => Self::Mysql8018,
36198 "MYSQL_8_0_26" => Self::Mysql8026,
36199 "MYSQL_8_0_27" => Self::Mysql8027,
36200 "MYSQL_8_0_28" => Self::Mysql8028,
36201 "MYSQL_8_0_29" => Self::Mysql8029,
36202 "MYSQL_8_0_30" => Self::Mysql8030,
36203 "MYSQL_8_0_31" => Self::Mysql8031,
36204 "MYSQL_8_0_32" => Self::Mysql8032,
36205 "MYSQL_8_0_33" => Self::Mysql8033,
36206 "MYSQL_8_0_34" => Self::Mysql8034,
36207 "MYSQL_8_0_35" => Self::Mysql8035,
36208 "MYSQL_8_0_36" => Self::Mysql8036,
36209 "MYSQL_8_0_37" => Self::Mysql8037,
36210 "MYSQL_8_0_39" => Self::Mysql8039,
36211 "MYSQL_8_0_40" => Self::Mysql8040,
36212 "MYSQL_8_0_41" => Self::Mysql8041,
36213 "MYSQL_8_0_42" => Self::Mysql8042,
36214 "MYSQL_8_0_43" => Self::Mysql8043,
36215 "MYSQL_8_0_44" => Self::Mysql8044,
36216 "MYSQL_8_0_45" => Self::Mysql8045,
36217 "MYSQL_8_0_46" => Self::Mysql8046,
36218 "MYSQL_8_4" => Self::Mysql84,
36219 "MYSQL_9_7" => Self::Mysql97,
36220 "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
36221 "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
36222 "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
36223 "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
36224 "POSTGRES_9_6" => Self::Postgres96,
36225 "POSTGRES_10" => Self::Postgres10,
36226 "POSTGRES_11" => Self::Postgres11,
36227 "POSTGRES_12" => Self::Postgres12,
36228 "POSTGRES_13" => Self::Postgres13,
36229 "POSTGRES_14" => Self::Postgres14,
36230 "POSTGRES_15" => Self::Postgres15,
36231 "POSTGRES_16" => Self::Postgres16,
36232 "POSTGRES_17" => Self::Postgres17,
36233 "POSTGRES_18" => Self::Postgres18,
36234 "POSTGRES_19" => Self::Postgres19,
36235 "POSTGRES_20" => Self::Postgres20,
36236 "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
36237 "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
36238 "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
36239 "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
36240 "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
36241 "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
36242 "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
36243 "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
36244 "SQLSERVER_2025_STANDARD" => Self::Sqlserver2025Standard,
36245 "SQLSERVER_2025_ENTERPRISE" => Self::Sqlserver2025Enterprise,
36246 "SQLSERVER_2025_EXPRESS" => Self::Sqlserver2025Express,
36247 _ => Self::UnknownValue(sql_database_version::UnknownValue(
36248 wkt::internal::UnknownEnumValue::String(value.to_string()),
36249 )),
36250 }
36251 }
36252}
36253
36254impl serde::ser::Serialize for SqlDatabaseVersion {
36255 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36256 where
36257 S: serde::Serializer,
36258 {
36259 match self {
36260 Self::Unspecified => serializer.serialize_i32(0),
36261 Self::Mysql51 => serializer.serialize_i32(2),
36262 Self::Mysql55 => serializer.serialize_i32(3),
36263 Self::Mysql56 => serializer.serialize_i32(5),
36264 Self::Mysql57 => serializer.serialize_i32(6),
36265 Self::Mysql80 => serializer.serialize_i32(20),
36266 Self::Mysql8018 => serializer.serialize_i32(41),
36267 Self::Mysql8026 => serializer.serialize_i32(85),
36268 Self::Mysql8027 => serializer.serialize_i32(111),
36269 Self::Mysql8028 => serializer.serialize_i32(132),
36270 Self::Mysql8029 => serializer.serialize_i32(148),
36271 Self::Mysql8030 => serializer.serialize_i32(174),
36272 Self::Mysql8031 => serializer.serialize_i32(197),
36273 Self::Mysql8032 => serializer.serialize_i32(213),
36274 Self::Mysql8033 => serializer.serialize_i32(238),
36275 Self::Mysql8034 => serializer.serialize_i32(239),
36276 Self::Mysql8035 => serializer.serialize_i32(240),
36277 Self::Mysql8036 => serializer.serialize_i32(241),
36278 Self::Mysql8037 => serializer.serialize_i32(355),
36279 Self::Mysql8039 => serializer.serialize_i32(357),
36280 Self::Mysql8040 => serializer.serialize_i32(358),
36281 Self::Mysql8041 => serializer.serialize_i32(488),
36282 Self::Mysql8042 => serializer.serialize_i32(489),
36283 Self::Mysql8043 => serializer.serialize_i32(553),
36284 Self::Mysql8044 => serializer.serialize_i32(554),
36285 Self::Mysql8045 => serializer.serialize_i32(555),
36286 Self::Mysql8046 => serializer.serialize_i32(556),
36287 Self::Mysql84 => serializer.serialize_i32(398),
36288 Self::Mysql97 => serializer.serialize_i32(654),
36289 Self::Sqlserver2017Standard => serializer.serialize_i32(11),
36290 Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
36291 Self::Sqlserver2017Express => serializer.serialize_i32(15),
36292 Self::Sqlserver2017Web => serializer.serialize_i32(16),
36293 Self::Postgres96 => serializer.serialize_i32(9),
36294 Self::Postgres10 => serializer.serialize_i32(18),
36295 Self::Postgres11 => serializer.serialize_i32(10),
36296 Self::Postgres12 => serializer.serialize_i32(19),
36297 Self::Postgres13 => serializer.serialize_i32(23),
36298 Self::Postgres14 => serializer.serialize_i32(110),
36299 Self::Postgres15 => serializer.serialize_i32(172),
36300 Self::Postgres16 => serializer.serialize_i32(272),
36301 Self::Postgres17 => serializer.serialize_i32(408),
36302 Self::Postgres18 => serializer.serialize_i32(557),
36303 Self::Postgres19 => serializer.serialize_i32(684),
36304 Self::Postgres20 => serializer.serialize_i32(781),
36305 Self::Sqlserver2019Standard => serializer.serialize_i32(26),
36306 Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
36307 Self::Sqlserver2019Express => serializer.serialize_i32(28),
36308 Self::Sqlserver2019Web => serializer.serialize_i32(29),
36309 Self::Sqlserver2022Standard => serializer.serialize_i32(199),
36310 Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
36311 Self::Sqlserver2022Express => serializer.serialize_i32(201),
36312 Self::Sqlserver2022Web => serializer.serialize_i32(202),
36313 Self::Sqlserver2025Standard => serializer.serialize_i32(549),
36314 Self::Sqlserver2025Enterprise => serializer.serialize_i32(550),
36315 Self::Sqlserver2025Express => serializer.serialize_i32(551),
36316 Self::UnknownValue(u) => u.0.serialize(serializer),
36317 }
36318 }
36319}
36320
36321impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
36322 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36323 where
36324 D: serde::Deserializer<'de>,
36325 {
36326 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
36327 ".google.cloud.sql.v1.SqlDatabaseVersion",
36328 ))
36329 }
36330}
36331
36332/// The pricing plan for this instance.
36333///
36334/// # Working with unknown values
36335///
36336/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36337/// additional enum variants at any time. Adding new variants is not considered
36338/// a breaking change. Applications should write their code in anticipation of:
36339///
36340/// - New values appearing in future releases of the client library, **and**
36341/// - New values received dynamically, without application changes.
36342///
36343/// Please consult the [Working with enums] section in the user guide for some
36344/// guidelines.
36345///
36346/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36347#[derive(Clone, Debug, PartialEq)]
36348#[non_exhaustive]
36349pub enum SqlPricingPlan {
36350 /// This is an unknown pricing plan for this instance.
36351 Unspecified,
36352 /// The instance is billed at a monthly flat rate.
36353 Package,
36354 /// The instance is billed per usage.
36355 PerUse,
36356 /// If set, the enum was initialized with an unknown value.
36357 ///
36358 /// Applications can examine the value using [SqlPricingPlan::value] or
36359 /// [SqlPricingPlan::name].
36360 UnknownValue(sql_pricing_plan::UnknownValue),
36361}
36362
36363#[doc(hidden)]
36364pub mod sql_pricing_plan {
36365 #[allow(unused_imports)]
36366 use super::*;
36367 #[derive(Clone, Debug, PartialEq)]
36368 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36369}
36370
36371impl SqlPricingPlan {
36372 /// Gets the enum value.
36373 ///
36374 /// Returns `None` if the enum contains an unknown value deserialized from
36375 /// the string representation of enums.
36376 pub fn value(&self) -> std::option::Option<i32> {
36377 match self {
36378 Self::Unspecified => std::option::Option::Some(0),
36379 Self::Package => std::option::Option::Some(1),
36380 Self::PerUse => std::option::Option::Some(2),
36381 Self::UnknownValue(u) => u.0.value(),
36382 }
36383 }
36384
36385 /// Gets the enum value as a string.
36386 ///
36387 /// Returns `None` if the enum contains an unknown value deserialized from
36388 /// the integer representation of enums.
36389 pub fn name(&self) -> std::option::Option<&str> {
36390 match self {
36391 Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
36392 Self::Package => std::option::Option::Some("PACKAGE"),
36393 Self::PerUse => std::option::Option::Some("PER_USE"),
36394 Self::UnknownValue(u) => u.0.name(),
36395 }
36396 }
36397}
36398
36399impl std::default::Default for SqlPricingPlan {
36400 fn default() -> Self {
36401 use std::convert::From;
36402 Self::from(0)
36403 }
36404}
36405
36406impl std::fmt::Display for SqlPricingPlan {
36407 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36408 wkt::internal::display_enum(f, self.name(), self.value())
36409 }
36410}
36411
36412impl std::convert::From<i32> for SqlPricingPlan {
36413 fn from(value: i32) -> Self {
36414 match value {
36415 0 => Self::Unspecified,
36416 1 => Self::Package,
36417 2 => Self::PerUse,
36418 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
36419 wkt::internal::UnknownEnumValue::Integer(value),
36420 )),
36421 }
36422 }
36423}
36424
36425impl std::convert::From<&str> for SqlPricingPlan {
36426 fn from(value: &str) -> Self {
36427 use std::string::ToString;
36428 match value {
36429 "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
36430 "PACKAGE" => Self::Package,
36431 "PER_USE" => Self::PerUse,
36432 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
36433 wkt::internal::UnknownEnumValue::String(value.to_string()),
36434 )),
36435 }
36436 }
36437}
36438
36439impl serde::ser::Serialize for SqlPricingPlan {
36440 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36441 where
36442 S: serde::Serializer,
36443 {
36444 match self {
36445 Self::Unspecified => serializer.serialize_i32(0),
36446 Self::Package => serializer.serialize_i32(1),
36447 Self::PerUse => serializer.serialize_i32(2),
36448 Self::UnknownValue(u) => u.0.serialize(serializer),
36449 }
36450 }
36451}
36452
36453impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
36454 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36455 where
36456 D: serde::Deserializer<'de>,
36457 {
36458 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
36459 ".google.cloud.sql.v1.SqlPricingPlan",
36460 ))
36461 }
36462}
36463
36464/// Enum for [SqlReplicationType].
36465///
36466/// # Working with unknown values
36467///
36468/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36469/// additional enum variants at any time. Adding new variants is not considered
36470/// a breaking change. Applications should write their code in anticipation of:
36471///
36472/// - New values appearing in future releases of the client library, **and**
36473/// - New values received dynamically, without application changes.
36474///
36475/// Please consult the [Working with enums] section in the user guide for some
36476/// guidelines.
36477///
36478/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36479#[derive(Clone, Debug, PartialEq)]
36480#[non_exhaustive]
36481pub enum SqlReplicationType {
36482 /// This is an unknown replication type for a Cloud SQL instance.
36483 Unspecified,
36484 /// The synchronous replication mode for First Generation instances. It is the
36485 /// default value.
36486 Synchronous,
36487 /// The asynchronous replication mode for First Generation instances. It
36488 /// provides a slight performance gain, but if an outage occurs while this
36489 /// option is set to asynchronous, you can lose up to a few seconds of updates
36490 /// to your data.
36491 Asynchronous,
36492 /// If set, the enum was initialized with an unknown value.
36493 ///
36494 /// Applications can examine the value using [SqlReplicationType::value] or
36495 /// [SqlReplicationType::name].
36496 UnknownValue(sql_replication_type::UnknownValue),
36497}
36498
36499#[doc(hidden)]
36500pub mod sql_replication_type {
36501 #[allow(unused_imports)]
36502 use super::*;
36503 #[derive(Clone, Debug, PartialEq)]
36504 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36505}
36506
36507impl SqlReplicationType {
36508 /// Gets the enum value.
36509 ///
36510 /// Returns `None` if the enum contains an unknown value deserialized from
36511 /// the string representation of enums.
36512 pub fn value(&self) -> std::option::Option<i32> {
36513 match self {
36514 Self::Unspecified => std::option::Option::Some(0),
36515 Self::Synchronous => std::option::Option::Some(1),
36516 Self::Asynchronous => std::option::Option::Some(2),
36517 Self::UnknownValue(u) => u.0.value(),
36518 }
36519 }
36520
36521 /// Gets the enum value as a string.
36522 ///
36523 /// Returns `None` if the enum contains an unknown value deserialized from
36524 /// the integer representation of enums.
36525 pub fn name(&self) -> std::option::Option<&str> {
36526 match self {
36527 Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
36528 Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
36529 Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
36530 Self::UnknownValue(u) => u.0.name(),
36531 }
36532 }
36533}
36534
36535impl std::default::Default for SqlReplicationType {
36536 fn default() -> Self {
36537 use std::convert::From;
36538 Self::from(0)
36539 }
36540}
36541
36542impl std::fmt::Display for SqlReplicationType {
36543 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36544 wkt::internal::display_enum(f, self.name(), self.value())
36545 }
36546}
36547
36548impl std::convert::From<i32> for SqlReplicationType {
36549 fn from(value: i32) -> Self {
36550 match value {
36551 0 => Self::Unspecified,
36552 1 => Self::Synchronous,
36553 2 => Self::Asynchronous,
36554 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
36555 wkt::internal::UnknownEnumValue::Integer(value),
36556 )),
36557 }
36558 }
36559}
36560
36561impl std::convert::From<&str> for SqlReplicationType {
36562 fn from(value: &str) -> Self {
36563 use std::string::ToString;
36564 match value {
36565 "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
36566 "SYNCHRONOUS" => Self::Synchronous,
36567 "ASYNCHRONOUS" => Self::Asynchronous,
36568 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
36569 wkt::internal::UnknownEnumValue::String(value.to_string()),
36570 )),
36571 }
36572 }
36573}
36574
36575impl serde::ser::Serialize for SqlReplicationType {
36576 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36577 where
36578 S: serde::Serializer,
36579 {
36580 match self {
36581 Self::Unspecified => serializer.serialize_i32(0),
36582 Self::Synchronous => serializer.serialize_i32(1),
36583 Self::Asynchronous => serializer.serialize_i32(2),
36584 Self::UnknownValue(u) => u.0.serialize(serializer),
36585 }
36586 }
36587}
36588
36589impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
36590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36591 where
36592 D: serde::Deserializer<'de>,
36593 {
36594 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
36595 ".google.cloud.sql.v1.SqlReplicationType",
36596 ))
36597 }
36598}
36599
36600/// The type of disk that is used for a v2 instance to use.
36601///
36602/// # Working with unknown values
36603///
36604/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36605/// additional enum variants at any time. Adding new variants is not considered
36606/// a breaking change. Applications should write their code in anticipation of:
36607///
36608/// - New values appearing in future releases of the client library, **and**
36609/// - New values received dynamically, without application changes.
36610///
36611/// Please consult the [Working with enums] section in the user guide for some
36612/// guidelines.
36613///
36614/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36615#[derive(Clone, Debug, PartialEq)]
36616#[non_exhaustive]
36617pub enum SqlDataDiskType {
36618 /// This is an unknown data disk type.
36619 Unspecified,
36620 /// An SSD data disk.
36621 PdSsd,
36622 /// An HDD data disk.
36623 PdHdd,
36624 /// This field is deprecated and will be removed from a future version of the
36625 /// API.
36626 #[deprecated]
36627 ObsoleteLocalSsd,
36628 /// A Hyperdisk Balanced data disk.
36629 HyperdiskBalanced,
36630 /// If set, the enum was initialized with an unknown value.
36631 ///
36632 /// Applications can examine the value using [SqlDataDiskType::value] or
36633 /// [SqlDataDiskType::name].
36634 UnknownValue(sql_data_disk_type::UnknownValue),
36635}
36636
36637#[doc(hidden)]
36638pub mod sql_data_disk_type {
36639 #[allow(unused_imports)]
36640 use super::*;
36641 #[derive(Clone, Debug, PartialEq)]
36642 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36643}
36644
36645impl SqlDataDiskType {
36646 /// Gets the enum value.
36647 ///
36648 /// Returns `None` if the enum contains an unknown value deserialized from
36649 /// the string representation of enums.
36650 pub fn value(&self) -> std::option::Option<i32> {
36651 match self {
36652 Self::Unspecified => std::option::Option::Some(0),
36653 Self::PdSsd => std::option::Option::Some(1),
36654 Self::PdHdd => std::option::Option::Some(2),
36655 Self::ObsoleteLocalSsd => std::option::Option::Some(3),
36656 Self::HyperdiskBalanced => std::option::Option::Some(4),
36657 Self::UnknownValue(u) => u.0.value(),
36658 }
36659 }
36660
36661 /// Gets the enum value as a string.
36662 ///
36663 /// Returns `None` if the enum contains an unknown value deserialized from
36664 /// the integer representation of enums.
36665 pub fn name(&self) -> std::option::Option<&str> {
36666 match self {
36667 Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
36668 Self::PdSsd => std::option::Option::Some("PD_SSD"),
36669 Self::PdHdd => std::option::Option::Some("PD_HDD"),
36670 Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
36671 Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
36672 Self::UnknownValue(u) => u.0.name(),
36673 }
36674 }
36675}
36676
36677impl std::default::Default for SqlDataDiskType {
36678 fn default() -> Self {
36679 use std::convert::From;
36680 Self::from(0)
36681 }
36682}
36683
36684impl std::fmt::Display for SqlDataDiskType {
36685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36686 wkt::internal::display_enum(f, self.name(), self.value())
36687 }
36688}
36689
36690impl std::convert::From<i32> for SqlDataDiskType {
36691 fn from(value: i32) -> Self {
36692 match value {
36693 0 => Self::Unspecified,
36694 1 => Self::PdSsd,
36695 2 => Self::PdHdd,
36696 3 => Self::ObsoleteLocalSsd,
36697 4 => Self::HyperdiskBalanced,
36698 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
36699 wkt::internal::UnknownEnumValue::Integer(value),
36700 )),
36701 }
36702 }
36703}
36704
36705impl std::convert::From<&str> for SqlDataDiskType {
36706 fn from(value: &str) -> Self {
36707 use std::string::ToString;
36708 match value {
36709 "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
36710 "PD_SSD" => Self::PdSsd,
36711 "PD_HDD" => Self::PdHdd,
36712 "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
36713 "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
36714 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
36715 wkt::internal::UnknownEnumValue::String(value.to_string()),
36716 )),
36717 }
36718 }
36719}
36720
36721impl serde::ser::Serialize for SqlDataDiskType {
36722 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36723 where
36724 S: serde::Serializer,
36725 {
36726 match self {
36727 Self::Unspecified => serializer.serialize_i32(0),
36728 Self::PdSsd => serializer.serialize_i32(1),
36729 Self::PdHdd => serializer.serialize_i32(2),
36730 Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
36731 Self::HyperdiskBalanced => serializer.serialize_i32(4),
36732 Self::UnknownValue(u) => u.0.serialize(serializer),
36733 }
36734 }
36735}
36736
36737impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
36738 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36739 where
36740 D: serde::Deserializer<'de>,
36741 {
36742 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
36743 ".google.cloud.sql.v1.SqlDataDiskType",
36744 ))
36745 }
36746}
36747
36748/// The availability type of the given Cloud SQL instance.
36749///
36750/// # Working with unknown values
36751///
36752/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36753/// additional enum variants at any time. Adding new variants is not considered
36754/// a breaking change. Applications should write their code in anticipation of:
36755///
36756/// - New values appearing in future releases of the client library, **and**
36757/// - New values received dynamically, without application changes.
36758///
36759/// Please consult the [Working with enums] section in the user guide for some
36760/// guidelines.
36761///
36762/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36763#[derive(Clone, Debug, PartialEq)]
36764#[non_exhaustive]
36765pub enum SqlAvailabilityType {
36766 /// This is an unknown Availability type.
36767 Unspecified,
36768 /// Zonal available instance.
36769 Zonal,
36770 /// Regional available instance.
36771 Regional,
36772 /// If set, the enum was initialized with an unknown value.
36773 ///
36774 /// Applications can examine the value using [SqlAvailabilityType::value] or
36775 /// [SqlAvailabilityType::name].
36776 UnknownValue(sql_availability_type::UnknownValue),
36777}
36778
36779#[doc(hidden)]
36780pub mod sql_availability_type {
36781 #[allow(unused_imports)]
36782 use super::*;
36783 #[derive(Clone, Debug, PartialEq)]
36784 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36785}
36786
36787impl SqlAvailabilityType {
36788 /// Gets the enum value.
36789 ///
36790 /// Returns `None` if the enum contains an unknown value deserialized from
36791 /// the string representation of enums.
36792 pub fn value(&self) -> std::option::Option<i32> {
36793 match self {
36794 Self::Unspecified => std::option::Option::Some(0),
36795 Self::Zonal => std::option::Option::Some(1),
36796 Self::Regional => std::option::Option::Some(2),
36797 Self::UnknownValue(u) => u.0.value(),
36798 }
36799 }
36800
36801 /// Gets the enum value as a string.
36802 ///
36803 /// Returns `None` if the enum contains an unknown value deserialized from
36804 /// the integer representation of enums.
36805 pub fn name(&self) -> std::option::Option<&str> {
36806 match self {
36807 Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
36808 Self::Zonal => std::option::Option::Some("ZONAL"),
36809 Self::Regional => std::option::Option::Some("REGIONAL"),
36810 Self::UnknownValue(u) => u.0.name(),
36811 }
36812 }
36813}
36814
36815impl std::default::Default for SqlAvailabilityType {
36816 fn default() -> Self {
36817 use std::convert::From;
36818 Self::from(0)
36819 }
36820}
36821
36822impl std::fmt::Display for SqlAvailabilityType {
36823 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36824 wkt::internal::display_enum(f, self.name(), self.value())
36825 }
36826}
36827
36828impl std::convert::From<i32> for SqlAvailabilityType {
36829 fn from(value: i32) -> Self {
36830 match value {
36831 0 => Self::Unspecified,
36832 1 => Self::Zonal,
36833 2 => Self::Regional,
36834 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
36835 wkt::internal::UnknownEnumValue::Integer(value),
36836 )),
36837 }
36838 }
36839}
36840
36841impl std::convert::From<&str> for SqlAvailabilityType {
36842 fn from(value: &str) -> Self {
36843 use std::string::ToString;
36844 match value {
36845 "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
36846 "ZONAL" => Self::Zonal,
36847 "REGIONAL" => Self::Regional,
36848 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
36849 wkt::internal::UnknownEnumValue::String(value.to_string()),
36850 )),
36851 }
36852 }
36853}
36854
36855impl serde::ser::Serialize for SqlAvailabilityType {
36856 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36857 where
36858 S: serde::Serializer,
36859 {
36860 match self {
36861 Self::Unspecified => serializer.serialize_i32(0),
36862 Self::Zonal => serializer.serialize_i32(1),
36863 Self::Regional => serializer.serialize_i32(2),
36864 Self::UnknownValue(u) => u.0.serialize(serializer),
36865 }
36866 }
36867}
36868
36869impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
36870 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36871 where
36872 D: serde::Deserializer<'de>,
36873 {
36874 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
36875 ".google.cloud.sql.v1.SqlAvailabilityType",
36876 ))
36877 }
36878}
36879
36880/// Enum for [SqlUpdateTrack].
36881///
36882/// # Working with unknown values
36883///
36884/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36885/// additional enum variants at any time. Adding new variants is not considered
36886/// a breaking change. Applications should write their code in anticipation of:
36887///
36888/// - New values appearing in future releases of the client library, **and**
36889/// - New values received dynamically, without application changes.
36890///
36891/// Please consult the [Working with enums] section in the user guide for some
36892/// guidelines.
36893///
36894/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36895#[derive(Clone, Debug, PartialEq)]
36896#[non_exhaustive]
36897pub enum SqlUpdateTrack {
36898 /// This is an unknown maintenance timing preference.
36899 Unspecified,
36900 /// For an instance with a scheduled maintenance window, this maintenance
36901 /// timing indicates that the maintenance update is scheduled 7 to 14 days
36902 /// after the notification is sent out. Also referred to as `Week 1` (Console)
36903 /// and `preview` (gcloud CLI).
36904 Canary,
36905 /// For an instance with a scheduled maintenance window, this maintenance
36906 /// timing indicates that the maintenance update is scheduled 15 to 21 days
36907 /// after the notification is sent out. Also referred to as `Week 2` (Console)
36908 /// and `production` (gcloud CLI).
36909 Stable,
36910 /// For instance with a scheduled maintenance window, this maintenance
36911 /// timing indicates that the maintenance update is scheduled 35 to 42 days
36912 /// after the notification is sent out.
36913 Week5,
36914 /// If set, the enum was initialized with an unknown value.
36915 ///
36916 /// Applications can examine the value using [SqlUpdateTrack::value] or
36917 /// [SqlUpdateTrack::name].
36918 UnknownValue(sql_update_track::UnknownValue),
36919}
36920
36921#[doc(hidden)]
36922pub mod sql_update_track {
36923 #[allow(unused_imports)]
36924 use super::*;
36925 #[derive(Clone, Debug, PartialEq)]
36926 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36927}
36928
36929impl SqlUpdateTrack {
36930 /// Gets the enum value.
36931 ///
36932 /// Returns `None` if the enum contains an unknown value deserialized from
36933 /// the string representation of enums.
36934 pub fn value(&self) -> std::option::Option<i32> {
36935 match self {
36936 Self::Unspecified => std::option::Option::Some(0),
36937 Self::Canary => std::option::Option::Some(1),
36938 Self::Stable => std::option::Option::Some(2),
36939 Self::Week5 => std::option::Option::Some(3),
36940 Self::UnknownValue(u) => u.0.value(),
36941 }
36942 }
36943
36944 /// Gets the enum value as a string.
36945 ///
36946 /// Returns `None` if the enum contains an unknown value deserialized from
36947 /// the integer representation of enums.
36948 pub fn name(&self) -> std::option::Option<&str> {
36949 match self {
36950 Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
36951 Self::Canary => std::option::Option::Some("canary"),
36952 Self::Stable => std::option::Option::Some("stable"),
36953 Self::Week5 => std::option::Option::Some("week5"),
36954 Self::UnknownValue(u) => u.0.name(),
36955 }
36956 }
36957}
36958
36959impl std::default::Default for SqlUpdateTrack {
36960 fn default() -> Self {
36961 use std::convert::From;
36962 Self::from(0)
36963 }
36964}
36965
36966impl std::fmt::Display for SqlUpdateTrack {
36967 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36968 wkt::internal::display_enum(f, self.name(), self.value())
36969 }
36970}
36971
36972impl std::convert::From<i32> for SqlUpdateTrack {
36973 fn from(value: i32) -> Self {
36974 match value {
36975 0 => Self::Unspecified,
36976 1 => Self::Canary,
36977 2 => Self::Stable,
36978 3 => Self::Week5,
36979 _ => Self::UnknownValue(sql_update_track::UnknownValue(
36980 wkt::internal::UnknownEnumValue::Integer(value),
36981 )),
36982 }
36983 }
36984}
36985
36986impl std::convert::From<&str> for SqlUpdateTrack {
36987 fn from(value: &str) -> Self {
36988 use std::string::ToString;
36989 match value {
36990 "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
36991 "canary" => Self::Canary,
36992 "stable" => Self::Stable,
36993 "week5" => Self::Week5,
36994 _ => Self::UnknownValue(sql_update_track::UnknownValue(
36995 wkt::internal::UnknownEnumValue::String(value.to_string()),
36996 )),
36997 }
36998 }
36999}
37000
37001impl serde::ser::Serialize for SqlUpdateTrack {
37002 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37003 where
37004 S: serde::Serializer,
37005 {
37006 match self {
37007 Self::Unspecified => serializer.serialize_i32(0),
37008 Self::Canary => serializer.serialize_i32(1),
37009 Self::Stable => serializer.serialize_i32(2),
37010 Self::Week5 => serializer.serialize_i32(3),
37011 Self::UnknownValue(u) => u.0.serialize(serializer),
37012 }
37013 }
37014}
37015
37016impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
37017 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37018 where
37019 D: serde::Deserializer<'de>,
37020 {
37021 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
37022 ".google.cloud.sql.v1.SqlUpdateTrack",
37023 ))
37024 }
37025}
37026
37027/// The status of automated DNS provisioning.
37028///
37029/// # Working with unknown values
37030///
37031/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37032/// additional enum variants at any time. Adding new variants is not considered
37033/// a breaking change. Applications should write their code in anticipation of:
37034///
37035/// - New values appearing in future releases of the client library, **and**
37036/// - New values received dynamically, without application changes.
37037///
37038/// Please consult the [Working with enums] section in the user guide for some
37039/// guidelines.
37040///
37041/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37042#[derive(Clone, Debug, PartialEq)]
37043#[non_exhaustive]
37044pub enum AutoDnsStatus {
37045 /// Unspecified status. This means status is missing from dependency service.
37046 Unspecified,
37047 /// DNS provisioning is OK.
37048 AutoDnsOk,
37049 /// DNS provisioning failed.
37050 AutoDnsFailed,
37051 /// DNS provisioning status is not recognized by Cloud SQL.
37052 AutoDnsUnknown,
37053 /// If set, the enum was initialized with an unknown value.
37054 ///
37055 /// Applications can examine the value using [AutoDnsStatus::value] or
37056 /// [AutoDnsStatus::name].
37057 UnknownValue(auto_dns_status::UnknownValue),
37058}
37059
37060#[doc(hidden)]
37061pub mod auto_dns_status {
37062 #[allow(unused_imports)]
37063 use super::*;
37064 #[derive(Clone, Debug, PartialEq)]
37065 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37066}
37067
37068impl AutoDnsStatus {
37069 /// Gets the enum value.
37070 ///
37071 /// Returns `None` if the enum contains an unknown value deserialized from
37072 /// the string representation of enums.
37073 pub fn value(&self) -> std::option::Option<i32> {
37074 match self {
37075 Self::Unspecified => std::option::Option::Some(0),
37076 Self::AutoDnsOk => std::option::Option::Some(1),
37077 Self::AutoDnsFailed => std::option::Option::Some(2),
37078 Self::AutoDnsUnknown => std::option::Option::Some(3),
37079 Self::UnknownValue(u) => u.0.value(),
37080 }
37081 }
37082
37083 /// Gets the enum value as a string.
37084 ///
37085 /// Returns `None` if the enum contains an unknown value deserialized from
37086 /// the integer representation of enums.
37087 pub fn name(&self) -> std::option::Option<&str> {
37088 match self {
37089 Self::Unspecified => std::option::Option::Some("AUTO_DNS_STATUS_UNSPECIFIED"),
37090 Self::AutoDnsOk => std::option::Option::Some("AUTO_DNS_OK"),
37091 Self::AutoDnsFailed => std::option::Option::Some("AUTO_DNS_FAILED"),
37092 Self::AutoDnsUnknown => std::option::Option::Some("AUTO_DNS_UNKNOWN"),
37093 Self::UnknownValue(u) => u.0.name(),
37094 }
37095 }
37096}
37097
37098impl std::default::Default for AutoDnsStatus {
37099 fn default() -> Self {
37100 use std::convert::From;
37101 Self::from(0)
37102 }
37103}
37104
37105impl std::fmt::Display for AutoDnsStatus {
37106 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37107 wkt::internal::display_enum(f, self.name(), self.value())
37108 }
37109}
37110
37111impl std::convert::From<i32> for AutoDnsStatus {
37112 fn from(value: i32) -> Self {
37113 match value {
37114 0 => Self::Unspecified,
37115 1 => Self::AutoDnsOk,
37116 2 => Self::AutoDnsFailed,
37117 3 => Self::AutoDnsUnknown,
37118 _ => Self::UnknownValue(auto_dns_status::UnknownValue(
37119 wkt::internal::UnknownEnumValue::Integer(value),
37120 )),
37121 }
37122 }
37123}
37124
37125impl std::convert::From<&str> for AutoDnsStatus {
37126 fn from(value: &str) -> Self {
37127 use std::string::ToString;
37128 match value {
37129 "AUTO_DNS_STATUS_UNSPECIFIED" => Self::Unspecified,
37130 "AUTO_DNS_OK" => Self::AutoDnsOk,
37131 "AUTO_DNS_FAILED" => Self::AutoDnsFailed,
37132 "AUTO_DNS_UNKNOWN" => Self::AutoDnsUnknown,
37133 _ => Self::UnknownValue(auto_dns_status::UnknownValue(
37134 wkt::internal::UnknownEnumValue::String(value.to_string()),
37135 )),
37136 }
37137 }
37138}
37139
37140impl serde::ser::Serialize for AutoDnsStatus {
37141 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37142 where
37143 S: serde::Serializer,
37144 {
37145 match self {
37146 Self::Unspecified => serializer.serialize_i32(0),
37147 Self::AutoDnsOk => serializer.serialize_i32(1),
37148 Self::AutoDnsFailed => serializer.serialize_i32(2),
37149 Self::AutoDnsUnknown => serializer.serialize_i32(3),
37150 Self::UnknownValue(u) => u.0.serialize(serializer),
37151 }
37152 }
37153}
37154
37155impl<'de> serde::de::Deserialize<'de> for AutoDnsStatus {
37156 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37157 where
37158 D: serde::Deserializer<'de>,
37159 {
37160 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoDnsStatus>::new(
37161 ".google.cloud.sql.v1.AutoDnsStatus",
37162 ))
37163 }
37164}