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 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11136}
11137
11138impl DatabaseInstance {
11139 /// Creates a new default instance.
11140 pub fn new() -> Self {
11141 std::default::Default::default()
11142 }
11143
11144 /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
11145 ///
11146 /// # Example
11147 /// ```ignore,no_run
11148 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11149 /// let x = DatabaseInstance::new().set_kind("example");
11150 /// ```
11151 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11152 self.kind = v.into();
11153 self
11154 }
11155
11156 /// Sets the value of [state][crate::model::DatabaseInstance::state].
11157 ///
11158 /// # Example
11159 /// ```ignore,no_run
11160 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11161 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
11162 /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
11163 /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
11164 /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
11165 /// ```
11166 pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
11167 mut self,
11168 v: T,
11169 ) -> Self {
11170 self.state = v.into();
11171 self
11172 }
11173
11174 /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
11175 ///
11176 /// # Example
11177 /// ```ignore,no_run
11178 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11179 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
11180 /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
11181 /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
11182 /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
11183 /// ```
11184 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
11185 mut self,
11186 v: T,
11187 ) -> Self {
11188 self.database_version = v.into();
11189 self
11190 }
11191
11192 /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
11193 ///
11194 /// # Example
11195 /// ```ignore,no_run
11196 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11197 /// use google_cloud_sql_v1::model::Settings;
11198 /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
11199 /// ```
11200 pub fn set_settings<T>(mut self, v: T) -> Self
11201 where
11202 T: std::convert::Into<crate::model::Settings>,
11203 {
11204 self.settings = std::option::Option::Some(v.into());
11205 self
11206 }
11207
11208 /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
11209 ///
11210 /// # Example
11211 /// ```ignore,no_run
11212 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11213 /// use google_cloud_sql_v1::model::Settings;
11214 /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
11215 /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
11216 /// ```
11217 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
11218 where
11219 T: std::convert::Into<crate::model::Settings>,
11220 {
11221 self.settings = v.map(|x| x.into());
11222 self
11223 }
11224
11225 /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
11226 ///
11227 /// # Example
11228 /// ```ignore,no_run
11229 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11230 /// let x = DatabaseInstance::new().set_etag("example");
11231 /// ```
11232 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11233 self.etag = v.into();
11234 self
11235 }
11236
11237 /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11238 ///
11239 /// # Example
11240 /// ```ignore,no_run
11241 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11242 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11243 /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
11244 /// ```
11245 pub fn set_failover_replica<T>(mut self, v: T) -> Self
11246 where
11247 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11248 {
11249 self.failover_replica = std::option::Option::Some(v.into());
11250 self
11251 }
11252
11253 /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11254 ///
11255 /// # Example
11256 /// ```ignore,no_run
11257 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11258 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11259 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
11260 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
11261 /// ```
11262 pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
11263 where
11264 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11265 {
11266 self.failover_replica = v.map(|x| x.into());
11267 self
11268 }
11269
11270 /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
11271 ///
11272 /// # Example
11273 /// ```ignore,no_run
11274 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11275 /// let x = DatabaseInstance::new().set_master_instance_name("example");
11276 /// ```
11277 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
11278 mut self,
11279 v: T,
11280 ) -> Self {
11281 self.master_instance_name = v.into();
11282 self
11283 }
11284
11285 /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
11286 ///
11287 /// # Example
11288 /// ```ignore,no_run
11289 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11290 /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
11291 /// ```
11292 pub fn set_replica_names<T, V>(mut self, v: T) -> Self
11293 where
11294 T: std::iter::IntoIterator<Item = V>,
11295 V: std::convert::Into<std::string::String>,
11296 {
11297 use std::iter::Iterator;
11298 self.replica_names = v.into_iter().map(|i| i.into()).collect();
11299 self
11300 }
11301
11302 /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11303 ///
11304 /// # Example
11305 /// ```ignore,no_run
11306 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11307 /// use wkt::Int64Value;
11308 /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
11309 /// ```
11310 #[deprecated]
11311 pub fn set_max_disk_size<T>(mut self, v: T) -> Self
11312 where
11313 T: std::convert::Into<wkt::Int64Value>,
11314 {
11315 self.max_disk_size = std::option::Option::Some(v.into());
11316 self
11317 }
11318
11319 /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11320 ///
11321 /// # Example
11322 /// ```ignore,no_run
11323 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11324 /// use wkt::Int64Value;
11325 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
11326 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
11327 /// ```
11328 #[deprecated]
11329 pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11330 where
11331 T: std::convert::Into<wkt::Int64Value>,
11332 {
11333 self.max_disk_size = v.map(|x| x.into());
11334 self
11335 }
11336
11337 /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11338 ///
11339 /// # Example
11340 /// ```ignore,no_run
11341 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11342 /// use wkt::Int64Value;
11343 /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
11344 /// ```
11345 #[deprecated]
11346 pub fn set_current_disk_size<T>(mut self, v: T) -> Self
11347 where
11348 T: std::convert::Into<wkt::Int64Value>,
11349 {
11350 self.current_disk_size = std::option::Option::Some(v.into());
11351 self
11352 }
11353
11354 /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
11355 ///
11356 /// # Example
11357 /// ```ignore,no_run
11358 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11359 /// use wkt::Int64Value;
11360 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
11361 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
11362 /// ```
11363 #[deprecated]
11364 pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11365 where
11366 T: std::convert::Into<wkt::Int64Value>,
11367 {
11368 self.current_disk_size = v.map(|x| x.into());
11369 self
11370 }
11371
11372 /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
11373 ///
11374 /// # Example
11375 /// ```ignore,no_run
11376 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11377 /// use google_cloud_sql_v1::model::IpMapping;
11378 /// let x = DatabaseInstance::new()
11379 /// .set_ip_addresses([
11380 /// IpMapping::default()/* use setters */,
11381 /// IpMapping::default()/* use (different) setters */,
11382 /// ]);
11383 /// ```
11384 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
11385 where
11386 T: std::iter::IntoIterator<Item = V>,
11387 V: std::convert::Into<crate::model::IpMapping>,
11388 {
11389 use std::iter::Iterator;
11390 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
11391 self
11392 }
11393
11394 /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11395 ///
11396 /// # Example
11397 /// ```ignore,no_run
11398 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11399 /// use google_cloud_sql_v1::model::SslCert;
11400 /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
11401 /// ```
11402 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
11403 where
11404 T: std::convert::Into<crate::model::SslCert>,
11405 {
11406 self.server_ca_cert = std::option::Option::Some(v.into());
11407 self
11408 }
11409
11410 /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11411 ///
11412 /// # Example
11413 /// ```ignore,no_run
11414 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11415 /// use google_cloud_sql_v1::model::SslCert;
11416 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
11417 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
11418 /// ```
11419 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
11420 where
11421 T: std::convert::Into<crate::model::SslCert>,
11422 {
11423 self.server_ca_cert = v.map(|x| x.into());
11424 self
11425 }
11426
11427 /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
11428 ///
11429 /// # Example
11430 /// ```ignore,no_run
11431 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11432 /// use google_cloud_sql_v1::model::SqlInstanceType;
11433 /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
11434 /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
11435 /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
11436 /// ```
11437 pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
11438 mut self,
11439 v: T,
11440 ) -> Self {
11441 self.instance_type = v.into();
11442 self
11443 }
11444
11445 /// Sets the value of [project][crate::model::DatabaseInstance::project].
11446 ///
11447 /// # Example
11448 /// ```ignore,no_run
11449 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11450 /// let x = DatabaseInstance::new().set_project("example");
11451 /// ```
11452 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11453 self.project = v.into();
11454 self
11455 }
11456
11457 /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
11458 ///
11459 /// # Example
11460 /// ```ignore,no_run
11461 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11462 /// let x = DatabaseInstance::new().set_ipv6_address("example");
11463 /// ```
11464 #[deprecated]
11465 pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11466 self.ipv6_address = v.into();
11467 self
11468 }
11469
11470 /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
11471 ///
11472 /// # Example
11473 /// ```ignore,no_run
11474 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11475 /// let x = DatabaseInstance::new().set_service_account_email_address("example");
11476 /// ```
11477 pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
11478 mut self,
11479 v: T,
11480 ) -> Self {
11481 self.service_account_email_address = v.into();
11482 self
11483 }
11484
11485 /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11486 ///
11487 /// # Example
11488 /// ```ignore,no_run
11489 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11490 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11491 /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
11492 /// ```
11493 pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
11494 where
11495 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11496 {
11497 self.on_premises_configuration = std::option::Option::Some(v.into());
11498 self
11499 }
11500
11501 /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11502 ///
11503 /// # Example
11504 /// ```ignore,no_run
11505 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11506 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11507 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
11508 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
11509 /// ```
11510 pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11511 where
11512 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11513 {
11514 self.on_premises_configuration = v.map(|x| x.into());
11515 self
11516 }
11517
11518 /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11519 ///
11520 /// # Example
11521 /// ```ignore,no_run
11522 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11523 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11524 /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
11525 /// ```
11526 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
11527 where
11528 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11529 {
11530 self.replica_configuration = std::option::Option::Some(v.into());
11531 self
11532 }
11533
11534 /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11535 ///
11536 /// # Example
11537 /// ```ignore,no_run
11538 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11539 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11540 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
11541 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
11542 /// ```
11543 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11544 where
11545 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11546 {
11547 self.replica_configuration = v.map(|x| x.into());
11548 self
11549 }
11550
11551 /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
11552 ///
11553 /// # Example
11554 /// ```ignore,no_run
11555 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11556 /// use google_cloud_sql_v1::model::SqlBackendType;
11557 /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
11558 /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
11559 /// ```
11560 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
11561 mut self,
11562 v: T,
11563 ) -> Self {
11564 self.backend_type = v.into();
11565 self
11566 }
11567
11568 /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
11569 ///
11570 /// # Example
11571 /// ```ignore,no_run
11572 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11573 /// let x = DatabaseInstance::new().set_self_link("example");
11574 /// ```
11575 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11576 self.self_link = v.into();
11577 self
11578 }
11579
11580 /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
11581 ///
11582 /// # Example
11583 /// ```ignore,no_run
11584 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11585 /// use google_cloud_sql_v1::model::SqlSuspensionReason;
11586 /// let x = DatabaseInstance::new().set_suspension_reason([
11587 /// SqlSuspensionReason::BillingIssue,
11588 /// SqlSuspensionReason::LegalIssue,
11589 /// SqlSuspensionReason::OperationalIssue,
11590 /// ]);
11591 /// ```
11592 pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
11593 where
11594 T: std::iter::IntoIterator<Item = V>,
11595 V: std::convert::Into<crate::model::SqlSuspensionReason>,
11596 {
11597 use std::iter::Iterator;
11598 self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
11599 self
11600 }
11601
11602 /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
11603 ///
11604 /// # Example
11605 /// ```ignore,no_run
11606 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11607 /// let x = DatabaseInstance::new().set_connection_name("example");
11608 /// ```
11609 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11610 self.connection_name = v.into();
11611 self
11612 }
11613
11614 /// Sets the value of [name][crate::model::DatabaseInstance::name].
11615 ///
11616 /// # Example
11617 /// ```ignore,no_run
11618 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11619 /// let x = DatabaseInstance::new().set_name("example");
11620 /// ```
11621 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11622 self.name = v.into();
11623 self
11624 }
11625
11626 /// Sets the value of [region][crate::model::DatabaseInstance::region].
11627 ///
11628 /// # Example
11629 /// ```ignore,no_run
11630 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11631 /// let x = DatabaseInstance::new().set_region("example");
11632 /// ```
11633 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11634 self.region = v.into();
11635 self
11636 }
11637
11638 /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
11639 ///
11640 /// # Example
11641 /// ```ignore,no_run
11642 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11643 /// let x = DatabaseInstance::new().set_gce_zone("example");
11644 /// ```
11645 pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11646 self.gce_zone = v.into();
11647 self
11648 }
11649
11650 /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
11651 ///
11652 /// # Example
11653 /// ```ignore,no_run
11654 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11655 /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
11656 /// ```
11657 pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
11658 mut self,
11659 v: T,
11660 ) -> Self {
11661 self.secondary_gce_zone = v.into();
11662 self
11663 }
11664
11665 /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11666 ///
11667 /// # Example
11668 /// ```ignore,no_run
11669 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11670 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11671 /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
11672 /// ```
11673 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
11674 where
11675 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11676 {
11677 self.disk_encryption_configuration = std::option::Option::Some(v.into());
11678 self
11679 }
11680
11681 /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11682 ///
11683 /// # Example
11684 /// ```ignore,no_run
11685 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11686 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11687 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
11688 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
11689 /// ```
11690 pub fn set_or_clear_disk_encryption_configuration<T>(
11691 mut self,
11692 v: std::option::Option<T>,
11693 ) -> Self
11694 where
11695 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11696 {
11697 self.disk_encryption_configuration = v.map(|x| x.into());
11698 self
11699 }
11700
11701 /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11702 ///
11703 /// # Example
11704 /// ```ignore,no_run
11705 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11706 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11707 /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
11708 /// ```
11709 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
11710 where
11711 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11712 {
11713 self.disk_encryption_status = std::option::Option::Some(v.into());
11714 self
11715 }
11716
11717 /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11718 ///
11719 /// # Example
11720 /// ```ignore,no_run
11721 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11722 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11723 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
11724 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
11725 /// ```
11726 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
11727 where
11728 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11729 {
11730 self.disk_encryption_status = v.map(|x| x.into());
11731 self
11732 }
11733
11734 /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
11735 ///
11736 /// # Example
11737 /// ```ignore,no_run
11738 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11739 /// let x = DatabaseInstance::new().set_root_password("example");
11740 /// ```
11741 pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11742 self.root_password = v.into();
11743 self
11744 }
11745
11746 /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11747 ///
11748 /// # Example
11749 /// ```ignore,no_run
11750 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11751 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11752 /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
11753 /// ```
11754 pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
11755 where
11756 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11757 {
11758 self.scheduled_maintenance = std::option::Option::Some(v.into());
11759 self
11760 }
11761
11762 /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11763 ///
11764 /// # Example
11765 /// ```ignore,no_run
11766 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11767 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11768 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
11769 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
11770 /// ```
11771 pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
11772 where
11773 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11774 {
11775 self.scheduled_maintenance = v.map(|x| x.into());
11776 self
11777 }
11778
11779 /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11780 ///
11781 /// # Example
11782 /// ```ignore,no_run
11783 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11784 /// use wkt::BoolValue;
11785 /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
11786 /// ```
11787 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11788 where
11789 T: std::convert::Into<wkt::BoolValue>,
11790 {
11791 self.satisfies_pzs = std::option::Option::Some(v.into());
11792 self
11793 }
11794
11795 /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11796 ///
11797 /// # Example
11798 /// ```ignore,no_run
11799 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11800 /// use wkt::BoolValue;
11801 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
11802 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
11803 /// ```
11804 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11805 where
11806 T: std::convert::Into<wkt::BoolValue>,
11807 {
11808 self.satisfies_pzs = v.map(|x| x.into());
11809 self
11810 }
11811
11812 /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
11813 ///
11814 /// # Example
11815 /// ```ignore,no_run
11816 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11817 /// let x = DatabaseInstance::new().set_database_installed_version("example");
11818 /// ```
11819 pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
11820 mut self,
11821 v: T,
11822 ) -> Self {
11823 self.database_installed_version = v.into();
11824 self
11825 }
11826
11827 /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11828 ///
11829 /// # Example
11830 /// ```ignore,no_run
11831 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11832 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11833 /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
11834 /// ```
11835 pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
11836 where
11837 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11838 {
11839 self.out_of_disk_report = std::option::Option::Some(v.into());
11840 self
11841 }
11842
11843 /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11844 ///
11845 /// # Example
11846 /// ```ignore,no_run
11847 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11848 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11849 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
11850 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
11851 /// ```
11852 pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
11853 where
11854 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11855 {
11856 self.out_of_disk_report = v.map(|x| x.into());
11857 self
11858 }
11859
11860 /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
11861 ///
11862 /// # Example
11863 /// ```ignore,no_run
11864 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11865 /// use wkt::Timestamp;
11866 /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
11867 /// ```
11868 pub fn set_create_time<T>(mut self, v: T) -> Self
11869 where
11870 T: std::convert::Into<wkt::Timestamp>,
11871 {
11872 self.create_time = std::option::Option::Some(v.into());
11873 self
11874 }
11875
11876 /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
11877 ///
11878 /// # Example
11879 /// ```ignore,no_run
11880 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11881 /// use wkt::Timestamp;
11882 /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11883 /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
11884 /// ```
11885 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11886 where
11887 T: std::convert::Into<wkt::Timestamp>,
11888 {
11889 self.create_time = v.map(|x| x.into());
11890 self
11891 }
11892
11893 /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
11894 ///
11895 /// # Example
11896 /// ```ignore,no_run
11897 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11898 /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
11899 /// ```
11900 pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
11901 where
11902 T: std::iter::IntoIterator<Item = V>,
11903 V: std::convert::Into<std::string::String>,
11904 {
11905 use std::iter::Iterator;
11906 self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
11907 self
11908 }
11909
11910 /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
11911 ///
11912 /// # Example
11913 /// ```ignore,no_run
11914 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11915 /// let x = DatabaseInstance::new().set_maintenance_version("example");
11916 /// ```
11917 pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
11918 mut self,
11919 v: T,
11920 ) -> Self {
11921 self.maintenance_version = v.into();
11922 self
11923 }
11924
11925 /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
11926 ///
11927 /// # Example
11928 /// ```ignore,no_run
11929 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11930 /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
11931 /// let x = DatabaseInstance::new()
11932 /// .set_upgradable_database_versions([
11933 /// AvailableDatabaseVersion::default()/* use setters */,
11934 /// AvailableDatabaseVersion::default()/* use (different) setters */,
11935 /// ]);
11936 /// ```
11937 pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
11938 where
11939 T: std::iter::IntoIterator<Item = V>,
11940 V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
11941 {
11942 use std::iter::Iterator;
11943 self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
11944 self
11945 }
11946
11947 /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11948 ///
11949 /// # Example
11950 /// ```ignore,no_run
11951 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11952 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11953 /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
11954 /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
11955 /// ```
11956 pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
11957 where
11958 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11959 {
11960 self.sql_network_architecture = std::option::Option::Some(v.into());
11961 self
11962 }
11963
11964 /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11965 ///
11966 /// # Example
11967 /// ```ignore,no_run
11968 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11969 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11970 /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
11971 /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
11972 /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
11973 /// ```
11974 pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
11975 where
11976 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11977 {
11978 self.sql_network_architecture = v.map(|x| x.into());
11979 self
11980 }
11981
11982 /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11983 ///
11984 /// # Example
11985 /// ```ignore,no_run
11986 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11987 /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
11988 /// ```
11989 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
11990 where
11991 T: std::convert::Into<std::string::String>,
11992 {
11993 self.psc_service_attachment_link = std::option::Option::Some(v.into());
11994 self
11995 }
11996
11997 /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11998 ///
11999 /// # Example
12000 /// ```ignore,no_run
12001 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12002 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
12003 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
12004 /// ```
12005 pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
12006 where
12007 T: std::convert::Into<std::string::String>,
12008 {
12009 self.psc_service_attachment_link = v.map(|x| x.into());
12010 self
12011 }
12012
12013 /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
12014 ///
12015 /// # Example
12016 /// ```ignore,no_run
12017 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12018 /// let x = DatabaseInstance::new().set_dns_name("example");
12019 /// ```
12020 pub fn set_dns_name<T>(mut self, v: T) -> Self
12021 where
12022 T: std::convert::Into<std::string::String>,
12023 {
12024 self.dns_name = std::option::Option::Some(v.into());
12025 self
12026 }
12027
12028 /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
12029 ///
12030 /// # Example
12031 /// ```ignore,no_run
12032 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12033 /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
12034 /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
12035 /// ```
12036 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12037 where
12038 T: std::convert::Into<std::string::String>,
12039 {
12040 self.dns_name = v.map(|x| x.into());
12041 self
12042 }
12043
12044 /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
12045 ///
12046 /// # Example
12047 /// ```ignore,no_run
12048 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12049 /// let x = DatabaseInstance::new().set_primary_dns_name("example");
12050 /// ```
12051 #[deprecated]
12052 pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
12053 where
12054 T: std::convert::Into<std::string::String>,
12055 {
12056 self.primary_dns_name = std::option::Option::Some(v.into());
12057 self
12058 }
12059
12060 /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
12061 ///
12062 /// # Example
12063 /// ```ignore,no_run
12064 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12065 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
12066 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
12067 /// ```
12068 #[deprecated]
12069 pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12070 where
12071 T: std::convert::Into<std::string::String>,
12072 {
12073 self.primary_dns_name = v.map(|x| x.into());
12074 self
12075 }
12076
12077 /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
12078 ///
12079 /// # Example
12080 /// ```ignore,no_run
12081 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12082 /// let x = DatabaseInstance::new().set_write_endpoint("example");
12083 /// ```
12084 pub fn set_write_endpoint<T>(mut self, v: T) -> Self
12085 where
12086 T: std::convert::Into<std::string::String>,
12087 {
12088 self.write_endpoint = std::option::Option::Some(v.into());
12089 self
12090 }
12091
12092 /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
12093 ///
12094 /// # Example
12095 /// ```ignore,no_run
12096 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12097 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
12098 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
12099 /// ```
12100 pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
12101 where
12102 T: std::convert::Into<std::string::String>,
12103 {
12104 self.write_endpoint = v.map(|x| x.into());
12105 self
12106 }
12107
12108 /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
12109 ///
12110 /// # Example
12111 /// ```ignore,no_run
12112 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12113 /// use google_cloud_sql_v1::model::ReplicationCluster;
12114 /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
12115 /// ```
12116 pub fn set_replication_cluster<T>(mut self, v: T) -> Self
12117 where
12118 T: std::convert::Into<crate::model::ReplicationCluster>,
12119 {
12120 self.replication_cluster = std::option::Option::Some(v.into());
12121 self
12122 }
12123
12124 /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
12125 ///
12126 /// # Example
12127 /// ```ignore,no_run
12128 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12129 /// use google_cloud_sql_v1::model::ReplicationCluster;
12130 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
12131 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
12132 /// ```
12133 pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
12134 where
12135 T: std::convert::Into<crate::model::ReplicationCluster>,
12136 {
12137 self.replication_cluster = v.map(|x| x.into());
12138 self
12139 }
12140
12141 /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12142 ///
12143 /// # Example
12144 /// ```ignore,no_run
12145 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12146 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12147 /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
12148 /// ```
12149 pub fn set_gemini_config<T>(mut self, v: T) -> Self
12150 where
12151 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12152 {
12153 self.gemini_config = std::option::Option::Some(v.into());
12154 self
12155 }
12156
12157 /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12158 ///
12159 /// # Example
12160 /// ```ignore,no_run
12161 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12162 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12163 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
12164 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
12165 /// ```
12166 pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
12167 where
12168 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12169 {
12170 self.gemini_config = v.map(|x| x.into());
12171 self
12172 }
12173
12174 /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12175 ///
12176 /// # Example
12177 /// ```ignore,no_run
12178 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12179 /// use wkt::BoolValue;
12180 /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
12181 /// ```
12182 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
12183 where
12184 T: std::convert::Into<wkt::BoolValue>,
12185 {
12186 self.satisfies_pzi = std::option::Option::Some(v.into());
12187 self
12188 }
12189
12190 /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12191 ///
12192 /// # Example
12193 /// ```ignore,no_run
12194 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12195 /// use wkt::BoolValue;
12196 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
12197 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
12198 /// ```
12199 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
12200 where
12201 T: std::convert::Into<wkt::BoolValue>,
12202 {
12203 self.satisfies_pzi = v.map(|x| x.into());
12204 self
12205 }
12206
12207 /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12208 ///
12209 /// # Example
12210 /// ```ignore,no_run
12211 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12212 /// use wkt::BoolValue;
12213 /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
12214 /// ```
12215 pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
12216 where
12217 T: std::convert::Into<wkt::BoolValue>,
12218 {
12219 self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
12220 self
12221 }
12222
12223 /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12224 ///
12225 /// # Example
12226 /// ```ignore,no_run
12227 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12228 /// use wkt::BoolValue;
12229 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
12230 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
12231 /// ```
12232 pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
12233 mut self,
12234 v: std::option::Option<T>,
12235 ) -> Self
12236 where
12237 T: std::convert::Into<wkt::BoolValue>,
12238 {
12239 self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
12240 self
12241 }
12242
12243 /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12244 ///
12245 /// # Example
12246 /// ```ignore,no_run
12247 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12248 /// use wkt::BoolValue;
12249 /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
12250 /// ```
12251 pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
12252 where
12253 T: std::convert::Into<wkt::BoolValue>,
12254 {
12255 self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
12256 self
12257 }
12258
12259 /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12260 ///
12261 /// # Example
12262 /// ```ignore,no_run
12263 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12264 /// use wkt::BoolValue;
12265 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
12266 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
12267 /// ```
12268 pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
12269 mut self,
12270 v: std::option::Option<T>,
12271 ) -> Self
12272 where
12273 T: std::convert::Into<wkt::BoolValue>,
12274 {
12275 self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
12276 self
12277 }
12278
12279 /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
12280 ///
12281 /// # Example
12282 /// ```ignore,no_run
12283 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12284 /// let x = DatabaseInstance::new().set_tags([
12285 /// ("key0", "abc"),
12286 /// ("key1", "xyz"),
12287 /// ]);
12288 /// ```
12289 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
12290 where
12291 T: std::iter::IntoIterator<Item = (K, V)>,
12292 K: std::convert::Into<std::string::String>,
12293 V: std::convert::Into<std::string::String>,
12294 {
12295 use std::iter::Iterator;
12296 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12297 self
12298 }
12299
12300 /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
12301 ///
12302 /// # Example
12303 /// ```ignore,no_run
12304 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12305 /// let x = DatabaseInstance::new().set_node_count(42);
12306 /// ```
12307 pub fn set_node_count<T>(mut self, v: T) -> Self
12308 where
12309 T: std::convert::Into<i32>,
12310 {
12311 self.node_count = std::option::Option::Some(v.into());
12312 self
12313 }
12314
12315 /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
12316 ///
12317 /// # Example
12318 /// ```ignore,no_run
12319 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12320 /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
12321 /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
12322 /// ```
12323 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
12324 where
12325 T: std::convert::Into<i32>,
12326 {
12327 self.node_count = v.map(|x| x.into());
12328 self
12329 }
12330
12331 /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
12332 ///
12333 /// # Example
12334 /// ```ignore,no_run
12335 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12336 /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12337 /// let x = DatabaseInstance::new()
12338 /// .set_nodes([
12339 /// PoolNodeConfig::default()/* use setters */,
12340 /// PoolNodeConfig::default()/* use (different) setters */,
12341 /// ]);
12342 /// ```
12343 pub fn set_nodes<T, V>(mut self, v: T) -> Self
12344 where
12345 T: std::iter::IntoIterator<Item = V>,
12346 V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
12347 {
12348 use std::iter::Iterator;
12349 self.nodes = v.into_iter().map(|i| i.into()).collect();
12350 self
12351 }
12352
12353 /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
12354 ///
12355 /// # Example
12356 /// ```ignore,no_run
12357 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12358 /// use google_cloud_sql_v1::model::DnsNameMapping;
12359 /// let x = DatabaseInstance::new()
12360 /// .set_dns_names([
12361 /// DnsNameMapping::default()/* use setters */,
12362 /// DnsNameMapping::default()/* use (different) setters */,
12363 /// ]);
12364 /// ```
12365 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12366 where
12367 T: std::iter::IntoIterator<Item = V>,
12368 V: std::convert::Into<crate::model::DnsNameMapping>,
12369 {
12370 use std::iter::Iterator;
12371 self.dns_names = v.into_iter().map(|i| i.into()).collect();
12372 self
12373 }
12374}
12375
12376impl wkt::message::Message for DatabaseInstance {
12377 fn typename() -> &'static str {
12378 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
12379 }
12380}
12381
12382/// Defines additional types related to [DatabaseInstance].
12383pub mod database_instance {
12384 #[allow(unused_imports)]
12385 use super::*;
12386
12387 #[allow(missing_docs)]
12388 #[derive(Clone, Default, PartialEq)]
12389 #[non_exhaustive]
12390 pub struct SqlFailoverReplica {
12391 /// The name of the failover replica. If specified at instance creation, a
12392 /// failover replica is created for the instance. The name
12393 /// doesn't include the project ID.
12394 pub name: std::string::String,
12395
12396 /// The availability status of the failover replica. A false status indicates
12397 /// that the failover replica is out of sync. The primary instance can only
12398 /// failover to the failover replica when the status is true.
12399 pub available: std::option::Option<wkt::BoolValue>,
12400
12401 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12402 }
12403
12404 impl SqlFailoverReplica {
12405 /// Creates a new default instance.
12406 pub fn new() -> Self {
12407 std::default::Default::default()
12408 }
12409
12410 /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
12411 ///
12412 /// # Example
12413 /// ```ignore,no_run
12414 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12415 /// let x = SqlFailoverReplica::new().set_name("example");
12416 /// ```
12417 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12418 self.name = v.into();
12419 self
12420 }
12421
12422 /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12423 ///
12424 /// # Example
12425 /// ```ignore,no_run
12426 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12427 /// use wkt::BoolValue;
12428 /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
12429 /// ```
12430 pub fn set_available<T>(mut self, v: T) -> Self
12431 where
12432 T: std::convert::Into<wkt::BoolValue>,
12433 {
12434 self.available = std::option::Option::Some(v.into());
12435 self
12436 }
12437
12438 /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12439 ///
12440 /// # Example
12441 /// ```ignore,no_run
12442 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12443 /// use wkt::BoolValue;
12444 /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
12445 /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
12446 /// ```
12447 pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
12448 where
12449 T: std::convert::Into<wkt::BoolValue>,
12450 {
12451 self.available = v.map(|x| x.into());
12452 self
12453 }
12454 }
12455
12456 impl wkt::message::Message for SqlFailoverReplica {
12457 fn typename() -> &'static str {
12458 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
12459 }
12460 }
12461
12462 /// Any scheduled maintenance for this instance.
12463 #[derive(Clone, Default, PartialEq)]
12464 #[non_exhaustive]
12465 pub struct SqlScheduledMaintenance {
12466 /// The start time of any upcoming scheduled maintenance for this instance.
12467 pub start_time: std::option::Option<wkt::Timestamp>,
12468
12469 #[allow(missing_docs)]
12470 #[deprecated]
12471 pub can_defer: bool,
12472
12473 /// If the scheduled maintenance can be rescheduled.
12474 pub can_reschedule: bool,
12475
12476 /// Maintenance cannot be rescheduled to start beyond this deadline.
12477 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
12478
12479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12480 }
12481
12482 impl SqlScheduledMaintenance {
12483 /// Creates a new default instance.
12484 pub fn new() -> Self {
12485 std::default::Default::default()
12486 }
12487
12488 /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12489 ///
12490 /// # Example
12491 /// ```ignore,no_run
12492 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12493 /// use wkt::Timestamp;
12494 /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
12495 /// ```
12496 pub fn set_start_time<T>(mut self, v: T) -> Self
12497 where
12498 T: std::convert::Into<wkt::Timestamp>,
12499 {
12500 self.start_time = std::option::Option::Some(v.into());
12501 self
12502 }
12503
12504 /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12505 ///
12506 /// # Example
12507 /// ```ignore,no_run
12508 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12509 /// use wkt::Timestamp;
12510 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12511 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
12512 /// ```
12513 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12514 where
12515 T: std::convert::Into<wkt::Timestamp>,
12516 {
12517 self.start_time = v.map(|x| x.into());
12518 self
12519 }
12520
12521 /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
12522 ///
12523 /// # Example
12524 /// ```ignore,no_run
12525 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12526 /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
12527 /// ```
12528 #[deprecated]
12529 pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12530 self.can_defer = v.into();
12531 self
12532 }
12533
12534 /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
12535 ///
12536 /// # Example
12537 /// ```ignore,no_run
12538 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12539 /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
12540 /// ```
12541 pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12542 self.can_reschedule = v.into();
12543 self
12544 }
12545
12546 /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12547 ///
12548 /// # Example
12549 /// ```ignore,no_run
12550 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12551 /// use wkt::Timestamp;
12552 /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
12553 /// ```
12554 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
12555 where
12556 T: std::convert::Into<wkt::Timestamp>,
12557 {
12558 self.schedule_deadline_time = std::option::Option::Some(v.into());
12559 self
12560 }
12561
12562 /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12563 ///
12564 /// # Example
12565 /// ```ignore,no_run
12566 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12567 /// use wkt::Timestamp;
12568 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
12569 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
12570 /// ```
12571 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
12572 where
12573 T: std::convert::Into<wkt::Timestamp>,
12574 {
12575 self.schedule_deadline_time = v.map(|x| x.into());
12576 self
12577 }
12578 }
12579
12580 impl wkt::message::Message for SqlScheduledMaintenance {
12581 fn typename() -> &'static str {
12582 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
12583 }
12584 }
12585
12586 /// This message wraps up the information written by out-of-disk detection job.
12587 #[derive(Clone, Default, PartialEq)]
12588 #[non_exhaustive]
12589 pub struct SqlOutOfDiskReport {
12590 /// This field represents the state generated by the proactive database
12591 /// wellness job for OutOfDisk issues.
12592 ///
12593 /// * Writers:
12594 /// * the proactive database wellness job for OOD.
12595 /// * Readers:
12596 /// * the proactive database wellness job
12597 pub sql_out_of_disk_state: std::option::Option<
12598 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12599 >,
12600
12601 /// The minimum recommended increase size in GigaBytes
12602 /// This field is consumed by the frontend
12603 ///
12604 /// * Writers:
12605 /// * the proactive database wellness job for OOD.
12606 /// * Readers:
12607 pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
12608
12609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12610 }
12611
12612 impl SqlOutOfDiskReport {
12613 /// Creates a new default instance.
12614 pub fn new() -> Self {
12615 std::default::Default::default()
12616 }
12617
12618 /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12619 ///
12620 /// # Example
12621 /// ```ignore,no_run
12622 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12623 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12624 /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
12625 /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
12626 /// ```
12627 pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
12628 where
12629 T: std::convert::Into<
12630 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12631 >,
12632 {
12633 self.sql_out_of_disk_state = std::option::Option::Some(v.into());
12634 self
12635 }
12636
12637 /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12638 ///
12639 /// # Example
12640 /// ```ignore,no_run
12641 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12642 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12643 /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
12644 /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
12645 /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
12646 /// ```
12647 pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
12648 where
12649 T: std::convert::Into<
12650 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12651 >,
12652 {
12653 self.sql_out_of_disk_state = v.map(|x| x.into());
12654 self
12655 }
12656
12657 /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12658 ///
12659 /// # Example
12660 /// ```ignore,no_run
12661 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12662 /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
12663 /// ```
12664 pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
12665 where
12666 T: std::convert::Into<i32>,
12667 {
12668 self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
12669 self
12670 }
12671
12672 /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12673 ///
12674 /// # Example
12675 /// ```ignore,no_run
12676 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12677 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
12678 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
12679 /// ```
12680 pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
12681 mut self,
12682 v: std::option::Option<T>,
12683 ) -> Self
12684 where
12685 T: std::convert::Into<i32>,
12686 {
12687 self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
12688 self
12689 }
12690 }
12691
12692 impl wkt::message::Message for SqlOutOfDiskReport {
12693 fn typename() -> &'static str {
12694 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
12695 }
12696 }
12697
12698 /// Defines additional types related to [SqlOutOfDiskReport].
12699 pub mod sql_out_of_disk_report {
12700 #[allow(unused_imports)]
12701 use super::*;
12702
12703 /// This enum lists all possible states regarding out-of-disk issues.
12704 ///
12705 /// # Working with unknown values
12706 ///
12707 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12708 /// additional enum variants at any time. Adding new variants is not considered
12709 /// a breaking change. Applications should write their code in anticipation of:
12710 ///
12711 /// - New values appearing in future releases of the client library, **and**
12712 /// - New values received dynamically, without application changes.
12713 ///
12714 /// Please consult the [Working with enums] section in the user guide for some
12715 /// guidelines.
12716 ///
12717 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12718 #[derive(Clone, Debug, PartialEq)]
12719 #[non_exhaustive]
12720 pub enum SqlOutOfDiskState {
12721 /// Unspecified state
12722 Unspecified,
12723 /// The instance has plenty space on data disk
12724 Normal,
12725 /// Data disk is almost used up. It is shutdown to prevent data
12726 /// corruption.
12727 SoftShutdown,
12728 /// If set, the enum was initialized with an unknown value.
12729 ///
12730 /// Applications can examine the value using [SqlOutOfDiskState::value] or
12731 /// [SqlOutOfDiskState::name].
12732 UnknownValue(sql_out_of_disk_state::UnknownValue),
12733 }
12734
12735 #[doc(hidden)]
12736 pub mod sql_out_of_disk_state {
12737 #[allow(unused_imports)]
12738 use super::*;
12739 #[derive(Clone, Debug, PartialEq)]
12740 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12741 }
12742
12743 impl SqlOutOfDiskState {
12744 /// Gets the enum value.
12745 ///
12746 /// Returns `None` if the enum contains an unknown value deserialized from
12747 /// the string representation of enums.
12748 pub fn value(&self) -> std::option::Option<i32> {
12749 match self {
12750 Self::Unspecified => std::option::Option::Some(0),
12751 Self::Normal => std::option::Option::Some(1),
12752 Self::SoftShutdown => std::option::Option::Some(2),
12753 Self::UnknownValue(u) => u.0.value(),
12754 }
12755 }
12756
12757 /// Gets the enum value as a string.
12758 ///
12759 /// Returns `None` if the enum contains an unknown value deserialized from
12760 /// the integer representation of enums.
12761 pub fn name(&self) -> std::option::Option<&str> {
12762 match self {
12763 Self::Unspecified => {
12764 std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
12765 }
12766 Self::Normal => std::option::Option::Some("NORMAL"),
12767 Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
12768 Self::UnknownValue(u) => u.0.name(),
12769 }
12770 }
12771 }
12772
12773 impl std::default::Default for SqlOutOfDiskState {
12774 fn default() -> Self {
12775 use std::convert::From;
12776 Self::from(0)
12777 }
12778 }
12779
12780 impl std::fmt::Display for SqlOutOfDiskState {
12781 fn fmt(
12782 &self,
12783 f: &mut std::fmt::Formatter<'_>,
12784 ) -> std::result::Result<(), std::fmt::Error> {
12785 wkt::internal::display_enum(f, self.name(), self.value())
12786 }
12787 }
12788
12789 impl std::convert::From<i32> for SqlOutOfDiskState {
12790 fn from(value: i32) -> Self {
12791 match value {
12792 0 => Self::Unspecified,
12793 1 => Self::Normal,
12794 2 => Self::SoftShutdown,
12795 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12796 wkt::internal::UnknownEnumValue::Integer(value),
12797 )),
12798 }
12799 }
12800 }
12801
12802 impl std::convert::From<&str> for SqlOutOfDiskState {
12803 fn from(value: &str) -> Self {
12804 use std::string::ToString;
12805 match value {
12806 "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
12807 "NORMAL" => Self::Normal,
12808 "SOFT_SHUTDOWN" => Self::SoftShutdown,
12809 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12810 wkt::internal::UnknownEnumValue::String(value.to_string()),
12811 )),
12812 }
12813 }
12814 }
12815
12816 impl serde::ser::Serialize for SqlOutOfDiskState {
12817 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12818 where
12819 S: serde::Serializer,
12820 {
12821 match self {
12822 Self::Unspecified => serializer.serialize_i32(0),
12823 Self::Normal => serializer.serialize_i32(1),
12824 Self::SoftShutdown => serializer.serialize_i32(2),
12825 Self::UnknownValue(u) => u.0.serialize(serializer),
12826 }
12827 }
12828 }
12829
12830 impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
12831 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12832 where
12833 D: serde::Deserializer<'de>,
12834 {
12835 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
12836 ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
12837 ))
12838 }
12839 }
12840 }
12841
12842 /// Details of a single read pool node of a read pool.
12843 #[derive(Clone, Default, PartialEq)]
12844 #[non_exhaustive]
12845 pub struct PoolNodeConfig {
12846 /// Output only. The name of the read pool node, to be used for retrieving
12847 /// metrics and logs.
12848 pub name: std::option::Option<std::string::String>,
12849
12850 /// Output only. The zone of the read pool node.
12851 pub gce_zone: std::option::Option<std::string::String>,
12852
12853 /// Output only. Mappings containing IP addresses that can be used to connect
12854 /// to the read pool node.
12855 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
12856
12857 /// Output only. The DNS name of the read pool node.
12858 pub dns_name: std::option::Option<std::string::String>,
12859
12860 /// Output only. The current state of the read pool node.
12861 pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
12862
12863 /// Output only. The list of DNS names used by this read pool node.
12864 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
12865
12866 /// Output only. The Private Service Connect (PSC) service attachment of the
12867 /// read pool node.
12868 pub psc_service_attachment_link: std::option::Option<std::string::String>,
12869
12870 /// Output only. The list of settings for requested automatically-setup
12871 /// Private Service Connect (PSC) consumer endpoints that can be used to
12872 /// connect to this read pool node.
12873 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
12874
12875 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12876 }
12877
12878 impl PoolNodeConfig {
12879 /// Creates a new default instance.
12880 pub fn new() -> Self {
12881 std::default::Default::default()
12882 }
12883
12884 /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12885 ///
12886 /// # Example
12887 /// ```ignore,no_run
12888 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12889 /// let x = PoolNodeConfig::new().set_name("example");
12890 /// ```
12891 pub fn set_name<T>(mut self, v: T) -> Self
12892 where
12893 T: std::convert::Into<std::string::String>,
12894 {
12895 self.name = std::option::Option::Some(v.into());
12896 self
12897 }
12898
12899 /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12900 ///
12901 /// # Example
12902 /// ```ignore,no_run
12903 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12904 /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
12905 /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
12906 /// ```
12907 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
12908 where
12909 T: std::convert::Into<std::string::String>,
12910 {
12911 self.name = v.map(|x| x.into());
12912 self
12913 }
12914
12915 /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12916 ///
12917 /// # Example
12918 /// ```ignore,no_run
12919 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12920 /// let x = PoolNodeConfig::new().set_gce_zone("example");
12921 /// ```
12922 pub fn set_gce_zone<T>(mut self, v: T) -> Self
12923 where
12924 T: std::convert::Into<std::string::String>,
12925 {
12926 self.gce_zone = std::option::Option::Some(v.into());
12927 self
12928 }
12929
12930 /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12931 ///
12932 /// # Example
12933 /// ```ignore,no_run
12934 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12935 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
12936 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
12937 /// ```
12938 pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
12939 where
12940 T: std::convert::Into<std::string::String>,
12941 {
12942 self.gce_zone = v.map(|x| x.into());
12943 self
12944 }
12945
12946 /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
12947 ///
12948 /// # Example
12949 /// ```ignore,no_run
12950 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12951 /// use google_cloud_sql_v1::model::IpMapping;
12952 /// let x = PoolNodeConfig::new()
12953 /// .set_ip_addresses([
12954 /// IpMapping::default()/* use setters */,
12955 /// IpMapping::default()/* use (different) setters */,
12956 /// ]);
12957 /// ```
12958 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12959 where
12960 T: std::iter::IntoIterator<Item = V>,
12961 V: std::convert::Into<crate::model::IpMapping>,
12962 {
12963 use std::iter::Iterator;
12964 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
12965 self
12966 }
12967
12968 /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12969 ///
12970 /// # Example
12971 /// ```ignore,no_run
12972 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12973 /// let x = PoolNodeConfig::new().set_dns_name("example");
12974 /// ```
12975 pub fn set_dns_name<T>(mut self, v: T) -> Self
12976 where
12977 T: std::convert::Into<std::string::String>,
12978 {
12979 self.dns_name = std::option::Option::Some(v.into());
12980 self
12981 }
12982
12983 /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12984 ///
12985 /// # Example
12986 /// ```ignore,no_run
12987 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12988 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
12989 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
12990 /// ```
12991 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12992 where
12993 T: std::convert::Into<std::string::String>,
12994 {
12995 self.dns_name = v.map(|x| x.into());
12996 self
12997 }
12998
12999 /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
13000 ///
13001 /// # Example
13002 /// ```ignore,no_run
13003 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13004 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
13005 /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
13006 /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
13007 /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
13008 /// ```
13009 pub fn set_state<T>(mut self, v: T) -> Self
13010 where
13011 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
13012 {
13013 self.state = std::option::Option::Some(v.into());
13014 self
13015 }
13016
13017 /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
13018 ///
13019 /// # Example
13020 /// ```ignore,no_run
13021 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13022 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
13023 /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
13024 /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
13025 /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
13026 /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
13027 /// ```
13028 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
13029 where
13030 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
13031 {
13032 self.state = v.map(|x| x.into());
13033 self
13034 }
13035
13036 /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
13037 ///
13038 /// # Example
13039 /// ```ignore,no_run
13040 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13041 /// use google_cloud_sql_v1::model::DnsNameMapping;
13042 /// let x = PoolNodeConfig::new()
13043 /// .set_dns_names([
13044 /// DnsNameMapping::default()/* use setters */,
13045 /// DnsNameMapping::default()/* use (different) setters */,
13046 /// ]);
13047 /// ```
13048 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
13049 where
13050 T: std::iter::IntoIterator<Item = V>,
13051 V: std::convert::Into<crate::model::DnsNameMapping>,
13052 {
13053 use std::iter::Iterator;
13054 self.dns_names = v.into_iter().map(|i| i.into()).collect();
13055 self
13056 }
13057
13058 /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
13059 ///
13060 /// # Example
13061 /// ```ignore,no_run
13062 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13063 /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
13064 /// ```
13065 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
13066 where
13067 T: std::convert::Into<std::string::String>,
13068 {
13069 self.psc_service_attachment_link = std::option::Option::Some(v.into());
13070 self
13071 }
13072
13073 /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
13074 ///
13075 /// # Example
13076 /// ```ignore,no_run
13077 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13078 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
13079 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
13080 /// ```
13081 pub fn set_or_clear_psc_service_attachment_link<T>(
13082 mut self,
13083 v: std::option::Option<T>,
13084 ) -> Self
13085 where
13086 T: std::convert::Into<std::string::String>,
13087 {
13088 self.psc_service_attachment_link = v.map(|x| x.into());
13089 self
13090 }
13091
13092 /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
13093 ///
13094 /// # Example
13095 /// ```ignore,no_run
13096 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13097 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
13098 /// let x = PoolNodeConfig::new()
13099 /// .set_psc_auto_connections([
13100 /// PscAutoConnectionConfig::default()/* use setters */,
13101 /// PscAutoConnectionConfig::default()/* use (different) setters */,
13102 /// ]);
13103 /// ```
13104 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
13105 where
13106 T: std::iter::IntoIterator<Item = V>,
13107 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
13108 {
13109 use std::iter::Iterator;
13110 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
13111 self
13112 }
13113 }
13114
13115 impl wkt::message::Message for PoolNodeConfig {
13116 fn typename() -> &'static str {
13117 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
13118 }
13119 }
13120
13121 /// The current serving state of the database instance.
13122 ///
13123 /// # Working with unknown values
13124 ///
13125 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13126 /// additional enum variants at any time. Adding new variants is not considered
13127 /// a breaking change. Applications should write their code in anticipation of:
13128 ///
13129 /// - New values appearing in future releases of the client library, **and**
13130 /// - New values received dynamically, without application changes.
13131 ///
13132 /// Please consult the [Working with enums] section in the user guide for some
13133 /// guidelines.
13134 ///
13135 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13136 #[derive(Clone, Debug, PartialEq)]
13137 #[non_exhaustive]
13138 pub enum SqlInstanceState {
13139 /// The state of the instance is unknown.
13140 Unspecified,
13141 /// The instance is running, or has been stopped by owner.
13142 Runnable,
13143 /// The instance is not available, for example due to problems with billing.
13144 Suspended,
13145 /// The instance is being deleted.
13146 PendingDelete,
13147 /// The instance is being created.
13148 PendingCreate,
13149 /// The instance is down for maintenance.
13150 Maintenance,
13151 /// The creation of the instance failed or a fatal error occurred during
13152 /// maintenance.
13153 Failed,
13154 /// Deprecated
13155 #[deprecated]
13156 OnlineMaintenance,
13157 /// (Applicable to read pool nodes only.) The read pool node needs to be
13158 /// repaired. The database might be unavailable.
13159 Repairing,
13160 /// If set, the enum was initialized with an unknown value.
13161 ///
13162 /// Applications can examine the value using [SqlInstanceState::value] or
13163 /// [SqlInstanceState::name].
13164 UnknownValue(sql_instance_state::UnknownValue),
13165 }
13166
13167 #[doc(hidden)]
13168 pub mod sql_instance_state {
13169 #[allow(unused_imports)]
13170 use super::*;
13171 #[derive(Clone, Debug, PartialEq)]
13172 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13173 }
13174
13175 impl SqlInstanceState {
13176 /// Gets the enum value.
13177 ///
13178 /// Returns `None` if the enum contains an unknown value deserialized from
13179 /// the string representation of enums.
13180 pub fn value(&self) -> std::option::Option<i32> {
13181 match self {
13182 Self::Unspecified => std::option::Option::Some(0),
13183 Self::Runnable => std::option::Option::Some(1),
13184 Self::Suspended => std::option::Option::Some(2),
13185 Self::PendingDelete => std::option::Option::Some(3),
13186 Self::PendingCreate => std::option::Option::Some(4),
13187 Self::Maintenance => std::option::Option::Some(5),
13188 Self::Failed => std::option::Option::Some(6),
13189 Self::OnlineMaintenance => std::option::Option::Some(7),
13190 Self::Repairing => std::option::Option::Some(8),
13191 Self::UnknownValue(u) => u.0.value(),
13192 }
13193 }
13194
13195 /// Gets the enum value as a string.
13196 ///
13197 /// Returns `None` if the enum contains an unknown value deserialized from
13198 /// the integer representation of enums.
13199 pub fn name(&self) -> std::option::Option<&str> {
13200 match self {
13201 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
13202 Self::Runnable => std::option::Option::Some("RUNNABLE"),
13203 Self::Suspended => std::option::Option::Some("SUSPENDED"),
13204 Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
13205 Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
13206 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
13207 Self::Failed => std::option::Option::Some("FAILED"),
13208 Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
13209 Self::Repairing => std::option::Option::Some("REPAIRING"),
13210 Self::UnknownValue(u) => u.0.name(),
13211 }
13212 }
13213 }
13214
13215 impl std::default::Default for SqlInstanceState {
13216 fn default() -> Self {
13217 use std::convert::From;
13218 Self::from(0)
13219 }
13220 }
13221
13222 impl std::fmt::Display for SqlInstanceState {
13223 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13224 wkt::internal::display_enum(f, self.name(), self.value())
13225 }
13226 }
13227
13228 impl std::convert::From<i32> for SqlInstanceState {
13229 fn from(value: i32) -> Self {
13230 match value {
13231 0 => Self::Unspecified,
13232 1 => Self::Runnable,
13233 2 => Self::Suspended,
13234 3 => Self::PendingDelete,
13235 4 => Self::PendingCreate,
13236 5 => Self::Maintenance,
13237 6 => Self::Failed,
13238 7 => Self::OnlineMaintenance,
13239 8 => Self::Repairing,
13240 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13241 wkt::internal::UnknownEnumValue::Integer(value),
13242 )),
13243 }
13244 }
13245 }
13246
13247 impl std::convert::From<&str> for SqlInstanceState {
13248 fn from(value: &str) -> Self {
13249 use std::string::ToString;
13250 match value {
13251 "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
13252 "RUNNABLE" => Self::Runnable,
13253 "SUSPENDED" => Self::Suspended,
13254 "PENDING_DELETE" => Self::PendingDelete,
13255 "PENDING_CREATE" => Self::PendingCreate,
13256 "MAINTENANCE" => Self::Maintenance,
13257 "FAILED" => Self::Failed,
13258 "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
13259 "REPAIRING" => Self::Repairing,
13260 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13261 wkt::internal::UnknownEnumValue::String(value.to_string()),
13262 )),
13263 }
13264 }
13265 }
13266
13267 impl serde::ser::Serialize for SqlInstanceState {
13268 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13269 where
13270 S: serde::Serializer,
13271 {
13272 match self {
13273 Self::Unspecified => serializer.serialize_i32(0),
13274 Self::Runnable => serializer.serialize_i32(1),
13275 Self::Suspended => serializer.serialize_i32(2),
13276 Self::PendingDelete => serializer.serialize_i32(3),
13277 Self::PendingCreate => serializer.serialize_i32(4),
13278 Self::Maintenance => serializer.serialize_i32(5),
13279 Self::Failed => serializer.serialize_i32(6),
13280 Self::OnlineMaintenance => serializer.serialize_i32(7),
13281 Self::Repairing => serializer.serialize_i32(8),
13282 Self::UnknownValue(u) => u.0.serialize(serializer),
13283 }
13284 }
13285 }
13286
13287 impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
13288 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13289 where
13290 D: serde::Deserializer<'de>,
13291 {
13292 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
13293 ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
13294 ))
13295 }
13296 }
13297
13298 /// The SQL network architecture for the instance.
13299 ///
13300 /// # Working with unknown values
13301 ///
13302 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13303 /// additional enum variants at any time. Adding new variants is not considered
13304 /// a breaking change. Applications should write their code in anticipation of:
13305 ///
13306 /// - New values appearing in future releases of the client library, **and**
13307 /// - New values received dynamically, without application changes.
13308 ///
13309 /// Please consult the [Working with enums] section in the user guide for some
13310 /// guidelines.
13311 ///
13312 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13313 #[derive(Clone, Debug, PartialEq)]
13314 #[non_exhaustive]
13315 pub enum SqlNetworkArchitecture {
13316 #[allow(missing_docs)]
13317 Unspecified,
13318 /// The instance uses the new network architecture.
13319 NewNetworkArchitecture,
13320 /// The instance uses the old network architecture.
13321 OldNetworkArchitecture,
13322 /// If set, the enum was initialized with an unknown value.
13323 ///
13324 /// Applications can examine the value using [SqlNetworkArchitecture::value] or
13325 /// [SqlNetworkArchitecture::name].
13326 UnknownValue(sql_network_architecture::UnknownValue),
13327 }
13328
13329 #[doc(hidden)]
13330 pub mod sql_network_architecture {
13331 #[allow(unused_imports)]
13332 use super::*;
13333 #[derive(Clone, Debug, PartialEq)]
13334 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13335 }
13336
13337 impl SqlNetworkArchitecture {
13338 /// Gets the enum value.
13339 ///
13340 /// Returns `None` if the enum contains an unknown value deserialized from
13341 /// the string representation of enums.
13342 pub fn value(&self) -> std::option::Option<i32> {
13343 match self {
13344 Self::Unspecified => std::option::Option::Some(0),
13345 Self::NewNetworkArchitecture => std::option::Option::Some(1),
13346 Self::OldNetworkArchitecture => std::option::Option::Some(2),
13347 Self::UnknownValue(u) => u.0.value(),
13348 }
13349 }
13350
13351 /// Gets the enum value as a string.
13352 ///
13353 /// Returns `None` if the enum contains an unknown value deserialized from
13354 /// the integer representation of enums.
13355 pub fn name(&self) -> std::option::Option<&str> {
13356 match self {
13357 Self::Unspecified => {
13358 std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
13359 }
13360 Self::NewNetworkArchitecture => {
13361 std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
13362 }
13363 Self::OldNetworkArchitecture => {
13364 std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
13365 }
13366 Self::UnknownValue(u) => u.0.name(),
13367 }
13368 }
13369 }
13370
13371 impl std::default::Default for SqlNetworkArchitecture {
13372 fn default() -> Self {
13373 use std::convert::From;
13374 Self::from(0)
13375 }
13376 }
13377
13378 impl std::fmt::Display for SqlNetworkArchitecture {
13379 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13380 wkt::internal::display_enum(f, self.name(), self.value())
13381 }
13382 }
13383
13384 impl std::convert::From<i32> for SqlNetworkArchitecture {
13385 fn from(value: i32) -> Self {
13386 match value {
13387 0 => Self::Unspecified,
13388 1 => Self::NewNetworkArchitecture,
13389 2 => Self::OldNetworkArchitecture,
13390 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13391 wkt::internal::UnknownEnumValue::Integer(value),
13392 )),
13393 }
13394 }
13395 }
13396
13397 impl std::convert::From<&str> for SqlNetworkArchitecture {
13398 fn from(value: &str) -> Self {
13399 use std::string::ToString;
13400 match value {
13401 "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
13402 "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
13403 "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
13404 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13405 wkt::internal::UnknownEnumValue::String(value.to_string()),
13406 )),
13407 }
13408 }
13409 }
13410
13411 impl serde::ser::Serialize for SqlNetworkArchitecture {
13412 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13413 where
13414 S: serde::Serializer,
13415 {
13416 match self {
13417 Self::Unspecified => serializer.serialize_i32(0),
13418 Self::NewNetworkArchitecture => serializer.serialize_i32(1),
13419 Self::OldNetworkArchitecture => serializer.serialize_i32(2),
13420 Self::UnknownValue(u) => u.0.serialize(serializer),
13421 }
13422 }
13423 }
13424
13425 impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
13426 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13427 where
13428 D: serde::Deserializer<'de>,
13429 {
13430 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
13431 ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
13432 ))
13433 }
13434 }
13435}
13436
13437/// Gemini instance configuration.
13438#[derive(Clone, Default, PartialEq)]
13439#[non_exhaustive]
13440pub struct GeminiInstanceConfig {
13441 /// Output only. Whether Gemini is enabled.
13442 pub entitled: std::option::Option<bool>,
13443
13444 /// Output only. Whether the vacuum management is enabled.
13445 pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
13446
13447 /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
13448 pub oom_session_cancel_enabled: std::option::Option<bool>,
13449
13450 /// Output only. Whether the active query is enabled.
13451 pub active_query_enabled: std::option::Option<bool>,
13452
13453 /// Output only. Whether the index advisor is enabled.
13454 pub index_advisor_enabled: std::option::Option<bool>,
13455
13456 /// Output only. Whether the flag recommender is enabled.
13457 pub flag_recommender_enabled: std::option::Option<bool>,
13458
13459 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13460}
13461
13462impl GeminiInstanceConfig {
13463 /// Creates a new default instance.
13464 pub fn new() -> Self {
13465 std::default::Default::default()
13466 }
13467
13468 /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13469 ///
13470 /// # Example
13471 /// ```ignore,no_run
13472 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13473 /// let x = GeminiInstanceConfig::new().set_entitled(true);
13474 /// ```
13475 pub fn set_entitled<T>(mut self, v: T) -> Self
13476 where
13477 T: std::convert::Into<bool>,
13478 {
13479 self.entitled = std::option::Option::Some(v.into());
13480 self
13481 }
13482
13483 /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13484 ///
13485 /// # Example
13486 /// ```ignore,no_run
13487 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13488 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
13489 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
13490 /// ```
13491 pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
13492 where
13493 T: std::convert::Into<bool>,
13494 {
13495 self.entitled = v.map(|x| x.into());
13496 self
13497 }
13498
13499 /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13500 ///
13501 /// # Example
13502 /// ```ignore,no_run
13503 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13504 /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
13505 /// ```
13506 pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
13507 where
13508 T: std::convert::Into<bool>,
13509 {
13510 self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
13511 self
13512 }
13513
13514 /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13515 ///
13516 /// # Example
13517 /// ```ignore,no_run
13518 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13519 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
13520 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
13521 /// ```
13522 pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13523 where
13524 T: std::convert::Into<bool>,
13525 {
13526 self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
13527 self
13528 }
13529
13530 /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13531 ///
13532 /// # Example
13533 /// ```ignore,no_run
13534 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13535 /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
13536 /// ```
13537 pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
13538 where
13539 T: std::convert::Into<bool>,
13540 {
13541 self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
13542 self
13543 }
13544
13545 /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13546 ///
13547 /// # Example
13548 /// ```ignore,no_run
13549 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13550 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
13551 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
13552 /// ```
13553 pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13554 where
13555 T: std::convert::Into<bool>,
13556 {
13557 self.oom_session_cancel_enabled = v.map(|x| x.into());
13558 self
13559 }
13560
13561 /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13562 ///
13563 /// # Example
13564 /// ```ignore,no_run
13565 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13566 /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
13567 /// ```
13568 pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
13569 where
13570 T: std::convert::Into<bool>,
13571 {
13572 self.active_query_enabled = std::option::Option::Some(v.into());
13573 self
13574 }
13575
13576 /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13577 ///
13578 /// # Example
13579 /// ```ignore,no_run
13580 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13581 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
13582 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
13583 /// ```
13584 pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13585 where
13586 T: std::convert::Into<bool>,
13587 {
13588 self.active_query_enabled = v.map(|x| x.into());
13589 self
13590 }
13591
13592 /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13593 ///
13594 /// # Example
13595 /// ```ignore,no_run
13596 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13597 /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
13598 /// ```
13599 pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
13600 where
13601 T: std::convert::Into<bool>,
13602 {
13603 self.index_advisor_enabled = std::option::Option::Some(v.into());
13604 self
13605 }
13606
13607 /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13608 ///
13609 /// # Example
13610 /// ```ignore,no_run
13611 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13612 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
13613 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
13614 /// ```
13615 pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13616 where
13617 T: std::convert::Into<bool>,
13618 {
13619 self.index_advisor_enabled = v.map(|x| x.into());
13620 self
13621 }
13622
13623 /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13624 ///
13625 /// # Example
13626 /// ```ignore,no_run
13627 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13628 /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
13629 /// ```
13630 pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
13631 where
13632 T: std::convert::Into<bool>,
13633 {
13634 self.flag_recommender_enabled = std::option::Option::Some(v.into());
13635 self
13636 }
13637
13638 /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13639 ///
13640 /// # Example
13641 /// ```ignore,no_run
13642 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13643 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
13644 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
13645 /// ```
13646 pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13647 where
13648 T: std::convert::Into<bool>,
13649 {
13650 self.flag_recommender_enabled = v.map(|x| x.into());
13651 self
13652 }
13653}
13654
13655impl wkt::message::Message for GeminiInstanceConfig {
13656 fn typename() -> &'static str {
13657 "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
13658 }
13659}
13660
13661/// A primary instance and disaster recovery (DR) replica pair.
13662/// A DR replica is a cross-region replica that you designate for failover in
13663/// the event that the primary instance experiences regional failure.
13664/// Applicable to MySQL and PostgreSQL.
13665#[derive(Clone, Default, PartialEq)]
13666#[non_exhaustive]
13667pub struct ReplicationCluster {
13668 /// Output only. If set, this field indicates this instance has a private
13669 /// service access (PSA) DNS endpoint that is pointing to the primary instance
13670 /// of the cluster. If this instance is the primary, then the DNS endpoint
13671 /// points to this instance. After a switchover or replica failover operation,
13672 /// this DNS endpoint points to the promoted instance. This is a read-only
13673 /// field, returned to the user as information. This field can exist even if a
13674 /// standalone instance doesn't have a DR replica yet or the DR replica is
13675 /// deleted.
13676 pub psa_write_endpoint: std::string::String,
13677
13678 /// Optional. If the instance is a primary instance, then this field identifies
13679 /// the disaster recovery (DR) replica. A DR replica is an optional
13680 /// configuration for Enterprise Plus edition instances. If the instance is a
13681 /// read replica, then the field is not set. Set this field to a replica name
13682 /// to designate a DR replica for a primary instance. Remove the replica name
13683 /// to remove the DR replica designation.
13684 pub failover_dr_replica_name: std::string::String,
13685
13686 /// Output only. Read-only field that indicates whether the replica is a DR
13687 /// replica. This field is not set if the instance is a primary instance.
13688 pub dr_replica: bool,
13689
13690 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13691}
13692
13693impl ReplicationCluster {
13694 /// Creates a new default instance.
13695 pub fn new() -> Self {
13696 std::default::Default::default()
13697 }
13698
13699 /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
13700 ///
13701 /// # Example
13702 /// ```ignore,no_run
13703 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13704 /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
13705 /// ```
13706 pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
13707 mut self,
13708 v: T,
13709 ) -> Self {
13710 self.psa_write_endpoint = v.into();
13711 self
13712 }
13713
13714 /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
13715 ///
13716 /// # Example
13717 /// ```ignore,no_run
13718 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13719 /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
13720 /// ```
13721 pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
13722 mut self,
13723 v: T,
13724 ) -> Self {
13725 self.failover_dr_replica_name = v.into();
13726 self
13727 }
13728
13729 /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
13730 ///
13731 /// # Example
13732 /// ```ignore,no_run
13733 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13734 /// let x = ReplicationCluster::new().set_dr_replica(true);
13735 /// ```
13736 pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13737 self.dr_replica = v.into();
13738 self
13739 }
13740}
13741
13742impl wkt::message::Message for ReplicationCluster {
13743 fn typename() -> &'static str {
13744 "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
13745 }
13746}
13747
13748/// An available database version. It can be a major or a minor version.
13749#[derive(Clone, Default, PartialEq)]
13750#[non_exhaustive]
13751pub struct AvailableDatabaseVersion {
13752 /// The version's major version name.
13753 pub major_version: std::option::Option<std::string::String>,
13754
13755 /// The database version name. For MySQL 8.0, this string provides the database
13756 /// major and minor version.
13757 pub name: std::option::Option<std::string::String>,
13758
13759 /// The database version's display name.
13760 pub display_name: std::option::Option<std::string::String>,
13761
13762 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13763}
13764
13765impl AvailableDatabaseVersion {
13766 /// Creates a new default instance.
13767 pub fn new() -> Self {
13768 std::default::Default::default()
13769 }
13770
13771 /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13772 ///
13773 /// # Example
13774 /// ```ignore,no_run
13775 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13776 /// let x = AvailableDatabaseVersion::new().set_major_version("example");
13777 /// ```
13778 pub fn set_major_version<T>(mut self, v: T) -> Self
13779 where
13780 T: std::convert::Into<std::string::String>,
13781 {
13782 self.major_version = std::option::Option::Some(v.into());
13783 self
13784 }
13785
13786 /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13787 ///
13788 /// # Example
13789 /// ```ignore,no_run
13790 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13791 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
13792 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
13793 /// ```
13794 pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
13795 where
13796 T: std::convert::Into<std::string::String>,
13797 {
13798 self.major_version = v.map(|x| x.into());
13799 self
13800 }
13801
13802 /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
13803 ///
13804 /// # Example
13805 /// ```ignore,no_run
13806 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13807 /// let x = AvailableDatabaseVersion::new().set_name("example");
13808 /// ```
13809 pub fn set_name<T>(mut self, v: T) -> Self
13810 where
13811 T: std::convert::Into<std::string::String>,
13812 {
13813 self.name = std::option::Option::Some(v.into());
13814 self
13815 }
13816
13817 /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
13818 ///
13819 /// # Example
13820 /// ```ignore,no_run
13821 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13822 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
13823 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
13824 /// ```
13825 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13826 where
13827 T: std::convert::Into<std::string::String>,
13828 {
13829 self.name = v.map(|x| x.into());
13830 self
13831 }
13832
13833 /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13834 ///
13835 /// # Example
13836 /// ```ignore,no_run
13837 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13838 /// let x = AvailableDatabaseVersion::new().set_display_name("example");
13839 /// ```
13840 pub fn set_display_name<T>(mut self, v: T) -> Self
13841 where
13842 T: std::convert::Into<std::string::String>,
13843 {
13844 self.display_name = std::option::Option::Some(v.into());
13845 self
13846 }
13847
13848 /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13849 ///
13850 /// # Example
13851 /// ```ignore,no_run
13852 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13853 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
13854 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
13855 /// ```
13856 pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
13857 where
13858 T: std::convert::Into<std::string::String>,
13859 {
13860 self.display_name = v.map(|x| x.into());
13861 self
13862 }
13863}
13864
13865impl wkt::message::Message for AvailableDatabaseVersion {
13866 fn typename() -> &'static str {
13867 "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
13868 }
13869}
13870
13871/// Reschedule options for maintenance windows.
13872#[derive(Clone, Default, PartialEq)]
13873#[non_exhaustive]
13874pub struct SqlInstancesRescheduleMaintenanceRequestBody {
13875 /// Required. The type of the reschedule the user wants.
13876 pub reschedule: std::option::Option<
13877 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13878 >,
13879
13880 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13881}
13882
13883impl SqlInstancesRescheduleMaintenanceRequestBody {
13884 /// Creates a new default instance.
13885 pub fn new() -> Self {
13886 std::default::Default::default()
13887 }
13888
13889 /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13890 ///
13891 /// # Example
13892 /// ```ignore,no_run
13893 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13894 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13895 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
13896 /// ```
13897 pub fn set_reschedule<T>(mut self, v: T) -> Self
13898 where
13899 T: std::convert::Into<
13900 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13901 >,
13902 {
13903 self.reschedule = std::option::Option::Some(v.into());
13904 self
13905 }
13906
13907 /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13908 ///
13909 /// # Example
13910 /// ```ignore,no_run
13911 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13912 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13913 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
13914 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
13915 /// ```
13916 pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
13917 where
13918 T: std::convert::Into<
13919 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13920 >,
13921 {
13922 self.reschedule = v.map(|x| x.into());
13923 self
13924 }
13925}
13926
13927impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
13928 fn typename() -> &'static str {
13929 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
13930 }
13931}
13932
13933/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
13934pub mod sql_instances_reschedule_maintenance_request_body {
13935 #[allow(unused_imports)]
13936 use super::*;
13937
13938 #[allow(missing_docs)]
13939 #[derive(Clone, Default, PartialEq)]
13940 #[non_exhaustive]
13941 pub struct Reschedule {
13942 /// Required. The type of the reschedule.
13943 pub reschedule_type:
13944 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13945
13946 /// Optional. Timestamp when the maintenance shall be rescheduled to if
13947 /// reschedule_type=SPECIFIC_TIME, in
13948 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
13949 /// `2012-11-15T16:19:00.094Z`.
13950 pub schedule_time: std::option::Option<wkt::Timestamp>,
13951
13952 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13953 }
13954
13955 impl Reschedule {
13956 /// Creates a new default instance.
13957 pub fn new() -> Self {
13958 std::default::Default::default()
13959 }
13960
13961 /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
13962 ///
13963 /// # Example
13964 /// ```ignore,no_run
13965 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13966 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
13967 /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
13968 /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
13969 /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
13970 /// ```
13971 pub fn set_reschedule_type<
13972 T: std::convert::Into<
13973 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13974 >,
13975 >(
13976 mut self,
13977 v: T,
13978 ) -> Self {
13979 self.reschedule_type = v.into();
13980 self
13981 }
13982
13983 /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13984 ///
13985 /// # Example
13986 /// ```ignore,no_run
13987 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13988 /// use wkt::Timestamp;
13989 /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
13990 /// ```
13991 pub fn set_schedule_time<T>(mut self, v: T) -> Self
13992 where
13993 T: std::convert::Into<wkt::Timestamp>,
13994 {
13995 self.schedule_time = std::option::Option::Some(v.into());
13996 self
13997 }
13998
13999 /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
14000 ///
14001 /// # Example
14002 /// ```ignore,no_run
14003 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14004 /// use wkt::Timestamp;
14005 /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
14006 /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
14007 /// ```
14008 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
14009 where
14010 T: std::convert::Into<wkt::Timestamp>,
14011 {
14012 self.schedule_time = v.map(|x| x.into());
14013 self
14014 }
14015 }
14016
14017 impl wkt::message::Message for Reschedule {
14018 fn typename() -> &'static str {
14019 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
14020 }
14021 }
14022
14023 /// Enum for [RescheduleType].
14024 ///
14025 /// # Working with unknown values
14026 ///
14027 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14028 /// additional enum variants at any time. Adding new variants is not considered
14029 /// a breaking change. Applications should write their code in anticipation of:
14030 ///
14031 /// - New values appearing in future releases of the client library, **and**
14032 /// - New values received dynamically, without application changes.
14033 ///
14034 /// Please consult the [Working with enums] section in the user guide for some
14035 /// guidelines.
14036 ///
14037 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14038 #[derive(Clone, Debug, PartialEq)]
14039 #[non_exhaustive]
14040 pub enum RescheduleType {
14041 #[allow(missing_docs)]
14042 Unspecified,
14043 /// Reschedules maintenance to happen now (within 5 minutes).
14044 Immediate,
14045 /// Reschedules maintenance to occur within one week from the originally
14046 /// scheduled day and time.
14047 NextAvailableWindow,
14048 /// Reschedules maintenance to a specific time and day.
14049 SpecificTime,
14050 /// If set, the enum was initialized with an unknown value.
14051 ///
14052 /// Applications can examine the value using [RescheduleType::value] or
14053 /// [RescheduleType::name].
14054 UnknownValue(reschedule_type::UnknownValue),
14055 }
14056
14057 #[doc(hidden)]
14058 pub mod reschedule_type {
14059 #[allow(unused_imports)]
14060 use super::*;
14061 #[derive(Clone, Debug, PartialEq)]
14062 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14063 }
14064
14065 impl RescheduleType {
14066 /// Gets the enum value.
14067 ///
14068 /// Returns `None` if the enum contains an unknown value deserialized from
14069 /// the string representation of enums.
14070 pub fn value(&self) -> std::option::Option<i32> {
14071 match self {
14072 Self::Unspecified => std::option::Option::Some(0),
14073 Self::Immediate => std::option::Option::Some(1),
14074 Self::NextAvailableWindow => std::option::Option::Some(2),
14075 Self::SpecificTime => std::option::Option::Some(3),
14076 Self::UnknownValue(u) => u.0.value(),
14077 }
14078 }
14079
14080 /// Gets the enum value as a string.
14081 ///
14082 /// Returns `None` if the enum contains an unknown value deserialized from
14083 /// the integer representation of enums.
14084 pub fn name(&self) -> std::option::Option<&str> {
14085 match self {
14086 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
14087 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
14088 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
14089 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
14090 Self::UnknownValue(u) => u.0.name(),
14091 }
14092 }
14093 }
14094
14095 impl std::default::Default for RescheduleType {
14096 fn default() -> Self {
14097 use std::convert::From;
14098 Self::from(0)
14099 }
14100 }
14101
14102 impl std::fmt::Display for RescheduleType {
14103 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14104 wkt::internal::display_enum(f, self.name(), self.value())
14105 }
14106 }
14107
14108 impl std::convert::From<i32> for RescheduleType {
14109 fn from(value: i32) -> Self {
14110 match value {
14111 0 => Self::Unspecified,
14112 1 => Self::Immediate,
14113 2 => Self::NextAvailableWindow,
14114 3 => Self::SpecificTime,
14115 _ => Self::UnknownValue(reschedule_type::UnknownValue(
14116 wkt::internal::UnknownEnumValue::Integer(value),
14117 )),
14118 }
14119 }
14120 }
14121
14122 impl std::convert::From<&str> for RescheduleType {
14123 fn from(value: &str) -> Self {
14124 use std::string::ToString;
14125 match value {
14126 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
14127 "IMMEDIATE" => Self::Immediate,
14128 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
14129 "SPECIFIC_TIME" => Self::SpecificTime,
14130 _ => Self::UnknownValue(reschedule_type::UnknownValue(
14131 wkt::internal::UnknownEnumValue::String(value.to_string()),
14132 )),
14133 }
14134 }
14135 }
14136
14137 impl serde::ser::Serialize for RescheduleType {
14138 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14139 where
14140 S: serde::Serializer,
14141 {
14142 match self {
14143 Self::Unspecified => serializer.serialize_i32(0),
14144 Self::Immediate => serializer.serialize_i32(1),
14145 Self::NextAvailableWindow => serializer.serialize_i32(2),
14146 Self::SpecificTime => serializer.serialize_i32(3),
14147 Self::UnknownValue(u) => u.0.serialize(serializer),
14148 }
14149 }
14150 }
14151
14152 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
14153 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14154 where
14155 D: serde::Deserializer<'de>,
14156 {
14157 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
14158 ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
14159 ))
14160 }
14161 }
14162}
14163
14164/// Database instance demote primary instance context.
14165#[derive(Clone, Default, PartialEq)]
14166#[non_exhaustive]
14167pub struct DemoteMasterContext {
14168 /// This is always `sql#demoteMasterContext`.
14169 pub kind: std::string::String,
14170
14171 /// Verify the GTID consistency for demote operation. Default value:
14172 /// `True`. Setting this flag to `false` enables you to bypass the GTID
14173 /// consistency check between on-premises primary instance and Cloud SQL
14174 /// instance during the demotion operation but also exposes you to the risk of
14175 /// future replication failures. Change the value only if you know the reason
14176 /// for the GTID divergence and are confident that doing so will not cause any
14177 /// replication issues.
14178 pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
14179
14180 /// The name of the instance which will act as on-premises primary instance
14181 /// in the replication setup.
14182 pub master_instance_name: std::string::String,
14183
14184 /// Configuration specific to read-replicas replicating from the on-premises
14185 /// primary instance.
14186 pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
14187
14188 /// Flag to skip replication setup on the instance.
14189 pub skip_replication_setup: bool,
14190
14191 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14192}
14193
14194impl DemoteMasterContext {
14195 /// Creates a new default instance.
14196 pub fn new() -> Self {
14197 std::default::Default::default()
14198 }
14199
14200 /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
14201 ///
14202 /// # Example
14203 /// ```ignore,no_run
14204 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14205 /// let x = DemoteMasterContext::new().set_kind("example");
14206 /// ```
14207 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14208 self.kind = v.into();
14209 self
14210 }
14211
14212 /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
14213 ///
14214 /// # Example
14215 /// ```ignore,no_run
14216 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14217 /// use wkt::BoolValue;
14218 /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
14219 /// ```
14220 pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
14221 where
14222 T: std::convert::Into<wkt::BoolValue>,
14223 {
14224 self.verify_gtid_consistency = std::option::Option::Some(v.into());
14225 self
14226 }
14227
14228 /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
14229 ///
14230 /// # Example
14231 /// ```ignore,no_run
14232 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14233 /// use wkt::BoolValue;
14234 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
14235 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
14236 /// ```
14237 pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
14238 where
14239 T: std::convert::Into<wkt::BoolValue>,
14240 {
14241 self.verify_gtid_consistency = v.map(|x| x.into());
14242 self
14243 }
14244
14245 /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
14246 ///
14247 /// # Example
14248 /// ```ignore,no_run
14249 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14250 /// let x = DemoteMasterContext::new().set_master_instance_name("example");
14251 /// ```
14252 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
14253 mut self,
14254 v: T,
14255 ) -> Self {
14256 self.master_instance_name = v.into();
14257 self
14258 }
14259
14260 /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14261 ///
14262 /// # Example
14263 /// ```ignore,no_run
14264 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14265 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14266 /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
14267 /// ```
14268 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
14269 where
14270 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14271 {
14272 self.replica_configuration = std::option::Option::Some(v.into());
14273 self
14274 }
14275
14276 /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
14277 ///
14278 /// # Example
14279 /// ```ignore,no_run
14280 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14281 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
14282 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
14283 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
14284 /// ```
14285 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
14286 where
14287 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
14288 {
14289 self.replica_configuration = v.map(|x| x.into());
14290 self
14291 }
14292
14293 /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
14294 ///
14295 /// # Example
14296 /// ```ignore,no_run
14297 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
14298 /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
14299 /// ```
14300 pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14301 self.skip_replication_setup = v.into();
14302 self
14303 }
14304}
14305
14306impl wkt::message::Message for DemoteMasterContext {
14307 fn typename() -> &'static str {
14308 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
14309 }
14310}
14311
14312/// This context is used to demote an existing standalone instance to be
14313/// a Cloud SQL read replica for an external database server.
14314#[derive(Clone, Default, PartialEq)]
14315#[non_exhaustive]
14316pub struct DemoteContext {
14317 /// This is always `sql#demoteContext`.
14318 pub kind: std::string::String,
14319
14320 /// Required. The name of the instance which acts as the on-premises primary
14321 /// instance in the replication setup.
14322 pub source_representative_instance_name: std::string::String,
14323
14324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14325}
14326
14327impl DemoteContext {
14328 /// Creates a new default instance.
14329 pub fn new() -> Self {
14330 std::default::Default::default()
14331 }
14332
14333 /// Sets the value of [kind][crate::model::DemoteContext::kind].
14334 ///
14335 /// # Example
14336 /// ```ignore,no_run
14337 /// # use google_cloud_sql_v1::model::DemoteContext;
14338 /// let x = DemoteContext::new().set_kind("example");
14339 /// ```
14340 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14341 self.kind = v.into();
14342 self
14343 }
14344
14345 /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
14346 ///
14347 /// # Example
14348 /// ```ignore,no_run
14349 /// # use google_cloud_sql_v1::model::DemoteContext;
14350 /// let x = DemoteContext::new().set_source_representative_instance_name("example");
14351 /// ```
14352 pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
14353 mut self,
14354 v: T,
14355 ) -> Self {
14356 self.source_representative_instance_name = v.into();
14357 self
14358 }
14359}
14360
14361impl wkt::message::Message for DemoteContext {
14362 fn typename() -> &'static str {
14363 "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
14364 }
14365}
14366
14367/// Database instance failover context.
14368#[derive(Clone, Default, PartialEq)]
14369#[non_exhaustive]
14370pub struct FailoverContext {
14371 /// The current settings version of this instance. Request will be rejected if
14372 /// this version doesn't match the current settings version.
14373 pub settings_version: i64,
14374
14375 /// This is always `sql#failoverContext`.
14376 pub kind: std::string::String,
14377
14378 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14379}
14380
14381impl FailoverContext {
14382 /// Creates a new default instance.
14383 pub fn new() -> Self {
14384 std::default::Default::default()
14385 }
14386
14387 /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
14388 ///
14389 /// # Example
14390 /// ```ignore,no_run
14391 /// # use google_cloud_sql_v1::model::FailoverContext;
14392 /// let x = FailoverContext::new().set_settings_version(42);
14393 /// ```
14394 pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14395 self.settings_version = v.into();
14396 self
14397 }
14398
14399 /// Sets the value of [kind][crate::model::FailoverContext::kind].
14400 ///
14401 /// # Example
14402 /// ```ignore,no_run
14403 /// # use google_cloud_sql_v1::model::FailoverContext;
14404 /// let x = FailoverContext::new().set_kind("example");
14405 /// ```
14406 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14407 self.kind = v.into();
14408 self
14409 }
14410}
14411
14412impl wkt::message::Message for FailoverContext {
14413 fn typename() -> &'static str {
14414 "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
14415 }
14416}
14417
14418/// Database instance restore from backup context.
14419/// Backup context contains source instance id and project id.
14420#[derive(Clone, Default, PartialEq)]
14421#[non_exhaustive]
14422pub struct RestoreBackupContext {
14423 /// This is always `sql#restoreBackupContext`.
14424 pub kind: std::string::String,
14425
14426 /// The ID of the backup run to restore from.
14427 pub backup_run_id: i64,
14428
14429 /// The ID of the instance that the backup was taken from.
14430 pub instance_id: std::string::String,
14431
14432 /// The full project ID of the source instance.
14433 pub project: std::string::String,
14434
14435 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14436}
14437
14438impl RestoreBackupContext {
14439 /// Creates a new default instance.
14440 pub fn new() -> Self {
14441 std::default::Default::default()
14442 }
14443
14444 /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
14445 ///
14446 /// # Example
14447 /// ```ignore,no_run
14448 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14449 /// let x = RestoreBackupContext::new().set_kind("example");
14450 /// ```
14451 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14452 self.kind = v.into();
14453 self
14454 }
14455
14456 /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
14457 ///
14458 /// # Example
14459 /// ```ignore,no_run
14460 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14461 /// let x = RestoreBackupContext::new().set_backup_run_id(42);
14462 /// ```
14463 pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14464 self.backup_run_id = v.into();
14465 self
14466 }
14467
14468 /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
14469 ///
14470 /// # Example
14471 /// ```ignore,no_run
14472 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14473 /// let x = RestoreBackupContext::new().set_instance_id("example");
14474 /// ```
14475 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14476 self.instance_id = v.into();
14477 self
14478 }
14479
14480 /// Sets the value of [project][crate::model::RestoreBackupContext::project].
14481 ///
14482 /// # Example
14483 /// ```ignore,no_run
14484 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14485 /// let x = RestoreBackupContext::new().set_project("example");
14486 /// ```
14487 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14488 self.project = v.into();
14489 self
14490 }
14491}
14492
14493impl wkt::message::Message for RestoreBackupContext {
14494 fn typename() -> &'static str {
14495 "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
14496 }
14497}
14498
14499/// Instance rotate server CA context.
14500#[derive(Clone, Default, PartialEq)]
14501#[non_exhaustive]
14502pub struct RotateServerCaContext {
14503 /// This is always `sql#rotateServerCaContext`.
14504 pub kind: std::string::String,
14505
14506 /// The fingerprint of the next version to be rotated to. If left unspecified,
14507 /// will be rotated to the most recently added server CA version.
14508 pub next_version: std::string::String,
14509
14510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14511}
14512
14513impl RotateServerCaContext {
14514 /// Creates a new default instance.
14515 pub fn new() -> Self {
14516 std::default::Default::default()
14517 }
14518
14519 /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
14520 ///
14521 /// # Example
14522 /// ```ignore,no_run
14523 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14524 /// let x = RotateServerCaContext::new().set_kind("example");
14525 /// ```
14526 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14527 self.kind = v.into();
14528 self
14529 }
14530
14531 /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
14532 ///
14533 /// # Example
14534 /// ```ignore,no_run
14535 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14536 /// let x = RotateServerCaContext::new().set_next_version("example");
14537 /// ```
14538 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14539 self.next_version = v.into();
14540 self
14541 }
14542}
14543
14544impl wkt::message::Message for RotateServerCaContext {
14545 fn typename() -> &'static str {
14546 "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
14547 }
14548}
14549
14550/// Instance rotate server certificate context.
14551#[derive(Clone, Default, PartialEq)]
14552#[non_exhaustive]
14553pub struct RotateServerCertificateContext {
14554 /// Optional. This is always `sql#rotateServerCertificateContext`.
14555 pub kind: std::string::String,
14556
14557 /// The fingerprint of the next version to be rotated to. If left unspecified,
14558 /// will be rotated to the most recently added server certificate version.
14559 pub next_version: std::string::String,
14560
14561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14562}
14563
14564impl RotateServerCertificateContext {
14565 /// Creates a new default instance.
14566 pub fn new() -> Self {
14567 std::default::Default::default()
14568 }
14569
14570 /// Sets the value of [kind][crate::model::RotateServerCertificateContext::kind].
14571 ///
14572 /// # Example
14573 /// ```ignore,no_run
14574 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14575 /// let x = RotateServerCertificateContext::new().set_kind("example");
14576 /// ```
14577 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14578 self.kind = v.into();
14579 self
14580 }
14581
14582 /// Sets the value of [next_version][crate::model::RotateServerCertificateContext::next_version].
14583 ///
14584 /// # Example
14585 /// ```ignore,no_run
14586 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14587 /// let x = RotateServerCertificateContext::new().set_next_version("example");
14588 /// ```
14589 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14590 self.next_version = v.into();
14591 self
14592 }
14593}
14594
14595impl wkt::message::Message for RotateServerCertificateContext {
14596 fn typename() -> &'static str {
14597 "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
14598 }
14599}
14600
14601/// Instance rotate Entra ID certificate context.
14602#[derive(Clone, Default, PartialEq)]
14603#[non_exhaustive]
14604pub struct RotateEntraIdCertificateContext {
14605 /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
14606 pub kind: std::string::String,
14607
14608 /// Optional. The fingerprint of the next version to be rotated to. If left
14609 /// unspecified, will be rotated to the most recently added server certificate
14610 /// version.
14611 pub next_version: std::string::String,
14612
14613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14614}
14615
14616impl RotateEntraIdCertificateContext {
14617 /// Creates a new default instance.
14618 pub fn new() -> Self {
14619 std::default::Default::default()
14620 }
14621
14622 /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
14623 ///
14624 /// # Example
14625 /// ```ignore,no_run
14626 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14627 /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
14628 /// ```
14629 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14630 self.kind = v.into();
14631 self
14632 }
14633
14634 /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
14635 ///
14636 /// # Example
14637 /// ```ignore,no_run
14638 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14639 /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
14640 /// ```
14641 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14642 self.next_version = v.into();
14643 self
14644 }
14645}
14646
14647impl wkt::message::Message for RotateEntraIdCertificateContext {
14648 fn typename() -> &'static str {
14649 "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
14650 }
14651}
14652
14653/// Database Instance truncate log context.
14654#[derive(Clone, Default, PartialEq)]
14655#[non_exhaustive]
14656pub struct TruncateLogContext {
14657 /// This is always `sql#truncateLogContext`.
14658 pub kind: std::string::String,
14659
14660 /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
14661 /// `MYSQL_SLOW_TABLE`.
14662 pub log_type: std::string::String,
14663
14664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14665}
14666
14667impl TruncateLogContext {
14668 /// Creates a new default instance.
14669 pub fn new() -> Self {
14670 std::default::Default::default()
14671 }
14672
14673 /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
14674 ///
14675 /// # Example
14676 /// ```ignore,no_run
14677 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14678 /// let x = TruncateLogContext::new().set_kind("example");
14679 /// ```
14680 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14681 self.kind = v.into();
14682 self
14683 }
14684
14685 /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
14686 ///
14687 /// # Example
14688 /// ```ignore,no_run
14689 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14690 /// let x = TruncateLogContext::new().set_log_type("example");
14691 /// ```
14692 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14693 self.log_type = v.into();
14694 self
14695 }
14696}
14697
14698impl wkt::message::Message for TruncateLogContext {
14699 fn typename() -> &'static str {
14700 "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
14701 }
14702}
14703
14704/// External primary instance migration setting error/warning.
14705#[derive(Clone, Default, PartialEq)]
14706#[non_exhaustive]
14707pub struct SqlExternalSyncSettingError {
14708 /// Can be `sql#externalSyncSettingError` or
14709 /// `sql#externalSyncSettingWarning`.
14710 pub kind: std::string::String,
14711
14712 /// Identifies the specific error that occurred.
14713 pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14714
14715 /// Additional information about the error encountered.
14716 pub detail: std::string::String,
14717
14718 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14719}
14720
14721impl SqlExternalSyncSettingError {
14722 /// Creates a new default instance.
14723 pub fn new() -> Self {
14724 std::default::Default::default()
14725 }
14726
14727 /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
14728 ///
14729 /// # Example
14730 /// ```ignore,no_run
14731 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14732 /// let x = SqlExternalSyncSettingError::new().set_kind("example");
14733 /// ```
14734 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14735 self.kind = v.into();
14736 self
14737 }
14738
14739 /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
14740 ///
14741 /// # Example
14742 /// ```ignore,no_run
14743 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14744 /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
14745 /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
14746 /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
14747 /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
14748 /// ```
14749 pub fn set_type<
14750 T: std::convert::Into<
14751 crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14752 >,
14753 >(
14754 mut self,
14755 v: T,
14756 ) -> Self {
14757 self.r#type = v.into();
14758 self
14759 }
14760
14761 /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
14762 ///
14763 /// # Example
14764 /// ```ignore,no_run
14765 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14766 /// let x = SqlExternalSyncSettingError::new().set_detail("example");
14767 /// ```
14768 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14769 self.detail = v.into();
14770 self
14771 }
14772}
14773
14774impl wkt::message::Message for SqlExternalSyncSettingError {
14775 fn typename() -> &'static str {
14776 "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
14777 }
14778}
14779
14780/// Defines additional types related to [SqlExternalSyncSettingError].
14781pub mod sql_external_sync_setting_error {
14782 #[allow(unused_imports)]
14783 use super::*;
14784
14785 /// Enum for [SqlExternalSyncSettingErrorType].
14786 ///
14787 /// # Working with unknown values
14788 ///
14789 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14790 /// additional enum variants at any time. Adding new variants is not considered
14791 /// a breaking change. Applications should write their code in anticipation of:
14792 ///
14793 /// - New values appearing in future releases of the client library, **and**
14794 /// - New values received dynamically, without application changes.
14795 ///
14796 /// Please consult the [Working with enums] section in the user guide for some
14797 /// guidelines.
14798 ///
14799 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14800 #[derive(Clone, Debug, PartialEq)]
14801 #[non_exhaustive]
14802 pub enum SqlExternalSyncSettingErrorType {
14803 #[allow(missing_docs)]
14804 Unspecified,
14805 #[allow(missing_docs)]
14806 ConnectionFailure,
14807 #[allow(missing_docs)]
14808 BinlogNotEnabled,
14809 #[allow(missing_docs)]
14810 IncompatibleDatabaseVersion,
14811 #[allow(missing_docs)]
14812 ReplicaAlreadySetup,
14813 /// The replication user is missing privileges that are required.
14814 InsufficientPrivilege,
14815 /// Unsupported migration type.
14816 UnsupportedMigrationType,
14817 /// No pglogical extension installed on databases, applicable for postgres.
14818 NoPglogicalInstalled,
14819 /// pglogical node already exists on databases, applicable for postgres.
14820 PglogicalNodeAlreadyExists,
14821 /// The value of parameter wal_level is not set to logical.
14822 InvalidWalLevel,
14823 /// The value of parameter shared_preload_libraries does not include
14824 /// pglogical.
14825 InvalidSharedPreloadLibrary,
14826 /// The value of parameter max_replication_slots is not sufficient.
14827 InsufficientMaxReplicationSlots,
14828 /// The value of parameter max_wal_senders is not sufficient.
14829 InsufficientMaxWalSenders,
14830 /// The value of parameter max_worker_processes is not sufficient.
14831 InsufficientMaxWorkerProcesses,
14832 /// Extensions installed are either not supported or having unsupported
14833 /// versions.
14834 UnsupportedExtensions,
14835 /// The value of parameter rds.logical_replication is not set to 1.
14836 InvalidRdsLogicalReplication,
14837 /// The primary instance logging setup doesn't allow EM sync.
14838 InvalidLoggingSetup,
14839 /// The primary instance database parameter setup doesn't allow EM sync.
14840 InvalidDbParam,
14841 /// The gtid_mode is not supported, applicable for MySQL.
14842 UnsupportedGtidMode,
14843 /// SQL Server Agent is not running.
14844 SqlserverAgentNotRunning,
14845 /// The table definition is not support due to missing primary key or replica
14846 /// identity, applicable for postgres. Note that this is a warning and won't
14847 /// block the migration.
14848 UnsupportedTableDefinition,
14849 /// The customer has a definer that will break EM setup.
14850 UnsupportedDefiner,
14851 /// SQL Server @@SERVERNAME does not match actual host name.
14852 SqlserverServernameMismatch,
14853 /// The primary instance has been setup and will fail the setup.
14854 PrimaryAlreadySetup,
14855 /// The primary instance has unsupported binary log format.
14856 UnsupportedBinlogFormat,
14857 /// The primary instance's binary log retention setting.
14858 BinlogRetentionSetting,
14859 /// The primary instance has tables with unsupported storage engine.
14860 UnsupportedStorageEngine,
14861 /// Source has tables with limited support
14862 /// eg: PostgreSQL tables without primary keys.
14863 LimitedSupportTables,
14864 /// The replica instance contains existing data.
14865 ExistingDataInReplica,
14866 /// The replication user is missing privileges that are optional.
14867 MissingOptionalPrivileges,
14868 /// Additional BACKUP_ADMIN privilege is granted to the replication user
14869 /// which may lock source MySQL 8 instance for DDLs during initial sync.
14870 RiskyBackupAdminPrivilege,
14871 /// The Cloud Storage bucket is missing necessary permissions.
14872 InsufficientGcsPermissions,
14873 /// The Cloud Storage bucket has an error in the file or contains invalid
14874 /// file information.
14875 InvalidFileInfo,
14876 /// The source instance has unsupported database settings for migration.
14877 UnsupportedDatabaseSettings,
14878 /// The replication user is missing parallel import specific privileges.
14879 /// (e.g. LOCK TABLES) for MySQL.
14880 MysqlParallelImportInsufficientPrivilege,
14881 /// The global variable local_infile is off on external server replica.
14882 LocalInfileOff,
14883 /// This code instructs customers to turn on point-in-time recovery manually
14884 /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
14885 TurnOnPitrAfterPromote,
14886 /// The minor version of replica database is incompatible with the source.
14887 IncompatibleDatabaseMinorVersion,
14888 /// This warning message indicates that Cloud SQL uses the maximum number of
14889 /// subscriptions to migrate data from the source to the destination.
14890 SourceMaxSubscriptions,
14891 /// Unable to verify definers on the source for MySQL.
14892 UnableToVerifyDefiners,
14893 /// If a time out occurs while the subscription counts are calculated, then
14894 /// this value is set to 1. Otherwise, this value is set to 2.
14895 SubscriptionCalculationStatus,
14896 /// Count of subscriptions needed to sync source data for PostgreSQL
14897 /// database.
14898 PgSubscriptionCount,
14899 /// Final parallel level that is used to do migration.
14900 PgSyncParallelLevel,
14901 /// The disk size of the replica instance is smaller than the data size of
14902 /// the source instance.
14903 InsufficientDiskSize,
14904 /// The data size of the source instance is greater than 1 TB, the number of
14905 /// cores of the replica instance is less than 8, and the memory of the
14906 /// replica is less than 32 GB.
14907 InsufficientMachineTier,
14908 /// The warning message indicates the unsupported extensions will not be
14909 /// migrated to the destination.
14910 UnsupportedExtensionsNotMigrated,
14911 /// The warning message indicates the pg_cron extension and settings will not
14912 /// be migrated to the destination.
14913 ExtensionsNotMigrated,
14914 /// The error message indicates that pg_cron flags are enabled on the
14915 /// destination which is not supported during the migration.
14916 PgCronFlagEnabledInReplica,
14917 /// This error message indicates that the specified extensions are not
14918 /// enabled on destination instance. For example, before you can migrate
14919 /// data to the destination instance, you must enable the PGAudit extension
14920 /// on the instance.
14921 ExtensionsNotEnabledInReplica,
14922 /// The source database has generated columns that can't be migrated. Please
14923 /// change them to regular columns before migration.
14924 UnsupportedColumns,
14925 /// The source database has users that aren't created in the replica.
14926 /// First, create all users, which are in the pg_user_mappings table
14927 /// of the source database, in the destination instance. Then, perform the
14928 /// migration.
14929 UsersNotCreatedInReplica,
14930 /// The selected objects include system objects that aren't supported for
14931 /// migration.
14932 UnsupportedSystemObjects,
14933 /// The source database has tables with the FULL or NOTHING replica identity.
14934 /// Before starting your migration, either remove the identity or change it
14935 /// to DEFAULT. Note that this is an error and will block the migration.
14936 UnsupportedTablesWithReplicaIdentity,
14937 /// The selected objects don't exist on the source instance.
14938 SelectedObjectsNotExistOnSource,
14939 /// PSC only destination instance does not have a network attachment URI.
14940 PscOnlyInstanceWithNoNetworkAttachmentUri,
14941 /// Selected objects reference unselected objects. Based on their object type
14942 /// (foreign key constraint or view), selected objects will fail during
14943 /// migration.
14944 SelectedObjectsReferenceUnselectedObjects,
14945 /// The migration will delete existing data in the replica; set
14946 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14947 /// in the request to acknowledge this. This is an error. MySQL only.
14948 ///
14949 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14950 PromptDeleteExisting,
14951 /// The migration will delete existing data in the replica;
14952 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14953 /// was set in the request acknowledging this. This is a warning rather than
14954 /// an error. MySQL only.
14955 ///
14956 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14957 WillDeleteExisting,
14958 /// The replication user is missing specific privileges to setup DDL
14959 /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
14960 PgDdlReplicationInsufficientPrivilege,
14961 /// If set, the enum was initialized with an unknown value.
14962 ///
14963 /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
14964 /// [SqlExternalSyncSettingErrorType::name].
14965 UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
14966 }
14967
14968 #[doc(hidden)]
14969 pub mod sql_external_sync_setting_error_type {
14970 #[allow(unused_imports)]
14971 use super::*;
14972 #[derive(Clone, Debug, PartialEq)]
14973 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14974 }
14975
14976 impl SqlExternalSyncSettingErrorType {
14977 /// Gets the enum value.
14978 ///
14979 /// Returns `None` if the enum contains an unknown value deserialized from
14980 /// the string representation of enums.
14981 pub fn value(&self) -> std::option::Option<i32> {
14982 match self {
14983 Self::Unspecified => std::option::Option::Some(0),
14984 Self::ConnectionFailure => std::option::Option::Some(1),
14985 Self::BinlogNotEnabled => std::option::Option::Some(2),
14986 Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
14987 Self::ReplicaAlreadySetup => std::option::Option::Some(4),
14988 Self::InsufficientPrivilege => std::option::Option::Some(5),
14989 Self::UnsupportedMigrationType => std::option::Option::Some(6),
14990 Self::NoPglogicalInstalled => std::option::Option::Some(7),
14991 Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
14992 Self::InvalidWalLevel => std::option::Option::Some(9),
14993 Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
14994 Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
14995 Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
14996 Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
14997 Self::UnsupportedExtensions => std::option::Option::Some(14),
14998 Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
14999 Self::InvalidLoggingSetup => std::option::Option::Some(16),
15000 Self::InvalidDbParam => std::option::Option::Some(17),
15001 Self::UnsupportedGtidMode => std::option::Option::Some(18),
15002 Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
15003 Self::UnsupportedTableDefinition => std::option::Option::Some(20),
15004 Self::UnsupportedDefiner => std::option::Option::Some(21),
15005 Self::SqlserverServernameMismatch => std::option::Option::Some(22),
15006 Self::PrimaryAlreadySetup => std::option::Option::Some(23),
15007 Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
15008 Self::BinlogRetentionSetting => std::option::Option::Some(25),
15009 Self::UnsupportedStorageEngine => std::option::Option::Some(26),
15010 Self::LimitedSupportTables => std::option::Option::Some(27),
15011 Self::ExistingDataInReplica => std::option::Option::Some(28),
15012 Self::MissingOptionalPrivileges => std::option::Option::Some(29),
15013 Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
15014 Self::InsufficientGcsPermissions => std::option::Option::Some(31),
15015 Self::InvalidFileInfo => std::option::Option::Some(32),
15016 Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
15017 Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
15018 Self::LocalInfileOff => std::option::Option::Some(35),
15019 Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
15020 Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
15021 Self::SourceMaxSubscriptions => std::option::Option::Some(38),
15022 Self::UnableToVerifyDefiners => std::option::Option::Some(39),
15023 Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
15024 Self::PgSubscriptionCount => std::option::Option::Some(41),
15025 Self::PgSyncParallelLevel => std::option::Option::Some(42),
15026 Self::InsufficientDiskSize => std::option::Option::Some(43),
15027 Self::InsufficientMachineTier => std::option::Option::Some(44),
15028 Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
15029 Self::ExtensionsNotMigrated => std::option::Option::Some(46),
15030 Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
15031 Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
15032 Self::UnsupportedColumns => std::option::Option::Some(49),
15033 Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
15034 Self::UnsupportedSystemObjects => std::option::Option::Some(51),
15035 Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
15036 Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
15037 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
15038 Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
15039 Self::PromptDeleteExisting => std::option::Option::Some(56),
15040 Self::WillDeleteExisting => std::option::Option::Some(57),
15041 Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
15042 Self::UnknownValue(u) => u.0.value(),
15043 }
15044 }
15045
15046 /// Gets the enum value as a string.
15047 ///
15048 /// Returns `None` if the enum contains an unknown value deserialized from
15049 /// the integer representation of enums.
15050 pub fn name(&self) -> std::option::Option<&str> {
15051 match self {
15052 Self::Unspecified => {
15053 std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
15054 }
15055 Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
15056 Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
15057 Self::IncompatibleDatabaseVersion => {
15058 std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
15059 }
15060 Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
15061 Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
15062 Self::UnsupportedMigrationType => {
15063 std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
15064 }
15065 Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
15066 Self::PglogicalNodeAlreadyExists => {
15067 std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
15068 }
15069 Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
15070 Self::InvalidSharedPreloadLibrary => {
15071 std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
15072 }
15073 Self::InsufficientMaxReplicationSlots => {
15074 std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
15075 }
15076 Self::InsufficientMaxWalSenders => {
15077 std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
15078 }
15079 Self::InsufficientMaxWorkerProcesses => {
15080 std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
15081 }
15082 Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
15083 Self::InvalidRdsLogicalReplication => {
15084 std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
15085 }
15086 Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
15087 Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
15088 Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
15089 Self::SqlserverAgentNotRunning => {
15090 std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
15091 }
15092 Self::UnsupportedTableDefinition => {
15093 std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
15094 }
15095 Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
15096 Self::SqlserverServernameMismatch => {
15097 std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
15098 }
15099 Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
15100 Self::UnsupportedBinlogFormat => {
15101 std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
15102 }
15103 Self::BinlogRetentionSetting => {
15104 std::option::Option::Some("BINLOG_RETENTION_SETTING")
15105 }
15106 Self::UnsupportedStorageEngine => {
15107 std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
15108 }
15109 Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
15110 Self::ExistingDataInReplica => {
15111 std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
15112 }
15113 Self::MissingOptionalPrivileges => {
15114 std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
15115 }
15116 Self::RiskyBackupAdminPrivilege => {
15117 std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
15118 }
15119 Self::InsufficientGcsPermissions => {
15120 std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
15121 }
15122 Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
15123 Self::UnsupportedDatabaseSettings => {
15124 std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
15125 }
15126 Self::MysqlParallelImportInsufficientPrivilege => {
15127 std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
15128 }
15129 Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
15130 Self::TurnOnPitrAfterPromote => {
15131 std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
15132 }
15133 Self::IncompatibleDatabaseMinorVersion => {
15134 std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
15135 }
15136 Self::SourceMaxSubscriptions => {
15137 std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
15138 }
15139 Self::UnableToVerifyDefiners => {
15140 std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
15141 }
15142 Self::SubscriptionCalculationStatus => {
15143 std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
15144 }
15145 Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
15146 Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
15147 Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
15148 Self::InsufficientMachineTier => {
15149 std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
15150 }
15151 Self::UnsupportedExtensionsNotMigrated => {
15152 std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
15153 }
15154 Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
15155 Self::PgCronFlagEnabledInReplica => {
15156 std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
15157 }
15158 Self::ExtensionsNotEnabledInReplica => {
15159 std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
15160 }
15161 Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
15162 Self::UsersNotCreatedInReplica => {
15163 std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
15164 }
15165 Self::UnsupportedSystemObjects => {
15166 std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
15167 }
15168 Self::UnsupportedTablesWithReplicaIdentity => {
15169 std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
15170 }
15171 Self::SelectedObjectsNotExistOnSource => {
15172 std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
15173 }
15174 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
15175 std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
15176 }
15177 Self::SelectedObjectsReferenceUnselectedObjects => {
15178 std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
15179 }
15180 Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
15181 Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
15182 Self::PgDdlReplicationInsufficientPrivilege => {
15183 std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
15184 }
15185 Self::UnknownValue(u) => u.0.name(),
15186 }
15187 }
15188 }
15189
15190 impl std::default::Default for SqlExternalSyncSettingErrorType {
15191 fn default() -> Self {
15192 use std::convert::From;
15193 Self::from(0)
15194 }
15195 }
15196
15197 impl std::fmt::Display for SqlExternalSyncSettingErrorType {
15198 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15199 wkt::internal::display_enum(f, self.name(), self.value())
15200 }
15201 }
15202
15203 impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
15204 fn from(value: i32) -> Self {
15205 match value {
15206 0 => Self::Unspecified,
15207 1 => Self::ConnectionFailure,
15208 2 => Self::BinlogNotEnabled,
15209 3 => Self::IncompatibleDatabaseVersion,
15210 4 => Self::ReplicaAlreadySetup,
15211 5 => Self::InsufficientPrivilege,
15212 6 => Self::UnsupportedMigrationType,
15213 7 => Self::NoPglogicalInstalled,
15214 8 => Self::PglogicalNodeAlreadyExists,
15215 9 => Self::InvalidWalLevel,
15216 10 => Self::InvalidSharedPreloadLibrary,
15217 11 => Self::InsufficientMaxReplicationSlots,
15218 12 => Self::InsufficientMaxWalSenders,
15219 13 => Self::InsufficientMaxWorkerProcesses,
15220 14 => Self::UnsupportedExtensions,
15221 15 => Self::InvalidRdsLogicalReplication,
15222 16 => Self::InvalidLoggingSetup,
15223 17 => Self::InvalidDbParam,
15224 18 => Self::UnsupportedGtidMode,
15225 19 => Self::SqlserverAgentNotRunning,
15226 20 => Self::UnsupportedTableDefinition,
15227 21 => Self::UnsupportedDefiner,
15228 22 => Self::SqlserverServernameMismatch,
15229 23 => Self::PrimaryAlreadySetup,
15230 24 => Self::UnsupportedBinlogFormat,
15231 25 => Self::BinlogRetentionSetting,
15232 26 => Self::UnsupportedStorageEngine,
15233 27 => Self::LimitedSupportTables,
15234 28 => Self::ExistingDataInReplica,
15235 29 => Self::MissingOptionalPrivileges,
15236 30 => Self::RiskyBackupAdminPrivilege,
15237 31 => Self::InsufficientGcsPermissions,
15238 32 => Self::InvalidFileInfo,
15239 33 => Self::UnsupportedDatabaseSettings,
15240 34 => Self::MysqlParallelImportInsufficientPrivilege,
15241 35 => Self::LocalInfileOff,
15242 36 => Self::TurnOnPitrAfterPromote,
15243 37 => Self::IncompatibleDatabaseMinorVersion,
15244 38 => Self::SourceMaxSubscriptions,
15245 39 => Self::UnableToVerifyDefiners,
15246 40 => Self::SubscriptionCalculationStatus,
15247 41 => Self::PgSubscriptionCount,
15248 42 => Self::PgSyncParallelLevel,
15249 43 => Self::InsufficientDiskSize,
15250 44 => Self::InsufficientMachineTier,
15251 45 => Self::UnsupportedExtensionsNotMigrated,
15252 46 => Self::ExtensionsNotMigrated,
15253 47 => Self::PgCronFlagEnabledInReplica,
15254 48 => Self::ExtensionsNotEnabledInReplica,
15255 49 => Self::UnsupportedColumns,
15256 50 => Self::UsersNotCreatedInReplica,
15257 51 => Self::UnsupportedSystemObjects,
15258 52 => Self::UnsupportedTablesWithReplicaIdentity,
15259 53 => Self::SelectedObjectsNotExistOnSource,
15260 54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
15261 55 => Self::SelectedObjectsReferenceUnselectedObjects,
15262 56 => Self::PromptDeleteExisting,
15263 57 => Self::WillDeleteExisting,
15264 58 => Self::PgDdlReplicationInsufficientPrivilege,
15265 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15266 wkt::internal::UnknownEnumValue::Integer(value),
15267 )),
15268 }
15269 }
15270 }
15271
15272 impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
15273 fn from(value: &str) -> Self {
15274 use std::string::ToString;
15275 match value {
15276 "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
15277 "CONNECTION_FAILURE" => Self::ConnectionFailure,
15278 "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
15279 "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
15280 "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
15281 "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
15282 "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
15283 "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
15284 "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
15285 "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
15286 "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
15287 "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
15288 "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
15289 "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
15290 "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
15291 "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
15292 "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
15293 "INVALID_DB_PARAM" => Self::InvalidDbParam,
15294 "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
15295 "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
15296 "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
15297 "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
15298 "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
15299 "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
15300 "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
15301 "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
15302 "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
15303 "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
15304 "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
15305 "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
15306 "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
15307 "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
15308 "INVALID_FILE_INFO" => Self::InvalidFileInfo,
15309 "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
15310 "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
15311 Self::MysqlParallelImportInsufficientPrivilege
15312 }
15313 "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
15314 "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
15315 "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
15316 "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
15317 "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
15318 "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
15319 "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
15320 "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
15321 "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
15322 "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
15323 "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
15324 "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
15325 "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
15326 "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
15327 "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
15328 "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
15329 "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
15330 "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
15331 Self::UnsupportedTablesWithReplicaIdentity
15332 }
15333 "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
15334 "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
15335 Self::PscOnlyInstanceWithNoNetworkAttachmentUri
15336 }
15337 "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
15338 Self::SelectedObjectsReferenceUnselectedObjects
15339 }
15340 "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
15341 "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
15342 "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
15343 Self::PgDdlReplicationInsufficientPrivilege
15344 }
15345 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
15346 wkt::internal::UnknownEnumValue::String(value.to_string()),
15347 )),
15348 }
15349 }
15350 }
15351
15352 impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
15353 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15354 where
15355 S: serde::Serializer,
15356 {
15357 match self {
15358 Self::Unspecified => serializer.serialize_i32(0),
15359 Self::ConnectionFailure => serializer.serialize_i32(1),
15360 Self::BinlogNotEnabled => serializer.serialize_i32(2),
15361 Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
15362 Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
15363 Self::InsufficientPrivilege => serializer.serialize_i32(5),
15364 Self::UnsupportedMigrationType => serializer.serialize_i32(6),
15365 Self::NoPglogicalInstalled => serializer.serialize_i32(7),
15366 Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
15367 Self::InvalidWalLevel => serializer.serialize_i32(9),
15368 Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
15369 Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
15370 Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
15371 Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
15372 Self::UnsupportedExtensions => serializer.serialize_i32(14),
15373 Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
15374 Self::InvalidLoggingSetup => serializer.serialize_i32(16),
15375 Self::InvalidDbParam => serializer.serialize_i32(17),
15376 Self::UnsupportedGtidMode => serializer.serialize_i32(18),
15377 Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
15378 Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
15379 Self::UnsupportedDefiner => serializer.serialize_i32(21),
15380 Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
15381 Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
15382 Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
15383 Self::BinlogRetentionSetting => serializer.serialize_i32(25),
15384 Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
15385 Self::LimitedSupportTables => serializer.serialize_i32(27),
15386 Self::ExistingDataInReplica => serializer.serialize_i32(28),
15387 Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
15388 Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
15389 Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
15390 Self::InvalidFileInfo => serializer.serialize_i32(32),
15391 Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
15392 Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
15393 Self::LocalInfileOff => serializer.serialize_i32(35),
15394 Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
15395 Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
15396 Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
15397 Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
15398 Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
15399 Self::PgSubscriptionCount => serializer.serialize_i32(41),
15400 Self::PgSyncParallelLevel => serializer.serialize_i32(42),
15401 Self::InsufficientDiskSize => serializer.serialize_i32(43),
15402 Self::InsufficientMachineTier => serializer.serialize_i32(44),
15403 Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
15404 Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
15405 Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
15406 Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
15407 Self::UnsupportedColumns => serializer.serialize_i32(49),
15408 Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
15409 Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
15410 Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
15411 Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
15412 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
15413 Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
15414 Self::PromptDeleteExisting => serializer.serialize_i32(56),
15415 Self::WillDeleteExisting => serializer.serialize_i32(57),
15416 Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
15417 Self::UnknownValue(u) => u.0.serialize(serializer),
15418 }
15419 }
15420 }
15421
15422 impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
15423 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15424 where
15425 D: serde::Deserializer<'de>,
15426 {
15427 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
15428 SqlExternalSyncSettingErrorType,
15429 >::new(
15430 ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
15431 ))
15432 }
15433 }
15434}
15435
15436/// A list of objects that the user selects for replication from an external
15437/// source instance.
15438#[derive(Clone, Default, PartialEq)]
15439#[non_exhaustive]
15440pub struct SelectedObjects {
15441 /// Required. The name of the database to migrate.
15442 pub database: std::string::String,
15443
15444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15445}
15446
15447impl SelectedObjects {
15448 /// Creates a new default instance.
15449 pub fn new() -> Self {
15450 std::default::Default::default()
15451 }
15452
15453 /// Sets the value of [database][crate::model::SelectedObjects::database].
15454 ///
15455 /// # Example
15456 /// ```ignore,no_run
15457 /// # use google_cloud_sql_v1::model::SelectedObjects;
15458 /// let x = SelectedObjects::new().set_database("example");
15459 /// ```
15460 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15461 self.database = v.into();
15462 self
15463 }
15464}
15465
15466impl wkt::message::Message for SelectedObjects {
15467 fn typename() -> &'static str {
15468 "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
15469 }
15470}
15471
15472/// On-premises instance configuration.
15473#[derive(Clone, Default, PartialEq)]
15474#[non_exhaustive]
15475pub struct OnPremisesConfiguration {
15476 /// The host and port of the on-premises instance in host:port format
15477 pub host_port: std::string::String,
15478
15479 /// This is always `sql#onPremisesConfiguration`.
15480 pub kind: std::string::String,
15481
15482 /// The username for connecting to on-premises instance.
15483 pub username: std::string::String,
15484
15485 /// The password for connecting to on-premises instance.
15486 pub password: std::string::String,
15487
15488 /// PEM representation of the trusted CA's x509 certificate.
15489 pub ca_certificate: std::string::String,
15490
15491 /// PEM representation of the replica's x509 certificate.
15492 pub client_certificate: std::string::String,
15493
15494 /// PEM representation of the replica's private key. The corresponding public
15495 /// key is encoded in the client's certificate.
15496 pub client_key: std::string::String,
15497
15498 /// The dump file to create the Cloud SQL replica.
15499 pub dump_file_path: std::string::String,
15500
15501 /// The reference to Cloud SQL instance if the source is Cloud SQL.
15502 pub source_instance: std::option::Option<crate::model::InstanceReference>,
15503
15504 /// Optional. A list of objects that the user selects for replication from an
15505 /// external source instance.
15506 pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
15507
15508 /// Optional. SSL option for replica connection to the on-premises source.
15509 pub ssl_option: crate::model::on_premises_configuration::SslOption,
15510
15511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15512}
15513
15514impl OnPremisesConfiguration {
15515 /// Creates a new default instance.
15516 pub fn new() -> Self {
15517 std::default::Default::default()
15518 }
15519
15520 /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
15521 ///
15522 /// # Example
15523 /// ```ignore,no_run
15524 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15525 /// let x = OnPremisesConfiguration::new().set_host_port("example");
15526 /// ```
15527 pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15528 self.host_port = v.into();
15529 self
15530 }
15531
15532 /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
15533 ///
15534 /// # Example
15535 /// ```ignore,no_run
15536 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15537 /// let x = OnPremisesConfiguration::new().set_kind("example");
15538 /// ```
15539 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15540 self.kind = v.into();
15541 self
15542 }
15543
15544 /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
15545 ///
15546 /// # Example
15547 /// ```ignore,no_run
15548 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15549 /// let x = OnPremisesConfiguration::new().set_username("example");
15550 /// ```
15551 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15552 self.username = v.into();
15553 self
15554 }
15555
15556 /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
15557 ///
15558 /// # Example
15559 /// ```ignore,no_run
15560 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15561 /// let x = OnPremisesConfiguration::new().set_password("example");
15562 /// ```
15563 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15564 self.password = v.into();
15565 self
15566 }
15567
15568 /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
15569 ///
15570 /// # Example
15571 /// ```ignore,no_run
15572 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15573 /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
15574 /// ```
15575 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15576 self.ca_certificate = v.into();
15577 self
15578 }
15579
15580 /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
15581 ///
15582 /// # Example
15583 /// ```ignore,no_run
15584 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15585 /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
15586 /// ```
15587 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15588 mut self,
15589 v: T,
15590 ) -> Self {
15591 self.client_certificate = v.into();
15592 self
15593 }
15594
15595 /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
15596 ///
15597 /// # Example
15598 /// ```ignore,no_run
15599 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15600 /// let x = OnPremisesConfiguration::new().set_client_key("example");
15601 /// ```
15602 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15603 self.client_key = v.into();
15604 self
15605 }
15606
15607 /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
15608 ///
15609 /// # Example
15610 /// ```ignore,no_run
15611 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15612 /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
15613 /// ```
15614 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15615 self.dump_file_path = v.into();
15616 self
15617 }
15618
15619 /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15620 ///
15621 /// # Example
15622 /// ```ignore,no_run
15623 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15624 /// use google_cloud_sql_v1::model::InstanceReference;
15625 /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
15626 /// ```
15627 pub fn set_source_instance<T>(mut self, v: T) -> Self
15628 where
15629 T: std::convert::Into<crate::model::InstanceReference>,
15630 {
15631 self.source_instance = std::option::Option::Some(v.into());
15632 self
15633 }
15634
15635 /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15636 ///
15637 /// # Example
15638 /// ```ignore,no_run
15639 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15640 /// use google_cloud_sql_v1::model::InstanceReference;
15641 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
15642 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
15643 /// ```
15644 pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
15645 where
15646 T: std::convert::Into<crate::model::InstanceReference>,
15647 {
15648 self.source_instance = v.map(|x| x.into());
15649 self
15650 }
15651
15652 /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
15653 ///
15654 /// # Example
15655 /// ```ignore,no_run
15656 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15657 /// use google_cloud_sql_v1::model::SelectedObjects;
15658 /// let x = OnPremisesConfiguration::new()
15659 /// .set_selected_objects([
15660 /// SelectedObjects::default()/* use setters */,
15661 /// SelectedObjects::default()/* use (different) setters */,
15662 /// ]);
15663 /// ```
15664 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
15665 where
15666 T: std::iter::IntoIterator<Item = V>,
15667 V: std::convert::Into<crate::model::SelectedObjects>,
15668 {
15669 use std::iter::Iterator;
15670 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
15671 self
15672 }
15673
15674 /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
15675 ///
15676 /// # Example
15677 /// ```ignore,no_run
15678 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15679 /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
15680 /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
15681 /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
15682 /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
15683 /// ```
15684 pub fn set_ssl_option<
15685 T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
15686 >(
15687 mut self,
15688 v: T,
15689 ) -> Self {
15690 self.ssl_option = v.into();
15691 self
15692 }
15693}
15694
15695impl wkt::message::Message for OnPremisesConfiguration {
15696 fn typename() -> &'static str {
15697 "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
15698 }
15699}
15700
15701/// Defines additional types related to [OnPremisesConfiguration].
15702pub mod on_premises_configuration {
15703 #[allow(unused_imports)]
15704 use super::*;
15705
15706 /// SslOption defines the SSL mode to be used for replica connection to the
15707 /// on-premises source.
15708 ///
15709 /// # Working with unknown values
15710 ///
15711 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15712 /// additional enum variants at any time. Adding new variants is not considered
15713 /// a breaking change. Applications should write their code in anticipation of:
15714 ///
15715 /// - New values appearing in future releases of the client library, **and**
15716 /// - New values received dynamically, without application changes.
15717 ///
15718 /// Please consult the [Working with enums] section in the user guide for some
15719 /// guidelines.
15720 ///
15721 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15722 #[derive(Clone, Debug, PartialEq)]
15723 #[non_exhaustive]
15724 pub enum SslOption {
15725 /// Unknown SSL option i.e. SSL option not specified by user.
15726 Unspecified,
15727 /// SSL is not used for replica connection to the on-premises source.
15728 Disable,
15729 /// SSL is required for replica connection to the on-premises source.
15730 Require,
15731 /// Verify CA is required for replica connection to the on-premises source.
15732 VerifyCa,
15733 /// If set, the enum was initialized with an unknown value.
15734 ///
15735 /// Applications can examine the value using [SslOption::value] or
15736 /// [SslOption::name].
15737 UnknownValue(ssl_option::UnknownValue),
15738 }
15739
15740 #[doc(hidden)]
15741 pub mod ssl_option {
15742 #[allow(unused_imports)]
15743 use super::*;
15744 #[derive(Clone, Debug, PartialEq)]
15745 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15746 }
15747
15748 impl SslOption {
15749 /// Gets the enum value.
15750 ///
15751 /// Returns `None` if the enum contains an unknown value deserialized from
15752 /// the string representation of enums.
15753 pub fn value(&self) -> std::option::Option<i32> {
15754 match self {
15755 Self::Unspecified => std::option::Option::Some(0),
15756 Self::Disable => std::option::Option::Some(1),
15757 Self::Require => std::option::Option::Some(2),
15758 Self::VerifyCa => std::option::Option::Some(3),
15759 Self::UnknownValue(u) => u.0.value(),
15760 }
15761 }
15762
15763 /// Gets the enum value as a string.
15764 ///
15765 /// Returns `None` if the enum contains an unknown value deserialized from
15766 /// the integer representation of enums.
15767 pub fn name(&self) -> std::option::Option<&str> {
15768 match self {
15769 Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
15770 Self::Disable => std::option::Option::Some("DISABLE"),
15771 Self::Require => std::option::Option::Some("REQUIRE"),
15772 Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
15773 Self::UnknownValue(u) => u.0.name(),
15774 }
15775 }
15776 }
15777
15778 impl std::default::Default for SslOption {
15779 fn default() -> Self {
15780 use std::convert::From;
15781 Self::from(0)
15782 }
15783 }
15784
15785 impl std::fmt::Display for SslOption {
15786 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15787 wkt::internal::display_enum(f, self.name(), self.value())
15788 }
15789 }
15790
15791 impl std::convert::From<i32> for SslOption {
15792 fn from(value: i32) -> Self {
15793 match value {
15794 0 => Self::Unspecified,
15795 1 => Self::Disable,
15796 2 => Self::Require,
15797 3 => Self::VerifyCa,
15798 _ => Self::UnknownValue(ssl_option::UnknownValue(
15799 wkt::internal::UnknownEnumValue::Integer(value),
15800 )),
15801 }
15802 }
15803 }
15804
15805 impl std::convert::From<&str> for SslOption {
15806 fn from(value: &str) -> Self {
15807 use std::string::ToString;
15808 match value {
15809 "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
15810 "DISABLE" => Self::Disable,
15811 "REQUIRE" => Self::Require,
15812 "VERIFY_CA" => Self::VerifyCa,
15813 _ => Self::UnknownValue(ssl_option::UnknownValue(
15814 wkt::internal::UnknownEnumValue::String(value.to_string()),
15815 )),
15816 }
15817 }
15818 }
15819
15820 impl serde::ser::Serialize for SslOption {
15821 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15822 where
15823 S: serde::Serializer,
15824 {
15825 match self {
15826 Self::Unspecified => serializer.serialize_i32(0),
15827 Self::Disable => serializer.serialize_i32(1),
15828 Self::Require => serializer.serialize_i32(2),
15829 Self::VerifyCa => serializer.serialize_i32(3),
15830 Self::UnknownValue(u) => u.0.serialize(serializer),
15831 }
15832 }
15833 }
15834
15835 impl<'de> serde::de::Deserialize<'de> for SslOption {
15836 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15837 where
15838 D: serde::Deserializer<'de>,
15839 {
15840 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
15841 ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
15842 ))
15843 }
15844 }
15845}
15846
15847/// Read-replica configuration for connecting to the primary instance.
15848#[derive(Clone, Default, PartialEq)]
15849#[non_exhaustive]
15850pub struct ReplicaConfiguration {
15851 /// This is always `sql#replicaConfiguration`.
15852 pub kind: std::string::String,
15853
15854 /// MySQL specific configuration when replicating from a MySQL on-premises
15855 /// primary instance. Replication configuration information such as the
15856 /// username, password, certificates, and keys are not stored in the instance
15857 /// metadata. The configuration information is used only to set up the
15858 /// replication connection and is stored by MySQL in a file named
15859 /// `master.info` in the data directory.
15860 pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
15861
15862 /// Specifies if the replica is the failover target. If the field is set to
15863 /// `true`, the replica will be designated as a failover replica. In case the
15864 /// primary instance fails, the replica instance will be promoted as the new
15865 /// primary instance. Only one replica can be specified as failover target, and
15866 /// the replica has to be in different zone with the primary instance.
15867 pub failover_target: std::option::Option<wkt::BoolValue>,
15868
15869 /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
15870 /// cascadable replica is a SQL Server cross region replica that supports
15871 /// replica(s) under it.
15872 pub cascadable_replica: std::option::Option<wkt::BoolValue>,
15873
15874 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15875}
15876
15877impl ReplicaConfiguration {
15878 /// Creates a new default instance.
15879 pub fn new() -> Self {
15880 std::default::Default::default()
15881 }
15882
15883 /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
15884 ///
15885 /// # Example
15886 /// ```ignore,no_run
15887 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15888 /// let x = ReplicaConfiguration::new().set_kind("example");
15889 /// ```
15890 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15891 self.kind = v.into();
15892 self
15893 }
15894
15895 /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15896 ///
15897 /// # Example
15898 /// ```ignore,no_run
15899 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15900 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15901 /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
15902 /// ```
15903 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
15904 where
15905 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15906 {
15907 self.mysql_replica_configuration = std::option::Option::Some(v.into());
15908 self
15909 }
15910
15911 /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15912 ///
15913 /// # Example
15914 /// ```ignore,no_run
15915 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15916 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15917 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
15918 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
15919 /// ```
15920 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15921 where
15922 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15923 {
15924 self.mysql_replica_configuration = v.map(|x| x.into());
15925 self
15926 }
15927
15928 /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15929 ///
15930 /// # Example
15931 /// ```ignore,no_run
15932 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15933 /// use wkt::BoolValue;
15934 /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
15935 /// ```
15936 pub fn set_failover_target<T>(mut self, v: T) -> Self
15937 where
15938 T: std::convert::Into<wkt::BoolValue>,
15939 {
15940 self.failover_target = std::option::Option::Some(v.into());
15941 self
15942 }
15943
15944 /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15945 ///
15946 /// # Example
15947 /// ```ignore,no_run
15948 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15949 /// use wkt::BoolValue;
15950 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
15951 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
15952 /// ```
15953 pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
15954 where
15955 T: std::convert::Into<wkt::BoolValue>,
15956 {
15957 self.failover_target = v.map(|x| x.into());
15958 self
15959 }
15960
15961 /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15962 ///
15963 /// # Example
15964 /// ```ignore,no_run
15965 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15966 /// use wkt::BoolValue;
15967 /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
15968 /// ```
15969 pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
15970 where
15971 T: std::convert::Into<wkt::BoolValue>,
15972 {
15973 self.cascadable_replica = std::option::Option::Some(v.into());
15974 self
15975 }
15976
15977 /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15978 ///
15979 /// # Example
15980 /// ```ignore,no_run
15981 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15982 /// use wkt::BoolValue;
15983 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
15984 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
15985 /// ```
15986 pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
15987 where
15988 T: std::convert::Into<wkt::BoolValue>,
15989 {
15990 self.cascadable_replica = v.map(|x| x.into());
15991 self
15992 }
15993}
15994
15995impl wkt::message::Message for ReplicaConfiguration {
15996 fn typename() -> &'static str {
15997 "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
15998 }
15999}
16000
16001/// Execute SQL statements request.
16002#[derive(Clone, Default, PartialEq)]
16003#[non_exhaustive]
16004pub struct SqlInstancesExecuteSqlRequest {
16005 /// Required. Database instance ID. This does not include the project ID.
16006 pub instance: std::string::String,
16007
16008 /// Required. Project ID of the project that contains the instance.
16009 pub project: std::string::String,
16010
16011 /// The request body.
16012 pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
16013
16014 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16015}
16016
16017impl SqlInstancesExecuteSqlRequest {
16018 /// Creates a new default instance.
16019 pub fn new() -> Self {
16020 std::default::Default::default()
16021 }
16022
16023 /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
16024 ///
16025 /// # Example
16026 /// ```ignore,no_run
16027 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16028 /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
16029 /// ```
16030 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16031 self.instance = v.into();
16032 self
16033 }
16034
16035 /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
16036 ///
16037 /// # Example
16038 /// ```ignore,no_run
16039 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16040 /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
16041 /// ```
16042 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16043 self.project = v.into();
16044 self
16045 }
16046
16047 /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
16048 ///
16049 /// # Example
16050 /// ```ignore,no_run
16051 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16052 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
16053 /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
16054 /// ```
16055 pub fn set_body<T>(mut self, v: T) -> Self
16056 where
16057 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
16058 {
16059 self.body = std::option::Option::Some(v.into());
16060 self
16061 }
16062
16063 /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
16064 ///
16065 /// # Example
16066 /// ```ignore,no_run
16067 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16068 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
16069 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
16070 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
16071 /// ```
16072 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16073 where
16074 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
16075 {
16076 self.body = v.map(|x| x.into());
16077 self
16078 }
16079}
16080
16081impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
16082 fn typename() -> &'static str {
16083 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
16084 }
16085}
16086
16087/// The request payload used to execute SQL statements.
16088#[derive(Clone, Default, PartialEq)]
16089#[non_exhaustive]
16090pub struct ExecuteSqlPayload {
16091 /// Optional. The name of an existing database user to connect to the database.
16092 /// When `auto_iam_authn` is set to true, this field is ignored and the API
16093 /// caller's IAM user is used.
16094 pub user: std::string::String,
16095
16096 /// Required. SQL statements to run on the database. It can be a single
16097 /// statement or a sequence of statements separated by semicolons.
16098 pub sql_statement: std::string::String,
16099
16100 /// Optional. Name of the database on which the statement will be executed.
16101 pub database: std::string::String,
16102
16103 /// Optional. The maximum number of rows returned per SQL statement.
16104 pub row_limit: i64,
16105
16106 /// Optional. Controls how the API should respond when the SQL execution result
16107 /// is incomplete due to the size limit or another error. The default mode is
16108 /// to throw an error.
16109 pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
16110
16111 /// Optional. Specifies the name of the application that is making the request.
16112 /// This field is used for telemetry. Only alphanumeric characters, dashes, and
16113 /// underscores are allowed. The maximum length is 32 characters.
16114 pub application: std::string::String,
16115
16116 /// Credentials for the database connection.
16117 pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
16118
16119 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16120}
16121
16122impl ExecuteSqlPayload {
16123 /// Creates a new default instance.
16124 pub fn new() -> Self {
16125 std::default::Default::default()
16126 }
16127
16128 /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
16129 ///
16130 /// # Example
16131 /// ```ignore,no_run
16132 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16133 /// let x = ExecuteSqlPayload::new().set_user("example");
16134 /// ```
16135 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16136 self.user = v.into();
16137 self
16138 }
16139
16140 /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
16141 ///
16142 /// # Example
16143 /// ```ignore,no_run
16144 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16145 /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
16146 /// ```
16147 pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16148 self.sql_statement = v.into();
16149 self
16150 }
16151
16152 /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
16153 ///
16154 /// # Example
16155 /// ```ignore,no_run
16156 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16157 /// let x = ExecuteSqlPayload::new().set_database("example");
16158 /// ```
16159 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16160 self.database = v.into();
16161 self
16162 }
16163
16164 /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
16165 ///
16166 /// # Example
16167 /// ```ignore,no_run
16168 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16169 /// let x = ExecuteSqlPayload::new().set_row_limit(42);
16170 /// ```
16171 pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16172 self.row_limit = v.into();
16173 self
16174 }
16175
16176 /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
16177 ///
16178 /// # Example
16179 /// ```ignore,no_run
16180 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16181 /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
16182 /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
16183 /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
16184 /// ```
16185 pub fn set_partial_result_mode<
16186 T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
16187 >(
16188 mut self,
16189 v: T,
16190 ) -> Self {
16191 self.partial_result_mode = v.into();
16192 self
16193 }
16194
16195 /// Sets the value of [application][crate::model::ExecuteSqlPayload::application].
16196 ///
16197 /// # Example
16198 /// ```ignore,no_run
16199 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16200 /// let x = ExecuteSqlPayload::new().set_application("example");
16201 /// ```
16202 pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16203 self.application = v.into();
16204 self
16205 }
16206
16207 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
16208 ///
16209 /// Note that all the setters affecting `user_password` are mutually
16210 /// exclusive.
16211 ///
16212 /// # Example
16213 /// ```ignore,no_run
16214 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16215 /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
16216 /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::AutoIamAuthn(true)));
16217 /// ```
16218 pub fn set_user_password<
16219 T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
16220 >(
16221 mut self,
16222 v: T,
16223 ) -> Self {
16224 self.user_password = v.into();
16225 self
16226 }
16227
16228 /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16229 /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
16230 /// holds a different branch.
16231 pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
16232 #[allow(unreachable_patterns)]
16233 self.user_password.as_ref().and_then(|v| match v {
16234 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
16235 std::option::Option::Some(v)
16236 }
16237 _ => std::option::Option::None,
16238 })
16239 }
16240
16241 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
16242 /// to hold a `AutoIamAuthn`.
16243 ///
16244 /// Note that all the setters affecting `user_password` are
16245 /// mutually exclusive.
16246 ///
16247 /// # Example
16248 /// ```ignore,no_run
16249 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
16250 /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
16251 /// assert!(x.auto_iam_authn().is_some());
16252 /// ```
16253 pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16254 self.user_password = std::option::Option::Some(
16255 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
16256 );
16257 self
16258 }
16259}
16260
16261impl wkt::message::Message for ExecuteSqlPayload {
16262 fn typename() -> &'static str {
16263 "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
16264 }
16265}
16266
16267/// Defines additional types related to [ExecuteSqlPayload].
16268pub mod execute_sql_payload {
16269 #[allow(unused_imports)]
16270 use super::*;
16271
16272 /// Controls how the API should respond when the SQL execution result exceeds
16273 /// 10 MB.
16274 ///
16275 /// # Working with unknown values
16276 ///
16277 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16278 /// additional enum variants at any time. Adding new variants is not considered
16279 /// a breaking change. Applications should write their code in anticipation of:
16280 ///
16281 /// - New values appearing in future releases of the client library, **and**
16282 /// - New values received dynamically, without application changes.
16283 ///
16284 /// Please consult the [Working with enums] section in the user guide for some
16285 /// guidelines.
16286 ///
16287 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16288 #[derive(Clone, Debug, PartialEq)]
16289 #[non_exhaustive]
16290 pub enum PartialResultMode {
16291 /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
16292 Unspecified,
16293 /// Throw an error if the result exceeds 10 MB or if only a partial result
16294 /// can be retrieved. Don't return the result.
16295 FailPartialResult,
16296 /// Return a truncated result and set `partial_result` to true if the result
16297 /// exceeds 10 MB or if only a partial result can be retrieved due to error.
16298 /// Don't throw an error.
16299 AllowPartialResult,
16300 /// If set, the enum was initialized with an unknown value.
16301 ///
16302 /// Applications can examine the value using [PartialResultMode::value] or
16303 /// [PartialResultMode::name].
16304 UnknownValue(partial_result_mode::UnknownValue),
16305 }
16306
16307 #[doc(hidden)]
16308 pub mod partial_result_mode {
16309 #[allow(unused_imports)]
16310 use super::*;
16311 #[derive(Clone, Debug, PartialEq)]
16312 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16313 }
16314
16315 impl PartialResultMode {
16316 /// Gets the enum value.
16317 ///
16318 /// Returns `None` if the enum contains an unknown value deserialized from
16319 /// the string representation of enums.
16320 pub fn value(&self) -> std::option::Option<i32> {
16321 match self {
16322 Self::Unspecified => std::option::Option::Some(0),
16323 Self::FailPartialResult => std::option::Option::Some(1),
16324 Self::AllowPartialResult => std::option::Option::Some(2),
16325 Self::UnknownValue(u) => u.0.value(),
16326 }
16327 }
16328
16329 /// Gets the enum value as a string.
16330 ///
16331 /// Returns `None` if the enum contains an unknown value deserialized from
16332 /// the integer representation of enums.
16333 pub fn name(&self) -> std::option::Option<&str> {
16334 match self {
16335 Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
16336 Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
16337 Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
16338 Self::UnknownValue(u) => u.0.name(),
16339 }
16340 }
16341 }
16342
16343 impl std::default::Default for PartialResultMode {
16344 fn default() -> Self {
16345 use std::convert::From;
16346 Self::from(0)
16347 }
16348 }
16349
16350 impl std::fmt::Display for PartialResultMode {
16351 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16352 wkt::internal::display_enum(f, self.name(), self.value())
16353 }
16354 }
16355
16356 impl std::convert::From<i32> for PartialResultMode {
16357 fn from(value: i32) -> Self {
16358 match value {
16359 0 => Self::Unspecified,
16360 1 => Self::FailPartialResult,
16361 2 => Self::AllowPartialResult,
16362 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16363 wkt::internal::UnknownEnumValue::Integer(value),
16364 )),
16365 }
16366 }
16367 }
16368
16369 impl std::convert::From<&str> for PartialResultMode {
16370 fn from(value: &str) -> Self {
16371 use std::string::ToString;
16372 match value {
16373 "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
16374 "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
16375 "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
16376 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
16377 wkt::internal::UnknownEnumValue::String(value.to_string()),
16378 )),
16379 }
16380 }
16381 }
16382
16383 impl serde::ser::Serialize for PartialResultMode {
16384 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16385 where
16386 S: serde::Serializer,
16387 {
16388 match self {
16389 Self::Unspecified => serializer.serialize_i32(0),
16390 Self::FailPartialResult => serializer.serialize_i32(1),
16391 Self::AllowPartialResult => serializer.serialize_i32(2),
16392 Self::UnknownValue(u) => u.0.serialize(serializer),
16393 }
16394 }
16395 }
16396
16397 impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
16398 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16399 where
16400 D: serde::Deserializer<'de>,
16401 {
16402 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
16403 ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
16404 ))
16405 }
16406 }
16407
16408 /// Credentials for the database connection.
16409 #[derive(Clone, Debug, PartialEq)]
16410 #[non_exhaustive]
16411 pub enum UserPassword {
16412 /// Optional. When set to `true`, the API caller identity associated with the
16413 /// request is used for database authentication. The API caller must be an
16414 /// IAM user in the database.
16415 AutoIamAuthn(bool),
16416 }
16417}
16418
16419/// Execute SQL statements response.
16420#[derive(Clone, Default, PartialEq)]
16421#[non_exhaustive]
16422pub struct SqlInstancesExecuteSqlResponse {
16423 /// A list of notices and warnings generated during query execution.
16424 /// For PostgreSQL, this includes all notices and warnings.
16425 /// For MySQL, this includes warnings generated by the last executed statement.
16426 /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
16427 /// be executed after each statement.
16428 pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
16429
16430 /// The additional metadata information regarding the execution of the SQL
16431 /// statements.
16432 pub metadata: std::option::Option<crate::model::Metadata>,
16433
16434 /// The list of results after executing all the SQL statements.
16435 pub results: std::vec::Vec<crate::model::QueryResult>,
16436
16437 /// Contains the error from the database if the SQL execution failed.
16438 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16439
16440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16441}
16442
16443impl SqlInstancesExecuteSqlResponse {
16444 /// Creates a new default instance.
16445 pub fn new() -> Self {
16446 std::default::Default::default()
16447 }
16448
16449 /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
16450 ///
16451 /// # Example
16452 /// ```ignore,no_run
16453 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16454 /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16455 /// let x = SqlInstancesExecuteSqlResponse::new()
16456 /// .set_messages([
16457 /// Message::default()/* use setters */,
16458 /// Message::default()/* use (different) setters */,
16459 /// ]);
16460 /// ```
16461 pub fn set_messages<T, V>(mut self, v: T) -> Self
16462 where
16463 T: std::iter::IntoIterator<Item = V>,
16464 V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
16465 {
16466 use std::iter::Iterator;
16467 self.messages = v.into_iter().map(|i| i.into()).collect();
16468 self
16469 }
16470
16471 /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16472 ///
16473 /// # Example
16474 /// ```ignore,no_run
16475 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16476 /// use google_cloud_sql_v1::model::Metadata;
16477 /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
16478 /// ```
16479 pub fn set_metadata<T>(mut self, v: T) -> Self
16480 where
16481 T: std::convert::Into<crate::model::Metadata>,
16482 {
16483 self.metadata = std::option::Option::Some(v.into());
16484 self
16485 }
16486
16487 /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16488 ///
16489 /// # Example
16490 /// ```ignore,no_run
16491 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16492 /// use google_cloud_sql_v1::model::Metadata;
16493 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
16494 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
16495 /// ```
16496 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16497 where
16498 T: std::convert::Into<crate::model::Metadata>,
16499 {
16500 self.metadata = v.map(|x| x.into());
16501 self
16502 }
16503
16504 /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
16505 ///
16506 /// # Example
16507 /// ```ignore,no_run
16508 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16509 /// use google_cloud_sql_v1::model::QueryResult;
16510 /// let x = SqlInstancesExecuteSqlResponse::new()
16511 /// .set_results([
16512 /// QueryResult::default()/* use setters */,
16513 /// QueryResult::default()/* use (different) setters */,
16514 /// ]);
16515 /// ```
16516 pub fn set_results<T, V>(mut self, v: T) -> Self
16517 where
16518 T: std::iter::IntoIterator<Item = V>,
16519 V: std::convert::Into<crate::model::QueryResult>,
16520 {
16521 use std::iter::Iterator;
16522 self.results = v.into_iter().map(|i| i.into()).collect();
16523 self
16524 }
16525
16526 /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16527 ///
16528 /// # Example
16529 /// ```ignore,no_run
16530 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16531 /// use google_cloud_rpc::model::Status;
16532 /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
16533 /// ```
16534 pub fn set_status<T>(mut self, v: T) -> Self
16535 where
16536 T: std::convert::Into<google_cloud_rpc::model::Status>,
16537 {
16538 self.status = std::option::Option::Some(v.into());
16539 self
16540 }
16541
16542 /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16543 ///
16544 /// # Example
16545 /// ```ignore,no_run
16546 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16547 /// use google_cloud_rpc::model::Status;
16548 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
16549 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
16550 /// ```
16551 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16552 where
16553 T: std::convert::Into<google_cloud_rpc::model::Status>,
16554 {
16555 self.status = v.map(|x| x.into());
16556 self
16557 }
16558}
16559
16560impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
16561 fn typename() -> &'static str {
16562 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
16563 }
16564}
16565
16566/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
16567pub mod sql_instances_execute_sql_response {
16568 #[allow(unused_imports)]
16569 use super::*;
16570
16571 /// Represents a notice or warning message from the database.
16572 #[derive(Clone, Default, PartialEq)]
16573 #[non_exhaustive]
16574 pub struct Message {
16575 /// The full message string.
16576 /// For PostgreSQL, this is a formatted string that may include severity,
16577 /// code, and the notice/warning message.
16578 /// For MySQL, this contains the warning message.
16579 pub message: std::option::Option<std::string::String>,
16580
16581 /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
16582 /// MySQL).
16583 pub severity: std::option::Option<std::string::String>,
16584
16585 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16586 }
16587
16588 impl Message {
16589 /// Creates a new default instance.
16590 pub fn new() -> Self {
16591 std::default::Default::default()
16592 }
16593
16594 /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16595 ///
16596 /// # Example
16597 /// ```ignore,no_run
16598 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16599 /// let x = Message::new().set_message("example");
16600 /// ```
16601 pub fn set_message<T>(mut self, v: T) -> Self
16602 where
16603 T: std::convert::Into<std::string::String>,
16604 {
16605 self.message = std::option::Option::Some(v.into());
16606 self
16607 }
16608
16609 /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16610 ///
16611 /// # Example
16612 /// ```ignore,no_run
16613 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16614 /// let x = Message::new().set_or_clear_message(Some("example"));
16615 /// let x = Message::new().set_or_clear_message(None::<String>);
16616 /// ```
16617 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
16618 where
16619 T: std::convert::Into<std::string::String>,
16620 {
16621 self.message = v.map(|x| x.into());
16622 self
16623 }
16624
16625 /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16626 ///
16627 /// # Example
16628 /// ```ignore,no_run
16629 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16630 /// let x = Message::new().set_severity("example");
16631 /// ```
16632 pub fn set_severity<T>(mut self, v: T) -> Self
16633 where
16634 T: std::convert::Into<std::string::String>,
16635 {
16636 self.severity = std::option::Option::Some(v.into());
16637 self
16638 }
16639
16640 /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16641 ///
16642 /// # Example
16643 /// ```ignore,no_run
16644 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16645 /// let x = Message::new().set_or_clear_severity(Some("example"));
16646 /// let x = Message::new().set_or_clear_severity(None::<String>);
16647 /// ```
16648 pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
16649 where
16650 T: std::convert::Into<std::string::String>,
16651 {
16652 self.severity = v.map(|x| x.into());
16653 self
16654 }
16655 }
16656
16657 impl wkt::message::Message for Message {
16658 fn typename() -> &'static str {
16659 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
16660 }
16661 }
16662}
16663
16664/// QueryResult contains the result of executing a single SQL statement.
16665#[derive(Clone, Default, PartialEq)]
16666#[non_exhaustive]
16667pub struct QueryResult {
16668 /// List of columns included in the result. This also includes the data type
16669 /// of the column.
16670 pub columns: std::vec::Vec<crate::model::Column>,
16671
16672 /// Rows returned by the SQL statement.
16673 pub rows: std::vec::Vec<crate::model::Row>,
16674
16675 /// Message related to the SQL execution result.
16676 pub message: std::string::String,
16677
16678 /// Set to true if the SQL execution's result is truncated due to size limits
16679 /// or an error retrieving results.
16680 pub partial_result: bool,
16681
16682 /// If results were truncated due to an error, details of that error.
16683 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16684
16685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16686}
16687
16688impl QueryResult {
16689 /// Creates a new default instance.
16690 pub fn new() -> Self {
16691 std::default::Default::default()
16692 }
16693
16694 /// Sets the value of [columns][crate::model::QueryResult::columns].
16695 ///
16696 /// # Example
16697 /// ```ignore,no_run
16698 /// # use google_cloud_sql_v1::model::QueryResult;
16699 /// use google_cloud_sql_v1::model::Column;
16700 /// let x = QueryResult::new()
16701 /// .set_columns([
16702 /// Column::default()/* use setters */,
16703 /// Column::default()/* use (different) setters */,
16704 /// ]);
16705 /// ```
16706 pub fn set_columns<T, V>(mut self, v: T) -> Self
16707 where
16708 T: std::iter::IntoIterator<Item = V>,
16709 V: std::convert::Into<crate::model::Column>,
16710 {
16711 use std::iter::Iterator;
16712 self.columns = v.into_iter().map(|i| i.into()).collect();
16713 self
16714 }
16715
16716 /// Sets the value of [rows][crate::model::QueryResult::rows].
16717 ///
16718 /// # Example
16719 /// ```ignore,no_run
16720 /// # use google_cloud_sql_v1::model::QueryResult;
16721 /// use google_cloud_sql_v1::model::Row;
16722 /// let x = QueryResult::new()
16723 /// .set_rows([
16724 /// Row::default()/* use setters */,
16725 /// Row::default()/* use (different) setters */,
16726 /// ]);
16727 /// ```
16728 pub fn set_rows<T, V>(mut self, v: T) -> Self
16729 where
16730 T: std::iter::IntoIterator<Item = V>,
16731 V: std::convert::Into<crate::model::Row>,
16732 {
16733 use std::iter::Iterator;
16734 self.rows = v.into_iter().map(|i| i.into()).collect();
16735 self
16736 }
16737
16738 /// Sets the value of [message][crate::model::QueryResult::message].
16739 ///
16740 /// # Example
16741 /// ```ignore,no_run
16742 /// # use google_cloud_sql_v1::model::QueryResult;
16743 /// let x = QueryResult::new().set_message("example");
16744 /// ```
16745 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16746 self.message = v.into();
16747 self
16748 }
16749
16750 /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
16751 ///
16752 /// # Example
16753 /// ```ignore,no_run
16754 /// # use google_cloud_sql_v1::model::QueryResult;
16755 /// let x = QueryResult::new().set_partial_result(true);
16756 /// ```
16757 pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16758 self.partial_result = v.into();
16759 self
16760 }
16761
16762 /// Sets the value of [status][crate::model::QueryResult::status].
16763 ///
16764 /// # Example
16765 /// ```ignore,no_run
16766 /// # use google_cloud_sql_v1::model::QueryResult;
16767 /// use google_cloud_rpc::model::Status;
16768 /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
16769 /// ```
16770 pub fn set_status<T>(mut self, v: T) -> Self
16771 where
16772 T: std::convert::Into<google_cloud_rpc::model::Status>,
16773 {
16774 self.status = std::option::Option::Some(v.into());
16775 self
16776 }
16777
16778 /// Sets or clears the value of [status][crate::model::QueryResult::status].
16779 ///
16780 /// # Example
16781 /// ```ignore,no_run
16782 /// # use google_cloud_sql_v1::model::QueryResult;
16783 /// use google_cloud_rpc::model::Status;
16784 /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
16785 /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
16786 /// ```
16787 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16788 where
16789 T: std::convert::Into<google_cloud_rpc::model::Status>,
16790 {
16791 self.status = v.map(|x| x.into());
16792 self
16793 }
16794}
16795
16796impl wkt::message::Message for QueryResult {
16797 fn typename() -> &'static str {
16798 "type.googleapis.com/google.cloud.sql.v1.QueryResult"
16799 }
16800}
16801
16802/// Contains the name and datatype of a column.
16803#[derive(Clone, Default, PartialEq)]
16804#[non_exhaustive]
16805pub struct Column {
16806 /// Name of the column.
16807 pub name: std::string::String,
16808
16809 /// Datatype of the column.
16810 pub r#type: std::string::String,
16811
16812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16813}
16814
16815impl Column {
16816 /// Creates a new default instance.
16817 pub fn new() -> Self {
16818 std::default::Default::default()
16819 }
16820
16821 /// Sets the value of [name][crate::model::Column::name].
16822 ///
16823 /// # Example
16824 /// ```ignore,no_run
16825 /// # use google_cloud_sql_v1::model::Column;
16826 /// let x = Column::new().set_name("example");
16827 /// ```
16828 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16829 self.name = v.into();
16830 self
16831 }
16832
16833 /// Sets the value of [r#type][crate::model::Column::type].
16834 ///
16835 /// # Example
16836 /// ```ignore,no_run
16837 /// # use google_cloud_sql_v1::model::Column;
16838 /// let x = Column::new().set_type("example");
16839 /// ```
16840 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16841 self.r#type = v.into();
16842 self
16843 }
16844}
16845
16846impl wkt::message::Message for Column {
16847 fn typename() -> &'static str {
16848 "type.googleapis.com/google.cloud.sql.v1.Column"
16849 }
16850}
16851
16852/// Contains the values for a row.
16853#[derive(Clone, Default, PartialEq)]
16854#[non_exhaustive]
16855pub struct Row {
16856 /// The values for the row.
16857 pub values: std::vec::Vec<crate::model::Value>,
16858
16859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16860}
16861
16862impl Row {
16863 /// Creates a new default instance.
16864 pub fn new() -> Self {
16865 std::default::Default::default()
16866 }
16867
16868 /// Sets the value of [values][crate::model::Row::values].
16869 ///
16870 /// # Example
16871 /// ```ignore,no_run
16872 /// # use google_cloud_sql_v1::model::Row;
16873 /// use google_cloud_sql_v1::model::Value;
16874 /// let x = Row::new()
16875 /// .set_values([
16876 /// Value::default()/* use setters */,
16877 /// Value::default()/* use (different) setters */,
16878 /// ]);
16879 /// ```
16880 pub fn set_values<T, V>(mut self, v: T) -> Self
16881 where
16882 T: std::iter::IntoIterator<Item = V>,
16883 V: std::convert::Into<crate::model::Value>,
16884 {
16885 use std::iter::Iterator;
16886 self.values = v.into_iter().map(|i| i.into()).collect();
16887 self
16888 }
16889}
16890
16891impl wkt::message::Message for Row {
16892 fn typename() -> &'static str {
16893 "type.googleapis.com/google.cloud.sql.v1.Row"
16894 }
16895}
16896
16897/// The cell value of the table.
16898#[derive(Clone, Default, PartialEq)]
16899#[non_exhaustive]
16900pub struct Value {
16901 /// The cell value in string format.
16902 pub value: std::string::String,
16903
16904 /// If cell value is null, then this flag will be set to true.
16905 pub null_value: bool,
16906
16907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16908}
16909
16910impl Value {
16911 /// Creates a new default instance.
16912 pub fn new() -> Self {
16913 std::default::Default::default()
16914 }
16915
16916 /// Sets the value of [value][crate::model::Value::value].
16917 ///
16918 /// # Example
16919 /// ```ignore,no_run
16920 /// # use google_cloud_sql_v1::model::Value;
16921 /// let x = Value::new().set_value("example");
16922 /// ```
16923 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16924 self.value = v.into();
16925 self
16926 }
16927
16928 /// Sets the value of [null_value][crate::model::Value::null_value].
16929 ///
16930 /// # Example
16931 /// ```ignore,no_run
16932 /// # use google_cloud_sql_v1::model::Value;
16933 /// let x = Value::new().set_null_value(true);
16934 /// ```
16935 pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16936 self.null_value = v.into();
16937 self
16938 }
16939}
16940
16941impl wkt::message::Message for Value {
16942 fn typename() -> &'static str {
16943 "type.googleapis.com/google.cloud.sql.v1.Value"
16944 }
16945}
16946
16947/// The additional metadata information regarding the execution of the SQL
16948/// statements.
16949#[derive(Clone, Default, PartialEq)]
16950#[non_exhaustive]
16951pub struct Metadata {
16952 /// The time taken to execute the SQL statements.
16953 pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
16954
16955 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16956}
16957
16958impl Metadata {
16959 /// Creates a new default instance.
16960 pub fn new() -> Self {
16961 std::default::Default::default()
16962 }
16963
16964 /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16965 ///
16966 /// # Example
16967 /// ```ignore,no_run
16968 /// # use google_cloud_sql_v1::model::Metadata;
16969 /// use wkt::Duration;
16970 /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
16971 /// ```
16972 pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
16973 where
16974 T: std::convert::Into<wkt::Duration>,
16975 {
16976 self.sql_statement_execution_time = std::option::Option::Some(v.into());
16977 self
16978 }
16979
16980 /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16981 ///
16982 /// # Example
16983 /// ```ignore,no_run
16984 /// # use google_cloud_sql_v1::model::Metadata;
16985 /// use wkt::Duration;
16986 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
16987 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
16988 /// ```
16989 pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
16990 where
16991 T: std::convert::Into<wkt::Duration>,
16992 {
16993 self.sql_statement_execution_time = v.map(|x| x.into());
16994 self
16995 }
16996}
16997
16998impl wkt::message::Message for Metadata {
16999 fn typename() -> &'static str {
17000 "type.googleapis.com/google.cloud.sql.v1.Metadata"
17001 }
17002}
17003
17004/// Request to acquire a lease for SSRS.
17005#[derive(Clone, Default, PartialEq)]
17006#[non_exhaustive]
17007pub struct SqlInstancesAcquireSsrsLeaseRequest {
17008 /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
17009 /// composed of lowercase letters, numbers, and hyphens, and it must start with
17010 /// a letter. The total length must be 98 characters or less (Example:
17011 /// instance-id).
17012 pub instance: std::string::String,
17013
17014 /// Required. Project ID of the project that contains the instance (Example:
17015 /// project-id).
17016 pub project: std::string::String,
17017
17018 /// Required. The request body.
17019 pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
17020
17021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17022}
17023
17024impl SqlInstancesAcquireSsrsLeaseRequest {
17025 /// Creates a new default instance.
17026 pub fn new() -> Self {
17027 std::default::Default::default()
17028 }
17029
17030 /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
17031 ///
17032 /// # Example
17033 /// ```ignore,no_run
17034 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17035 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
17036 /// ```
17037 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17038 self.instance = v.into();
17039 self
17040 }
17041
17042 /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
17043 ///
17044 /// # Example
17045 /// ```ignore,no_run
17046 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17047 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
17048 /// ```
17049 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17050 self.project = v.into();
17051 self
17052 }
17053
17054 /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
17055 ///
17056 /// # Example
17057 /// ```ignore,no_run
17058 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17059 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
17060 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
17061 /// ```
17062 pub fn set_body<T>(mut self, v: T) -> Self
17063 where
17064 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
17065 {
17066 self.body = std::option::Option::Some(v.into());
17067 self
17068 }
17069
17070 /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
17071 ///
17072 /// # Example
17073 /// ```ignore,no_run
17074 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17075 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
17076 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
17077 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
17078 /// ```
17079 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
17080 where
17081 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
17082 {
17083 self.body = v.map(|x| x.into());
17084 self
17085 }
17086}
17087
17088impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
17089 fn typename() -> &'static str {
17090 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
17091 }
17092}
17093
17094/// Response for the acquire SSRS lease request.
17095#[derive(Clone, Default, PartialEq)]
17096#[non_exhaustive]
17097pub struct SqlInstancesAcquireSsrsLeaseResponse {
17098 /// The unique identifier for this operation.
17099 pub operation_id: std::string::String,
17100
17101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17102}
17103
17104impl SqlInstancesAcquireSsrsLeaseResponse {
17105 /// Creates a new default instance.
17106 pub fn new() -> Self {
17107 std::default::Default::default()
17108 }
17109
17110 /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
17111 ///
17112 /// # Example
17113 /// ```ignore,no_run
17114 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
17115 /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
17116 /// ```
17117 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17118 self.operation_id = v.into();
17119 self
17120 }
17121}
17122
17123impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
17124 fn typename() -> &'static str {
17125 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
17126 }
17127}
17128
17129/// Request to release a lease for SSRS.
17130#[derive(Clone, Default, PartialEq)]
17131#[non_exhaustive]
17132pub struct SqlInstancesReleaseSsrsLeaseRequest {
17133 /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
17134 /// The instance ID contains lowercase letters, numbers, and hyphens, and it
17135 /// must start with a letter. This ID can have a maximum length of 98
17136 /// characters.
17137 pub instance: std::string::String,
17138
17139 /// Required. The project ID that contains the instance.
17140 pub project: std::string::String,
17141
17142 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17143}
17144
17145impl SqlInstancesReleaseSsrsLeaseRequest {
17146 /// Creates a new default instance.
17147 pub fn new() -> Self {
17148 std::default::Default::default()
17149 }
17150
17151 /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
17152 ///
17153 /// # Example
17154 /// ```ignore,no_run
17155 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
17156 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
17157 /// ```
17158 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17159 self.instance = v.into();
17160 self
17161 }
17162
17163 /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
17164 ///
17165 /// # Example
17166 /// ```ignore,no_run
17167 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
17168 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
17169 /// ```
17170 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17171 self.project = v.into();
17172 self
17173 }
17174}
17175
17176impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
17177 fn typename() -> &'static str {
17178 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
17179 }
17180}
17181
17182/// Response for the release SSRS lease request.
17183#[derive(Clone, Default, PartialEq)]
17184#[non_exhaustive]
17185pub struct SqlInstancesReleaseSsrsLeaseResponse {
17186 /// The unique identifier for this operation.
17187 pub operation_id: std::string::String,
17188
17189 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17190}
17191
17192impl SqlInstancesReleaseSsrsLeaseResponse {
17193 /// Creates a new default instance.
17194 pub fn new() -> Self {
17195 std::default::Default::default()
17196 }
17197
17198 /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
17199 ///
17200 /// # Example
17201 /// ```ignore,no_run
17202 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
17203 /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
17204 /// ```
17205 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17206 self.operation_id = v.into();
17207 self
17208 }
17209}
17210
17211impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
17212 fn typename() -> &'static str {
17213 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
17214 }
17215}
17216
17217/// Request to perform a point in time restore on a Google Cloud Backup and
17218/// Disaster Recovery managed instance.
17219#[derive(Clone, Default, PartialEq)]
17220#[non_exhaustive]
17221pub struct SqlInstancesPointInTimeRestoreRequest {
17222 /// Required. The parent resource where you created this instance.
17223 /// Format: projects/{project}
17224 pub parent: std::string::String,
17225
17226 /// Required. The context for request to perform a PITR on a Google Cloud
17227 /// Backup and Disaster Recovery managed instance.
17228 pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
17229
17230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17231}
17232
17233impl SqlInstancesPointInTimeRestoreRequest {
17234 /// Creates a new default instance.
17235 pub fn new() -> Self {
17236 std::default::Default::default()
17237 }
17238
17239 /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
17240 ///
17241 /// # Example
17242 /// ```ignore,no_run
17243 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17244 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
17245 /// ```
17246 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17247 self.parent = v.into();
17248 self
17249 }
17250
17251 /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17252 ///
17253 /// # Example
17254 /// ```ignore,no_run
17255 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17256 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17257 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
17258 /// ```
17259 pub fn set_context<T>(mut self, v: T) -> Self
17260 where
17261 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17262 {
17263 self.context = std::option::Option::Some(v.into());
17264 self
17265 }
17266
17267 /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
17268 ///
17269 /// # Example
17270 /// ```ignore,no_run
17271 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
17272 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
17273 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
17274 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
17275 /// ```
17276 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
17277 where
17278 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
17279 {
17280 self.context = v.map(|x| x.into());
17281 self
17282 }
17283}
17284
17285impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
17286 fn typename() -> &'static str {
17287 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
17288 }
17289}
17290
17291/// Operations get request.
17292#[derive(Clone, Default, PartialEq)]
17293#[non_exhaustive]
17294pub struct SqlOperationsGetRequest {
17295 /// Required. Instance operation ID.
17296 pub operation: std::string::String,
17297
17298 /// Required. Project ID of the project that contains the instance.
17299 pub project: std::string::String,
17300
17301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17302}
17303
17304impl SqlOperationsGetRequest {
17305 /// Creates a new default instance.
17306 pub fn new() -> Self {
17307 std::default::Default::default()
17308 }
17309
17310 /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
17311 ///
17312 /// # Example
17313 /// ```ignore,no_run
17314 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17315 /// let x = SqlOperationsGetRequest::new().set_operation("example");
17316 /// ```
17317 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17318 self.operation = v.into();
17319 self
17320 }
17321
17322 /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
17323 ///
17324 /// # Example
17325 /// ```ignore,no_run
17326 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
17327 /// let x = SqlOperationsGetRequest::new().set_project("example");
17328 /// ```
17329 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17330 self.project = v.into();
17331 self
17332 }
17333}
17334
17335impl wkt::message::Message for SqlOperationsGetRequest {
17336 fn typename() -> &'static str {
17337 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
17338 }
17339}
17340
17341/// Operations list request.
17342#[derive(Clone, Default, PartialEq)]
17343#[non_exhaustive]
17344pub struct SqlOperationsListRequest {
17345 /// Cloud SQL instance ID. This does not include the project ID.
17346 pub instance: std::string::String,
17347
17348 /// Maximum number of operations per response.
17349 pub max_results: u32,
17350
17351 /// A previously-returned page token representing part of the larger set of
17352 /// results to view.
17353 pub page_token: std::string::String,
17354
17355 /// Project ID of the project that contains the instance.
17356 pub project: std::string::String,
17357
17358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17359}
17360
17361impl SqlOperationsListRequest {
17362 /// Creates a new default instance.
17363 pub fn new() -> Self {
17364 std::default::Default::default()
17365 }
17366
17367 /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
17368 ///
17369 /// # Example
17370 /// ```ignore,no_run
17371 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17372 /// let x = SqlOperationsListRequest::new().set_instance("example");
17373 /// ```
17374 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17375 self.instance = v.into();
17376 self
17377 }
17378
17379 /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
17380 ///
17381 /// # Example
17382 /// ```ignore,no_run
17383 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17384 /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
17385 /// ```
17386 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
17387 self.max_results = v.into();
17388 self
17389 }
17390
17391 /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
17392 ///
17393 /// # Example
17394 /// ```ignore,no_run
17395 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17396 /// let x = SqlOperationsListRequest::new().set_page_token("example");
17397 /// ```
17398 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17399 self.page_token = v.into();
17400 self
17401 }
17402
17403 /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
17404 ///
17405 /// # Example
17406 /// ```ignore,no_run
17407 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
17408 /// let x = SqlOperationsListRequest::new().set_project("example");
17409 /// ```
17410 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17411 self.project = v.into();
17412 self
17413 }
17414}
17415
17416impl wkt::message::Message for SqlOperationsListRequest {
17417 fn typename() -> &'static str {
17418 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
17419 }
17420}
17421
17422/// Operations list response.
17423#[derive(Clone, Default, PartialEq)]
17424#[non_exhaustive]
17425pub struct OperationsListResponse {
17426 /// This is always `sql#operationsList`.
17427 pub kind: std::string::String,
17428
17429 /// List of operation resources.
17430 pub items: std::vec::Vec<crate::model::Operation>,
17431
17432 /// The continuation token, used to page through large result sets. Provide
17433 /// this value in a subsequent request to return the next page of results.
17434 pub next_page_token: std::string::String,
17435
17436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17437}
17438
17439impl OperationsListResponse {
17440 /// Creates a new default instance.
17441 pub fn new() -> Self {
17442 std::default::Default::default()
17443 }
17444
17445 /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
17446 ///
17447 /// # Example
17448 /// ```ignore,no_run
17449 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17450 /// let x = OperationsListResponse::new().set_kind("example");
17451 /// ```
17452 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17453 self.kind = v.into();
17454 self
17455 }
17456
17457 /// Sets the value of [items][crate::model::OperationsListResponse::items].
17458 ///
17459 /// # Example
17460 /// ```ignore,no_run
17461 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17462 /// use google_cloud_sql_v1::model::Operation;
17463 /// let x = OperationsListResponse::new()
17464 /// .set_items([
17465 /// Operation::default()/* use setters */,
17466 /// Operation::default()/* use (different) setters */,
17467 /// ]);
17468 /// ```
17469 pub fn set_items<T, V>(mut self, v: T) -> Self
17470 where
17471 T: std::iter::IntoIterator<Item = V>,
17472 V: std::convert::Into<crate::model::Operation>,
17473 {
17474 use std::iter::Iterator;
17475 self.items = v.into_iter().map(|i| i.into()).collect();
17476 self
17477 }
17478
17479 /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
17480 ///
17481 /// # Example
17482 /// ```ignore,no_run
17483 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17484 /// let x = OperationsListResponse::new().set_next_page_token("example");
17485 /// ```
17486 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17487 self.next_page_token = v.into();
17488 self
17489 }
17490}
17491
17492impl wkt::message::Message for OperationsListResponse {
17493 fn typename() -> &'static str {
17494 "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
17495 }
17496}
17497
17498#[doc(hidden)]
17499impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
17500 type PageItem = crate::model::Operation;
17501
17502 fn items(self) -> std::vec::Vec<Self::PageItem> {
17503 self.items
17504 }
17505
17506 fn next_page_token(&self) -> std::string::String {
17507 use std::clone::Clone;
17508 self.next_page_token.clone()
17509 }
17510}
17511
17512/// Operations cancel request.
17513#[derive(Clone, Default, PartialEq)]
17514#[non_exhaustive]
17515pub struct SqlOperationsCancelRequest {
17516 /// Instance operation ID.
17517 pub operation: std::string::String,
17518
17519 /// Project ID of the project that contains the instance.
17520 pub project: std::string::String,
17521
17522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17523}
17524
17525impl SqlOperationsCancelRequest {
17526 /// Creates a new default instance.
17527 pub fn new() -> Self {
17528 std::default::Default::default()
17529 }
17530
17531 /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
17532 ///
17533 /// # Example
17534 /// ```ignore,no_run
17535 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17536 /// let x = SqlOperationsCancelRequest::new().set_operation("example");
17537 /// ```
17538 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17539 self.operation = v.into();
17540 self
17541 }
17542
17543 /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
17544 ///
17545 /// # Example
17546 /// ```ignore,no_run
17547 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17548 /// let x = SqlOperationsCancelRequest::new().set_project("example");
17549 /// ```
17550 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17551 self.project = v.into();
17552 self
17553 }
17554}
17555
17556impl wkt::message::Message for SqlOperationsCancelRequest {
17557 fn typename() -> &'static str {
17558 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
17559 }
17560}
17561
17562/// An entry for an Access Control list.
17563#[derive(Clone, Default, PartialEq)]
17564#[non_exhaustive]
17565pub struct AclEntry {
17566 /// The allowlisted value for the access control list.
17567 pub value: std::string::String,
17568
17569 /// The time when this access control entry expires in
17570 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
17571 /// `2012-11-15T16:19:00.094Z`.
17572 pub expiration_time: std::option::Option<wkt::Timestamp>,
17573
17574 /// Optional. A label to identify this entry.
17575 pub name: std::string::String,
17576
17577 /// This is always `sql#aclEntry`.
17578 pub kind: std::string::String,
17579
17580 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17581}
17582
17583impl AclEntry {
17584 /// Creates a new default instance.
17585 pub fn new() -> Self {
17586 std::default::Default::default()
17587 }
17588
17589 /// Sets the value of [value][crate::model::AclEntry::value].
17590 ///
17591 /// # Example
17592 /// ```ignore,no_run
17593 /// # use google_cloud_sql_v1::model::AclEntry;
17594 /// let x = AclEntry::new().set_value("example");
17595 /// ```
17596 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17597 self.value = v.into();
17598 self
17599 }
17600
17601 /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
17602 ///
17603 /// # Example
17604 /// ```ignore,no_run
17605 /// # use google_cloud_sql_v1::model::AclEntry;
17606 /// use wkt::Timestamp;
17607 /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
17608 /// ```
17609 pub fn set_expiration_time<T>(mut self, v: T) -> Self
17610 where
17611 T: std::convert::Into<wkt::Timestamp>,
17612 {
17613 self.expiration_time = std::option::Option::Some(v.into());
17614 self
17615 }
17616
17617 /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
17618 ///
17619 /// # Example
17620 /// ```ignore,no_run
17621 /// # use google_cloud_sql_v1::model::AclEntry;
17622 /// use wkt::Timestamp;
17623 /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
17624 /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
17625 /// ```
17626 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
17627 where
17628 T: std::convert::Into<wkt::Timestamp>,
17629 {
17630 self.expiration_time = v.map(|x| x.into());
17631 self
17632 }
17633
17634 /// Sets the value of [name][crate::model::AclEntry::name].
17635 ///
17636 /// # Example
17637 /// ```ignore,no_run
17638 /// # use google_cloud_sql_v1::model::AclEntry;
17639 /// let x = AclEntry::new().set_name("example");
17640 /// ```
17641 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17642 self.name = v.into();
17643 self
17644 }
17645
17646 /// Sets the value of [kind][crate::model::AclEntry::kind].
17647 ///
17648 /// # Example
17649 /// ```ignore,no_run
17650 /// # use google_cloud_sql_v1::model::AclEntry;
17651 /// let x = AclEntry::new().set_kind("example");
17652 /// ```
17653 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17654 self.kind = v.into();
17655 self
17656 }
17657}
17658
17659impl wkt::message::Message for AclEntry {
17660 fn typename() -> &'static str {
17661 "type.googleapis.com/google.cloud.sql.v1.AclEntry"
17662 }
17663}
17664
17665/// An Admin API warning message.
17666#[derive(Clone, Default, PartialEq)]
17667#[non_exhaustive]
17668pub struct ApiWarning {
17669 /// Code to uniquely identify the warning type.
17670 pub code: crate::model::api_warning::SqlApiWarningCode,
17671
17672 /// The warning message.
17673 pub message: std::string::String,
17674
17675 /// The region name for REGION_UNREACHABLE warning.
17676 pub region: std::string::String,
17677
17678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17679}
17680
17681impl ApiWarning {
17682 /// Creates a new default instance.
17683 pub fn new() -> Self {
17684 std::default::Default::default()
17685 }
17686
17687 /// Sets the value of [code][crate::model::ApiWarning::code].
17688 ///
17689 /// # Example
17690 /// ```ignore,no_run
17691 /// # use google_cloud_sql_v1::model::ApiWarning;
17692 /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
17693 /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
17694 /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
17695 /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
17696 /// ```
17697 pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
17698 mut self,
17699 v: T,
17700 ) -> Self {
17701 self.code = v.into();
17702 self
17703 }
17704
17705 /// Sets the value of [message][crate::model::ApiWarning::message].
17706 ///
17707 /// # Example
17708 /// ```ignore,no_run
17709 /// # use google_cloud_sql_v1::model::ApiWarning;
17710 /// let x = ApiWarning::new().set_message("example");
17711 /// ```
17712 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17713 self.message = v.into();
17714 self
17715 }
17716
17717 /// Sets the value of [region][crate::model::ApiWarning::region].
17718 ///
17719 /// # Example
17720 /// ```ignore,no_run
17721 /// # use google_cloud_sql_v1::model::ApiWarning;
17722 /// let x = ApiWarning::new().set_region("example");
17723 /// ```
17724 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17725 self.region = v.into();
17726 self
17727 }
17728}
17729
17730impl wkt::message::Message for ApiWarning {
17731 fn typename() -> &'static str {
17732 "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
17733 }
17734}
17735
17736/// Defines additional types related to [ApiWarning].
17737pub mod api_warning {
17738 #[allow(unused_imports)]
17739 use super::*;
17740
17741 /// Enum for [SqlApiWarningCode].
17742 ///
17743 /// # Working with unknown values
17744 ///
17745 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17746 /// additional enum variants at any time. Adding new variants is not considered
17747 /// a breaking change. Applications should write their code in anticipation of:
17748 ///
17749 /// - New values appearing in future releases of the client library, **and**
17750 /// - New values received dynamically, without application changes.
17751 ///
17752 /// Please consult the [Working with enums] section in the user guide for some
17753 /// guidelines.
17754 ///
17755 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17756 #[derive(Clone, Debug, PartialEq)]
17757 #[non_exhaustive]
17758 pub enum SqlApiWarningCode {
17759 /// An unknown or unset warning type from Cloud SQL API.
17760 Unspecified,
17761 /// Warning when one or more regions are not reachable. The returned result
17762 /// set may be incomplete.
17763 RegionUnreachable,
17764 /// Warning when user provided maxResults parameter exceeds the limit. The
17765 /// returned result set may be incomplete.
17766 MaxResultsExceedsLimit,
17767 /// Warning when user tries to create/update a user with credentials that
17768 /// have previously been compromised by a public data breach.
17769 CompromisedCredentials,
17770 /// Warning when the operation succeeds but some non-critical workflow state
17771 /// failed.
17772 InternalStateFailure,
17773 /// If set, the enum was initialized with an unknown value.
17774 ///
17775 /// Applications can examine the value using [SqlApiWarningCode::value] or
17776 /// [SqlApiWarningCode::name].
17777 UnknownValue(sql_api_warning_code::UnknownValue),
17778 }
17779
17780 #[doc(hidden)]
17781 pub mod sql_api_warning_code {
17782 #[allow(unused_imports)]
17783 use super::*;
17784 #[derive(Clone, Debug, PartialEq)]
17785 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17786 }
17787
17788 impl SqlApiWarningCode {
17789 /// Gets the enum value.
17790 ///
17791 /// Returns `None` if the enum contains an unknown value deserialized from
17792 /// the string representation of enums.
17793 pub fn value(&self) -> std::option::Option<i32> {
17794 match self {
17795 Self::Unspecified => std::option::Option::Some(0),
17796 Self::RegionUnreachable => std::option::Option::Some(1),
17797 Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
17798 Self::CompromisedCredentials => std::option::Option::Some(3),
17799 Self::InternalStateFailure => std::option::Option::Some(4),
17800 Self::UnknownValue(u) => u.0.value(),
17801 }
17802 }
17803
17804 /// Gets the enum value as a string.
17805 ///
17806 /// Returns `None` if the enum contains an unknown value deserialized from
17807 /// the integer representation of enums.
17808 pub fn name(&self) -> std::option::Option<&str> {
17809 match self {
17810 Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
17811 Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
17812 Self::MaxResultsExceedsLimit => {
17813 std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
17814 }
17815 Self::CompromisedCredentials => {
17816 std::option::Option::Some("COMPROMISED_CREDENTIALS")
17817 }
17818 Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
17819 Self::UnknownValue(u) => u.0.name(),
17820 }
17821 }
17822 }
17823
17824 impl std::default::Default for SqlApiWarningCode {
17825 fn default() -> Self {
17826 use std::convert::From;
17827 Self::from(0)
17828 }
17829 }
17830
17831 impl std::fmt::Display for SqlApiWarningCode {
17832 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17833 wkt::internal::display_enum(f, self.name(), self.value())
17834 }
17835 }
17836
17837 impl std::convert::From<i32> for SqlApiWarningCode {
17838 fn from(value: i32) -> Self {
17839 match value {
17840 0 => Self::Unspecified,
17841 1 => Self::RegionUnreachable,
17842 2 => Self::MaxResultsExceedsLimit,
17843 3 => Self::CompromisedCredentials,
17844 4 => Self::InternalStateFailure,
17845 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17846 wkt::internal::UnknownEnumValue::Integer(value),
17847 )),
17848 }
17849 }
17850 }
17851
17852 impl std::convert::From<&str> for SqlApiWarningCode {
17853 fn from(value: &str) -> Self {
17854 use std::string::ToString;
17855 match value {
17856 "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
17857 "REGION_UNREACHABLE" => Self::RegionUnreachable,
17858 "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
17859 "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
17860 "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
17861 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17862 wkt::internal::UnknownEnumValue::String(value.to_string()),
17863 )),
17864 }
17865 }
17866 }
17867
17868 impl serde::ser::Serialize for SqlApiWarningCode {
17869 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17870 where
17871 S: serde::Serializer,
17872 {
17873 match self {
17874 Self::Unspecified => serializer.serialize_i32(0),
17875 Self::RegionUnreachable => serializer.serialize_i32(1),
17876 Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
17877 Self::CompromisedCredentials => serializer.serialize_i32(3),
17878 Self::InternalStateFailure => serializer.serialize_i32(4),
17879 Self::UnknownValue(u) => u.0.serialize(serializer),
17880 }
17881 }
17882 }
17883
17884 impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
17885 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17886 where
17887 D: serde::Deserializer<'de>,
17888 {
17889 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
17890 ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
17891 ))
17892 }
17893 }
17894}
17895
17896/// We currently only support backup retention by specifying the number
17897/// of backups we will retain.
17898#[derive(Clone, Default, PartialEq)]
17899#[non_exhaustive]
17900pub struct BackupRetentionSettings {
17901 /// The unit that 'retained_backups' represents.
17902 pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
17903
17904 /// Depending on the value of retention_unit, this is used to determine
17905 /// if a backup needs to be deleted. If retention_unit is 'COUNT', we will
17906 /// retain this many backups.
17907 pub retained_backups: std::option::Option<wkt::Int32Value>,
17908
17909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17910}
17911
17912impl BackupRetentionSettings {
17913 /// Creates a new default instance.
17914 pub fn new() -> Self {
17915 std::default::Default::default()
17916 }
17917
17918 /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
17919 ///
17920 /// # Example
17921 /// ```ignore,no_run
17922 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17923 /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
17924 /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
17925 /// ```
17926 pub fn set_retention_unit<
17927 T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
17928 >(
17929 mut self,
17930 v: T,
17931 ) -> Self {
17932 self.retention_unit = v.into();
17933 self
17934 }
17935
17936 /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17937 ///
17938 /// # Example
17939 /// ```ignore,no_run
17940 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17941 /// use wkt::Int32Value;
17942 /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
17943 /// ```
17944 pub fn set_retained_backups<T>(mut self, v: T) -> Self
17945 where
17946 T: std::convert::Into<wkt::Int32Value>,
17947 {
17948 self.retained_backups = std::option::Option::Some(v.into());
17949 self
17950 }
17951
17952 /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17953 ///
17954 /// # Example
17955 /// ```ignore,no_run
17956 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17957 /// use wkt::Int32Value;
17958 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
17959 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
17960 /// ```
17961 pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
17962 where
17963 T: std::convert::Into<wkt::Int32Value>,
17964 {
17965 self.retained_backups = v.map(|x| x.into());
17966 self
17967 }
17968}
17969
17970impl wkt::message::Message for BackupRetentionSettings {
17971 fn typename() -> &'static str {
17972 "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
17973 }
17974}
17975
17976/// Defines additional types related to [BackupRetentionSettings].
17977pub mod backup_retention_settings {
17978 #[allow(unused_imports)]
17979 use super::*;
17980
17981 /// The units that retained_backups specifies, we only support COUNT.
17982 ///
17983 /// # Working with unknown values
17984 ///
17985 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17986 /// additional enum variants at any time. Adding new variants is not considered
17987 /// a breaking change. Applications should write their code in anticipation of:
17988 ///
17989 /// - New values appearing in future releases of the client library, **and**
17990 /// - New values received dynamically, without application changes.
17991 ///
17992 /// Please consult the [Working with enums] section in the user guide for some
17993 /// guidelines.
17994 ///
17995 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17996 #[derive(Clone, Debug, PartialEq)]
17997 #[non_exhaustive]
17998 pub enum RetentionUnit {
17999 /// Backup retention unit is unspecified, will be treated as COUNT.
18000 Unspecified,
18001 /// Retention will be by count, eg. "retain the most recent 7 backups".
18002 Count,
18003 /// If set, the enum was initialized with an unknown value.
18004 ///
18005 /// Applications can examine the value using [RetentionUnit::value] or
18006 /// [RetentionUnit::name].
18007 UnknownValue(retention_unit::UnknownValue),
18008 }
18009
18010 #[doc(hidden)]
18011 pub mod retention_unit {
18012 #[allow(unused_imports)]
18013 use super::*;
18014 #[derive(Clone, Debug, PartialEq)]
18015 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18016 }
18017
18018 impl RetentionUnit {
18019 /// Gets the enum value.
18020 ///
18021 /// Returns `None` if the enum contains an unknown value deserialized from
18022 /// the string representation of enums.
18023 pub fn value(&self) -> std::option::Option<i32> {
18024 match self {
18025 Self::Unspecified => std::option::Option::Some(0),
18026 Self::Count => std::option::Option::Some(1),
18027 Self::UnknownValue(u) => u.0.value(),
18028 }
18029 }
18030
18031 /// Gets the enum value as a string.
18032 ///
18033 /// Returns `None` if the enum contains an unknown value deserialized from
18034 /// the integer representation of enums.
18035 pub fn name(&self) -> std::option::Option<&str> {
18036 match self {
18037 Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
18038 Self::Count => std::option::Option::Some("COUNT"),
18039 Self::UnknownValue(u) => u.0.name(),
18040 }
18041 }
18042 }
18043
18044 impl std::default::Default for RetentionUnit {
18045 fn default() -> Self {
18046 use std::convert::From;
18047 Self::from(0)
18048 }
18049 }
18050
18051 impl std::fmt::Display for RetentionUnit {
18052 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18053 wkt::internal::display_enum(f, self.name(), self.value())
18054 }
18055 }
18056
18057 impl std::convert::From<i32> for RetentionUnit {
18058 fn from(value: i32) -> Self {
18059 match value {
18060 0 => Self::Unspecified,
18061 1 => Self::Count,
18062 _ => Self::UnknownValue(retention_unit::UnknownValue(
18063 wkt::internal::UnknownEnumValue::Integer(value),
18064 )),
18065 }
18066 }
18067 }
18068
18069 impl std::convert::From<&str> for RetentionUnit {
18070 fn from(value: &str) -> Self {
18071 use std::string::ToString;
18072 match value {
18073 "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
18074 "COUNT" => Self::Count,
18075 _ => Self::UnknownValue(retention_unit::UnknownValue(
18076 wkt::internal::UnknownEnumValue::String(value.to_string()),
18077 )),
18078 }
18079 }
18080 }
18081
18082 impl serde::ser::Serialize for RetentionUnit {
18083 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18084 where
18085 S: serde::Serializer,
18086 {
18087 match self {
18088 Self::Unspecified => serializer.serialize_i32(0),
18089 Self::Count => serializer.serialize_i32(1),
18090 Self::UnknownValue(u) => u.0.serialize(serializer),
18091 }
18092 }
18093 }
18094
18095 impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
18096 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18097 where
18098 D: serde::Deserializer<'de>,
18099 {
18100 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
18101 ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
18102 ))
18103 }
18104 }
18105}
18106
18107/// Database instance backup configuration.
18108#[derive(Clone, Default, PartialEq)]
18109#[non_exhaustive]
18110pub struct BackupConfiguration {
18111 /// Start time for the daily backup configuration in UTC timezone in the 24
18112 /// hour format - `HH:MM`.
18113 pub start_time: std::string::String,
18114
18115 /// Whether this configuration is enabled.
18116 pub enabled: std::option::Option<wkt::BoolValue>,
18117
18118 /// This is always `sql#backupConfiguration`.
18119 pub kind: std::string::String,
18120
18121 /// (MySQL only) Whether binary log is enabled. If backup configuration is
18122 /// disabled, binarylog must be disabled as well.
18123 pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
18124
18125 /// Optional. Deprecated: replication_log_archiving_enabled is deprecated and
18126 /// will be removed from a future version of the API. Use
18127 /// [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
18128 /// instead.
18129 ///
18130 /// [google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]: crate::model::BackupConfiguration::point_in_time_recovery_enabled
18131 #[deprecated]
18132 pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
18133
18134 /// Location of the backup
18135 pub location: std::string::String,
18136
18137 /// Whether point in time recovery is enabled.
18138 pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
18139
18140 /// Backup retention settings.
18141 pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
18142
18143 /// The number of days of transaction logs we retain for point in time
18144 /// restore, from 1-7.
18145 pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
18146
18147 /// Output only. This value contains the storage location of transactional logs
18148 /// used to perform point-in-time recovery (PITR) for the database.
18149 pub transactional_log_storage_state:
18150 std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
18151
18152 /// Output only. Backup tier that manages the backups for the instance.
18153 pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
18154
18155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18156}
18157
18158impl BackupConfiguration {
18159 /// Creates a new default instance.
18160 pub fn new() -> Self {
18161 std::default::Default::default()
18162 }
18163
18164 /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
18165 ///
18166 /// # Example
18167 /// ```ignore,no_run
18168 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18169 /// let x = BackupConfiguration::new().set_start_time("example");
18170 /// ```
18171 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18172 self.start_time = v.into();
18173 self
18174 }
18175
18176 /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
18177 ///
18178 /// # Example
18179 /// ```ignore,no_run
18180 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18181 /// use wkt::BoolValue;
18182 /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
18183 /// ```
18184 pub fn set_enabled<T>(mut self, v: T) -> Self
18185 where
18186 T: std::convert::Into<wkt::BoolValue>,
18187 {
18188 self.enabled = std::option::Option::Some(v.into());
18189 self
18190 }
18191
18192 /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
18193 ///
18194 /// # Example
18195 /// ```ignore,no_run
18196 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18197 /// use wkt::BoolValue;
18198 /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
18199 /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
18200 /// ```
18201 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
18202 where
18203 T: std::convert::Into<wkt::BoolValue>,
18204 {
18205 self.enabled = v.map(|x| x.into());
18206 self
18207 }
18208
18209 /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
18210 ///
18211 /// # Example
18212 /// ```ignore,no_run
18213 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18214 /// let x = BackupConfiguration::new().set_kind("example");
18215 /// ```
18216 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18217 self.kind = v.into();
18218 self
18219 }
18220
18221 /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
18222 ///
18223 /// # Example
18224 /// ```ignore,no_run
18225 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18226 /// use wkt::BoolValue;
18227 /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
18228 /// ```
18229 pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
18230 where
18231 T: std::convert::Into<wkt::BoolValue>,
18232 {
18233 self.binary_log_enabled = std::option::Option::Some(v.into());
18234 self
18235 }
18236
18237 /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
18238 ///
18239 /// # Example
18240 /// ```ignore,no_run
18241 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18242 /// use wkt::BoolValue;
18243 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
18244 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
18245 /// ```
18246 pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
18247 where
18248 T: std::convert::Into<wkt::BoolValue>,
18249 {
18250 self.binary_log_enabled = v.map(|x| x.into());
18251 self
18252 }
18253
18254 /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18255 ///
18256 /// # Example
18257 /// ```ignore,no_run
18258 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18259 /// use wkt::BoolValue;
18260 /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
18261 /// ```
18262 #[deprecated]
18263 pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
18264 where
18265 T: std::convert::Into<wkt::BoolValue>,
18266 {
18267 self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
18268 self
18269 }
18270
18271 /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
18272 ///
18273 /// # Example
18274 /// ```ignore,no_run
18275 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18276 /// use wkt::BoolValue;
18277 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
18278 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
18279 /// ```
18280 #[deprecated]
18281 pub fn set_or_clear_replication_log_archiving_enabled<T>(
18282 mut self,
18283 v: std::option::Option<T>,
18284 ) -> Self
18285 where
18286 T: std::convert::Into<wkt::BoolValue>,
18287 {
18288 self.replication_log_archiving_enabled = v.map(|x| x.into());
18289 self
18290 }
18291
18292 /// Sets the value of [location][crate::model::BackupConfiguration::location].
18293 ///
18294 /// # Example
18295 /// ```ignore,no_run
18296 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18297 /// let x = BackupConfiguration::new().set_location("example");
18298 /// ```
18299 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18300 self.location = v.into();
18301 self
18302 }
18303
18304 /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18305 ///
18306 /// # Example
18307 /// ```ignore,no_run
18308 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18309 /// use wkt::BoolValue;
18310 /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
18311 /// ```
18312 pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
18313 where
18314 T: std::convert::Into<wkt::BoolValue>,
18315 {
18316 self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
18317 self
18318 }
18319
18320 /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
18321 ///
18322 /// # Example
18323 /// ```ignore,no_run
18324 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18325 /// use wkt::BoolValue;
18326 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
18327 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
18328 /// ```
18329 pub fn set_or_clear_point_in_time_recovery_enabled<T>(
18330 mut self,
18331 v: std::option::Option<T>,
18332 ) -> Self
18333 where
18334 T: std::convert::Into<wkt::BoolValue>,
18335 {
18336 self.point_in_time_recovery_enabled = v.map(|x| x.into());
18337 self
18338 }
18339
18340 /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18341 ///
18342 /// # Example
18343 /// ```ignore,no_run
18344 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18345 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18346 /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
18347 /// ```
18348 pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
18349 where
18350 T: std::convert::Into<crate::model::BackupRetentionSettings>,
18351 {
18352 self.backup_retention_settings = std::option::Option::Some(v.into());
18353 self
18354 }
18355
18356 /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
18357 ///
18358 /// # Example
18359 /// ```ignore,no_run
18360 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18361 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
18362 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
18363 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
18364 /// ```
18365 pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
18366 where
18367 T: std::convert::Into<crate::model::BackupRetentionSettings>,
18368 {
18369 self.backup_retention_settings = v.map(|x| x.into());
18370 self
18371 }
18372
18373 /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18374 ///
18375 /// # Example
18376 /// ```ignore,no_run
18377 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18378 /// use wkt::Int32Value;
18379 /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
18380 /// ```
18381 pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
18382 where
18383 T: std::convert::Into<wkt::Int32Value>,
18384 {
18385 self.transaction_log_retention_days = std::option::Option::Some(v.into());
18386 self
18387 }
18388
18389 /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
18390 ///
18391 /// # Example
18392 /// ```ignore,no_run
18393 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18394 /// use wkt::Int32Value;
18395 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
18396 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
18397 /// ```
18398 pub fn set_or_clear_transaction_log_retention_days<T>(
18399 mut self,
18400 v: std::option::Option<T>,
18401 ) -> Self
18402 where
18403 T: std::convert::Into<wkt::Int32Value>,
18404 {
18405 self.transaction_log_retention_days = v.map(|x| x.into());
18406 self
18407 }
18408
18409 /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18410 ///
18411 /// # Example
18412 /// ```ignore,no_run
18413 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18414 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18415 /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
18416 /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
18417 /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
18418 /// ```
18419 pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
18420 where
18421 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18422 {
18423 self.transactional_log_storage_state = std::option::Option::Some(v.into());
18424 self
18425 }
18426
18427 /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18428 ///
18429 /// # Example
18430 /// ```ignore,no_run
18431 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18432 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18433 /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
18434 /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
18435 /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
18436 /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
18437 /// ```
18438 pub fn set_or_clear_transactional_log_storage_state<T>(
18439 mut self,
18440 v: std::option::Option<T>,
18441 ) -> Self
18442 where
18443 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18444 {
18445 self.transactional_log_storage_state = v.map(|x| x.into());
18446 self
18447 }
18448
18449 /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18450 ///
18451 /// # Example
18452 /// ```ignore,no_run
18453 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18454 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18455 /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
18456 /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
18457 /// ```
18458 pub fn set_backup_tier<T>(mut self, v: T) -> Self
18459 where
18460 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18461 {
18462 self.backup_tier = std::option::Option::Some(v.into());
18463 self
18464 }
18465
18466 /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18467 ///
18468 /// # Example
18469 /// ```ignore,no_run
18470 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18471 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18472 /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
18473 /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
18474 /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
18475 /// ```
18476 pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
18477 where
18478 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18479 {
18480 self.backup_tier = v.map(|x| x.into());
18481 self
18482 }
18483}
18484
18485impl wkt::message::Message for BackupConfiguration {
18486 fn typename() -> &'static str {
18487 "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
18488 }
18489}
18490
18491/// Defines additional types related to [BackupConfiguration].
18492pub mod backup_configuration {
18493 #[allow(unused_imports)]
18494 use super::*;
18495
18496 /// This value contains the storage location of the transactional logs
18497 /// used to perform point-in-time recovery (PITR) for the database.
18498 ///
18499 /// # Working with unknown values
18500 ///
18501 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18502 /// additional enum variants at any time. Adding new variants is not considered
18503 /// a breaking change. Applications should write their code in anticipation of:
18504 ///
18505 /// - New values appearing in future releases of the client library, **and**
18506 /// - New values received dynamically, without application changes.
18507 ///
18508 /// Please consult the [Working with enums] section in the user guide for some
18509 /// guidelines.
18510 ///
18511 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18512 #[derive(Clone, Debug, PartialEq)]
18513 #[non_exhaustive]
18514 pub enum TransactionalLogStorageState {
18515 /// Unspecified.
18516 Unspecified,
18517 /// The transaction logs used for PITR for the instance are stored
18518 /// on a data disk.
18519 Disk,
18520 /// The transaction logs used for PITR for the instance are switching from
18521 /// being stored on a data disk to being stored in Cloud Storage.
18522 /// Only applicable to MySQL.
18523 SwitchingToCloudStorage,
18524 /// The transaction logs used for PITR for the instance are now stored
18525 /// in Cloud Storage. Previously, they were stored on a data disk.
18526 /// Only applicable to MySQL.
18527 SwitchedToCloudStorage,
18528 /// The transaction logs used for PITR for the instance are stored in
18529 /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
18530 CloudStorage,
18531 /// If set, the enum was initialized with an unknown value.
18532 ///
18533 /// Applications can examine the value using [TransactionalLogStorageState::value] or
18534 /// [TransactionalLogStorageState::name].
18535 UnknownValue(transactional_log_storage_state::UnknownValue),
18536 }
18537
18538 #[doc(hidden)]
18539 pub mod transactional_log_storage_state {
18540 #[allow(unused_imports)]
18541 use super::*;
18542 #[derive(Clone, Debug, PartialEq)]
18543 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18544 }
18545
18546 impl TransactionalLogStorageState {
18547 /// Gets the enum value.
18548 ///
18549 /// Returns `None` if the enum contains an unknown value deserialized from
18550 /// the string representation of enums.
18551 pub fn value(&self) -> std::option::Option<i32> {
18552 match self {
18553 Self::Unspecified => std::option::Option::Some(0),
18554 Self::Disk => std::option::Option::Some(1),
18555 Self::SwitchingToCloudStorage => std::option::Option::Some(2),
18556 Self::SwitchedToCloudStorage => std::option::Option::Some(3),
18557 Self::CloudStorage => std::option::Option::Some(4),
18558 Self::UnknownValue(u) => u.0.value(),
18559 }
18560 }
18561
18562 /// Gets the enum value as a string.
18563 ///
18564 /// Returns `None` if the enum contains an unknown value deserialized from
18565 /// the integer representation of enums.
18566 pub fn name(&self) -> std::option::Option<&str> {
18567 match self {
18568 Self::Unspecified => {
18569 std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
18570 }
18571 Self::Disk => std::option::Option::Some("DISK"),
18572 Self::SwitchingToCloudStorage => {
18573 std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
18574 }
18575 Self::SwitchedToCloudStorage => {
18576 std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
18577 }
18578 Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
18579 Self::UnknownValue(u) => u.0.name(),
18580 }
18581 }
18582 }
18583
18584 impl std::default::Default for TransactionalLogStorageState {
18585 fn default() -> Self {
18586 use std::convert::From;
18587 Self::from(0)
18588 }
18589 }
18590
18591 impl std::fmt::Display for TransactionalLogStorageState {
18592 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18593 wkt::internal::display_enum(f, self.name(), self.value())
18594 }
18595 }
18596
18597 impl std::convert::From<i32> for TransactionalLogStorageState {
18598 fn from(value: i32) -> Self {
18599 match value {
18600 0 => Self::Unspecified,
18601 1 => Self::Disk,
18602 2 => Self::SwitchingToCloudStorage,
18603 3 => Self::SwitchedToCloudStorage,
18604 4 => Self::CloudStorage,
18605 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18606 wkt::internal::UnknownEnumValue::Integer(value),
18607 )),
18608 }
18609 }
18610 }
18611
18612 impl std::convert::From<&str> for TransactionalLogStorageState {
18613 fn from(value: &str) -> Self {
18614 use std::string::ToString;
18615 match value {
18616 "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
18617 "DISK" => Self::Disk,
18618 "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
18619 "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
18620 "CLOUD_STORAGE" => Self::CloudStorage,
18621 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18622 wkt::internal::UnknownEnumValue::String(value.to_string()),
18623 )),
18624 }
18625 }
18626 }
18627
18628 impl serde::ser::Serialize for TransactionalLogStorageState {
18629 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18630 where
18631 S: serde::Serializer,
18632 {
18633 match self {
18634 Self::Unspecified => serializer.serialize_i32(0),
18635 Self::Disk => serializer.serialize_i32(1),
18636 Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
18637 Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
18638 Self::CloudStorage => serializer.serialize_i32(4),
18639 Self::UnknownValue(u) => u.0.serialize(serializer),
18640 }
18641 }
18642 }
18643
18644 impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
18645 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18646 where
18647 D: serde::Deserializer<'de>,
18648 {
18649 deserializer.deserialize_any(
18650 wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
18651 ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
18652 ),
18653 )
18654 }
18655 }
18656
18657 /// Backup tier that manages the backups for the instance.
18658 ///
18659 /// # Working with unknown values
18660 ///
18661 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18662 /// additional enum variants at any time. Adding new variants is not considered
18663 /// a breaking change. Applications should write their code in anticipation of:
18664 ///
18665 /// - New values appearing in future releases of the client library, **and**
18666 /// - New values received dynamically, without application changes.
18667 ///
18668 /// Please consult the [Working with enums] section in the user guide for some
18669 /// guidelines.
18670 ///
18671 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18672 #[derive(Clone, Debug, PartialEq)]
18673 #[non_exhaustive]
18674 pub enum BackupTier {
18675 /// Unspecified.
18676 Unspecified,
18677 /// Instance is managed by Cloud SQL.
18678 Standard,
18679 /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
18680 #[deprecated]
18681 Advanced,
18682 /// Instance is managed by Google Cloud Backup and DR Service.
18683 Enhanced,
18684 /// If set, the enum was initialized with an unknown value.
18685 ///
18686 /// Applications can examine the value using [BackupTier::value] or
18687 /// [BackupTier::name].
18688 UnknownValue(backup_tier::UnknownValue),
18689 }
18690
18691 #[doc(hidden)]
18692 pub mod backup_tier {
18693 #[allow(unused_imports)]
18694 use super::*;
18695 #[derive(Clone, Debug, PartialEq)]
18696 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18697 }
18698
18699 impl BackupTier {
18700 /// Gets the enum value.
18701 ///
18702 /// Returns `None` if the enum contains an unknown value deserialized from
18703 /// the string representation of enums.
18704 pub fn value(&self) -> std::option::Option<i32> {
18705 match self {
18706 Self::Unspecified => std::option::Option::Some(0),
18707 Self::Standard => std::option::Option::Some(1),
18708 Self::Advanced => std::option::Option::Some(2),
18709 Self::Enhanced => std::option::Option::Some(3),
18710 Self::UnknownValue(u) => u.0.value(),
18711 }
18712 }
18713
18714 /// Gets the enum value as a string.
18715 ///
18716 /// Returns `None` if the enum contains an unknown value deserialized from
18717 /// the integer representation of enums.
18718 pub fn name(&self) -> std::option::Option<&str> {
18719 match self {
18720 Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
18721 Self::Standard => std::option::Option::Some("STANDARD"),
18722 Self::Advanced => std::option::Option::Some("ADVANCED"),
18723 Self::Enhanced => std::option::Option::Some("ENHANCED"),
18724 Self::UnknownValue(u) => u.0.name(),
18725 }
18726 }
18727 }
18728
18729 impl std::default::Default for BackupTier {
18730 fn default() -> Self {
18731 use std::convert::From;
18732 Self::from(0)
18733 }
18734 }
18735
18736 impl std::fmt::Display for BackupTier {
18737 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18738 wkt::internal::display_enum(f, self.name(), self.value())
18739 }
18740 }
18741
18742 impl std::convert::From<i32> for BackupTier {
18743 fn from(value: i32) -> Self {
18744 match value {
18745 0 => Self::Unspecified,
18746 1 => Self::Standard,
18747 2 => Self::Advanced,
18748 3 => Self::Enhanced,
18749 _ => Self::UnknownValue(backup_tier::UnknownValue(
18750 wkt::internal::UnknownEnumValue::Integer(value),
18751 )),
18752 }
18753 }
18754 }
18755
18756 impl std::convert::From<&str> for BackupTier {
18757 fn from(value: &str) -> Self {
18758 use std::string::ToString;
18759 match value {
18760 "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
18761 "STANDARD" => Self::Standard,
18762 "ADVANCED" => Self::Advanced,
18763 "ENHANCED" => Self::Enhanced,
18764 _ => Self::UnknownValue(backup_tier::UnknownValue(
18765 wkt::internal::UnknownEnumValue::String(value.to_string()),
18766 )),
18767 }
18768 }
18769 }
18770
18771 impl serde::ser::Serialize for BackupTier {
18772 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18773 where
18774 S: serde::Serializer,
18775 {
18776 match self {
18777 Self::Unspecified => serializer.serialize_i32(0),
18778 Self::Standard => serializer.serialize_i32(1),
18779 Self::Advanced => serializer.serialize_i32(2),
18780 Self::Enhanced => serializer.serialize_i32(3),
18781 Self::UnknownValue(u) => u.0.serialize(serializer),
18782 }
18783 }
18784 }
18785
18786 impl<'de> serde::de::Deserialize<'de> for BackupTier {
18787 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18788 where
18789 D: serde::Deserializer<'de>,
18790 {
18791 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
18792 ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
18793 ))
18794 }
18795 }
18796}
18797
18798/// Perform disk shrink context.
18799#[derive(Clone, Default, PartialEq)]
18800#[non_exhaustive]
18801pub struct PerformDiskShrinkContext {
18802 /// The target disk shrink size in GigaBytes.
18803 pub target_size_gb: i64,
18804
18805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18806}
18807
18808impl PerformDiskShrinkContext {
18809 /// Creates a new default instance.
18810 pub fn new() -> Self {
18811 std::default::Default::default()
18812 }
18813
18814 /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
18815 ///
18816 /// # Example
18817 /// ```ignore,no_run
18818 /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
18819 /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
18820 /// ```
18821 pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18822 self.target_size_gb = v.into();
18823 self
18824 }
18825}
18826
18827impl wkt::message::Message for PerformDiskShrinkContext {
18828 fn typename() -> &'static str {
18829 "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
18830 }
18831}
18832
18833/// Structured PreCheckResponse containing message, type, and required
18834/// actions.
18835#[derive(Clone, Default, PartialEq)]
18836#[non_exhaustive]
18837pub struct PreCheckResponse {
18838 /// The message to be displayed to the user.
18839 pub message: std::option::Option<std::string::String>,
18840
18841 /// The type of message whether it is an info, warning, or error.
18842 pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
18843
18844 /// The actions that the user needs to take. Use repeated for multiple
18845 /// actions.
18846 pub actions_required: std::vec::Vec<std::string::String>,
18847
18848 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18849}
18850
18851impl PreCheckResponse {
18852 /// Creates a new default instance.
18853 pub fn new() -> Self {
18854 std::default::Default::default()
18855 }
18856
18857 /// Sets the value of [message][crate::model::PreCheckResponse::message].
18858 ///
18859 /// # Example
18860 /// ```ignore,no_run
18861 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18862 /// let x = PreCheckResponse::new().set_message("example");
18863 /// ```
18864 pub fn set_message<T>(mut self, v: T) -> Self
18865 where
18866 T: std::convert::Into<std::string::String>,
18867 {
18868 self.message = std::option::Option::Some(v.into());
18869 self
18870 }
18871
18872 /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
18873 ///
18874 /// # Example
18875 /// ```ignore,no_run
18876 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18877 /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
18878 /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
18879 /// ```
18880 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
18881 where
18882 T: std::convert::Into<std::string::String>,
18883 {
18884 self.message = v.map(|x| x.into());
18885 self
18886 }
18887
18888 /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
18889 ///
18890 /// # Example
18891 /// ```ignore,no_run
18892 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18893 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18894 /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
18895 /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
18896 /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
18897 /// ```
18898 pub fn set_message_type<T>(mut self, v: T) -> Self
18899 where
18900 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18901 {
18902 self.message_type = std::option::Option::Some(v.into());
18903 self
18904 }
18905
18906 /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
18907 ///
18908 /// # Example
18909 /// ```ignore,no_run
18910 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18911 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18912 /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
18913 /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
18914 /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
18915 /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
18916 /// ```
18917 pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
18918 where
18919 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18920 {
18921 self.message_type = v.map(|x| x.into());
18922 self
18923 }
18924
18925 /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
18926 ///
18927 /// # Example
18928 /// ```ignore,no_run
18929 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18930 /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
18931 /// ```
18932 pub fn set_actions_required<T, V>(mut self, v: T) -> Self
18933 where
18934 T: std::iter::IntoIterator<Item = V>,
18935 V: std::convert::Into<std::string::String>,
18936 {
18937 use std::iter::Iterator;
18938 self.actions_required = v.into_iter().map(|i| i.into()).collect();
18939 self
18940 }
18941}
18942
18943impl wkt::message::Message for PreCheckResponse {
18944 fn typename() -> &'static str {
18945 "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
18946 }
18947}
18948
18949/// Defines additional types related to [PreCheckResponse].
18950pub mod pre_check_response {
18951 #[allow(unused_imports)]
18952 use super::*;
18953
18954 /// The type of message which can be an info, a warning, or an error that
18955 /// requires user intervention.
18956 ///
18957 /// # Working with unknown values
18958 ///
18959 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18960 /// additional enum variants at any time. Adding new variants is not considered
18961 /// a breaking change. Applications should write their code in anticipation of:
18962 ///
18963 /// - New values appearing in future releases of the client library, **and**
18964 /// - New values received dynamically, without application changes.
18965 ///
18966 /// Please consult the [Working with enums] section in the user guide for some
18967 /// guidelines.
18968 ///
18969 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18970 #[derive(Clone, Debug, PartialEq)]
18971 #[non_exhaustive]
18972 pub enum MessageType {
18973 /// Default unspecified value to prevent unintended behavior changes.
18974 Unspecified,
18975 /// General informational messages that don't require action.
18976 Info,
18977 /// Warnings that might impact the upgrade but don't block it.
18978 Warning,
18979 /// Errors that a user must resolve before proceeding with the upgrade.
18980 Error,
18981 /// If set, the enum was initialized with an unknown value.
18982 ///
18983 /// Applications can examine the value using [MessageType::value] or
18984 /// [MessageType::name].
18985 UnknownValue(message_type::UnknownValue),
18986 }
18987
18988 #[doc(hidden)]
18989 pub mod message_type {
18990 #[allow(unused_imports)]
18991 use super::*;
18992 #[derive(Clone, Debug, PartialEq)]
18993 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18994 }
18995
18996 impl MessageType {
18997 /// Gets the enum value.
18998 ///
18999 /// Returns `None` if the enum contains an unknown value deserialized from
19000 /// the string representation of enums.
19001 pub fn value(&self) -> std::option::Option<i32> {
19002 match self {
19003 Self::Unspecified => std::option::Option::Some(0),
19004 Self::Info => std::option::Option::Some(1),
19005 Self::Warning => std::option::Option::Some(2),
19006 Self::Error => std::option::Option::Some(3),
19007 Self::UnknownValue(u) => u.0.value(),
19008 }
19009 }
19010
19011 /// Gets the enum value as a string.
19012 ///
19013 /// Returns `None` if the enum contains an unknown value deserialized from
19014 /// the integer representation of enums.
19015 pub fn name(&self) -> std::option::Option<&str> {
19016 match self {
19017 Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
19018 Self::Info => std::option::Option::Some("INFO"),
19019 Self::Warning => std::option::Option::Some("WARNING"),
19020 Self::Error => std::option::Option::Some("ERROR"),
19021 Self::UnknownValue(u) => u.0.name(),
19022 }
19023 }
19024 }
19025
19026 impl std::default::Default for MessageType {
19027 fn default() -> Self {
19028 use std::convert::From;
19029 Self::from(0)
19030 }
19031 }
19032
19033 impl std::fmt::Display for MessageType {
19034 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19035 wkt::internal::display_enum(f, self.name(), self.value())
19036 }
19037 }
19038
19039 impl std::convert::From<i32> for MessageType {
19040 fn from(value: i32) -> Self {
19041 match value {
19042 0 => Self::Unspecified,
19043 1 => Self::Info,
19044 2 => Self::Warning,
19045 3 => Self::Error,
19046 _ => Self::UnknownValue(message_type::UnknownValue(
19047 wkt::internal::UnknownEnumValue::Integer(value),
19048 )),
19049 }
19050 }
19051 }
19052
19053 impl std::convert::From<&str> for MessageType {
19054 fn from(value: &str) -> Self {
19055 use std::string::ToString;
19056 match value {
19057 "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
19058 "INFO" => Self::Info,
19059 "WARNING" => Self::Warning,
19060 "ERROR" => Self::Error,
19061 _ => Self::UnknownValue(message_type::UnknownValue(
19062 wkt::internal::UnknownEnumValue::String(value.to_string()),
19063 )),
19064 }
19065 }
19066 }
19067
19068 impl serde::ser::Serialize for MessageType {
19069 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19070 where
19071 S: serde::Serializer,
19072 {
19073 match self {
19074 Self::Unspecified => serializer.serialize_i32(0),
19075 Self::Info => serializer.serialize_i32(1),
19076 Self::Warning => serializer.serialize_i32(2),
19077 Self::Error => serializer.serialize_i32(3),
19078 Self::UnknownValue(u) => u.0.serialize(serializer),
19079 }
19080 }
19081 }
19082
19083 impl<'de> serde::de::Deserialize<'de> for MessageType {
19084 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19085 where
19086 D: serde::Deserializer<'de>,
19087 {
19088 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
19089 ".google.cloud.sql.v1.PreCheckResponse.MessageType",
19090 ))
19091 }
19092 }
19093}
19094
19095/// Pre-check major version upgrade context.
19096#[derive(Clone, Default, PartialEq)]
19097#[non_exhaustive]
19098pub struct PreCheckMajorVersionUpgradeContext {
19099 /// Required. The target database version to upgrade to.
19100 pub target_database_version: crate::model::SqlDatabaseVersion,
19101
19102 /// Output only. The responses from the precheck operation.
19103 pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
19104
19105 /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
19106 pub kind: std::string::String,
19107
19108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19109}
19110
19111impl PreCheckMajorVersionUpgradeContext {
19112 /// Creates a new default instance.
19113 pub fn new() -> Self {
19114 std::default::Default::default()
19115 }
19116
19117 /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
19118 ///
19119 /// # Example
19120 /// ```ignore,no_run
19121 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
19122 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
19123 /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
19124 /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
19125 /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
19126 /// ```
19127 pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
19128 mut self,
19129 v: T,
19130 ) -> Self {
19131 self.target_database_version = v.into();
19132 self
19133 }
19134
19135 /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
19136 ///
19137 /// # Example
19138 /// ```ignore,no_run
19139 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
19140 /// use google_cloud_sql_v1::model::PreCheckResponse;
19141 /// let x = PreCheckMajorVersionUpgradeContext::new()
19142 /// .set_pre_check_response([
19143 /// PreCheckResponse::default()/* use setters */,
19144 /// PreCheckResponse::default()/* use (different) setters */,
19145 /// ]);
19146 /// ```
19147 pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
19148 where
19149 T: std::iter::IntoIterator<Item = V>,
19150 V: std::convert::Into<crate::model::PreCheckResponse>,
19151 {
19152 use std::iter::Iterator;
19153 self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
19154 self
19155 }
19156
19157 /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
19158 ///
19159 /// # Example
19160 /// ```ignore,no_run
19161 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
19162 /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
19163 /// ```
19164 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19165 self.kind = v.into();
19166 self
19167 }
19168}
19169
19170impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
19171 fn typename() -> &'static str {
19172 "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
19173 }
19174}
19175
19176/// Backup context.
19177#[derive(Clone, Default, PartialEq)]
19178#[non_exhaustive]
19179pub struct BackupContext {
19180 /// The identifier of the backup.
19181 pub backup_id: i64,
19182
19183 /// This is always `sql#backupContext`.
19184 pub kind: std::string::String,
19185
19186 /// The name of the backup.
19187 /// Format: projects/{project}/backups/{backup}
19188 pub name: std::string::String,
19189
19190 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19191}
19192
19193impl BackupContext {
19194 /// Creates a new default instance.
19195 pub fn new() -> Self {
19196 std::default::Default::default()
19197 }
19198
19199 /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
19200 ///
19201 /// # Example
19202 /// ```ignore,no_run
19203 /// # use google_cloud_sql_v1::model::BackupContext;
19204 /// let x = BackupContext::new().set_backup_id(42);
19205 /// ```
19206 pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19207 self.backup_id = v.into();
19208 self
19209 }
19210
19211 /// Sets the value of [kind][crate::model::BackupContext::kind].
19212 ///
19213 /// # Example
19214 /// ```ignore,no_run
19215 /// # use google_cloud_sql_v1::model::BackupContext;
19216 /// let x = BackupContext::new().set_kind("example");
19217 /// ```
19218 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19219 self.kind = v.into();
19220 self
19221 }
19222
19223 /// Sets the value of [name][crate::model::BackupContext::name].
19224 ///
19225 /// # Example
19226 /// ```ignore,no_run
19227 /// # use google_cloud_sql_v1::model::BackupContext;
19228 /// let x = BackupContext::new().set_name("example");
19229 /// ```
19230 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19231 self.name = v.into();
19232 self
19233 }
19234}
19235
19236impl wkt::message::Message for BackupContext {
19237 fn typename() -> &'static str {
19238 "type.googleapis.com/google.cloud.sql.v1.BackupContext"
19239 }
19240}
19241
19242/// Represents a SQL database on the Cloud SQL instance.
19243#[derive(Clone, Default, PartialEq)]
19244#[non_exhaustive]
19245pub struct Database {
19246 /// This is always `sql#database`.
19247 pub kind: std::string::String,
19248
19249 /// The Cloud SQL charset value.
19250 pub charset: std::string::String,
19251
19252 /// The Cloud SQL collation value.
19253 pub collation: std::string::String,
19254
19255 /// This field is deprecated and will be removed from a future version of the
19256 /// API.
19257 pub etag: std::string::String,
19258
19259 /// The name of the database in the Cloud SQL instance. This does not include
19260 /// the project ID or instance name.
19261 pub name: std::string::String,
19262
19263 /// The name of the Cloud SQL instance. This does not include the project ID.
19264 pub instance: std::string::String,
19265
19266 /// The URI of this resource.
19267 pub self_link: std::string::String,
19268
19269 /// The project ID of the project containing the Cloud SQL database. The Google
19270 /// apps domain is prefixed if applicable.
19271 pub project: std::string::String,
19272
19273 #[allow(missing_docs)]
19274 pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
19275
19276 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19277}
19278
19279impl Database {
19280 /// Creates a new default instance.
19281 pub fn new() -> Self {
19282 std::default::Default::default()
19283 }
19284
19285 /// Sets the value of [kind][crate::model::Database::kind].
19286 ///
19287 /// # Example
19288 /// ```ignore,no_run
19289 /// # use google_cloud_sql_v1::model::Database;
19290 /// let x = Database::new().set_kind("example");
19291 /// ```
19292 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19293 self.kind = v.into();
19294 self
19295 }
19296
19297 /// Sets the value of [charset][crate::model::Database::charset].
19298 ///
19299 /// # Example
19300 /// ```ignore,no_run
19301 /// # use google_cloud_sql_v1::model::Database;
19302 /// let x = Database::new().set_charset("example");
19303 /// ```
19304 pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19305 self.charset = v.into();
19306 self
19307 }
19308
19309 /// Sets the value of [collation][crate::model::Database::collation].
19310 ///
19311 /// # Example
19312 /// ```ignore,no_run
19313 /// # use google_cloud_sql_v1::model::Database;
19314 /// let x = Database::new().set_collation("example");
19315 /// ```
19316 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19317 self.collation = v.into();
19318 self
19319 }
19320
19321 /// Sets the value of [etag][crate::model::Database::etag].
19322 ///
19323 /// # Example
19324 /// ```ignore,no_run
19325 /// # use google_cloud_sql_v1::model::Database;
19326 /// let x = Database::new().set_etag("example");
19327 /// ```
19328 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19329 self.etag = v.into();
19330 self
19331 }
19332
19333 /// Sets the value of [name][crate::model::Database::name].
19334 ///
19335 /// # Example
19336 /// ```ignore,no_run
19337 /// # use google_cloud_sql_v1::model::Database;
19338 /// let x = Database::new().set_name("example");
19339 /// ```
19340 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19341 self.name = v.into();
19342 self
19343 }
19344
19345 /// Sets the value of [instance][crate::model::Database::instance].
19346 ///
19347 /// # Example
19348 /// ```ignore,no_run
19349 /// # use google_cloud_sql_v1::model::Database;
19350 /// let x = Database::new().set_instance("example");
19351 /// ```
19352 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19353 self.instance = v.into();
19354 self
19355 }
19356
19357 /// Sets the value of [self_link][crate::model::Database::self_link].
19358 ///
19359 /// # Example
19360 /// ```ignore,no_run
19361 /// # use google_cloud_sql_v1::model::Database;
19362 /// let x = Database::new().set_self_link("example");
19363 /// ```
19364 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19365 self.self_link = v.into();
19366 self
19367 }
19368
19369 /// Sets the value of [project][crate::model::Database::project].
19370 ///
19371 /// # Example
19372 /// ```ignore,no_run
19373 /// # use google_cloud_sql_v1::model::Database;
19374 /// let x = Database::new().set_project("example");
19375 /// ```
19376 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19377 self.project = v.into();
19378 self
19379 }
19380
19381 /// Sets the value of [database_details][crate::model::Database::database_details].
19382 ///
19383 /// Note that all the setters affecting `database_details` are mutually
19384 /// exclusive.
19385 ///
19386 /// # Example
19387 /// ```ignore,no_run
19388 /// # use google_cloud_sql_v1::model::Database;
19389 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19390 /// let x = Database::new().set_database_details(Some(
19391 /// google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
19392 /// ```
19393 pub fn set_database_details<
19394 T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
19395 >(
19396 mut self,
19397 v: T,
19398 ) -> Self {
19399 self.database_details = v.into();
19400 self
19401 }
19402
19403 /// The value of [database_details][crate::model::Database::database_details]
19404 /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
19405 /// holds a different branch.
19406 pub fn sqlserver_database_details(
19407 &self,
19408 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
19409 #[allow(unreachable_patterns)]
19410 self.database_details.as_ref().and_then(|v| match v {
19411 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
19412 std::option::Option::Some(v)
19413 }
19414 _ => std::option::Option::None,
19415 })
19416 }
19417
19418 /// Sets the value of [database_details][crate::model::Database::database_details]
19419 /// to hold a `SqlserverDatabaseDetails`.
19420 ///
19421 /// Note that all the setters affecting `database_details` are
19422 /// mutually exclusive.
19423 ///
19424 /// # Example
19425 /// ```ignore,no_run
19426 /// # use google_cloud_sql_v1::model::Database;
19427 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19428 /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
19429 /// assert!(x.sqlserver_database_details().is_some());
19430 /// ```
19431 pub fn set_sqlserver_database_details<
19432 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
19433 >(
19434 mut self,
19435 v: T,
19436 ) -> Self {
19437 self.database_details = std::option::Option::Some(
19438 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
19439 );
19440 self
19441 }
19442}
19443
19444impl wkt::message::Message for Database {
19445 fn typename() -> &'static str {
19446 "type.googleapis.com/google.cloud.sql.v1.Database"
19447 }
19448}
19449
19450/// Defines additional types related to [Database].
19451pub mod database {
19452 #[allow(unused_imports)]
19453 use super::*;
19454
19455 #[allow(missing_docs)]
19456 #[derive(Clone, Debug, PartialEq)]
19457 #[non_exhaustive]
19458 pub enum DatabaseDetails {
19459 #[allow(missing_docs)]
19460 SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
19461 }
19462}
19463
19464/// Represents a Sql Server database on the Cloud SQL instance.
19465#[derive(Clone, Default, PartialEq)]
19466#[non_exhaustive]
19467pub struct SqlServerDatabaseDetails {
19468 /// The version of SQL Server with which the database is to be made compatible
19469 pub compatibility_level: i32,
19470
19471 /// The recovery model of a SQL Server database
19472 pub recovery_model: std::string::String,
19473
19474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19475}
19476
19477impl SqlServerDatabaseDetails {
19478 /// Creates a new default instance.
19479 pub fn new() -> Self {
19480 std::default::Default::default()
19481 }
19482
19483 /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
19484 ///
19485 /// # Example
19486 /// ```ignore,no_run
19487 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19488 /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
19489 /// ```
19490 pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19491 self.compatibility_level = v.into();
19492 self
19493 }
19494
19495 /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
19496 ///
19497 /// # Example
19498 /// ```ignore,no_run
19499 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19500 /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
19501 /// ```
19502 pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19503 self.recovery_model = v.into();
19504 self
19505 }
19506}
19507
19508impl wkt::message::Message for SqlServerDatabaseDetails {
19509 fn typename() -> &'static str {
19510 "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
19511 }
19512}
19513
19514/// Database flags for Cloud SQL instances.
19515#[derive(Clone, Default, PartialEq)]
19516#[non_exhaustive]
19517pub struct DatabaseFlags {
19518 /// The name of the flag. These flags are passed at instance startup, so
19519 /// include both server options and system variables. Flags are
19520 /// specified with underscores, not hyphens. For more information, see
19521 /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
19522 /// in the Cloud SQL documentation.
19523 pub name: std::string::String,
19524
19525 /// The value of the flag. Boolean flags are set to `on` for true
19526 /// and `off` for false. This field must be omitted if the flag
19527 /// doesn't take a value.
19528 pub value: std::string::String,
19529
19530 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19531}
19532
19533impl DatabaseFlags {
19534 /// Creates a new default instance.
19535 pub fn new() -> Self {
19536 std::default::Default::default()
19537 }
19538
19539 /// Sets the value of [name][crate::model::DatabaseFlags::name].
19540 ///
19541 /// # Example
19542 /// ```ignore,no_run
19543 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19544 /// let x = DatabaseFlags::new().set_name("example");
19545 /// ```
19546 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19547 self.name = v.into();
19548 self
19549 }
19550
19551 /// Sets the value of [value][crate::model::DatabaseFlags::value].
19552 ///
19553 /// # Example
19554 /// ```ignore,no_run
19555 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19556 /// let x = DatabaseFlags::new().set_value("example");
19557 /// ```
19558 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19559 self.value = v.into();
19560 self
19561 }
19562}
19563
19564impl wkt::message::Message for DatabaseFlags {
19565 fn typename() -> &'static str {
19566 "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
19567 }
19568}
19569
19570/// MySQL-specific external server sync settings.
19571#[derive(Clone, Default, PartialEq)]
19572#[non_exhaustive]
19573pub struct MySqlSyncConfig {
19574 /// Flags to use for the initial dump.
19575 pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
19576
19577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19578}
19579
19580impl MySqlSyncConfig {
19581 /// Creates a new default instance.
19582 pub fn new() -> Self {
19583 std::default::Default::default()
19584 }
19585
19586 /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
19587 ///
19588 /// # Example
19589 /// ```ignore,no_run
19590 /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
19591 /// use google_cloud_sql_v1::model::SyncFlags;
19592 /// let x = MySqlSyncConfig::new()
19593 /// .set_initial_sync_flags([
19594 /// SyncFlags::default()/* use setters */,
19595 /// SyncFlags::default()/* use (different) setters */,
19596 /// ]);
19597 /// ```
19598 pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
19599 where
19600 T: std::iter::IntoIterator<Item = V>,
19601 V: std::convert::Into<crate::model::SyncFlags>,
19602 {
19603 use std::iter::Iterator;
19604 self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
19605 self
19606 }
19607}
19608
19609impl wkt::message::Message for MySqlSyncConfig {
19610 fn typename() -> &'static str {
19611 "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
19612 }
19613}
19614
19615/// Initial sync flags for certain Cloud SQL APIs.
19616/// Currently used for the MySQL external server initial dump.
19617#[derive(Clone, Default, PartialEq)]
19618#[non_exhaustive]
19619pub struct SyncFlags {
19620 /// The name of the flag.
19621 pub name: std::string::String,
19622
19623 /// The value of the flag. This field must be omitted if the flag
19624 /// doesn't take a value.
19625 pub value: std::string::String,
19626
19627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19628}
19629
19630impl SyncFlags {
19631 /// Creates a new default instance.
19632 pub fn new() -> Self {
19633 std::default::Default::default()
19634 }
19635
19636 /// Sets the value of [name][crate::model::SyncFlags::name].
19637 ///
19638 /// # Example
19639 /// ```ignore,no_run
19640 /// # use google_cloud_sql_v1::model::SyncFlags;
19641 /// let x = SyncFlags::new().set_name("example");
19642 /// ```
19643 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19644 self.name = v.into();
19645 self
19646 }
19647
19648 /// Sets the value of [value][crate::model::SyncFlags::value].
19649 ///
19650 /// # Example
19651 /// ```ignore,no_run
19652 /// # use google_cloud_sql_v1::model::SyncFlags;
19653 /// let x = SyncFlags::new().set_value("example");
19654 /// ```
19655 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19656 self.value = v.into();
19657 self
19658 }
19659}
19660
19661impl wkt::message::Message for SyncFlags {
19662 fn typename() -> &'static str {
19663 "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
19664 }
19665}
19666
19667/// Reference to another Cloud SQL instance.
19668#[derive(Clone, Default, PartialEq)]
19669#[non_exhaustive]
19670pub struct InstanceReference {
19671 /// The name of the Cloud SQL instance being referenced.
19672 /// This does not include the project ID.
19673 pub name: std::string::String,
19674
19675 /// The region of the Cloud SQL instance being referenced.
19676 pub region: std::string::String,
19677
19678 /// The project ID of the Cloud SQL instance being referenced.
19679 /// The default is the same project ID as the instance references it.
19680 pub project: std::string::String,
19681
19682 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19683}
19684
19685impl InstanceReference {
19686 /// Creates a new default instance.
19687 pub fn new() -> Self {
19688 std::default::Default::default()
19689 }
19690
19691 /// Sets the value of [name][crate::model::InstanceReference::name].
19692 ///
19693 /// # Example
19694 /// ```ignore,no_run
19695 /// # use google_cloud_sql_v1::model::InstanceReference;
19696 /// let x = InstanceReference::new().set_name("example");
19697 /// ```
19698 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19699 self.name = v.into();
19700 self
19701 }
19702
19703 /// Sets the value of [region][crate::model::InstanceReference::region].
19704 ///
19705 /// # Example
19706 /// ```ignore,no_run
19707 /// # use google_cloud_sql_v1::model::InstanceReference;
19708 /// let x = InstanceReference::new().set_region("example");
19709 /// ```
19710 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19711 self.region = v.into();
19712 self
19713 }
19714
19715 /// Sets the value of [project][crate::model::InstanceReference::project].
19716 ///
19717 /// # Example
19718 /// ```ignore,no_run
19719 /// # use google_cloud_sql_v1::model::InstanceReference;
19720 /// let x = InstanceReference::new().set_project("example");
19721 /// ```
19722 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19723 self.project = v.into();
19724 self
19725 }
19726}
19727
19728impl wkt::message::Message for InstanceReference {
19729 fn typename() -> &'static str {
19730 "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
19731 }
19732}
19733
19734/// Read-replica configuration for connecting to the on-premises primary
19735/// instance.
19736#[derive(Clone, Default, PartialEq)]
19737#[non_exhaustive]
19738pub struct DemoteMasterConfiguration {
19739 /// This is always `sql#demoteMasterConfiguration`.
19740 pub kind: std::string::String,
19741
19742 /// MySQL specific configuration when replicating from a MySQL on-premises
19743 /// primary instance. Replication configuration information such as the
19744 /// username, password, certificates, and keys are not stored in the instance
19745 /// metadata. The configuration information is used only to set up the
19746 /// replication connection and is stored by MySQL in a file named
19747 /// `master.info` in the data directory.
19748 pub mysql_replica_configuration:
19749 std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19750
19751 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19752}
19753
19754impl DemoteMasterConfiguration {
19755 /// Creates a new default instance.
19756 pub fn new() -> Self {
19757 std::default::Default::default()
19758 }
19759
19760 /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
19761 ///
19762 /// # Example
19763 /// ```ignore,no_run
19764 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19765 /// let x = DemoteMasterConfiguration::new().set_kind("example");
19766 /// ```
19767 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19768 self.kind = v.into();
19769 self
19770 }
19771
19772 /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19773 ///
19774 /// # Example
19775 /// ```ignore,no_run
19776 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19777 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19778 /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
19779 /// ```
19780 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
19781 where
19782 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19783 {
19784 self.mysql_replica_configuration = std::option::Option::Some(v.into());
19785 self
19786 }
19787
19788 /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19789 ///
19790 /// # Example
19791 /// ```ignore,no_run
19792 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19793 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19794 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
19795 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
19796 /// ```
19797 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
19798 where
19799 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19800 {
19801 self.mysql_replica_configuration = v.map(|x| x.into());
19802 self
19803 }
19804}
19805
19806impl wkt::message::Message for DemoteMasterConfiguration {
19807 fn typename() -> &'static str {
19808 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
19809 }
19810}
19811
19812/// Read-replica configuration specific to MySQL databases.
19813#[derive(Clone, Default, PartialEq)]
19814#[non_exhaustive]
19815pub struct DemoteMasterMySqlReplicaConfiguration {
19816 /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
19817 pub kind: std::string::String,
19818
19819 /// The username for the replication connection.
19820 pub username: std::string::String,
19821
19822 /// The password for the replication connection.
19823 pub password: std::string::String,
19824
19825 /// PEM representation of the replica's private key. The corresponding public
19826 /// key is encoded in the client's certificate. The format of the replica's
19827 /// private key can be either PKCS #1 or PKCS #8.
19828 pub client_key: std::string::String,
19829
19830 /// PEM representation of the replica's x509 certificate.
19831 pub client_certificate: std::string::String,
19832
19833 /// PEM representation of the trusted CA's x509 certificate.
19834 pub ca_certificate: std::string::String,
19835
19836 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19837}
19838
19839impl DemoteMasterMySqlReplicaConfiguration {
19840 /// Creates a new default instance.
19841 pub fn new() -> Self {
19842 std::default::Default::default()
19843 }
19844
19845 /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
19846 ///
19847 /// # Example
19848 /// ```ignore,no_run
19849 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19850 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
19851 /// ```
19852 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19853 self.kind = v.into();
19854 self
19855 }
19856
19857 /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
19858 ///
19859 /// # Example
19860 /// ```ignore,no_run
19861 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19862 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
19863 /// ```
19864 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19865 self.username = v.into();
19866 self
19867 }
19868
19869 /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
19870 ///
19871 /// # Example
19872 /// ```ignore,no_run
19873 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19874 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
19875 /// ```
19876 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19877 self.password = v.into();
19878 self
19879 }
19880
19881 /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
19882 ///
19883 /// # Example
19884 /// ```ignore,no_run
19885 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19886 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
19887 /// ```
19888 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19889 self.client_key = v.into();
19890 self
19891 }
19892
19893 /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
19894 ///
19895 /// # Example
19896 /// ```ignore,no_run
19897 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19898 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
19899 /// ```
19900 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
19901 mut self,
19902 v: T,
19903 ) -> Self {
19904 self.client_certificate = v.into();
19905 self
19906 }
19907
19908 /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
19909 ///
19910 /// # Example
19911 /// ```ignore,no_run
19912 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19913 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
19914 /// ```
19915 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19916 self.ca_certificate = v.into();
19917 self
19918 }
19919}
19920
19921impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
19922 fn typename() -> &'static str {
19923 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
19924 }
19925}
19926
19927/// Database instance export context.
19928#[derive(Clone, Default, PartialEq)]
19929#[non_exhaustive]
19930pub struct ExportContext {
19931 /// The path to the file in Google Cloud Storage where the export will be
19932 /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
19933 /// already exists, the request succeeds, but the operation fails. If
19934 /// `fileType` is `SQL` and the filename ends with .gz,
19935 /// the contents are compressed.
19936 pub uri: std::string::String,
19937
19938 /// Databases to be exported. <br /> `MySQL instances:` If
19939 /// `fileType` is `SQL` and no database is specified, all
19940 /// databases are exported, except for the `mysql` system database.
19941 /// If `fileType` is `CSV`, you can specify one database,
19942 /// either by using this property or by using the
19943 /// `csvExportOptions.selectQuery` property, which takes precedence
19944 /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
19945 /// database by name, all user databases in the instance are exported.
19946 /// This excludes system databases and Cloud SQL databases used to manage
19947 /// internal operations. Exporting all user databases is only available for
19948 /// directory-formatted parallel export. If `fileType` is `CSV`,
19949 /// this database must match the one specified in the
19950 /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
19951 /// instances:` You must specify one database to be exported, and the
19952 /// `fileType` must be `BAK`.
19953 pub databases: std::vec::Vec<std::string::String>,
19954
19955 /// This is always `sql#exportContext`.
19956 pub kind: std::string::String,
19957
19958 /// Options for exporting data as SQL statements.
19959 pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
19960
19961 /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
19962 /// instances only.
19963 pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
19964
19965 /// The file type for the specified uri.
19966 pub file_type: crate::model::SqlFileType,
19967
19968 /// Whether to perform a serverless export.
19969 pub offload: std::option::Option<wkt::BoolValue>,
19970
19971 /// Options for exporting data as BAK files.
19972 pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
19973
19974 /// Optional. Export parameters specific to SQL Server TDE certificates
19975 pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
19976
19977 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19978}
19979
19980impl ExportContext {
19981 /// Creates a new default instance.
19982 pub fn new() -> Self {
19983 std::default::Default::default()
19984 }
19985
19986 /// Sets the value of [uri][crate::model::ExportContext::uri].
19987 ///
19988 /// # Example
19989 /// ```ignore,no_run
19990 /// # use google_cloud_sql_v1::model::ExportContext;
19991 /// let x = ExportContext::new().set_uri("example");
19992 /// ```
19993 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19994 self.uri = v.into();
19995 self
19996 }
19997
19998 /// Sets the value of [databases][crate::model::ExportContext::databases].
19999 ///
20000 /// # Example
20001 /// ```ignore,no_run
20002 /// # use google_cloud_sql_v1::model::ExportContext;
20003 /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
20004 /// ```
20005 pub fn set_databases<T, V>(mut self, v: T) -> Self
20006 where
20007 T: std::iter::IntoIterator<Item = V>,
20008 V: std::convert::Into<std::string::String>,
20009 {
20010 use std::iter::Iterator;
20011 self.databases = v.into_iter().map(|i| i.into()).collect();
20012 self
20013 }
20014
20015 /// Sets the value of [kind][crate::model::ExportContext::kind].
20016 ///
20017 /// # Example
20018 /// ```ignore,no_run
20019 /// # use google_cloud_sql_v1::model::ExportContext;
20020 /// let x = ExportContext::new().set_kind("example");
20021 /// ```
20022 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20023 self.kind = v.into();
20024 self
20025 }
20026
20027 /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
20028 ///
20029 /// # Example
20030 /// ```ignore,no_run
20031 /// # use google_cloud_sql_v1::model::ExportContext;
20032 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20033 /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
20034 /// ```
20035 pub fn set_sql_export_options<T>(mut self, v: T) -> Self
20036 where
20037 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
20038 {
20039 self.sql_export_options = std::option::Option::Some(v.into());
20040 self
20041 }
20042
20043 /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
20044 ///
20045 /// # Example
20046 /// ```ignore,no_run
20047 /// # use google_cloud_sql_v1::model::ExportContext;
20048 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20049 /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
20050 /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
20051 /// ```
20052 pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20053 where
20054 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
20055 {
20056 self.sql_export_options = v.map(|x| x.into());
20057 self
20058 }
20059
20060 /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
20061 ///
20062 /// # Example
20063 /// ```ignore,no_run
20064 /// # use google_cloud_sql_v1::model::ExportContext;
20065 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20066 /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
20067 /// ```
20068 pub fn set_csv_export_options<T>(mut self, v: T) -> Self
20069 where
20070 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
20071 {
20072 self.csv_export_options = std::option::Option::Some(v.into());
20073 self
20074 }
20075
20076 /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
20077 ///
20078 /// # Example
20079 /// ```ignore,no_run
20080 /// # use google_cloud_sql_v1::model::ExportContext;
20081 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20082 /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
20083 /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
20084 /// ```
20085 pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20086 where
20087 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
20088 {
20089 self.csv_export_options = v.map(|x| x.into());
20090 self
20091 }
20092
20093 /// Sets the value of [file_type][crate::model::ExportContext::file_type].
20094 ///
20095 /// # Example
20096 /// ```ignore,no_run
20097 /// # use google_cloud_sql_v1::model::ExportContext;
20098 /// use google_cloud_sql_v1::model::SqlFileType;
20099 /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
20100 /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
20101 /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
20102 /// ```
20103 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
20104 self.file_type = v.into();
20105 self
20106 }
20107
20108 /// Sets the value of [offload][crate::model::ExportContext::offload].
20109 ///
20110 /// # Example
20111 /// ```ignore,no_run
20112 /// # use google_cloud_sql_v1::model::ExportContext;
20113 /// use wkt::BoolValue;
20114 /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
20115 /// ```
20116 pub fn set_offload<T>(mut self, v: T) -> Self
20117 where
20118 T: std::convert::Into<wkt::BoolValue>,
20119 {
20120 self.offload = std::option::Option::Some(v.into());
20121 self
20122 }
20123
20124 /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
20125 ///
20126 /// # Example
20127 /// ```ignore,no_run
20128 /// # use google_cloud_sql_v1::model::ExportContext;
20129 /// use wkt::BoolValue;
20130 /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
20131 /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
20132 /// ```
20133 pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
20134 where
20135 T: std::convert::Into<wkt::BoolValue>,
20136 {
20137 self.offload = v.map(|x| x.into());
20138 self
20139 }
20140
20141 /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
20142 ///
20143 /// # Example
20144 /// ```ignore,no_run
20145 /// # use google_cloud_sql_v1::model::ExportContext;
20146 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20147 /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
20148 /// ```
20149 pub fn set_bak_export_options<T>(mut self, v: T) -> Self
20150 where
20151 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
20152 {
20153 self.bak_export_options = std::option::Option::Some(v.into());
20154 self
20155 }
20156
20157 /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
20158 ///
20159 /// # Example
20160 /// ```ignore,no_run
20161 /// # use google_cloud_sql_v1::model::ExportContext;
20162 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20163 /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
20164 /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
20165 /// ```
20166 pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20167 where
20168 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
20169 {
20170 self.bak_export_options = v.map(|x| x.into());
20171 self
20172 }
20173
20174 /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_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::SqlTdeExportOptions;
20180 /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
20181 /// ```
20182 pub fn set_tde_export_options<T>(mut self, v: T) -> Self
20183 where
20184 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
20185 {
20186 self.tde_export_options = std::option::Option::Some(v.into());
20187 self
20188 }
20189
20190 /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_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::SqlTdeExportOptions;
20196 /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
20197 /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
20198 /// ```
20199 pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20200 where
20201 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
20202 {
20203 self.tde_export_options = v.map(|x| x.into());
20204 self
20205 }
20206}
20207
20208impl wkt::message::Message for ExportContext {
20209 fn typename() -> &'static str {
20210 "type.googleapis.com/google.cloud.sql.v1.ExportContext"
20211 }
20212}
20213
20214/// Defines additional types related to [ExportContext].
20215pub mod export_context {
20216 #[allow(unused_imports)]
20217 use super::*;
20218
20219 #[allow(missing_docs)]
20220 #[derive(Clone, Default, PartialEq)]
20221 #[non_exhaustive]
20222 pub struct SqlCsvExportOptions {
20223 /// The select query used to extract the data.
20224 pub select_query: std::string::String,
20225
20226 /// Specifies the character that should appear before a data character that
20227 /// needs to be escaped.
20228 pub escape_character: std::string::String,
20229
20230 /// Specifies the quoting character to be used when a data value is quoted.
20231 pub quote_character: std::string::String,
20232
20233 /// Specifies the character that separates columns within each row (line) of
20234 /// the file.
20235 pub fields_terminated_by: std::string::String,
20236
20237 /// This is used to separate lines. If a line does not contain all fields,
20238 /// the rest of the columns are set to their default values.
20239 pub lines_terminated_by: std::string::String,
20240
20241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20242 }
20243
20244 impl SqlCsvExportOptions {
20245 /// Creates a new default instance.
20246 pub fn new() -> Self {
20247 std::default::Default::default()
20248 }
20249
20250 /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
20251 ///
20252 /// # Example
20253 /// ```ignore,no_run
20254 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20255 /// let x = SqlCsvExportOptions::new().set_select_query("example");
20256 /// ```
20257 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
20258 mut self,
20259 v: T,
20260 ) -> Self {
20261 self.select_query = v.into();
20262 self
20263 }
20264
20265 /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
20266 ///
20267 /// # Example
20268 /// ```ignore,no_run
20269 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20270 /// let x = SqlCsvExportOptions::new().set_escape_character("example");
20271 /// ```
20272 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
20273 mut self,
20274 v: T,
20275 ) -> Self {
20276 self.escape_character = v.into();
20277 self
20278 }
20279
20280 /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
20281 ///
20282 /// # Example
20283 /// ```ignore,no_run
20284 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20285 /// let x = SqlCsvExportOptions::new().set_quote_character("example");
20286 /// ```
20287 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
20288 mut self,
20289 v: T,
20290 ) -> Self {
20291 self.quote_character = v.into();
20292 self
20293 }
20294
20295 /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
20296 ///
20297 /// # Example
20298 /// ```ignore,no_run
20299 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20300 /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
20301 /// ```
20302 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
20303 mut self,
20304 v: T,
20305 ) -> Self {
20306 self.fields_terminated_by = v.into();
20307 self
20308 }
20309
20310 /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
20311 ///
20312 /// # Example
20313 /// ```ignore,no_run
20314 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
20315 /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
20316 /// ```
20317 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
20318 mut self,
20319 v: T,
20320 ) -> Self {
20321 self.lines_terminated_by = v.into();
20322 self
20323 }
20324 }
20325
20326 impl wkt::message::Message for SqlCsvExportOptions {
20327 fn typename() -> &'static str {
20328 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
20329 }
20330 }
20331
20332 #[allow(missing_docs)]
20333 #[derive(Clone, Default, PartialEq)]
20334 #[non_exhaustive]
20335 pub struct SqlExportOptions {
20336 /// Tables to export, or that were exported, from the specified database. If
20337 /// you specify tables, specify one and only one database. For PostgreSQL
20338 /// instances, you can specify only one table.
20339 pub tables: std::vec::Vec<std::string::String>,
20340
20341 /// Export only schemas.
20342 pub schema_only: std::option::Option<wkt::BoolValue>,
20343
20344 #[allow(missing_docs)]
20345 pub mysql_export_options: std::option::Option<
20346 crate::model::export_context::sql_export_options::MysqlExportOptions,
20347 >,
20348
20349 /// Optional. The number of threads to use for parallel export.
20350 pub threads: std::option::Option<wkt::Int32Value>,
20351
20352 /// Optional. Whether or not the export should be parallel.
20353 pub parallel: std::option::Option<wkt::BoolValue>,
20354
20355 /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
20356 pub postgres_export_options: std::option::Option<
20357 crate::model::export_context::sql_export_options::PostgresExportOptions,
20358 >,
20359
20360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20361 }
20362
20363 impl SqlExportOptions {
20364 /// Creates a new default instance.
20365 pub fn new() -> Self {
20366 std::default::Default::default()
20367 }
20368
20369 /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
20370 ///
20371 /// # Example
20372 /// ```ignore,no_run
20373 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20374 /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
20375 /// ```
20376 pub fn set_tables<T, V>(mut self, v: T) -> Self
20377 where
20378 T: std::iter::IntoIterator<Item = V>,
20379 V: std::convert::Into<std::string::String>,
20380 {
20381 use std::iter::Iterator;
20382 self.tables = v.into_iter().map(|i| i.into()).collect();
20383 self
20384 }
20385
20386 /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
20387 ///
20388 /// # Example
20389 /// ```ignore,no_run
20390 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20391 /// use wkt::BoolValue;
20392 /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
20393 /// ```
20394 pub fn set_schema_only<T>(mut self, v: T) -> Self
20395 where
20396 T: std::convert::Into<wkt::BoolValue>,
20397 {
20398 self.schema_only = std::option::Option::Some(v.into());
20399 self
20400 }
20401
20402 /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
20403 ///
20404 /// # Example
20405 /// ```ignore,no_run
20406 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20407 /// use wkt::BoolValue;
20408 /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
20409 /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
20410 /// ```
20411 pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
20412 where
20413 T: std::convert::Into<wkt::BoolValue>,
20414 {
20415 self.schema_only = v.map(|x| x.into());
20416 self
20417 }
20418
20419 /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
20420 ///
20421 /// # Example
20422 /// ```ignore,no_run
20423 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20424 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20425 /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
20426 /// ```
20427 pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
20428 where
20429 T: std::convert::Into<
20430 crate::model::export_context::sql_export_options::MysqlExportOptions,
20431 >,
20432 {
20433 self.mysql_export_options = std::option::Option::Some(v.into());
20434 self
20435 }
20436
20437 /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
20438 ///
20439 /// # Example
20440 /// ```ignore,no_run
20441 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20442 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20443 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
20444 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
20445 /// ```
20446 pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20447 where
20448 T: std::convert::Into<
20449 crate::model::export_context::sql_export_options::MysqlExportOptions,
20450 >,
20451 {
20452 self.mysql_export_options = v.map(|x| x.into());
20453 self
20454 }
20455
20456 /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20457 ///
20458 /// # Example
20459 /// ```ignore,no_run
20460 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20461 /// use wkt::Int32Value;
20462 /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
20463 /// ```
20464 pub fn set_threads<T>(mut self, v: T) -> Self
20465 where
20466 T: std::convert::Into<wkt::Int32Value>,
20467 {
20468 self.threads = std::option::Option::Some(v.into());
20469 self
20470 }
20471
20472 /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20473 ///
20474 /// # Example
20475 /// ```ignore,no_run
20476 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20477 /// use wkt::Int32Value;
20478 /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20479 /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
20480 /// ```
20481 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20482 where
20483 T: std::convert::Into<wkt::Int32Value>,
20484 {
20485 self.threads = v.map(|x| x.into());
20486 self
20487 }
20488
20489 /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20490 ///
20491 /// # Example
20492 /// ```ignore,no_run
20493 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20494 /// use wkt::BoolValue;
20495 /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20496 /// ```
20497 pub fn set_parallel<T>(mut self, v: T) -> Self
20498 where
20499 T: std::convert::Into<wkt::BoolValue>,
20500 {
20501 self.parallel = std::option::Option::Some(v.into());
20502 self
20503 }
20504
20505 /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20506 ///
20507 /// # Example
20508 /// ```ignore,no_run
20509 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20510 /// use wkt::BoolValue;
20511 /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20512 /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20513 /// ```
20514 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20515 where
20516 T: std::convert::Into<wkt::BoolValue>,
20517 {
20518 self.parallel = v.map(|x| x.into());
20519 self
20520 }
20521
20522 /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20523 ///
20524 /// # Example
20525 /// ```ignore,no_run
20526 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20527 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20528 /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
20529 /// ```
20530 pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
20531 where
20532 T: std::convert::Into<
20533 crate::model::export_context::sql_export_options::PostgresExportOptions,
20534 >,
20535 {
20536 self.postgres_export_options = std::option::Option::Some(v.into());
20537 self
20538 }
20539
20540 /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20541 ///
20542 /// # Example
20543 /// ```ignore,no_run
20544 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20545 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20546 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
20547 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
20548 /// ```
20549 pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20550 where
20551 T: std::convert::Into<
20552 crate::model::export_context::sql_export_options::PostgresExportOptions,
20553 >,
20554 {
20555 self.postgres_export_options = v.map(|x| x.into());
20556 self
20557 }
20558 }
20559
20560 impl wkt::message::Message for SqlExportOptions {
20561 fn typename() -> &'static str {
20562 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
20563 }
20564 }
20565
20566 /// Defines additional types related to [SqlExportOptions].
20567 pub mod sql_export_options {
20568 #[allow(unused_imports)]
20569 use super::*;
20570
20571 /// Options for exporting from MySQL.
20572 #[derive(Clone, Default, PartialEq)]
20573 #[non_exhaustive]
20574 pub struct MysqlExportOptions {
20575 /// Option to include SQL statement required to set up replication. If set
20576 /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
20577 /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
20578 /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
20579 /// has no effect. If set to any value other than `1`, --set-gtid-purged
20580 /// is set to OFF.
20581 pub master_data: std::option::Option<wkt::Int32Value>,
20582
20583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20584 }
20585
20586 impl MysqlExportOptions {
20587 /// Creates a new default instance.
20588 pub fn new() -> Self {
20589 std::default::Default::default()
20590 }
20591
20592 /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20593 ///
20594 /// # Example
20595 /// ```ignore,no_run
20596 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20597 /// use wkt::Int32Value;
20598 /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
20599 /// ```
20600 pub fn set_master_data<T>(mut self, v: T) -> Self
20601 where
20602 T: std::convert::Into<wkt::Int32Value>,
20603 {
20604 self.master_data = std::option::Option::Some(v.into());
20605 self
20606 }
20607
20608 /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20609 ///
20610 /// # Example
20611 /// ```ignore,no_run
20612 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20613 /// use wkt::Int32Value;
20614 /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
20615 /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
20616 /// ```
20617 pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
20618 where
20619 T: std::convert::Into<wkt::Int32Value>,
20620 {
20621 self.master_data = v.map(|x| x.into());
20622 self
20623 }
20624 }
20625
20626 impl wkt::message::Message for MysqlExportOptions {
20627 fn typename() -> &'static str {
20628 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
20629 }
20630 }
20631
20632 /// Options for exporting from a Cloud SQL for PostgreSQL instance.
20633 #[derive(Clone, Default, PartialEq)]
20634 #[non_exhaustive]
20635 pub struct PostgresExportOptions {
20636 /// Optional. Use this option to include DROP \<code\><object>\</code\>
20637 /// SQL statements. Use these statements to delete database objects before
20638 /// running the import operation.
20639 pub clean: std::option::Option<wkt::BoolValue>,
20640
20641 /// Optional. Option to include an IF EXISTS SQL statement with each DROP
20642 /// statement produced by clean.
20643 pub if_exists: std::option::Option<wkt::BoolValue>,
20644
20645 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20646 }
20647
20648 impl PostgresExportOptions {
20649 /// Creates a new default instance.
20650 pub fn new() -> Self {
20651 std::default::Default::default()
20652 }
20653
20654 /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20655 ///
20656 /// # Example
20657 /// ```ignore,no_run
20658 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20659 /// use wkt::BoolValue;
20660 /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
20661 /// ```
20662 pub fn set_clean<T>(mut self, v: T) -> Self
20663 where
20664 T: std::convert::Into<wkt::BoolValue>,
20665 {
20666 self.clean = std::option::Option::Some(v.into());
20667 self
20668 }
20669
20670 /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20671 ///
20672 /// # Example
20673 /// ```ignore,no_run
20674 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20675 /// use wkt::BoolValue;
20676 /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20677 /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
20678 /// ```
20679 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20680 where
20681 T: std::convert::Into<wkt::BoolValue>,
20682 {
20683 self.clean = v.map(|x| x.into());
20684 self
20685 }
20686
20687 /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20688 ///
20689 /// # Example
20690 /// ```ignore,no_run
20691 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20692 /// use wkt::BoolValue;
20693 /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
20694 /// ```
20695 pub fn set_if_exists<T>(mut self, v: T) -> Self
20696 where
20697 T: std::convert::Into<wkt::BoolValue>,
20698 {
20699 self.if_exists = std::option::Option::Some(v.into());
20700 self
20701 }
20702
20703 /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20704 ///
20705 /// # Example
20706 /// ```ignore,no_run
20707 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20708 /// use wkt::BoolValue;
20709 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
20710 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
20711 /// ```
20712 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
20713 where
20714 T: std::convert::Into<wkt::BoolValue>,
20715 {
20716 self.if_exists = v.map(|x| x.into());
20717 self
20718 }
20719 }
20720
20721 impl wkt::message::Message for PostgresExportOptions {
20722 fn typename() -> &'static str {
20723 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
20724 }
20725 }
20726 }
20727
20728 /// Options for exporting BAK files (SQL Server-only)
20729 #[derive(Clone, Default, PartialEq)]
20730 #[non_exhaustive]
20731 pub struct SqlBakExportOptions {
20732 /// Whether or not the export should be striped.
20733 pub striped: std::option::Option<wkt::BoolValue>,
20734
20735 /// Option for specifying how many stripes to use for the export.
20736 /// If blank, and the value of the striped field is true,
20737 /// the number of stripes is automatically chosen.
20738 pub stripe_count: std::option::Option<wkt::Int32Value>,
20739
20740 /// Type of this bak file will be export, FULL or DIFF, SQL Server only
20741 pub bak_type: crate::model::BakType,
20742
20743 /// Deprecated: copy_only is deprecated. Use differential_base instead
20744 #[deprecated]
20745 pub copy_only: std::option::Option<wkt::BoolValue>,
20746
20747 /// Whether or not the backup can be used as a differential base
20748 /// copy_only backup can not be served as differential base
20749 pub differential_base: std::option::Option<wkt::BoolValue>,
20750
20751 /// Optional. The begin timestamp when transaction log will be included in
20752 /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
20753 /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20754 /// available logs from the beginning of retention period will be included.
20755 /// Only applied to Cloud SQL for SQL Server.
20756 pub export_log_start_time: std::option::Option<wkt::Timestamp>,
20757
20758 /// Optional. The end timestamp when transaction log will be included in the
20759 /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
20760 /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20761 /// available logs until current time will be included. Only applied to Cloud
20762 /// SQL for SQL Server.
20763 pub export_log_end_time: std::option::Option<wkt::Timestamp>,
20764
20765 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20766 }
20767
20768 impl SqlBakExportOptions {
20769 /// Creates a new default instance.
20770 pub fn new() -> Self {
20771 std::default::Default::default()
20772 }
20773
20774 /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20775 ///
20776 /// # Example
20777 /// ```ignore,no_run
20778 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20779 /// use wkt::BoolValue;
20780 /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
20781 /// ```
20782 pub fn set_striped<T>(mut self, v: T) -> Self
20783 where
20784 T: std::convert::Into<wkt::BoolValue>,
20785 {
20786 self.striped = std::option::Option::Some(v.into());
20787 self
20788 }
20789
20790 /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20791 ///
20792 /// # Example
20793 /// ```ignore,no_run
20794 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20795 /// use wkt::BoolValue;
20796 /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
20797 /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
20798 /// ```
20799 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
20800 where
20801 T: std::convert::Into<wkt::BoolValue>,
20802 {
20803 self.striped = v.map(|x| x.into());
20804 self
20805 }
20806
20807 /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20808 ///
20809 /// # Example
20810 /// ```ignore,no_run
20811 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20812 /// use wkt::Int32Value;
20813 /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
20814 /// ```
20815 pub fn set_stripe_count<T>(mut self, v: T) -> Self
20816 where
20817 T: std::convert::Into<wkt::Int32Value>,
20818 {
20819 self.stripe_count = std::option::Option::Some(v.into());
20820 self
20821 }
20822
20823 /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20824 ///
20825 /// # Example
20826 /// ```ignore,no_run
20827 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20828 /// use wkt::Int32Value;
20829 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
20830 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
20831 /// ```
20832 pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
20833 where
20834 T: std::convert::Into<wkt::Int32Value>,
20835 {
20836 self.stripe_count = v.map(|x| x.into());
20837 self
20838 }
20839
20840 /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
20841 ///
20842 /// # Example
20843 /// ```ignore,no_run
20844 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20845 /// use google_cloud_sql_v1::model::BakType;
20846 /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
20847 /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
20848 /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
20849 /// ```
20850 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
20851 self.bak_type = v.into();
20852 self
20853 }
20854
20855 /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20856 ///
20857 /// # Example
20858 /// ```ignore,no_run
20859 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20860 /// use wkt::BoolValue;
20861 /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
20862 /// ```
20863 #[deprecated]
20864 pub fn set_copy_only<T>(mut self, v: T) -> Self
20865 where
20866 T: std::convert::Into<wkt::BoolValue>,
20867 {
20868 self.copy_only = std::option::Option::Some(v.into());
20869 self
20870 }
20871
20872 /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20873 ///
20874 /// # Example
20875 /// ```ignore,no_run
20876 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20877 /// use wkt::BoolValue;
20878 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
20879 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
20880 /// ```
20881 #[deprecated]
20882 pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
20883 where
20884 T: std::convert::Into<wkt::BoolValue>,
20885 {
20886 self.copy_only = v.map(|x| x.into());
20887 self
20888 }
20889
20890 /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20891 ///
20892 /// # Example
20893 /// ```ignore,no_run
20894 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20895 /// use wkt::BoolValue;
20896 /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
20897 /// ```
20898 pub fn set_differential_base<T>(mut self, v: T) -> Self
20899 where
20900 T: std::convert::Into<wkt::BoolValue>,
20901 {
20902 self.differential_base = std::option::Option::Some(v.into());
20903 self
20904 }
20905
20906 /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20907 ///
20908 /// # Example
20909 /// ```ignore,no_run
20910 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20911 /// use wkt::BoolValue;
20912 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
20913 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
20914 /// ```
20915 pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
20916 where
20917 T: std::convert::Into<wkt::BoolValue>,
20918 {
20919 self.differential_base = v.map(|x| x.into());
20920 self
20921 }
20922
20923 /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20924 ///
20925 /// # Example
20926 /// ```ignore,no_run
20927 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20928 /// use wkt::Timestamp;
20929 /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
20930 /// ```
20931 pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
20932 where
20933 T: std::convert::Into<wkt::Timestamp>,
20934 {
20935 self.export_log_start_time = std::option::Option::Some(v.into());
20936 self
20937 }
20938
20939 /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20940 ///
20941 /// # Example
20942 /// ```ignore,no_run
20943 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20944 /// use wkt::Timestamp;
20945 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
20946 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
20947 /// ```
20948 pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
20949 where
20950 T: std::convert::Into<wkt::Timestamp>,
20951 {
20952 self.export_log_start_time = v.map(|x| x.into());
20953 self
20954 }
20955
20956 /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20957 ///
20958 /// # Example
20959 /// ```ignore,no_run
20960 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20961 /// use wkt::Timestamp;
20962 /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
20963 /// ```
20964 pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
20965 where
20966 T: std::convert::Into<wkt::Timestamp>,
20967 {
20968 self.export_log_end_time = std::option::Option::Some(v.into());
20969 self
20970 }
20971
20972 /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20973 ///
20974 /// # Example
20975 /// ```ignore,no_run
20976 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20977 /// use wkt::Timestamp;
20978 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
20979 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
20980 /// ```
20981 pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
20982 where
20983 T: std::convert::Into<wkt::Timestamp>,
20984 {
20985 self.export_log_end_time = v.map(|x| x.into());
20986 self
20987 }
20988 }
20989
20990 impl wkt::message::Message for SqlBakExportOptions {
20991 fn typename() -> &'static str {
20992 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
20993 }
20994 }
20995
20996 #[allow(missing_docs)]
20997 #[derive(Clone, Default, PartialEq)]
20998 #[non_exhaustive]
20999 pub struct SqlTdeExportOptions {
21000 /// Required. Path to the TDE certificate public key
21001 /// in the form gs://bucketName/fileName.
21002 /// The instance must have write access to the bucket.
21003 /// Applicable only for SQL Server instances.
21004 pub certificate_path: std::string::String,
21005
21006 /// Required. Path to the TDE certificate private key
21007 /// in the form gs://bucketName/fileName.
21008 /// The instance must have write access to the location.
21009 /// Applicable only for SQL Server instances.
21010 pub private_key_path: std::string::String,
21011
21012 /// Required. Password that encrypts the private key.
21013 pub private_key_password: std::string::String,
21014
21015 /// Required. Certificate name.
21016 /// Applicable only for SQL Server instances.
21017 pub name: std::string::String,
21018
21019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21020 }
21021
21022 impl SqlTdeExportOptions {
21023 /// Creates a new default instance.
21024 pub fn new() -> Self {
21025 std::default::Default::default()
21026 }
21027
21028 /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
21029 ///
21030 /// # Example
21031 /// ```ignore,no_run
21032 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21033 /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
21034 /// ```
21035 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
21036 mut self,
21037 v: T,
21038 ) -> Self {
21039 self.certificate_path = v.into();
21040 self
21041 }
21042
21043 /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
21044 ///
21045 /// # Example
21046 /// ```ignore,no_run
21047 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21048 /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
21049 /// ```
21050 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
21051 mut self,
21052 v: T,
21053 ) -> Self {
21054 self.private_key_path = v.into();
21055 self
21056 }
21057
21058 /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
21059 ///
21060 /// # Example
21061 /// ```ignore,no_run
21062 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21063 /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
21064 /// ```
21065 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
21066 mut self,
21067 v: T,
21068 ) -> Self {
21069 self.private_key_password = v.into();
21070 self
21071 }
21072
21073 /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
21074 ///
21075 /// # Example
21076 /// ```ignore,no_run
21077 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21078 /// let x = SqlTdeExportOptions::new().set_name("example");
21079 /// ```
21080 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21081 self.name = v.into();
21082 self
21083 }
21084 }
21085
21086 impl wkt::message::Message for SqlTdeExportOptions {
21087 fn typename() -> &'static str {
21088 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
21089 }
21090 }
21091}
21092
21093/// Database instance import context.
21094#[derive(Clone, Default, PartialEq)]
21095#[non_exhaustive]
21096pub struct ImportContext {
21097 /// Path to the import file in Cloud Storage, in the form
21098 /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
21099 /// when `fileType` is `SQL`. The instance must have
21100 /// write permissions to the bucket and read access to the file.
21101 pub uri: std::string::String,
21102
21103 /// The target database for the import. If `fileType` is `SQL`, this field
21104 /// is required only if the import file does not specify a database, and is
21105 /// overridden by any database specification in the import file. For entire
21106 /// instance parallel import operations, the database is overridden by the
21107 /// database name stored in subdirectory name. If
21108 /// `fileType` is `CSV`, one database must be specified.
21109 pub database: std::string::String,
21110
21111 /// This is always `sql#importContext`.
21112 pub kind: std::string::String,
21113
21114 /// The file type for the specified uri.\`SQL`: The file
21115 /// contains SQL statements. \`CSV`: The file contains CSV data.
21116 pub file_type: crate::model::SqlFileType,
21117
21118 /// Options for importing data as CSV.
21119 pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
21120
21121 /// The PostgreSQL user for this import operation. PostgreSQL instances only.
21122 pub import_user: std::string::String,
21123
21124 /// Import parameters specific to SQL Server .BAK files
21125 pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
21126
21127 /// Optional. Options for importing data from SQL statements.
21128 pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
21129
21130 /// Optional. Import parameters specific to SQL Server TDE certificates
21131 pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
21132
21133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21134}
21135
21136impl ImportContext {
21137 /// Creates a new default instance.
21138 pub fn new() -> Self {
21139 std::default::Default::default()
21140 }
21141
21142 /// Sets the value of [uri][crate::model::ImportContext::uri].
21143 ///
21144 /// # Example
21145 /// ```ignore,no_run
21146 /// # use google_cloud_sql_v1::model::ImportContext;
21147 /// let x = ImportContext::new().set_uri("example");
21148 /// ```
21149 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21150 self.uri = v.into();
21151 self
21152 }
21153
21154 /// Sets the value of [database][crate::model::ImportContext::database].
21155 ///
21156 /// # Example
21157 /// ```ignore,no_run
21158 /// # use google_cloud_sql_v1::model::ImportContext;
21159 /// let x = ImportContext::new().set_database("example");
21160 /// ```
21161 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21162 self.database = v.into();
21163 self
21164 }
21165
21166 /// Sets the value of [kind][crate::model::ImportContext::kind].
21167 ///
21168 /// # Example
21169 /// ```ignore,no_run
21170 /// # use google_cloud_sql_v1::model::ImportContext;
21171 /// let x = ImportContext::new().set_kind("example");
21172 /// ```
21173 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21174 self.kind = v.into();
21175 self
21176 }
21177
21178 /// Sets the value of [file_type][crate::model::ImportContext::file_type].
21179 ///
21180 /// # Example
21181 /// ```ignore,no_run
21182 /// # use google_cloud_sql_v1::model::ImportContext;
21183 /// use google_cloud_sql_v1::model::SqlFileType;
21184 /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
21185 /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
21186 /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
21187 /// ```
21188 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
21189 self.file_type = v.into();
21190 self
21191 }
21192
21193 /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
21194 ///
21195 /// # Example
21196 /// ```ignore,no_run
21197 /// # use google_cloud_sql_v1::model::ImportContext;
21198 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21199 /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
21200 /// ```
21201 pub fn set_csv_import_options<T>(mut self, v: T) -> Self
21202 where
21203 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
21204 {
21205 self.csv_import_options = std::option::Option::Some(v.into());
21206 self
21207 }
21208
21209 /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
21210 ///
21211 /// # Example
21212 /// ```ignore,no_run
21213 /// # use google_cloud_sql_v1::model::ImportContext;
21214 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21215 /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
21216 /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
21217 /// ```
21218 pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21219 where
21220 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
21221 {
21222 self.csv_import_options = v.map(|x| x.into());
21223 self
21224 }
21225
21226 /// Sets the value of [import_user][crate::model::ImportContext::import_user].
21227 ///
21228 /// # Example
21229 /// ```ignore,no_run
21230 /// # use google_cloud_sql_v1::model::ImportContext;
21231 /// let x = ImportContext::new().set_import_user("example");
21232 /// ```
21233 pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21234 self.import_user = v.into();
21235 self
21236 }
21237
21238 /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
21239 ///
21240 /// # Example
21241 /// ```ignore,no_run
21242 /// # use google_cloud_sql_v1::model::ImportContext;
21243 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21244 /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
21245 /// ```
21246 pub fn set_bak_import_options<T>(mut self, v: T) -> Self
21247 where
21248 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
21249 {
21250 self.bak_import_options = std::option::Option::Some(v.into());
21251 self
21252 }
21253
21254 /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
21255 ///
21256 /// # Example
21257 /// ```ignore,no_run
21258 /// # use google_cloud_sql_v1::model::ImportContext;
21259 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21260 /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
21261 /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
21262 /// ```
21263 pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21264 where
21265 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
21266 {
21267 self.bak_import_options = v.map(|x| x.into());
21268 self
21269 }
21270
21271 /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21272 ///
21273 /// # Example
21274 /// ```ignore,no_run
21275 /// # use google_cloud_sql_v1::model::ImportContext;
21276 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21277 /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
21278 /// ```
21279 pub fn set_sql_import_options<T>(mut self, v: T) -> Self
21280 where
21281 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21282 {
21283 self.sql_import_options = std::option::Option::Some(v.into());
21284 self
21285 }
21286
21287 /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
21288 ///
21289 /// # Example
21290 /// ```ignore,no_run
21291 /// # use google_cloud_sql_v1::model::ImportContext;
21292 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21293 /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
21294 /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
21295 /// ```
21296 pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21297 where
21298 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
21299 {
21300 self.sql_import_options = v.map(|x| x.into());
21301 self
21302 }
21303
21304 /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21305 ///
21306 /// # Example
21307 /// ```ignore,no_run
21308 /// # use google_cloud_sql_v1::model::ImportContext;
21309 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21310 /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
21311 /// ```
21312 pub fn set_tde_import_options<T>(mut self, v: T) -> Self
21313 where
21314 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21315 {
21316 self.tde_import_options = std::option::Option::Some(v.into());
21317 self
21318 }
21319
21320 /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
21321 ///
21322 /// # Example
21323 /// ```ignore,no_run
21324 /// # use google_cloud_sql_v1::model::ImportContext;
21325 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21326 /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
21327 /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
21328 /// ```
21329 pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21330 where
21331 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
21332 {
21333 self.tde_import_options = v.map(|x| x.into());
21334 self
21335 }
21336}
21337
21338impl wkt::message::Message for ImportContext {
21339 fn typename() -> &'static str {
21340 "type.googleapis.com/google.cloud.sql.v1.ImportContext"
21341 }
21342}
21343
21344/// Defines additional types related to [ImportContext].
21345pub mod import_context {
21346 #[allow(unused_imports)]
21347 use super::*;
21348
21349 #[allow(missing_docs)]
21350 #[derive(Clone, Default, PartialEq)]
21351 #[non_exhaustive]
21352 pub struct SqlImportOptions {
21353 /// Optional. The number of threads to use for parallel import.
21354 pub threads: std::option::Option<wkt::Int32Value>,
21355
21356 /// Optional. Whether or not the import should be parallel.
21357 pub parallel: std::option::Option<wkt::BoolValue>,
21358
21359 /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
21360 pub postgres_import_options: std::option::Option<
21361 crate::model::import_context::sql_import_options::PostgresImportOptions,
21362 >,
21363
21364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21365 }
21366
21367 impl SqlImportOptions {
21368 /// Creates a new default instance.
21369 pub fn new() -> Self {
21370 std::default::Default::default()
21371 }
21372
21373 /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21374 ///
21375 /// # Example
21376 /// ```ignore,no_run
21377 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21378 /// use wkt::Int32Value;
21379 /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
21380 /// ```
21381 pub fn set_threads<T>(mut self, v: T) -> Self
21382 where
21383 T: std::convert::Into<wkt::Int32Value>,
21384 {
21385 self.threads = std::option::Option::Some(v.into());
21386 self
21387 }
21388
21389 /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
21390 ///
21391 /// # Example
21392 /// ```ignore,no_run
21393 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21394 /// use wkt::Int32Value;
21395 /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
21396 /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
21397 /// ```
21398 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
21399 where
21400 T: std::convert::Into<wkt::Int32Value>,
21401 {
21402 self.threads = v.map(|x| x.into());
21403 self
21404 }
21405
21406 /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21407 ///
21408 /// # Example
21409 /// ```ignore,no_run
21410 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21411 /// use wkt::BoolValue;
21412 /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
21413 /// ```
21414 pub fn set_parallel<T>(mut self, v: T) -> Self
21415 where
21416 T: std::convert::Into<wkt::BoolValue>,
21417 {
21418 self.parallel = std::option::Option::Some(v.into());
21419 self
21420 }
21421
21422 /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
21423 ///
21424 /// # Example
21425 /// ```ignore,no_run
21426 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21427 /// use wkt::BoolValue;
21428 /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
21429 /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
21430 /// ```
21431 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
21432 where
21433 T: std::convert::Into<wkt::BoolValue>,
21434 {
21435 self.parallel = v.map(|x| x.into());
21436 self
21437 }
21438
21439 /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21440 ///
21441 /// # Example
21442 /// ```ignore,no_run
21443 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21444 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21445 /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
21446 /// ```
21447 pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
21448 where
21449 T: std::convert::Into<
21450 crate::model::import_context::sql_import_options::PostgresImportOptions,
21451 >,
21452 {
21453 self.postgres_import_options = std::option::Option::Some(v.into());
21454 self
21455 }
21456
21457 /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21458 ///
21459 /// # Example
21460 /// ```ignore,no_run
21461 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21462 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21463 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
21464 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
21465 /// ```
21466 pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21467 where
21468 T: std::convert::Into<
21469 crate::model::import_context::sql_import_options::PostgresImportOptions,
21470 >,
21471 {
21472 self.postgres_import_options = v.map(|x| x.into());
21473 self
21474 }
21475 }
21476
21477 impl wkt::message::Message for SqlImportOptions {
21478 fn typename() -> &'static str {
21479 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
21480 }
21481 }
21482
21483 /// Defines additional types related to [SqlImportOptions].
21484 pub mod sql_import_options {
21485 #[allow(unused_imports)]
21486 use super::*;
21487
21488 #[allow(missing_docs)]
21489 #[derive(Clone, Default, PartialEq)]
21490 #[non_exhaustive]
21491 pub struct PostgresImportOptions {
21492 /// Optional. The --clean flag for the pg_restore utility. This flag
21493 /// applies only if you enabled Cloud SQL to import files in parallel.
21494 pub clean: std::option::Option<wkt::BoolValue>,
21495
21496 /// Optional. The --if-exists flag for the pg_restore utility. This flag
21497 /// applies only if you enabled Cloud SQL to import files in parallel.
21498 pub if_exists: std::option::Option<wkt::BoolValue>,
21499
21500 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21501 }
21502
21503 impl PostgresImportOptions {
21504 /// Creates a new default instance.
21505 pub fn new() -> Self {
21506 std::default::Default::default()
21507 }
21508
21509 /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21510 ///
21511 /// # Example
21512 /// ```ignore,no_run
21513 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21514 /// use wkt::BoolValue;
21515 /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
21516 /// ```
21517 pub fn set_clean<T>(mut self, v: T) -> Self
21518 where
21519 T: std::convert::Into<wkt::BoolValue>,
21520 {
21521 self.clean = std::option::Option::Some(v.into());
21522 self
21523 }
21524
21525 /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21526 ///
21527 /// # Example
21528 /// ```ignore,no_run
21529 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21530 /// use wkt::BoolValue;
21531 /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
21532 /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
21533 /// ```
21534 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
21535 where
21536 T: std::convert::Into<wkt::BoolValue>,
21537 {
21538 self.clean = v.map(|x| x.into());
21539 self
21540 }
21541
21542 /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21543 ///
21544 /// # Example
21545 /// ```ignore,no_run
21546 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21547 /// use wkt::BoolValue;
21548 /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21549 /// ```
21550 pub fn set_if_exists<T>(mut self, v: T) -> Self
21551 where
21552 T: std::convert::Into<wkt::BoolValue>,
21553 {
21554 self.if_exists = std::option::Option::Some(v.into());
21555 self
21556 }
21557
21558 /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21559 ///
21560 /// # Example
21561 /// ```ignore,no_run
21562 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21563 /// use wkt::BoolValue;
21564 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21565 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21566 /// ```
21567 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21568 where
21569 T: std::convert::Into<wkt::BoolValue>,
21570 {
21571 self.if_exists = v.map(|x| x.into());
21572 self
21573 }
21574 }
21575
21576 impl wkt::message::Message for PostgresImportOptions {
21577 fn typename() -> &'static str {
21578 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
21579 }
21580 }
21581 }
21582
21583 #[allow(missing_docs)]
21584 #[derive(Clone, Default, PartialEq)]
21585 #[non_exhaustive]
21586 pub struct SqlCsvImportOptions {
21587 /// The table to which CSV data is imported.
21588 pub table: std::string::String,
21589
21590 /// The columns to which CSV data is imported. If not specified, all columns
21591 /// of the database table are loaded with CSV data.
21592 pub columns: std::vec::Vec<std::string::String>,
21593
21594 /// Specifies the character that should appear before a data character that
21595 /// needs to be escaped.
21596 pub escape_character: std::string::String,
21597
21598 /// Specifies the quoting character to be used when a data value is quoted.
21599 pub quote_character: std::string::String,
21600
21601 /// Specifies the character that separates columns within each row (line) of
21602 /// the file.
21603 pub fields_terminated_by: std::string::String,
21604
21605 /// This is used to separate lines. If a line does not contain all fields,
21606 /// the rest of the columns are set to their default values.
21607 pub lines_terminated_by: std::string::String,
21608
21609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21610 }
21611
21612 impl SqlCsvImportOptions {
21613 /// Creates a new default instance.
21614 pub fn new() -> Self {
21615 std::default::Default::default()
21616 }
21617
21618 /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
21619 ///
21620 /// # Example
21621 /// ```ignore,no_run
21622 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21623 /// let x = SqlCsvImportOptions::new().set_table("example");
21624 /// ```
21625 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21626 self.table = v.into();
21627 self
21628 }
21629
21630 /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
21631 ///
21632 /// # Example
21633 /// ```ignore,no_run
21634 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21635 /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
21636 /// ```
21637 pub fn set_columns<T, V>(mut self, v: T) -> Self
21638 where
21639 T: std::iter::IntoIterator<Item = V>,
21640 V: std::convert::Into<std::string::String>,
21641 {
21642 use std::iter::Iterator;
21643 self.columns = v.into_iter().map(|i| i.into()).collect();
21644 self
21645 }
21646
21647 /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
21648 ///
21649 /// # Example
21650 /// ```ignore,no_run
21651 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21652 /// let x = SqlCsvImportOptions::new().set_escape_character("example");
21653 /// ```
21654 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21655 mut self,
21656 v: T,
21657 ) -> Self {
21658 self.escape_character = v.into();
21659 self
21660 }
21661
21662 /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
21663 ///
21664 /// # Example
21665 /// ```ignore,no_run
21666 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21667 /// let x = SqlCsvImportOptions::new().set_quote_character("example");
21668 /// ```
21669 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21670 mut self,
21671 v: T,
21672 ) -> Self {
21673 self.quote_character = v.into();
21674 self
21675 }
21676
21677 /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
21678 ///
21679 /// # Example
21680 /// ```ignore,no_run
21681 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21682 /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
21683 /// ```
21684 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21685 mut self,
21686 v: T,
21687 ) -> Self {
21688 self.fields_terminated_by = v.into();
21689 self
21690 }
21691
21692 /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
21693 ///
21694 /// # Example
21695 /// ```ignore,no_run
21696 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21697 /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
21698 /// ```
21699 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21700 mut self,
21701 v: T,
21702 ) -> Self {
21703 self.lines_terminated_by = v.into();
21704 self
21705 }
21706 }
21707
21708 impl wkt::message::Message for SqlCsvImportOptions {
21709 fn typename() -> &'static str {
21710 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
21711 }
21712 }
21713
21714 #[allow(missing_docs)]
21715 #[derive(Clone, Default, PartialEq)]
21716 #[non_exhaustive]
21717 pub struct SqlBakImportOptions {
21718 #[allow(missing_docs)]
21719 pub encryption_options: std::option::Option<
21720 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21721 >,
21722
21723 /// Whether or not the backup set being restored is striped.
21724 /// Applies only to Cloud SQL for SQL Server.
21725 pub striped: std::option::Option<wkt::BoolValue>,
21726
21727 /// Whether or not the backup importing will restore database
21728 /// with NORECOVERY option.
21729 /// Applies only to Cloud SQL for SQL Server.
21730 pub no_recovery: std::option::Option<wkt::BoolValue>,
21731
21732 /// Whether or not the backup importing request will just bring database
21733 /// online without downloading Bak content only one of "no_recovery" and
21734 /// "recovery_only" can be true otherwise error will return. Applies only to
21735 /// Cloud SQL for SQL Server.
21736 pub recovery_only: std::option::Option<wkt::BoolValue>,
21737
21738 /// Type of the bak content, FULL or DIFF
21739 pub bak_type: crate::model::BakType,
21740
21741 /// Optional. The timestamp when the import should stop. This timestamp is in
21742 /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
21743 /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
21744 /// keyword and applies to Cloud SQL for SQL Server only.
21745 pub stop_at: std::option::Option<wkt::Timestamp>,
21746
21747 /// Optional. The marked transaction where the import should stop. This field
21748 /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
21749 /// Server only.
21750 pub stop_at_mark: std::string::String,
21751
21752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21753 }
21754
21755 impl SqlBakImportOptions {
21756 /// Creates a new default instance.
21757 pub fn new() -> Self {
21758 std::default::Default::default()
21759 }
21760
21761 /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21762 ///
21763 /// # Example
21764 /// ```ignore,no_run
21765 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21766 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21767 /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
21768 /// ```
21769 pub fn set_encryption_options<T>(mut self, v: T) -> Self
21770 where
21771 T: std::convert::Into<
21772 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21773 >,
21774 {
21775 self.encryption_options = std::option::Option::Some(v.into());
21776 self
21777 }
21778
21779 /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21780 ///
21781 /// # Example
21782 /// ```ignore,no_run
21783 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21784 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21785 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
21786 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
21787 /// ```
21788 pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
21789 where
21790 T: std::convert::Into<
21791 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21792 >,
21793 {
21794 self.encryption_options = v.map(|x| x.into());
21795 self
21796 }
21797
21798 /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21799 ///
21800 /// # Example
21801 /// ```ignore,no_run
21802 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21803 /// use wkt::BoolValue;
21804 /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
21805 /// ```
21806 pub fn set_striped<T>(mut self, v: T) -> Self
21807 where
21808 T: std::convert::Into<wkt::BoolValue>,
21809 {
21810 self.striped = std::option::Option::Some(v.into());
21811 self
21812 }
21813
21814 /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21815 ///
21816 /// # Example
21817 /// ```ignore,no_run
21818 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21819 /// use wkt::BoolValue;
21820 /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21821 /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
21822 /// ```
21823 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21824 where
21825 T: std::convert::Into<wkt::BoolValue>,
21826 {
21827 self.striped = v.map(|x| x.into());
21828 self
21829 }
21830
21831 /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21832 ///
21833 /// # Example
21834 /// ```ignore,no_run
21835 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21836 /// use wkt::BoolValue;
21837 /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
21838 /// ```
21839 pub fn set_no_recovery<T>(mut self, v: T) -> Self
21840 where
21841 T: std::convert::Into<wkt::BoolValue>,
21842 {
21843 self.no_recovery = std::option::Option::Some(v.into());
21844 self
21845 }
21846
21847 /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21848 ///
21849 /// # Example
21850 /// ```ignore,no_run
21851 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21852 /// use wkt::BoolValue;
21853 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
21854 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
21855 /// ```
21856 pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
21857 where
21858 T: std::convert::Into<wkt::BoolValue>,
21859 {
21860 self.no_recovery = v.map(|x| x.into());
21861 self
21862 }
21863
21864 /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21865 ///
21866 /// # Example
21867 /// ```ignore,no_run
21868 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21869 /// use wkt::BoolValue;
21870 /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
21871 /// ```
21872 pub fn set_recovery_only<T>(mut self, v: T) -> Self
21873 where
21874 T: std::convert::Into<wkt::BoolValue>,
21875 {
21876 self.recovery_only = std::option::Option::Some(v.into());
21877 self
21878 }
21879
21880 /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21881 ///
21882 /// # Example
21883 /// ```ignore,no_run
21884 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21885 /// use wkt::BoolValue;
21886 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
21887 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
21888 /// ```
21889 pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
21890 where
21891 T: std::convert::Into<wkt::BoolValue>,
21892 {
21893 self.recovery_only = v.map(|x| x.into());
21894 self
21895 }
21896
21897 /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
21898 ///
21899 /// # Example
21900 /// ```ignore,no_run
21901 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21902 /// use google_cloud_sql_v1::model::BakType;
21903 /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
21904 /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
21905 /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
21906 /// ```
21907 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
21908 self.bak_type = v.into();
21909 self
21910 }
21911
21912 /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21913 ///
21914 /// # Example
21915 /// ```ignore,no_run
21916 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21917 /// use wkt::Timestamp;
21918 /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
21919 /// ```
21920 pub fn set_stop_at<T>(mut self, v: T) -> Self
21921 where
21922 T: std::convert::Into<wkt::Timestamp>,
21923 {
21924 self.stop_at = std::option::Option::Some(v.into());
21925 self
21926 }
21927
21928 /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21929 ///
21930 /// # Example
21931 /// ```ignore,no_run
21932 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21933 /// use wkt::Timestamp;
21934 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
21935 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
21936 /// ```
21937 pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
21938 where
21939 T: std::convert::Into<wkt::Timestamp>,
21940 {
21941 self.stop_at = v.map(|x| x.into());
21942 self
21943 }
21944
21945 /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
21946 ///
21947 /// # Example
21948 /// ```ignore,no_run
21949 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21950 /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
21951 /// ```
21952 pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
21953 mut self,
21954 v: T,
21955 ) -> Self {
21956 self.stop_at_mark = v.into();
21957 self
21958 }
21959 }
21960
21961 impl wkt::message::Message for SqlBakImportOptions {
21962 fn typename() -> &'static str {
21963 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
21964 }
21965 }
21966
21967 /// Defines additional types related to [SqlBakImportOptions].
21968 pub mod sql_bak_import_options {
21969 #[allow(unused_imports)]
21970 use super::*;
21971
21972 #[allow(missing_docs)]
21973 #[derive(Clone, Default, PartialEq)]
21974 #[non_exhaustive]
21975 pub struct EncryptionOptions {
21976 /// Path to the Certificate (.cer) in Cloud Storage, in the form
21977 /// `gs://bucketName/fileName`. The instance must have
21978 /// write permissions to the bucket and read access to the file.
21979 pub cert_path: std::string::String,
21980
21981 /// Path to the Certificate Private Key (.pvk) in Cloud Storage, in the
21982 /// form `gs://bucketName/fileName`. The instance must have
21983 /// write permissions to the bucket and read access to the file.
21984 pub pvk_path: std::string::String,
21985
21986 /// Password that encrypts the private key
21987 pub pvk_password: std::string::String,
21988
21989 /// Optional. Whether the imported file remains encrypted.
21990 pub keep_encrypted: std::option::Option<wkt::BoolValue>,
21991
21992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21993 }
21994
21995 impl EncryptionOptions {
21996 /// Creates a new default instance.
21997 pub fn new() -> Self {
21998 std::default::Default::default()
21999 }
22000
22001 /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
22002 ///
22003 /// # Example
22004 /// ```ignore,no_run
22005 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22006 /// let x = EncryptionOptions::new().set_cert_path("example");
22007 /// ```
22008 pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
22009 mut self,
22010 v: T,
22011 ) -> Self {
22012 self.cert_path = v.into();
22013 self
22014 }
22015
22016 /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
22017 ///
22018 /// # Example
22019 /// ```ignore,no_run
22020 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22021 /// let x = EncryptionOptions::new().set_pvk_path("example");
22022 /// ```
22023 pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
22024 mut self,
22025 v: T,
22026 ) -> Self {
22027 self.pvk_path = v.into();
22028 self
22029 }
22030
22031 /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
22032 ///
22033 /// # Example
22034 /// ```ignore,no_run
22035 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22036 /// let x = EncryptionOptions::new().set_pvk_password("example");
22037 /// ```
22038 pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
22039 mut self,
22040 v: T,
22041 ) -> Self {
22042 self.pvk_password = v.into();
22043 self
22044 }
22045
22046 /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
22047 ///
22048 /// # Example
22049 /// ```ignore,no_run
22050 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22051 /// use wkt::BoolValue;
22052 /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
22053 /// ```
22054 pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
22055 where
22056 T: std::convert::Into<wkt::BoolValue>,
22057 {
22058 self.keep_encrypted = std::option::Option::Some(v.into());
22059 self
22060 }
22061
22062 /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
22063 ///
22064 /// # Example
22065 /// ```ignore,no_run
22066 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22067 /// use wkt::BoolValue;
22068 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
22069 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
22070 /// ```
22071 pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
22072 where
22073 T: std::convert::Into<wkt::BoolValue>,
22074 {
22075 self.keep_encrypted = v.map(|x| x.into());
22076 self
22077 }
22078 }
22079
22080 impl wkt::message::Message for EncryptionOptions {
22081 fn typename() -> &'static str {
22082 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
22083 }
22084 }
22085 }
22086
22087 #[allow(missing_docs)]
22088 #[derive(Clone, Default, PartialEq)]
22089 #[non_exhaustive]
22090 pub struct SqlTdeImportOptions {
22091 /// Required. Path to the TDE certificate public key
22092 /// in the form gs://bucketName/fileName.
22093 /// The instance must have read access to the file.
22094 /// Applicable only for SQL Server instances.
22095 pub certificate_path: std::string::String,
22096
22097 /// Required. Path to the TDE certificate private key
22098 /// in the form gs://bucketName/fileName.
22099 /// The instance must have read access to the file.
22100 /// Applicable only for SQL Server instances.
22101 pub private_key_path: std::string::String,
22102
22103 /// Required. Password that encrypts the private key.
22104 pub private_key_password: std::string::String,
22105
22106 /// Required. Certificate name.
22107 /// Applicable only for SQL Server instances.
22108 pub name: std::string::String,
22109
22110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22111 }
22112
22113 impl SqlTdeImportOptions {
22114 /// Creates a new default instance.
22115 pub fn new() -> Self {
22116 std::default::Default::default()
22117 }
22118
22119 /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
22120 ///
22121 /// # Example
22122 /// ```ignore,no_run
22123 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22124 /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
22125 /// ```
22126 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
22127 mut self,
22128 v: T,
22129 ) -> Self {
22130 self.certificate_path = v.into();
22131 self
22132 }
22133
22134 /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
22135 ///
22136 /// # Example
22137 /// ```ignore,no_run
22138 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22139 /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
22140 /// ```
22141 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
22142 mut self,
22143 v: T,
22144 ) -> Self {
22145 self.private_key_path = v.into();
22146 self
22147 }
22148
22149 /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
22150 ///
22151 /// # Example
22152 /// ```ignore,no_run
22153 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22154 /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
22155 /// ```
22156 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
22157 mut self,
22158 v: T,
22159 ) -> Self {
22160 self.private_key_password = v.into();
22161 self
22162 }
22163
22164 /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
22165 ///
22166 /// # Example
22167 /// ```ignore,no_run
22168 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22169 /// let x = SqlTdeImportOptions::new().set_name("example");
22170 /// ```
22171 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22172 self.name = v.into();
22173 self
22174 }
22175 }
22176
22177 impl wkt::message::Message for SqlTdeImportOptions {
22178 fn typename() -> &'static str {
22179 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
22180 }
22181 }
22182}
22183
22184/// IP Management configuration.
22185#[derive(Clone, Default, PartialEq)]
22186#[non_exhaustive]
22187pub struct IpConfiguration {
22188 /// Whether the instance is assigned a public IP address or not.
22189 pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
22190
22191 /// The resource link for the VPC network from which the Cloud SQL instance is
22192 /// accessible for private IP. For example,
22193 /// `/projects/myProject/global/networks/default`. This setting can
22194 /// be updated, but it cannot be removed after it is set.
22195 pub private_network: std::string::String,
22196
22197 /// Use `ssl_mode` instead.
22198 ///
22199 /// Whether SSL/TLS connections over IP are enforced.
22200 /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
22201 /// For SSL/TLS connections, the client certificate won't be verified. If
22202 /// set to true, then only allow connections encrypted with SSL/TLS and with
22203 /// valid client certificates. If you want to enforce SSL/TLS without enforcing
22204 /// the requirement for valid client certificates, then use the `ssl_mode` flag
22205 /// instead of the `require_ssl` flag.
22206 pub require_ssl: std::option::Option<wkt::BoolValue>,
22207
22208 /// The list of external networks that are allowed to connect to the instance
22209 /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
22210 /// example: `157.197.200.0/24`).
22211 pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
22212
22213 /// The name of the allocated ip range for the private ip Cloud SQL instance.
22214 /// For example: "google-managed-services-default". If set, the instance ip
22215 /// will be created in the allocated range. The range name must comply with
22216 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
22217 /// must be 1-63 characters long and match the regular expression
22218 /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
22219 pub allocated_ip_range: std::string::String,
22220
22221 /// Controls connectivity to private IP instances from Google services,
22222 /// such as BigQuery.
22223 pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
22224
22225 /// Specify how SSL/TLS is enforced in database connections. If you must use
22226 /// the `require_ssl` flag for backward compatibility, then only the following
22227 /// value pairs are valid:
22228 ///
22229 /// For PostgreSQL and MySQL:
22230 ///
22231 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
22232 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
22233 /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
22234 ///
22235 /// For SQL Server:
22236 ///
22237 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
22238 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
22239 ///
22240 /// The value of `ssl_mode` has priority over the value of `require_ssl`.
22241 ///
22242 /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
22243 /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
22244 /// connections, while `require_ssl=false` means accept both non-SSL
22245 /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
22246 /// `ssl_mode` and accepts only SSL connections.
22247 pub ssl_mode: crate::model::ip_configuration::SslMode,
22248
22249 /// PSC settings for this instance.
22250 pub psc_config: std::option::Option<crate::model::PscConfig>,
22251
22252 /// Specify what type of CA is used for the server certificate.
22253 pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
22254
22255 /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
22256 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
22257
22258 /// Optional. The resource name of the server CA pool for an instance with
22259 /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
22260 /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
22261 pub server_ca_pool: std::option::Option<std::string::String>,
22262
22263 /// Optional. Controls the automatic server certificate rotation feature. This
22264 /// feature is disabled by default. When enabled, the server certificate will
22265 /// be automatically rotated during Cloud SQL scheduled maintenance or
22266 /// self-service maintenance updates up to six months before it expires. This
22267 /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
22268 /// or CUSTOMER_MANAGED_CAS_CA.
22269 pub server_certificate_rotation_mode:
22270 std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
22271
22272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22273}
22274
22275impl IpConfiguration {
22276 /// Creates a new default instance.
22277 pub fn new() -> Self {
22278 std::default::Default::default()
22279 }
22280
22281 /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22282 ///
22283 /// # Example
22284 /// ```ignore,no_run
22285 /// # use google_cloud_sql_v1::model::IpConfiguration;
22286 /// use wkt::BoolValue;
22287 /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
22288 /// ```
22289 pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
22290 where
22291 T: std::convert::Into<wkt::BoolValue>,
22292 {
22293 self.ipv4_enabled = std::option::Option::Some(v.into());
22294 self
22295 }
22296
22297 /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
22298 ///
22299 /// # Example
22300 /// ```ignore,no_run
22301 /// # use google_cloud_sql_v1::model::IpConfiguration;
22302 /// use wkt::BoolValue;
22303 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
22304 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
22305 /// ```
22306 pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22307 where
22308 T: std::convert::Into<wkt::BoolValue>,
22309 {
22310 self.ipv4_enabled = v.map(|x| x.into());
22311 self
22312 }
22313
22314 /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
22315 ///
22316 /// # Example
22317 /// ```ignore,no_run
22318 /// # use google_cloud_sql_v1::model::IpConfiguration;
22319 /// let x = IpConfiguration::new().set_private_network("example");
22320 /// ```
22321 pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22322 self.private_network = v.into();
22323 self
22324 }
22325
22326 /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22327 ///
22328 /// # Example
22329 /// ```ignore,no_run
22330 /// # use google_cloud_sql_v1::model::IpConfiguration;
22331 /// use wkt::BoolValue;
22332 /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
22333 /// ```
22334 pub fn set_require_ssl<T>(mut self, v: T) -> Self
22335 where
22336 T: std::convert::Into<wkt::BoolValue>,
22337 {
22338 self.require_ssl = std::option::Option::Some(v.into());
22339 self
22340 }
22341
22342 /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
22343 ///
22344 /// # Example
22345 /// ```ignore,no_run
22346 /// # use google_cloud_sql_v1::model::IpConfiguration;
22347 /// use wkt::BoolValue;
22348 /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
22349 /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
22350 /// ```
22351 pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
22352 where
22353 T: std::convert::Into<wkt::BoolValue>,
22354 {
22355 self.require_ssl = v.map(|x| x.into());
22356 self
22357 }
22358
22359 /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
22360 ///
22361 /// # Example
22362 /// ```ignore,no_run
22363 /// # use google_cloud_sql_v1::model::IpConfiguration;
22364 /// use google_cloud_sql_v1::model::AclEntry;
22365 /// let x = IpConfiguration::new()
22366 /// .set_authorized_networks([
22367 /// AclEntry::default()/* use setters */,
22368 /// AclEntry::default()/* use (different) setters */,
22369 /// ]);
22370 /// ```
22371 pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
22372 where
22373 T: std::iter::IntoIterator<Item = V>,
22374 V: std::convert::Into<crate::model::AclEntry>,
22375 {
22376 use std::iter::Iterator;
22377 self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
22378 self
22379 }
22380
22381 /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
22382 ///
22383 /// # Example
22384 /// ```ignore,no_run
22385 /// # use google_cloud_sql_v1::model::IpConfiguration;
22386 /// let x = IpConfiguration::new().set_allocated_ip_range("example");
22387 /// ```
22388 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
22389 mut self,
22390 v: T,
22391 ) -> Self {
22392 self.allocated_ip_range = v.into();
22393 self
22394 }
22395
22396 /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22397 ///
22398 /// # Example
22399 /// ```ignore,no_run
22400 /// # use google_cloud_sql_v1::model::IpConfiguration;
22401 /// use wkt::BoolValue;
22402 /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
22403 /// ```
22404 pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
22405 where
22406 T: std::convert::Into<wkt::BoolValue>,
22407 {
22408 self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
22409 self
22410 }
22411
22412 /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
22413 ///
22414 /// # Example
22415 /// ```ignore,no_run
22416 /// # use google_cloud_sql_v1::model::IpConfiguration;
22417 /// use wkt::BoolValue;
22418 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
22419 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
22420 /// ```
22421 pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
22422 mut self,
22423 v: std::option::Option<T>,
22424 ) -> Self
22425 where
22426 T: std::convert::Into<wkt::BoolValue>,
22427 {
22428 self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
22429 self
22430 }
22431
22432 /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
22433 ///
22434 /// # Example
22435 /// ```ignore,no_run
22436 /// # use google_cloud_sql_v1::model::IpConfiguration;
22437 /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
22438 /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
22439 /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
22440 /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
22441 /// ```
22442 pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
22443 mut self,
22444 v: T,
22445 ) -> Self {
22446 self.ssl_mode = v.into();
22447 self
22448 }
22449
22450 /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
22451 ///
22452 /// # Example
22453 /// ```ignore,no_run
22454 /// # use google_cloud_sql_v1::model::IpConfiguration;
22455 /// use google_cloud_sql_v1::model::PscConfig;
22456 /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
22457 /// ```
22458 pub fn set_psc_config<T>(mut self, v: T) -> Self
22459 where
22460 T: std::convert::Into<crate::model::PscConfig>,
22461 {
22462 self.psc_config = std::option::Option::Some(v.into());
22463 self
22464 }
22465
22466 /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
22467 ///
22468 /// # Example
22469 /// ```ignore,no_run
22470 /// # use google_cloud_sql_v1::model::IpConfiguration;
22471 /// use google_cloud_sql_v1::model::PscConfig;
22472 /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
22473 /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
22474 /// ```
22475 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
22476 where
22477 T: std::convert::Into<crate::model::PscConfig>,
22478 {
22479 self.psc_config = v.map(|x| x.into());
22480 self
22481 }
22482
22483 /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22484 ///
22485 /// # Example
22486 /// ```ignore,no_run
22487 /// # use google_cloud_sql_v1::model::IpConfiguration;
22488 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22489 /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
22490 /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
22491 /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
22492 /// ```
22493 pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
22494 where
22495 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22496 {
22497 self.server_ca_mode = std::option::Option::Some(v.into());
22498 self
22499 }
22500
22501 /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22502 ///
22503 /// # Example
22504 /// ```ignore,no_run
22505 /// # use google_cloud_sql_v1::model::IpConfiguration;
22506 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22507 /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
22508 /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
22509 /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
22510 /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
22511 /// ```
22512 pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
22513 where
22514 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22515 {
22516 self.server_ca_mode = v.map(|x| x.into());
22517 self
22518 }
22519
22520 /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
22521 ///
22522 /// # Example
22523 /// ```ignore,no_run
22524 /// # use google_cloud_sql_v1::model::IpConfiguration;
22525 /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
22526 /// ```
22527 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
22528 where
22529 T: std::iter::IntoIterator<Item = V>,
22530 V: std::convert::Into<std::string::String>,
22531 {
22532 use std::iter::Iterator;
22533 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
22534 self
22535 }
22536
22537 /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22538 ///
22539 /// # Example
22540 /// ```ignore,no_run
22541 /// # use google_cloud_sql_v1::model::IpConfiguration;
22542 /// let x = IpConfiguration::new().set_server_ca_pool("example");
22543 /// ```
22544 pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
22545 where
22546 T: std::convert::Into<std::string::String>,
22547 {
22548 self.server_ca_pool = std::option::Option::Some(v.into());
22549 self
22550 }
22551
22552 /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22553 ///
22554 /// # Example
22555 /// ```ignore,no_run
22556 /// # use google_cloud_sql_v1::model::IpConfiguration;
22557 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
22558 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
22559 /// ```
22560 pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
22561 where
22562 T: std::convert::Into<std::string::String>,
22563 {
22564 self.server_ca_pool = v.map(|x| x.into());
22565 self
22566 }
22567
22568 /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22569 ///
22570 /// # Example
22571 /// ```ignore,no_run
22572 /// # use google_cloud_sql_v1::model::IpConfiguration;
22573 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22574 /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
22575 /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
22576 /// ```
22577 pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
22578 where
22579 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22580 {
22581 self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
22582 self
22583 }
22584
22585 /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22586 ///
22587 /// # Example
22588 /// ```ignore,no_run
22589 /// # use google_cloud_sql_v1::model::IpConfiguration;
22590 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22591 /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
22592 /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
22593 /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
22594 /// ```
22595 pub fn set_or_clear_server_certificate_rotation_mode<T>(
22596 mut self,
22597 v: std::option::Option<T>,
22598 ) -> Self
22599 where
22600 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22601 {
22602 self.server_certificate_rotation_mode = v.map(|x| x.into());
22603 self
22604 }
22605}
22606
22607impl wkt::message::Message for IpConfiguration {
22608 fn typename() -> &'static str {
22609 "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
22610 }
22611}
22612
22613/// Defines additional types related to [IpConfiguration].
22614pub mod ip_configuration {
22615 #[allow(unused_imports)]
22616 use super::*;
22617
22618 /// The SSL options for database connections.
22619 ///
22620 /// # Working with unknown values
22621 ///
22622 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22623 /// additional enum variants at any time. Adding new variants is not considered
22624 /// a breaking change. Applications should write their code in anticipation of:
22625 ///
22626 /// - New values appearing in future releases of the client library, **and**
22627 /// - New values received dynamically, without application changes.
22628 ///
22629 /// Please consult the [Working with enums] section in the user guide for some
22630 /// guidelines.
22631 ///
22632 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22633 #[derive(Clone, Debug, PartialEq)]
22634 #[non_exhaustive]
22635 pub enum SslMode {
22636 /// The SSL mode is unknown.
22637 Unspecified,
22638 /// Allow non-SSL/non-TLS and SSL/TLS connections.
22639 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22640 /// isn't verified.
22641 ///
22642 /// When this value is used, the legacy `require_ssl` flag must be false or
22643 /// cleared to avoid a conflict between the values of the two flags.
22644 AllowUnencryptedAndEncrypted,
22645 /// Only allow connections encrypted with SSL/TLS.
22646 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22647 /// isn't verified.
22648 ///
22649 /// When this value is used, the legacy `require_ssl` flag must be false or
22650 /// cleared to avoid a conflict between the values of the two flags.
22651 EncryptedOnly,
22652 /// Only allow connections encrypted with SSL/TLS and with valid
22653 /// client certificates.
22654 ///
22655 /// When this value is used, the legacy `require_ssl` flag must be true or
22656 /// cleared to avoid the conflict between values of two flags.
22657 /// PostgreSQL clients or users that connect using IAM database
22658 /// authentication must use either the
22659 /// [Cloud SQL Auth
22660 /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
22661 /// [Cloud SQL
22662 /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
22663 /// to enforce client identity verification.
22664 ///
22665 /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
22666 TrustedClientCertificateRequired,
22667 /// If set, the enum was initialized with an unknown value.
22668 ///
22669 /// Applications can examine the value using [SslMode::value] or
22670 /// [SslMode::name].
22671 UnknownValue(ssl_mode::UnknownValue),
22672 }
22673
22674 #[doc(hidden)]
22675 pub mod ssl_mode {
22676 #[allow(unused_imports)]
22677 use super::*;
22678 #[derive(Clone, Debug, PartialEq)]
22679 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22680 }
22681
22682 impl SslMode {
22683 /// Gets the enum value.
22684 ///
22685 /// Returns `None` if the enum contains an unknown value deserialized from
22686 /// the string representation of enums.
22687 pub fn value(&self) -> std::option::Option<i32> {
22688 match self {
22689 Self::Unspecified => std::option::Option::Some(0),
22690 Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
22691 Self::EncryptedOnly => std::option::Option::Some(2),
22692 Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
22693 Self::UnknownValue(u) => u.0.value(),
22694 }
22695 }
22696
22697 /// Gets the enum value as a string.
22698 ///
22699 /// Returns `None` if the enum contains an unknown value deserialized from
22700 /// the integer representation of enums.
22701 pub fn name(&self) -> std::option::Option<&str> {
22702 match self {
22703 Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
22704 Self::AllowUnencryptedAndEncrypted => {
22705 std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
22706 }
22707 Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
22708 Self::TrustedClientCertificateRequired => {
22709 std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
22710 }
22711 Self::UnknownValue(u) => u.0.name(),
22712 }
22713 }
22714 }
22715
22716 impl std::default::Default for SslMode {
22717 fn default() -> Self {
22718 use std::convert::From;
22719 Self::from(0)
22720 }
22721 }
22722
22723 impl std::fmt::Display for SslMode {
22724 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22725 wkt::internal::display_enum(f, self.name(), self.value())
22726 }
22727 }
22728
22729 impl std::convert::From<i32> for SslMode {
22730 fn from(value: i32) -> Self {
22731 match value {
22732 0 => Self::Unspecified,
22733 1 => Self::AllowUnencryptedAndEncrypted,
22734 2 => Self::EncryptedOnly,
22735 3 => Self::TrustedClientCertificateRequired,
22736 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22737 wkt::internal::UnknownEnumValue::Integer(value),
22738 )),
22739 }
22740 }
22741 }
22742
22743 impl std::convert::From<&str> for SslMode {
22744 fn from(value: &str) -> Self {
22745 use std::string::ToString;
22746 match value {
22747 "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
22748 "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
22749 "ENCRYPTED_ONLY" => Self::EncryptedOnly,
22750 "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
22751 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22752 wkt::internal::UnknownEnumValue::String(value.to_string()),
22753 )),
22754 }
22755 }
22756 }
22757
22758 impl serde::ser::Serialize for SslMode {
22759 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22760 where
22761 S: serde::Serializer,
22762 {
22763 match self {
22764 Self::Unspecified => serializer.serialize_i32(0),
22765 Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
22766 Self::EncryptedOnly => serializer.serialize_i32(2),
22767 Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
22768 Self::UnknownValue(u) => u.0.serialize(serializer),
22769 }
22770 }
22771 }
22772
22773 impl<'de> serde::de::Deserialize<'de> for SslMode {
22774 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22775 where
22776 D: serde::Deserializer<'de>,
22777 {
22778 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
22779 ".google.cloud.sql.v1.IpConfiguration.SslMode",
22780 ))
22781 }
22782 }
22783
22784 /// Various Certificate Authority (CA) modes for certificate signing.
22785 ///
22786 /// # Working with unknown values
22787 ///
22788 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22789 /// additional enum variants at any time. Adding new variants is not considered
22790 /// a breaking change. Applications should write their code in anticipation of:
22791 ///
22792 /// - New values appearing in future releases of the client library, **and**
22793 /// - New values received dynamically, without application changes.
22794 ///
22795 /// Please consult the [Working with enums] section in the user guide for some
22796 /// guidelines.
22797 ///
22798 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22799 #[derive(Clone, Debug, PartialEq)]
22800 #[non_exhaustive]
22801 pub enum CaMode {
22802 /// CA mode is unspecified. It is effectively the same as
22803 /// `GOOGLE_MANAGED_INTERNAL_CA`.
22804 Unspecified,
22805 /// Google-managed self-signed internal CA.
22806 GoogleManagedInternalCa,
22807 /// Google-managed regional CA part of root CA hierarchy hosted on Google
22808 /// Cloud's Certificate Authority Service (CAS).
22809 GoogleManagedCasCa,
22810 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
22811 /// Service (CAS).
22812 CustomerManagedCasCa,
22813 /// If set, the enum was initialized with an unknown value.
22814 ///
22815 /// Applications can examine the value using [CaMode::value] or
22816 /// [CaMode::name].
22817 UnknownValue(ca_mode::UnknownValue),
22818 }
22819
22820 #[doc(hidden)]
22821 pub mod ca_mode {
22822 #[allow(unused_imports)]
22823 use super::*;
22824 #[derive(Clone, Debug, PartialEq)]
22825 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22826 }
22827
22828 impl CaMode {
22829 /// Gets the enum value.
22830 ///
22831 /// Returns `None` if the enum contains an unknown value deserialized from
22832 /// the string representation of enums.
22833 pub fn value(&self) -> std::option::Option<i32> {
22834 match self {
22835 Self::Unspecified => std::option::Option::Some(0),
22836 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
22837 Self::GoogleManagedCasCa => std::option::Option::Some(2),
22838 Self::CustomerManagedCasCa => std::option::Option::Some(3),
22839 Self::UnknownValue(u) => u.0.value(),
22840 }
22841 }
22842
22843 /// Gets the enum value as a string.
22844 ///
22845 /// Returns `None` if the enum contains an unknown value deserialized from
22846 /// the integer representation of enums.
22847 pub fn name(&self) -> std::option::Option<&str> {
22848 match self {
22849 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
22850 Self::GoogleManagedInternalCa => {
22851 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
22852 }
22853 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
22854 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
22855 Self::UnknownValue(u) => u.0.name(),
22856 }
22857 }
22858 }
22859
22860 impl std::default::Default for CaMode {
22861 fn default() -> Self {
22862 use std::convert::From;
22863 Self::from(0)
22864 }
22865 }
22866
22867 impl std::fmt::Display for CaMode {
22868 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22869 wkt::internal::display_enum(f, self.name(), self.value())
22870 }
22871 }
22872
22873 impl std::convert::From<i32> for CaMode {
22874 fn from(value: i32) -> Self {
22875 match value {
22876 0 => Self::Unspecified,
22877 1 => Self::GoogleManagedInternalCa,
22878 2 => Self::GoogleManagedCasCa,
22879 3 => Self::CustomerManagedCasCa,
22880 _ => Self::UnknownValue(ca_mode::UnknownValue(
22881 wkt::internal::UnknownEnumValue::Integer(value),
22882 )),
22883 }
22884 }
22885 }
22886
22887 impl std::convert::From<&str> for CaMode {
22888 fn from(value: &str) -> Self {
22889 use std::string::ToString;
22890 match value {
22891 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
22892 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
22893 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
22894 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
22895 _ => Self::UnknownValue(ca_mode::UnknownValue(
22896 wkt::internal::UnknownEnumValue::String(value.to_string()),
22897 )),
22898 }
22899 }
22900 }
22901
22902 impl serde::ser::Serialize for CaMode {
22903 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22904 where
22905 S: serde::Serializer,
22906 {
22907 match self {
22908 Self::Unspecified => serializer.serialize_i32(0),
22909 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
22910 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
22911 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
22912 Self::UnknownValue(u) => u.0.serialize(serializer),
22913 }
22914 }
22915 }
22916
22917 impl<'de> serde::de::Deserialize<'de> for CaMode {
22918 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22919 where
22920 D: serde::Deserializer<'de>,
22921 {
22922 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
22923 ".google.cloud.sql.v1.IpConfiguration.CaMode",
22924 ))
22925 }
22926 }
22927
22928 /// Settings for automatic server certificate rotation.
22929 ///
22930 /// # Working with unknown values
22931 ///
22932 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22933 /// additional enum variants at any time. Adding new variants is not considered
22934 /// a breaking change. Applications should write their code in anticipation of:
22935 ///
22936 /// - New values appearing in future releases of the client library, **and**
22937 /// - New values received dynamically, without application changes.
22938 ///
22939 /// Please consult the [Working with enums] section in the user guide for some
22940 /// guidelines.
22941 ///
22942 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22943 #[derive(Clone, Debug, PartialEq)]
22944 #[non_exhaustive]
22945 pub enum ServerCertificateRotationMode {
22946 /// Unspecified: no automatic server certificate rotation.
22947 Unspecified,
22948 /// No automatic server certificate rotation. The user must [manage server
22949 /// certificate
22950 /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
22951 /// on their side.
22952 NoAutomaticRotation,
22953 /// Automatic server certificate rotation during Cloud SQL scheduled
22954 /// maintenance or self-service maintenance updates. Requires
22955 /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
22956 /// `CUSTOMER_MANAGED_CAS_CA`.
22957 AutomaticRotationDuringMaintenance,
22958 /// If set, the enum was initialized with an unknown value.
22959 ///
22960 /// Applications can examine the value using [ServerCertificateRotationMode::value] or
22961 /// [ServerCertificateRotationMode::name].
22962 UnknownValue(server_certificate_rotation_mode::UnknownValue),
22963 }
22964
22965 #[doc(hidden)]
22966 pub mod server_certificate_rotation_mode {
22967 #[allow(unused_imports)]
22968 use super::*;
22969 #[derive(Clone, Debug, PartialEq)]
22970 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22971 }
22972
22973 impl ServerCertificateRotationMode {
22974 /// Gets the enum value.
22975 ///
22976 /// Returns `None` if the enum contains an unknown value deserialized from
22977 /// the string representation of enums.
22978 pub fn value(&self) -> std::option::Option<i32> {
22979 match self {
22980 Self::Unspecified => std::option::Option::Some(0),
22981 Self::NoAutomaticRotation => std::option::Option::Some(1),
22982 Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
22983 Self::UnknownValue(u) => u.0.value(),
22984 }
22985 }
22986
22987 /// Gets the enum value as a string.
22988 ///
22989 /// Returns `None` if the enum contains an unknown value deserialized from
22990 /// the integer representation of enums.
22991 pub fn name(&self) -> std::option::Option<&str> {
22992 match self {
22993 Self::Unspecified => {
22994 std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
22995 }
22996 Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
22997 Self::AutomaticRotationDuringMaintenance => {
22998 std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
22999 }
23000 Self::UnknownValue(u) => u.0.name(),
23001 }
23002 }
23003 }
23004
23005 impl std::default::Default for ServerCertificateRotationMode {
23006 fn default() -> Self {
23007 use std::convert::From;
23008 Self::from(0)
23009 }
23010 }
23011
23012 impl std::fmt::Display for ServerCertificateRotationMode {
23013 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23014 wkt::internal::display_enum(f, self.name(), self.value())
23015 }
23016 }
23017
23018 impl std::convert::From<i32> for ServerCertificateRotationMode {
23019 fn from(value: i32) -> Self {
23020 match value {
23021 0 => Self::Unspecified,
23022 1 => Self::NoAutomaticRotation,
23023 2 => Self::AutomaticRotationDuringMaintenance,
23024 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
23025 wkt::internal::UnknownEnumValue::Integer(value),
23026 )),
23027 }
23028 }
23029 }
23030
23031 impl std::convert::From<&str> for ServerCertificateRotationMode {
23032 fn from(value: &str) -> Self {
23033 use std::string::ToString;
23034 match value {
23035 "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
23036 "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
23037 "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
23038 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
23039 wkt::internal::UnknownEnumValue::String(value.to_string()),
23040 )),
23041 }
23042 }
23043 }
23044
23045 impl serde::ser::Serialize for ServerCertificateRotationMode {
23046 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23047 where
23048 S: serde::Serializer,
23049 {
23050 match self {
23051 Self::Unspecified => serializer.serialize_i32(0),
23052 Self::NoAutomaticRotation => serializer.serialize_i32(1),
23053 Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
23054 Self::UnknownValue(u) => u.0.serialize(serializer),
23055 }
23056 }
23057 }
23058
23059 impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
23060 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23061 where
23062 D: serde::Deserializer<'de>,
23063 {
23064 deserializer.deserialize_any(
23065 wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
23066 ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
23067 ),
23068 )
23069 }
23070 }
23071}
23072
23073/// PSC settings for a Cloud SQL instance.
23074#[derive(Clone, Default, PartialEq)]
23075#[non_exhaustive]
23076pub struct PscConfig {
23077 /// Whether PSC connectivity is enabled for this instance.
23078 pub psc_enabled: std::option::Option<bool>,
23079
23080 /// Optional. The list of consumer projects that are allow-listed for PSC
23081 /// connections to this instance. This instance can be connected to with PSC
23082 /// from any network in these projects.
23083 ///
23084 /// Each consumer project in this list may be represented by a project number
23085 /// (numeric) or by a project id (alphanumeric).
23086 pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
23087
23088 /// Optional. The list of settings for requested Private Service Connect
23089 /// consumer endpoints that can be used to connect to this Cloud SQL instance.
23090 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
23091
23092 /// Optional. The network attachment of the consumer network that the
23093 /// Private Service Connect enabled Cloud SQL instance is
23094 /// authorized to connect via PSC interface.
23095 /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
23096 pub network_attachment_uri: std::string::String,
23097
23098 /// Optional. Indicates whether Private Service Connect DNS automation is
23099 /// enabled for this instance. When enabled, Cloud SQL provisions a universal
23100 /// DNS record across all networks configured with Private Service Connect
23101 /// auto-connections. This will default to true for new instances when
23102 /// Private Service Connect is enabled.
23103 pub psc_auto_dns_enabled: std::option::Option<bool>,
23104
23105 /// Optional. Indicates whether Private Service Connect write endpoint DNS
23106 /// automation is enabled for this instance. When enabled, Cloud SQL provisions
23107 /// a universal global DNS record across all networks configured with Private
23108 /// Service Connect auto-connections that points to the cluster primary
23109 /// instance. This feature is only supported for Enterprise Plus edition. This
23110 /// will default to true for new Enterprise Plus instances when
23111 /// `psc_auto_dns_enabled` is enabled.
23112 pub psc_write_endpoint_dns_enabled: std::option::Option<bool>,
23113
23114 /// Optional. Whether to set up the PSC service connection policy
23115 /// automatically.
23116 pub psc_auto_connection_policy_enabled: std::option::Option<bool>,
23117
23118 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23119}
23120
23121impl PscConfig {
23122 /// Creates a new default instance.
23123 pub fn new() -> Self {
23124 std::default::Default::default()
23125 }
23126
23127 /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
23128 ///
23129 /// # Example
23130 /// ```ignore,no_run
23131 /// # use google_cloud_sql_v1::model::PscConfig;
23132 /// let x = PscConfig::new().set_psc_enabled(true);
23133 /// ```
23134 pub fn set_psc_enabled<T>(mut self, v: T) -> Self
23135 where
23136 T: std::convert::Into<bool>,
23137 {
23138 self.psc_enabled = std::option::Option::Some(v.into());
23139 self
23140 }
23141
23142 /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
23143 ///
23144 /// # Example
23145 /// ```ignore,no_run
23146 /// # use google_cloud_sql_v1::model::PscConfig;
23147 /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
23148 /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
23149 /// ```
23150 pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
23151 where
23152 T: std::convert::Into<bool>,
23153 {
23154 self.psc_enabled = v.map(|x| x.into());
23155 self
23156 }
23157
23158 /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
23159 ///
23160 /// # Example
23161 /// ```ignore,no_run
23162 /// # use google_cloud_sql_v1::model::PscConfig;
23163 /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
23164 /// ```
23165 pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
23166 where
23167 T: std::iter::IntoIterator<Item = V>,
23168 V: std::convert::Into<std::string::String>,
23169 {
23170 use std::iter::Iterator;
23171 self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
23172 self
23173 }
23174
23175 /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
23176 ///
23177 /// # Example
23178 /// ```ignore,no_run
23179 /// # use google_cloud_sql_v1::model::PscConfig;
23180 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23181 /// let x = PscConfig::new()
23182 /// .set_psc_auto_connections([
23183 /// PscAutoConnectionConfig::default()/* use setters */,
23184 /// PscAutoConnectionConfig::default()/* use (different) setters */,
23185 /// ]);
23186 /// ```
23187 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
23188 where
23189 T: std::iter::IntoIterator<Item = V>,
23190 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
23191 {
23192 use std::iter::Iterator;
23193 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
23194 self
23195 }
23196
23197 /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
23198 ///
23199 /// # Example
23200 /// ```ignore,no_run
23201 /// # use google_cloud_sql_v1::model::PscConfig;
23202 /// let x = PscConfig::new().set_network_attachment_uri("example");
23203 /// ```
23204 pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
23205 mut self,
23206 v: T,
23207 ) -> Self {
23208 self.network_attachment_uri = v.into();
23209 self
23210 }
23211
23212 /// Sets the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
23213 ///
23214 /// # Example
23215 /// ```ignore,no_run
23216 /// # use google_cloud_sql_v1::model::PscConfig;
23217 /// let x = PscConfig::new().set_psc_auto_dns_enabled(true);
23218 /// ```
23219 pub fn set_psc_auto_dns_enabled<T>(mut self, v: T) -> Self
23220 where
23221 T: std::convert::Into<bool>,
23222 {
23223 self.psc_auto_dns_enabled = std::option::Option::Some(v.into());
23224 self
23225 }
23226
23227 /// Sets or clears the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
23228 ///
23229 /// # Example
23230 /// ```ignore,no_run
23231 /// # use google_cloud_sql_v1::model::PscConfig;
23232 /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(Some(false));
23233 /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(None::<bool>);
23234 /// ```
23235 pub fn set_or_clear_psc_auto_dns_enabled<T>(mut self, v: std::option::Option<T>) -> Self
23236 where
23237 T: std::convert::Into<bool>,
23238 {
23239 self.psc_auto_dns_enabled = v.map(|x| x.into());
23240 self
23241 }
23242
23243 /// Sets the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
23244 ///
23245 /// # Example
23246 /// ```ignore,no_run
23247 /// # use google_cloud_sql_v1::model::PscConfig;
23248 /// let x = PscConfig::new().set_psc_write_endpoint_dns_enabled(true);
23249 /// ```
23250 pub fn set_psc_write_endpoint_dns_enabled<T>(mut self, v: T) -> Self
23251 where
23252 T: std::convert::Into<bool>,
23253 {
23254 self.psc_write_endpoint_dns_enabled = std::option::Option::Some(v.into());
23255 self
23256 }
23257
23258 /// Sets or clears the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
23259 ///
23260 /// # Example
23261 /// ```ignore,no_run
23262 /// # use google_cloud_sql_v1::model::PscConfig;
23263 /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(Some(false));
23264 /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(None::<bool>);
23265 /// ```
23266 pub fn set_or_clear_psc_write_endpoint_dns_enabled<T>(
23267 mut self,
23268 v: std::option::Option<T>,
23269 ) -> Self
23270 where
23271 T: std::convert::Into<bool>,
23272 {
23273 self.psc_write_endpoint_dns_enabled = v.map(|x| x.into());
23274 self
23275 }
23276
23277 /// Sets the value of [psc_auto_connection_policy_enabled][crate::model::PscConfig::psc_auto_connection_policy_enabled].
23278 ///
23279 /// # Example
23280 /// ```ignore,no_run
23281 /// # use google_cloud_sql_v1::model::PscConfig;
23282 /// let x = PscConfig::new().set_psc_auto_connection_policy_enabled(true);
23283 /// ```
23284 pub fn set_psc_auto_connection_policy_enabled<T>(mut self, v: T) -> Self
23285 where
23286 T: std::convert::Into<bool>,
23287 {
23288 self.psc_auto_connection_policy_enabled = std::option::Option::Some(v.into());
23289 self
23290 }
23291
23292 /// Sets or clears the value of [psc_auto_connection_policy_enabled][crate::model::PscConfig::psc_auto_connection_policy_enabled].
23293 ///
23294 /// # Example
23295 /// ```ignore,no_run
23296 /// # use google_cloud_sql_v1::model::PscConfig;
23297 /// let x = PscConfig::new().set_or_clear_psc_auto_connection_policy_enabled(Some(false));
23298 /// let x = PscConfig::new().set_or_clear_psc_auto_connection_policy_enabled(None::<bool>);
23299 /// ```
23300 pub fn set_or_clear_psc_auto_connection_policy_enabled<T>(
23301 mut self,
23302 v: std::option::Option<T>,
23303 ) -> Self
23304 where
23305 T: std::convert::Into<bool>,
23306 {
23307 self.psc_auto_connection_policy_enabled = v.map(|x| x.into());
23308 self
23309 }
23310}
23311
23312impl wkt::message::Message for PscConfig {
23313 fn typename() -> &'static str {
23314 "type.googleapis.com/google.cloud.sql.v1.PscConfig"
23315 }
23316}
23317
23318/// Settings for an automatically-setup Private Service Connect consumer endpoint
23319/// that is used to connect to a Cloud SQL instance.
23320#[derive(Clone, Default, PartialEq)]
23321#[non_exhaustive]
23322pub struct PscAutoConnectionConfig {
23323 /// Optional. This is the project ID of consumer service project of this
23324 /// consumer endpoint.
23325 ///
23326 /// This is only applicable if `consumer_network` is a shared VPC
23327 /// network.
23328 pub consumer_project: std::string::String,
23329
23330 /// Optional. The consumer network of this consumer endpoint. This must be a
23331 /// resource path that includes both the host project and the network name.
23332 ///
23333 /// For example, `projects/project1/global/networks/network1`.
23334 ///
23335 /// The consumer host project of this network might be different from the
23336 /// consumer service project.
23337 pub consumer_network: std::string::String,
23338
23339 /// The IP address of the consumer endpoint.
23340 pub ip_address: std::option::Option<std::string::String>,
23341
23342 /// The connection status of the consumer endpoint.
23343 pub status: std::option::Option<std::string::String>,
23344
23345 /// The connection policy status of the consumer network.
23346 pub consumer_network_status: std::option::Option<std::string::String>,
23347
23348 /// Output only. The service connection policy created automatically for the
23349 /// consumer network when `psc_auto_connection_policy_enabled` is true. It is
23350 /// in the format of:
23351 /// `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
23352 /// The `policy_id` is in format of `$NETWORK-$RANDOM`.
23353 pub service_connection_policy: std::option::Option<std::string::String>,
23354
23355 /// Output only. The status of service connection policy creation.
23356 pub service_connection_policy_creation_result: std::option::Option<std::string::String>,
23357
23358 /// Output only. The status of automated DNS provisioning.
23359 pub instance_auto_dns_status: std::option::Option<crate::model::AutoDnsStatus>,
23360
23361 /// Output only. The status of automated DNS provisioning for the write
23362 /// endpoint.
23363 pub write_endpoint_auto_dns_status: std::option::Option<crate::model::AutoDnsStatus>,
23364
23365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23366}
23367
23368impl PscAutoConnectionConfig {
23369 /// Creates a new default instance.
23370 pub fn new() -> Self {
23371 std::default::Default::default()
23372 }
23373
23374 /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
23375 ///
23376 /// # Example
23377 /// ```ignore,no_run
23378 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23379 /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
23380 /// ```
23381 pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
23382 mut self,
23383 v: T,
23384 ) -> Self {
23385 self.consumer_project = v.into();
23386 self
23387 }
23388
23389 /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
23390 ///
23391 /// # Example
23392 /// ```ignore,no_run
23393 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23394 /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
23395 /// ```
23396 pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
23397 mut self,
23398 v: T,
23399 ) -> Self {
23400 self.consumer_network = v.into();
23401 self
23402 }
23403
23404 /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23405 ///
23406 /// # Example
23407 /// ```ignore,no_run
23408 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23409 /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
23410 /// ```
23411 pub fn set_ip_address<T>(mut self, v: T) -> Self
23412 where
23413 T: std::convert::Into<std::string::String>,
23414 {
23415 self.ip_address = std::option::Option::Some(v.into());
23416 self
23417 }
23418
23419 /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
23420 ///
23421 /// # Example
23422 /// ```ignore,no_run
23423 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23424 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
23425 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
23426 /// ```
23427 pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
23428 where
23429 T: std::convert::Into<std::string::String>,
23430 {
23431 self.ip_address = v.map(|x| x.into());
23432 self
23433 }
23434
23435 /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
23436 ///
23437 /// # Example
23438 /// ```ignore,no_run
23439 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23440 /// let x = PscAutoConnectionConfig::new().set_status("example");
23441 /// ```
23442 pub fn set_status<T>(mut self, v: T) -> Self
23443 where
23444 T: std::convert::Into<std::string::String>,
23445 {
23446 self.status = std::option::Option::Some(v.into());
23447 self
23448 }
23449
23450 /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
23451 ///
23452 /// # Example
23453 /// ```ignore,no_run
23454 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23455 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
23456 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
23457 /// ```
23458 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
23459 where
23460 T: std::convert::Into<std::string::String>,
23461 {
23462 self.status = v.map(|x| x.into());
23463 self
23464 }
23465
23466 /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23467 ///
23468 /// # Example
23469 /// ```ignore,no_run
23470 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23471 /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
23472 /// ```
23473 pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
23474 where
23475 T: std::convert::Into<std::string::String>,
23476 {
23477 self.consumer_network_status = std::option::Option::Some(v.into());
23478 self
23479 }
23480
23481 /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
23482 ///
23483 /// # Example
23484 /// ```ignore,no_run
23485 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23486 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
23487 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
23488 /// ```
23489 pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
23490 where
23491 T: std::convert::Into<std::string::String>,
23492 {
23493 self.consumer_network_status = v.map(|x| x.into());
23494 self
23495 }
23496
23497 /// Sets the value of [service_connection_policy][crate::model::PscAutoConnectionConfig::service_connection_policy].
23498 ///
23499 /// # Example
23500 /// ```ignore,no_run
23501 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23502 /// let x = PscAutoConnectionConfig::new().set_service_connection_policy("example");
23503 /// ```
23504 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
23505 where
23506 T: std::convert::Into<std::string::String>,
23507 {
23508 self.service_connection_policy = std::option::Option::Some(v.into());
23509 self
23510 }
23511
23512 /// Sets or clears the value of [service_connection_policy][crate::model::PscAutoConnectionConfig::service_connection_policy].
23513 ///
23514 /// # Example
23515 /// ```ignore,no_run
23516 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23517 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy(Some("example"));
23518 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy(None::<String>);
23519 /// ```
23520 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
23521 where
23522 T: std::convert::Into<std::string::String>,
23523 {
23524 self.service_connection_policy = v.map(|x| x.into());
23525 self
23526 }
23527
23528 /// Sets the value of [service_connection_policy_creation_result][crate::model::PscAutoConnectionConfig::service_connection_policy_creation_result].
23529 ///
23530 /// # Example
23531 /// ```ignore,no_run
23532 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23533 /// let x = PscAutoConnectionConfig::new().set_service_connection_policy_creation_result("example");
23534 /// ```
23535 pub fn set_service_connection_policy_creation_result<T>(mut self, v: T) -> Self
23536 where
23537 T: std::convert::Into<std::string::String>,
23538 {
23539 self.service_connection_policy_creation_result = std::option::Option::Some(v.into());
23540 self
23541 }
23542
23543 /// Sets or clears the value of [service_connection_policy_creation_result][crate::model::PscAutoConnectionConfig::service_connection_policy_creation_result].
23544 ///
23545 /// # Example
23546 /// ```ignore,no_run
23547 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23548 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy_creation_result(Some("example"));
23549 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy_creation_result(None::<String>);
23550 /// ```
23551 pub fn set_or_clear_service_connection_policy_creation_result<T>(
23552 mut self,
23553 v: std::option::Option<T>,
23554 ) -> Self
23555 where
23556 T: std::convert::Into<std::string::String>,
23557 {
23558 self.service_connection_policy_creation_result = v.map(|x| x.into());
23559 self
23560 }
23561
23562 /// Sets the value of [instance_auto_dns_status][crate::model::PscAutoConnectionConfig::instance_auto_dns_status].
23563 ///
23564 /// # Example
23565 /// ```ignore,no_run
23566 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23567 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23568 /// let x0 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsOk);
23569 /// let x1 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsFailed);
23570 /// let x2 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsUnknown);
23571 /// ```
23572 pub fn set_instance_auto_dns_status<T>(mut self, v: T) -> Self
23573 where
23574 T: std::convert::Into<crate::model::AutoDnsStatus>,
23575 {
23576 self.instance_auto_dns_status = std::option::Option::Some(v.into());
23577 self
23578 }
23579
23580 /// Sets or clears the value of [instance_auto_dns_status][crate::model::PscAutoConnectionConfig::instance_auto_dns_status].
23581 ///
23582 /// # Example
23583 /// ```ignore,no_run
23584 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23585 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23586 /// let x0 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsOk));
23587 /// let x1 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsFailed));
23588 /// let x2 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsUnknown));
23589 /// let x_none = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(None::<AutoDnsStatus>);
23590 /// ```
23591 pub fn set_or_clear_instance_auto_dns_status<T>(mut self, v: std::option::Option<T>) -> Self
23592 where
23593 T: std::convert::Into<crate::model::AutoDnsStatus>,
23594 {
23595 self.instance_auto_dns_status = v.map(|x| x.into());
23596 self
23597 }
23598
23599 /// Sets the value of [write_endpoint_auto_dns_status][crate::model::PscAutoConnectionConfig::write_endpoint_auto_dns_status].
23600 ///
23601 /// # Example
23602 /// ```ignore,no_run
23603 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23604 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23605 /// let x0 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsOk);
23606 /// let x1 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsFailed);
23607 /// let x2 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsUnknown);
23608 /// ```
23609 pub fn set_write_endpoint_auto_dns_status<T>(mut self, v: T) -> Self
23610 where
23611 T: std::convert::Into<crate::model::AutoDnsStatus>,
23612 {
23613 self.write_endpoint_auto_dns_status = std::option::Option::Some(v.into());
23614 self
23615 }
23616
23617 /// Sets or clears the value of [write_endpoint_auto_dns_status][crate::model::PscAutoConnectionConfig::write_endpoint_auto_dns_status].
23618 ///
23619 /// # Example
23620 /// ```ignore,no_run
23621 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
23622 /// use google_cloud_sql_v1::model::AutoDnsStatus;
23623 /// let x0 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsOk));
23624 /// let x1 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsFailed));
23625 /// let x2 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsUnknown));
23626 /// let x_none = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(None::<AutoDnsStatus>);
23627 /// ```
23628 pub fn set_or_clear_write_endpoint_auto_dns_status<T>(
23629 mut self,
23630 v: std::option::Option<T>,
23631 ) -> Self
23632 where
23633 T: std::convert::Into<crate::model::AutoDnsStatus>,
23634 {
23635 self.write_endpoint_auto_dns_status = v.map(|x| x.into());
23636 self
23637 }
23638}
23639
23640impl wkt::message::Message for PscAutoConnectionConfig {
23641 fn typename() -> &'static str {
23642 "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
23643 }
23644}
23645
23646/// Preferred location. This specifies where a Cloud SQL instance is located.
23647/// Note that if the preferred location is not available, the instance will be
23648/// located as close as possible within the region. Only one location may be
23649/// specified.
23650#[derive(Clone, Default, PartialEq)]
23651#[non_exhaustive]
23652pub struct LocationPreference {
23653 /// The App Engine application to follow, it must be in the same region as the
23654 /// Cloud SQL instance. WARNING: Changing this might restart the instance.
23655 #[deprecated]
23656 pub follow_gae_application: std::string::String,
23657
23658 /// The preferred Compute Engine zone (for example: us-central1-a,
23659 /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
23660 pub zone: std::string::String,
23661
23662 /// The preferred Compute Engine zone for the secondary/failover
23663 /// (for example: us-central1-a, us-central1-b, etc.).
23664 /// To disable this field, set it to 'no_secondary_zone'.
23665 pub secondary_zone: std::string::String,
23666
23667 /// This is always `sql#locationPreference`.
23668 pub kind: std::string::String,
23669
23670 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23671}
23672
23673impl LocationPreference {
23674 /// Creates a new default instance.
23675 pub fn new() -> Self {
23676 std::default::Default::default()
23677 }
23678
23679 /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
23680 ///
23681 /// # Example
23682 /// ```ignore,no_run
23683 /// # use google_cloud_sql_v1::model::LocationPreference;
23684 /// let x = LocationPreference::new().set_follow_gae_application("example");
23685 /// ```
23686 #[deprecated]
23687 pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
23688 mut self,
23689 v: T,
23690 ) -> Self {
23691 self.follow_gae_application = v.into();
23692 self
23693 }
23694
23695 /// Sets the value of [zone][crate::model::LocationPreference::zone].
23696 ///
23697 /// # Example
23698 /// ```ignore,no_run
23699 /// # use google_cloud_sql_v1::model::LocationPreference;
23700 /// let x = LocationPreference::new().set_zone("example");
23701 /// ```
23702 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23703 self.zone = v.into();
23704 self
23705 }
23706
23707 /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
23708 ///
23709 /// # Example
23710 /// ```ignore,no_run
23711 /// # use google_cloud_sql_v1::model::LocationPreference;
23712 /// let x = LocationPreference::new().set_secondary_zone("example");
23713 /// ```
23714 pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23715 self.secondary_zone = v.into();
23716 self
23717 }
23718
23719 /// Sets the value of [kind][crate::model::LocationPreference::kind].
23720 ///
23721 /// # Example
23722 /// ```ignore,no_run
23723 /// # use google_cloud_sql_v1::model::LocationPreference;
23724 /// let x = LocationPreference::new().set_kind("example");
23725 /// ```
23726 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23727 self.kind = v.into();
23728 self
23729 }
23730}
23731
23732impl wkt::message::Message for LocationPreference {
23733 fn typename() -> &'static str {
23734 "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
23735 }
23736}
23737
23738/// Maintenance window. This specifies when a Cloud SQL instance is
23739/// restarted for system maintenance purposes.
23740#[derive(Clone, Default, PartialEq)]
23741#[non_exhaustive]
23742pub struct MaintenanceWindow {
23743 /// Hour of day - 0 to 23. Specify in the UTC time zone.
23744 pub hour: std::option::Option<wkt::Int32Value>,
23745
23746 /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
23747 /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
23748 /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
23749 pub day: std::option::Option<wkt::Int32Value>,
23750
23751 /// Maintenance timing settings: `canary`, `stable`, or `week5`.
23752 /// For more information, see [About maintenance on Cloud SQL
23753 /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
23754 pub update_track: crate::model::SqlUpdateTrack,
23755
23756 /// This is always `sql#maintenanceWindow`.
23757 pub kind: std::string::String,
23758
23759 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23760}
23761
23762impl MaintenanceWindow {
23763 /// Creates a new default instance.
23764 pub fn new() -> Self {
23765 std::default::Default::default()
23766 }
23767
23768 /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
23769 ///
23770 /// # Example
23771 /// ```ignore,no_run
23772 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23773 /// use wkt::Int32Value;
23774 /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
23775 /// ```
23776 pub fn set_hour<T>(mut self, v: T) -> Self
23777 where
23778 T: std::convert::Into<wkt::Int32Value>,
23779 {
23780 self.hour = std::option::Option::Some(v.into());
23781 self
23782 }
23783
23784 /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
23785 ///
23786 /// # Example
23787 /// ```ignore,no_run
23788 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23789 /// use wkt::Int32Value;
23790 /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
23791 /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
23792 /// ```
23793 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
23794 where
23795 T: std::convert::Into<wkt::Int32Value>,
23796 {
23797 self.hour = v.map(|x| x.into());
23798 self
23799 }
23800
23801 /// Sets the value of [day][crate::model::MaintenanceWindow::day].
23802 ///
23803 /// # Example
23804 /// ```ignore,no_run
23805 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23806 /// use wkt::Int32Value;
23807 /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
23808 /// ```
23809 pub fn set_day<T>(mut self, v: T) -> Self
23810 where
23811 T: std::convert::Into<wkt::Int32Value>,
23812 {
23813 self.day = std::option::Option::Some(v.into());
23814 self
23815 }
23816
23817 /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
23818 ///
23819 /// # Example
23820 /// ```ignore,no_run
23821 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23822 /// use wkt::Int32Value;
23823 /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
23824 /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
23825 /// ```
23826 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
23827 where
23828 T: std::convert::Into<wkt::Int32Value>,
23829 {
23830 self.day = v.map(|x| x.into());
23831 self
23832 }
23833
23834 /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
23835 ///
23836 /// # Example
23837 /// ```ignore,no_run
23838 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23839 /// use google_cloud_sql_v1::model::SqlUpdateTrack;
23840 /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
23841 /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
23842 /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
23843 /// ```
23844 pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
23845 mut self,
23846 v: T,
23847 ) -> Self {
23848 self.update_track = v.into();
23849 self
23850 }
23851
23852 /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
23853 ///
23854 /// # Example
23855 /// ```ignore,no_run
23856 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23857 /// let x = MaintenanceWindow::new().set_kind("example");
23858 /// ```
23859 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23860 self.kind = v.into();
23861 self
23862 }
23863}
23864
23865impl wkt::message::Message for MaintenanceWindow {
23866 fn typename() -> &'static str {
23867 "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
23868 }
23869}
23870
23871/// Deny maintenance Periods. This specifies a date range during when all CSA
23872/// rollout will be denied.
23873#[derive(Clone, Default, PartialEq)]
23874#[non_exhaustive]
23875pub struct DenyMaintenancePeriod {
23876 /// "deny maintenance period" start date. If the year of the start date is
23877 /// empty, the year of the end date also must be empty. In this case, it means
23878 /// the deny maintenance period recurs every year. The date is in format
23879 /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
23880 pub start_date: std::string::String,
23881
23882 /// "deny maintenance period" end date. If the year of the end date is empty,
23883 /// the year of the start date also must be empty. In this case, it means the
23884 /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
23885 /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
23886 pub end_date: std::string::String,
23887
23888 /// Time in UTC when the "deny maintenance period" starts on start_date and
23889 /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
23890 pub time: std::string::String,
23891
23892 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23893}
23894
23895impl DenyMaintenancePeriod {
23896 /// Creates a new default instance.
23897 pub fn new() -> Self {
23898 std::default::Default::default()
23899 }
23900
23901 /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
23902 ///
23903 /// # Example
23904 /// ```ignore,no_run
23905 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23906 /// let x = DenyMaintenancePeriod::new().set_start_date("example");
23907 /// ```
23908 pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23909 self.start_date = v.into();
23910 self
23911 }
23912
23913 /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
23914 ///
23915 /// # Example
23916 /// ```ignore,no_run
23917 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23918 /// let x = DenyMaintenancePeriod::new().set_end_date("example");
23919 /// ```
23920 pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23921 self.end_date = v.into();
23922 self
23923 }
23924
23925 /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
23926 ///
23927 /// # Example
23928 /// ```ignore,no_run
23929 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23930 /// let x = DenyMaintenancePeriod::new().set_time("example");
23931 /// ```
23932 pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23933 self.time = v.into();
23934 self
23935 }
23936}
23937
23938impl wkt::message::Message for DenyMaintenancePeriod {
23939 fn typename() -> &'static str {
23940 "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
23941 }
23942}
23943
23944/// Insights configuration. This specifies when Cloud SQL Insights feature is
23945/// enabled and optional configuration.
23946#[derive(Clone, Default, PartialEq)]
23947#[non_exhaustive]
23948pub struct InsightsConfig {
23949 /// Whether Query Insights feature is enabled.
23950 pub query_insights_enabled: bool,
23951
23952 /// Whether Query Insights will record client address when enabled.
23953 pub record_client_address: bool,
23954
23955 /// Whether Query Insights will record application tags from query when
23956 /// enabled.
23957 pub record_application_tags: bool,
23958
23959 /// Maximum query length stored in bytes. Default value: 1024 bytes.
23960 /// Range: 256-4500 bytes. Query lengths greater than this field value will be
23961 /// truncated to this value. When unset, query length will be the default
23962 /// value. Changing query length will restart the database.
23963 pub query_string_length: std::option::Option<wkt::Int32Value>,
23964
23965 /// Number of query execution plans captured by Insights per minute
23966 /// for all queries combined. Default is 5.
23967 pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
23968
23969 /// Optional. Whether enhanced query insights feature is enabled.
23970 pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
23971
23972 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23973}
23974
23975impl InsightsConfig {
23976 /// Creates a new default instance.
23977 pub fn new() -> Self {
23978 std::default::Default::default()
23979 }
23980
23981 /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
23982 ///
23983 /// # Example
23984 /// ```ignore,no_run
23985 /// # use google_cloud_sql_v1::model::InsightsConfig;
23986 /// let x = InsightsConfig::new().set_query_insights_enabled(true);
23987 /// ```
23988 pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23989 self.query_insights_enabled = v.into();
23990 self
23991 }
23992
23993 /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
23994 ///
23995 /// # Example
23996 /// ```ignore,no_run
23997 /// # use google_cloud_sql_v1::model::InsightsConfig;
23998 /// let x = InsightsConfig::new().set_record_client_address(true);
23999 /// ```
24000 pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24001 self.record_client_address = v.into();
24002 self
24003 }
24004
24005 /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
24006 ///
24007 /// # Example
24008 /// ```ignore,no_run
24009 /// # use google_cloud_sql_v1::model::InsightsConfig;
24010 /// let x = InsightsConfig::new().set_record_application_tags(true);
24011 /// ```
24012 pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
24013 self.record_application_tags = v.into();
24014 self
24015 }
24016
24017 /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
24018 ///
24019 /// # Example
24020 /// ```ignore,no_run
24021 /// # use google_cloud_sql_v1::model::InsightsConfig;
24022 /// use wkt::Int32Value;
24023 /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
24024 /// ```
24025 pub fn set_query_string_length<T>(mut self, v: T) -> Self
24026 where
24027 T: std::convert::Into<wkt::Int32Value>,
24028 {
24029 self.query_string_length = std::option::Option::Some(v.into());
24030 self
24031 }
24032
24033 /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
24034 ///
24035 /// # Example
24036 /// ```ignore,no_run
24037 /// # use google_cloud_sql_v1::model::InsightsConfig;
24038 /// use wkt::Int32Value;
24039 /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
24040 /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
24041 /// ```
24042 pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
24043 where
24044 T: std::convert::Into<wkt::Int32Value>,
24045 {
24046 self.query_string_length = v.map(|x| x.into());
24047 self
24048 }
24049
24050 /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
24051 ///
24052 /// # Example
24053 /// ```ignore,no_run
24054 /// # use google_cloud_sql_v1::model::InsightsConfig;
24055 /// use wkt::Int32Value;
24056 /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
24057 /// ```
24058 pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
24059 where
24060 T: std::convert::Into<wkt::Int32Value>,
24061 {
24062 self.query_plans_per_minute = std::option::Option::Some(v.into());
24063 self
24064 }
24065
24066 /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
24067 ///
24068 /// # Example
24069 /// ```ignore,no_run
24070 /// # use google_cloud_sql_v1::model::InsightsConfig;
24071 /// use wkt::Int32Value;
24072 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
24073 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
24074 /// ```
24075 pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
24076 where
24077 T: std::convert::Into<wkt::Int32Value>,
24078 {
24079 self.query_plans_per_minute = v.map(|x| x.into());
24080 self
24081 }
24082
24083 /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
24084 ///
24085 /// # Example
24086 /// ```ignore,no_run
24087 /// # use google_cloud_sql_v1::model::InsightsConfig;
24088 /// use wkt::BoolValue;
24089 /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
24090 /// ```
24091 pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
24092 where
24093 T: std::convert::Into<wkt::BoolValue>,
24094 {
24095 self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
24096 self
24097 }
24098
24099 /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
24100 ///
24101 /// # Example
24102 /// ```ignore,no_run
24103 /// # use google_cloud_sql_v1::model::InsightsConfig;
24104 /// use wkt::BoolValue;
24105 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
24106 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
24107 /// ```
24108 pub fn set_or_clear_enhanced_query_insights_enabled<T>(
24109 mut self,
24110 v: std::option::Option<T>,
24111 ) -> Self
24112 where
24113 T: std::convert::Into<wkt::BoolValue>,
24114 {
24115 self.enhanced_query_insights_enabled = v.map(|x| x.into());
24116 self
24117 }
24118}
24119
24120impl wkt::message::Message for InsightsConfig {
24121 fn typename() -> &'static str {
24122 "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
24123 }
24124}
24125
24126/// Read-replica configuration specific to MySQL databases.
24127#[derive(Clone, Default, PartialEq)]
24128#[non_exhaustive]
24129pub struct MySqlReplicaConfiguration {
24130 /// Path to a SQL dump file in Google Cloud Storage from which the replica
24131 /// instance is to be created. The URI is in the form gs://bucketName/fileName.
24132 /// Compressed gzip files (.gz) are also supported.
24133 /// Dumps have the binlog co-ordinates from which replication
24134 /// begins. This can be accomplished by setting --master-data to 1 when using
24135 /// mysqldump.
24136 pub dump_file_path: std::string::String,
24137
24138 /// The username for the replication connection.
24139 pub username: std::string::String,
24140
24141 /// The password for the replication connection.
24142 pub password: std::string::String,
24143
24144 /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
24145 pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
24146
24147 /// Interval in milliseconds between replication heartbeats.
24148 pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
24149
24150 /// PEM representation of the trusted CA's x509 certificate.
24151 pub ca_certificate: std::string::String,
24152
24153 /// PEM representation of the replica's x509 certificate.
24154 pub client_certificate: std::string::String,
24155
24156 /// PEM representation of the replica's private key. The corresponding public
24157 /// key is encoded in the client's certificate.
24158 pub client_key: std::string::String,
24159
24160 /// A list of permissible ciphers to use for SSL encryption.
24161 pub ssl_cipher: std::string::String,
24162
24163 /// Whether or not to check the primary instance's Common Name value in the
24164 /// certificate that it sends during the SSL handshake.
24165 pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
24166
24167 /// This is always `sql#mysqlReplicaConfiguration`.
24168 pub kind: std::string::String,
24169
24170 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24171}
24172
24173impl MySqlReplicaConfiguration {
24174 /// Creates a new default instance.
24175 pub fn new() -> Self {
24176 std::default::Default::default()
24177 }
24178
24179 /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
24180 ///
24181 /// # Example
24182 /// ```ignore,no_run
24183 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24184 /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
24185 /// ```
24186 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24187 self.dump_file_path = v.into();
24188 self
24189 }
24190
24191 /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
24192 ///
24193 /// # Example
24194 /// ```ignore,no_run
24195 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24196 /// let x = MySqlReplicaConfiguration::new().set_username("example");
24197 /// ```
24198 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24199 self.username = v.into();
24200 self
24201 }
24202
24203 /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
24204 ///
24205 /// # Example
24206 /// ```ignore,no_run
24207 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24208 /// let x = MySqlReplicaConfiguration::new().set_password("example");
24209 /// ```
24210 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24211 self.password = v.into();
24212 self
24213 }
24214
24215 /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
24216 ///
24217 /// # Example
24218 /// ```ignore,no_run
24219 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24220 /// use wkt::Int32Value;
24221 /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
24222 /// ```
24223 pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
24224 where
24225 T: std::convert::Into<wkt::Int32Value>,
24226 {
24227 self.connect_retry_interval = std::option::Option::Some(v.into());
24228 self
24229 }
24230
24231 /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
24232 ///
24233 /// # Example
24234 /// ```ignore,no_run
24235 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24236 /// use wkt::Int32Value;
24237 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
24238 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
24239 /// ```
24240 pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
24241 where
24242 T: std::convert::Into<wkt::Int32Value>,
24243 {
24244 self.connect_retry_interval = v.map(|x| x.into());
24245 self
24246 }
24247
24248 /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
24249 ///
24250 /// # Example
24251 /// ```ignore,no_run
24252 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24253 /// use wkt::Int64Value;
24254 /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
24255 /// ```
24256 pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
24257 where
24258 T: std::convert::Into<wkt::Int64Value>,
24259 {
24260 self.master_heartbeat_period = std::option::Option::Some(v.into());
24261 self
24262 }
24263
24264 /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
24265 ///
24266 /// # Example
24267 /// ```ignore,no_run
24268 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24269 /// use wkt::Int64Value;
24270 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
24271 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
24272 /// ```
24273 pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
24274 where
24275 T: std::convert::Into<wkt::Int64Value>,
24276 {
24277 self.master_heartbeat_period = v.map(|x| x.into());
24278 self
24279 }
24280
24281 /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
24282 ///
24283 /// # Example
24284 /// ```ignore,no_run
24285 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24286 /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
24287 /// ```
24288 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24289 self.ca_certificate = v.into();
24290 self
24291 }
24292
24293 /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
24294 ///
24295 /// # Example
24296 /// ```ignore,no_run
24297 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24298 /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
24299 /// ```
24300 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
24301 mut self,
24302 v: T,
24303 ) -> Self {
24304 self.client_certificate = v.into();
24305 self
24306 }
24307
24308 /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
24309 ///
24310 /// # Example
24311 /// ```ignore,no_run
24312 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24313 /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
24314 /// ```
24315 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24316 self.client_key = v.into();
24317 self
24318 }
24319
24320 /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
24321 ///
24322 /// # Example
24323 /// ```ignore,no_run
24324 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24325 /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
24326 /// ```
24327 pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24328 self.ssl_cipher = v.into();
24329 self
24330 }
24331
24332 /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
24333 ///
24334 /// # Example
24335 /// ```ignore,no_run
24336 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24337 /// use wkt::BoolValue;
24338 /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
24339 /// ```
24340 pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
24341 where
24342 T: std::convert::Into<wkt::BoolValue>,
24343 {
24344 self.verify_server_certificate = std::option::Option::Some(v.into());
24345 self
24346 }
24347
24348 /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
24349 ///
24350 /// # Example
24351 /// ```ignore,no_run
24352 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24353 /// use wkt::BoolValue;
24354 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
24355 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
24356 /// ```
24357 pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
24358 where
24359 T: std::convert::Into<wkt::BoolValue>,
24360 {
24361 self.verify_server_certificate = v.map(|x| x.into());
24362 self
24363 }
24364
24365 /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
24366 ///
24367 /// # Example
24368 /// ```ignore,no_run
24369 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
24370 /// let x = MySqlReplicaConfiguration::new().set_kind("example");
24371 /// ```
24372 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24373 self.kind = v.into();
24374 self
24375 }
24376}
24377
24378impl wkt::message::Message for MySqlReplicaConfiguration {
24379 fn typename() -> &'static str {
24380 "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
24381 }
24382}
24383
24384/// Disk encryption configuration for an instance.
24385#[derive(Clone, Default, PartialEq)]
24386#[non_exhaustive]
24387pub struct DiskEncryptionConfiguration {
24388 /// Resource name of KMS key for disk encryption
24389 pub kms_key_name: std::string::String,
24390
24391 /// This is always `sql#diskEncryptionConfiguration`.
24392 pub kind: std::string::String,
24393
24394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24395}
24396
24397impl DiskEncryptionConfiguration {
24398 /// Creates a new default instance.
24399 pub fn new() -> Self {
24400 std::default::Default::default()
24401 }
24402
24403 /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
24404 ///
24405 /// # Example
24406 /// ```ignore,no_run
24407 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
24408 /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
24409 /// ```
24410 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24411 self.kms_key_name = v.into();
24412 self
24413 }
24414
24415 /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
24416 ///
24417 /// # Example
24418 /// ```ignore,no_run
24419 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
24420 /// let x = DiskEncryptionConfiguration::new().set_kind("example");
24421 /// ```
24422 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24423 self.kind = v.into();
24424 self
24425 }
24426}
24427
24428impl wkt::message::Message for DiskEncryptionConfiguration {
24429 fn typename() -> &'static str {
24430 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
24431 }
24432}
24433
24434/// Disk encryption status for an instance.
24435#[derive(Clone, Default, PartialEq)]
24436#[non_exhaustive]
24437pub struct DiskEncryptionStatus {
24438 /// KMS key version used to encrypt the Cloud SQL instance resource
24439 pub kms_key_version_name: std::string::String,
24440
24441 /// This is always `sql#diskEncryptionStatus`.
24442 pub kind: std::string::String,
24443
24444 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24445}
24446
24447impl DiskEncryptionStatus {
24448 /// Creates a new default instance.
24449 pub fn new() -> Self {
24450 std::default::Default::default()
24451 }
24452
24453 /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
24454 ///
24455 /// # Example
24456 /// ```ignore,no_run
24457 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
24458 /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
24459 /// ```
24460 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
24461 mut self,
24462 v: T,
24463 ) -> Self {
24464 self.kms_key_version_name = v.into();
24465 self
24466 }
24467
24468 /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
24469 ///
24470 /// # Example
24471 /// ```ignore,no_run
24472 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
24473 /// let x = DiskEncryptionStatus::new().set_kind("example");
24474 /// ```
24475 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24476 self.kind = v.into();
24477 self
24478 }
24479}
24480
24481impl wkt::message::Message for DiskEncryptionStatus {
24482 fn typename() -> &'static str {
24483 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
24484 }
24485}
24486
24487/// Database instance IP mapping
24488#[derive(Clone, Default, PartialEq)]
24489#[non_exhaustive]
24490pub struct IpMapping {
24491 /// The type of this IP address. A `PRIMARY` address is a public address that
24492 /// can accept incoming connections. A `PRIVATE` address is a private address
24493 /// that can accept incoming connections. An `OUTGOING` address is the source
24494 /// address of connections originating from the instance, if supported.
24495 pub r#type: crate::model::SqlIpAddressType,
24496
24497 /// The IP address assigned.
24498 pub ip_address: std::string::String,
24499
24500 /// The due time for this IP to be retired in
24501 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
24502 /// `2012-11-15T16:19:00.094Z`. This field is only available when
24503 /// the IP is scheduled to be retired.
24504 pub time_to_retire: std::option::Option<wkt::Timestamp>,
24505
24506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24507}
24508
24509impl IpMapping {
24510 /// Creates a new default instance.
24511 pub fn new() -> Self {
24512 std::default::Default::default()
24513 }
24514
24515 /// Sets the value of [r#type][crate::model::IpMapping::type].
24516 ///
24517 /// # Example
24518 /// ```ignore,no_run
24519 /// # use google_cloud_sql_v1::model::IpMapping;
24520 /// use google_cloud_sql_v1::model::SqlIpAddressType;
24521 /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
24522 /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
24523 /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
24524 /// ```
24525 pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
24526 self.r#type = v.into();
24527 self
24528 }
24529
24530 /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
24531 ///
24532 /// # Example
24533 /// ```ignore,no_run
24534 /// # use google_cloud_sql_v1::model::IpMapping;
24535 /// let x = IpMapping::new().set_ip_address("example");
24536 /// ```
24537 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24538 self.ip_address = v.into();
24539 self
24540 }
24541
24542 /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24543 ///
24544 /// # Example
24545 /// ```ignore,no_run
24546 /// # use google_cloud_sql_v1::model::IpMapping;
24547 /// use wkt::Timestamp;
24548 /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
24549 /// ```
24550 pub fn set_time_to_retire<T>(mut self, v: T) -> Self
24551 where
24552 T: std::convert::Into<wkt::Timestamp>,
24553 {
24554 self.time_to_retire = std::option::Option::Some(v.into());
24555 self
24556 }
24557
24558 /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
24559 ///
24560 /// # Example
24561 /// ```ignore,no_run
24562 /// # use google_cloud_sql_v1::model::IpMapping;
24563 /// use wkt::Timestamp;
24564 /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
24565 /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
24566 /// ```
24567 pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
24568 where
24569 T: std::convert::Into<wkt::Timestamp>,
24570 {
24571 self.time_to_retire = v.map(|x| x.into());
24572 self
24573 }
24574}
24575
24576impl wkt::message::Message for IpMapping {
24577 fn typename() -> &'static str {
24578 "type.googleapis.com/google.cloud.sql.v1.IpMapping"
24579 }
24580}
24581
24582/// The sub operation type based on the operation type.
24583#[derive(Clone, Default, PartialEq)]
24584#[non_exhaustive]
24585pub struct SqlSubOperationType {
24586 /// Sub operation details corresponding to the operation type.
24587 pub sub_operation_details:
24588 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24589
24590 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24591}
24592
24593impl SqlSubOperationType {
24594 /// Creates a new default instance.
24595 pub fn new() -> Self {
24596 std::default::Default::default()
24597 }
24598
24599 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
24600 ///
24601 /// Note that all the setters affecting `sub_operation_details` are mutually
24602 /// exclusive.
24603 ///
24604 /// # Example
24605 /// ```ignore,no_run
24606 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24607 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24608 /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
24609 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
24610 /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
24611 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
24612 /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
24613 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
24614 /// ```
24615 pub fn set_sub_operation_details<
24616 T: std::convert::Into<
24617 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
24618 >,
24619 >(
24620 mut self,
24621 v: T,
24622 ) -> Self {
24623 self.sub_operation_details = v.into();
24624 self
24625 }
24626
24627 /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24628 /// if it holds a `MaintenanceType`, `None` if the field is not set or
24629 /// holds a different branch.
24630 pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
24631 #[allow(unreachable_patterns)]
24632 self.sub_operation_details.as_ref().and_then(|v| match v {
24633 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
24634 std::option::Option::Some(v)
24635 }
24636 _ => std::option::Option::None,
24637 })
24638 }
24639
24640 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
24641 /// to hold a `MaintenanceType`.
24642 ///
24643 /// Note that all the setters affecting `sub_operation_details` are
24644 /// mutually exclusive.
24645 ///
24646 /// # Example
24647 /// ```ignore,no_run
24648 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
24649 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
24650 /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
24651 /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
24652 /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
24653 /// assert!(x0.maintenance_type().is_some());
24654 /// assert!(x1.maintenance_type().is_some());
24655 /// assert!(x2.maintenance_type().is_some());
24656 /// ```
24657 pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
24658 mut self,
24659 v: T,
24660 ) -> Self {
24661 self.sub_operation_details = std::option::Option::Some(
24662 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
24663 );
24664 self
24665 }
24666}
24667
24668impl wkt::message::Message for SqlSubOperationType {
24669 fn typename() -> &'static str {
24670 "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
24671 }
24672}
24673
24674/// Defines additional types related to [SqlSubOperationType].
24675pub mod sql_sub_operation_type {
24676 #[allow(unused_imports)]
24677 use super::*;
24678
24679 /// Sub operation details corresponding to the operation type.
24680 #[derive(Clone, Debug, PartialEq)]
24681 #[non_exhaustive]
24682 pub enum SubOperationDetails {
24683 /// The type of maintenance to be performed on the instance.
24684 MaintenanceType(crate::model::SqlMaintenanceType),
24685 }
24686}
24687
24688/// An Operation resource. For successful operations that return an
24689/// Operation resource, only the fields relevant to the operation are populated
24690/// in the resource.
24691#[derive(Clone, Default, PartialEq)]
24692#[non_exhaustive]
24693pub struct Operation {
24694 /// This is always `sql#operation`.
24695 pub kind: std::string::String,
24696
24697 #[allow(missing_docs)]
24698 pub target_link: std::string::String,
24699
24700 /// The status of an operation.
24701 pub status: crate::model::operation::SqlOperationStatus,
24702
24703 /// The email address of the user who initiated this operation.
24704 pub user: std::string::String,
24705
24706 /// The time this operation was enqueued in UTC timezone in [RFC
24707 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24708 /// `2012-11-15T16:19:00.094Z`.
24709 pub insert_time: std::option::Option<wkt::Timestamp>,
24710
24711 /// The time this operation actually started in UTC timezone in [RFC
24712 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24713 /// `2012-11-15T16:19:00.094Z`.
24714 pub start_time: std::option::Option<wkt::Timestamp>,
24715
24716 /// The time this operation finished in UTC timezone in [RFC
24717 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
24718 /// `2012-11-15T16:19:00.094Z`.
24719 pub end_time: std::option::Option<wkt::Timestamp>,
24720
24721 /// If errors occurred during processing of this operation, this field will be
24722 /// populated.
24723 pub error: std::option::Option<crate::model::OperationErrors>,
24724
24725 /// An Admin API warning message.
24726 pub api_warning: std::option::Option<crate::model::ApiWarning>,
24727
24728 /// The type of the operation. Valid values are:
24729 ///
24730 /// * `CREATE`
24731 /// * `DELETE`
24732 /// * `UPDATE`
24733 /// * `RESTART`
24734 /// * `IMPORT`
24735 /// * `EXPORT`
24736 /// * `BACKUP_VOLUME`
24737 /// * `RESTORE_VOLUME`
24738 /// * `CREATE_USER`
24739 /// * `DELETE_USER`
24740 /// * `CREATE_DATABASE`
24741 /// * `DELETE_DATABASE`
24742 pub operation_type: crate::model::operation::SqlOperationType,
24743
24744 /// The context for import operation, if applicable.
24745 pub import_context: std::option::Option<crate::model::ImportContext>,
24746
24747 /// The context for export operation, if applicable.
24748 pub export_context: std::option::Option<crate::model::ExportContext>,
24749
24750 /// The context for backup operation, if applicable.
24751 pub backup_context: std::option::Option<crate::model::BackupContext>,
24752
24753 /// This field is only populated when the operation_type is
24754 /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
24755 /// The PreCheckMajorVersionUpgradeContext message itself contains the details
24756 /// for that pre-check, such as the target database version for the upgrade
24757 /// and the results of the check (including any warnings or errors found).
24758 pub pre_check_major_version_upgrade_context:
24759 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
24760
24761 /// An identifier that uniquely identifies the operation. You can use this
24762 /// identifier to retrieve the Operations resource that has information about
24763 /// the operation.
24764 pub name: std::string::String,
24765
24766 /// Name of the resource on which this operation runs.
24767 pub target_id: std::string::String,
24768
24769 /// The URI of this resource.
24770 pub self_link: std::string::String,
24771
24772 /// The project ID of the target instance related to this operation.
24773 pub target_project: std::string::String,
24774
24775 /// The context for acquire SSRS lease operation, if applicable.
24776 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
24777
24778 /// Optional. The sub operation based on the operation type.
24779 pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
24780
24781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24782}
24783
24784impl Operation {
24785 /// Creates a new default instance.
24786 pub fn new() -> Self {
24787 std::default::Default::default()
24788 }
24789
24790 /// Sets the value of [kind][crate::model::Operation::kind].
24791 ///
24792 /// # Example
24793 /// ```ignore,no_run
24794 /// # use google_cloud_sql_v1::model::Operation;
24795 /// let x = Operation::new().set_kind("example");
24796 /// ```
24797 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24798 self.kind = v.into();
24799 self
24800 }
24801
24802 /// Sets the value of [target_link][crate::model::Operation::target_link].
24803 ///
24804 /// # Example
24805 /// ```ignore,no_run
24806 /// # use google_cloud_sql_v1::model::Operation;
24807 /// let x = Operation::new().set_target_link("example");
24808 /// ```
24809 pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24810 self.target_link = v.into();
24811 self
24812 }
24813
24814 /// Sets the value of [status][crate::model::Operation::status].
24815 ///
24816 /// # Example
24817 /// ```ignore,no_run
24818 /// # use google_cloud_sql_v1::model::Operation;
24819 /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
24820 /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
24821 /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
24822 /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
24823 /// ```
24824 pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
24825 mut self,
24826 v: T,
24827 ) -> Self {
24828 self.status = v.into();
24829 self
24830 }
24831
24832 /// Sets the value of [user][crate::model::Operation::user].
24833 ///
24834 /// # Example
24835 /// ```ignore,no_run
24836 /// # use google_cloud_sql_v1::model::Operation;
24837 /// let x = Operation::new().set_user("example");
24838 /// ```
24839 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24840 self.user = v.into();
24841 self
24842 }
24843
24844 /// Sets the value of [insert_time][crate::model::Operation::insert_time].
24845 ///
24846 /// # Example
24847 /// ```ignore,no_run
24848 /// # use google_cloud_sql_v1::model::Operation;
24849 /// use wkt::Timestamp;
24850 /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
24851 /// ```
24852 pub fn set_insert_time<T>(mut self, v: T) -> Self
24853 where
24854 T: std::convert::Into<wkt::Timestamp>,
24855 {
24856 self.insert_time = std::option::Option::Some(v.into());
24857 self
24858 }
24859
24860 /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
24861 ///
24862 /// # Example
24863 /// ```ignore,no_run
24864 /// # use google_cloud_sql_v1::model::Operation;
24865 /// use wkt::Timestamp;
24866 /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
24867 /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
24868 /// ```
24869 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
24870 where
24871 T: std::convert::Into<wkt::Timestamp>,
24872 {
24873 self.insert_time = v.map(|x| x.into());
24874 self
24875 }
24876
24877 /// Sets the value of [start_time][crate::model::Operation::start_time].
24878 ///
24879 /// # Example
24880 /// ```ignore,no_run
24881 /// # use google_cloud_sql_v1::model::Operation;
24882 /// use wkt::Timestamp;
24883 /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
24884 /// ```
24885 pub fn set_start_time<T>(mut self, v: T) -> Self
24886 where
24887 T: std::convert::Into<wkt::Timestamp>,
24888 {
24889 self.start_time = std::option::Option::Some(v.into());
24890 self
24891 }
24892
24893 /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
24894 ///
24895 /// # Example
24896 /// ```ignore,no_run
24897 /// # use google_cloud_sql_v1::model::Operation;
24898 /// use wkt::Timestamp;
24899 /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
24900 /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
24901 /// ```
24902 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
24903 where
24904 T: std::convert::Into<wkt::Timestamp>,
24905 {
24906 self.start_time = v.map(|x| x.into());
24907 self
24908 }
24909
24910 /// Sets the value of [end_time][crate::model::Operation::end_time].
24911 ///
24912 /// # Example
24913 /// ```ignore,no_run
24914 /// # use google_cloud_sql_v1::model::Operation;
24915 /// use wkt::Timestamp;
24916 /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
24917 /// ```
24918 pub fn set_end_time<T>(mut self, v: T) -> Self
24919 where
24920 T: std::convert::Into<wkt::Timestamp>,
24921 {
24922 self.end_time = std::option::Option::Some(v.into());
24923 self
24924 }
24925
24926 /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
24927 ///
24928 /// # Example
24929 /// ```ignore,no_run
24930 /// # use google_cloud_sql_v1::model::Operation;
24931 /// use wkt::Timestamp;
24932 /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
24933 /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
24934 /// ```
24935 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
24936 where
24937 T: std::convert::Into<wkt::Timestamp>,
24938 {
24939 self.end_time = v.map(|x| x.into());
24940 self
24941 }
24942
24943 /// Sets the value of [error][crate::model::Operation::error].
24944 ///
24945 /// # Example
24946 /// ```ignore,no_run
24947 /// # use google_cloud_sql_v1::model::Operation;
24948 /// use google_cloud_sql_v1::model::OperationErrors;
24949 /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
24950 /// ```
24951 pub fn set_error<T>(mut self, v: T) -> Self
24952 where
24953 T: std::convert::Into<crate::model::OperationErrors>,
24954 {
24955 self.error = std::option::Option::Some(v.into());
24956 self
24957 }
24958
24959 /// Sets or clears the value of [error][crate::model::Operation::error].
24960 ///
24961 /// # Example
24962 /// ```ignore,no_run
24963 /// # use google_cloud_sql_v1::model::Operation;
24964 /// use google_cloud_sql_v1::model::OperationErrors;
24965 /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
24966 /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
24967 /// ```
24968 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
24969 where
24970 T: std::convert::Into<crate::model::OperationErrors>,
24971 {
24972 self.error = v.map(|x| x.into());
24973 self
24974 }
24975
24976 /// Sets the value of [api_warning][crate::model::Operation::api_warning].
24977 ///
24978 /// # Example
24979 /// ```ignore,no_run
24980 /// # use google_cloud_sql_v1::model::Operation;
24981 /// use google_cloud_sql_v1::model::ApiWarning;
24982 /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
24983 /// ```
24984 pub fn set_api_warning<T>(mut self, v: T) -> Self
24985 where
24986 T: std::convert::Into<crate::model::ApiWarning>,
24987 {
24988 self.api_warning = std::option::Option::Some(v.into());
24989 self
24990 }
24991
24992 /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
24993 ///
24994 /// # Example
24995 /// ```ignore,no_run
24996 /// # use google_cloud_sql_v1::model::Operation;
24997 /// use google_cloud_sql_v1::model::ApiWarning;
24998 /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
24999 /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
25000 /// ```
25001 pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
25002 where
25003 T: std::convert::Into<crate::model::ApiWarning>,
25004 {
25005 self.api_warning = v.map(|x| x.into());
25006 self
25007 }
25008
25009 /// Sets the value of [operation_type][crate::model::Operation::operation_type].
25010 ///
25011 /// # Example
25012 /// ```ignore,no_run
25013 /// # use google_cloud_sql_v1::model::Operation;
25014 /// use google_cloud_sql_v1::model::operation::SqlOperationType;
25015 /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
25016 /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
25017 /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
25018 /// ```
25019 pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
25020 mut self,
25021 v: T,
25022 ) -> Self {
25023 self.operation_type = v.into();
25024 self
25025 }
25026
25027 /// Sets the value of [import_context][crate::model::Operation::import_context].
25028 ///
25029 /// # Example
25030 /// ```ignore,no_run
25031 /// # use google_cloud_sql_v1::model::Operation;
25032 /// use google_cloud_sql_v1::model::ImportContext;
25033 /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
25034 /// ```
25035 pub fn set_import_context<T>(mut self, v: T) -> Self
25036 where
25037 T: std::convert::Into<crate::model::ImportContext>,
25038 {
25039 self.import_context = std::option::Option::Some(v.into());
25040 self
25041 }
25042
25043 /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
25044 ///
25045 /// # Example
25046 /// ```ignore,no_run
25047 /// # use google_cloud_sql_v1::model::Operation;
25048 /// use google_cloud_sql_v1::model::ImportContext;
25049 /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
25050 /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
25051 /// ```
25052 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
25053 where
25054 T: std::convert::Into<crate::model::ImportContext>,
25055 {
25056 self.import_context = v.map(|x| x.into());
25057 self
25058 }
25059
25060 /// Sets the value of [export_context][crate::model::Operation::export_context].
25061 ///
25062 /// # Example
25063 /// ```ignore,no_run
25064 /// # use google_cloud_sql_v1::model::Operation;
25065 /// use google_cloud_sql_v1::model::ExportContext;
25066 /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
25067 /// ```
25068 pub fn set_export_context<T>(mut self, v: T) -> Self
25069 where
25070 T: std::convert::Into<crate::model::ExportContext>,
25071 {
25072 self.export_context = std::option::Option::Some(v.into());
25073 self
25074 }
25075
25076 /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
25077 ///
25078 /// # Example
25079 /// ```ignore,no_run
25080 /// # use google_cloud_sql_v1::model::Operation;
25081 /// use google_cloud_sql_v1::model::ExportContext;
25082 /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
25083 /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
25084 /// ```
25085 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
25086 where
25087 T: std::convert::Into<crate::model::ExportContext>,
25088 {
25089 self.export_context = v.map(|x| x.into());
25090 self
25091 }
25092
25093 /// Sets the value of [backup_context][crate::model::Operation::backup_context].
25094 ///
25095 /// # Example
25096 /// ```ignore,no_run
25097 /// # use google_cloud_sql_v1::model::Operation;
25098 /// use google_cloud_sql_v1::model::BackupContext;
25099 /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
25100 /// ```
25101 pub fn set_backup_context<T>(mut self, v: T) -> Self
25102 where
25103 T: std::convert::Into<crate::model::BackupContext>,
25104 {
25105 self.backup_context = std::option::Option::Some(v.into());
25106 self
25107 }
25108
25109 /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
25110 ///
25111 /// # Example
25112 /// ```ignore,no_run
25113 /// # use google_cloud_sql_v1::model::Operation;
25114 /// use google_cloud_sql_v1::model::BackupContext;
25115 /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
25116 /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
25117 /// ```
25118 pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
25119 where
25120 T: std::convert::Into<crate::model::BackupContext>,
25121 {
25122 self.backup_context = v.map(|x| x.into());
25123 self
25124 }
25125
25126 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
25127 ///
25128 /// # Example
25129 /// ```ignore,no_run
25130 /// # use google_cloud_sql_v1::model::Operation;
25131 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
25132 /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
25133 /// ```
25134 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
25135 where
25136 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
25137 {
25138 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
25139 self
25140 }
25141
25142 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
25143 ///
25144 /// # Example
25145 /// ```ignore,no_run
25146 /// # use google_cloud_sql_v1::model::Operation;
25147 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
25148 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
25149 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
25150 /// ```
25151 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
25152 mut self,
25153 v: std::option::Option<T>,
25154 ) -> Self
25155 where
25156 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
25157 {
25158 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
25159 self
25160 }
25161
25162 /// Sets the value of [name][crate::model::Operation::name].
25163 ///
25164 /// # Example
25165 /// ```ignore,no_run
25166 /// # use google_cloud_sql_v1::model::Operation;
25167 /// let x = Operation::new().set_name("example");
25168 /// ```
25169 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25170 self.name = v.into();
25171 self
25172 }
25173
25174 /// Sets the value of [target_id][crate::model::Operation::target_id].
25175 ///
25176 /// # Example
25177 /// ```ignore,no_run
25178 /// # use google_cloud_sql_v1::model::Operation;
25179 /// let x = Operation::new().set_target_id("example");
25180 /// ```
25181 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25182 self.target_id = v.into();
25183 self
25184 }
25185
25186 /// Sets the value of [self_link][crate::model::Operation::self_link].
25187 ///
25188 /// # Example
25189 /// ```ignore,no_run
25190 /// # use google_cloud_sql_v1::model::Operation;
25191 /// let x = Operation::new().set_self_link("example");
25192 /// ```
25193 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25194 self.self_link = v.into();
25195 self
25196 }
25197
25198 /// Sets the value of [target_project][crate::model::Operation::target_project].
25199 ///
25200 /// # Example
25201 /// ```ignore,no_run
25202 /// # use google_cloud_sql_v1::model::Operation;
25203 /// let x = Operation::new().set_target_project("example");
25204 /// ```
25205 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25206 self.target_project = v.into();
25207 self
25208 }
25209
25210 /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
25211 ///
25212 /// # Example
25213 /// ```ignore,no_run
25214 /// # use google_cloud_sql_v1::model::Operation;
25215 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
25216 /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
25217 /// ```
25218 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
25219 where
25220 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
25221 {
25222 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
25223 self
25224 }
25225
25226 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
25227 ///
25228 /// # Example
25229 /// ```ignore,no_run
25230 /// # use google_cloud_sql_v1::model::Operation;
25231 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
25232 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
25233 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
25234 /// ```
25235 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
25236 where
25237 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
25238 {
25239 self.acquire_ssrs_lease_context = v.map(|x| x.into());
25240 self
25241 }
25242
25243 /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
25244 ///
25245 /// # Example
25246 /// ```ignore,no_run
25247 /// # use google_cloud_sql_v1::model::Operation;
25248 /// use google_cloud_sql_v1::model::SqlSubOperationType;
25249 /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
25250 /// ```
25251 pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
25252 where
25253 T: std::convert::Into<crate::model::SqlSubOperationType>,
25254 {
25255 self.sub_operation_type = std::option::Option::Some(v.into());
25256 self
25257 }
25258
25259 /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
25260 ///
25261 /// # Example
25262 /// ```ignore,no_run
25263 /// # use google_cloud_sql_v1::model::Operation;
25264 /// use google_cloud_sql_v1::model::SqlSubOperationType;
25265 /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
25266 /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
25267 /// ```
25268 pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
25269 where
25270 T: std::convert::Into<crate::model::SqlSubOperationType>,
25271 {
25272 self.sub_operation_type = v.map(|x| x.into());
25273 self
25274 }
25275}
25276
25277impl wkt::message::Message for Operation {
25278 fn typename() -> &'static str {
25279 "type.googleapis.com/google.cloud.sql.v1.Operation"
25280 }
25281}
25282
25283/// Defines additional types related to [Operation].
25284pub mod operation {
25285 #[allow(unused_imports)]
25286 use super::*;
25287
25288 /// The type of Cloud SQL operation.
25289 ///
25290 /// # Working with unknown values
25291 ///
25292 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25293 /// additional enum variants at any time. Adding new variants is not considered
25294 /// a breaking change. Applications should write their code in anticipation of:
25295 ///
25296 /// - New values appearing in future releases of the client library, **and**
25297 /// - New values received dynamically, without application changes.
25298 ///
25299 /// Please consult the [Working with enums] section in the user guide for some
25300 /// guidelines.
25301 ///
25302 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25303 #[derive(Clone, Debug, PartialEq)]
25304 #[non_exhaustive]
25305 pub enum SqlOperationType {
25306 /// Unknown operation type.
25307 Unspecified,
25308 /// Imports data into a Cloud SQL instance.
25309 Import,
25310 /// Exports data from a Cloud SQL instance to a Cloud Storage
25311 /// bucket.
25312 Export,
25313 /// Creates a new Cloud SQL instance.
25314 Create,
25315 /// Updates the settings of a Cloud SQL instance.
25316 Update,
25317 /// Deletes a Cloud SQL instance.
25318 Delete,
25319 /// Restarts the Cloud SQL instance.
25320 Restart,
25321 #[allow(missing_docs)]
25322 #[deprecated]
25323 Backup,
25324 #[allow(missing_docs)]
25325 #[deprecated]
25326 Snapshot,
25327 /// Performs instance backup.
25328 BackupVolume,
25329 /// Deletes an instance backup.
25330 DeleteVolume,
25331 /// Restores an instance backup.
25332 RestoreVolume,
25333 /// Injects a privileged user in mysql for MOB instances.
25334 InjectUser,
25335 /// Clones a Cloud SQL instance.
25336 Clone,
25337 /// Stops replication on a Cloud SQL read replica instance.
25338 StopReplica,
25339 /// Starts replication on a Cloud SQL read replica instance.
25340 StartReplica,
25341 /// Promotes a Cloud SQL replica instance.
25342 PromoteReplica,
25343 /// Creates a Cloud SQL replica instance.
25344 CreateReplica,
25345 /// Creates a new user in a Cloud SQL instance.
25346 CreateUser,
25347 /// Deletes a user from a Cloud SQL instance.
25348 DeleteUser,
25349 /// Updates an existing user in a Cloud SQL instance. If a user with the
25350 /// specified username doesn't exist, a new user is created.
25351 UpdateUser,
25352 /// Creates a database in the Cloud SQL instance.
25353 CreateDatabase,
25354 /// Deletes a database in the Cloud SQL instance.
25355 DeleteDatabase,
25356 /// Updates a database in the Cloud SQL instance.
25357 UpdateDatabase,
25358 /// Performs failover of an HA-enabled Cloud SQL
25359 /// failover replica.
25360 Failover,
25361 /// Deletes the backup taken by a backup run.
25362 DeleteBackup,
25363 #[allow(missing_docs)]
25364 RecreateReplica,
25365 /// Truncates a general or slow log table in MySQL.
25366 TruncateLog,
25367 /// Demotes the stand-alone instance to be a Cloud SQL
25368 /// read replica for an external database server.
25369 DemoteMaster,
25370 /// Indicates that the instance is currently in maintenance. Maintenance
25371 /// typically causes the instance to be unavailable for 1-3 minutes.
25372 Maintenance,
25373 /// This field is deprecated, and will be removed in future version of API.
25374 #[deprecated]
25375 EnablePrivateIp,
25376 #[allow(missing_docs)]
25377 #[deprecated]
25378 DeferMaintenance,
25379 /// Creates clone instance.
25380 #[deprecated]
25381 CreateClone,
25382 /// Reschedule maintenance to another time.
25383 RescheduleMaintenance,
25384 /// Starts external sync of a Cloud SQL EM replica to an external primary
25385 /// instance.
25386 StartExternalSync,
25387 /// Recovers logs from an instance's old data disk.
25388 LogCleanup,
25389 /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
25390 /// recovery.
25391 AutoRestart,
25392 /// Re-encrypts CMEK instances with latest key version.
25393 Reencrypt,
25394 /// Switches the roles of the primary and replica pair. The target instance
25395 /// should be the replica.
25396 Switchover,
25397 /// Update a backup.
25398 UpdateBackup,
25399 /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
25400 AcquireSsrsLease,
25401 /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
25402 ReleaseSsrsLease,
25403 /// Reconfigures old primary after a promote replica operation. Effect of a
25404 /// promote operation to the old primary is executed in this operation,
25405 /// asynchronously from the promote replica operation executed to the
25406 /// replica.
25407 ReconfigureOldPrimary,
25408 /// Indicates that the instance, its read replicas, and its cascading
25409 /// replicas are in maintenance. Maintenance typically gets initiated on
25410 /// groups of replicas first, followed by the primary instance. For each
25411 /// instance, maintenance typically causes the instance to be unavailable for
25412 /// 1-3 minutes.
25413 #[deprecated]
25414 ClusterMaintenance,
25415 /// Indicates that the instance (and any of its replicas) are currently in
25416 /// maintenance. This is initiated as a self-service request by using SSM.
25417 /// Maintenance typically causes the instance to be unavailable for 1-3
25418 /// minutes.
25419 #[deprecated]
25420 SelfServiceMaintenance,
25421 /// Switches a primary instance to a replica. This operation runs as part of
25422 /// a switchover operation to the original primary instance.
25423 SwitchoverToReplica,
25424 /// Updates the major version of a Cloud SQL instance.
25425 MajorVersionUpgrade,
25426 /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
25427 #[deprecated]
25428 AdvancedBackup,
25429 /// Changes the BackupTier of a Cloud SQL instance.
25430 ManageBackup,
25431 /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
25432 EnhancedBackup,
25433 /// Repairs entire read pool or specified read pool nodes in the read pool.
25434 RepairReadPool,
25435 /// Creates a Cloud SQL read pool instance.
25436 CreateReadPool,
25437 /// Pre-checks the major version upgrade operation.
25438 PreCheckMajorVersionUpgrade,
25439 /// This operation type represents individual steps in a multi-step setup
25440 /// migration workflow: including configuration, replication,
25441 /// switchover/back, and data reseeding, as defined by operation's intent.
25442 SetupMigration,
25443 /// If set, the enum was initialized with an unknown value.
25444 ///
25445 /// Applications can examine the value using [SqlOperationType::value] or
25446 /// [SqlOperationType::name].
25447 UnknownValue(sql_operation_type::UnknownValue),
25448 }
25449
25450 #[doc(hidden)]
25451 pub mod sql_operation_type {
25452 #[allow(unused_imports)]
25453 use super::*;
25454 #[derive(Clone, Debug, PartialEq)]
25455 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25456 }
25457
25458 impl SqlOperationType {
25459 /// Gets the enum value.
25460 ///
25461 /// Returns `None` if the enum contains an unknown value deserialized from
25462 /// the string representation of enums.
25463 pub fn value(&self) -> std::option::Option<i32> {
25464 match self {
25465 Self::Unspecified => std::option::Option::Some(0),
25466 Self::Import => std::option::Option::Some(1),
25467 Self::Export => std::option::Option::Some(2),
25468 Self::Create => std::option::Option::Some(3),
25469 Self::Update => std::option::Option::Some(4),
25470 Self::Delete => std::option::Option::Some(5),
25471 Self::Restart => std::option::Option::Some(6),
25472 Self::Backup => std::option::Option::Some(7),
25473 Self::Snapshot => std::option::Option::Some(8),
25474 Self::BackupVolume => std::option::Option::Some(9),
25475 Self::DeleteVolume => std::option::Option::Some(10),
25476 Self::RestoreVolume => std::option::Option::Some(11),
25477 Self::InjectUser => std::option::Option::Some(12),
25478 Self::Clone => std::option::Option::Some(14),
25479 Self::StopReplica => std::option::Option::Some(15),
25480 Self::StartReplica => std::option::Option::Some(16),
25481 Self::PromoteReplica => std::option::Option::Some(17),
25482 Self::CreateReplica => std::option::Option::Some(18),
25483 Self::CreateUser => std::option::Option::Some(19),
25484 Self::DeleteUser => std::option::Option::Some(20),
25485 Self::UpdateUser => std::option::Option::Some(21),
25486 Self::CreateDatabase => std::option::Option::Some(22),
25487 Self::DeleteDatabase => std::option::Option::Some(23),
25488 Self::UpdateDatabase => std::option::Option::Some(24),
25489 Self::Failover => std::option::Option::Some(25),
25490 Self::DeleteBackup => std::option::Option::Some(26),
25491 Self::RecreateReplica => std::option::Option::Some(27),
25492 Self::TruncateLog => std::option::Option::Some(28),
25493 Self::DemoteMaster => std::option::Option::Some(29),
25494 Self::Maintenance => std::option::Option::Some(30),
25495 Self::EnablePrivateIp => std::option::Option::Some(31),
25496 Self::DeferMaintenance => std::option::Option::Some(32),
25497 Self::CreateClone => std::option::Option::Some(33),
25498 Self::RescheduleMaintenance => std::option::Option::Some(34),
25499 Self::StartExternalSync => std::option::Option::Some(35),
25500 Self::LogCleanup => std::option::Option::Some(36),
25501 Self::AutoRestart => std::option::Option::Some(37),
25502 Self::Reencrypt => std::option::Option::Some(38),
25503 Self::Switchover => std::option::Option::Some(39),
25504 Self::UpdateBackup => std::option::Option::Some(40),
25505 Self::AcquireSsrsLease => std::option::Option::Some(42),
25506 Self::ReleaseSsrsLease => std::option::Option::Some(43),
25507 Self::ReconfigureOldPrimary => std::option::Option::Some(44),
25508 Self::ClusterMaintenance => std::option::Option::Some(45),
25509 Self::SelfServiceMaintenance => std::option::Option::Some(46),
25510 Self::SwitchoverToReplica => std::option::Option::Some(47),
25511 Self::MajorVersionUpgrade => std::option::Option::Some(48),
25512 Self::AdvancedBackup => std::option::Option::Some(49),
25513 Self::ManageBackup => std::option::Option::Some(50),
25514 Self::EnhancedBackup => std::option::Option::Some(51),
25515 Self::RepairReadPool => std::option::Option::Some(52),
25516 Self::CreateReadPool => std::option::Option::Some(53),
25517 Self::PreCheckMajorVersionUpgrade => std::option::Option::Some(54),
25518 Self::SetupMigration => std::option::Option::Some(55),
25519 Self::UnknownValue(u) => u.0.value(),
25520 }
25521 }
25522
25523 /// Gets the enum value as a string.
25524 ///
25525 /// Returns `None` if the enum contains an unknown value deserialized from
25526 /// the integer representation of enums.
25527 pub fn name(&self) -> std::option::Option<&str> {
25528 match self {
25529 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
25530 Self::Import => std::option::Option::Some("IMPORT"),
25531 Self::Export => std::option::Option::Some("EXPORT"),
25532 Self::Create => std::option::Option::Some("CREATE"),
25533 Self::Update => std::option::Option::Some("UPDATE"),
25534 Self::Delete => std::option::Option::Some("DELETE"),
25535 Self::Restart => std::option::Option::Some("RESTART"),
25536 Self::Backup => std::option::Option::Some("BACKUP"),
25537 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
25538 Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
25539 Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
25540 Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
25541 Self::InjectUser => std::option::Option::Some("INJECT_USER"),
25542 Self::Clone => std::option::Option::Some("CLONE"),
25543 Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
25544 Self::StartReplica => std::option::Option::Some("START_REPLICA"),
25545 Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
25546 Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
25547 Self::CreateUser => std::option::Option::Some("CREATE_USER"),
25548 Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
25549 Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
25550 Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
25551 Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
25552 Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
25553 Self::Failover => std::option::Option::Some("FAILOVER"),
25554 Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
25555 Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
25556 Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
25557 Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
25558 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
25559 Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
25560 Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
25561 Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
25562 Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
25563 Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
25564 Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
25565 Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
25566 Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
25567 Self::Switchover => std::option::Option::Some("SWITCHOVER"),
25568 Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
25569 Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
25570 Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
25571 Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
25572 Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
25573 Self::SelfServiceMaintenance => {
25574 std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
25575 }
25576 Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
25577 Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
25578 Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
25579 Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
25580 Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
25581 Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
25582 Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
25583 Self::PreCheckMajorVersionUpgrade => {
25584 std::option::Option::Some("PRE_CHECK_MAJOR_VERSION_UPGRADE")
25585 }
25586 Self::SetupMigration => std::option::Option::Some("SETUP_MIGRATION"),
25587 Self::UnknownValue(u) => u.0.name(),
25588 }
25589 }
25590 }
25591
25592 impl std::default::Default for SqlOperationType {
25593 fn default() -> Self {
25594 use std::convert::From;
25595 Self::from(0)
25596 }
25597 }
25598
25599 impl std::fmt::Display for SqlOperationType {
25600 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25601 wkt::internal::display_enum(f, self.name(), self.value())
25602 }
25603 }
25604
25605 impl std::convert::From<i32> for SqlOperationType {
25606 fn from(value: i32) -> Self {
25607 match value {
25608 0 => Self::Unspecified,
25609 1 => Self::Import,
25610 2 => Self::Export,
25611 3 => Self::Create,
25612 4 => Self::Update,
25613 5 => Self::Delete,
25614 6 => Self::Restart,
25615 7 => Self::Backup,
25616 8 => Self::Snapshot,
25617 9 => Self::BackupVolume,
25618 10 => Self::DeleteVolume,
25619 11 => Self::RestoreVolume,
25620 12 => Self::InjectUser,
25621 14 => Self::Clone,
25622 15 => Self::StopReplica,
25623 16 => Self::StartReplica,
25624 17 => Self::PromoteReplica,
25625 18 => Self::CreateReplica,
25626 19 => Self::CreateUser,
25627 20 => Self::DeleteUser,
25628 21 => Self::UpdateUser,
25629 22 => Self::CreateDatabase,
25630 23 => Self::DeleteDatabase,
25631 24 => Self::UpdateDatabase,
25632 25 => Self::Failover,
25633 26 => Self::DeleteBackup,
25634 27 => Self::RecreateReplica,
25635 28 => Self::TruncateLog,
25636 29 => Self::DemoteMaster,
25637 30 => Self::Maintenance,
25638 31 => Self::EnablePrivateIp,
25639 32 => Self::DeferMaintenance,
25640 33 => Self::CreateClone,
25641 34 => Self::RescheduleMaintenance,
25642 35 => Self::StartExternalSync,
25643 36 => Self::LogCleanup,
25644 37 => Self::AutoRestart,
25645 38 => Self::Reencrypt,
25646 39 => Self::Switchover,
25647 40 => Self::UpdateBackup,
25648 42 => Self::AcquireSsrsLease,
25649 43 => Self::ReleaseSsrsLease,
25650 44 => Self::ReconfigureOldPrimary,
25651 45 => Self::ClusterMaintenance,
25652 46 => Self::SelfServiceMaintenance,
25653 47 => Self::SwitchoverToReplica,
25654 48 => Self::MajorVersionUpgrade,
25655 49 => Self::AdvancedBackup,
25656 50 => Self::ManageBackup,
25657 51 => Self::EnhancedBackup,
25658 52 => Self::RepairReadPool,
25659 53 => Self::CreateReadPool,
25660 54 => Self::PreCheckMajorVersionUpgrade,
25661 55 => Self::SetupMigration,
25662 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25663 wkt::internal::UnknownEnumValue::Integer(value),
25664 )),
25665 }
25666 }
25667 }
25668
25669 impl std::convert::From<&str> for SqlOperationType {
25670 fn from(value: &str) -> Self {
25671 use std::string::ToString;
25672 match value {
25673 "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
25674 "IMPORT" => Self::Import,
25675 "EXPORT" => Self::Export,
25676 "CREATE" => Self::Create,
25677 "UPDATE" => Self::Update,
25678 "DELETE" => Self::Delete,
25679 "RESTART" => Self::Restart,
25680 "BACKUP" => Self::Backup,
25681 "SNAPSHOT" => Self::Snapshot,
25682 "BACKUP_VOLUME" => Self::BackupVolume,
25683 "DELETE_VOLUME" => Self::DeleteVolume,
25684 "RESTORE_VOLUME" => Self::RestoreVolume,
25685 "INJECT_USER" => Self::InjectUser,
25686 "CLONE" => Self::Clone,
25687 "STOP_REPLICA" => Self::StopReplica,
25688 "START_REPLICA" => Self::StartReplica,
25689 "PROMOTE_REPLICA" => Self::PromoteReplica,
25690 "CREATE_REPLICA" => Self::CreateReplica,
25691 "CREATE_USER" => Self::CreateUser,
25692 "DELETE_USER" => Self::DeleteUser,
25693 "UPDATE_USER" => Self::UpdateUser,
25694 "CREATE_DATABASE" => Self::CreateDatabase,
25695 "DELETE_DATABASE" => Self::DeleteDatabase,
25696 "UPDATE_DATABASE" => Self::UpdateDatabase,
25697 "FAILOVER" => Self::Failover,
25698 "DELETE_BACKUP" => Self::DeleteBackup,
25699 "RECREATE_REPLICA" => Self::RecreateReplica,
25700 "TRUNCATE_LOG" => Self::TruncateLog,
25701 "DEMOTE_MASTER" => Self::DemoteMaster,
25702 "MAINTENANCE" => Self::Maintenance,
25703 "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
25704 "DEFER_MAINTENANCE" => Self::DeferMaintenance,
25705 "CREATE_CLONE" => Self::CreateClone,
25706 "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
25707 "START_EXTERNAL_SYNC" => Self::StartExternalSync,
25708 "LOG_CLEANUP" => Self::LogCleanup,
25709 "AUTO_RESTART" => Self::AutoRestart,
25710 "REENCRYPT" => Self::Reencrypt,
25711 "SWITCHOVER" => Self::Switchover,
25712 "UPDATE_BACKUP" => Self::UpdateBackup,
25713 "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
25714 "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
25715 "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
25716 "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
25717 "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
25718 "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
25719 "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
25720 "ADVANCED_BACKUP" => Self::AdvancedBackup,
25721 "MANAGE_BACKUP" => Self::ManageBackup,
25722 "ENHANCED_BACKUP" => Self::EnhancedBackup,
25723 "REPAIR_READ_POOL" => Self::RepairReadPool,
25724 "CREATE_READ_POOL" => Self::CreateReadPool,
25725 "PRE_CHECK_MAJOR_VERSION_UPGRADE" => Self::PreCheckMajorVersionUpgrade,
25726 "SETUP_MIGRATION" => Self::SetupMigration,
25727 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
25728 wkt::internal::UnknownEnumValue::String(value.to_string()),
25729 )),
25730 }
25731 }
25732 }
25733
25734 impl serde::ser::Serialize for SqlOperationType {
25735 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25736 where
25737 S: serde::Serializer,
25738 {
25739 match self {
25740 Self::Unspecified => serializer.serialize_i32(0),
25741 Self::Import => serializer.serialize_i32(1),
25742 Self::Export => serializer.serialize_i32(2),
25743 Self::Create => serializer.serialize_i32(3),
25744 Self::Update => serializer.serialize_i32(4),
25745 Self::Delete => serializer.serialize_i32(5),
25746 Self::Restart => serializer.serialize_i32(6),
25747 Self::Backup => serializer.serialize_i32(7),
25748 Self::Snapshot => serializer.serialize_i32(8),
25749 Self::BackupVolume => serializer.serialize_i32(9),
25750 Self::DeleteVolume => serializer.serialize_i32(10),
25751 Self::RestoreVolume => serializer.serialize_i32(11),
25752 Self::InjectUser => serializer.serialize_i32(12),
25753 Self::Clone => serializer.serialize_i32(14),
25754 Self::StopReplica => serializer.serialize_i32(15),
25755 Self::StartReplica => serializer.serialize_i32(16),
25756 Self::PromoteReplica => serializer.serialize_i32(17),
25757 Self::CreateReplica => serializer.serialize_i32(18),
25758 Self::CreateUser => serializer.serialize_i32(19),
25759 Self::DeleteUser => serializer.serialize_i32(20),
25760 Self::UpdateUser => serializer.serialize_i32(21),
25761 Self::CreateDatabase => serializer.serialize_i32(22),
25762 Self::DeleteDatabase => serializer.serialize_i32(23),
25763 Self::UpdateDatabase => serializer.serialize_i32(24),
25764 Self::Failover => serializer.serialize_i32(25),
25765 Self::DeleteBackup => serializer.serialize_i32(26),
25766 Self::RecreateReplica => serializer.serialize_i32(27),
25767 Self::TruncateLog => serializer.serialize_i32(28),
25768 Self::DemoteMaster => serializer.serialize_i32(29),
25769 Self::Maintenance => serializer.serialize_i32(30),
25770 Self::EnablePrivateIp => serializer.serialize_i32(31),
25771 Self::DeferMaintenance => serializer.serialize_i32(32),
25772 Self::CreateClone => serializer.serialize_i32(33),
25773 Self::RescheduleMaintenance => serializer.serialize_i32(34),
25774 Self::StartExternalSync => serializer.serialize_i32(35),
25775 Self::LogCleanup => serializer.serialize_i32(36),
25776 Self::AutoRestart => serializer.serialize_i32(37),
25777 Self::Reencrypt => serializer.serialize_i32(38),
25778 Self::Switchover => serializer.serialize_i32(39),
25779 Self::UpdateBackup => serializer.serialize_i32(40),
25780 Self::AcquireSsrsLease => serializer.serialize_i32(42),
25781 Self::ReleaseSsrsLease => serializer.serialize_i32(43),
25782 Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
25783 Self::ClusterMaintenance => serializer.serialize_i32(45),
25784 Self::SelfServiceMaintenance => serializer.serialize_i32(46),
25785 Self::SwitchoverToReplica => serializer.serialize_i32(47),
25786 Self::MajorVersionUpgrade => serializer.serialize_i32(48),
25787 Self::AdvancedBackup => serializer.serialize_i32(49),
25788 Self::ManageBackup => serializer.serialize_i32(50),
25789 Self::EnhancedBackup => serializer.serialize_i32(51),
25790 Self::RepairReadPool => serializer.serialize_i32(52),
25791 Self::CreateReadPool => serializer.serialize_i32(53),
25792 Self::PreCheckMajorVersionUpgrade => serializer.serialize_i32(54),
25793 Self::SetupMigration => serializer.serialize_i32(55),
25794 Self::UnknownValue(u) => u.0.serialize(serializer),
25795 }
25796 }
25797 }
25798
25799 impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
25800 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25801 where
25802 D: serde::Deserializer<'de>,
25803 {
25804 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
25805 ".google.cloud.sql.v1.Operation.SqlOperationType",
25806 ))
25807 }
25808 }
25809
25810 /// The status of an operation.
25811 ///
25812 /// # Working with unknown values
25813 ///
25814 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25815 /// additional enum variants at any time. Adding new variants is not considered
25816 /// a breaking change. Applications should write their code in anticipation of:
25817 ///
25818 /// - New values appearing in future releases of the client library, **and**
25819 /// - New values received dynamically, without application changes.
25820 ///
25821 /// Please consult the [Working with enums] section in the user guide for some
25822 /// guidelines.
25823 ///
25824 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25825 #[derive(Clone, Debug, PartialEq)]
25826 #[non_exhaustive]
25827 pub enum SqlOperationStatus {
25828 /// The state of the operation is unknown.
25829 Unspecified,
25830 /// The operation has been queued, but has not started yet.
25831 Pending,
25832 /// The operation is running.
25833 Running,
25834 /// The operation completed.
25835 Done,
25836 /// If set, the enum was initialized with an unknown value.
25837 ///
25838 /// Applications can examine the value using [SqlOperationStatus::value] or
25839 /// [SqlOperationStatus::name].
25840 UnknownValue(sql_operation_status::UnknownValue),
25841 }
25842
25843 #[doc(hidden)]
25844 pub mod sql_operation_status {
25845 #[allow(unused_imports)]
25846 use super::*;
25847 #[derive(Clone, Debug, PartialEq)]
25848 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25849 }
25850
25851 impl SqlOperationStatus {
25852 /// Gets the enum value.
25853 ///
25854 /// Returns `None` if the enum contains an unknown value deserialized from
25855 /// the string representation of enums.
25856 pub fn value(&self) -> std::option::Option<i32> {
25857 match self {
25858 Self::Unspecified => std::option::Option::Some(0),
25859 Self::Pending => std::option::Option::Some(1),
25860 Self::Running => std::option::Option::Some(2),
25861 Self::Done => std::option::Option::Some(3),
25862 Self::UnknownValue(u) => u.0.value(),
25863 }
25864 }
25865
25866 /// Gets the enum value as a string.
25867 ///
25868 /// Returns `None` if the enum contains an unknown value deserialized from
25869 /// the integer representation of enums.
25870 pub fn name(&self) -> std::option::Option<&str> {
25871 match self {
25872 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
25873 Self::Pending => std::option::Option::Some("PENDING"),
25874 Self::Running => std::option::Option::Some("RUNNING"),
25875 Self::Done => std::option::Option::Some("DONE"),
25876 Self::UnknownValue(u) => u.0.name(),
25877 }
25878 }
25879 }
25880
25881 impl std::default::Default for SqlOperationStatus {
25882 fn default() -> Self {
25883 use std::convert::From;
25884 Self::from(0)
25885 }
25886 }
25887
25888 impl std::fmt::Display for SqlOperationStatus {
25889 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25890 wkt::internal::display_enum(f, self.name(), self.value())
25891 }
25892 }
25893
25894 impl std::convert::From<i32> for SqlOperationStatus {
25895 fn from(value: i32) -> Self {
25896 match value {
25897 0 => Self::Unspecified,
25898 1 => Self::Pending,
25899 2 => Self::Running,
25900 3 => Self::Done,
25901 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25902 wkt::internal::UnknownEnumValue::Integer(value),
25903 )),
25904 }
25905 }
25906 }
25907
25908 impl std::convert::From<&str> for SqlOperationStatus {
25909 fn from(value: &str) -> Self {
25910 use std::string::ToString;
25911 match value {
25912 "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
25913 "PENDING" => Self::Pending,
25914 "RUNNING" => Self::Running,
25915 "DONE" => Self::Done,
25916 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25917 wkt::internal::UnknownEnumValue::String(value.to_string()),
25918 )),
25919 }
25920 }
25921 }
25922
25923 impl serde::ser::Serialize for SqlOperationStatus {
25924 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25925 where
25926 S: serde::Serializer,
25927 {
25928 match self {
25929 Self::Unspecified => serializer.serialize_i32(0),
25930 Self::Pending => serializer.serialize_i32(1),
25931 Self::Running => serializer.serialize_i32(2),
25932 Self::Done => serializer.serialize_i32(3),
25933 Self::UnknownValue(u) => u.0.serialize(serializer),
25934 }
25935 }
25936 }
25937
25938 impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
25939 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25940 where
25941 D: serde::Deserializer<'de>,
25942 {
25943 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
25944 ".google.cloud.sql.v1.Operation.SqlOperationStatus",
25945 ))
25946 }
25947 }
25948}
25949
25950/// Database instance operation error.
25951#[derive(Clone, Default, PartialEq)]
25952#[non_exhaustive]
25953pub struct OperationError {
25954 /// This is always `sql#operationError`.
25955 pub kind: std::string::String,
25956
25957 /// Identifies the specific error that occurred.
25958 pub code: std::string::String,
25959
25960 /// Additional information about the error encountered.
25961 pub message: std::string::String,
25962
25963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25964}
25965
25966impl OperationError {
25967 /// Creates a new default instance.
25968 pub fn new() -> Self {
25969 std::default::Default::default()
25970 }
25971
25972 /// Sets the value of [kind][crate::model::OperationError::kind].
25973 ///
25974 /// # Example
25975 /// ```ignore,no_run
25976 /// # use google_cloud_sql_v1::model::OperationError;
25977 /// let x = OperationError::new().set_kind("example");
25978 /// ```
25979 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25980 self.kind = v.into();
25981 self
25982 }
25983
25984 /// Sets the value of [code][crate::model::OperationError::code].
25985 ///
25986 /// # Example
25987 /// ```ignore,no_run
25988 /// # use google_cloud_sql_v1::model::OperationError;
25989 /// let x = OperationError::new().set_code("example");
25990 /// ```
25991 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25992 self.code = v.into();
25993 self
25994 }
25995
25996 /// Sets the value of [message][crate::model::OperationError::message].
25997 ///
25998 /// # Example
25999 /// ```ignore,no_run
26000 /// # use google_cloud_sql_v1::model::OperationError;
26001 /// let x = OperationError::new().set_message("example");
26002 /// ```
26003 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26004 self.message = v.into();
26005 self
26006 }
26007}
26008
26009impl wkt::message::Message for OperationError {
26010 fn typename() -> &'static str {
26011 "type.googleapis.com/google.cloud.sql.v1.OperationError"
26012 }
26013}
26014
26015/// Database instance operation errors list wrapper.
26016#[derive(Clone, Default, PartialEq)]
26017#[non_exhaustive]
26018pub struct OperationErrors {
26019 /// This is always `sql#operationErrors`.
26020 pub kind: std::string::String,
26021
26022 /// The list of errors encountered while processing this operation.
26023 pub errors: std::vec::Vec<crate::model::OperationError>,
26024
26025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26026}
26027
26028impl OperationErrors {
26029 /// Creates a new default instance.
26030 pub fn new() -> Self {
26031 std::default::Default::default()
26032 }
26033
26034 /// Sets the value of [kind][crate::model::OperationErrors::kind].
26035 ///
26036 /// # Example
26037 /// ```ignore,no_run
26038 /// # use google_cloud_sql_v1::model::OperationErrors;
26039 /// let x = OperationErrors::new().set_kind("example");
26040 /// ```
26041 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26042 self.kind = v.into();
26043 self
26044 }
26045
26046 /// Sets the value of [errors][crate::model::OperationErrors::errors].
26047 ///
26048 /// # Example
26049 /// ```ignore,no_run
26050 /// # use google_cloud_sql_v1::model::OperationErrors;
26051 /// use google_cloud_sql_v1::model::OperationError;
26052 /// let x = OperationErrors::new()
26053 /// .set_errors([
26054 /// OperationError::default()/* use setters */,
26055 /// OperationError::default()/* use (different) setters */,
26056 /// ]);
26057 /// ```
26058 pub fn set_errors<T, V>(mut self, v: T) -> Self
26059 where
26060 T: std::iter::IntoIterator<Item = V>,
26061 V: std::convert::Into<crate::model::OperationError>,
26062 {
26063 use std::iter::Iterator;
26064 self.errors = v.into_iter().map(|i| i.into()).collect();
26065 self
26066 }
26067}
26068
26069impl wkt::message::Message for OperationErrors {
26070 fn typename() -> &'static str {
26071 "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
26072 }
26073}
26074
26075/// Database instance local user password validation policy.
26076/// This message defines the password policy for local database users.
26077/// When enabled, it enforces constraints on password complexity, length,
26078/// and reuse. Keep this policy enabled to help prevent unauthorized access.
26079#[derive(Clone, Default, PartialEq)]
26080#[non_exhaustive]
26081pub struct PasswordValidationPolicy {
26082 /// Minimum number of characters allowed.
26083 pub min_length: std::option::Option<wkt::Int32Value>,
26084
26085 /// The complexity of the password.
26086 pub complexity: crate::model::password_validation_policy::Complexity,
26087
26088 /// Number of previous passwords that cannot be reused.
26089 pub reuse_interval: std::option::Option<wkt::Int32Value>,
26090
26091 /// Disallow username as a part of the password.
26092 pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
26093
26094 /// Minimum interval after which the password can be changed. This flag is only
26095 /// supported for PostgreSQL.
26096 pub password_change_interval: std::option::Option<wkt::Duration>,
26097
26098 /// Whether to enable the password policy or not. When enabled, passwords must
26099 /// meet complexity requirements. Keep this policy enabled to help prevent
26100 /// unauthorized access. Disabling this policy allows weak passwords.
26101 pub enable_password_policy: std::option::Option<wkt::BoolValue>,
26102
26103 /// This field is deprecated and will be removed in a future version of the
26104 /// API.
26105 #[deprecated]
26106 pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
26107
26108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26109}
26110
26111impl PasswordValidationPolicy {
26112 /// Creates a new default instance.
26113 pub fn new() -> Self {
26114 std::default::Default::default()
26115 }
26116
26117 /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
26118 ///
26119 /// # Example
26120 /// ```ignore,no_run
26121 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26122 /// use wkt::Int32Value;
26123 /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
26124 /// ```
26125 pub fn set_min_length<T>(mut self, v: T) -> Self
26126 where
26127 T: std::convert::Into<wkt::Int32Value>,
26128 {
26129 self.min_length = std::option::Option::Some(v.into());
26130 self
26131 }
26132
26133 /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
26134 ///
26135 /// # Example
26136 /// ```ignore,no_run
26137 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26138 /// use wkt::Int32Value;
26139 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
26140 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
26141 /// ```
26142 pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
26143 where
26144 T: std::convert::Into<wkt::Int32Value>,
26145 {
26146 self.min_length = v.map(|x| x.into());
26147 self
26148 }
26149
26150 /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
26151 ///
26152 /// # Example
26153 /// ```ignore,no_run
26154 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26155 /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
26156 /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
26157 /// ```
26158 pub fn set_complexity<
26159 T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
26160 >(
26161 mut self,
26162 v: T,
26163 ) -> Self {
26164 self.complexity = v.into();
26165 self
26166 }
26167
26168 /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
26169 ///
26170 /// # Example
26171 /// ```ignore,no_run
26172 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26173 /// use wkt::Int32Value;
26174 /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
26175 /// ```
26176 pub fn set_reuse_interval<T>(mut self, v: T) -> Self
26177 where
26178 T: std::convert::Into<wkt::Int32Value>,
26179 {
26180 self.reuse_interval = std::option::Option::Some(v.into());
26181 self
26182 }
26183
26184 /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
26185 ///
26186 /// # Example
26187 /// ```ignore,no_run
26188 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26189 /// use wkt::Int32Value;
26190 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
26191 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
26192 /// ```
26193 pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
26194 where
26195 T: std::convert::Into<wkt::Int32Value>,
26196 {
26197 self.reuse_interval = v.map(|x| x.into());
26198 self
26199 }
26200
26201 /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
26202 ///
26203 /// # Example
26204 /// ```ignore,no_run
26205 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26206 /// use wkt::BoolValue;
26207 /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
26208 /// ```
26209 pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
26210 where
26211 T: std::convert::Into<wkt::BoolValue>,
26212 {
26213 self.disallow_username_substring = std::option::Option::Some(v.into());
26214 self
26215 }
26216
26217 /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
26218 ///
26219 /// # Example
26220 /// ```ignore,no_run
26221 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26222 /// use wkt::BoolValue;
26223 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
26224 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
26225 /// ```
26226 pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
26227 where
26228 T: std::convert::Into<wkt::BoolValue>,
26229 {
26230 self.disallow_username_substring = v.map(|x| x.into());
26231 self
26232 }
26233
26234 /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
26235 ///
26236 /// # Example
26237 /// ```ignore,no_run
26238 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26239 /// use wkt::Duration;
26240 /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
26241 /// ```
26242 pub fn set_password_change_interval<T>(mut self, v: T) -> Self
26243 where
26244 T: std::convert::Into<wkt::Duration>,
26245 {
26246 self.password_change_interval = std::option::Option::Some(v.into());
26247 self
26248 }
26249
26250 /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
26251 ///
26252 /// # Example
26253 /// ```ignore,no_run
26254 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26255 /// use wkt::Duration;
26256 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
26257 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
26258 /// ```
26259 pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
26260 where
26261 T: std::convert::Into<wkt::Duration>,
26262 {
26263 self.password_change_interval = v.map(|x| x.into());
26264 self
26265 }
26266
26267 /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
26268 ///
26269 /// # Example
26270 /// ```ignore,no_run
26271 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26272 /// use wkt::BoolValue;
26273 /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
26274 /// ```
26275 pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
26276 where
26277 T: std::convert::Into<wkt::BoolValue>,
26278 {
26279 self.enable_password_policy = std::option::Option::Some(v.into());
26280 self
26281 }
26282
26283 /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
26284 ///
26285 /// # Example
26286 /// ```ignore,no_run
26287 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26288 /// use wkt::BoolValue;
26289 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
26290 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
26291 /// ```
26292 pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
26293 where
26294 T: std::convert::Into<wkt::BoolValue>,
26295 {
26296 self.enable_password_policy = v.map(|x| x.into());
26297 self
26298 }
26299
26300 /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
26301 ///
26302 /// # Example
26303 /// ```ignore,no_run
26304 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26305 /// use wkt::BoolValue;
26306 /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
26307 /// ```
26308 #[deprecated]
26309 pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
26310 where
26311 T: std::convert::Into<wkt::BoolValue>,
26312 {
26313 self.disallow_compromised_credentials = std::option::Option::Some(v.into());
26314 self
26315 }
26316
26317 /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
26318 ///
26319 /// # Example
26320 /// ```ignore,no_run
26321 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
26322 /// use wkt::BoolValue;
26323 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
26324 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
26325 /// ```
26326 #[deprecated]
26327 pub fn set_or_clear_disallow_compromised_credentials<T>(
26328 mut self,
26329 v: std::option::Option<T>,
26330 ) -> Self
26331 where
26332 T: std::convert::Into<wkt::BoolValue>,
26333 {
26334 self.disallow_compromised_credentials = v.map(|x| x.into());
26335 self
26336 }
26337}
26338
26339impl wkt::message::Message for PasswordValidationPolicy {
26340 fn typename() -> &'static str {
26341 "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
26342 }
26343}
26344
26345/// Defines additional types related to [PasswordValidationPolicy].
26346pub mod password_validation_policy {
26347 #[allow(unused_imports)]
26348 use super::*;
26349
26350 /// The complexity choices of the password.
26351 ///
26352 /// # Working with unknown values
26353 ///
26354 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26355 /// additional enum variants at any time. Adding new variants is not considered
26356 /// a breaking change. Applications should write their code in anticipation of:
26357 ///
26358 /// - New values appearing in future releases of the client library, **and**
26359 /// - New values received dynamically, without application changes.
26360 ///
26361 /// Please consult the [Working with enums] section in the user guide for some
26362 /// guidelines.
26363 ///
26364 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26365 #[derive(Clone, Debug, PartialEq)]
26366 #[non_exhaustive]
26367 pub enum Complexity {
26368 /// Complexity check is not specified.
26369 Unspecified,
26370 /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
26371 /// characters.
26372 Default,
26373 /// If set, the enum was initialized with an unknown value.
26374 ///
26375 /// Applications can examine the value using [Complexity::value] or
26376 /// [Complexity::name].
26377 UnknownValue(complexity::UnknownValue),
26378 }
26379
26380 #[doc(hidden)]
26381 pub mod complexity {
26382 #[allow(unused_imports)]
26383 use super::*;
26384 #[derive(Clone, Debug, PartialEq)]
26385 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26386 }
26387
26388 impl Complexity {
26389 /// Gets the enum value.
26390 ///
26391 /// Returns `None` if the enum contains an unknown value deserialized from
26392 /// the string representation of enums.
26393 pub fn value(&self) -> std::option::Option<i32> {
26394 match self {
26395 Self::Unspecified => std::option::Option::Some(0),
26396 Self::Default => std::option::Option::Some(1),
26397 Self::UnknownValue(u) => u.0.value(),
26398 }
26399 }
26400
26401 /// Gets the enum value as a string.
26402 ///
26403 /// Returns `None` if the enum contains an unknown value deserialized from
26404 /// the integer representation of enums.
26405 pub fn name(&self) -> std::option::Option<&str> {
26406 match self {
26407 Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
26408 Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
26409 Self::UnknownValue(u) => u.0.name(),
26410 }
26411 }
26412 }
26413
26414 impl std::default::Default for Complexity {
26415 fn default() -> Self {
26416 use std::convert::From;
26417 Self::from(0)
26418 }
26419 }
26420
26421 impl std::fmt::Display for Complexity {
26422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26423 wkt::internal::display_enum(f, self.name(), self.value())
26424 }
26425 }
26426
26427 impl std::convert::From<i32> for Complexity {
26428 fn from(value: i32) -> Self {
26429 match value {
26430 0 => Self::Unspecified,
26431 1 => Self::Default,
26432 _ => Self::UnknownValue(complexity::UnknownValue(
26433 wkt::internal::UnknownEnumValue::Integer(value),
26434 )),
26435 }
26436 }
26437 }
26438
26439 impl std::convert::From<&str> for Complexity {
26440 fn from(value: &str) -> Self {
26441 use std::string::ToString;
26442 match value {
26443 "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
26444 "COMPLEXITY_DEFAULT" => Self::Default,
26445 _ => Self::UnknownValue(complexity::UnknownValue(
26446 wkt::internal::UnknownEnumValue::String(value.to_string()),
26447 )),
26448 }
26449 }
26450 }
26451
26452 impl serde::ser::Serialize for Complexity {
26453 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26454 where
26455 S: serde::Serializer,
26456 {
26457 match self {
26458 Self::Unspecified => serializer.serialize_i32(0),
26459 Self::Default => serializer.serialize_i32(1),
26460 Self::UnknownValue(u) => u.0.serialize(serializer),
26461 }
26462 }
26463 }
26464
26465 impl<'de> serde::de::Deserialize<'de> for Complexity {
26466 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26467 where
26468 D: serde::Deserializer<'de>,
26469 {
26470 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
26471 ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
26472 ))
26473 }
26474 }
26475}
26476
26477/// Data cache configurations.
26478#[derive(Clone, Default, PartialEq)]
26479#[non_exhaustive]
26480pub struct DataCacheConfig {
26481 /// Whether data cache is enabled for the instance.
26482 pub data_cache_enabled: bool,
26483
26484 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26485}
26486
26487impl DataCacheConfig {
26488 /// Creates a new default instance.
26489 pub fn new() -> Self {
26490 std::default::Default::default()
26491 }
26492
26493 /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
26494 ///
26495 /// # Example
26496 /// ```ignore,no_run
26497 /// # use google_cloud_sql_v1::model::DataCacheConfig;
26498 /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
26499 /// ```
26500 pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
26501 self.data_cache_enabled = v.into();
26502 self
26503 }
26504}
26505
26506impl wkt::message::Message for DataCacheConfig {
26507 fn typename() -> &'static str {
26508 "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
26509 }
26510}
26511
26512/// Config used to determine the final backup settings for the instance.
26513#[derive(Clone, Default, PartialEq)]
26514#[non_exhaustive]
26515pub struct FinalBackupConfig {
26516 /// Whether the final backup is enabled for the instance.
26517 pub enabled: std::option::Option<bool>,
26518
26519 /// The number of days to retain the final backup after the instance deletion.
26520 /// The final backup will be purged at (time_of_instance_deletion +
26521 /// retention_days).
26522 pub retention_days: std::option::Option<i32>,
26523
26524 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26525}
26526
26527impl FinalBackupConfig {
26528 /// Creates a new default instance.
26529 pub fn new() -> Self {
26530 std::default::Default::default()
26531 }
26532
26533 /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
26534 ///
26535 /// # Example
26536 /// ```ignore,no_run
26537 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26538 /// let x = FinalBackupConfig::new().set_enabled(true);
26539 /// ```
26540 pub fn set_enabled<T>(mut self, v: T) -> Self
26541 where
26542 T: std::convert::Into<bool>,
26543 {
26544 self.enabled = std::option::Option::Some(v.into());
26545 self
26546 }
26547
26548 /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
26549 ///
26550 /// # Example
26551 /// ```ignore,no_run
26552 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26553 /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
26554 /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
26555 /// ```
26556 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26557 where
26558 T: std::convert::Into<bool>,
26559 {
26560 self.enabled = v.map(|x| x.into());
26561 self
26562 }
26563
26564 /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26565 ///
26566 /// # Example
26567 /// ```ignore,no_run
26568 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26569 /// let x = FinalBackupConfig::new().set_retention_days(42);
26570 /// ```
26571 pub fn set_retention_days<T>(mut self, v: T) -> Self
26572 where
26573 T: std::convert::Into<i32>,
26574 {
26575 self.retention_days = std::option::Option::Some(v.into());
26576 self
26577 }
26578
26579 /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
26580 ///
26581 /// # Example
26582 /// ```ignore,no_run
26583 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
26584 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
26585 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
26586 /// ```
26587 pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
26588 where
26589 T: std::convert::Into<i32>,
26590 {
26591 self.retention_days = v.map(|x| x.into());
26592 self
26593 }
26594}
26595
26596impl wkt::message::Message for FinalBackupConfig {
26597 fn typename() -> &'static str {
26598 "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
26599 }
26600}
26601
26602/// Database instance settings.
26603#[derive(Clone, Default, PartialEq)]
26604#[non_exhaustive]
26605pub struct Settings {
26606 /// The version of instance settings. This is a required field for update
26607 /// method to make sure concurrent updates are handled properly. During update,
26608 /// use the most recent settingsVersion value for this instance and do not try
26609 /// to update this value.
26610 pub settings_version: std::option::Option<wkt::Int64Value>,
26611
26612 /// The App Engine app IDs that can access this instance.
26613 /// (Deprecated) Applied to First Generation instances only.
26614 #[deprecated]
26615 pub authorized_gae_applications: std::vec::Vec<std::string::String>,
26616
26617 /// The tier (or machine type) for this instance, for example
26618 /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
26619 pub tier: std::string::String,
26620
26621 /// This is always `sql#settings`.
26622 pub kind: std::string::String,
26623
26624 /// User-provided labels, represented as a dictionary where each label is a
26625 /// single key value pair.
26626 pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
26627
26628 /// Availability type. Potential values:
26629 ///
26630 /// * `ZONAL`: The instance serves data from only one zone. Outages in that
26631 /// zone affect data accessibility.
26632 /// * `REGIONAL`: The instance can serve data from more than one zone in a
26633 /// region (it is highly available)./
26634 ///
26635 /// For more information, see [Overview of the High Availability
26636 /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
26637 pub availability_type: crate::model::SqlAvailabilityType,
26638
26639 /// The pricing plan for this instance. This can be either `PER_USE` or
26640 /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
26641 pub pricing_plan: crate::model::SqlPricingPlan,
26642
26643 /// The type of replication this instance uses. This can be either
26644 /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
26645 /// applicable to First Generation instances.
26646 #[deprecated]
26647 pub replication_type: crate::model::SqlReplicationType,
26648
26649 /// The maximum size to which storage capacity can be automatically increased.
26650 /// The default value is 0, which specifies that there is no limit.
26651 pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
26652
26653 /// The activation policy specifies when the instance is activated; it is
26654 /// applicable only when the instance state is RUNNABLE. Valid values:
26655 ///
26656 /// * `ALWAYS`: The instance is on, and remains so even in the absence of
26657 /// connection requests.
26658 /// * `NEVER`: The instance is off; it is not activated, even if a
26659 /// connection request arrives.
26660 pub activation_policy: crate::model::settings::SqlActivationPolicy,
26661
26662 /// The settings for IP Management. This allows to enable or disable the
26663 /// instance IP and manage which external networks can connect to the instance.
26664 /// The IPv4 address cannot be disabled for Second Generation instances.
26665 pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
26666
26667 /// Configuration to increase storage size automatically. The default value is
26668 /// true.
26669 pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
26670
26671 /// The location preference settings. This allows the instance to be located as
26672 /// near as possible to either an App Engine app or Compute Engine zone for
26673 /// better performance. App Engine co-location was only applicable to First
26674 /// Generation instances.
26675 pub location_preference: std::option::Option<crate::model::LocationPreference>,
26676
26677 /// The database flags passed to the instance at startup.
26678 pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
26679
26680 /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
26681 /// First Generation instances.
26682 pub data_disk_type: crate::model::SqlDataDiskType,
26683
26684 /// The maintenance window for this instance. This specifies when the instance
26685 /// can be restarted for maintenance purposes.
26686 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
26687
26688 /// The daily backup configuration for the instance.
26689 pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
26690
26691 /// Configuration specific to read replica instances. Indicates whether
26692 /// replication is enabled or not. WARNING: Changing this restarts the
26693 /// instance.
26694 pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
26695
26696 /// Configuration specific to read replica instances. Indicates whether
26697 /// database flags for crash-safe replication are enabled. This property was
26698 /// only applicable to First Generation instances.
26699 #[deprecated]
26700 pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
26701
26702 /// The size of data disk, in GB. The data disk size minimum is 10GB.
26703 pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
26704
26705 /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
26706 pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
26707
26708 /// The name of server Instance collation.
26709 pub collation: std::string::String,
26710
26711 /// Deny maintenance periods
26712 pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
26713
26714 /// Insights configuration, for now relevant only for Postgres.
26715 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
26716
26717 /// The local user password validation policy of the instance.
26718 pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
26719
26720 /// SQL Server specific audit configuration.
26721 pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
26722
26723 /// Optional. The edition type of the Cloud SQL instance.
26724 pub edition: crate::model::settings::Edition,
26725
26726 /// Specifies if connections must use Cloud SQL connectors.
26727 /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
26728 /// can be connected without Cloud SQL
26729 /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
26730 /// Connectors).
26731 ///
26732 /// Note that using REQUIRED disables all existing authorized networks. If
26733 /// this field is not specified when creating a new instance, NOT_REQUIRED is
26734 /// used. If this field is not specified when patching or updating an existing
26735 /// instance, it is left unchanged in the instance.
26736 pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
26737
26738 /// Configuration to protect against accidental instance deletion.
26739 pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
26740
26741 /// Server timezone, relevant only for Cloud SQL for SQL Server.
26742 pub time_zone: std::string::String,
26743
26744 /// Specifies advanced machine configuration for the instances relevant only
26745 /// for SQL Server.
26746 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
26747
26748 /// Configuration for data cache.
26749 pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
26750
26751 /// Optional. Configuration value for recreation of replica after certain
26752 /// replication lag
26753 pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
26754
26755 /// Optional. When this parameter is set to true, Cloud SQL instances can
26756 /// connect to Vertex AI to pass requests for real-time predictions and
26757 /// insights to the AI. The default value is false. This applies only to Cloud
26758 /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
26759 pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
26760
26761 /// Optional. By default, Cloud SQL instances have schema extraction disabled
26762 /// for Dataplex. When this parameter is set to true, schema extraction for
26763 /// Dataplex on Cloud SQL instances is activated.
26764 pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
26765
26766 /// Optional. When this parameter is set to true, Cloud SQL retains backups of
26767 /// the instance even after the instance is deleted. The ON_DEMAND backup will
26768 /// be retained until customer deletes the backup or the project. The AUTOMATED
26769 /// backup will be retained based on the backups retention setting.
26770 pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
26771
26772 /// Optional. Provisioned number of I/O operations per second for the data
26773 /// disk. This field is only used for hyperdisk-balanced disk types.
26774 pub data_disk_provisioned_iops: std::option::Option<i64>,
26775
26776 /// Optional. Provisioned throughput measured in MiB per second for the data
26777 /// disk. This field is only used for hyperdisk-balanced disk types.
26778 pub data_disk_provisioned_throughput: std::option::Option<i64>,
26779
26780 /// Optional. The managed connection pooling configuration for the instance.
26781 pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
26782
26783 /// Optional. The final backup configuration for the instance.
26784 pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
26785
26786 /// Optional. The read pool auto-scale configuration for the instance.
26787 pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
26788
26789 /// Optional. Whether the replica is in accelerated mode. This feature is in
26790 /// private preview and requires allowlisting to take effect.
26791 pub accelerated_replica_mode: std::option::Option<wkt::BoolValue>,
26792
26793 /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
26794 /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
26795 /// versions. The MySQL version must be 8.0.35 or higher.
26796 pub auto_upgrade_enabled: std::option::Option<bool>,
26797
26798 /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
26799 pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
26800
26801 /// This parameter controls whether to allow using ExecuteSql API to connect to
26802 /// the instance. Not allowed by default.
26803 pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
26804
26805 /// Optional. Configuration for Performance Capture, provides diagnostic
26806 /// metrics during high load situations.
26807 pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
26808
26809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26810}
26811
26812impl Settings {
26813 /// Creates a new default instance.
26814 pub fn new() -> Self {
26815 std::default::Default::default()
26816 }
26817
26818 /// Sets the value of [settings_version][crate::model::Settings::settings_version].
26819 ///
26820 /// # Example
26821 /// ```ignore,no_run
26822 /// # use google_cloud_sql_v1::model::Settings;
26823 /// use wkt::Int64Value;
26824 /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
26825 /// ```
26826 pub fn set_settings_version<T>(mut self, v: T) -> Self
26827 where
26828 T: std::convert::Into<wkt::Int64Value>,
26829 {
26830 self.settings_version = std::option::Option::Some(v.into());
26831 self
26832 }
26833
26834 /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
26835 ///
26836 /// # Example
26837 /// ```ignore,no_run
26838 /// # use google_cloud_sql_v1::model::Settings;
26839 /// use wkt::Int64Value;
26840 /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
26841 /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
26842 /// ```
26843 pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
26844 where
26845 T: std::convert::Into<wkt::Int64Value>,
26846 {
26847 self.settings_version = v.map(|x| x.into());
26848 self
26849 }
26850
26851 /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
26852 ///
26853 /// # Example
26854 /// ```ignore,no_run
26855 /// # use google_cloud_sql_v1::model::Settings;
26856 /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
26857 /// ```
26858 #[deprecated]
26859 pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
26860 where
26861 T: std::iter::IntoIterator<Item = V>,
26862 V: std::convert::Into<std::string::String>,
26863 {
26864 use std::iter::Iterator;
26865 self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
26866 self
26867 }
26868
26869 /// Sets the value of [tier][crate::model::Settings::tier].
26870 ///
26871 /// # Example
26872 /// ```ignore,no_run
26873 /// # use google_cloud_sql_v1::model::Settings;
26874 /// let x = Settings::new().set_tier("example");
26875 /// ```
26876 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26877 self.tier = v.into();
26878 self
26879 }
26880
26881 /// Sets the value of [kind][crate::model::Settings::kind].
26882 ///
26883 /// # Example
26884 /// ```ignore,no_run
26885 /// # use google_cloud_sql_v1::model::Settings;
26886 /// let x = Settings::new().set_kind("example");
26887 /// ```
26888 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26889 self.kind = v.into();
26890 self
26891 }
26892
26893 /// Sets the value of [user_labels][crate::model::Settings::user_labels].
26894 ///
26895 /// # Example
26896 /// ```ignore,no_run
26897 /// # use google_cloud_sql_v1::model::Settings;
26898 /// let x = Settings::new().set_user_labels([
26899 /// ("key0", "abc"),
26900 /// ("key1", "xyz"),
26901 /// ]);
26902 /// ```
26903 pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
26904 where
26905 T: std::iter::IntoIterator<Item = (K, V)>,
26906 K: std::convert::Into<std::string::String>,
26907 V: std::convert::Into<std::string::String>,
26908 {
26909 use std::iter::Iterator;
26910 self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26911 self
26912 }
26913
26914 /// Sets the value of [availability_type][crate::model::Settings::availability_type].
26915 ///
26916 /// # Example
26917 /// ```ignore,no_run
26918 /// # use google_cloud_sql_v1::model::Settings;
26919 /// use google_cloud_sql_v1::model::SqlAvailabilityType;
26920 /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
26921 /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
26922 /// ```
26923 pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
26924 mut self,
26925 v: T,
26926 ) -> Self {
26927 self.availability_type = v.into();
26928 self
26929 }
26930
26931 /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
26932 ///
26933 /// # Example
26934 /// ```ignore,no_run
26935 /// # use google_cloud_sql_v1::model::Settings;
26936 /// use google_cloud_sql_v1::model::SqlPricingPlan;
26937 /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
26938 /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
26939 /// ```
26940 pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
26941 mut self,
26942 v: T,
26943 ) -> Self {
26944 self.pricing_plan = v.into();
26945 self
26946 }
26947
26948 /// Sets the value of [replication_type][crate::model::Settings::replication_type].
26949 ///
26950 /// # Example
26951 /// ```ignore,no_run
26952 /// # use google_cloud_sql_v1::model::Settings;
26953 /// use google_cloud_sql_v1::model::SqlReplicationType;
26954 /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
26955 /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
26956 /// ```
26957 #[deprecated]
26958 pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
26959 mut self,
26960 v: T,
26961 ) -> Self {
26962 self.replication_type = v.into();
26963 self
26964 }
26965
26966 /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26967 ///
26968 /// # Example
26969 /// ```ignore,no_run
26970 /// # use google_cloud_sql_v1::model::Settings;
26971 /// use wkt::Int64Value;
26972 /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
26973 /// ```
26974 pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
26975 where
26976 T: std::convert::Into<wkt::Int64Value>,
26977 {
26978 self.storage_auto_resize_limit = std::option::Option::Some(v.into());
26979 self
26980 }
26981
26982 /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26983 ///
26984 /// # Example
26985 /// ```ignore,no_run
26986 /// # use google_cloud_sql_v1::model::Settings;
26987 /// use wkt::Int64Value;
26988 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
26989 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
26990 /// ```
26991 pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
26992 where
26993 T: std::convert::Into<wkt::Int64Value>,
26994 {
26995 self.storage_auto_resize_limit = v.map(|x| x.into());
26996 self
26997 }
26998
26999 /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
27000 ///
27001 /// # Example
27002 /// ```ignore,no_run
27003 /// # use google_cloud_sql_v1::model::Settings;
27004 /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
27005 /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
27006 /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
27007 /// ```
27008 pub fn set_activation_policy<
27009 T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
27010 >(
27011 mut self,
27012 v: T,
27013 ) -> Self {
27014 self.activation_policy = v.into();
27015 self
27016 }
27017
27018 /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
27019 ///
27020 /// # Example
27021 /// ```ignore,no_run
27022 /// # use google_cloud_sql_v1::model::Settings;
27023 /// use google_cloud_sql_v1::model::IpConfiguration;
27024 /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
27025 /// ```
27026 pub fn set_ip_configuration<T>(mut self, v: T) -> Self
27027 where
27028 T: std::convert::Into<crate::model::IpConfiguration>,
27029 {
27030 self.ip_configuration = std::option::Option::Some(v.into());
27031 self
27032 }
27033
27034 /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
27035 ///
27036 /// # Example
27037 /// ```ignore,no_run
27038 /// # use google_cloud_sql_v1::model::Settings;
27039 /// use google_cloud_sql_v1::model::IpConfiguration;
27040 /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
27041 /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
27042 /// ```
27043 pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
27044 where
27045 T: std::convert::Into<crate::model::IpConfiguration>,
27046 {
27047 self.ip_configuration = v.map(|x| x.into());
27048 self
27049 }
27050
27051 /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
27052 ///
27053 /// # Example
27054 /// ```ignore,no_run
27055 /// # use google_cloud_sql_v1::model::Settings;
27056 /// use wkt::BoolValue;
27057 /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
27058 /// ```
27059 pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
27060 where
27061 T: std::convert::Into<wkt::BoolValue>,
27062 {
27063 self.storage_auto_resize = std::option::Option::Some(v.into());
27064 self
27065 }
27066
27067 /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
27068 ///
27069 /// # Example
27070 /// ```ignore,no_run
27071 /// # use google_cloud_sql_v1::model::Settings;
27072 /// use wkt::BoolValue;
27073 /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
27074 /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
27075 /// ```
27076 pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
27077 where
27078 T: std::convert::Into<wkt::BoolValue>,
27079 {
27080 self.storage_auto_resize = v.map(|x| x.into());
27081 self
27082 }
27083
27084 /// Sets the value of [location_preference][crate::model::Settings::location_preference].
27085 ///
27086 /// # Example
27087 /// ```ignore,no_run
27088 /// # use google_cloud_sql_v1::model::Settings;
27089 /// use google_cloud_sql_v1::model::LocationPreference;
27090 /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
27091 /// ```
27092 pub fn set_location_preference<T>(mut self, v: T) -> Self
27093 where
27094 T: std::convert::Into<crate::model::LocationPreference>,
27095 {
27096 self.location_preference = std::option::Option::Some(v.into());
27097 self
27098 }
27099
27100 /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
27101 ///
27102 /// # Example
27103 /// ```ignore,no_run
27104 /// # use google_cloud_sql_v1::model::Settings;
27105 /// use google_cloud_sql_v1::model::LocationPreference;
27106 /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
27107 /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
27108 /// ```
27109 pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
27110 where
27111 T: std::convert::Into<crate::model::LocationPreference>,
27112 {
27113 self.location_preference = v.map(|x| x.into());
27114 self
27115 }
27116
27117 /// Sets the value of [database_flags][crate::model::Settings::database_flags].
27118 ///
27119 /// # Example
27120 /// ```ignore,no_run
27121 /// # use google_cloud_sql_v1::model::Settings;
27122 /// use google_cloud_sql_v1::model::DatabaseFlags;
27123 /// let x = Settings::new()
27124 /// .set_database_flags([
27125 /// DatabaseFlags::default()/* use setters */,
27126 /// DatabaseFlags::default()/* use (different) setters */,
27127 /// ]);
27128 /// ```
27129 pub fn set_database_flags<T, V>(mut self, v: T) -> Self
27130 where
27131 T: std::iter::IntoIterator<Item = V>,
27132 V: std::convert::Into<crate::model::DatabaseFlags>,
27133 {
27134 use std::iter::Iterator;
27135 self.database_flags = v.into_iter().map(|i| i.into()).collect();
27136 self
27137 }
27138
27139 /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
27140 ///
27141 /// # Example
27142 /// ```ignore,no_run
27143 /// # use google_cloud_sql_v1::model::Settings;
27144 /// use google_cloud_sql_v1::model::SqlDataDiskType;
27145 /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
27146 /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
27147 /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
27148 /// ```
27149 pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
27150 mut self,
27151 v: T,
27152 ) -> Self {
27153 self.data_disk_type = v.into();
27154 self
27155 }
27156
27157 /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
27158 ///
27159 /// # Example
27160 /// ```ignore,no_run
27161 /// # use google_cloud_sql_v1::model::Settings;
27162 /// use google_cloud_sql_v1::model::MaintenanceWindow;
27163 /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
27164 /// ```
27165 pub fn set_maintenance_window<T>(mut self, v: T) -> Self
27166 where
27167 T: std::convert::Into<crate::model::MaintenanceWindow>,
27168 {
27169 self.maintenance_window = std::option::Option::Some(v.into());
27170 self
27171 }
27172
27173 /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
27174 ///
27175 /// # Example
27176 /// ```ignore,no_run
27177 /// # use google_cloud_sql_v1::model::Settings;
27178 /// use google_cloud_sql_v1::model::MaintenanceWindow;
27179 /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
27180 /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
27181 /// ```
27182 pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
27183 where
27184 T: std::convert::Into<crate::model::MaintenanceWindow>,
27185 {
27186 self.maintenance_window = v.map(|x| x.into());
27187 self
27188 }
27189
27190 /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
27191 ///
27192 /// # Example
27193 /// ```ignore,no_run
27194 /// # use google_cloud_sql_v1::model::Settings;
27195 /// use google_cloud_sql_v1::model::BackupConfiguration;
27196 /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
27197 /// ```
27198 pub fn set_backup_configuration<T>(mut self, v: T) -> Self
27199 where
27200 T: std::convert::Into<crate::model::BackupConfiguration>,
27201 {
27202 self.backup_configuration = std::option::Option::Some(v.into());
27203 self
27204 }
27205
27206 /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
27207 ///
27208 /// # Example
27209 /// ```ignore,no_run
27210 /// # use google_cloud_sql_v1::model::Settings;
27211 /// use google_cloud_sql_v1::model::BackupConfiguration;
27212 /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
27213 /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
27214 /// ```
27215 pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
27216 where
27217 T: std::convert::Into<crate::model::BackupConfiguration>,
27218 {
27219 self.backup_configuration = v.map(|x| x.into());
27220 self
27221 }
27222
27223 /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
27224 ///
27225 /// # Example
27226 /// ```ignore,no_run
27227 /// # use google_cloud_sql_v1::model::Settings;
27228 /// use wkt::BoolValue;
27229 /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
27230 /// ```
27231 pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
27232 where
27233 T: std::convert::Into<wkt::BoolValue>,
27234 {
27235 self.database_replication_enabled = std::option::Option::Some(v.into());
27236 self
27237 }
27238
27239 /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
27240 ///
27241 /// # Example
27242 /// ```ignore,no_run
27243 /// # use google_cloud_sql_v1::model::Settings;
27244 /// use wkt::BoolValue;
27245 /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
27246 /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
27247 /// ```
27248 pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27249 where
27250 T: std::convert::Into<wkt::BoolValue>,
27251 {
27252 self.database_replication_enabled = v.map(|x| x.into());
27253 self
27254 }
27255
27256 /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
27257 ///
27258 /// # Example
27259 /// ```ignore,no_run
27260 /// # use google_cloud_sql_v1::model::Settings;
27261 /// use wkt::BoolValue;
27262 /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
27263 /// ```
27264 #[deprecated]
27265 pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
27266 where
27267 T: std::convert::Into<wkt::BoolValue>,
27268 {
27269 self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
27270 self
27271 }
27272
27273 /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
27274 ///
27275 /// # Example
27276 /// ```ignore,no_run
27277 /// # use google_cloud_sql_v1::model::Settings;
27278 /// use wkt::BoolValue;
27279 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
27280 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
27281 /// ```
27282 #[deprecated]
27283 pub fn set_or_clear_crash_safe_replication_enabled<T>(
27284 mut self,
27285 v: std::option::Option<T>,
27286 ) -> Self
27287 where
27288 T: std::convert::Into<wkt::BoolValue>,
27289 {
27290 self.crash_safe_replication_enabled = v.map(|x| x.into());
27291 self
27292 }
27293
27294 /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
27295 ///
27296 /// # Example
27297 /// ```ignore,no_run
27298 /// # use google_cloud_sql_v1::model::Settings;
27299 /// use wkt::Int64Value;
27300 /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
27301 /// ```
27302 pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
27303 where
27304 T: std::convert::Into<wkt::Int64Value>,
27305 {
27306 self.data_disk_size_gb = std::option::Option::Some(v.into());
27307 self
27308 }
27309
27310 /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
27311 ///
27312 /// # Example
27313 /// ```ignore,no_run
27314 /// # use google_cloud_sql_v1::model::Settings;
27315 /// use wkt::Int64Value;
27316 /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
27317 /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
27318 /// ```
27319 pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
27320 where
27321 T: std::convert::Into<wkt::Int64Value>,
27322 {
27323 self.data_disk_size_gb = v.map(|x| x.into());
27324 self
27325 }
27326
27327 /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
27328 ///
27329 /// # Example
27330 /// ```ignore,no_run
27331 /// # use google_cloud_sql_v1::model::Settings;
27332 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
27333 /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
27334 /// ```
27335 pub fn set_active_directory_config<T>(mut self, v: T) -> Self
27336 where
27337 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
27338 {
27339 self.active_directory_config = std::option::Option::Some(v.into());
27340 self
27341 }
27342
27343 /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
27344 ///
27345 /// # Example
27346 /// ```ignore,no_run
27347 /// # use google_cloud_sql_v1::model::Settings;
27348 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
27349 /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
27350 /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
27351 /// ```
27352 pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
27353 where
27354 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
27355 {
27356 self.active_directory_config = v.map(|x| x.into());
27357 self
27358 }
27359
27360 /// Sets the value of [collation][crate::model::Settings::collation].
27361 ///
27362 /// # Example
27363 /// ```ignore,no_run
27364 /// # use google_cloud_sql_v1::model::Settings;
27365 /// let x = Settings::new().set_collation("example");
27366 /// ```
27367 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27368 self.collation = v.into();
27369 self
27370 }
27371
27372 /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
27373 ///
27374 /// # Example
27375 /// ```ignore,no_run
27376 /// # use google_cloud_sql_v1::model::Settings;
27377 /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
27378 /// let x = Settings::new()
27379 /// .set_deny_maintenance_periods([
27380 /// DenyMaintenancePeriod::default()/* use setters */,
27381 /// DenyMaintenancePeriod::default()/* use (different) setters */,
27382 /// ]);
27383 /// ```
27384 pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
27385 where
27386 T: std::iter::IntoIterator<Item = V>,
27387 V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
27388 {
27389 use std::iter::Iterator;
27390 self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
27391 self
27392 }
27393
27394 /// Sets the value of [insights_config][crate::model::Settings::insights_config].
27395 ///
27396 /// # Example
27397 /// ```ignore,no_run
27398 /// # use google_cloud_sql_v1::model::Settings;
27399 /// use google_cloud_sql_v1::model::InsightsConfig;
27400 /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
27401 /// ```
27402 pub fn set_insights_config<T>(mut self, v: T) -> Self
27403 where
27404 T: std::convert::Into<crate::model::InsightsConfig>,
27405 {
27406 self.insights_config = std::option::Option::Some(v.into());
27407 self
27408 }
27409
27410 /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
27411 ///
27412 /// # Example
27413 /// ```ignore,no_run
27414 /// # use google_cloud_sql_v1::model::Settings;
27415 /// use google_cloud_sql_v1::model::InsightsConfig;
27416 /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
27417 /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
27418 /// ```
27419 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
27420 where
27421 T: std::convert::Into<crate::model::InsightsConfig>,
27422 {
27423 self.insights_config = v.map(|x| x.into());
27424 self
27425 }
27426
27427 /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
27428 ///
27429 /// # Example
27430 /// ```ignore,no_run
27431 /// # use google_cloud_sql_v1::model::Settings;
27432 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
27433 /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
27434 /// ```
27435 pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
27436 where
27437 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
27438 {
27439 self.password_validation_policy = std::option::Option::Some(v.into());
27440 self
27441 }
27442
27443 /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
27444 ///
27445 /// # Example
27446 /// ```ignore,no_run
27447 /// # use google_cloud_sql_v1::model::Settings;
27448 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
27449 /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
27450 /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
27451 /// ```
27452 pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
27453 where
27454 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
27455 {
27456 self.password_validation_policy = v.map(|x| x.into());
27457 self
27458 }
27459
27460 /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
27461 ///
27462 /// # Example
27463 /// ```ignore,no_run
27464 /// # use google_cloud_sql_v1::model::Settings;
27465 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
27466 /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
27467 /// ```
27468 pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
27469 where
27470 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
27471 {
27472 self.sql_server_audit_config = std::option::Option::Some(v.into());
27473 self
27474 }
27475
27476 /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
27477 ///
27478 /// # Example
27479 /// ```ignore,no_run
27480 /// # use google_cloud_sql_v1::model::Settings;
27481 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
27482 /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
27483 /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
27484 /// ```
27485 pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
27486 where
27487 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
27488 {
27489 self.sql_server_audit_config = v.map(|x| x.into());
27490 self
27491 }
27492
27493 /// Sets the value of [edition][crate::model::Settings::edition].
27494 ///
27495 /// # Example
27496 /// ```ignore,no_run
27497 /// # use google_cloud_sql_v1::model::Settings;
27498 /// use google_cloud_sql_v1::model::settings::Edition;
27499 /// let x0 = Settings::new().set_edition(Edition::Enterprise);
27500 /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
27501 /// let x2 = Settings::new().set_edition(Edition::Developer);
27502 /// ```
27503 pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
27504 mut self,
27505 v: T,
27506 ) -> Self {
27507 self.edition = v.into();
27508 self
27509 }
27510
27511 /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
27512 ///
27513 /// # Example
27514 /// ```ignore,no_run
27515 /// # use google_cloud_sql_v1::model::Settings;
27516 /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
27517 /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
27518 /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
27519 /// ```
27520 pub fn set_connector_enforcement<
27521 T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
27522 >(
27523 mut self,
27524 v: T,
27525 ) -> Self {
27526 self.connector_enforcement = v.into();
27527 self
27528 }
27529
27530 /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
27531 ///
27532 /// # Example
27533 /// ```ignore,no_run
27534 /// # use google_cloud_sql_v1::model::Settings;
27535 /// use wkt::BoolValue;
27536 /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
27537 /// ```
27538 pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
27539 where
27540 T: std::convert::Into<wkt::BoolValue>,
27541 {
27542 self.deletion_protection_enabled = std::option::Option::Some(v.into());
27543 self
27544 }
27545
27546 /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
27547 ///
27548 /// # Example
27549 /// ```ignore,no_run
27550 /// # use google_cloud_sql_v1::model::Settings;
27551 /// use wkt::BoolValue;
27552 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
27553 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
27554 /// ```
27555 pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27556 where
27557 T: std::convert::Into<wkt::BoolValue>,
27558 {
27559 self.deletion_protection_enabled = v.map(|x| x.into());
27560 self
27561 }
27562
27563 /// Sets the value of [time_zone][crate::model::Settings::time_zone].
27564 ///
27565 /// # Example
27566 /// ```ignore,no_run
27567 /// # use google_cloud_sql_v1::model::Settings;
27568 /// let x = Settings::new().set_time_zone("example");
27569 /// ```
27570 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27571 self.time_zone = v.into();
27572 self
27573 }
27574
27575 /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27576 ///
27577 /// # Example
27578 /// ```ignore,no_run
27579 /// # use google_cloud_sql_v1::model::Settings;
27580 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27581 /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
27582 /// ```
27583 pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
27584 where
27585 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27586 {
27587 self.advanced_machine_features = std::option::Option::Some(v.into());
27588 self
27589 }
27590
27591 /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
27592 ///
27593 /// # Example
27594 /// ```ignore,no_run
27595 /// # use google_cloud_sql_v1::model::Settings;
27596 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
27597 /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
27598 /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
27599 /// ```
27600 pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
27601 where
27602 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
27603 {
27604 self.advanced_machine_features = v.map(|x| x.into());
27605 self
27606 }
27607
27608 /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
27609 ///
27610 /// # Example
27611 /// ```ignore,no_run
27612 /// # use google_cloud_sql_v1::model::Settings;
27613 /// use google_cloud_sql_v1::model::DataCacheConfig;
27614 /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
27615 /// ```
27616 pub fn set_data_cache_config<T>(mut self, v: T) -> Self
27617 where
27618 T: std::convert::Into<crate::model::DataCacheConfig>,
27619 {
27620 self.data_cache_config = std::option::Option::Some(v.into());
27621 self
27622 }
27623
27624 /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
27625 ///
27626 /// # Example
27627 /// ```ignore,no_run
27628 /// # use google_cloud_sql_v1::model::Settings;
27629 /// use google_cloud_sql_v1::model::DataCacheConfig;
27630 /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
27631 /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
27632 /// ```
27633 pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
27634 where
27635 T: std::convert::Into<crate::model::DataCacheConfig>,
27636 {
27637 self.data_cache_config = v.map(|x| x.into());
27638 self
27639 }
27640
27641 /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27642 ///
27643 /// # Example
27644 /// ```ignore,no_run
27645 /// # use google_cloud_sql_v1::model::Settings;
27646 /// use wkt::Int32Value;
27647 /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
27648 /// ```
27649 pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
27650 where
27651 T: std::convert::Into<wkt::Int32Value>,
27652 {
27653 self.replication_lag_max_seconds = std::option::Option::Some(v.into());
27654 self
27655 }
27656
27657 /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
27658 ///
27659 /// # Example
27660 /// ```ignore,no_run
27661 /// # use google_cloud_sql_v1::model::Settings;
27662 /// use wkt::Int32Value;
27663 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
27664 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
27665 /// ```
27666 pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
27667 where
27668 T: std::convert::Into<wkt::Int32Value>,
27669 {
27670 self.replication_lag_max_seconds = v.map(|x| x.into());
27671 self
27672 }
27673
27674 /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27675 ///
27676 /// # Example
27677 /// ```ignore,no_run
27678 /// # use google_cloud_sql_v1::model::Settings;
27679 /// use wkt::BoolValue;
27680 /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
27681 /// ```
27682 pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
27683 where
27684 T: std::convert::Into<wkt::BoolValue>,
27685 {
27686 self.enable_google_ml_integration = std::option::Option::Some(v.into());
27687 self
27688 }
27689
27690 /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
27691 ///
27692 /// # Example
27693 /// ```ignore,no_run
27694 /// # use google_cloud_sql_v1::model::Settings;
27695 /// use wkt::BoolValue;
27696 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
27697 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
27698 /// ```
27699 pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
27700 where
27701 T: std::convert::Into<wkt::BoolValue>,
27702 {
27703 self.enable_google_ml_integration = v.map(|x| x.into());
27704 self
27705 }
27706
27707 /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27708 ///
27709 /// # Example
27710 /// ```ignore,no_run
27711 /// # use google_cloud_sql_v1::model::Settings;
27712 /// use wkt::BoolValue;
27713 /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
27714 /// ```
27715 pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
27716 where
27717 T: std::convert::Into<wkt::BoolValue>,
27718 {
27719 self.enable_dataplex_integration = std::option::Option::Some(v.into());
27720 self
27721 }
27722
27723 /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
27724 ///
27725 /// # Example
27726 /// ```ignore,no_run
27727 /// # use google_cloud_sql_v1::model::Settings;
27728 /// use wkt::BoolValue;
27729 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
27730 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
27731 /// ```
27732 pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
27733 where
27734 T: std::convert::Into<wkt::BoolValue>,
27735 {
27736 self.enable_dataplex_integration = v.map(|x| x.into());
27737 self
27738 }
27739
27740 /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27741 ///
27742 /// # Example
27743 /// ```ignore,no_run
27744 /// # use google_cloud_sql_v1::model::Settings;
27745 /// use wkt::BoolValue;
27746 /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
27747 /// ```
27748 pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
27749 where
27750 T: std::convert::Into<wkt::BoolValue>,
27751 {
27752 self.retain_backups_on_delete = std::option::Option::Some(v.into());
27753 self
27754 }
27755
27756 /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
27757 ///
27758 /// # Example
27759 /// ```ignore,no_run
27760 /// # use google_cloud_sql_v1::model::Settings;
27761 /// use wkt::BoolValue;
27762 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
27763 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
27764 /// ```
27765 pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
27766 where
27767 T: std::convert::Into<wkt::BoolValue>,
27768 {
27769 self.retain_backups_on_delete = v.map(|x| x.into());
27770 self
27771 }
27772
27773 /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27774 ///
27775 /// # Example
27776 /// ```ignore,no_run
27777 /// # use google_cloud_sql_v1::model::Settings;
27778 /// let x = Settings::new().set_data_disk_provisioned_iops(42);
27779 /// ```
27780 pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
27781 where
27782 T: std::convert::Into<i64>,
27783 {
27784 self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
27785 self
27786 }
27787
27788 /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
27789 ///
27790 /// # Example
27791 /// ```ignore,no_run
27792 /// # use google_cloud_sql_v1::model::Settings;
27793 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
27794 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
27795 /// ```
27796 pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
27797 where
27798 T: std::convert::Into<i64>,
27799 {
27800 self.data_disk_provisioned_iops = v.map(|x| x.into());
27801 self
27802 }
27803
27804 /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27805 ///
27806 /// # Example
27807 /// ```ignore,no_run
27808 /// # use google_cloud_sql_v1::model::Settings;
27809 /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
27810 /// ```
27811 pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
27812 where
27813 T: std::convert::Into<i64>,
27814 {
27815 self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
27816 self
27817 }
27818
27819 /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27820 ///
27821 /// # Example
27822 /// ```ignore,no_run
27823 /// # use google_cloud_sql_v1::model::Settings;
27824 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
27825 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
27826 /// ```
27827 pub fn set_or_clear_data_disk_provisioned_throughput<T>(
27828 mut self,
27829 v: std::option::Option<T>,
27830 ) -> Self
27831 where
27832 T: std::convert::Into<i64>,
27833 {
27834 self.data_disk_provisioned_throughput = v.map(|x| x.into());
27835 self
27836 }
27837
27838 /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27839 ///
27840 /// # Example
27841 /// ```ignore,no_run
27842 /// # use google_cloud_sql_v1::model::Settings;
27843 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27844 /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
27845 /// ```
27846 pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
27847 where
27848 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27849 {
27850 self.connection_pool_config = std::option::Option::Some(v.into());
27851 self
27852 }
27853
27854 /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27855 ///
27856 /// # Example
27857 /// ```ignore,no_run
27858 /// # use google_cloud_sql_v1::model::Settings;
27859 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27860 /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
27861 /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
27862 /// ```
27863 pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
27864 where
27865 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27866 {
27867 self.connection_pool_config = v.map(|x| x.into());
27868 self
27869 }
27870
27871 /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
27872 ///
27873 /// # Example
27874 /// ```ignore,no_run
27875 /// # use google_cloud_sql_v1::model::Settings;
27876 /// use google_cloud_sql_v1::model::FinalBackupConfig;
27877 /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
27878 /// ```
27879 pub fn set_final_backup_config<T>(mut self, v: T) -> Self
27880 where
27881 T: std::convert::Into<crate::model::FinalBackupConfig>,
27882 {
27883 self.final_backup_config = std::option::Option::Some(v.into());
27884 self
27885 }
27886
27887 /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
27888 ///
27889 /// # Example
27890 /// ```ignore,no_run
27891 /// # use google_cloud_sql_v1::model::Settings;
27892 /// use google_cloud_sql_v1::model::FinalBackupConfig;
27893 /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
27894 /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
27895 /// ```
27896 pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
27897 where
27898 T: std::convert::Into<crate::model::FinalBackupConfig>,
27899 {
27900 self.final_backup_config = v.map(|x| x.into());
27901 self
27902 }
27903
27904 /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27905 ///
27906 /// # Example
27907 /// ```ignore,no_run
27908 /// # use google_cloud_sql_v1::model::Settings;
27909 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27910 /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
27911 /// ```
27912 pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
27913 where
27914 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27915 {
27916 self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
27917 self
27918 }
27919
27920 /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27921 ///
27922 /// # Example
27923 /// ```ignore,no_run
27924 /// # use google_cloud_sql_v1::model::Settings;
27925 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27926 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
27927 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
27928 /// ```
27929 pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
27930 where
27931 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27932 {
27933 self.read_pool_auto_scale_config = v.map(|x| x.into());
27934 self
27935 }
27936
27937 /// Sets the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
27938 ///
27939 /// # Example
27940 /// ```ignore,no_run
27941 /// # use google_cloud_sql_v1::model::Settings;
27942 /// use wkt::BoolValue;
27943 /// let x = Settings::new().set_accelerated_replica_mode(BoolValue::default()/* use setters */);
27944 /// ```
27945 pub fn set_accelerated_replica_mode<T>(mut self, v: T) -> Self
27946 where
27947 T: std::convert::Into<wkt::BoolValue>,
27948 {
27949 self.accelerated_replica_mode = std::option::Option::Some(v.into());
27950 self
27951 }
27952
27953 /// Sets or clears the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
27954 ///
27955 /// # Example
27956 /// ```ignore,no_run
27957 /// # use google_cloud_sql_v1::model::Settings;
27958 /// use wkt::BoolValue;
27959 /// let x = Settings::new().set_or_clear_accelerated_replica_mode(Some(BoolValue::default()/* use setters */));
27960 /// let x = Settings::new().set_or_clear_accelerated_replica_mode(None::<BoolValue>);
27961 /// ```
27962 pub fn set_or_clear_accelerated_replica_mode<T>(mut self, v: std::option::Option<T>) -> Self
27963 where
27964 T: std::convert::Into<wkt::BoolValue>,
27965 {
27966 self.accelerated_replica_mode = v.map(|x| x.into());
27967 self
27968 }
27969
27970 /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27971 ///
27972 /// # Example
27973 /// ```ignore,no_run
27974 /// # use google_cloud_sql_v1::model::Settings;
27975 /// let x = Settings::new().set_auto_upgrade_enabled(true);
27976 /// ```
27977 pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
27978 where
27979 T: std::convert::Into<bool>,
27980 {
27981 self.auto_upgrade_enabled = std::option::Option::Some(v.into());
27982 self
27983 }
27984
27985 /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27986 ///
27987 /// # Example
27988 /// ```ignore,no_run
27989 /// # use google_cloud_sql_v1::model::Settings;
27990 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
27991 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
27992 /// ```
27993 pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27994 where
27995 T: std::convert::Into<bool>,
27996 {
27997 self.auto_upgrade_enabled = v.map(|x| x.into());
27998 self
27999 }
28000
28001 /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
28002 ///
28003 /// # Example
28004 /// ```ignore,no_run
28005 /// # use google_cloud_sql_v1::model::Settings;
28006 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
28007 /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
28008 /// ```
28009 pub fn set_entraid_config<T>(mut self, v: T) -> Self
28010 where
28011 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
28012 {
28013 self.entraid_config = std::option::Option::Some(v.into());
28014 self
28015 }
28016
28017 /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
28018 ///
28019 /// # Example
28020 /// ```ignore,no_run
28021 /// # use google_cloud_sql_v1::model::Settings;
28022 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
28023 /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
28024 /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
28025 /// ```
28026 pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
28027 where
28028 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
28029 {
28030 self.entraid_config = v.map(|x| x.into());
28031 self
28032 }
28033
28034 /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
28035 ///
28036 /// # Example
28037 /// ```ignore,no_run
28038 /// # use google_cloud_sql_v1::model::Settings;
28039 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
28040 /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
28041 /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
28042 /// ```
28043 pub fn set_data_api_access<T>(mut self, v: T) -> Self
28044 where
28045 T: std::convert::Into<crate::model::settings::DataApiAccess>,
28046 {
28047 self.data_api_access = std::option::Option::Some(v.into());
28048 self
28049 }
28050
28051 /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
28052 ///
28053 /// # Example
28054 /// ```ignore,no_run
28055 /// # use google_cloud_sql_v1::model::Settings;
28056 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
28057 /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
28058 /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
28059 /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
28060 /// ```
28061 pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
28062 where
28063 T: std::convert::Into<crate::model::settings::DataApiAccess>,
28064 {
28065 self.data_api_access = v.map(|x| x.into());
28066 self
28067 }
28068
28069 /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
28070 ///
28071 /// # Example
28072 /// ```ignore,no_run
28073 /// # use google_cloud_sql_v1::model::Settings;
28074 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28075 /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
28076 /// ```
28077 pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
28078 where
28079 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
28080 {
28081 self.performance_capture_config = std::option::Option::Some(v.into());
28082 self
28083 }
28084
28085 /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
28086 ///
28087 /// # Example
28088 /// ```ignore,no_run
28089 /// # use google_cloud_sql_v1::model::Settings;
28090 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28091 /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
28092 /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
28093 /// ```
28094 pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
28095 where
28096 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
28097 {
28098 self.performance_capture_config = v.map(|x| x.into());
28099 self
28100 }
28101}
28102
28103impl wkt::message::Message for Settings {
28104 fn typename() -> &'static str {
28105 "type.googleapis.com/google.cloud.sql.v1.Settings"
28106 }
28107}
28108
28109/// Defines additional types related to [Settings].
28110pub mod settings {
28111 #[allow(unused_imports)]
28112 use super::*;
28113
28114 /// Specifies when the instance is activated.
28115 ///
28116 /// # Working with unknown values
28117 ///
28118 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28119 /// additional enum variants at any time. Adding new variants is not considered
28120 /// a breaking change. Applications should write their code in anticipation of:
28121 ///
28122 /// - New values appearing in future releases of the client library, **and**
28123 /// - New values received dynamically, without application changes.
28124 ///
28125 /// Please consult the [Working with enums] section in the user guide for some
28126 /// guidelines.
28127 ///
28128 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28129 #[derive(Clone, Debug, PartialEq)]
28130 #[non_exhaustive]
28131 pub enum SqlActivationPolicy {
28132 /// Unknown activation plan.
28133 Unspecified,
28134 /// The instance is always up and running.
28135 Always,
28136 /// The instance never starts.
28137 Never,
28138 /// The instance starts upon receiving requests.
28139 #[deprecated]
28140 OnDemand,
28141 /// If set, the enum was initialized with an unknown value.
28142 ///
28143 /// Applications can examine the value using [SqlActivationPolicy::value] or
28144 /// [SqlActivationPolicy::name].
28145 UnknownValue(sql_activation_policy::UnknownValue),
28146 }
28147
28148 #[doc(hidden)]
28149 pub mod sql_activation_policy {
28150 #[allow(unused_imports)]
28151 use super::*;
28152 #[derive(Clone, Debug, PartialEq)]
28153 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28154 }
28155
28156 impl SqlActivationPolicy {
28157 /// Gets the enum value.
28158 ///
28159 /// Returns `None` if the enum contains an unknown value deserialized from
28160 /// the string representation of enums.
28161 pub fn value(&self) -> std::option::Option<i32> {
28162 match self {
28163 Self::Unspecified => std::option::Option::Some(0),
28164 Self::Always => std::option::Option::Some(1),
28165 Self::Never => std::option::Option::Some(2),
28166 Self::OnDemand => std::option::Option::Some(3),
28167 Self::UnknownValue(u) => u.0.value(),
28168 }
28169 }
28170
28171 /// Gets the enum value as a string.
28172 ///
28173 /// Returns `None` if the enum contains an unknown value deserialized from
28174 /// the integer representation of enums.
28175 pub fn name(&self) -> std::option::Option<&str> {
28176 match self {
28177 Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
28178 Self::Always => std::option::Option::Some("ALWAYS"),
28179 Self::Never => std::option::Option::Some("NEVER"),
28180 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
28181 Self::UnknownValue(u) => u.0.name(),
28182 }
28183 }
28184 }
28185
28186 impl std::default::Default for SqlActivationPolicy {
28187 fn default() -> Self {
28188 use std::convert::From;
28189 Self::from(0)
28190 }
28191 }
28192
28193 impl std::fmt::Display for SqlActivationPolicy {
28194 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28195 wkt::internal::display_enum(f, self.name(), self.value())
28196 }
28197 }
28198
28199 impl std::convert::From<i32> for SqlActivationPolicy {
28200 fn from(value: i32) -> Self {
28201 match value {
28202 0 => Self::Unspecified,
28203 1 => Self::Always,
28204 2 => Self::Never,
28205 3 => Self::OnDemand,
28206 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
28207 wkt::internal::UnknownEnumValue::Integer(value),
28208 )),
28209 }
28210 }
28211 }
28212
28213 impl std::convert::From<&str> for SqlActivationPolicy {
28214 fn from(value: &str) -> Self {
28215 use std::string::ToString;
28216 match value {
28217 "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
28218 "ALWAYS" => Self::Always,
28219 "NEVER" => Self::Never,
28220 "ON_DEMAND" => Self::OnDemand,
28221 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
28222 wkt::internal::UnknownEnumValue::String(value.to_string()),
28223 )),
28224 }
28225 }
28226 }
28227
28228 impl serde::ser::Serialize for SqlActivationPolicy {
28229 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28230 where
28231 S: serde::Serializer,
28232 {
28233 match self {
28234 Self::Unspecified => serializer.serialize_i32(0),
28235 Self::Always => serializer.serialize_i32(1),
28236 Self::Never => serializer.serialize_i32(2),
28237 Self::OnDemand => serializer.serialize_i32(3),
28238 Self::UnknownValue(u) => u.0.serialize(serializer),
28239 }
28240 }
28241 }
28242
28243 impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
28244 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28245 where
28246 D: serde::Deserializer<'de>,
28247 {
28248 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
28249 ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
28250 ))
28251 }
28252 }
28253
28254 /// The list of Cloud SQL editions available to users.
28255 ///
28256 /// # Working with unknown values
28257 ///
28258 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28259 /// additional enum variants at any time. Adding new variants is not considered
28260 /// a breaking change. Applications should write their code in anticipation of:
28261 ///
28262 /// - New values appearing in future releases of the client library, **and**
28263 /// - New values received dynamically, without application changes.
28264 ///
28265 /// Please consult the [Working with enums] section in the user guide for some
28266 /// guidelines.
28267 ///
28268 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28269 #[derive(Clone, Debug, PartialEq)]
28270 #[non_exhaustive]
28271 pub enum Edition {
28272 /// The instance did not specify the edition.
28273 Unspecified,
28274 /// The instance is an enterprise edition.
28275 Enterprise,
28276 /// The instance is an Enterprise Plus edition.
28277 EnterprisePlus,
28278 /// This instance is a Cloud SQL developer edition instance.
28279 Developer,
28280 /// If set, the enum was initialized with an unknown value.
28281 ///
28282 /// Applications can examine the value using [Edition::value] or
28283 /// [Edition::name].
28284 UnknownValue(edition::UnknownValue),
28285 }
28286
28287 #[doc(hidden)]
28288 pub mod edition {
28289 #[allow(unused_imports)]
28290 use super::*;
28291 #[derive(Clone, Debug, PartialEq)]
28292 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28293 }
28294
28295 impl Edition {
28296 /// Gets the enum value.
28297 ///
28298 /// Returns `None` if the enum contains an unknown value deserialized from
28299 /// the string representation of enums.
28300 pub fn value(&self) -> std::option::Option<i32> {
28301 match self {
28302 Self::Unspecified => std::option::Option::Some(0),
28303 Self::Enterprise => std::option::Option::Some(2),
28304 Self::EnterprisePlus => std::option::Option::Some(3),
28305 Self::Developer => std::option::Option::Some(5),
28306 Self::UnknownValue(u) => u.0.value(),
28307 }
28308 }
28309
28310 /// Gets the enum value as a string.
28311 ///
28312 /// Returns `None` if the enum contains an unknown value deserialized from
28313 /// the integer representation of enums.
28314 pub fn name(&self) -> std::option::Option<&str> {
28315 match self {
28316 Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
28317 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
28318 Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
28319 Self::Developer => std::option::Option::Some("DEVELOPER"),
28320 Self::UnknownValue(u) => u.0.name(),
28321 }
28322 }
28323 }
28324
28325 impl std::default::Default for Edition {
28326 fn default() -> Self {
28327 use std::convert::From;
28328 Self::from(0)
28329 }
28330 }
28331
28332 impl std::fmt::Display for Edition {
28333 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28334 wkt::internal::display_enum(f, self.name(), self.value())
28335 }
28336 }
28337
28338 impl std::convert::From<i32> for Edition {
28339 fn from(value: i32) -> Self {
28340 match value {
28341 0 => Self::Unspecified,
28342 2 => Self::Enterprise,
28343 3 => Self::EnterprisePlus,
28344 5 => Self::Developer,
28345 _ => Self::UnknownValue(edition::UnknownValue(
28346 wkt::internal::UnknownEnumValue::Integer(value),
28347 )),
28348 }
28349 }
28350 }
28351
28352 impl std::convert::From<&str> for Edition {
28353 fn from(value: &str) -> Self {
28354 use std::string::ToString;
28355 match value {
28356 "EDITION_UNSPECIFIED" => Self::Unspecified,
28357 "ENTERPRISE" => Self::Enterprise,
28358 "ENTERPRISE_PLUS" => Self::EnterprisePlus,
28359 "DEVELOPER" => Self::Developer,
28360 _ => Self::UnknownValue(edition::UnknownValue(
28361 wkt::internal::UnknownEnumValue::String(value.to_string()),
28362 )),
28363 }
28364 }
28365 }
28366
28367 impl serde::ser::Serialize for Edition {
28368 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28369 where
28370 S: serde::Serializer,
28371 {
28372 match self {
28373 Self::Unspecified => serializer.serialize_i32(0),
28374 Self::Enterprise => serializer.serialize_i32(2),
28375 Self::EnterprisePlus => serializer.serialize_i32(3),
28376 Self::Developer => serializer.serialize_i32(5),
28377 Self::UnknownValue(u) => u.0.serialize(serializer),
28378 }
28379 }
28380 }
28381
28382 impl<'de> serde::de::Deserialize<'de> for Edition {
28383 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28384 where
28385 D: serde::Deserializer<'de>,
28386 {
28387 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
28388 ".google.cloud.sql.v1.Settings.Edition",
28389 ))
28390 }
28391 }
28392
28393 /// The options for enforcing Cloud SQL connectors in the instance.
28394 ///
28395 /// # Working with unknown values
28396 ///
28397 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28398 /// additional enum variants at any time. Adding new variants is not considered
28399 /// a breaking change. Applications should write their code in anticipation of:
28400 ///
28401 /// - New values appearing in future releases of the client library, **and**
28402 /// - New values received dynamically, without application changes.
28403 ///
28404 /// Please consult the [Working with enums] section in the user guide for some
28405 /// guidelines.
28406 ///
28407 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28408 #[derive(Clone, Debug, PartialEq)]
28409 #[non_exhaustive]
28410 pub enum ConnectorEnforcement {
28411 /// The requirement for Cloud SQL connectors is unknown.
28412 Unspecified,
28413 /// Do not require Cloud SQL connectors.
28414 NotRequired,
28415 /// Require all connections to use Cloud SQL connectors, including the
28416 /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
28417 /// Note: This disables all existing authorized networks.
28418 Required,
28419 /// If set, the enum was initialized with an unknown value.
28420 ///
28421 /// Applications can examine the value using [ConnectorEnforcement::value] or
28422 /// [ConnectorEnforcement::name].
28423 UnknownValue(connector_enforcement::UnknownValue),
28424 }
28425
28426 #[doc(hidden)]
28427 pub mod connector_enforcement {
28428 #[allow(unused_imports)]
28429 use super::*;
28430 #[derive(Clone, Debug, PartialEq)]
28431 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28432 }
28433
28434 impl ConnectorEnforcement {
28435 /// Gets the enum value.
28436 ///
28437 /// Returns `None` if the enum contains an unknown value deserialized from
28438 /// the string representation of enums.
28439 pub fn value(&self) -> std::option::Option<i32> {
28440 match self {
28441 Self::Unspecified => std::option::Option::Some(0),
28442 Self::NotRequired => std::option::Option::Some(1),
28443 Self::Required => std::option::Option::Some(2),
28444 Self::UnknownValue(u) => u.0.value(),
28445 }
28446 }
28447
28448 /// Gets the enum value as a string.
28449 ///
28450 /// Returns `None` if the enum contains an unknown value deserialized from
28451 /// the integer representation of enums.
28452 pub fn name(&self) -> std::option::Option<&str> {
28453 match self {
28454 Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
28455 Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
28456 Self::Required => std::option::Option::Some("REQUIRED"),
28457 Self::UnknownValue(u) => u.0.name(),
28458 }
28459 }
28460 }
28461
28462 impl std::default::Default for ConnectorEnforcement {
28463 fn default() -> Self {
28464 use std::convert::From;
28465 Self::from(0)
28466 }
28467 }
28468
28469 impl std::fmt::Display for ConnectorEnforcement {
28470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28471 wkt::internal::display_enum(f, self.name(), self.value())
28472 }
28473 }
28474
28475 impl std::convert::From<i32> for ConnectorEnforcement {
28476 fn from(value: i32) -> Self {
28477 match value {
28478 0 => Self::Unspecified,
28479 1 => Self::NotRequired,
28480 2 => Self::Required,
28481 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
28482 wkt::internal::UnknownEnumValue::Integer(value),
28483 )),
28484 }
28485 }
28486 }
28487
28488 impl std::convert::From<&str> for ConnectorEnforcement {
28489 fn from(value: &str) -> Self {
28490 use std::string::ToString;
28491 match value {
28492 "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
28493 "NOT_REQUIRED" => Self::NotRequired,
28494 "REQUIRED" => Self::Required,
28495 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
28496 wkt::internal::UnknownEnumValue::String(value.to_string()),
28497 )),
28498 }
28499 }
28500 }
28501
28502 impl serde::ser::Serialize for ConnectorEnforcement {
28503 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28504 where
28505 S: serde::Serializer,
28506 {
28507 match self {
28508 Self::Unspecified => serializer.serialize_i32(0),
28509 Self::NotRequired => serializer.serialize_i32(1),
28510 Self::Required => serializer.serialize_i32(2),
28511 Self::UnknownValue(u) => u.0.serialize(serializer),
28512 }
28513 }
28514 }
28515
28516 impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
28517 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28518 where
28519 D: serde::Deserializer<'de>,
28520 {
28521 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
28522 ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
28523 ))
28524 }
28525 }
28526
28527 /// ExecuteSql API's access to the instance.
28528 ///
28529 /// # Working with unknown values
28530 ///
28531 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
28532 /// additional enum variants at any time. Adding new variants is not considered
28533 /// a breaking change. Applications should write their code in anticipation of:
28534 ///
28535 /// - New values appearing in future releases of the client library, **and**
28536 /// - New values received dynamically, without application changes.
28537 ///
28538 /// Please consult the [Working with enums] section in the user guide for some
28539 /// guidelines.
28540 ///
28541 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
28542 #[derive(Clone, Debug, PartialEq)]
28543 #[non_exhaustive]
28544 pub enum DataApiAccess {
28545 /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
28546 Unspecified,
28547 /// Disallow using ExecuteSql API to connect to the instance.
28548 DisallowDataApi,
28549 /// Allow using ExecuteSql API to connect to the instance. For private IP
28550 /// instances, this allows authorized users to access the instance from
28551 /// the public internet using ExecuteSql API.
28552 AllowDataApi,
28553 /// If set, the enum was initialized with an unknown value.
28554 ///
28555 /// Applications can examine the value using [DataApiAccess::value] or
28556 /// [DataApiAccess::name].
28557 UnknownValue(data_api_access::UnknownValue),
28558 }
28559
28560 #[doc(hidden)]
28561 pub mod data_api_access {
28562 #[allow(unused_imports)]
28563 use super::*;
28564 #[derive(Clone, Debug, PartialEq)]
28565 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
28566 }
28567
28568 impl DataApiAccess {
28569 /// Gets the enum value.
28570 ///
28571 /// Returns `None` if the enum contains an unknown value deserialized from
28572 /// the string representation of enums.
28573 pub fn value(&self) -> std::option::Option<i32> {
28574 match self {
28575 Self::Unspecified => std::option::Option::Some(0),
28576 Self::DisallowDataApi => std::option::Option::Some(1),
28577 Self::AllowDataApi => std::option::Option::Some(2),
28578 Self::UnknownValue(u) => u.0.value(),
28579 }
28580 }
28581
28582 /// Gets the enum value as a string.
28583 ///
28584 /// Returns `None` if the enum contains an unknown value deserialized from
28585 /// the integer representation of enums.
28586 pub fn name(&self) -> std::option::Option<&str> {
28587 match self {
28588 Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
28589 Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
28590 Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
28591 Self::UnknownValue(u) => u.0.name(),
28592 }
28593 }
28594 }
28595
28596 impl std::default::Default for DataApiAccess {
28597 fn default() -> Self {
28598 use std::convert::From;
28599 Self::from(0)
28600 }
28601 }
28602
28603 impl std::fmt::Display for DataApiAccess {
28604 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
28605 wkt::internal::display_enum(f, self.name(), self.value())
28606 }
28607 }
28608
28609 impl std::convert::From<i32> for DataApiAccess {
28610 fn from(value: i32) -> Self {
28611 match value {
28612 0 => Self::Unspecified,
28613 1 => Self::DisallowDataApi,
28614 2 => Self::AllowDataApi,
28615 _ => Self::UnknownValue(data_api_access::UnknownValue(
28616 wkt::internal::UnknownEnumValue::Integer(value),
28617 )),
28618 }
28619 }
28620 }
28621
28622 impl std::convert::From<&str> for DataApiAccess {
28623 fn from(value: &str) -> Self {
28624 use std::string::ToString;
28625 match value {
28626 "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
28627 "DISALLOW_DATA_API" => Self::DisallowDataApi,
28628 "ALLOW_DATA_API" => Self::AllowDataApi,
28629 _ => Self::UnknownValue(data_api_access::UnknownValue(
28630 wkt::internal::UnknownEnumValue::String(value.to_string()),
28631 )),
28632 }
28633 }
28634 }
28635
28636 impl serde::ser::Serialize for DataApiAccess {
28637 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
28638 where
28639 S: serde::Serializer,
28640 {
28641 match self {
28642 Self::Unspecified => serializer.serialize_i32(0),
28643 Self::DisallowDataApi => serializer.serialize_i32(1),
28644 Self::AllowDataApi => serializer.serialize_i32(2),
28645 Self::UnknownValue(u) => u.0.serialize(serializer),
28646 }
28647 }
28648 }
28649
28650 impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
28651 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
28652 where
28653 D: serde::Deserializer<'de>,
28654 {
28655 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
28656 ".google.cloud.sql.v1.Settings.DataApiAccess",
28657 ))
28658 }
28659 }
28660}
28661
28662/// Performance capture configuration.
28663#[derive(Clone, Default, PartialEq)]
28664#[non_exhaustive]
28665pub struct PerformanceCaptureConfig {
28666 /// Optional. Enables or disables the performance capture feature.
28667 pub enabled: std::option::Option<bool>,
28668
28669 /// Optional. Specifies the interval in seconds between consecutive probes that
28670 /// check if any trigger condition thresholds have been reached.
28671 pub probing_interval_seconds: std::option::Option<i32>,
28672
28673 /// Optional. Specifies the minimum number of consecutive probe threshold that
28674 /// triggers performance capture.
28675 pub probe_threshold: std::option::Option<i32>,
28676
28677 /// Optional. Specifies the minimum number of MySQL `Threads_running` to
28678 /// trigger the performance capture on the primary instance.
28679 pub running_threads_threshold: std::option::Option<i32>,
28680
28681 /// Optional. Specifies the minimum number of seconds replica must be lagging
28682 /// behind primary instance to trigger the performance capture on replica.
28683 pub seconds_behind_source_threshold: std::option::Option<i32>,
28684
28685 /// Optional. Specifies the amount of time in seconds that a transaction needs
28686 /// to have been open before the watcher starts recording it.
28687 pub transaction_duration_threshold: std::option::Option<i32>,
28688
28689 /// Optional. Specifies the minimum percentage of CPU utilization to trigger
28690 /// the performance capture. Valid integers range from `10` to `99`. Enter `0`
28691 /// to disable the check.
28692 pub cpu_utilization_threshold_percent: std::option::Option<i32>,
28693
28694 /// Optional. Specifies the minimum percentage of memory usage to trigger the
28695 /// performance capture.
28696 /// Valid integers range from `10` to `99`. Enter `0` to disable the check.
28697 pub memory_usage_threshold_percent: std::option::Option<i32>,
28698
28699 /// Optional. Specifies the minimum allowed number of transactions in lock wait
28700 /// state to trigger the performance capture. Valid integers range from `10` to
28701 /// `10000`. Enter `0` to disable the check.
28702 pub transaction_lock_wait_threshold_count: std::option::Option<i32>,
28703
28704 /// Optional. Specifies the minimum allowed number of semaphore waits to
28705 /// trigger the performance capture. Valid integers range from `10` to `10000`.
28706 /// Enter `0` to disable the check.
28707 pub semaphore_wait_threshold_count: std::option::Option<i32>,
28708
28709 /// Optional. Specifies the minimum number of undo log entries in the history
28710 /// list length to trigger the performance capture. Valid integers range from
28711 /// `10000` to `10000000`. Enter `0` to disable the check.
28712 pub history_list_length_threshold_count: std::option::Option<i32>,
28713
28714 /// Optional. Specifies the amount of time in seconds that a transaction needs
28715 /// to have been open before the watcher starts terminating it. Valid integers
28716 /// range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
28717 /// (i.e., > 0), this value must be greater than or equal to
28718 /// `transaction_duration_threshold`. Configurations where
28719 /// `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
28720 /// will be rejected.
28721 pub transaction_kill_threshold_seconds: std::option::Option<i32>,
28722
28723 /// Optional. Specifies a customer-defined list of users to exclude from
28724 /// transaction termination. Entries can be in the format 'user@host' or just
28725 /// 'user'. A standalone 'user' implies 'user@%', excluding the user from any
28726 /// host. Wildcard '%' is allowed in the host part of the 'user@host' format.
28727 /// Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
28728 pub transaction_kill_excluded_user_hosts: std::vec::Vec<std::string::String>,
28729
28730 /// Optional. Determines which transactions are allowed to be terminated when
28731 /// they exceed `transaction_kill_threshold_seconds`. This allows protecting
28732 /// write-heavy transactions from auto-termination if desired. Defaults to
28733 /// `READ_ONLY_TRANSACTIONS` if unspecified.
28734 pub transaction_kill_type:
28735 std::option::Option<crate::model::performance_capture_config::TransactionKillType>,
28736
28737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28738}
28739
28740impl PerformanceCaptureConfig {
28741 /// Creates a new default instance.
28742 pub fn new() -> Self {
28743 std::default::Default::default()
28744 }
28745
28746 /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28747 ///
28748 /// # Example
28749 /// ```ignore,no_run
28750 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28751 /// let x = PerformanceCaptureConfig::new().set_enabled(true);
28752 /// ```
28753 pub fn set_enabled<T>(mut self, v: T) -> Self
28754 where
28755 T: std::convert::Into<bool>,
28756 {
28757 self.enabled = std::option::Option::Some(v.into());
28758 self
28759 }
28760
28761 /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
28762 ///
28763 /// # Example
28764 /// ```ignore,no_run
28765 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28766 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
28767 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
28768 /// ```
28769 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28770 where
28771 T: std::convert::Into<bool>,
28772 {
28773 self.enabled = v.map(|x| x.into());
28774 self
28775 }
28776
28777 /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28778 ///
28779 /// # Example
28780 /// ```ignore,no_run
28781 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28782 /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
28783 /// ```
28784 pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
28785 where
28786 T: std::convert::Into<i32>,
28787 {
28788 self.probing_interval_seconds = std::option::Option::Some(v.into());
28789 self
28790 }
28791
28792 /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
28793 ///
28794 /// # Example
28795 /// ```ignore,no_run
28796 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28797 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
28798 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
28799 /// ```
28800 pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28801 where
28802 T: std::convert::Into<i32>,
28803 {
28804 self.probing_interval_seconds = v.map(|x| x.into());
28805 self
28806 }
28807
28808 /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28809 ///
28810 /// # Example
28811 /// ```ignore,no_run
28812 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28813 /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
28814 /// ```
28815 pub fn set_probe_threshold<T>(mut self, v: T) -> Self
28816 where
28817 T: std::convert::Into<i32>,
28818 {
28819 self.probe_threshold = std::option::Option::Some(v.into());
28820 self
28821 }
28822
28823 /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
28824 ///
28825 /// # Example
28826 /// ```ignore,no_run
28827 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28828 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
28829 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
28830 /// ```
28831 pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
28832 where
28833 T: std::convert::Into<i32>,
28834 {
28835 self.probe_threshold = v.map(|x| x.into());
28836 self
28837 }
28838
28839 /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
28840 ///
28841 /// # Example
28842 /// ```ignore,no_run
28843 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28844 /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
28845 /// ```
28846 pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
28847 where
28848 T: std::convert::Into<i32>,
28849 {
28850 self.running_threads_threshold = std::option::Option::Some(v.into());
28851 self
28852 }
28853
28854 /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
28855 ///
28856 /// # Example
28857 /// ```ignore,no_run
28858 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28859 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
28860 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
28861 /// ```
28862 pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
28863 where
28864 T: std::convert::Into<i32>,
28865 {
28866 self.running_threads_threshold = v.map(|x| x.into());
28867 self
28868 }
28869
28870 /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28871 ///
28872 /// # Example
28873 /// ```ignore,no_run
28874 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28875 /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
28876 /// ```
28877 pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
28878 where
28879 T: std::convert::Into<i32>,
28880 {
28881 self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
28882 self
28883 }
28884
28885 /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28886 ///
28887 /// # Example
28888 /// ```ignore,no_run
28889 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28890 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
28891 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
28892 /// ```
28893 pub fn set_or_clear_seconds_behind_source_threshold<T>(
28894 mut self,
28895 v: std::option::Option<T>,
28896 ) -> Self
28897 where
28898 T: std::convert::Into<i32>,
28899 {
28900 self.seconds_behind_source_threshold = v.map(|x| x.into());
28901 self
28902 }
28903
28904 /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28905 ///
28906 /// # Example
28907 /// ```ignore,no_run
28908 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28909 /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
28910 /// ```
28911 pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
28912 where
28913 T: std::convert::Into<i32>,
28914 {
28915 self.transaction_duration_threshold = std::option::Option::Some(v.into());
28916 self
28917 }
28918
28919 /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28920 ///
28921 /// # Example
28922 /// ```ignore,no_run
28923 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28924 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
28925 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
28926 /// ```
28927 pub fn set_or_clear_transaction_duration_threshold<T>(
28928 mut self,
28929 v: std::option::Option<T>,
28930 ) -> Self
28931 where
28932 T: std::convert::Into<i32>,
28933 {
28934 self.transaction_duration_threshold = v.map(|x| x.into());
28935 self
28936 }
28937
28938 /// Sets the value of [cpu_utilization_threshold_percent][crate::model::PerformanceCaptureConfig::cpu_utilization_threshold_percent].
28939 ///
28940 /// # Example
28941 /// ```ignore,no_run
28942 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28943 /// let x = PerformanceCaptureConfig::new().set_cpu_utilization_threshold_percent(42);
28944 /// ```
28945 pub fn set_cpu_utilization_threshold_percent<T>(mut self, v: T) -> Self
28946 where
28947 T: std::convert::Into<i32>,
28948 {
28949 self.cpu_utilization_threshold_percent = std::option::Option::Some(v.into());
28950 self
28951 }
28952
28953 /// Sets or clears the value of [cpu_utilization_threshold_percent][crate::model::PerformanceCaptureConfig::cpu_utilization_threshold_percent].
28954 ///
28955 /// # Example
28956 /// ```ignore,no_run
28957 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28958 /// let x = PerformanceCaptureConfig::new().set_or_clear_cpu_utilization_threshold_percent(Some(42));
28959 /// let x = PerformanceCaptureConfig::new().set_or_clear_cpu_utilization_threshold_percent(None::<i32>);
28960 /// ```
28961 pub fn set_or_clear_cpu_utilization_threshold_percent<T>(
28962 mut self,
28963 v: std::option::Option<T>,
28964 ) -> Self
28965 where
28966 T: std::convert::Into<i32>,
28967 {
28968 self.cpu_utilization_threshold_percent = v.map(|x| x.into());
28969 self
28970 }
28971
28972 /// Sets the value of [memory_usage_threshold_percent][crate::model::PerformanceCaptureConfig::memory_usage_threshold_percent].
28973 ///
28974 /// # Example
28975 /// ```ignore,no_run
28976 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28977 /// let x = PerformanceCaptureConfig::new().set_memory_usage_threshold_percent(42);
28978 /// ```
28979 pub fn set_memory_usage_threshold_percent<T>(mut self, v: T) -> Self
28980 where
28981 T: std::convert::Into<i32>,
28982 {
28983 self.memory_usage_threshold_percent = std::option::Option::Some(v.into());
28984 self
28985 }
28986
28987 /// Sets or clears the value of [memory_usage_threshold_percent][crate::model::PerformanceCaptureConfig::memory_usage_threshold_percent].
28988 ///
28989 /// # Example
28990 /// ```ignore,no_run
28991 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28992 /// let x = PerformanceCaptureConfig::new().set_or_clear_memory_usage_threshold_percent(Some(42));
28993 /// let x = PerformanceCaptureConfig::new().set_or_clear_memory_usage_threshold_percent(None::<i32>);
28994 /// ```
28995 pub fn set_or_clear_memory_usage_threshold_percent<T>(
28996 mut self,
28997 v: std::option::Option<T>,
28998 ) -> Self
28999 where
29000 T: std::convert::Into<i32>,
29001 {
29002 self.memory_usage_threshold_percent = v.map(|x| x.into());
29003 self
29004 }
29005
29006 /// Sets the value of [transaction_lock_wait_threshold_count][crate::model::PerformanceCaptureConfig::transaction_lock_wait_threshold_count].
29007 ///
29008 /// # Example
29009 /// ```ignore,no_run
29010 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29011 /// let x = PerformanceCaptureConfig::new().set_transaction_lock_wait_threshold_count(42);
29012 /// ```
29013 pub fn set_transaction_lock_wait_threshold_count<T>(mut self, v: T) -> Self
29014 where
29015 T: std::convert::Into<i32>,
29016 {
29017 self.transaction_lock_wait_threshold_count = std::option::Option::Some(v.into());
29018 self
29019 }
29020
29021 /// Sets or clears the value of [transaction_lock_wait_threshold_count][crate::model::PerformanceCaptureConfig::transaction_lock_wait_threshold_count].
29022 ///
29023 /// # Example
29024 /// ```ignore,no_run
29025 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29026 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_lock_wait_threshold_count(Some(42));
29027 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_lock_wait_threshold_count(None::<i32>);
29028 /// ```
29029 pub fn set_or_clear_transaction_lock_wait_threshold_count<T>(
29030 mut self,
29031 v: std::option::Option<T>,
29032 ) -> Self
29033 where
29034 T: std::convert::Into<i32>,
29035 {
29036 self.transaction_lock_wait_threshold_count = v.map(|x| x.into());
29037 self
29038 }
29039
29040 /// Sets the value of [semaphore_wait_threshold_count][crate::model::PerformanceCaptureConfig::semaphore_wait_threshold_count].
29041 ///
29042 /// # Example
29043 /// ```ignore,no_run
29044 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29045 /// let x = PerformanceCaptureConfig::new().set_semaphore_wait_threshold_count(42);
29046 /// ```
29047 pub fn set_semaphore_wait_threshold_count<T>(mut self, v: T) -> Self
29048 where
29049 T: std::convert::Into<i32>,
29050 {
29051 self.semaphore_wait_threshold_count = std::option::Option::Some(v.into());
29052 self
29053 }
29054
29055 /// Sets or clears the value of [semaphore_wait_threshold_count][crate::model::PerformanceCaptureConfig::semaphore_wait_threshold_count].
29056 ///
29057 /// # Example
29058 /// ```ignore,no_run
29059 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29060 /// let x = PerformanceCaptureConfig::new().set_or_clear_semaphore_wait_threshold_count(Some(42));
29061 /// let x = PerformanceCaptureConfig::new().set_or_clear_semaphore_wait_threshold_count(None::<i32>);
29062 /// ```
29063 pub fn set_or_clear_semaphore_wait_threshold_count<T>(
29064 mut self,
29065 v: std::option::Option<T>,
29066 ) -> Self
29067 where
29068 T: std::convert::Into<i32>,
29069 {
29070 self.semaphore_wait_threshold_count = v.map(|x| x.into());
29071 self
29072 }
29073
29074 /// Sets the value of [history_list_length_threshold_count][crate::model::PerformanceCaptureConfig::history_list_length_threshold_count].
29075 ///
29076 /// # Example
29077 /// ```ignore,no_run
29078 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29079 /// let x = PerformanceCaptureConfig::new().set_history_list_length_threshold_count(42);
29080 /// ```
29081 pub fn set_history_list_length_threshold_count<T>(mut self, v: T) -> Self
29082 where
29083 T: std::convert::Into<i32>,
29084 {
29085 self.history_list_length_threshold_count = std::option::Option::Some(v.into());
29086 self
29087 }
29088
29089 /// Sets or clears the value of [history_list_length_threshold_count][crate::model::PerformanceCaptureConfig::history_list_length_threshold_count].
29090 ///
29091 /// # Example
29092 /// ```ignore,no_run
29093 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29094 /// let x = PerformanceCaptureConfig::new().set_or_clear_history_list_length_threshold_count(Some(42));
29095 /// let x = PerformanceCaptureConfig::new().set_or_clear_history_list_length_threshold_count(None::<i32>);
29096 /// ```
29097 pub fn set_or_clear_history_list_length_threshold_count<T>(
29098 mut self,
29099 v: std::option::Option<T>,
29100 ) -> Self
29101 where
29102 T: std::convert::Into<i32>,
29103 {
29104 self.history_list_length_threshold_count = v.map(|x| x.into());
29105 self
29106 }
29107
29108 /// Sets the value of [transaction_kill_threshold_seconds][crate::model::PerformanceCaptureConfig::transaction_kill_threshold_seconds].
29109 ///
29110 /// # Example
29111 /// ```ignore,no_run
29112 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29113 /// let x = PerformanceCaptureConfig::new().set_transaction_kill_threshold_seconds(42);
29114 /// ```
29115 pub fn set_transaction_kill_threshold_seconds<T>(mut self, v: T) -> Self
29116 where
29117 T: std::convert::Into<i32>,
29118 {
29119 self.transaction_kill_threshold_seconds = std::option::Option::Some(v.into());
29120 self
29121 }
29122
29123 /// Sets or clears the value of [transaction_kill_threshold_seconds][crate::model::PerformanceCaptureConfig::transaction_kill_threshold_seconds].
29124 ///
29125 /// # Example
29126 /// ```ignore,no_run
29127 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29128 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_threshold_seconds(Some(42));
29129 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_threshold_seconds(None::<i32>);
29130 /// ```
29131 pub fn set_or_clear_transaction_kill_threshold_seconds<T>(
29132 mut self,
29133 v: std::option::Option<T>,
29134 ) -> Self
29135 where
29136 T: std::convert::Into<i32>,
29137 {
29138 self.transaction_kill_threshold_seconds = v.map(|x| x.into());
29139 self
29140 }
29141
29142 /// Sets the value of [transaction_kill_excluded_user_hosts][crate::model::PerformanceCaptureConfig::transaction_kill_excluded_user_hosts].
29143 ///
29144 /// # Example
29145 /// ```ignore,no_run
29146 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29147 /// let x = PerformanceCaptureConfig::new().set_transaction_kill_excluded_user_hosts(["a", "b", "c"]);
29148 /// ```
29149 pub fn set_transaction_kill_excluded_user_hosts<T, V>(mut self, v: T) -> Self
29150 where
29151 T: std::iter::IntoIterator<Item = V>,
29152 V: std::convert::Into<std::string::String>,
29153 {
29154 use std::iter::Iterator;
29155 self.transaction_kill_excluded_user_hosts = v.into_iter().map(|i| i.into()).collect();
29156 self
29157 }
29158
29159 /// Sets the value of [transaction_kill_type][crate::model::PerformanceCaptureConfig::transaction_kill_type].
29160 ///
29161 /// # Example
29162 /// ```ignore,no_run
29163 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29164 /// use google_cloud_sql_v1::model::performance_capture_config::TransactionKillType;
29165 /// let x0 = PerformanceCaptureConfig::new().set_transaction_kill_type(TransactionKillType::ReadOnlyTransactions);
29166 /// let x1 = PerformanceCaptureConfig::new().set_transaction_kill_type(TransactionKillType::AllTransactions);
29167 /// ```
29168 pub fn set_transaction_kill_type<T>(mut self, v: T) -> Self
29169 where
29170 T: std::convert::Into<crate::model::performance_capture_config::TransactionKillType>,
29171 {
29172 self.transaction_kill_type = std::option::Option::Some(v.into());
29173 self
29174 }
29175
29176 /// Sets or clears the value of [transaction_kill_type][crate::model::PerformanceCaptureConfig::transaction_kill_type].
29177 ///
29178 /// # Example
29179 /// ```ignore,no_run
29180 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29181 /// use google_cloud_sql_v1::model::performance_capture_config::TransactionKillType;
29182 /// let x0 = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(Some(TransactionKillType::ReadOnlyTransactions));
29183 /// let x1 = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(Some(TransactionKillType::AllTransactions));
29184 /// let x_none = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(None::<TransactionKillType>);
29185 /// ```
29186 pub fn set_or_clear_transaction_kill_type<T>(mut self, v: std::option::Option<T>) -> Self
29187 where
29188 T: std::convert::Into<crate::model::performance_capture_config::TransactionKillType>,
29189 {
29190 self.transaction_kill_type = v.map(|x| x.into());
29191 self
29192 }
29193}
29194
29195impl wkt::message::Message for PerformanceCaptureConfig {
29196 fn typename() -> &'static str {
29197 "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
29198 }
29199}
29200
29201/// Defines additional types related to [PerformanceCaptureConfig].
29202pub mod performance_capture_config {
29203 #[allow(unused_imports)]
29204 use super::*;
29205
29206 /// Defines the categories of long-running transactions eligible for automatic
29207 /// termination by the Performance Capture.
29208 ///
29209 /// # Working with unknown values
29210 ///
29211 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29212 /// additional enum variants at any time. Adding new variants is not considered
29213 /// a breaking change. Applications should write their code in anticipation of:
29214 ///
29215 /// - New values appearing in future releases of the client library, **and**
29216 /// - New values received dynamically, without application changes.
29217 ///
29218 /// Please consult the [Working with enums] section in the user guide for some
29219 /// guidelines.
29220 ///
29221 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29222 #[derive(Clone, Debug, PartialEq)]
29223 #[non_exhaustive]
29224 pub enum TransactionKillType {
29225 /// Unspecified.
29226 Unspecified,
29227 /// Only read-only transactions are eligible for termination.
29228 ReadOnlyTransactions,
29229 /// All transactions are eligible for termination, including those with write
29230 /// operations (such as INSERT, UPDATE, DELETE, or DDL).
29231 AllTransactions,
29232 /// If set, the enum was initialized with an unknown value.
29233 ///
29234 /// Applications can examine the value using [TransactionKillType::value] or
29235 /// [TransactionKillType::name].
29236 UnknownValue(transaction_kill_type::UnknownValue),
29237 }
29238
29239 #[doc(hidden)]
29240 pub mod transaction_kill_type {
29241 #[allow(unused_imports)]
29242 use super::*;
29243 #[derive(Clone, Debug, PartialEq)]
29244 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29245 }
29246
29247 impl TransactionKillType {
29248 /// Gets the enum value.
29249 ///
29250 /// Returns `None` if the enum contains an unknown value deserialized from
29251 /// the string representation of enums.
29252 pub fn value(&self) -> std::option::Option<i32> {
29253 match self {
29254 Self::Unspecified => std::option::Option::Some(0),
29255 Self::ReadOnlyTransactions => std::option::Option::Some(1),
29256 Self::AllTransactions => std::option::Option::Some(2),
29257 Self::UnknownValue(u) => u.0.value(),
29258 }
29259 }
29260
29261 /// Gets the enum value as a string.
29262 ///
29263 /// Returns `None` if the enum contains an unknown value deserialized from
29264 /// the integer representation of enums.
29265 pub fn name(&self) -> std::option::Option<&str> {
29266 match self {
29267 Self::Unspecified => std::option::Option::Some("TRANSACTION_KILL_TYPE_UNSPECIFIED"),
29268 Self::ReadOnlyTransactions => std::option::Option::Some("READ_ONLY_TRANSACTIONS"),
29269 Self::AllTransactions => std::option::Option::Some("ALL_TRANSACTIONS"),
29270 Self::UnknownValue(u) => u.0.name(),
29271 }
29272 }
29273 }
29274
29275 impl std::default::Default for TransactionKillType {
29276 fn default() -> Self {
29277 use std::convert::From;
29278 Self::from(0)
29279 }
29280 }
29281
29282 impl std::fmt::Display for TransactionKillType {
29283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29284 wkt::internal::display_enum(f, self.name(), self.value())
29285 }
29286 }
29287
29288 impl std::convert::From<i32> for TransactionKillType {
29289 fn from(value: i32) -> Self {
29290 match value {
29291 0 => Self::Unspecified,
29292 1 => Self::ReadOnlyTransactions,
29293 2 => Self::AllTransactions,
29294 _ => Self::UnknownValue(transaction_kill_type::UnknownValue(
29295 wkt::internal::UnknownEnumValue::Integer(value),
29296 )),
29297 }
29298 }
29299 }
29300
29301 impl std::convert::From<&str> for TransactionKillType {
29302 fn from(value: &str) -> Self {
29303 use std::string::ToString;
29304 match value {
29305 "TRANSACTION_KILL_TYPE_UNSPECIFIED" => Self::Unspecified,
29306 "READ_ONLY_TRANSACTIONS" => Self::ReadOnlyTransactions,
29307 "ALL_TRANSACTIONS" => Self::AllTransactions,
29308 _ => Self::UnknownValue(transaction_kill_type::UnknownValue(
29309 wkt::internal::UnknownEnumValue::String(value.to_string()),
29310 )),
29311 }
29312 }
29313 }
29314
29315 impl serde::ser::Serialize for TransactionKillType {
29316 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29317 where
29318 S: serde::Serializer,
29319 {
29320 match self {
29321 Self::Unspecified => serializer.serialize_i32(0),
29322 Self::ReadOnlyTransactions => serializer.serialize_i32(1),
29323 Self::AllTransactions => serializer.serialize_i32(2),
29324 Self::UnknownValue(u) => u.0.serialize(serializer),
29325 }
29326 }
29327 }
29328
29329 impl<'de> serde::de::Deserialize<'de> for TransactionKillType {
29330 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29331 where
29332 D: serde::Deserializer<'de>,
29333 {
29334 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransactionKillType>::new(
29335 ".google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType",
29336 ))
29337 }
29338 }
29339}
29340
29341/// Connection pool flags for Cloud SQL instances managed connection pool
29342/// configuration.
29343#[derive(Clone, Default, PartialEq)]
29344#[non_exhaustive]
29345pub struct ConnectionPoolFlags {
29346 /// Required. The name of the flag.
29347 pub name: std::string::String,
29348
29349 /// Required. The value of the flag. Boolean flags are set to `on` for true
29350 /// and `off` for false. This field must be omitted if the flag
29351 /// doesn't take a value.
29352 pub value: std::string::String,
29353
29354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29355}
29356
29357impl ConnectionPoolFlags {
29358 /// Creates a new default instance.
29359 pub fn new() -> Self {
29360 std::default::Default::default()
29361 }
29362
29363 /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
29364 ///
29365 /// # Example
29366 /// ```ignore,no_run
29367 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
29368 /// let x = ConnectionPoolFlags::new().set_name("example");
29369 /// ```
29370 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29371 self.name = v.into();
29372 self
29373 }
29374
29375 /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
29376 ///
29377 /// # Example
29378 /// ```ignore,no_run
29379 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
29380 /// let x = ConnectionPoolFlags::new().set_value("example");
29381 /// ```
29382 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29383 self.value = v.into();
29384 self
29385 }
29386}
29387
29388impl wkt::message::Message for ConnectionPoolFlags {
29389 fn typename() -> &'static str {
29390 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
29391 }
29392}
29393
29394/// The managed connection pooling configuration.
29395#[derive(Clone, Default, PartialEq)]
29396#[non_exhaustive]
29397pub struct ConnectionPoolConfig {
29398 /// Whether managed connection pooling is enabled.
29399 pub connection_pooling_enabled: std::option::Option<bool>,
29400
29401 /// Optional. List of connection pool configuration flags.
29402 pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
29403
29404 /// Output only. Number of connection poolers.
29405 pub pooler_count: std::option::Option<i32>,
29406
29407 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29408}
29409
29410impl ConnectionPoolConfig {
29411 /// Creates a new default instance.
29412 pub fn new() -> Self {
29413 std::default::Default::default()
29414 }
29415
29416 /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
29417 ///
29418 /// # Example
29419 /// ```ignore,no_run
29420 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29421 /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
29422 /// ```
29423 pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
29424 where
29425 T: std::convert::Into<bool>,
29426 {
29427 self.connection_pooling_enabled = std::option::Option::Some(v.into());
29428 self
29429 }
29430
29431 /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
29432 ///
29433 /// # Example
29434 /// ```ignore,no_run
29435 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29436 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
29437 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
29438 /// ```
29439 pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
29440 where
29441 T: std::convert::Into<bool>,
29442 {
29443 self.connection_pooling_enabled = v.map(|x| x.into());
29444 self
29445 }
29446
29447 /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
29448 ///
29449 /// # Example
29450 /// ```ignore,no_run
29451 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29452 /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
29453 /// let x = ConnectionPoolConfig::new()
29454 /// .set_flags([
29455 /// ConnectionPoolFlags::default()/* use setters */,
29456 /// ConnectionPoolFlags::default()/* use (different) setters */,
29457 /// ]);
29458 /// ```
29459 pub fn set_flags<T, V>(mut self, v: T) -> Self
29460 where
29461 T: std::iter::IntoIterator<Item = V>,
29462 V: std::convert::Into<crate::model::ConnectionPoolFlags>,
29463 {
29464 use std::iter::Iterator;
29465 self.flags = v.into_iter().map(|i| i.into()).collect();
29466 self
29467 }
29468
29469 /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
29470 ///
29471 /// # Example
29472 /// ```ignore,no_run
29473 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29474 /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
29475 /// ```
29476 pub fn set_pooler_count<T>(mut self, v: T) -> Self
29477 where
29478 T: std::convert::Into<i32>,
29479 {
29480 self.pooler_count = std::option::Option::Some(v.into());
29481 self
29482 }
29483
29484 /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
29485 ///
29486 /// # Example
29487 /// ```ignore,no_run
29488 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
29489 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
29490 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
29491 /// ```
29492 pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
29493 where
29494 T: std::convert::Into<i32>,
29495 {
29496 self.pooler_count = v.map(|x| x.into());
29497 self
29498 }
29499}
29500
29501impl wkt::message::Message for ConnectionPoolConfig {
29502 fn typename() -> &'static str {
29503 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
29504 }
29505}
29506
29507/// The read pool auto-scale configuration.
29508#[derive(Clone, Default, PartialEq)]
29509#[non_exhaustive]
29510pub struct ReadPoolAutoScaleConfig {
29511 /// Indicates whether read pool auto scaling is enabled.
29512 pub enabled: std::option::Option<bool>,
29513
29514 /// Minimum number of read pool nodes to be maintained.
29515 pub min_node_count: std::option::Option<i32>,
29516
29517 /// Maximum number of read pool nodes to be maintained.
29518 pub max_node_count: std::option::Option<i32>,
29519
29520 /// Optional. Target metrics for read pool auto scaling.
29521 pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
29522
29523 /// Indicates whether read pool auto scaling supports scale in operations
29524 /// (removing nodes).
29525 pub disable_scale_in: std::option::Option<bool>,
29526
29527 /// The cooldown period for scale-in operations.
29528 pub scale_in_cooldown_seconds: std::option::Option<i32>,
29529
29530 /// The cooldown period for scale-out operations.
29531 pub scale_out_cooldown_seconds: std::option::Option<i32>,
29532
29533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29534}
29535
29536impl ReadPoolAutoScaleConfig {
29537 /// Creates a new default instance.
29538 pub fn new() -> Self {
29539 std::default::Default::default()
29540 }
29541
29542 /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
29543 ///
29544 /// # Example
29545 /// ```ignore,no_run
29546 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29547 /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
29548 /// ```
29549 pub fn set_enabled<T>(mut self, v: T) -> Self
29550 where
29551 T: std::convert::Into<bool>,
29552 {
29553 self.enabled = std::option::Option::Some(v.into());
29554 self
29555 }
29556
29557 /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
29558 ///
29559 /// # Example
29560 /// ```ignore,no_run
29561 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29562 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
29563 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
29564 /// ```
29565 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
29566 where
29567 T: std::convert::Into<bool>,
29568 {
29569 self.enabled = v.map(|x| x.into());
29570 self
29571 }
29572
29573 /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
29574 ///
29575 /// # Example
29576 /// ```ignore,no_run
29577 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29578 /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
29579 /// ```
29580 pub fn set_min_node_count<T>(mut self, v: T) -> Self
29581 where
29582 T: std::convert::Into<i32>,
29583 {
29584 self.min_node_count = std::option::Option::Some(v.into());
29585 self
29586 }
29587
29588 /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
29589 ///
29590 /// # Example
29591 /// ```ignore,no_run
29592 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29593 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
29594 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
29595 /// ```
29596 pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
29597 where
29598 T: std::convert::Into<i32>,
29599 {
29600 self.min_node_count = v.map(|x| x.into());
29601 self
29602 }
29603
29604 /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
29605 ///
29606 /// # Example
29607 /// ```ignore,no_run
29608 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29609 /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
29610 /// ```
29611 pub fn set_max_node_count<T>(mut self, v: T) -> Self
29612 where
29613 T: std::convert::Into<i32>,
29614 {
29615 self.max_node_count = std::option::Option::Some(v.into());
29616 self
29617 }
29618
29619 /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
29620 ///
29621 /// # Example
29622 /// ```ignore,no_run
29623 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29624 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
29625 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
29626 /// ```
29627 pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
29628 where
29629 T: std::convert::Into<i32>,
29630 {
29631 self.max_node_count = v.map(|x| x.into());
29632 self
29633 }
29634
29635 /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
29636 ///
29637 /// # Example
29638 /// ```ignore,no_run
29639 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29640 /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29641 /// let x = ReadPoolAutoScaleConfig::new()
29642 /// .set_target_metrics([
29643 /// TargetMetric::default()/* use setters */,
29644 /// TargetMetric::default()/* use (different) setters */,
29645 /// ]);
29646 /// ```
29647 pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
29648 where
29649 T: std::iter::IntoIterator<Item = V>,
29650 V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
29651 {
29652 use std::iter::Iterator;
29653 self.target_metrics = v.into_iter().map(|i| i.into()).collect();
29654 self
29655 }
29656
29657 /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
29658 ///
29659 /// # Example
29660 /// ```ignore,no_run
29661 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29662 /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
29663 /// ```
29664 pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
29665 where
29666 T: std::convert::Into<bool>,
29667 {
29668 self.disable_scale_in = std::option::Option::Some(v.into());
29669 self
29670 }
29671
29672 /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
29673 ///
29674 /// # Example
29675 /// ```ignore,no_run
29676 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29677 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
29678 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
29679 /// ```
29680 pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
29681 where
29682 T: std::convert::Into<bool>,
29683 {
29684 self.disable_scale_in = v.map(|x| x.into());
29685 self
29686 }
29687
29688 /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
29689 ///
29690 /// # Example
29691 /// ```ignore,no_run
29692 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29693 /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
29694 /// ```
29695 pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
29696 where
29697 T: std::convert::Into<i32>,
29698 {
29699 self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
29700 self
29701 }
29702
29703 /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
29704 ///
29705 /// # Example
29706 /// ```ignore,no_run
29707 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29708 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
29709 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
29710 /// ```
29711 pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
29712 where
29713 T: std::convert::Into<i32>,
29714 {
29715 self.scale_in_cooldown_seconds = v.map(|x| x.into());
29716 self
29717 }
29718
29719 /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
29720 ///
29721 /// # Example
29722 /// ```ignore,no_run
29723 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29724 /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
29725 /// ```
29726 pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
29727 where
29728 T: std::convert::Into<i32>,
29729 {
29730 self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
29731 self
29732 }
29733
29734 /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
29735 ///
29736 /// # Example
29737 /// ```ignore,no_run
29738 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
29739 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
29740 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
29741 /// ```
29742 pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
29743 where
29744 T: std::convert::Into<i32>,
29745 {
29746 self.scale_out_cooldown_seconds = v.map(|x| x.into());
29747 self
29748 }
29749}
29750
29751impl wkt::message::Message for ReadPoolAutoScaleConfig {
29752 fn typename() -> &'static str {
29753 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
29754 }
29755}
29756
29757/// Defines additional types related to [ReadPoolAutoScaleConfig].
29758pub mod read_pool_auto_scale_config {
29759 #[allow(unused_imports)]
29760 use super::*;
29761
29762 /// Target metric for read pool auto scaling.
29763 #[derive(Clone, Default, PartialEq)]
29764 #[non_exhaustive]
29765 pub struct TargetMetric {
29766 /// The metric name to be used for auto scaling.
29767 pub metric: std::option::Option<std::string::String>,
29768
29769 /// The target value for the metric.
29770 pub target_value: std::option::Option<f32>,
29771
29772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29773 }
29774
29775 impl TargetMetric {
29776 /// Creates a new default instance.
29777 pub fn new() -> Self {
29778 std::default::Default::default()
29779 }
29780
29781 /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
29782 ///
29783 /// # Example
29784 /// ```ignore,no_run
29785 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29786 /// let x = TargetMetric::new().set_metric("example");
29787 /// ```
29788 pub fn set_metric<T>(mut self, v: T) -> Self
29789 where
29790 T: std::convert::Into<std::string::String>,
29791 {
29792 self.metric = std::option::Option::Some(v.into());
29793 self
29794 }
29795
29796 /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
29797 ///
29798 /// # Example
29799 /// ```ignore,no_run
29800 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29801 /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
29802 /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
29803 /// ```
29804 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
29805 where
29806 T: std::convert::Into<std::string::String>,
29807 {
29808 self.metric = v.map(|x| x.into());
29809 self
29810 }
29811
29812 /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
29813 ///
29814 /// # Example
29815 /// ```ignore,no_run
29816 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29817 /// let x = TargetMetric::new().set_target_value(42.0);
29818 /// ```
29819 pub fn set_target_value<T>(mut self, v: T) -> Self
29820 where
29821 T: std::convert::Into<f32>,
29822 {
29823 self.target_value = std::option::Option::Some(v.into());
29824 self
29825 }
29826
29827 /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
29828 ///
29829 /// # Example
29830 /// ```ignore,no_run
29831 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
29832 /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
29833 /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
29834 /// ```
29835 pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
29836 where
29837 T: std::convert::Into<f32>,
29838 {
29839 self.target_value = v.map(|x| x.into());
29840 self
29841 }
29842 }
29843
29844 impl wkt::message::Message for TargetMetric {
29845 fn typename() -> &'static str {
29846 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
29847 }
29848 }
29849}
29850
29851/// Specifies options for controlling advanced machine features.
29852#[derive(Clone, Default, PartialEq)]
29853#[non_exhaustive]
29854pub struct AdvancedMachineFeatures {
29855 /// The number of threads per physical core.
29856 pub threads_per_core: i32,
29857
29858 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29859}
29860
29861impl AdvancedMachineFeatures {
29862 /// Creates a new default instance.
29863 pub fn new() -> Self {
29864 std::default::Default::default()
29865 }
29866
29867 /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
29868 ///
29869 /// # Example
29870 /// ```ignore,no_run
29871 /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
29872 /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
29873 /// ```
29874 pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
29875 self.threads_per_core = v.into();
29876 self
29877 }
29878}
29879
29880impl wkt::message::Message for AdvancedMachineFeatures {
29881 fn typename() -> &'static str {
29882 "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
29883 }
29884}
29885
29886/// SslCerts Resource
29887#[derive(Clone, Default, PartialEq)]
29888#[non_exhaustive]
29889pub struct SslCert {
29890 /// This is always `sql#sslCert`.
29891 pub kind: std::string::String,
29892
29893 /// Serial number, as extracted from the certificate.
29894 pub cert_serial_number: std::string::String,
29895
29896 /// PEM representation.
29897 pub cert: std::string::String,
29898
29899 /// The time when the certificate was created in [RFC
29900 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
29901 /// `2012-11-15T16:19:00.094Z`
29902 pub create_time: std::option::Option<wkt::Timestamp>,
29903
29904 /// User supplied name. Constrained to [a-zA-Z.-_ ]+.
29905 pub common_name: std::string::String,
29906
29907 /// The time when the certificate expires in [RFC
29908 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
29909 /// `2012-11-15T16:19:00.094Z`.
29910 pub expiration_time: std::option::Option<wkt::Timestamp>,
29911
29912 /// Sha1 Fingerprint.
29913 pub sha1_fingerprint: std::string::String,
29914
29915 /// Name of the database instance.
29916 pub instance: std::string::String,
29917
29918 /// The URI of this resource.
29919 pub self_link: std::string::String,
29920
29921 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29922}
29923
29924impl SslCert {
29925 /// Creates a new default instance.
29926 pub fn new() -> Self {
29927 std::default::Default::default()
29928 }
29929
29930 /// Sets the value of [kind][crate::model::SslCert::kind].
29931 ///
29932 /// # Example
29933 /// ```ignore,no_run
29934 /// # use google_cloud_sql_v1::model::SslCert;
29935 /// let x = SslCert::new().set_kind("example");
29936 /// ```
29937 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29938 self.kind = v.into();
29939 self
29940 }
29941
29942 /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
29943 ///
29944 /// # Example
29945 /// ```ignore,no_run
29946 /// # use google_cloud_sql_v1::model::SslCert;
29947 /// let x = SslCert::new().set_cert_serial_number("example");
29948 /// ```
29949 pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
29950 mut self,
29951 v: T,
29952 ) -> Self {
29953 self.cert_serial_number = v.into();
29954 self
29955 }
29956
29957 /// Sets the value of [cert][crate::model::SslCert::cert].
29958 ///
29959 /// # Example
29960 /// ```ignore,no_run
29961 /// # use google_cloud_sql_v1::model::SslCert;
29962 /// let x = SslCert::new().set_cert("example");
29963 /// ```
29964 pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29965 self.cert = v.into();
29966 self
29967 }
29968
29969 /// Sets the value of [create_time][crate::model::SslCert::create_time].
29970 ///
29971 /// # Example
29972 /// ```ignore,no_run
29973 /// # use google_cloud_sql_v1::model::SslCert;
29974 /// use wkt::Timestamp;
29975 /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
29976 /// ```
29977 pub fn set_create_time<T>(mut self, v: T) -> Self
29978 where
29979 T: std::convert::Into<wkt::Timestamp>,
29980 {
29981 self.create_time = std::option::Option::Some(v.into());
29982 self
29983 }
29984
29985 /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
29986 ///
29987 /// # Example
29988 /// ```ignore,no_run
29989 /// # use google_cloud_sql_v1::model::SslCert;
29990 /// use wkt::Timestamp;
29991 /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
29992 /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
29993 /// ```
29994 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
29995 where
29996 T: std::convert::Into<wkt::Timestamp>,
29997 {
29998 self.create_time = v.map(|x| x.into());
29999 self
30000 }
30001
30002 /// Sets the value of [common_name][crate::model::SslCert::common_name].
30003 ///
30004 /// # Example
30005 /// ```ignore,no_run
30006 /// # use google_cloud_sql_v1::model::SslCert;
30007 /// let x = SslCert::new().set_common_name("example");
30008 /// ```
30009 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30010 self.common_name = v.into();
30011 self
30012 }
30013
30014 /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
30015 ///
30016 /// # Example
30017 /// ```ignore,no_run
30018 /// # use google_cloud_sql_v1::model::SslCert;
30019 /// use wkt::Timestamp;
30020 /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
30021 /// ```
30022 pub fn set_expiration_time<T>(mut self, v: T) -> Self
30023 where
30024 T: std::convert::Into<wkt::Timestamp>,
30025 {
30026 self.expiration_time = std::option::Option::Some(v.into());
30027 self
30028 }
30029
30030 /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
30031 ///
30032 /// # Example
30033 /// ```ignore,no_run
30034 /// # use google_cloud_sql_v1::model::SslCert;
30035 /// use wkt::Timestamp;
30036 /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
30037 /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
30038 /// ```
30039 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
30040 where
30041 T: std::convert::Into<wkt::Timestamp>,
30042 {
30043 self.expiration_time = v.map(|x| x.into());
30044 self
30045 }
30046
30047 /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
30048 ///
30049 /// # Example
30050 /// ```ignore,no_run
30051 /// # use google_cloud_sql_v1::model::SslCert;
30052 /// let x = SslCert::new().set_sha1_fingerprint("example");
30053 /// ```
30054 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30055 mut self,
30056 v: T,
30057 ) -> Self {
30058 self.sha1_fingerprint = v.into();
30059 self
30060 }
30061
30062 /// Sets the value of [instance][crate::model::SslCert::instance].
30063 ///
30064 /// # Example
30065 /// ```ignore,no_run
30066 /// # use google_cloud_sql_v1::model::SslCert;
30067 /// let x = SslCert::new().set_instance("example");
30068 /// ```
30069 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30070 self.instance = v.into();
30071 self
30072 }
30073
30074 /// Sets the value of [self_link][crate::model::SslCert::self_link].
30075 ///
30076 /// # Example
30077 /// ```ignore,no_run
30078 /// # use google_cloud_sql_v1::model::SslCert;
30079 /// let x = SslCert::new().set_self_link("example");
30080 /// ```
30081 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30082 self.self_link = v.into();
30083 self
30084 }
30085}
30086
30087impl wkt::message::Message for SslCert {
30088 fn typename() -> &'static str {
30089 "type.googleapis.com/google.cloud.sql.v1.SslCert"
30090 }
30091}
30092
30093/// SslCertDetail.
30094#[derive(Clone, Default, PartialEq)]
30095#[non_exhaustive]
30096pub struct SslCertDetail {
30097 /// The public information about the cert.
30098 pub cert_info: std::option::Option<crate::model::SslCert>,
30099
30100 /// The private key for the client cert, in pem format. Keep private in order
30101 /// to protect your security.
30102 pub cert_private_key: std::string::String,
30103
30104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30105}
30106
30107impl SslCertDetail {
30108 /// Creates a new default instance.
30109 pub fn new() -> Self {
30110 std::default::Default::default()
30111 }
30112
30113 /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
30114 ///
30115 /// # Example
30116 /// ```ignore,no_run
30117 /// # use google_cloud_sql_v1::model::SslCertDetail;
30118 /// use google_cloud_sql_v1::model::SslCert;
30119 /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
30120 /// ```
30121 pub fn set_cert_info<T>(mut self, v: T) -> Self
30122 where
30123 T: std::convert::Into<crate::model::SslCert>,
30124 {
30125 self.cert_info = std::option::Option::Some(v.into());
30126 self
30127 }
30128
30129 /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
30130 ///
30131 /// # Example
30132 /// ```ignore,no_run
30133 /// # use google_cloud_sql_v1::model::SslCertDetail;
30134 /// use google_cloud_sql_v1::model::SslCert;
30135 /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
30136 /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
30137 /// ```
30138 pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
30139 where
30140 T: std::convert::Into<crate::model::SslCert>,
30141 {
30142 self.cert_info = v.map(|x| x.into());
30143 self
30144 }
30145
30146 /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
30147 ///
30148 /// # Example
30149 /// ```ignore,no_run
30150 /// # use google_cloud_sql_v1::model::SslCertDetail;
30151 /// let x = SslCertDetail::new().set_cert_private_key("example");
30152 /// ```
30153 pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
30154 mut self,
30155 v: T,
30156 ) -> Self {
30157 self.cert_private_key = v.into();
30158 self
30159 }
30160}
30161
30162impl wkt::message::Message for SslCertDetail {
30163 fn typename() -> &'static str {
30164 "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
30165 }
30166}
30167
30168/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
30169#[derive(Clone, Default, PartialEq)]
30170#[non_exhaustive]
30171pub struct SqlActiveDirectoryConfig {
30172 /// This is always sql#activeDirectoryConfig.
30173 pub kind: std::string::String,
30174
30175 /// The name of the domain (e.g., mydomain.com).
30176 pub domain: std::string::String,
30177
30178 /// Optional. The mode of the Active Directory configuration.
30179 pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
30180
30181 /// Optional. Domain controller IPv4 addresses used to bootstrap Active
30182 /// Directory.
30183 pub dns_servers: std::vec::Vec<std::string::String>,
30184
30185 /// Optional. The secret manager key storing the administrator credential.
30186 /// (e.g., projects/{project}/secrets/{secret}).
30187 pub admin_credential_secret_name: std::string::String,
30188
30189 /// Optional. The organizational unit distinguished name. This is the full
30190 /// hierarchical path to the organizational unit.
30191 pub organizational_unit: std::string::String,
30192
30193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30194}
30195
30196impl SqlActiveDirectoryConfig {
30197 /// Creates a new default instance.
30198 pub fn new() -> Self {
30199 std::default::Default::default()
30200 }
30201
30202 /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
30203 ///
30204 /// # Example
30205 /// ```ignore,no_run
30206 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30207 /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
30208 /// ```
30209 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30210 self.kind = v.into();
30211 self
30212 }
30213
30214 /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
30215 ///
30216 /// # Example
30217 /// ```ignore,no_run
30218 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30219 /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
30220 /// ```
30221 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30222 self.domain = v.into();
30223 self
30224 }
30225
30226 /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
30227 ///
30228 /// # Example
30229 /// ```ignore,no_run
30230 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30231 /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
30232 /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
30233 /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
30234 /// ```
30235 pub fn set_mode<
30236 T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
30237 >(
30238 mut self,
30239 v: T,
30240 ) -> Self {
30241 self.mode = v.into();
30242 self
30243 }
30244
30245 /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
30246 ///
30247 /// # Example
30248 /// ```ignore,no_run
30249 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30250 /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
30251 /// ```
30252 pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
30253 where
30254 T: std::iter::IntoIterator<Item = V>,
30255 V: std::convert::Into<std::string::String>,
30256 {
30257 use std::iter::Iterator;
30258 self.dns_servers = v.into_iter().map(|i| i.into()).collect();
30259 self
30260 }
30261
30262 /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
30263 ///
30264 /// # Example
30265 /// ```ignore,no_run
30266 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30267 /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
30268 /// ```
30269 pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
30270 mut self,
30271 v: T,
30272 ) -> Self {
30273 self.admin_credential_secret_name = v.into();
30274 self
30275 }
30276
30277 /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
30278 ///
30279 /// # Example
30280 /// ```ignore,no_run
30281 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
30282 /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
30283 /// ```
30284 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
30285 mut self,
30286 v: T,
30287 ) -> Self {
30288 self.organizational_unit = v.into();
30289 self
30290 }
30291}
30292
30293impl wkt::message::Message for SqlActiveDirectoryConfig {
30294 fn typename() -> &'static str {
30295 "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
30296 }
30297}
30298
30299/// Defines additional types related to [SqlActiveDirectoryConfig].
30300pub mod sql_active_directory_config {
30301 #[allow(unused_imports)]
30302 use super::*;
30303
30304 /// The modes of Active Directory configuration.
30305 ///
30306 /// # Working with unknown values
30307 ///
30308 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30309 /// additional enum variants at any time. Adding new variants is not considered
30310 /// a breaking change. Applications should write their code in anticipation of:
30311 ///
30312 /// - New values appearing in future releases of the client library, **and**
30313 /// - New values received dynamically, without application changes.
30314 ///
30315 /// Please consult the [Working with enums] section in the user guide for some
30316 /// guidelines.
30317 ///
30318 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30319 #[derive(Clone, Debug, PartialEq)]
30320 #[non_exhaustive]
30321 pub enum ActiveDirectoryMode {
30322 /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
30323 /// not specified to maintain backward compatibility.
30324 Unspecified,
30325 /// Managed Active Directory mode.
30326 ManagedActiveDirectory,
30327 /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
30328 #[deprecated]
30329 SelfManagedActiveDirectory,
30330 /// Customer-managed Active Directory mode.
30331 CustomerManagedActiveDirectory,
30332 /// If set, the enum was initialized with an unknown value.
30333 ///
30334 /// Applications can examine the value using [ActiveDirectoryMode::value] or
30335 /// [ActiveDirectoryMode::name].
30336 UnknownValue(active_directory_mode::UnknownValue),
30337 }
30338
30339 #[doc(hidden)]
30340 pub mod active_directory_mode {
30341 #[allow(unused_imports)]
30342 use super::*;
30343 #[derive(Clone, Debug, PartialEq)]
30344 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30345 }
30346
30347 impl ActiveDirectoryMode {
30348 /// Gets the enum value.
30349 ///
30350 /// Returns `None` if the enum contains an unknown value deserialized from
30351 /// the string representation of enums.
30352 pub fn value(&self) -> std::option::Option<i32> {
30353 match self {
30354 Self::Unspecified => std::option::Option::Some(0),
30355 Self::ManagedActiveDirectory => std::option::Option::Some(1),
30356 Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
30357 Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
30358 Self::UnknownValue(u) => u.0.value(),
30359 }
30360 }
30361
30362 /// Gets the enum value as a string.
30363 ///
30364 /// Returns `None` if the enum contains an unknown value deserialized from
30365 /// the integer representation of enums.
30366 pub fn name(&self) -> std::option::Option<&str> {
30367 match self {
30368 Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
30369 Self::ManagedActiveDirectory => {
30370 std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
30371 }
30372 Self::SelfManagedActiveDirectory => {
30373 std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
30374 }
30375 Self::CustomerManagedActiveDirectory => {
30376 std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
30377 }
30378 Self::UnknownValue(u) => u.0.name(),
30379 }
30380 }
30381 }
30382
30383 impl std::default::Default for ActiveDirectoryMode {
30384 fn default() -> Self {
30385 use std::convert::From;
30386 Self::from(0)
30387 }
30388 }
30389
30390 impl std::fmt::Display for ActiveDirectoryMode {
30391 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30392 wkt::internal::display_enum(f, self.name(), self.value())
30393 }
30394 }
30395
30396 impl std::convert::From<i32> for ActiveDirectoryMode {
30397 fn from(value: i32) -> Self {
30398 match value {
30399 0 => Self::Unspecified,
30400 1 => Self::ManagedActiveDirectory,
30401 2 => Self::SelfManagedActiveDirectory,
30402 3 => Self::CustomerManagedActiveDirectory,
30403 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
30404 wkt::internal::UnknownEnumValue::Integer(value),
30405 )),
30406 }
30407 }
30408 }
30409
30410 impl std::convert::From<&str> for ActiveDirectoryMode {
30411 fn from(value: &str) -> Self {
30412 use std::string::ToString;
30413 match value {
30414 "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
30415 "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
30416 "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
30417 "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
30418 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
30419 wkt::internal::UnknownEnumValue::String(value.to_string()),
30420 )),
30421 }
30422 }
30423 }
30424
30425 impl serde::ser::Serialize for ActiveDirectoryMode {
30426 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30427 where
30428 S: serde::Serializer,
30429 {
30430 match self {
30431 Self::Unspecified => serializer.serialize_i32(0),
30432 Self::ManagedActiveDirectory => serializer.serialize_i32(1),
30433 Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
30434 Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
30435 Self::UnknownValue(u) => u.0.serialize(serializer),
30436 }
30437 }
30438 }
30439
30440 impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
30441 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30442 where
30443 D: serde::Deserializer<'de>,
30444 {
30445 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
30446 ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
30447 ))
30448 }
30449 }
30450}
30451
30452/// SQL Server specific audit configuration.
30453#[derive(Clone, Default, PartialEq)]
30454#[non_exhaustive]
30455pub struct SqlServerAuditConfig {
30456 /// This is always sql#sqlServerAuditConfig
30457 pub kind: std::string::String,
30458
30459 /// The name of the destination bucket (e.g., gs://mybucket).
30460 pub bucket: std::string::String,
30461
30462 /// How long to keep generated audit files.
30463 pub retention_interval: std::option::Option<wkt::Duration>,
30464
30465 /// How often to upload generated audit files.
30466 pub upload_interval: std::option::Option<wkt::Duration>,
30467
30468 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30469}
30470
30471impl SqlServerAuditConfig {
30472 /// Creates a new default instance.
30473 pub fn new() -> Self {
30474 std::default::Default::default()
30475 }
30476
30477 /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
30478 ///
30479 /// # Example
30480 /// ```ignore,no_run
30481 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30482 /// let x = SqlServerAuditConfig::new().set_kind("example");
30483 /// ```
30484 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30485 self.kind = v.into();
30486 self
30487 }
30488
30489 /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
30490 ///
30491 /// # Example
30492 /// ```ignore,no_run
30493 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30494 /// let x = SqlServerAuditConfig::new().set_bucket("example");
30495 /// ```
30496 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30497 self.bucket = v.into();
30498 self
30499 }
30500
30501 /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
30502 ///
30503 /// # Example
30504 /// ```ignore,no_run
30505 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30506 /// use wkt::Duration;
30507 /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
30508 /// ```
30509 pub fn set_retention_interval<T>(mut self, v: T) -> Self
30510 where
30511 T: std::convert::Into<wkt::Duration>,
30512 {
30513 self.retention_interval = std::option::Option::Some(v.into());
30514 self
30515 }
30516
30517 /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
30518 ///
30519 /// # Example
30520 /// ```ignore,no_run
30521 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30522 /// use wkt::Duration;
30523 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
30524 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
30525 /// ```
30526 pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
30527 where
30528 T: std::convert::Into<wkt::Duration>,
30529 {
30530 self.retention_interval = v.map(|x| x.into());
30531 self
30532 }
30533
30534 /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
30535 ///
30536 /// # Example
30537 /// ```ignore,no_run
30538 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30539 /// use wkt::Duration;
30540 /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
30541 /// ```
30542 pub fn set_upload_interval<T>(mut self, v: T) -> Self
30543 where
30544 T: std::convert::Into<wkt::Duration>,
30545 {
30546 self.upload_interval = std::option::Option::Some(v.into());
30547 self
30548 }
30549
30550 /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
30551 ///
30552 /// # Example
30553 /// ```ignore,no_run
30554 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
30555 /// use wkt::Duration;
30556 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
30557 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
30558 /// ```
30559 pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
30560 where
30561 T: std::convert::Into<wkt::Duration>,
30562 {
30563 self.upload_interval = v.map(|x| x.into());
30564 self
30565 }
30566}
30567
30568impl wkt::message::Message for SqlServerAuditConfig {
30569 fn typename() -> &'static str {
30570 "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
30571 }
30572}
30573
30574/// SQL Server Entra ID configuration.
30575#[derive(Clone, Default, PartialEq)]
30576#[non_exhaustive]
30577pub struct SqlServerEntraIdConfig {
30578 /// Output only. This is always sql#sqlServerEntraIdConfig
30579 pub kind: std::string::String,
30580
30581 /// Optional. The tenant ID for the Entra ID configuration.
30582 pub tenant_id: std::string::String,
30583
30584 /// Optional. The application ID for the Entra ID configuration.
30585 pub application_id: std::string::String,
30586
30587 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30588}
30589
30590impl SqlServerEntraIdConfig {
30591 /// Creates a new default instance.
30592 pub fn new() -> Self {
30593 std::default::Default::default()
30594 }
30595
30596 /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
30597 ///
30598 /// # Example
30599 /// ```ignore,no_run
30600 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
30601 /// let x = SqlServerEntraIdConfig::new().set_kind("example");
30602 /// ```
30603 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30604 self.kind = v.into();
30605 self
30606 }
30607
30608 /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
30609 ///
30610 /// # Example
30611 /// ```ignore,no_run
30612 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
30613 /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
30614 /// ```
30615 pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30616 self.tenant_id = v.into();
30617 self
30618 }
30619
30620 /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
30621 ///
30622 /// # Example
30623 /// ```ignore,no_run
30624 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
30625 /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
30626 /// ```
30627 pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30628 self.application_id = v.into();
30629 self
30630 }
30631}
30632
30633impl wkt::message::Message for SqlServerEntraIdConfig {
30634 fn typename() -> &'static str {
30635 "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
30636 }
30637}
30638
30639/// Acquire SSRS lease context.
30640#[derive(Clone, Default, PartialEq)]
30641#[non_exhaustive]
30642pub struct AcquireSsrsLeaseContext {
30643 /// The username to be used as the setup login to connect to the database
30644 /// server for SSRS setup.
30645 pub setup_login: std::option::Option<std::string::String>,
30646
30647 /// The username to be used as the service login to connect to the report
30648 /// database for SSRS setup.
30649 pub service_login: std::option::Option<std::string::String>,
30650
30651 /// The report database to be used for SSRS setup.
30652 pub report_database: std::option::Option<std::string::String>,
30653
30654 /// Lease duration needed for SSRS setup.
30655 pub duration: std::option::Option<wkt::Duration>,
30656
30657 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30658}
30659
30660impl AcquireSsrsLeaseContext {
30661 /// Creates a new default instance.
30662 pub fn new() -> Self {
30663 std::default::Default::default()
30664 }
30665
30666 /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
30667 ///
30668 /// # Example
30669 /// ```ignore,no_run
30670 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30671 /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
30672 /// ```
30673 pub fn set_setup_login<T>(mut self, v: T) -> Self
30674 where
30675 T: std::convert::Into<std::string::String>,
30676 {
30677 self.setup_login = std::option::Option::Some(v.into());
30678 self
30679 }
30680
30681 /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
30682 ///
30683 /// # Example
30684 /// ```ignore,no_run
30685 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30686 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
30687 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
30688 /// ```
30689 pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
30690 where
30691 T: std::convert::Into<std::string::String>,
30692 {
30693 self.setup_login = v.map(|x| x.into());
30694 self
30695 }
30696
30697 /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
30698 ///
30699 /// # Example
30700 /// ```ignore,no_run
30701 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30702 /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
30703 /// ```
30704 pub fn set_service_login<T>(mut self, v: T) -> Self
30705 where
30706 T: std::convert::Into<std::string::String>,
30707 {
30708 self.service_login = std::option::Option::Some(v.into());
30709 self
30710 }
30711
30712 /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
30713 ///
30714 /// # Example
30715 /// ```ignore,no_run
30716 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30717 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
30718 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
30719 /// ```
30720 pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
30721 where
30722 T: std::convert::Into<std::string::String>,
30723 {
30724 self.service_login = v.map(|x| x.into());
30725 self
30726 }
30727
30728 /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
30729 ///
30730 /// # Example
30731 /// ```ignore,no_run
30732 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30733 /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
30734 /// ```
30735 pub fn set_report_database<T>(mut self, v: T) -> Self
30736 where
30737 T: std::convert::Into<std::string::String>,
30738 {
30739 self.report_database = std::option::Option::Some(v.into());
30740 self
30741 }
30742
30743 /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
30744 ///
30745 /// # Example
30746 /// ```ignore,no_run
30747 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30748 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
30749 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
30750 /// ```
30751 pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
30752 where
30753 T: std::convert::Into<std::string::String>,
30754 {
30755 self.report_database = v.map(|x| x.into());
30756 self
30757 }
30758
30759 /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
30760 ///
30761 /// # Example
30762 /// ```ignore,no_run
30763 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30764 /// use wkt::Duration;
30765 /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
30766 /// ```
30767 pub fn set_duration<T>(mut self, v: T) -> Self
30768 where
30769 T: std::convert::Into<wkt::Duration>,
30770 {
30771 self.duration = std::option::Option::Some(v.into());
30772 self
30773 }
30774
30775 /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
30776 ///
30777 /// # Example
30778 /// ```ignore,no_run
30779 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
30780 /// use wkt::Duration;
30781 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
30782 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
30783 /// ```
30784 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
30785 where
30786 T: std::convert::Into<wkt::Duration>,
30787 {
30788 self.duration = v.map(|x| x.into());
30789 self
30790 }
30791}
30792
30793impl wkt::message::Message for AcquireSsrsLeaseContext {
30794 fn typename() -> &'static str {
30795 "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
30796 }
30797}
30798
30799/// DNS metadata.
30800#[derive(Clone, Default, PartialEq)]
30801#[non_exhaustive]
30802pub struct DnsNameMapping {
30803 /// Output only. The DNS name.
30804 pub name: std::string::String,
30805
30806 /// Output only. The connection type of the DNS name.
30807 pub connection_type: crate::model::dns_name_mapping::ConnectionType,
30808
30809 /// Output only. The scope that the DNS name applies to.
30810 pub dns_scope: crate::model::dns_name_mapping::DnsScope,
30811
30812 /// Output only. The manager for this DNS record.
30813 pub record_manager: crate::model::dns_name_mapping::RecordManager,
30814
30815 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30816}
30817
30818impl DnsNameMapping {
30819 /// Creates a new default instance.
30820 pub fn new() -> Self {
30821 std::default::Default::default()
30822 }
30823
30824 /// Sets the value of [name][crate::model::DnsNameMapping::name].
30825 ///
30826 /// # Example
30827 /// ```ignore,no_run
30828 /// # use google_cloud_sql_v1::model::DnsNameMapping;
30829 /// let x = DnsNameMapping::new().set_name("example");
30830 /// ```
30831 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30832 self.name = v.into();
30833 self
30834 }
30835
30836 /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
30837 ///
30838 /// # Example
30839 /// ```ignore,no_run
30840 /// # use google_cloud_sql_v1::model::DnsNameMapping;
30841 /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
30842 /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
30843 /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
30844 /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
30845 /// ```
30846 pub fn set_connection_type<
30847 T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
30848 >(
30849 mut self,
30850 v: T,
30851 ) -> Self {
30852 self.connection_type = v.into();
30853 self
30854 }
30855
30856 /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
30857 ///
30858 /// # Example
30859 /// ```ignore,no_run
30860 /// # use google_cloud_sql_v1::model::DnsNameMapping;
30861 /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
30862 /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
30863 /// let x1 = DnsNameMapping::new().set_dns_scope(DnsScope::Cluster);
30864 /// ```
30865 pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
30866 mut self,
30867 v: T,
30868 ) -> Self {
30869 self.dns_scope = v.into();
30870 self
30871 }
30872
30873 /// Sets the value of [record_manager][crate::model::DnsNameMapping::record_manager].
30874 ///
30875 /// # Example
30876 /// ```ignore,no_run
30877 /// # use google_cloud_sql_v1::model::DnsNameMapping;
30878 /// use google_cloud_sql_v1::model::dns_name_mapping::RecordManager;
30879 /// let x0 = DnsNameMapping::new().set_record_manager(RecordManager::Customer);
30880 /// let x1 = DnsNameMapping::new().set_record_manager(RecordManager::CloudSqlAutomation);
30881 /// ```
30882 pub fn set_record_manager<
30883 T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
30884 >(
30885 mut self,
30886 v: T,
30887 ) -> Self {
30888 self.record_manager = v.into();
30889 self
30890 }
30891}
30892
30893impl wkt::message::Message for DnsNameMapping {
30894 fn typename() -> &'static str {
30895 "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
30896 }
30897}
30898
30899/// Defines additional types related to [DnsNameMapping].
30900pub mod dns_name_mapping {
30901 #[allow(unused_imports)]
30902 use super::*;
30903
30904 /// The connection type of the DNS name.
30905 /// This enum is not frozen, and new values may be added in the future.
30906 ///
30907 /// # Working with unknown values
30908 ///
30909 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30910 /// additional enum variants at any time. Adding new variants is not considered
30911 /// a breaking change. Applications should write their code in anticipation of:
30912 ///
30913 /// - New values appearing in future releases of the client library, **and**
30914 /// - New values received dynamically, without application changes.
30915 ///
30916 /// Please consult the [Working with enums] section in the user guide for some
30917 /// guidelines.
30918 ///
30919 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30920 #[derive(Clone, Debug, PartialEq)]
30921 #[non_exhaustive]
30922 pub enum ConnectionType {
30923 /// Unknown connection type.
30924 Unspecified,
30925 /// Public IP.
30926 Public,
30927 /// Private services access (private IP).
30928 PrivateServicesAccess,
30929 /// Private Service Connect.
30930 PrivateServiceConnect,
30931 /// If set, the enum was initialized with an unknown value.
30932 ///
30933 /// Applications can examine the value using [ConnectionType::value] or
30934 /// [ConnectionType::name].
30935 UnknownValue(connection_type::UnknownValue),
30936 }
30937
30938 #[doc(hidden)]
30939 pub mod connection_type {
30940 #[allow(unused_imports)]
30941 use super::*;
30942 #[derive(Clone, Debug, PartialEq)]
30943 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30944 }
30945
30946 impl ConnectionType {
30947 /// Gets the enum value.
30948 ///
30949 /// Returns `None` if the enum contains an unknown value deserialized from
30950 /// the string representation of enums.
30951 pub fn value(&self) -> std::option::Option<i32> {
30952 match self {
30953 Self::Unspecified => std::option::Option::Some(0),
30954 Self::Public => std::option::Option::Some(1),
30955 Self::PrivateServicesAccess => std::option::Option::Some(2),
30956 Self::PrivateServiceConnect => std::option::Option::Some(3),
30957 Self::UnknownValue(u) => u.0.value(),
30958 }
30959 }
30960
30961 /// Gets the enum value as a string.
30962 ///
30963 /// Returns `None` if the enum contains an unknown value deserialized from
30964 /// the integer representation of enums.
30965 pub fn name(&self) -> std::option::Option<&str> {
30966 match self {
30967 Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
30968 Self::Public => std::option::Option::Some("PUBLIC"),
30969 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
30970 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
30971 Self::UnknownValue(u) => u.0.name(),
30972 }
30973 }
30974 }
30975
30976 impl std::default::Default for ConnectionType {
30977 fn default() -> Self {
30978 use std::convert::From;
30979 Self::from(0)
30980 }
30981 }
30982
30983 impl std::fmt::Display for ConnectionType {
30984 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30985 wkt::internal::display_enum(f, self.name(), self.value())
30986 }
30987 }
30988
30989 impl std::convert::From<i32> for ConnectionType {
30990 fn from(value: i32) -> Self {
30991 match value {
30992 0 => Self::Unspecified,
30993 1 => Self::Public,
30994 2 => Self::PrivateServicesAccess,
30995 3 => Self::PrivateServiceConnect,
30996 _ => Self::UnknownValue(connection_type::UnknownValue(
30997 wkt::internal::UnknownEnumValue::Integer(value),
30998 )),
30999 }
31000 }
31001 }
31002
31003 impl std::convert::From<&str> for ConnectionType {
31004 fn from(value: &str) -> Self {
31005 use std::string::ToString;
31006 match value {
31007 "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
31008 "PUBLIC" => Self::Public,
31009 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
31010 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
31011 _ => Self::UnknownValue(connection_type::UnknownValue(
31012 wkt::internal::UnknownEnumValue::String(value.to_string()),
31013 )),
31014 }
31015 }
31016 }
31017
31018 impl serde::ser::Serialize for ConnectionType {
31019 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31020 where
31021 S: serde::Serializer,
31022 {
31023 match self {
31024 Self::Unspecified => serializer.serialize_i32(0),
31025 Self::Public => serializer.serialize_i32(1),
31026 Self::PrivateServicesAccess => serializer.serialize_i32(2),
31027 Self::PrivateServiceConnect => serializer.serialize_i32(3),
31028 Self::UnknownValue(u) => u.0.serialize(serializer),
31029 }
31030 }
31031 }
31032
31033 impl<'de> serde::de::Deserialize<'de> for ConnectionType {
31034 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31035 where
31036 D: serde::Deserializer<'de>,
31037 {
31038 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
31039 ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
31040 ))
31041 }
31042 }
31043
31044 /// The scope that the DNS name applies to.
31045 ///
31046 /// # Working with unknown values
31047 ///
31048 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31049 /// additional enum variants at any time. Adding new variants is not considered
31050 /// a breaking change. Applications should write their code in anticipation of:
31051 ///
31052 /// - New values appearing in future releases of the client library, **and**
31053 /// - New values received dynamically, without application changes.
31054 ///
31055 /// Please consult the [Working with enums] section in the user guide for some
31056 /// guidelines.
31057 ///
31058 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31059 #[derive(Clone, Debug, PartialEq)]
31060 #[non_exhaustive]
31061 pub enum DnsScope {
31062 /// DNS scope not set. This value should not be used.
31063 Unspecified,
31064 /// Indicates an instance-level DNS name.
31065 Instance,
31066 /// Indicates a cluster-level DNS name.
31067 Cluster,
31068 /// If set, the enum was initialized with an unknown value.
31069 ///
31070 /// Applications can examine the value using [DnsScope::value] or
31071 /// [DnsScope::name].
31072 UnknownValue(dns_scope::UnknownValue),
31073 }
31074
31075 #[doc(hidden)]
31076 pub mod dns_scope {
31077 #[allow(unused_imports)]
31078 use super::*;
31079 #[derive(Clone, Debug, PartialEq)]
31080 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31081 }
31082
31083 impl DnsScope {
31084 /// Gets the enum value.
31085 ///
31086 /// Returns `None` if the enum contains an unknown value deserialized from
31087 /// the string representation of enums.
31088 pub fn value(&self) -> std::option::Option<i32> {
31089 match self {
31090 Self::Unspecified => std::option::Option::Some(0),
31091 Self::Instance => std::option::Option::Some(1),
31092 Self::Cluster => std::option::Option::Some(2),
31093 Self::UnknownValue(u) => u.0.value(),
31094 }
31095 }
31096
31097 /// Gets the enum value as a string.
31098 ///
31099 /// Returns `None` if the enum contains an unknown value deserialized from
31100 /// the integer representation of enums.
31101 pub fn name(&self) -> std::option::Option<&str> {
31102 match self {
31103 Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
31104 Self::Instance => std::option::Option::Some("INSTANCE"),
31105 Self::Cluster => std::option::Option::Some("CLUSTER"),
31106 Self::UnknownValue(u) => u.0.name(),
31107 }
31108 }
31109 }
31110
31111 impl std::default::Default for DnsScope {
31112 fn default() -> Self {
31113 use std::convert::From;
31114 Self::from(0)
31115 }
31116 }
31117
31118 impl std::fmt::Display for DnsScope {
31119 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31120 wkt::internal::display_enum(f, self.name(), self.value())
31121 }
31122 }
31123
31124 impl std::convert::From<i32> for DnsScope {
31125 fn from(value: i32) -> Self {
31126 match value {
31127 0 => Self::Unspecified,
31128 1 => Self::Instance,
31129 2 => Self::Cluster,
31130 _ => Self::UnknownValue(dns_scope::UnknownValue(
31131 wkt::internal::UnknownEnumValue::Integer(value),
31132 )),
31133 }
31134 }
31135 }
31136
31137 impl std::convert::From<&str> for DnsScope {
31138 fn from(value: &str) -> Self {
31139 use std::string::ToString;
31140 match value {
31141 "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
31142 "INSTANCE" => Self::Instance,
31143 "CLUSTER" => Self::Cluster,
31144 _ => Self::UnknownValue(dns_scope::UnknownValue(
31145 wkt::internal::UnknownEnumValue::String(value.to_string()),
31146 )),
31147 }
31148 }
31149 }
31150
31151 impl serde::ser::Serialize for DnsScope {
31152 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31153 where
31154 S: serde::Serializer,
31155 {
31156 match self {
31157 Self::Unspecified => serializer.serialize_i32(0),
31158 Self::Instance => serializer.serialize_i32(1),
31159 Self::Cluster => serializer.serialize_i32(2),
31160 Self::UnknownValue(u) => u.0.serialize(serializer),
31161 }
31162 }
31163 }
31164
31165 impl<'de> serde::de::Deserialize<'de> for DnsScope {
31166 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31167 where
31168 D: serde::Deserializer<'de>,
31169 {
31170 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
31171 ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
31172 ))
31173 }
31174 }
31175
31176 /// The system responsible for managing the DNS record.
31177 ///
31178 /// # Working with unknown values
31179 ///
31180 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31181 /// additional enum variants at any time. Adding new variants is not considered
31182 /// a breaking change. Applications should write their code in anticipation of:
31183 ///
31184 /// - New values appearing in future releases of the client library, **and**
31185 /// - New values received dynamically, without application changes.
31186 ///
31187 /// Please consult the [Working with enums] section in the user guide for some
31188 /// guidelines.
31189 ///
31190 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31191 #[derive(Clone, Debug, PartialEq)]
31192 #[non_exhaustive]
31193 pub enum RecordManager {
31194 /// Record manager not set. This value should not be used.
31195 Unspecified,
31196 /// The record may be managed by the customer. It is not automatically
31197 /// managed by Cloud SQL automation.
31198 Customer,
31199 /// The record is managed by Cloud SQL, which will create, update,
31200 /// and delete the DNS records for the zone automatically when
31201 /// the Cloud SQL database instance is created or updated.
31202 CloudSqlAutomation,
31203 /// If set, the enum was initialized with an unknown value.
31204 ///
31205 /// Applications can examine the value using [RecordManager::value] or
31206 /// [RecordManager::name].
31207 UnknownValue(record_manager::UnknownValue),
31208 }
31209
31210 #[doc(hidden)]
31211 pub mod record_manager {
31212 #[allow(unused_imports)]
31213 use super::*;
31214 #[derive(Clone, Debug, PartialEq)]
31215 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31216 }
31217
31218 impl RecordManager {
31219 /// Gets the enum value.
31220 ///
31221 /// Returns `None` if the enum contains an unknown value deserialized from
31222 /// the string representation of enums.
31223 pub fn value(&self) -> std::option::Option<i32> {
31224 match self {
31225 Self::Unspecified => std::option::Option::Some(0),
31226 Self::Customer => std::option::Option::Some(1),
31227 Self::CloudSqlAutomation => std::option::Option::Some(2),
31228 Self::UnknownValue(u) => u.0.value(),
31229 }
31230 }
31231
31232 /// Gets the enum value as a string.
31233 ///
31234 /// Returns `None` if the enum contains an unknown value deserialized from
31235 /// the integer representation of enums.
31236 pub fn name(&self) -> std::option::Option<&str> {
31237 match self {
31238 Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
31239 Self::Customer => std::option::Option::Some("CUSTOMER"),
31240 Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
31241 Self::UnknownValue(u) => u.0.name(),
31242 }
31243 }
31244 }
31245
31246 impl std::default::Default for RecordManager {
31247 fn default() -> Self {
31248 use std::convert::From;
31249 Self::from(0)
31250 }
31251 }
31252
31253 impl std::fmt::Display for RecordManager {
31254 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31255 wkt::internal::display_enum(f, self.name(), self.value())
31256 }
31257 }
31258
31259 impl std::convert::From<i32> for RecordManager {
31260 fn from(value: i32) -> Self {
31261 match value {
31262 0 => Self::Unspecified,
31263 1 => Self::Customer,
31264 2 => Self::CloudSqlAutomation,
31265 _ => Self::UnknownValue(record_manager::UnknownValue(
31266 wkt::internal::UnknownEnumValue::Integer(value),
31267 )),
31268 }
31269 }
31270 }
31271
31272 impl std::convert::From<&str> for RecordManager {
31273 fn from(value: &str) -> Self {
31274 use std::string::ToString;
31275 match value {
31276 "RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
31277 "CUSTOMER" => Self::Customer,
31278 "CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
31279 _ => Self::UnknownValue(record_manager::UnknownValue(
31280 wkt::internal::UnknownEnumValue::String(value.to_string()),
31281 )),
31282 }
31283 }
31284 }
31285
31286 impl serde::ser::Serialize for RecordManager {
31287 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31288 where
31289 S: serde::Serializer,
31290 {
31291 match self {
31292 Self::Unspecified => serializer.serialize_i32(0),
31293 Self::Customer => serializer.serialize_i32(1),
31294 Self::CloudSqlAutomation => serializer.serialize_i32(2),
31295 Self::UnknownValue(u) => u.0.serialize(serializer),
31296 }
31297 }
31298 }
31299
31300 impl<'de> serde::de::Deserialize<'de> for RecordManager {
31301 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31302 where
31303 D: serde::Deserializer<'de>,
31304 {
31305 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
31306 ".google.cloud.sql.v1.DnsNameMapping.RecordManager",
31307 ))
31308 }
31309 }
31310}
31311
31312#[allow(missing_docs)]
31313#[derive(Clone, Default, PartialEq)]
31314#[non_exhaustive]
31315pub struct SqlSslCertsDeleteRequest {
31316 /// Cloud SQL instance ID. This does not include the project ID.
31317 pub instance: std::string::String,
31318
31319 /// Project ID of the project that contains the instance.
31320 pub project: std::string::String,
31321
31322 /// Sha1 FingerPrint.
31323 pub sha1_fingerprint: std::string::String,
31324
31325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31326}
31327
31328impl SqlSslCertsDeleteRequest {
31329 /// Creates a new default instance.
31330 pub fn new() -> Self {
31331 std::default::Default::default()
31332 }
31333
31334 /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
31335 ///
31336 /// # Example
31337 /// ```ignore,no_run
31338 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
31339 /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
31340 /// ```
31341 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31342 self.instance = v.into();
31343 self
31344 }
31345
31346 /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
31347 ///
31348 /// # Example
31349 /// ```ignore,no_run
31350 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
31351 /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
31352 /// ```
31353 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31354 self.project = v.into();
31355 self
31356 }
31357
31358 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
31359 ///
31360 /// # Example
31361 /// ```ignore,no_run
31362 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
31363 /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
31364 /// ```
31365 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
31366 mut self,
31367 v: T,
31368 ) -> Self {
31369 self.sha1_fingerprint = v.into();
31370 self
31371 }
31372}
31373
31374impl wkt::message::Message for SqlSslCertsDeleteRequest {
31375 fn typename() -> &'static str {
31376 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
31377 }
31378}
31379
31380#[allow(missing_docs)]
31381#[derive(Clone, Default, PartialEq)]
31382#[non_exhaustive]
31383pub struct SqlSslCertsGetRequest {
31384 /// Cloud SQL instance ID. This does not include the project ID.
31385 pub instance: std::string::String,
31386
31387 /// Project ID of the project that contains the instance.
31388 pub project: std::string::String,
31389
31390 /// Sha1 FingerPrint.
31391 pub sha1_fingerprint: std::string::String,
31392
31393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31394}
31395
31396impl SqlSslCertsGetRequest {
31397 /// Creates a new default instance.
31398 pub fn new() -> Self {
31399 std::default::Default::default()
31400 }
31401
31402 /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
31403 ///
31404 /// # Example
31405 /// ```ignore,no_run
31406 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
31407 /// let x = SqlSslCertsGetRequest::new().set_instance("example");
31408 /// ```
31409 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31410 self.instance = v.into();
31411 self
31412 }
31413
31414 /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
31415 ///
31416 /// # Example
31417 /// ```ignore,no_run
31418 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
31419 /// let x = SqlSslCertsGetRequest::new().set_project("example");
31420 /// ```
31421 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31422 self.project = v.into();
31423 self
31424 }
31425
31426 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
31427 ///
31428 /// # Example
31429 /// ```ignore,no_run
31430 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
31431 /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
31432 /// ```
31433 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
31434 mut self,
31435 v: T,
31436 ) -> Self {
31437 self.sha1_fingerprint = v.into();
31438 self
31439 }
31440}
31441
31442impl wkt::message::Message for SqlSslCertsGetRequest {
31443 fn typename() -> &'static str {
31444 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
31445 }
31446}
31447
31448#[allow(missing_docs)]
31449#[derive(Clone, Default, PartialEq)]
31450#[non_exhaustive]
31451pub struct SqlSslCertsInsertRequest {
31452 /// Cloud SQL instance ID. This does not include the project ID.
31453 pub instance: std::string::String,
31454
31455 /// Project ID of the project that contains the instance.
31456 pub project: std::string::String,
31457
31458 #[allow(missing_docs)]
31459 pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
31460
31461 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31462}
31463
31464impl SqlSslCertsInsertRequest {
31465 /// Creates a new default instance.
31466 pub fn new() -> Self {
31467 std::default::Default::default()
31468 }
31469
31470 /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
31471 ///
31472 /// # Example
31473 /// ```ignore,no_run
31474 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31475 /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
31476 /// ```
31477 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31478 self.instance = v.into();
31479 self
31480 }
31481
31482 /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
31483 ///
31484 /// # Example
31485 /// ```ignore,no_run
31486 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31487 /// let x = SqlSslCertsInsertRequest::new().set_project("example");
31488 /// ```
31489 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31490 self.project = v.into();
31491 self
31492 }
31493
31494 /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
31495 ///
31496 /// # Example
31497 /// ```ignore,no_run
31498 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31499 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
31500 /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
31501 /// ```
31502 pub fn set_body<T>(mut self, v: T) -> Self
31503 where
31504 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
31505 {
31506 self.body = std::option::Option::Some(v.into());
31507 self
31508 }
31509
31510 /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
31511 ///
31512 /// # Example
31513 /// ```ignore,no_run
31514 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
31515 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
31516 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
31517 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
31518 /// ```
31519 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31520 where
31521 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
31522 {
31523 self.body = v.map(|x| x.into());
31524 self
31525 }
31526}
31527
31528impl wkt::message::Message for SqlSslCertsInsertRequest {
31529 fn typename() -> &'static str {
31530 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
31531 }
31532}
31533
31534#[allow(missing_docs)]
31535#[derive(Clone, Default, PartialEq)]
31536#[non_exhaustive]
31537pub struct SqlSslCertsListRequest {
31538 /// Cloud SQL instance ID. This does not include the project ID.
31539 pub instance: std::string::String,
31540
31541 /// Project ID of the project that contains the instance.
31542 pub project: std::string::String,
31543
31544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31545}
31546
31547impl SqlSslCertsListRequest {
31548 /// Creates a new default instance.
31549 pub fn new() -> Self {
31550 std::default::Default::default()
31551 }
31552
31553 /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
31554 ///
31555 /// # Example
31556 /// ```ignore,no_run
31557 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
31558 /// let x = SqlSslCertsListRequest::new().set_instance("example");
31559 /// ```
31560 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31561 self.instance = v.into();
31562 self
31563 }
31564
31565 /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
31566 ///
31567 /// # Example
31568 /// ```ignore,no_run
31569 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
31570 /// let x = SqlSslCertsListRequest::new().set_project("example");
31571 /// ```
31572 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31573 self.project = v.into();
31574 self
31575 }
31576}
31577
31578impl wkt::message::Message for SqlSslCertsListRequest {
31579 fn typename() -> &'static str {
31580 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
31581 }
31582}
31583
31584/// SslCerts insert request.
31585#[derive(Clone, Default, PartialEq)]
31586#[non_exhaustive]
31587pub struct SslCertsInsertRequest {
31588 /// User supplied name. Must be a distinct name from the other certificates
31589 /// for this instance.
31590 pub common_name: std::string::String,
31591
31592 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31593}
31594
31595impl SslCertsInsertRequest {
31596 /// Creates a new default instance.
31597 pub fn new() -> Self {
31598 std::default::Default::default()
31599 }
31600
31601 /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
31602 ///
31603 /// # Example
31604 /// ```ignore,no_run
31605 /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
31606 /// let x = SslCertsInsertRequest::new().set_common_name("example");
31607 /// ```
31608 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31609 self.common_name = v.into();
31610 self
31611 }
31612}
31613
31614impl wkt::message::Message for SslCertsInsertRequest {
31615 fn typename() -> &'static str {
31616 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
31617 }
31618}
31619
31620/// SslCert insert response.
31621#[derive(Clone, Default, PartialEq)]
31622#[non_exhaustive]
31623pub struct SslCertsInsertResponse {
31624 /// This is always `sql#sslCertsInsert`.
31625 pub kind: std::string::String,
31626
31627 /// The operation to track the ssl certs insert request.
31628 pub operation: std::option::Option<crate::model::Operation>,
31629
31630 /// The server Certificate Authority's certificate. If this is missing you can
31631 /// force a new one to be generated by calling resetSslConfig method on
31632 /// instances resource.
31633 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
31634
31635 /// The new client certificate and private key.
31636 pub client_cert: std::option::Option<crate::model::SslCertDetail>,
31637
31638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31639}
31640
31641impl SslCertsInsertResponse {
31642 /// Creates a new default instance.
31643 pub fn new() -> Self {
31644 std::default::Default::default()
31645 }
31646
31647 /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
31648 ///
31649 /// # Example
31650 /// ```ignore,no_run
31651 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31652 /// let x = SslCertsInsertResponse::new().set_kind("example");
31653 /// ```
31654 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31655 self.kind = v.into();
31656 self
31657 }
31658
31659 /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
31660 ///
31661 /// # Example
31662 /// ```ignore,no_run
31663 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31664 /// use google_cloud_sql_v1::model::Operation;
31665 /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
31666 /// ```
31667 pub fn set_operation<T>(mut self, v: T) -> Self
31668 where
31669 T: std::convert::Into<crate::model::Operation>,
31670 {
31671 self.operation = std::option::Option::Some(v.into());
31672 self
31673 }
31674
31675 /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
31676 ///
31677 /// # Example
31678 /// ```ignore,no_run
31679 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31680 /// use google_cloud_sql_v1::model::Operation;
31681 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
31682 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
31683 /// ```
31684 pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
31685 where
31686 T: std::convert::Into<crate::model::Operation>,
31687 {
31688 self.operation = v.map(|x| x.into());
31689 self
31690 }
31691
31692 /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
31693 ///
31694 /// # Example
31695 /// ```ignore,no_run
31696 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31697 /// use google_cloud_sql_v1::model::SslCert;
31698 /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
31699 /// ```
31700 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
31701 where
31702 T: std::convert::Into<crate::model::SslCert>,
31703 {
31704 self.server_ca_cert = std::option::Option::Some(v.into());
31705 self
31706 }
31707
31708 /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
31709 ///
31710 /// # Example
31711 /// ```ignore,no_run
31712 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31713 /// use google_cloud_sql_v1::model::SslCert;
31714 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
31715 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
31716 /// ```
31717 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
31718 where
31719 T: std::convert::Into<crate::model::SslCert>,
31720 {
31721 self.server_ca_cert = v.map(|x| x.into());
31722 self
31723 }
31724
31725 /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
31726 ///
31727 /// # Example
31728 /// ```ignore,no_run
31729 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31730 /// use google_cloud_sql_v1::model::SslCertDetail;
31731 /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
31732 /// ```
31733 pub fn set_client_cert<T>(mut self, v: T) -> Self
31734 where
31735 T: std::convert::Into<crate::model::SslCertDetail>,
31736 {
31737 self.client_cert = std::option::Option::Some(v.into());
31738 self
31739 }
31740
31741 /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
31742 ///
31743 /// # Example
31744 /// ```ignore,no_run
31745 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
31746 /// use google_cloud_sql_v1::model::SslCertDetail;
31747 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
31748 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
31749 /// ```
31750 pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
31751 where
31752 T: std::convert::Into<crate::model::SslCertDetail>,
31753 {
31754 self.client_cert = v.map(|x| x.into());
31755 self
31756 }
31757}
31758
31759impl wkt::message::Message for SslCertsInsertResponse {
31760 fn typename() -> &'static str {
31761 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
31762 }
31763}
31764
31765/// SslCerts list response.
31766#[derive(Clone, Default, PartialEq)]
31767#[non_exhaustive]
31768pub struct SslCertsListResponse {
31769 /// This is always `sql#sslCertsList`.
31770 pub kind: std::string::String,
31771
31772 /// List of client certificates for the instance.
31773 pub items: std::vec::Vec<crate::model::SslCert>,
31774
31775 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31776}
31777
31778impl SslCertsListResponse {
31779 /// Creates a new default instance.
31780 pub fn new() -> Self {
31781 std::default::Default::default()
31782 }
31783
31784 /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
31785 ///
31786 /// # Example
31787 /// ```ignore,no_run
31788 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
31789 /// let x = SslCertsListResponse::new().set_kind("example");
31790 /// ```
31791 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31792 self.kind = v.into();
31793 self
31794 }
31795
31796 /// Sets the value of [items][crate::model::SslCertsListResponse::items].
31797 ///
31798 /// # Example
31799 /// ```ignore,no_run
31800 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
31801 /// use google_cloud_sql_v1::model::SslCert;
31802 /// let x = SslCertsListResponse::new()
31803 /// .set_items([
31804 /// SslCert::default()/* use setters */,
31805 /// SslCert::default()/* use (different) setters */,
31806 /// ]);
31807 /// ```
31808 pub fn set_items<T, V>(mut self, v: T) -> Self
31809 where
31810 T: std::iter::IntoIterator<Item = V>,
31811 V: std::convert::Into<crate::model::SslCert>,
31812 {
31813 use std::iter::Iterator;
31814 self.items = v.into_iter().map(|i| i.into()).collect();
31815 self
31816 }
31817}
31818
31819impl wkt::message::Message for SslCertsListResponse {
31820 fn typename() -> &'static str {
31821 "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
31822 }
31823}
31824
31825/// Tiers list request.
31826#[derive(Clone, Default, PartialEq)]
31827#[non_exhaustive]
31828pub struct SqlTiersListRequest {
31829 /// Project ID of the project for which to list tiers.
31830 pub project: std::string::String,
31831
31832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31833}
31834
31835impl SqlTiersListRequest {
31836 /// Creates a new default instance.
31837 pub fn new() -> Self {
31838 std::default::Default::default()
31839 }
31840
31841 /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
31842 ///
31843 /// # Example
31844 /// ```ignore,no_run
31845 /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
31846 /// let x = SqlTiersListRequest::new().set_project("example");
31847 /// ```
31848 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31849 self.project = v.into();
31850 self
31851 }
31852}
31853
31854impl wkt::message::Message for SqlTiersListRequest {
31855 fn typename() -> &'static str {
31856 "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
31857 }
31858}
31859
31860/// Tiers list response.
31861#[derive(Clone, Default, PartialEq)]
31862#[non_exhaustive]
31863pub struct TiersListResponse {
31864 /// This is always `sql#tiersList`.
31865 pub kind: std::string::String,
31866
31867 /// List of tiers.
31868 pub items: std::vec::Vec<crate::model::Tier>,
31869
31870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31871}
31872
31873impl TiersListResponse {
31874 /// Creates a new default instance.
31875 pub fn new() -> Self {
31876 std::default::Default::default()
31877 }
31878
31879 /// Sets the value of [kind][crate::model::TiersListResponse::kind].
31880 ///
31881 /// # Example
31882 /// ```ignore,no_run
31883 /// # use google_cloud_sql_v1::model::TiersListResponse;
31884 /// let x = TiersListResponse::new().set_kind("example");
31885 /// ```
31886 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31887 self.kind = v.into();
31888 self
31889 }
31890
31891 /// Sets the value of [items][crate::model::TiersListResponse::items].
31892 ///
31893 /// # Example
31894 /// ```ignore,no_run
31895 /// # use google_cloud_sql_v1::model::TiersListResponse;
31896 /// use google_cloud_sql_v1::model::Tier;
31897 /// let x = TiersListResponse::new()
31898 /// .set_items([
31899 /// Tier::default()/* use setters */,
31900 /// Tier::default()/* use (different) setters */,
31901 /// ]);
31902 /// ```
31903 pub fn set_items<T, V>(mut self, v: T) -> Self
31904 where
31905 T: std::iter::IntoIterator<Item = V>,
31906 V: std::convert::Into<crate::model::Tier>,
31907 {
31908 use std::iter::Iterator;
31909 self.items = v.into_iter().map(|i| i.into()).collect();
31910 self
31911 }
31912}
31913
31914impl wkt::message::Message for TiersListResponse {
31915 fn typename() -> &'static str {
31916 "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
31917 }
31918}
31919
31920/// A Google Cloud SQL service tier resource.
31921#[derive(Clone, Default, PartialEq)]
31922#[non_exhaustive]
31923pub struct Tier {
31924 /// An identifier for the machine type, for example, `db-custom-1-3840`. For
31925 /// related information, see [Pricing](/sql/pricing).
31926 pub tier: std::string::String,
31927
31928 /// The maximum RAM usage of this tier in bytes.
31929 pub ram: i64,
31930
31931 /// This is always `sql#tier`.
31932 pub kind: std::string::String,
31933
31934 /// The maximum disk size of this tier in bytes.
31935 pub disk_quota: i64,
31936
31937 /// The applicable regions for this tier.
31938 pub region: std::vec::Vec<std::string::String>,
31939
31940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31941}
31942
31943impl Tier {
31944 /// Creates a new default instance.
31945 pub fn new() -> Self {
31946 std::default::Default::default()
31947 }
31948
31949 /// Sets the value of [tier][crate::model::Tier::tier].
31950 ///
31951 /// # Example
31952 /// ```ignore,no_run
31953 /// # use google_cloud_sql_v1::model::Tier;
31954 /// let x = Tier::new().set_tier("example");
31955 /// ```
31956 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31957 self.tier = v.into();
31958 self
31959 }
31960
31961 /// Sets the value of [ram][crate::model::Tier::ram].
31962 ///
31963 /// # Example
31964 /// ```ignore,no_run
31965 /// # use google_cloud_sql_v1::model::Tier;
31966 /// let x = Tier::new().set_ram(42);
31967 /// ```
31968 pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31969 self.ram = v.into();
31970 self
31971 }
31972
31973 /// Sets the value of [kind][crate::model::Tier::kind].
31974 ///
31975 /// # Example
31976 /// ```ignore,no_run
31977 /// # use google_cloud_sql_v1::model::Tier;
31978 /// let x = Tier::new().set_kind("example");
31979 /// ```
31980 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31981 self.kind = v.into();
31982 self
31983 }
31984
31985 /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
31986 ///
31987 /// # Example
31988 /// ```ignore,no_run
31989 /// # use google_cloud_sql_v1::model::Tier;
31990 /// let x = Tier::new().set_disk_quota(42);
31991 /// ```
31992 pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
31993 self.disk_quota = v.into();
31994 self
31995 }
31996
31997 /// Sets the value of [region][crate::model::Tier::region].
31998 ///
31999 /// # Example
32000 /// ```ignore,no_run
32001 /// # use google_cloud_sql_v1::model::Tier;
32002 /// let x = Tier::new().set_region(["a", "b", "c"]);
32003 /// ```
32004 pub fn set_region<T, V>(mut self, v: T) -> Self
32005 where
32006 T: std::iter::IntoIterator<Item = V>,
32007 V: std::convert::Into<std::string::String>,
32008 {
32009 use std::iter::Iterator;
32010 self.region = v.into_iter().map(|i| i.into()).collect();
32011 self
32012 }
32013}
32014
32015impl wkt::message::Message for Tier {
32016 fn typename() -> &'static str {
32017 "type.googleapis.com/google.cloud.sql.v1.Tier"
32018 }
32019}
32020
32021#[allow(missing_docs)]
32022#[derive(Clone, Default, PartialEq)]
32023#[non_exhaustive]
32024pub struct SqlUsersDeleteRequest {
32025 /// Host of the user in the instance.
32026 pub host: std::string::String,
32027
32028 /// Database instance ID. This does not include the project ID.
32029 pub instance: std::string::String,
32030
32031 /// Name of the user in the instance.
32032 pub name: std::string::String,
32033
32034 /// Project ID of the project that contains the instance.
32035 pub project: std::string::String,
32036
32037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32038}
32039
32040impl SqlUsersDeleteRequest {
32041 /// Creates a new default instance.
32042 pub fn new() -> Self {
32043 std::default::Default::default()
32044 }
32045
32046 /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
32047 ///
32048 /// # Example
32049 /// ```ignore,no_run
32050 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32051 /// let x = SqlUsersDeleteRequest::new().set_host("example");
32052 /// ```
32053 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32054 self.host = v.into();
32055 self
32056 }
32057
32058 /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
32059 ///
32060 /// # Example
32061 /// ```ignore,no_run
32062 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32063 /// let x = SqlUsersDeleteRequest::new().set_instance("example");
32064 /// ```
32065 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32066 self.instance = v.into();
32067 self
32068 }
32069
32070 /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
32071 ///
32072 /// # Example
32073 /// ```ignore,no_run
32074 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32075 /// let x = SqlUsersDeleteRequest::new().set_name("example");
32076 /// ```
32077 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32078 self.name = v.into();
32079 self
32080 }
32081
32082 /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
32083 ///
32084 /// # Example
32085 /// ```ignore,no_run
32086 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
32087 /// let x = SqlUsersDeleteRequest::new().set_project("example");
32088 /// ```
32089 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32090 self.project = v.into();
32091 self
32092 }
32093}
32094
32095impl wkt::message::Message for SqlUsersDeleteRequest {
32096 fn typename() -> &'static str {
32097 "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
32098 }
32099}
32100
32101/// Request message for Users Get RPC
32102#[derive(Clone, Default, PartialEq)]
32103#[non_exhaustive]
32104pub struct SqlUsersGetRequest {
32105 /// Database instance ID. This does not include the project ID.
32106 pub instance: std::string::String,
32107
32108 /// User of the instance.
32109 pub name: std::string::String,
32110
32111 /// Project ID of the project that contains the instance.
32112 pub project: std::string::String,
32113
32114 /// Host of a user of the instance.
32115 pub host: std::string::String,
32116
32117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32118}
32119
32120impl SqlUsersGetRequest {
32121 /// Creates a new default instance.
32122 pub fn new() -> Self {
32123 std::default::Default::default()
32124 }
32125
32126 /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
32127 ///
32128 /// # Example
32129 /// ```ignore,no_run
32130 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32131 /// let x = SqlUsersGetRequest::new().set_instance("example");
32132 /// ```
32133 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32134 self.instance = v.into();
32135 self
32136 }
32137
32138 /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
32139 ///
32140 /// # Example
32141 /// ```ignore,no_run
32142 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32143 /// let x = SqlUsersGetRequest::new().set_name("example");
32144 /// ```
32145 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32146 self.name = v.into();
32147 self
32148 }
32149
32150 /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
32151 ///
32152 /// # Example
32153 /// ```ignore,no_run
32154 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32155 /// let x = SqlUsersGetRequest::new().set_project("example");
32156 /// ```
32157 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32158 self.project = v.into();
32159 self
32160 }
32161
32162 /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
32163 ///
32164 /// # Example
32165 /// ```ignore,no_run
32166 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
32167 /// let x = SqlUsersGetRequest::new().set_host("example");
32168 /// ```
32169 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32170 self.host = v.into();
32171 self
32172 }
32173}
32174
32175impl wkt::message::Message for SqlUsersGetRequest {
32176 fn typename() -> &'static str {
32177 "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
32178 }
32179}
32180
32181#[allow(missing_docs)]
32182#[derive(Clone, Default, PartialEq)]
32183#[non_exhaustive]
32184pub struct SqlUsersInsertRequest {
32185 /// Database instance ID. This does not include the project ID.
32186 pub instance: std::string::String,
32187
32188 /// Project ID of the project that contains the instance.
32189 pub project: std::string::String,
32190
32191 #[allow(missing_docs)]
32192 pub body: std::option::Option<crate::model::User>,
32193
32194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32195}
32196
32197impl SqlUsersInsertRequest {
32198 /// Creates a new default instance.
32199 pub fn new() -> Self {
32200 std::default::Default::default()
32201 }
32202
32203 /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
32204 ///
32205 /// # Example
32206 /// ```ignore,no_run
32207 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32208 /// let x = SqlUsersInsertRequest::new().set_instance("example");
32209 /// ```
32210 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32211 self.instance = v.into();
32212 self
32213 }
32214
32215 /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
32216 ///
32217 /// # Example
32218 /// ```ignore,no_run
32219 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32220 /// let x = SqlUsersInsertRequest::new().set_project("example");
32221 /// ```
32222 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32223 self.project = v.into();
32224 self
32225 }
32226
32227 /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
32228 ///
32229 /// # Example
32230 /// ```ignore,no_run
32231 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32232 /// use google_cloud_sql_v1::model::User;
32233 /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
32234 /// ```
32235 pub fn set_body<T>(mut self, v: T) -> Self
32236 where
32237 T: std::convert::Into<crate::model::User>,
32238 {
32239 self.body = std::option::Option::Some(v.into());
32240 self
32241 }
32242
32243 /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
32244 ///
32245 /// # Example
32246 /// ```ignore,no_run
32247 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
32248 /// use google_cloud_sql_v1::model::User;
32249 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
32250 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
32251 /// ```
32252 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
32253 where
32254 T: std::convert::Into<crate::model::User>,
32255 {
32256 self.body = v.map(|x| x.into());
32257 self
32258 }
32259}
32260
32261impl wkt::message::Message for SqlUsersInsertRequest {
32262 fn typename() -> &'static str {
32263 "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
32264 }
32265}
32266
32267#[allow(missing_docs)]
32268#[derive(Clone, Default, PartialEq)]
32269#[non_exhaustive]
32270pub struct SqlUsersListRequest {
32271 /// Database instance ID. This does not include the project ID.
32272 pub instance: std::string::String,
32273
32274 /// Project ID of the project that contains the instance.
32275 pub project: std::string::String,
32276
32277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32278}
32279
32280impl SqlUsersListRequest {
32281 /// Creates a new default instance.
32282 pub fn new() -> Self {
32283 std::default::Default::default()
32284 }
32285
32286 /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
32287 ///
32288 /// # Example
32289 /// ```ignore,no_run
32290 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
32291 /// let x = SqlUsersListRequest::new().set_instance("example");
32292 /// ```
32293 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32294 self.instance = v.into();
32295 self
32296 }
32297
32298 /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
32299 ///
32300 /// # Example
32301 /// ```ignore,no_run
32302 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
32303 /// let x = SqlUsersListRequest::new().set_project("example");
32304 /// ```
32305 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32306 self.project = v.into();
32307 self
32308 }
32309}
32310
32311impl wkt::message::Message for SqlUsersListRequest {
32312 fn typename() -> &'static str {
32313 "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
32314 }
32315}
32316
32317#[allow(missing_docs)]
32318#[derive(Clone, Default, PartialEq)]
32319#[non_exhaustive]
32320pub struct SqlUsersUpdateRequest {
32321 /// Optional. Host of the user in the instance.
32322 pub host: std::string::String,
32323
32324 /// Database instance ID. This does not include the project ID.
32325 pub instance: std::string::String,
32326
32327 /// Name of the user in the instance.
32328 pub name: std::string::String,
32329
32330 /// Project ID of the project that contains the instance.
32331 pub project: std::string::String,
32332
32333 /// Optional. List of database roles to grant to the user. body.database_roles
32334 /// will be ignored for update request.
32335 pub database_roles: std::vec::Vec<std::string::String>,
32336
32337 /// Optional. Specifies whether to revoke existing roles that are not present
32338 /// in the `database_roles` field. If `false` or unset, the database roles
32339 /// specified in `database_roles` are added to the user's existing roles.
32340 pub revoke_existing_roles: std::option::Option<bool>,
32341
32342 #[allow(missing_docs)]
32343 pub body: std::option::Option<crate::model::User>,
32344
32345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32346}
32347
32348impl SqlUsersUpdateRequest {
32349 /// Creates a new default instance.
32350 pub fn new() -> Self {
32351 std::default::Default::default()
32352 }
32353
32354 /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
32355 ///
32356 /// # Example
32357 /// ```ignore,no_run
32358 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32359 /// let x = SqlUsersUpdateRequest::new().set_host("example");
32360 /// ```
32361 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32362 self.host = v.into();
32363 self
32364 }
32365
32366 /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
32367 ///
32368 /// # Example
32369 /// ```ignore,no_run
32370 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32371 /// let x = SqlUsersUpdateRequest::new().set_instance("example");
32372 /// ```
32373 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32374 self.instance = v.into();
32375 self
32376 }
32377
32378 /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
32379 ///
32380 /// # Example
32381 /// ```ignore,no_run
32382 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32383 /// let x = SqlUsersUpdateRequest::new().set_name("example");
32384 /// ```
32385 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32386 self.name = v.into();
32387 self
32388 }
32389
32390 /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
32391 ///
32392 /// # Example
32393 /// ```ignore,no_run
32394 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32395 /// let x = SqlUsersUpdateRequest::new().set_project("example");
32396 /// ```
32397 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32398 self.project = v.into();
32399 self
32400 }
32401
32402 /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
32403 ///
32404 /// # Example
32405 /// ```ignore,no_run
32406 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32407 /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
32408 /// ```
32409 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
32410 where
32411 T: std::iter::IntoIterator<Item = V>,
32412 V: std::convert::Into<std::string::String>,
32413 {
32414 use std::iter::Iterator;
32415 self.database_roles = v.into_iter().map(|i| i.into()).collect();
32416 self
32417 }
32418
32419 /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
32420 ///
32421 /// # Example
32422 /// ```ignore,no_run
32423 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32424 /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_roles(true);
32425 /// ```
32426 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
32427 where
32428 T: std::convert::Into<bool>,
32429 {
32430 self.revoke_existing_roles = std::option::Option::Some(v.into());
32431 self
32432 }
32433
32434 /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
32435 ///
32436 /// # Example
32437 /// ```ignore,no_run
32438 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32439 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(Some(false));
32440 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(None::<bool>);
32441 /// ```
32442 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
32443 where
32444 T: std::convert::Into<bool>,
32445 {
32446 self.revoke_existing_roles = v.map(|x| x.into());
32447 self
32448 }
32449
32450 /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
32451 ///
32452 /// # Example
32453 /// ```ignore,no_run
32454 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32455 /// use google_cloud_sql_v1::model::User;
32456 /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
32457 /// ```
32458 pub fn set_body<T>(mut self, v: T) -> Self
32459 where
32460 T: std::convert::Into<crate::model::User>,
32461 {
32462 self.body = std::option::Option::Some(v.into());
32463 self
32464 }
32465
32466 /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
32467 ///
32468 /// # Example
32469 /// ```ignore,no_run
32470 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
32471 /// use google_cloud_sql_v1::model::User;
32472 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
32473 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
32474 /// ```
32475 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
32476 where
32477 T: std::convert::Into<crate::model::User>,
32478 {
32479 self.body = v.map(|x| x.into());
32480 self
32481 }
32482}
32483
32484impl wkt::message::Message for SqlUsersUpdateRequest {
32485 fn typename() -> &'static str {
32486 "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
32487 }
32488}
32489
32490/// User level password validation policy.
32491#[derive(Clone, Default, PartialEq)]
32492#[non_exhaustive]
32493pub struct UserPasswordValidationPolicy {
32494 /// Number of failed login attempts allowed before user get locked.
32495 pub allowed_failed_attempts: i32,
32496
32497 /// Expiration duration after password is updated.
32498 pub password_expiration_duration: std::option::Option<wkt::Duration>,
32499
32500 /// If true, failed login attempts check will be enabled.
32501 pub enable_failed_attempts_check: bool,
32502
32503 /// Output only. Read-only password status.
32504 pub status: std::option::Option<crate::model::PasswordStatus>,
32505
32506 /// If true, the user must specify the current password before changing the
32507 /// password. This flag is supported only for MySQL.
32508 pub enable_password_verification: bool,
32509
32510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32511}
32512
32513impl UserPasswordValidationPolicy {
32514 /// Creates a new default instance.
32515 pub fn new() -> Self {
32516 std::default::Default::default()
32517 }
32518
32519 /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
32520 ///
32521 /// # Example
32522 /// ```ignore,no_run
32523 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32524 /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
32525 /// ```
32526 pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
32527 self.allowed_failed_attempts = v.into();
32528 self
32529 }
32530
32531 /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
32532 ///
32533 /// # Example
32534 /// ```ignore,no_run
32535 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32536 /// use wkt::Duration;
32537 /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
32538 /// ```
32539 pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
32540 where
32541 T: std::convert::Into<wkt::Duration>,
32542 {
32543 self.password_expiration_duration = std::option::Option::Some(v.into());
32544 self
32545 }
32546
32547 /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
32548 ///
32549 /// # Example
32550 /// ```ignore,no_run
32551 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32552 /// use wkt::Duration;
32553 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
32554 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
32555 /// ```
32556 pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
32557 where
32558 T: std::convert::Into<wkt::Duration>,
32559 {
32560 self.password_expiration_duration = v.map(|x| x.into());
32561 self
32562 }
32563
32564 /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
32565 ///
32566 /// # Example
32567 /// ```ignore,no_run
32568 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32569 /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
32570 /// ```
32571 pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32572 self.enable_failed_attempts_check = v.into();
32573 self
32574 }
32575
32576 /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
32577 ///
32578 /// # Example
32579 /// ```ignore,no_run
32580 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32581 /// use google_cloud_sql_v1::model::PasswordStatus;
32582 /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
32583 /// ```
32584 pub fn set_status<T>(mut self, v: T) -> Self
32585 where
32586 T: std::convert::Into<crate::model::PasswordStatus>,
32587 {
32588 self.status = std::option::Option::Some(v.into());
32589 self
32590 }
32591
32592 /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
32593 ///
32594 /// # Example
32595 /// ```ignore,no_run
32596 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32597 /// use google_cloud_sql_v1::model::PasswordStatus;
32598 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
32599 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
32600 /// ```
32601 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
32602 where
32603 T: std::convert::Into<crate::model::PasswordStatus>,
32604 {
32605 self.status = v.map(|x| x.into());
32606 self
32607 }
32608
32609 /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
32610 ///
32611 /// # Example
32612 /// ```ignore,no_run
32613 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32614 /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
32615 /// ```
32616 pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32617 self.enable_password_verification = v.into();
32618 self
32619 }
32620}
32621
32622impl wkt::message::Message for UserPasswordValidationPolicy {
32623 fn typename() -> &'static str {
32624 "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
32625 }
32626}
32627
32628/// Read-only password status.
32629#[derive(Clone, Default, PartialEq)]
32630#[non_exhaustive]
32631pub struct PasswordStatus {
32632 /// If true, user does not have login privileges.
32633 pub locked: bool,
32634
32635 /// The expiration time of the current password.
32636 pub password_expiration_time: std::option::Option<wkt::Timestamp>,
32637
32638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32639}
32640
32641impl PasswordStatus {
32642 /// Creates a new default instance.
32643 pub fn new() -> Self {
32644 std::default::Default::default()
32645 }
32646
32647 /// Sets the value of [locked][crate::model::PasswordStatus::locked].
32648 ///
32649 /// # Example
32650 /// ```ignore,no_run
32651 /// # use google_cloud_sql_v1::model::PasswordStatus;
32652 /// let x = PasswordStatus::new().set_locked(true);
32653 /// ```
32654 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32655 self.locked = v.into();
32656 self
32657 }
32658
32659 /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
32660 ///
32661 /// # Example
32662 /// ```ignore,no_run
32663 /// # use google_cloud_sql_v1::model::PasswordStatus;
32664 /// use wkt::Timestamp;
32665 /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
32666 /// ```
32667 pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
32668 where
32669 T: std::convert::Into<wkt::Timestamp>,
32670 {
32671 self.password_expiration_time = std::option::Option::Some(v.into());
32672 self
32673 }
32674
32675 /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
32676 ///
32677 /// # Example
32678 /// ```ignore,no_run
32679 /// # use google_cloud_sql_v1::model::PasswordStatus;
32680 /// use wkt::Timestamp;
32681 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
32682 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
32683 /// ```
32684 pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
32685 where
32686 T: std::convert::Into<wkt::Timestamp>,
32687 {
32688 self.password_expiration_time = v.map(|x| x.into());
32689 self
32690 }
32691}
32692
32693impl wkt::message::Message for PasswordStatus {
32694 fn typename() -> &'static str {
32695 "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
32696 }
32697}
32698
32699/// A Cloud SQL user resource.
32700#[derive(Clone, Default, PartialEq)]
32701#[non_exhaustive]
32702pub struct User {
32703 /// This is always `sql#user`.
32704 pub kind: std::string::String,
32705
32706 /// The password for the user.
32707 pub password: std::string::String,
32708
32709 /// This field is deprecated and will be removed from a future version of the
32710 /// API.
32711 pub etag: std::string::String,
32712
32713 /// The name of the user in the Cloud SQL instance. Can be omitted for
32714 /// `update` because it is already specified in the URL.
32715 pub name: std::string::String,
32716
32717 /// Optional. The host from which the user can connect. For `insert`
32718 /// operations, host defaults to an empty string. For `update`
32719 /// operations, host is specified as part of the request URL. The host name
32720 /// cannot be updated after insertion. For a MySQL instance, it's required;
32721 /// for a PostgreSQL or SQL Server instance, it's optional.
32722 pub host: std::string::String,
32723
32724 /// The name of the Cloud SQL instance. This does not include the project ID.
32725 /// Can be omitted for `update` because it is already specified on the
32726 /// URL.
32727 pub instance: std::string::String,
32728
32729 /// The project ID of the project containing the Cloud SQL database. The Google
32730 /// apps domain is prefixed if applicable. Can be omitted for `update` because
32731 /// it is already specified on the URL.
32732 pub project: std::string::String,
32733
32734 /// The user type. It determines the method to authenticate the user during
32735 /// login. The default is the database's built-in user type.
32736 pub r#type: crate::model::user::SqlUserType,
32737
32738 /// Optional. The full email for an IAM user. For normal database users, this
32739 /// will not be filled. Only applicable to MySQL database users.
32740 pub iam_email: std::string::String,
32741
32742 /// User level password validation policy.
32743 pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
32744
32745 /// Dual password status for the user.
32746 pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
32747
32748 /// Indicates if a group is active or inactive for IAM database authentication.
32749 pub iam_status: std::option::Option<crate::model::user::IamStatus>,
32750
32751 /// Optional. Role memberships of the user
32752 pub database_roles: std::vec::Vec<std::string::String>,
32753
32754 /// User details for specific database type
32755 pub user_details: std::option::Option<crate::model::user::UserDetails>,
32756
32757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32758}
32759
32760impl User {
32761 /// Creates a new default instance.
32762 pub fn new() -> Self {
32763 std::default::Default::default()
32764 }
32765
32766 /// Sets the value of [kind][crate::model::User::kind].
32767 ///
32768 /// # Example
32769 /// ```ignore,no_run
32770 /// # use google_cloud_sql_v1::model::User;
32771 /// let x = User::new().set_kind("example");
32772 /// ```
32773 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32774 self.kind = v.into();
32775 self
32776 }
32777
32778 /// Sets the value of [password][crate::model::User::password].
32779 ///
32780 /// # Example
32781 /// ```ignore,no_run
32782 /// # use google_cloud_sql_v1::model::User;
32783 /// let x = User::new().set_password("example");
32784 /// ```
32785 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32786 self.password = v.into();
32787 self
32788 }
32789
32790 /// Sets the value of [etag][crate::model::User::etag].
32791 ///
32792 /// # Example
32793 /// ```ignore,no_run
32794 /// # use google_cloud_sql_v1::model::User;
32795 /// let x = User::new().set_etag("example");
32796 /// ```
32797 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32798 self.etag = v.into();
32799 self
32800 }
32801
32802 /// Sets the value of [name][crate::model::User::name].
32803 ///
32804 /// # Example
32805 /// ```ignore,no_run
32806 /// # use google_cloud_sql_v1::model::User;
32807 /// let x = User::new().set_name("example");
32808 /// ```
32809 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32810 self.name = v.into();
32811 self
32812 }
32813
32814 /// Sets the value of [host][crate::model::User::host].
32815 ///
32816 /// # Example
32817 /// ```ignore,no_run
32818 /// # use google_cloud_sql_v1::model::User;
32819 /// let x = User::new().set_host("example");
32820 /// ```
32821 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32822 self.host = v.into();
32823 self
32824 }
32825
32826 /// Sets the value of [instance][crate::model::User::instance].
32827 ///
32828 /// # Example
32829 /// ```ignore,no_run
32830 /// # use google_cloud_sql_v1::model::User;
32831 /// let x = User::new().set_instance("example");
32832 /// ```
32833 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32834 self.instance = v.into();
32835 self
32836 }
32837
32838 /// Sets the value of [project][crate::model::User::project].
32839 ///
32840 /// # Example
32841 /// ```ignore,no_run
32842 /// # use google_cloud_sql_v1::model::User;
32843 /// let x = User::new().set_project("example");
32844 /// ```
32845 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32846 self.project = v.into();
32847 self
32848 }
32849
32850 /// Sets the value of [r#type][crate::model::User::type].
32851 ///
32852 /// # Example
32853 /// ```ignore,no_run
32854 /// # use google_cloud_sql_v1::model::User;
32855 /// use google_cloud_sql_v1::model::user::SqlUserType;
32856 /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
32857 /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
32858 /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
32859 /// ```
32860 pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
32861 mut self,
32862 v: T,
32863 ) -> Self {
32864 self.r#type = v.into();
32865 self
32866 }
32867
32868 /// Sets the value of [iam_email][crate::model::User::iam_email].
32869 ///
32870 /// # Example
32871 /// ```ignore,no_run
32872 /// # use google_cloud_sql_v1::model::User;
32873 /// let x = User::new().set_iam_email("example");
32874 /// ```
32875 pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32876 self.iam_email = v.into();
32877 self
32878 }
32879
32880 /// Sets the value of [password_policy][crate::model::User::password_policy].
32881 ///
32882 /// # Example
32883 /// ```ignore,no_run
32884 /// # use google_cloud_sql_v1::model::User;
32885 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32886 /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
32887 /// ```
32888 pub fn set_password_policy<T>(mut self, v: T) -> Self
32889 where
32890 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
32891 {
32892 self.password_policy = std::option::Option::Some(v.into());
32893 self
32894 }
32895
32896 /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
32897 ///
32898 /// # Example
32899 /// ```ignore,no_run
32900 /// # use google_cloud_sql_v1::model::User;
32901 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
32902 /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
32903 /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
32904 /// ```
32905 pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
32906 where
32907 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
32908 {
32909 self.password_policy = v.map(|x| x.into());
32910 self
32911 }
32912
32913 /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
32914 ///
32915 /// # Example
32916 /// ```ignore,no_run
32917 /// # use google_cloud_sql_v1::model::User;
32918 /// use google_cloud_sql_v1::model::user::DualPasswordType;
32919 /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
32920 /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
32921 /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
32922 /// ```
32923 pub fn set_dual_password_type<T>(mut self, v: T) -> Self
32924 where
32925 T: std::convert::Into<crate::model::user::DualPasswordType>,
32926 {
32927 self.dual_password_type = std::option::Option::Some(v.into());
32928 self
32929 }
32930
32931 /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
32932 ///
32933 /// # Example
32934 /// ```ignore,no_run
32935 /// # use google_cloud_sql_v1::model::User;
32936 /// use google_cloud_sql_v1::model::user::DualPasswordType;
32937 /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
32938 /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
32939 /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
32940 /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
32941 /// ```
32942 pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
32943 where
32944 T: std::convert::Into<crate::model::user::DualPasswordType>,
32945 {
32946 self.dual_password_type = v.map(|x| x.into());
32947 self
32948 }
32949
32950 /// Sets the value of [iam_status][crate::model::User::iam_status].
32951 ///
32952 /// # Example
32953 /// ```ignore,no_run
32954 /// # use google_cloud_sql_v1::model::User;
32955 /// use google_cloud_sql_v1::model::user::IamStatus;
32956 /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
32957 /// let x1 = User::new().set_iam_status(IamStatus::Active);
32958 /// ```
32959 pub fn set_iam_status<T>(mut self, v: T) -> Self
32960 where
32961 T: std::convert::Into<crate::model::user::IamStatus>,
32962 {
32963 self.iam_status = std::option::Option::Some(v.into());
32964 self
32965 }
32966
32967 /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
32968 ///
32969 /// # Example
32970 /// ```ignore,no_run
32971 /// # use google_cloud_sql_v1::model::User;
32972 /// use google_cloud_sql_v1::model::user::IamStatus;
32973 /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
32974 /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
32975 /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
32976 /// ```
32977 pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
32978 where
32979 T: std::convert::Into<crate::model::user::IamStatus>,
32980 {
32981 self.iam_status = v.map(|x| x.into());
32982 self
32983 }
32984
32985 /// Sets the value of [database_roles][crate::model::User::database_roles].
32986 ///
32987 /// # Example
32988 /// ```ignore,no_run
32989 /// # use google_cloud_sql_v1::model::User;
32990 /// let x = User::new().set_database_roles(["a", "b", "c"]);
32991 /// ```
32992 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
32993 where
32994 T: std::iter::IntoIterator<Item = V>,
32995 V: std::convert::Into<std::string::String>,
32996 {
32997 use std::iter::Iterator;
32998 self.database_roles = v.into_iter().map(|i| i.into()).collect();
32999 self
33000 }
33001
33002 /// Sets the value of [user_details][crate::model::User::user_details].
33003 ///
33004 /// Note that all the setters affecting `user_details` are mutually
33005 /// exclusive.
33006 ///
33007 /// # Example
33008 /// ```ignore,no_run
33009 /// # use google_cloud_sql_v1::model::User;
33010 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
33011 /// let x = User::new().set_user_details(Some(
33012 /// google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
33013 /// ```
33014 pub fn set_user_details<
33015 T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
33016 >(
33017 mut self,
33018 v: T,
33019 ) -> Self {
33020 self.user_details = v.into();
33021 self
33022 }
33023
33024 /// The value of [user_details][crate::model::User::user_details]
33025 /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
33026 /// holds a different branch.
33027 pub fn sqlserver_user_details(
33028 &self,
33029 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
33030 #[allow(unreachable_patterns)]
33031 self.user_details.as_ref().and_then(|v| match v {
33032 crate::model::user::UserDetails::SqlserverUserDetails(v) => {
33033 std::option::Option::Some(v)
33034 }
33035 _ => std::option::Option::None,
33036 })
33037 }
33038
33039 /// Sets the value of [user_details][crate::model::User::user_details]
33040 /// to hold a `SqlserverUserDetails`.
33041 ///
33042 /// Note that all the setters affecting `user_details` are
33043 /// mutually exclusive.
33044 ///
33045 /// # Example
33046 /// ```ignore,no_run
33047 /// # use google_cloud_sql_v1::model::User;
33048 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
33049 /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
33050 /// assert!(x.sqlserver_user_details().is_some());
33051 /// ```
33052 pub fn set_sqlserver_user_details<
33053 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
33054 >(
33055 mut self,
33056 v: T,
33057 ) -> Self {
33058 self.user_details = std::option::Option::Some(
33059 crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
33060 );
33061 self
33062 }
33063}
33064
33065impl wkt::message::Message for User {
33066 fn typename() -> &'static str {
33067 "type.googleapis.com/google.cloud.sql.v1.User"
33068 }
33069}
33070
33071/// Defines additional types related to [User].
33072pub mod user {
33073 #[allow(unused_imports)]
33074 use super::*;
33075
33076 /// The user type.
33077 ///
33078 /// # Working with unknown values
33079 ///
33080 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33081 /// additional enum variants at any time. Adding new variants is not considered
33082 /// a breaking change. Applications should write their code in anticipation of:
33083 ///
33084 /// - New values appearing in future releases of the client library, **and**
33085 /// - New values received dynamically, without application changes.
33086 ///
33087 /// Please consult the [Working with enums] section in the user guide for some
33088 /// guidelines.
33089 ///
33090 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33091 #[derive(Clone, Debug, PartialEq)]
33092 #[non_exhaustive]
33093 pub enum SqlUserType {
33094 /// The database's built-in user type.
33095 BuiltIn,
33096 /// Cloud IAM user.
33097 CloudIamUser,
33098 /// Cloud IAM service account.
33099 CloudIamServiceAccount,
33100 /// Cloud IAM group. Not used for login.
33101 CloudIamGroup,
33102 /// Read-only. Login for a user that belongs to the Cloud IAM group.
33103 CloudIamGroupUser,
33104 /// Read-only. Login for a service account that belongs to the
33105 /// Cloud IAM group.
33106 CloudIamGroupServiceAccount,
33107 /// Cloud IAM workforce identity user managed via workforce identity
33108 /// federation.
33109 CloudIamWorkforceIdentity,
33110 /// Microsoft Entra ID user.
33111 EntraidUser,
33112 /// If set, the enum was initialized with an unknown value.
33113 ///
33114 /// Applications can examine the value using [SqlUserType::value] or
33115 /// [SqlUserType::name].
33116 UnknownValue(sql_user_type::UnknownValue),
33117 }
33118
33119 #[doc(hidden)]
33120 pub mod sql_user_type {
33121 #[allow(unused_imports)]
33122 use super::*;
33123 #[derive(Clone, Debug, PartialEq)]
33124 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33125 }
33126
33127 impl SqlUserType {
33128 /// Gets the enum value.
33129 ///
33130 /// Returns `None` if the enum contains an unknown value deserialized from
33131 /// the string representation of enums.
33132 pub fn value(&self) -> std::option::Option<i32> {
33133 match self {
33134 Self::BuiltIn => std::option::Option::Some(0),
33135 Self::CloudIamUser => std::option::Option::Some(1),
33136 Self::CloudIamServiceAccount => std::option::Option::Some(2),
33137 Self::CloudIamGroup => std::option::Option::Some(3),
33138 Self::CloudIamGroupUser => std::option::Option::Some(4),
33139 Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
33140 Self::CloudIamWorkforceIdentity => std::option::Option::Some(6),
33141 Self::EntraidUser => std::option::Option::Some(7),
33142 Self::UnknownValue(u) => u.0.value(),
33143 }
33144 }
33145
33146 /// Gets the enum value as a string.
33147 ///
33148 /// Returns `None` if the enum contains an unknown value deserialized from
33149 /// the integer representation of enums.
33150 pub fn name(&self) -> std::option::Option<&str> {
33151 match self {
33152 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
33153 Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
33154 Self::CloudIamServiceAccount => {
33155 std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
33156 }
33157 Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
33158 Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
33159 Self::CloudIamGroupServiceAccount => {
33160 std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
33161 }
33162 Self::CloudIamWorkforceIdentity => {
33163 std::option::Option::Some("CLOUD_IAM_WORKFORCE_IDENTITY")
33164 }
33165 Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
33166 Self::UnknownValue(u) => u.0.name(),
33167 }
33168 }
33169 }
33170
33171 impl std::default::Default for SqlUserType {
33172 fn default() -> Self {
33173 use std::convert::From;
33174 Self::from(0)
33175 }
33176 }
33177
33178 impl std::fmt::Display for SqlUserType {
33179 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33180 wkt::internal::display_enum(f, self.name(), self.value())
33181 }
33182 }
33183
33184 impl std::convert::From<i32> for SqlUserType {
33185 fn from(value: i32) -> Self {
33186 match value {
33187 0 => Self::BuiltIn,
33188 1 => Self::CloudIamUser,
33189 2 => Self::CloudIamServiceAccount,
33190 3 => Self::CloudIamGroup,
33191 4 => Self::CloudIamGroupUser,
33192 5 => Self::CloudIamGroupServiceAccount,
33193 6 => Self::CloudIamWorkforceIdentity,
33194 7 => Self::EntraidUser,
33195 _ => Self::UnknownValue(sql_user_type::UnknownValue(
33196 wkt::internal::UnknownEnumValue::Integer(value),
33197 )),
33198 }
33199 }
33200 }
33201
33202 impl std::convert::From<&str> for SqlUserType {
33203 fn from(value: &str) -> Self {
33204 use std::string::ToString;
33205 match value {
33206 "BUILT_IN" => Self::BuiltIn,
33207 "CLOUD_IAM_USER" => Self::CloudIamUser,
33208 "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
33209 "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
33210 "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
33211 "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
33212 "CLOUD_IAM_WORKFORCE_IDENTITY" => Self::CloudIamWorkforceIdentity,
33213 "ENTRAID_USER" => Self::EntraidUser,
33214 _ => Self::UnknownValue(sql_user_type::UnknownValue(
33215 wkt::internal::UnknownEnumValue::String(value.to_string()),
33216 )),
33217 }
33218 }
33219 }
33220
33221 impl serde::ser::Serialize for SqlUserType {
33222 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33223 where
33224 S: serde::Serializer,
33225 {
33226 match self {
33227 Self::BuiltIn => serializer.serialize_i32(0),
33228 Self::CloudIamUser => serializer.serialize_i32(1),
33229 Self::CloudIamServiceAccount => serializer.serialize_i32(2),
33230 Self::CloudIamGroup => serializer.serialize_i32(3),
33231 Self::CloudIamGroupUser => serializer.serialize_i32(4),
33232 Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
33233 Self::CloudIamWorkforceIdentity => serializer.serialize_i32(6),
33234 Self::EntraidUser => serializer.serialize_i32(7),
33235 Self::UnknownValue(u) => u.0.serialize(serializer),
33236 }
33237 }
33238 }
33239
33240 impl<'de> serde::de::Deserialize<'de> for SqlUserType {
33241 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33242 where
33243 D: serde::Deserializer<'de>,
33244 {
33245 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
33246 ".google.cloud.sql.v1.User.SqlUserType",
33247 ))
33248 }
33249 }
33250
33251 /// The type of retained password.
33252 ///
33253 /// # Working with unknown values
33254 ///
33255 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33256 /// additional enum variants at any time. Adding new variants is not considered
33257 /// a breaking change. Applications should write their code in anticipation of:
33258 ///
33259 /// - New values appearing in future releases of the client library, **and**
33260 /// - New values received dynamically, without application changes.
33261 ///
33262 /// Please consult the [Working with enums] section in the user guide for some
33263 /// guidelines.
33264 ///
33265 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33266 #[derive(Clone, Debug, PartialEq)]
33267 #[non_exhaustive]
33268 pub enum DualPasswordType {
33269 /// The default value.
33270 Unspecified,
33271 /// Do not update the user's dual password status.
33272 NoModifyDualPassword,
33273 /// No dual password usable for connecting using this user.
33274 NoDualPassword,
33275 /// Dual password usable for connecting using this user.
33276 DualPassword,
33277 /// If set, the enum was initialized with an unknown value.
33278 ///
33279 /// Applications can examine the value using [DualPasswordType::value] or
33280 /// [DualPasswordType::name].
33281 UnknownValue(dual_password_type::UnknownValue),
33282 }
33283
33284 #[doc(hidden)]
33285 pub mod dual_password_type {
33286 #[allow(unused_imports)]
33287 use super::*;
33288 #[derive(Clone, Debug, PartialEq)]
33289 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33290 }
33291
33292 impl DualPasswordType {
33293 /// Gets the enum value.
33294 ///
33295 /// Returns `None` if the enum contains an unknown value deserialized from
33296 /// the string representation of enums.
33297 pub fn value(&self) -> std::option::Option<i32> {
33298 match self {
33299 Self::Unspecified => std::option::Option::Some(0),
33300 Self::NoModifyDualPassword => std::option::Option::Some(1),
33301 Self::NoDualPassword => std::option::Option::Some(2),
33302 Self::DualPassword => std::option::Option::Some(3),
33303 Self::UnknownValue(u) => u.0.value(),
33304 }
33305 }
33306
33307 /// Gets the enum value as a string.
33308 ///
33309 /// Returns `None` if the enum contains an unknown value deserialized from
33310 /// the integer representation of enums.
33311 pub fn name(&self) -> std::option::Option<&str> {
33312 match self {
33313 Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
33314 Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
33315 Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
33316 Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
33317 Self::UnknownValue(u) => u.0.name(),
33318 }
33319 }
33320 }
33321
33322 impl std::default::Default for DualPasswordType {
33323 fn default() -> Self {
33324 use std::convert::From;
33325 Self::from(0)
33326 }
33327 }
33328
33329 impl std::fmt::Display for DualPasswordType {
33330 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33331 wkt::internal::display_enum(f, self.name(), self.value())
33332 }
33333 }
33334
33335 impl std::convert::From<i32> for DualPasswordType {
33336 fn from(value: i32) -> Self {
33337 match value {
33338 0 => Self::Unspecified,
33339 1 => Self::NoModifyDualPassword,
33340 2 => Self::NoDualPassword,
33341 3 => Self::DualPassword,
33342 _ => Self::UnknownValue(dual_password_type::UnknownValue(
33343 wkt::internal::UnknownEnumValue::Integer(value),
33344 )),
33345 }
33346 }
33347 }
33348
33349 impl std::convert::From<&str> for DualPasswordType {
33350 fn from(value: &str) -> Self {
33351 use std::string::ToString;
33352 match value {
33353 "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
33354 "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
33355 "NO_DUAL_PASSWORD" => Self::NoDualPassword,
33356 "DUAL_PASSWORD" => Self::DualPassword,
33357 _ => Self::UnknownValue(dual_password_type::UnknownValue(
33358 wkt::internal::UnknownEnumValue::String(value.to_string()),
33359 )),
33360 }
33361 }
33362 }
33363
33364 impl serde::ser::Serialize for DualPasswordType {
33365 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33366 where
33367 S: serde::Serializer,
33368 {
33369 match self {
33370 Self::Unspecified => serializer.serialize_i32(0),
33371 Self::NoModifyDualPassword => serializer.serialize_i32(1),
33372 Self::NoDualPassword => serializer.serialize_i32(2),
33373 Self::DualPassword => serializer.serialize_i32(3),
33374 Self::UnknownValue(u) => u.0.serialize(serializer),
33375 }
33376 }
33377 }
33378
33379 impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
33380 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33381 where
33382 D: serde::Deserializer<'de>,
33383 {
33384 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
33385 ".google.cloud.sql.v1.User.DualPasswordType",
33386 ))
33387 }
33388 }
33389
33390 /// Indicates if a group is available for IAM database authentication.
33391 ///
33392 /// # Working with unknown values
33393 ///
33394 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33395 /// additional enum variants at any time. Adding new variants is not considered
33396 /// a breaking change. Applications should write their code in anticipation of:
33397 ///
33398 /// - New values appearing in future releases of the client library, **and**
33399 /// - New values received dynamically, without application changes.
33400 ///
33401 /// Please consult the [Working with enums] section in the user guide for some
33402 /// guidelines.
33403 ///
33404 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33405 #[derive(Clone, Debug, PartialEq)]
33406 #[non_exhaustive]
33407 pub enum IamStatus {
33408 /// The default value for users that are not of type CLOUD_IAM_GROUP.
33409 /// Only CLOUD_IAM_GROUP users will be inactive or active.
33410 /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
33411 /// display whether they are active or inactive as that is not applicable to
33412 /// them.
33413 Unspecified,
33414 /// INACTIVE indicates a group is not available for IAM database
33415 /// authentication.
33416 Inactive,
33417 /// ACTIVE indicates a group is available for IAM database authentication.
33418 Active,
33419 /// If set, the enum was initialized with an unknown value.
33420 ///
33421 /// Applications can examine the value using [IamStatus::value] or
33422 /// [IamStatus::name].
33423 UnknownValue(iam_status::UnknownValue),
33424 }
33425
33426 #[doc(hidden)]
33427 pub mod iam_status {
33428 #[allow(unused_imports)]
33429 use super::*;
33430 #[derive(Clone, Debug, PartialEq)]
33431 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33432 }
33433
33434 impl IamStatus {
33435 /// Gets the enum value.
33436 ///
33437 /// Returns `None` if the enum contains an unknown value deserialized from
33438 /// the string representation of enums.
33439 pub fn value(&self) -> std::option::Option<i32> {
33440 match self {
33441 Self::Unspecified => std::option::Option::Some(0),
33442 Self::Inactive => std::option::Option::Some(1),
33443 Self::Active => std::option::Option::Some(2),
33444 Self::UnknownValue(u) => u.0.value(),
33445 }
33446 }
33447
33448 /// Gets the enum value as a string.
33449 ///
33450 /// Returns `None` if the enum contains an unknown value deserialized from
33451 /// the integer representation of enums.
33452 pub fn name(&self) -> std::option::Option<&str> {
33453 match self {
33454 Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
33455 Self::Inactive => std::option::Option::Some("INACTIVE"),
33456 Self::Active => std::option::Option::Some("ACTIVE"),
33457 Self::UnknownValue(u) => u.0.name(),
33458 }
33459 }
33460 }
33461
33462 impl std::default::Default for IamStatus {
33463 fn default() -> Self {
33464 use std::convert::From;
33465 Self::from(0)
33466 }
33467 }
33468
33469 impl std::fmt::Display for IamStatus {
33470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33471 wkt::internal::display_enum(f, self.name(), self.value())
33472 }
33473 }
33474
33475 impl std::convert::From<i32> for IamStatus {
33476 fn from(value: i32) -> Self {
33477 match value {
33478 0 => Self::Unspecified,
33479 1 => Self::Inactive,
33480 2 => Self::Active,
33481 _ => Self::UnknownValue(iam_status::UnknownValue(
33482 wkt::internal::UnknownEnumValue::Integer(value),
33483 )),
33484 }
33485 }
33486 }
33487
33488 impl std::convert::From<&str> for IamStatus {
33489 fn from(value: &str) -> Self {
33490 use std::string::ToString;
33491 match value {
33492 "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
33493 "INACTIVE" => Self::Inactive,
33494 "ACTIVE" => Self::Active,
33495 _ => Self::UnknownValue(iam_status::UnknownValue(
33496 wkt::internal::UnknownEnumValue::String(value.to_string()),
33497 )),
33498 }
33499 }
33500 }
33501
33502 impl serde::ser::Serialize for IamStatus {
33503 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33504 where
33505 S: serde::Serializer,
33506 {
33507 match self {
33508 Self::Unspecified => serializer.serialize_i32(0),
33509 Self::Inactive => serializer.serialize_i32(1),
33510 Self::Active => serializer.serialize_i32(2),
33511 Self::UnknownValue(u) => u.0.serialize(serializer),
33512 }
33513 }
33514 }
33515
33516 impl<'de> serde::de::Deserialize<'de> for IamStatus {
33517 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33518 where
33519 D: serde::Deserializer<'de>,
33520 {
33521 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
33522 ".google.cloud.sql.v1.User.IamStatus",
33523 ))
33524 }
33525 }
33526
33527 /// User details for specific database type
33528 #[derive(Clone, Debug, PartialEq)]
33529 #[non_exhaustive]
33530 pub enum UserDetails {
33531 #[allow(missing_docs)]
33532 SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
33533 }
33534}
33535
33536/// Represents a Sql Server user on the Cloud SQL instance.
33537#[derive(Clone, Default, PartialEq)]
33538#[non_exhaustive]
33539pub struct SqlServerUserDetails {
33540 /// If the user has been disabled
33541 pub disabled: bool,
33542
33543 /// The server roles for this user
33544 pub server_roles: std::vec::Vec<std::string::String>,
33545
33546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33547}
33548
33549impl SqlServerUserDetails {
33550 /// Creates a new default instance.
33551 pub fn new() -> Self {
33552 std::default::Default::default()
33553 }
33554
33555 /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
33556 ///
33557 /// # Example
33558 /// ```ignore,no_run
33559 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
33560 /// let x = SqlServerUserDetails::new().set_disabled(true);
33561 /// ```
33562 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33563 self.disabled = v.into();
33564 self
33565 }
33566
33567 /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
33568 ///
33569 /// # Example
33570 /// ```ignore,no_run
33571 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
33572 /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
33573 /// ```
33574 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
33575 where
33576 T: std::iter::IntoIterator<Item = V>,
33577 V: std::convert::Into<std::string::String>,
33578 {
33579 use std::iter::Iterator;
33580 self.server_roles = v.into_iter().map(|i| i.into()).collect();
33581 self
33582 }
33583}
33584
33585impl wkt::message::Message for SqlServerUserDetails {
33586 fn typename() -> &'static str {
33587 "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
33588 }
33589}
33590
33591/// User list response.
33592#[derive(Clone, Default, PartialEq)]
33593#[non_exhaustive]
33594pub struct UsersListResponse {
33595 /// This is always `sql#usersList`.
33596 pub kind: std::string::String,
33597
33598 /// List of user resources in the instance.
33599 pub items: std::vec::Vec<crate::model::User>,
33600
33601 /// Unused.
33602 #[deprecated]
33603 pub next_page_token: std::string::String,
33604
33605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33606}
33607
33608impl UsersListResponse {
33609 /// Creates a new default instance.
33610 pub fn new() -> Self {
33611 std::default::Default::default()
33612 }
33613
33614 /// Sets the value of [kind][crate::model::UsersListResponse::kind].
33615 ///
33616 /// # Example
33617 /// ```ignore,no_run
33618 /// # use google_cloud_sql_v1::model::UsersListResponse;
33619 /// let x = UsersListResponse::new().set_kind("example");
33620 /// ```
33621 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33622 self.kind = v.into();
33623 self
33624 }
33625
33626 /// Sets the value of [items][crate::model::UsersListResponse::items].
33627 ///
33628 /// # Example
33629 /// ```ignore,no_run
33630 /// # use google_cloud_sql_v1::model::UsersListResponse;
33631 /// use google_cloud_sql_v1::model::User;
33632 /// let x = UsersListResponse::new()
33633 /// .set_items([
33634 /// User::default()/* use setters */,
33635 /// User::default()/* use (different) setters */,
33636 /// ]);
33637 /// ```
33638 pub fn set_items<T, V>(mut self, v: T) -> Self
33639 where
33640 T: std::iter::IntoIterator<Item = V>,
33641 V: std::convert::Into<crate::model::User>,
33642 {
33643 use std::iter::Iterator;
33644 self.items = v.into_iter().map(|i| i.into()).collect();
33645 self
33646 }
33647
33648 /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
33649 ///
33650 /// # Example
33651 /// ```ignore,no_run
33652 /// # use google_cloud_sql_v1::model::UsersListResponse;
33653 /// let x = UsersListResponse::new().set_next_page_token("example");
33654 /// ```
33655 #[deprecated]
33656 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33657 self.next_page_token = v.into();
33658 self
33659 }
33660}
33661
33662impl wkt::message::Message for UsersListResponse {
33663 fn typename() -> &'static str {
33664 "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
33665 }
33666}
33667
33668/// The status of a backup run.
33669///
33670/// # Working with unknown values
33671///
33672/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33673/// additional enum variants at any time. Adding new variants is not considered
33674/// a breaking change. Applications should write their code in anticipation of:
33675///
33676/// - New values appearing in future releases of the client library, **and**
33677/// - New values received dynamically, without application changes.
33678///
33679/// Please consult the [Working with enums] section in the user guide for some
33680/// guidelines.
33681///
33682/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33683#[derive(Clone, Debug, PartialEq)]
33684#[non_exhaustive]
33685pub enum SqlBackupRunStatus {
33686 /// The status of the run is unknown.
33687 Unspecified,
33688 /// The backup operation was enqueued.
33689 Enqueued,
33690 /// The backup is overdue across a given backup window. Indicates a
33691 /// problem. Example: Long-running operation in progress during
33692 /// the whole window.
33693 Overdue,
33694 /// The backup is in progress.
33695 Running,
33696 /// The backup failed.
33697 Failed,
33698 /// The backup was successful.
33699 Successful,
33700 /// The backup was skipped (without problems) for a given backup
33701 /// window. Example: Instance was idle.
33702 Skipped,
33703 /// The backup is about to be deleted.
33704 DeletionPending,
33705 /// The backup deletion failed.
33706 DeletionFailed,
33707 /// The backup has been deleted.
33708 Deleted,
33709 /// If set, the enum was initialized with an unknown value.
33710 ///
33711 /// Applications can examine the value using [SqlBackupRunStatus::value] or
33712 /// [SqlBackupRunStatus::name].
33713 UnknownValue(sql_backup_run_status::UnknownValue),
33714}
33715
33716#[doc(hidden)]
33717pub mod sql_backup_run_status {
33718 #[allow(unused_imports)]
33719 use super::*;
33720 #[derive(Clone, Debug, PartialEq)]
33721 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33722}
33723
33724impl SqlBackupRunStatus {
33725 /// Gets the enum value.
33726 ///
33727 /// Returns `None` if the enum contains an unknown value deserialized from
33728 /// the string representation of enums.
33729 pub fn value(&self) -> std::option::Option<i32> {
33730 match self {
33731 Self::Unspecified => std::option::Option::Some(0),
33732 Self::Enqueued => std::option::Option::Some(1),
33733 Self::Overdue => std::option::Option::Some(2),
33734 Self::Running => std::option::Option::Some(3),
33735 Self::Failed => std::option::Option::Some(4),
33736 Self::Successful => std::option::Option::Some(5),
33737 Self::Skipped => std::option::Option::Some(6),
33738 Self::DeletionPending => std::option::Option::Some(7),
33739 Self::DeletionFailed => std::option::Option::Some(8),
33740 Self::Deleted => std::option::Option::Some(9),
33741 Self::UnknownValue(u) => u.0.value(),
33742 }
33743 }
33744
33745 /// Gets the enum value as a string.
33746 ///
33747 /// Returns `None` if the enum contains an unknown value deserialized from
33748 /// the integer representation of enums.
33749 pub fn name(&self) -> std::option::Option<&str> {
33750 match self {
33751 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
33752 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
33753 Self::Overdue => std::option::Option::Some("OVERDUE"),
33754 Self::Running => std::option::Option::Some("RUNNING"),
33755 Self::Failed => std::option::Option::Some("FAILED"),
33756 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
33757 Self::Skipped => std::option::Option::Some("SKIPPED"),
33758 Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
33759 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
33760 Self::Deleted => std::option::Option::Some("DELETED"),
33761 Self::UnknownValue(u) => u.0.name(),
33762 }
33763 }
33764}
33765
33766impl std::default::Default for SqlBackupRunStatus {
33767 fn default() -> Self {
33768 use std::convert::From;
33769 Self::from(0)
33770 }
33771}
33772
33773impl std::fmt::Display for SqlBackupRunStatus {
33774 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33775 wkt::internal::display_enum(f, self.name(), self.value())
33776 }
33777}
33778
33779impl std::convert::From<i32> for SqlBackupRunStatus {
33780 fn from(value: i32) -> Self {
33781 match value {
33782 0 => Self::Unspecified,
33783 1 => Self::Enqueued,
33784 2 => Self::Overdue,
33785 3 => Self::Running,
33786 4 => Self::Failed,
33787 5 => Self::Successful,
33788 6 => Self::Skipped,
33789 7 => Self::DeletionPending,
33790 8 => Self::DeletionFailed,
33791 9 => Self::Deleted,
33792 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
33793 wkt::internal::UnknownEnumValue::Integer(value),
33794 )),
33795 }
33796 }
33797}
33798
33799impl std::convert::From<&str> for SqlBackupRunStatus {
33800 fn from(value: &str) -> Self {
33801 use std::string::ToString;
33802 match value {
33803 "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
33804 "ENQUEUED" => Self::Enqueued,
33805 "OVERDUE" => Self::Overdue,
33806 "RUNNING" => Self::Running,
33807 "FAILED" => Self::Failed,
33808 "SUCCESSFUL" => Self::Successful,
33809 "SKIPPED" => Self::Skipped,
33810 "DELETION_PENDING" => Self::DeletionPending,
33811 "DELETION_FAILED" => Self::DeletionFailed,
33812 "DELETED" => Self::Deleted,
33813 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
33814 wkt::internal::UnknownEnumValue::String(value.to_string()),
33815 )),
33816 }
33817 }
33818}
33819
33820impl serde::ser::Serialize for SqlBackupRunStatus {
33821 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33822 where
33823 S: serde::Serializer,
33824 {
33825 match self {
33826 Self::Unspecified => serializer.serialize_i32(0),
33827 Self::Enqueued => serializer.serialize_i32(1),
33828 Self::Overdue => serializer.serialize_i32(2),
33829 Self::Running => serializer.serialize_i32(3),
33830 Self::Failed => serializer.serialize_i32(4),
33831 Self::Successful => serializer.serialize_i32(5),
33832 Self::Skipped => serializer.serialize_i32(6),
33833 Self::DeletionPending => serializer.serialize_i32(7),
33834 Self::DeletionFailed => serializer.serialize_i32(8),
33835 Self::Deleted => serializer.serialize_i32(9),
33836 Self::UnknownValue(u) => u.0.serialize(serializer),
33837 }
33838 }
33839}
33840
33841impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
33842 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33843 where
33844 D: serde::Deserializer<'de>,
33845 {
33846 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
33847 ".google.cloud.sql.v1.SqlBackupRunStatus",
33848 ))
33849 }
33850}
33851
33852/// Defines the supported backup kinds.
33853///
33854/// # Working with unknown values
33855///
33856/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33857/// additional enum variants at any time. Adding new variants is not considered
33858/// a breaking change. Applications should write their code in anticipation of:
33859///
33860/// - New values appearing in future releases of the client library, **and**
33861/// - New values received dynamically, without application changes.
33862///
33863/// Please consult the [Working with enums] section in the user guide for some
33864/// guidelines.
33865///
33866/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33867#[derive(Clone, Debug, PartialEq)]
33868#[non_exhaustive]
33869pub enum SqlBackupKind {
33870 /// This is an unknown BackupKind.
33871 Unspecified,
33872 /// Snapshot-based backups.
33873 Snapshot,
33874 /// Physical backups.
33875 Physical,
33876 /// If set, the enum was initialized with an unknown value.
33877 ///
33878 /// Applications can examine the value using [SqlBackupKind::value] or
33879 /// [SqlBackupKind::name].
33880 UnknownValue(sql_backup_kind::UnknownValue),
33881}
33882
33883#[doc(hidden)]
33884pub mod sql_backup_kind {
33885 #[allow(unused_imports)]
33886 use super::*;
33887 #[derive(Clone, Debug, PartialEq)]
33888 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33889}
33890
33891impl SqlBackupKind {
33892 /// Gets the enum value.
33893 ///
33894 /// Returns `None` if the enum contains an unknown value deserialized from
33895 /// the string representation of enums.
33896 pub fn value(&self) -> std::option::Option<i32> {
33897 match self {
33898 Self::Unspecified => std::option::Option::Some(0),
33899 Self::Snapshot => std::option::Option::Some(1),
33900 Self::Physical => std::option::Option::Some(2),
33901 Self::UnknownValue(u) => u.0.value(),
33902 }
33903 }
33904
33905 /// Gets the enum value as a string.
33906 ///
33907 /// Returns `None` if the enum contains an unknown value deserialized from
33908 /// the integer representation of enums.
33909 pub fn name(&self) -> std::option::Option<&str> {
33910 match self {
33911 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
33912 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
33913 Self::Physical => std::option::Option::Some("PHYSICAL"),
33914 Self::UnknownValue(u) => u.0.name(),
33915 }
33916 }
33917}
33918
33919impl std::default::Default for SqlBackupKind {
33920 fn default() -> Self {
33921 use std::convert::From;
33922 Self::from(0)
33923 }
33924}
33925
33926impl std::fmt::Display for SqlBackupKind {
33927 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33928 wkt::internal::display_enum(f, self.name(), self.value())
33929 }
33930}
33931
33932impl std::convert::From<i32> for SqlBackupKind {
33933 fn from(value: i32) -> Self {
33934 match value {
33935 0 => Self::Unspecified,
33936 1 => Self::Snapshot,
33937 2 => Self::Physical,
33938 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
33939 wkt::internal::UnknownEnumValue::Integer(value),
33940 )),
33941 }
33942 }
33943}
33944
33945impl std::convert::From<&str> for SqlBackupKind {
33946 fn from(value: &str) -> Self {
33947 use std::string::ToString;
33948 match value {
33949 "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
33950 "SNAPSHOT" => Self::Snapshot,
33951 "PHYSICAL" => Self::Physical,
33952 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
33953 wkt::internal::UnknownEnumValue::String(value.to_string()),
33954 )),
33955 }
33956 }
33957}
33958
33959impl serde::ser::Serialize for SqlBackupKind {
33960 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33961 where
33962 S: serde::Serializer,
33963 {
33964 match self {
33965 Self::Unspecified => serializer.serialize_i32(0),
33966 Self::Snapshot => serializer.serialize_i32(1),
33967 Self::Physical => serializer.serialize_i32(2),
33968 Self::UnknownValue(u) => u.0.serialize(serializer),
33969 }
33970 }
33971}
33972
33973impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
33974 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33975 where
33976 D: serde::Deserializer<'de>,
33977 {
33978 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
33979 ".google.cloud.sql.v1.SqlBackupKind",
33980 ))
33981 }
33982}
33983
33984/// Type of backup (i.e. automated, on demand, etc).
33985///
33986/// # Working with unknown values
33987///
33988/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33989/// additional enum variants at any time. Adding new variants is not considered
33990/// a breaking change. Applications should write their code in anticipation of:
33991///
33992/// - New values appearing in future releases of the client library, **and**
33993/// - New values received dynamically, without application changes.
33994///
33995/// Please consult the [Working with enums] section in the user guide for some
33996/// guidelines.
33997///
33998/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33999#[derive(Clone, Debug, PartialEq)]
34000#[non_exhaustive]
34001pub enum SqlBackupRunType {
34002 /// This is an unknown BackupRun type.
34003 Unspecified,
34004 /// The backup schedule automatically triggers a backup.
34005 Automated,
34006 /// The user manually triggers a backup.
34007 OnDemand,
34008 /// If set, the enum was initialized with an unknown value.
34009 ///
34010 /// Applications can examine the value using [SqlBackupRunType::value] or
34011 /// [SqlBackupRunType::name].
34012 UnknownValue(sql_backup_run_type::UnknownValue),
34013}
34014
34015#[doc(hidden)]
34016pub mod sql_backup_run_type {
34017 #[allow(unused_imports)]
34018 use super::*;
34019 #[derive(Clone, Debug, PartialEq)]
34020 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34021}
34022
34023impl SqlBackupRunType {
34024 /// Gets the enum value.
34025 ///
34026 /// Returns `None` if the enum contains an unknown value deserialized from
34027 /// the string representation of enums.
34028 pub fn value(&self) -> std::option::Option<i32> {
34029 match self {
34030 Self::Unspecified => std::option::Option::Some(0),
34031 Self::Automated => std::option::Option::Some(1),
34032 Self::OnDemand => std::option::Option::Some(2),
34033 Self::UnknownValue(u) => u.0.value(),
34034 }
34035 }
34036
34037 /// Gets the enum value as a string.
34038 ///
34039 /// Returns `None` if the enum contains an unknown value deserialized from
34040 /// the integer representation of enums.
34041 pub fn name(&self) -> std::option::Option<&str> {
34042 match self {
34043 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
34044 Self::Automated => std::option::Option::Some("AUTOMATED"),
34045 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
34046 Self::UnknownValue(u) => u.0.name(),
34047 }
34048 }
34049}
34050
34051impl std::default::Default for SqlBackupRunType {
34052 fn default() -> Self {
34053 use std::convert::From;
34054 Self::from(0)
34055 }
34056}
34057
34058impl std::fmt::Display for SqlBackupRunType {
34059 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34060 wkt::internal::display_enum(f, self.name(), self.value())
34061 }
34062}
34063
34064impl std::convert::From<i32> for SqlBackupRunType {
34065 fn from(value: i32) -> Self {
34066 match value {
34067 0 => Self::Unspecified,
34068 1 => Self::Automated,
34069 2 => Self::OnDemand,
34070 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
34071 wkt::internal::UnknownEnumValue::Integer(value),
34072 )),
34073 }
34074 }
34075}
34076
34077impl std::convert::From<&str> for SqlBackupRunType {
34078 fn from(value: &str) -> Self {
34079 use std::string::ToString;
34080 match value {
34081 "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
34082 "AUTOMATED" => Self::Automated,
34083 "ON_DEMAND" => Self::OnDemand,
34084 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
34085 wkt::internal::UnknownEnumValue::String(value.to_string()),
34086 )),
34087 }
34088 }
34089}
34090
34091impl serde::ser::Serialize for SqlBackupRunType {
34092 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34093 where
34094 S: serde::Serializer,
34095 {
34096 match self {
34097 Self::Unspecified => serializer.serialize_i32(0),
34098 Self::Automated => serializer.serialize_i32(1),
34099 Self::OnDemand => serializer.serialize_i32(2),
34100 Self::UnknownValue(u) => u.0.serialize(serializer),
34101 }
34102 }
34103}
34104
34105impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
34106 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34107 where
34108 D: serde::Deserializer<'de>,
34109 {
34110 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
34111 ".google.cloud.sql.v1.SqlBackupRunType",
34112 ))
34113 }
34114}
34115
34116/// Enum for [SqlFlagType].
34117///
34118/// # Working with unknown values
34119///
34120/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34121/// additional enum variants at any time. Adding new variants is not considered
34122/// a breaking change. Applications should write their code in anticipation of:
34123///
34124/// - New values appearing in future releases of the client library, **and**
34125/// - New values received dynamically, without application changes.
34126///
34127/// Please consult the [Working with enums] section in the user guide for some
34128/// guidelines.
34129///
34130/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34131#[derive(Clone, Debug, PartialEq)]
34132#[non_exhaustive]
34133pub enum SqlFlagType {
34134 /// This is an unknown flag type.
34135 Unspecified,
34136 /// Boolean type flag.
34137 Boolean,
34138 /// String type flag.
34139 String,
34140 /// Integer type flag.
34141 Integer,
34142 /// Flag type used for a server startup option.
34143 None,
34144 /// Type introduced specially for MySQL TimeZone offset. Accept a string value
34145 /// with the format [-12:59, 13:00].
34146 MysqlTimezoneOffset,
34147 /// Float type flag.
34148 Float,
34149 /// Comma-separated list of the strings in a SqlFlagType enum.
34150 RepeatedString,
34151 /// If set, the enum was initialized with an unknown value.
34152 ///
34153 /// Applications can examine the value using [SqlFlagType::value] or
34154 /// [SqlFlagType::name].
34155 UnknownValue(sql_flag_type::UnknownValue),
34156}
34157
34158#[doc(hidden)]
34159pub mod sql_flag_type {
34160 #[allow(unused_imports)]
34161 use super::*;
34162 #[derive(Clone, Debug, PartialEq)]
34163 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34164}
34165
34166impl SqlFlagType {
34167 /// Gets the enum value.
34168 ///
34169 /// Returns `None` if the enum contains an unknown value deserialized from
34170 /// the string representation of enums.
34171 pub fn value(&self) -> std::option::Option<i32> {
34172 match self {
34173 Self::Unspecified => std::option::Option::Some(0),
34174 Self::Boolean => std::option::Option::Some(1),
34175 Self::String => std::option::Option::Some(2),
34176 Self::Integer => std::option::Option::Some(3),
34177 Self::None => std::option::Option::Some(4),
34178 Self::MysqlTimezoneOffset => std::option::Option::Some(5),
34179 Self::Float => std::option::Option::Some(6),
34180 Self::RepeatedString => std::option::Option::Some(7),
34181 Self::UnknownValue(u) => u.0.value(),
34182 }
34183 }
34184
34185 /// Gets the enum value as a string.
34186 ///
34187 /// Returns `None` if the enum contains an unknown value deserialized from
34188 /// the integer representation of enums.
34189 pub fn name(&self) -> std::option::Option<&str> {
34190 match self {
34191 Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
34192 Self::Boolean => std::option::Option::Some("BOOLEAN"),
34193 Self::String => std::option::Option::Some("STRING"),
34194 Self::Integer => std::option::Option::Some("INTEGER"),
34195 Self::None => std::option::Option::Some("NONE"),
34196 Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
34197 Self::Float => std::option::Option::Some("FLOAT"),
34198 Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
34199 Self::UnknownValue(u) => u.0.name(),
34200 }
34201 }
34202}
34203
34204impl std::default::Default for SqlFlagType {
34205 fn default() -> Self {
34206 use std::convert::From;
34207 Self::from(0)
34208 }
34209}
34210
34211impl std::fmt::Display for SqlFlagType {
34212 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34213 wkt::internal::display_enum(f, self.name(), self.value())
34214 }
34215}
34216
34217impl std::convert::From<i32> for SqlFlagType {
34218 fn from(value: i32) -> Self {
34219 match value {
34220 0 => Self::Unspecified,
34221 1 => Self::Boolean,
34222 2 => Self::String,
34223 3 => Self::Integer,
34224 4 => Self::None,
34225 5 => Self::MysqlTimezoneOffset,
34226 6 => Self::Float,
34227 7 => Self::RepeatedString,
34228 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
34229 wkt::internal::UnknownEnumValue::Integer(value),
34230 )),
34231 }
34232 }
34233}
34234
34235impl std::convert::From<&str> for SqlFlagType {
34236 fn from(value: &str) -> Self {
34237 use std::string::ToString;
34238 match value {
34239 "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
34240 "BOOLEAN" => Self::Boolean,
34241 "STRING" => Self::String,
34242 "INTEGER" => Self::Integer,
34243 "NONE" => Self::None,
34244 "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
34245 "FLOAT" => Self::Float,
34246 "REPEATED_STRING" => Self::RepeatedString,
34247 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
34248 wkt::internal::UnknownEnumValue::String(value.to_string()),
34249 )),
34250 }
34251 }
34252}
34253
34254impl serde::ser::Serialize for SqlFlagType {
34255 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34256 where
34257 S: serde::Serializer,
34258 {
34259 match self {
34260 Self::Unspecified => serializer.serialize_i32(0),
34261 Self::Boolean => serializer.serialize_i32(1),
34262 Self::String => serializer.serialize_i32(2),
34263 Self::Integer => serializer.serialize_i32(3),
34264 Self::None => serializer.serialize_i32(4),
34265 Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
34266 Self::Float => serializer.serialize_i32(6),
34267 Self::RepeatedString => serializer.serialize_i32(7),
34268 Self::UnknownValue(u) => u.0.serialize(serializer),
34269 }
34270 }
34271}
34272
34273impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
34274 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34275 where
34276 D: serde::Deserializer<'de>,
34277 {
34278 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
34279 ".google.cloud.sql.v1.SqlFlagType",
34280 ))
34281 }
34282}
34283
34284/// Scopes of a flag describe where the flag is used.
34285///
34286/// # Working with unknown values
34287///
34288/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34289/// additional enum variants at any time. Adding new variants is not considered
34290/// a breaking change. Applications should write their code in anticipation of:
34291///
34292/// - New values appearing in future releases of the client library, **and**
34293/// - New values received dynamically, without application changes.
34294///
34295/// Please consult the [Working with enums] section in the user guide for some
34296/// guidelines.
34297///
34298/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34299#[derive(Clone, Debug, PartialEq)]
34300#[non_exhaustive]
34301pub enum SqlFlagScope {
34302 /// Assume database flags if unspecified
34303 Unspecified,
34304 /// database flags
34305 Database,
34306 /// connection pool configuration flags
34307 ConnectionPool,
34308 /// If set, the enum was initialized with an unknown value.
34309 ///
34310 /// Applications can examine the value using [SqlFlagScope::value] or
34311 /// [SqlFlagScope::name].
34312 UnknownValue(sql_flag_scope::UnknownValue),
34313}
34314
34315#[doc(hidden)]
34316pub mod sql_flag_scope {
34317 #[allow(unused_imports)]
34318 use super::*;
34319 #[derive(Clone, Debug, PartialEq)]
34320 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34321}
34322
34323impl SqlFlagScope {
34324 /// Gets the enum value.
34325 ///
34326 /// Returns `None` if the enum contains an unknown value deserialized from
34327 /// the string representation of enums.
34328 pub fn value(&self) -> std::option::Option<i32> {
34329 match self {
34330 Self::Unspecified => std::option::Option::Some(0),
34331 Self::Database => std::option::Option::Some(1),
34332 Self::ConnectionPool => std::option::Option::Some(2),
34333 Self::UnknownValue(u) => u.0.value(),
34334 }
34335 }
34336
34337 /// Gets the enum value as a string.
34338 ///
34339 /// Returns `None` if the enum contains an unknown value deserialized from
34340 /// the integer representation of enums.
34341 pub fn name(&self) -> std::option::Option<&str> {
34342 match self {
34343 Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
34344 Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
34345 Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
34346 Self::UnknownValue(u) => u.0.name(),
34347 }
34348 }
34349}
34350
34351impl std::default::Default for SqlFlagScope {
34352 fn default() -> Self {
34353 use std::convert::From;
34354 Self::from(0)
34355 }
34356}
34357
34358impl std::fmt::Display for SqlFlagScope {
34359 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34360 wkt::internal::display_enum(f, self.name(), self.value())
34361 }
34362}
34363
34364impl std::convert::From<i32> for SqlFlagScope {
34365 fn from(value: i32) -> Self {
34366 match value {
34367 0 => Self::Unspecified,
34368 1 => Self::Database,
34369 2 => Self::ConnectionPool,
34370 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
34371 wkt::internal::UnknownEnumValue::Integer(value),
34372 )),
34373 }
34374 }
34375}
34376
34377impl std::convert::From<&str> for SqlFlagScope {
34378 fn from(value: &str) -> Self {
34379 use std::string::ToString;
34380 match value {
34381 "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
34382 "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
34383 "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
34384 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
34385 wkt::internal::UnknownEnumValue::String(value.to_string()),
34386 )),
34387 }
34388 }
34389}
34390
34391impl serde::ser::Serialize for SqlFlagScope {
34392 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34393 where
34394 S: serde::Serializer,
34395 {
34396 match self {
34397 Self::Unspecified => serializer.serialize_i32(0),
34398 Self::Database => serializer.serialize_i32(1),
34399 Self::ConnectionPool => serializer.serialize_i32(2),
34400 Self::UnknownValue(u) => u.0.serialize(serializer),
34401 }
34402 }
34403}
34404
34405impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
34406 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34407 where
34408 D: serde::Deserializer<'de>,
34409 {
34410 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
34411 ".google.cloud.sql.v1.SqlFlagScope",
34412 ))
34413 }
34414}
34415
34416/// External Sync parallel level.
34417///
34418/// # Working with unknown values
34419///
34420/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34421/// additional enum variants at any time. Adding new variants is not considered
34422/// a breaking change. Applications should write their code in anticipation of:
34423///
34424/// - New values appearing in future releases of the client library, **and**
34425/// - New values received dynamically, without application changes.
34426///
34427/// Please consult the [Working with enums] section in the user guide for some
34428/// guidelines.
34429///
34430/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34431#[derive(Clone, Debug, PartialEq)]
34432#[non_exhaustive]
34433pub enum ExternalSyncParallelLevel {
34434 /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
34435 Unspecified,
34436 /// Minimal parallel level.
34437 Min,
34438 /// Optimal parallel level.
34439 Optimal,
34440 /// Maximum parallel level.
34441 Max,
34442 /// If set, the enum was initialized with an unknown value.
34443 ///
34444 /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
34445 /// [ExternalSyncParallelLevel::name].
34446 UnknownValue(external_sync_parallel_level::UnknownValue),
34447}
34448
34449#[doc(hidden)]
34450pub mod external_sync_parallel_level {
34451 #[allow(unused_imports)]
34452 use super::*;
34453 #[derive(Clone, Debug, PartialEq)]
34454 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34455}
34456
34457impl ExternalSyncParallelLevel {
34458 /// Gets the enum value.
34459 ///
34460 /// Returns `None` if the enum contains an unknown value deserialized from
34461 /// the string representation of enums.
34462 pub fn value(&self) -> std::option::Option<i32> {
34463 match self {
34464 Self::Unspecified => std::option::Option::Some(0),
34465 Self::Min => std::option::Option::Some(1),
34466 Self::Optimal => std::option::Option::Some(2),
34467 Self::Max => std::option::Option::Some(3),
34468 Self::UnknownValue(u) => u.0.value(),
34469 }
34470 }
34471
34472 /// Gets the enum value as a string.
34473 ///
34474 /// Returns `None` if the enum contains an unknown value deserialized from
34475 /// the integer representation of enums.
34476 pub fn name(&self) -> std::option::Option<&str> {
34477 match self {
34478 Self::Unspecified => {
34479 std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
34480 }
34481 Self::Min => std::option::Option::Some("MIN"),
34482 Self::Optimal => std::option::Option::Some("OPTIMAL"),
34483 Self::Max => std::option::Option::Some("MAX"),
34484 Self::UnknownValue(u) => u.0.name(),
34485 }
34486 }
34487}
34488
34489impl std::default::Default for ExternalSyncParallelLevel {
34490 fn default() -> Self {
34491 use std::convert::From;
34492 Self::from(0)
34493 }
34494}
34495
34496impl std::fmt::Display for ExternalSyncParallelLevel {
34497 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34498 wkt::internal::display_enum(f, self.name(), self.value())
34499 }
34500}
34501
34502impl std::convert::From<i32> for ExternalSyncParallelLevel {
34503 fn from(value: i32) -> Self {
34504 match value {
34505 0 => Self::Unspecified,
34506 1 => Self::Min,
34507 2 => Self::Optimal,
34508 3 => Self::Max,
34509 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
34510 wkt::internal::UnknownEnumValue::Integer(value),
34511 )),
34512 }
34513 }
34514}
34515
34516impl std::convert::From<&str> for ExternalSyncParallelLevel {
34517 fn from(value: &str) -> Self {
34518 use std::string::ToString;
34519 match value {
34520 "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
34521 "MIN" => Self::Min,
34522 "OPTIMAL" => Self::Optimal,
34523 "MAX" => Self::Max,
34524 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
34525 wkt::internal::UnknownEnumValue::String(value.to_string()),
34526 )),
34527 }
34528 }
34529}
34530
34531impl serde::ser::Serialize for ExternalSyncParallelLevel {
34532 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34533 where
34534 S: serde::Serializer,
34535 {
34536 match self {
34537 Self::Unspecified => serializer.serialize_i32(0),
34538 Self::Min => serializer.serialize_i32(1),
34539 Self::Optimal => serializer.serialize_i32(2),
34540 Self::Max => serializer.serialize_i32(3),
34541 Self::UnknownValue(u) => u.0.serialize(serializer),
34542 }
34543 }
34544}
34545
34546impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
34547 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34548 where
34549 D: serde::Deserializer<'de>,
34550 {
34551 deserializer.deserialize_any(
34552 wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
34553 ".google.cloud.sql.v1.ExternalSyncParallelLevel",
34554 ),
34555 )
34556 }
34557}
34558
34559/// Enum for [SqlInstanceType].
34560///
34561/// # Working with unknown values
34562///
34563/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34564/// additional enum variants at any time. Adding new variants is not considered
34565/// a breaking change. Applications should write their code in anticipation of:
34566///
34567/// - New values appearing in future releases of the client library, **and**
34568/// - New values received dynamically, without application changes.
34569///
34570/// Please consult the [Working with enums] section in the user guide for some
34571/// guidelines.
34572///
34573/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34574#[derive(Clone, Debug, PartialEq)]
34575#[non_exhaustive]
34576pub enum SqlInstanceType {
34577 /// This is an unknown Cloud SQL instance type.
34578 Unspecified,
34579 /// A regular Cloud SQL instance that is not replicating from a primary
34580 /// instance.
34581 CloudSqlInstance,
34582 /// An instance running on the customer's premises that is not managed by
34583 /// Cloud SQL.
34584 OnPremisesInstance,
34585 /// A Cloud SQL instance acting as a read-replica.
34586 ReadReplicaInstance,
34587 /// A Cloud SQL read pool.
34588 ReadPoolInstance,
34589 /// If set, the enum was initialized with an unknown value.
34590 ///
34591 /// Applications can examine the value using [SqlInstanceType::value] or
34592 /// [SqlInstanceType::name].
34593 UnknownValue(sql_instance_type::UnknownValue),
34594}
34595
34596#[doc(hidden)]
34597pub mod sql_instance_type {
34598 #[allow(unused_imports)]
34599 use super::*;
34600 #[derive(Clone, Debug, PartialEq)]
34601 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34602}
34603
34604impl SqlInstanceType {
34605 /// Gets the enum value.
34606 ///
34607 /// Returns `None` if the enum contains an unknown value deserialized from
34608 /// the string representation of enums.
34609 pub fn value(&self) -> std::option::Option<i32> {
34610 match self {
34611 Self::Unspecified => std::option::Option::Some(0),
34612 Self::CloudSqlInstance => std::option::Option::Some(1),
34613 Self::OnPremisesInstance => std::option::Option::Some(2),
34614 Self::ReadReplicaInstance => std::option::Option::Some(3),
34615 Self::ReadPoolInstance => std::option::Option::Some(5),
34616 Self::UnknownValue(u) => u.0.value(),
34617 }
34618 }
34619
34620 /// Gets the enum value as a string.
34621 ///
34622 /// Returns `None` if the enum contains an unknown value deserialized from
34623 /// the integer representation of enums.
34624 pub fn name(&self) -> std::option::Option<&str> {
34625 match self {
34626 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
34627 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
34628 Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
34629 Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
34630 Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
34631 Self::UnknownValue(u) => u.0.name(),
34632 }
34633 }
34634}
34635
34636impl std::default::Default for SqlInstanceType {
34637 fn default() -> Self {
34638 use std::convert::From;
34639 Self::from(0)
34640 }
34641}
34642
34643impl std::fmt::Display for SqlInstanceType {
34644 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34645 wkt::internal::display_enum(f, self.name(), self.value())
34646 }
34647}
34648
34649impl std::convert::From<i32> for SqlInstanceType {
34650 fn from(value: i32) -> Self {
34651 match value {
34652 0 => Self::Unspecified,
34653 1 => Self::CloudSqlInstance,
34654 2 => Self::OnPremisesInstance,
34655 3 => Self::ReadReplicaInstance,
34656 5 => Self::ReadPoolInstance,
34657 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
34658 wkt::internal::UnknownEnumValue::Integer(value),
34659 )),
34660 }
34661 }
34662}
34663
34664impl std::convert::From<&str> for SqlInstanceType {
34665 fn from(value: &str) -> Self {
34666 use std::string::ToString;
34667 match value {
34668 "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
34669 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
34670 "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
34671 "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
34672 "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
34673 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
34674 wkt::internal::UnknownEnumValue::String(value.to_string()),
34675 )),
34676 }
34677 }
34678}
34679
34680impl serde::ser::Serialize for SqlInstanceType {
34681 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34682 where
34683 S: serde::Serializer,
34684 {
34685 match self {
34686 Self::Unspecified => serializer.serialize_i32(0),
34687 Self::CloudSqlInstance => serializer.serialize_i32(1),
34688 Self::OnPremisesInstance => serializer.serialize_i32(2),
34689 Self::ReadReplicaInstance => serializer.serialize_i32(3),
34690 Self::ReadPoolInstance => serializer.serialize_i32(5),
34691 Self::UnknownValue(u) => u.0.serialize(serializer),
34692 }
34693 }
34694}
34695
34696impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
34697 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34698 where
34699 D: serde::Deserializer<'de>,
34700 {
34701 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
34702 ".google.cloud.sql.v1.SqlInstanceType",
34703 ))
34704 }
34705}
34706
34707/// The suspension reason of the database instance if the state is SUSPENDED.
34708///
34709/// # Working with unknown values
34710///
34711/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34712/// additional enum variants at any time. Adding new variants is not considered
34713/// a breaking change. Applications should write their code in anticipation of:
34714///
34715/// - New values appearing in future releases of the client library, **and**
34716/// - New values received dynamically, without application changes.
34717///
34718/// Please consult the [Working with enums] section in the user guide for some
34719/// guidelines.
34720///
34721/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34722#[derive(Clone, Debug, PartialEq)]
34723#[non_exhaustive]
34724pub enum SqlSuspensionReason {
34725 /// This is an unknown suspension reason.
34726 Unspecified,
34727 /// The instance is suspended due to billing issues (for example:, account
34728 /// issue)
34729 BillingIssue,
34730 /// The instance is suspended due to illegal content (for example:, child
34731 /// pornography, copyrighted material, etc.).
34732 LegalIssue,
34733 /// The instance is causing operational issues (for example:, causing the
34734 /// database to crash).
34735 OperationalIssue,
34736 /// The KMS key used by the instance is either revoked or denied access to
34737 KmsKeyIssue,
34738 /// The project is suspended due to abuse detected by Ares.
34739 ProjectAbuse,
34740 /// If set, the enum was initialized with an unknown value.
34741 ///
34742 /// Applications can examine the value using [SqlSuspensionReason::value] or
34743 /// [SqlSuspensionReason::name].
34744 UnknownValue(sql_suspension_reason::UnknownValue),
34745}
34746
34747#[doc(hidden)]
34748pub mod sql_suspension_reason {
34749 #[allow(unused_imports)]
34750 use super::*;
34751 #[derive(Clone, Debug, PartialEq)]
34752 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34753}
34754
34755impl SqlSuspensionReason {
34756 /// Gets the enum value.
34757 ///
34758 /// Returns `None` if the enum contains an unknown value deserialized from
34759 /// the string representation of enums.
34760 pub fn value(&self) -> std::option::Option<i32> {
34761 match self {
34762 Self::Unspecified => std::option::Option::Some(0),
34763 Self::BillingIssue => std::option::Option::Some(2),
34764 Self::LegalIssue => std::option::Option::Some(3),
34765 Self::OperationalIssue => std::option::Option::Some(4),
34766 Self::KmsKeyIssue => std::option::Option::Some(5),
34767 Self::ProjectAbuse => std::option::Option::Some(8),
34768 Self::UnknownValue(u) => u.0.value(),
34769 }
34770 }
34771
34772 /// Gets the enum value as a string.
34773 ///
34774 /// Returns `None` if the enum contains an unknown value deserialized from
34775 /// the integer representation of enums.
34776 pub fn name(&self) -> std::option::Option<&str> {
34777 match self {
34778 Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
34779 Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
34780 Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
34781 Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
34782 Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
34783 Self::ProjectAbuse => std::option::Option::Some("PROJECT_ABUSE"),
34784 Self::UnknownValue(u) => u.0.name(),
34785 }
34786 }
34787}
34788
34789impl std::default::Default for SqlSuspensionReason {
34790 fn default() -> Self {
34791 use std::convert::From;
34792 Self::from(0)
34793 }
34794}
34795
34796impl std::fmt::Display for SqlSuspensionReason {
34797 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34798 wkt::internal::display_enum(f, self.name(), self.value())
34799 }
34800}
34801
34802impl std::convert::From<i32> for SqlSuspensionReason {
34803 fn from(value: i32) -> Self {
34804 match value {
34805 0 => Self::Unspecified,
34806 2 => Self::BillingIssue,
34807 3 => Self::LegalIssue,
34808 4 => Self::OperationalIssue,
34809 5 => Self::KmsKeyIssue,
34810 8 => Self::ProjectAbuse,
34811 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
34812 wkt::internal::UnknownEnumValue::Integer(value),
34813 )),
34814 }
34815 }
34816}
34817
34818impl std::convert::From<&str> for SqlSuspensionReason {
34819 fn from(value: &str) -> Self {
34820 use std::string::ToString;
34821 match value {
34822 "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
34823 "BILLING_ISSUE" => Self::BillingIssue,
34824 "LEGAL_ISSUE" => Self::LegalIssue,
34825 "OPERATIONAL_ISSUE" => Self::OperationalIssue,
34826 "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
34827 "PROJECT_ABUSE" => Self::ProjectAbuse,
34828 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
34829 wkt::internal::UnknownEnumValue::String(value.to_string()),
34830 )),
34831 }
34832 }
34833}
34834
34835impl serde::ser::Serialize for SqlSuspensionReason {
34836 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34837 where
34838 S: serde::Serializer,
34839 {
34840 match self {
34841 Self::Unspecified => serializer.serialize_i32(0),
34842 Self::BillingIssue => serializer.serialize_i32(2),
34843 Self::LegalIssue => serializer.serialize_i32(3),
34844 Self::OperationalIssue => serializer.serialize_i32(4),
34845 Self::KmsKeyIssue => serializer.serialize_i32(5),
34846 Self::ProjectAbuse => serializer.serialize_i32(8),
34847 Self::UnknownValue(u) => u.0.serialize(serializer),
34848 }
34849 }
34850}
34851
34852impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
34853 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34854 where
34855 D: serde::Deserializer<'de>,
34856 {
34857 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
34858 ".google.cloud.sql.v1.SqlSuspensionReason",
34859 ))
34860 }
34861}
34862
34863/// Enum for [SqlFileType].
34864///
34865/// # Working with unknown values
34866///
34867/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34868/// additional enum variants at any time. Adding new variants is not considered
34869/// a breaking change. Applications should write their code in anticipation of:
34870///
34871/// - New values appearing in future releases of the client library, **and**
34872/// - New values received dynamically, without application changes.
34873///
34874/// Please consult the [Working with enums] section in the user guide for some
34875/// guidelines.
34876///
34877/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34878#[derive(Clone, Debug, PartialEq)]
34879#[non_exhaustive]
34880pub enum SqlFileType {
34881 /// Unknown file type.
34882 Unspecified,
34883 /// File containing SQL statements.
34884 Sql,
34885 /// File in CSV format.
34886 Csv,
34887 #[allow(missing_docs)]
34888 Bak,
34889 /// TDE certificate.
34890 Tde,
34891 /// If set, the enum was initialized with an unknown value.
34892 ///
34893 /// Applications can examine the value using [SqlFileType::value] or
34894 /// [SqlFileType::name].
34895 UnknownValue(sql_file_type::UnknownValue),
34896}
34897
34898#[doc(hidden)]
34899pub mod sql_file_type {
34900 #[allow(unused_imports)]
34901 use super::*;
34902 #[derive(Clone, Debug, PartialEq)]
34903 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34904}
34905
34906impl SqlFileType {
34907 /// Gets the enum value.
34908 ///
34909 /// Returns `None` if the enum contains an unknown value deserialized from
34910 /// the string representation of enums.
34911 pub fn value(&self) -> std::option::Option<i32> {
34912 match self {
34913 Self::Unspecified => std::option::Option::Some(0),
34914 Self::Sql => std::option::Option::Some(1),
34915 Self::Csv => std::option::Option::Some(2),
34916 Self::Bak => std::option::Option::Some(4),
34917 Self::Tde => std::option::Option::Some(8),
34918 Self::UnknownValue(u) => u.0.value(),
34919 }
34920 }
34921
34922 /// Gets the enum value as a string.
34923 ///
34924 /// Returns `None` if the enum contains an unknown value deserialized from
34925 /// the integer representation of enums.
34926 pub fn name(&self) -> std::option::Option<&str> {
34927 match self {
34928 Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
34929 Self::Sql => std::option::Option::Some("SQL"),
34930 Self::Csv => std::option::Option::Some("CSV"),
34931 Self::Bak => std::option::Option::Some("BAK"),
34932 Self::Tde => std::option::Option::Some("TDE"),
34933 Self::UnknownValue(u) => u.0.name(),
34934 }
34935 }
34936}
34937
34938impl std::default::Default for SqlFileType {
34939 fn default() -> Self {
34940 use std::convert::From;
34941 Self::from(0)
34942 }
34943}
34944
34945impl std::fmt::Display for SqlFileType {
34946 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34947 wkt::internal::display_enum(f, self.name(), self.value())
34948 }
34949}
34950
34951impl std::convert::From<i32> for SqlFileType {
34952 fn from(value: i32) -> Self {
34953 match value {
34954 0 => Self::Unspecified,
34955 1 => Self::Sql,
34956 2 => Self::Csv,
34957 4 => Self::Bak,
34958 8 => Self::Tde,
34959 _ => Self::UnknownValue(sql_file_type::UnknownValue(
34960 wkt::internal::UnknownEnumValue::Integer(value),
34961 )),
34962 }
34963 }
34964}
34965
34966impl std::convert::From<&str> for SqlFileType {
34967 fn from(value: &str) -> Self {
34968 use std::string::ToString;
34969 match value {
34970 "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
34971 "SQL" => Self::Sql,
34972 "CSV" => Self::Csv,
34973 "BAK" => Self::Bak,
34974 "TDE" => Self::Tde,
34975 _ => Self::UnknownValue(sql_file_type::UnknownValue(
34976 wkt::internal::UnknownEnumValue::String(value.to_string()),
34977 )),
34978 }
34979 }
34980}
34981
34982impl serde::ser::Serialize for SqlFileType {
34983 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34984 where
34985 S: serde::Serializer,
34986 {
34987 match self {
34988 Self::Unspecified => serializer.serialize_i32(0),
34989 Self::Sql => serializer.serialize_i32(1),
34990 Self::Csv => serializer.serialize_i32(2),
34991 Self::Bak => serializer.serialize_i32(4),
34992 Self::Tde => serializer.serialize_i32(8),
34993 Self::UnknownValue(u) => u.0.serialize(serializer),
34994 }
34995 }
34996}
34997
34998impl<'de> serde::de::Deserialize<'de> for SqlFileType {
34999 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35000 where
35001 D: serde::Deserializer<'de>,
35002 {
35003 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
35004 ".google.cloud.sql.v1.SqlFileType",
35005 ))
35006 }
35007}
35008
35009/// Enum for [BakType].
35010///
35011/// # Working with unknown values
35012///
35013/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35014/// additional enum variants at any time. Adding new variants is not considered
35015/// a breaking change. Applications should write their code in anticipation of:
35016///
35017/// - New values appearing in future releases of the client library, **and**
35018/// - New values received dynamically, without application changes.
35019///
35020/// Please consult the [Working with enums] section in the user guide for some
35021/// guidelines.
35022///
35023/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35024#[derive(Clone, Debug, PartialEq)]
35025#[non_exhaustive]
35026pub enum BakType {
35027 /// Default type.
35028 Unspecified,
35029 /// Full backup.
35030 Full,
35031 /// Differential backup.
35032 Diff,
35033 /// Transaction Log backup
35034 Tlog,
35035 /// If set, the enum was initialized with an unknown value.
35036 ///
35037 /// Applications can examine the value using [BakType::value] or
35038 /// [BakType::name].
35039 UnknownValue(bak_type::UnknownValue),
35040}
35041
35042#[doc(hidden)]
35043pub mod bak_type {
35044 #[allow(unused_imports)]
35045 use super::*;
35046 #[derive(Clone, Debug, PartialEq)]
35047 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35048}
35049
35050impl BakType {
35051 /// Gets the enum value.
35052 ///
35053 /// Returns `None` if the enum contains an unknown value deserialized from
35054 /// the string representation of enums.
35055 pub fn value(&self) -> std::option::Option<i32> {
35056 match self {
35057 Self::Unspecified => std::option::Option::Some(0),
35058 Self::Full => std::option::Option::Some(1),
35059 Self::Diff => std::option::Option::Some(2),
35060 Self::Tlog => std::option::Option::Some(3),
35061 Self::UnknownValue(u) => u.0.value(),
35062 }
35063 }
35064
35065 /// Gets the enum value as a string.
35066 ///
35067 /// Returns `None` if the enum contains an unknown value deserialized from
35068 /// the integer representation of enums.
35069 pub fn name(&self) -> std::option::Option<&str> {
35070 match self {
35071 Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
35072 Self::Full => std::option::Option::Some("FULL"),
35073 Self::Diff => std::option::Option::Some("DIFF"),
35074 Self::Tlog => std::option::Option::Some("TLOG"),
35075 Self::UnknownValue(u) => u.0.name(),
35076 }
35077 }
35078}
35079
35080impl std::default::Default for BakType {
35081 fn default() -> Self {
35082 use std::convert::From;
35083 Self::from(0)
35084 }
35085}
35086
35087impl std::fmt::Display for BakType {
35088 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35089 wkt::internal::display_enum(f, self.name(), self.value())
35090 }
35091}
35092
35093impl std::convert::From<i32> for BakType {
35094 fn from(value: i32) -> Self {
35095 match value {
35096 0 => Self::Unspecified,
35097 1 => Self::Full,
35098 2 => Self::Diff,
35099 3 => Self::Tlog,
35100 _ => Self::UnknownValue(bak_type::UnknownValue(
35101 wkt::internal::UnknownEnumValue::Integer(value),
35102 )),
35103 }
35104 }
35105}
35106
35107impl std::convert::From<&str> for BakType {
35108 fn from(value: &str) -> Self {
35109 use std::string::ToString;
35110 match value {
35111 "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
35112 "FULL" => Self::Full,
35113 "DIFF" => Self::Diff,
35114 "TLOG" => Self::Tlog,
35115 _ => Self::UnknownValue(bak_type::UnknownValue(
35116 wkt::internal::UnknownEnumValue::String(value.to_string()),
35117 )),
35118 }
35119 }
35120}
35121
35122impl serde::ser::Serialize for BakType {
35123 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35124 where
35125 S: serde::Serializer,
35126 {
35127 match self {
35128 Self::Unspecified => serializer.serialize_i32(0),
35129 Self::Full => serializer.serialize_i32(1),
35130 Self::Diff => serializer.serialize_i32(2),
35131 Self::Tlog => serializer.serialize_i32(3),
35132 Self::UnknownValue(u) => u.0.serialize(serializer),
35133 }
35134 }
35135}
35136
35137impl<'de> serde::de::Deserialize<'de> for BakType {
35138 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35139 where
35140 D: serde::Deserializer<'de>,
35141 {
35142 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
35143 ".google.cloud.sql.v1.BakType",
35144 ))
35145 }
35146}
35147
35148/// The type of maintenance to be performed on the instance.
35149///
35150/// # Working with unknown values
35151///
35152/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35153/// additional enum variants at any time. Adding new variants is not considered
35154/// a breaking change. Applications should write their code in anticipation of:
35155///
35156/// - New values appearing in future releases of the client library, **and**
35157/// - New values received dynamically, without application changes.
35158///
35159/// Please consult the [Working with enums] section in the user guide for some
35160/// guidelines.
35161///
35162/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35163#[derive(Clone, Debug, PartialEq)]
35164#[non_exhaustive]
35165pub enum SqlMaintenanceType {
35166 /// Maintenance type is unspecified.
35167 Unspecified,
35168 /// Indicates that a standalone instance is undergoing maintenance. The
35169 /// instance can be either a primary instance or a replica.
35170 InstanceMaintenance,
35171 /// Indicates that the primary instance and all of its replicas, including
35172 /// cascading replicas, are undergoing maintenance. Maintenance is performed on
35173 /// groups of replicas first, followed by the primary instance.
35174 ReplicaIncludedMaintenance,
35175 /// Indicates that the standalone instance is undergoing maintenance, initiated
35176 /// by self-service. The instance can be either a primary instance or a
35177 /// replica.
35178 InstanceSelfServiceMaintenance,
35179 /// Indicates that the primary instance and all of its replicas are undergoing
35180 /// maintenance, initiated by self-service. Maintenance is performed on groups
35181 /// of replicas first, followed by the primary instance.
35182 ReplicaIncludedSelfServiceMaintenance,
35183 /// If set, the enum was initialized with an unknown value.
35184 ///
35185 /// Applications can examine the value using [SqlMaintenanceType::value] or
35186 /// [SqlMaintenanceType::name].
35187 UnknownValue(sql_maintenance_type::UnknownValue),
35188}
35189
35190#[doc(hidden)]
35191pub mod sql_maintenance_type {
35192 #[allow(unused_imports)]
35193 use super::*;
35194 #[derive(Clone, Debug, PartialEq)]
35195 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35196}
35197
35198impl SqlMaintenanceType {
35199 /// Gets the enum value.
35200 ///
35201 /// Returns `None` if the enum contains an unknown value deserialized from
35202 /// the string representation of enums.
35203 pub fn value(&self) -> std::option::Option<i32> {
35204 match self {
35205 Self::Unspecified => std::option::Option::Some(0),
35206 Self::InstanceMaintenance => std::option::Option::Some(1),
35207 Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
35208 Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
35209 Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
35210 Self::UnknownValue(u) => u.0.value(),
35211 }
35212 }
35213
35214 /// Gets the enum value as a string.
35215 ///
35216 /// Returns `None` if the enum contains an unknown value deserialized from
35217 /// the integer representation of enums.
35218 pub fn name(&self) -> std::option::Option<&str> {
35219 match self {
35220 Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
35221 Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
35222 Self::ReplicaIncludedMaintenance => {
35223 std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
35224 }
35225 Self::InstanceSelfServiceMaintenance => {
35226 std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
35227 }
35228 Self::ReplicaIncludedSelfServiceMaintenance => {
35229 std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
35230 }
35231 Self::UnknownValue(u) => u.0.name(),
35232 }
35233 }
35234}
35235
35236impl std::default::Default for SqlMaintenanceType {
35237 fn default() -> Self {
35238 use std::convert::From;
35239 Self::from(0)
35240 }
35241}
35242
35243impl std::fmt::Display for SqlMaintenanceType {
35244 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35245 wkt::internal::display_enum(f, self.name(), self.value())
35246 }
35247}
35248
35249impl std::convert::From<i32> for SqlMaintenanceType {
35250 fn from(value: i32) -> Self {
35251 match value {
35252 0 => Self::Unspecified,
35253 1 => Self::InstanceMaintenance,
35254 2 => Self::ReplicaIncludedMaintenance,
35255 3 => Self::InstanceSelfServiceMaintenance,
35256 4 => Self::ReplicaIncludedSelfServiceMaintenance,
35257 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
35258 wkt::internal::UnknownEnumValue::Integer(value),
35259 )),
35260 }
35261 }
35262}
35263
35264impl std::convert::From<&str> for SqlMaintenanceType {
35265 fn from(value: &str) -> Self {
35266 use std::string::ToString;
35267 match value {
35268 "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
35269 "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
35270 "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
35271 "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
35272 "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
35273 Self::ReplicaIncludedSelfServiceMaintenance
35274 }
35275 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
35276 wkt::internal::UnknownEnumValue::String(value.to_string()),
35277 )),
35278 }
35279 }
35280}
35281
35282impl serde::ser::Serialize for SqlMaintenanceType {
35283 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35284 where
35285 S: serde::Serializer,
35286 {
35287 match self {
35288 Self::Unspecified => serializer.serialize_i32(0),
35289 Self::InstanceMaintenance => serializer.serialize_i32(1),
35290 Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
35291 Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
35292 Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
35293 Self::UnknownValue(u) => u.0.serialize(serializer),
35294 }
35295 }
35296}
35297
35298impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
35299 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35300 where
35301 D: serde::Deserializer<'de>,
35302 {
35303 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
35304 ".google.cloud.sql.v1.SqlMaintenanceType",
35305 ))
35306 }
35307}
35308
35309/// Enum for [SqlBackendType].
35310///
35311/// # Working with unknown values
35312///
35313/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35314/// additional enum variants at any time. Adding new variants is not considered
35315/// a breaking change. Applications should write their code in anticipation of:
35316///
35317/// - New values appearing in future releases of the client library, **and**
35318/// - New values received dynamically, without application changes.
35319///
35320/// Please consult the [Working with enums] section in the user guide for some
35321/// guidelines.
35322///
35323/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35324#[derive(Clone, Debug, PartialEq)]
35325#[non_exhaustive]
35326pub enum SqlBackendType {
35327 /// This is an unknown backend type for instance.
35328 Unspecified,
35329 /// V1 speckle instance.
35330 #[deprecated]
35331 FirstGen,
35332 /// V2 speckle instance.
35333 SecondGen,
35334 /// On premises instance.
35335 External,
35336 /// If set, the enum was initialized with an unknown value.
35337 ///
35338 /// Applications can examine the value using [SqlBackendType::value] or
35339 /// [SqlBackendType::name].
35340 UnknownValue(sql_backend_type::UnknownValue),
35341}
35342
35343#[doc(hidden)]
35344pub mod sql_backend_type {
35345 #[allow(unused_imports)]
35346 use super::*;
35347 #[derive(Clone, Debug, PartialEq)]
35348 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35349}
35350
35351impl SqlBackendType {
35352 /// Gets the enum value.
35353 ///
35354 /// Returns `None` if the enum contains an unknown value deserialized from
35355 /// the string representation of enums.
35356 pub fn value(&self) -> std::option::Option<i32> {
35357 match self {
35358 Self::Unspecified => std::option::Option::Some(0),
35359 Self::FirstGen => std::option::Option::Some(1),
35360 Self::SecondGen => std::option::Option::Some(2),
35361 Self::External => std::option::Option::Some(3),
35362 Self::UnknownValue(u) => u.0.value(),
35363 }
35364 }
35365
35366 /// Gets the enum value as a string.
35367 ///
35368 /// Returns `None` if the enum contains an unknown value deserialized from
35369 /// the integer representation of enums.
35370 pub fn name(&self) -> std::option::Option<&str> {
35371 match self {
35372 Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
35373 Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
35374 Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
35375 Self::External => std::option::Option::Some("EXTERNAL"),
35376 Self::UnknownValue(u) => u.0.name(),
35377 }
35378 }
35379}
35380
35381impl std::default::Default for SqlBackendType {
35382 fn default() -> Self {
35383 use std::convert::From;
35384 Self::from(0)
35385 }
35386}
35387
35388impl std::fmt::Display for SqlBackendType {
35389 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35390 wkt::internal::display_enum(f, self.name(), self.value())
35391 }
35392}
35393
35394impl std::convert::From<i32> for SqlBackendType {
35395 fn from(value: i32) -> Self {
35396 match value {
35397 0 => Self::Unspecified,
35398 1 => Self::FirstGen,
35399 2 => Self::SecondGen,
35400 3 => Self::External,
35401 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
35402 wkt::internal::UnknownEnumValue::Integer(value),
35403 )),
35404 }
35405 }
35406}
35407
35408impl std::convert::From<&str> for SqlBackendType {
35409 fn from(value: &str) -> Self {
35410 use std::string::ToString;
35411 match value {
35412 "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
35413 "FIRST_GEN" => Self::FirstGen,
35414 "SECOND_GEN" => Self::SecondGen,
35415 "EXTERNAL" => Self::External,
35416 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
35417 wkt::internal::UnknownEnumValue::String(value.to_string()),
35418 )),
35419 }
35420 }
35421}
35422
35423impl serde::ser::Serialize for SqlBackendType {
35424 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35425 where
35426 S: serde::Serializer,
35427 {
35428 match self {
35429 Self::Unspecified => serializer.serialize_i32(0),
35430 Self::FirstGen => serializer.serialize_i32(1),
35431 Self::SecondGen => serializer.serialize_i32(2),
35432 Self::External => serializer.serialize_i32(3),
35433 Self::UnknownValue(u) => u.0.serialize(serializer),
35434 }
35435 }
35436}
35437
35438impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
35439 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35440 where
35441 D: serde::Deserializer<'de>,
35442 {
35443 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
35444 ".google.cloud.sql.v1.SqlBackendType",
35445 ))
35446 }
35447}
35448
35449/// Enum for [SqlIpAddressType].
35450///
35451/// # Working with unknown values
35452///
35453/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35454/// additional enum variants at any time. Adding new variants is not considered
35455/// a breaking change. Applications should write their code in anticipation of:
35456///
35457/// - New values appearing in future releases of the client library, **and**
35458/// - New values received dynamically, without application changes.
35459///
35460/// Please consult the [Working with enums] section in the user guide for some
35461/// guidelines.
35462///
35463/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35464#[derive(Clone, Debug, PartialEq)]
35465#[non_exhaustive]
35466pub enum SqlIpAddressType {
35467 /// This is an unknown IP address type.
35468 Unspecified,
35469 /// IP address the customer is supposed to connect to. Usually this is the
35470 /// load balancer's IP address
35471 Primary,
35472 /// Source IP address of the connection a read replica establishes to its
35473 /// external primary instance. This IP address can be allowlisted by the
35474 /// customer in case it has a firewall that filters incoming connection to its
35475 /// on premises primary instance.
35476 Outgoing,
35477 /// Private IP used when using private IPs and network peering.
35478 Private,
35479 /// V1 IP of a migrated instance. We want the user to
35480 /// decommission this IP as soon as the migration is complete.
35481 /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
35482 Migrated1StGen,
35483 /// If set, the enum was initialized with an unknown value.
35484 ///
35485 /// Applications can examine the value using [SqlIpAddressType::value] or
35486 /// [SqlIpAddressType::name].
35487 UnknownValue(sql_ip_address_type::UnknownValue),
35488}
35489
35490#[doc(hidden)]
35491pub mod sql_ip_address_type {
35492 #[allow(unused_imports)]
35493 use super::*;
35494 #[derive(Clone, Debug, PartialEq)]
35495 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35496}
35497
35498impl SqlIpAddressType {
35499 /// Gets the enum value.
35500 ///
35501 /// Returns `None` if the enum contains an unknown value deserialized from
35502 /// the string representation of enums.
35503 pub fn value(&self) -> std::option::Option<i32> {
35504 match self {
35505 Self::Unspecified => std::option::Option::Some(0),
35506 Self::Primary => std::option::Option::Some(1),
35507 Self::Outgoing => std::option::Option::Some(2),
35508 Self::Private => std::option::Option::Some(3),
35509 Self::Migrated1StGen => std::option::Option::Some(4),
35510 Self::UnknownValue(u) => u.0.value(),
35511 }
35512 }
35513
35514 /// Gets the enum value as a string.
35515 ///
35516 /// Returns `None` if the enum contains an unknown value deserialized from
35517 /// the integer representation of enums.
35518 pub fn name(&self) -> std::option::Option<&str> {
35519 match self {
35520 Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
35521 Self::Primary => std::option::Option::Some("PRIMARY"),
35522 Self::Outgoing => std::option::Option::Some("OUTGOING"),
35523 Self::Private => std::option::Option::Some("PRIVATE"),
35524 Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
35525 Self::UnknownValue(u) => u.0.name(),
35526 }
35527 }
35528}
35529
35530impl std::default::Default for SqlIpAddressType {
35531 fn default() -> Self {
35532 use std::convert::From;
35533 Self::from(0)
35534 }
35535}
35536
35537impl std::fmt::Display for SqlIpAddressType {
35538 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35539 wkt::internal::display_enum(f, self.name(), self.value())
35540 }
35541}
35542
35543impl std::convert::From<i32> for SqlIpAddressType {
35544 fn from(value: i32) -> Self {
35545 match value {
35546 0 => Self::Unspecified,
35547 1 => Self::Primary,
35548 2 => Self::Outgoing,
35549 3 => Self::Private,
35550 4 => Self::Migrated1StGen,
35551 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
35552 wkt::internal::UnknownEnumValue::Integer(value),
35553 )),
35554 }
35555 }
35556}
35557
35558impl std::convert::From<&str> for SqlIpAddressType {
35559 fn from(value: &str) -> Self {
35560 use std::string::ToString;
35561 match value {
35562 "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
35563 "PRIMARY" => Self::Primary,
35564 "OUTGOING" => Self::Outgoing,
35565 "PRIVATE" => Self::Private,
35566 "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
35567 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
35568 wkt::internal::UnknownEnumValue::String(value.to_string()),
35569 )),
35570 }
35571 }
35572}
35573
35574impl serde::ser::Serialize for SqlIpAddressType {
35575 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35576 where
35577 S: serde::Serializer,
35578 {
35579 match self {
35580 Self::Unspecified => serializer.serialize_i32(0),
35581 Self::Primary => serializer.serialize_i32(1),
35582 Self::Outgoing => serializer.serialize_i32(2),
35583 Self::Private => serializer.serialize_i32(3),
35584 Self::Migrated1StGen => serializer.serialize_i32(4),
35585 Self::UnknownValue(u) => u.0.serialize(serializer),
35586 }
35587 }
35588}
35589
35590impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
35591 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35592 where
35593 D: serde::Deserializer<'de>,
35594 {
35595 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
35596 ".google.cloud.sql.v1.SqlIpAddressType",
35597 ))
35598 }
35599}
35600
35601/// The database engine type and version.
35602///
35603/// # Working with unknown values
35604///
35605/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35606/// additional enum variants at any time. Adding new variants is not considered
35607/// a breaking change. Applications should write their code in anticipation of:
35608///
35609/// - New values appearing in future releases of the client library, **and**
35610/// - New values received dynamically, without application changes.
35611///
35612/// Please consult the [Working with enums] section in the user guide for some
35613/// guidelines.
35614///
35615/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35616#[derive(Clone, Debug, PartialEq)]
35617#[non_exhaustive]
35618pub enum SqlDatabaseVersion {
35619 /// This is an unknown database version.
35620 Unspecified,
35621 /// The database version is MySQL 5.1.
35622 #[deprecated]
35623 Mysql51,
35624 /// The database version is MySQL 5.5.
35625 #[deprecated]
35626 Mysql55,
35627 /// The database version is MySQL 5.6.
35628 Mysql56,
35629 /// The database version is MySQL 5.7.
35630 Mysql57,
35631 /// The database version is MySQL 8.
35632 Mysql80,
35633 /// The database major version is MySQL 8.0 and the minor version is 18.
35634 Mysql8018,
35635 /// The database major version is MySQL 8.0 and the minor version is 26.
35636 Mysql8026,
35637 /// The database major version is MySQL 8.0 and the minor version is 27.
35638 Mysql8027,
35639 /// The database major version is MySQL 8.0 and the minor version is 28.
35640 Mysql8028,
35641 /// The database major version is MySQL 8.0 and the minor version is 29.
35642 #[deprecated]
35643 Mysql8029,
35644 /// The database major version is MySQL 8.0 and the minor version is 30.
35645 Mysql8030,
35646 /// The database major version is MySQL 8.0 and the minor version is 31.
35647 Mysql8031,
35648 /// The database major version is MySQL 8.0 and the minor version is 32.
35649 Mysql8032,
35650 /// The database major version is MySQL 8.0 and the minor version is 33.
35651 Mysql8033,
35652 /// The database major version is MySQL 8.0 and the minor version is 34.
35653 Mysql8034,
35654 /// The database major version is MySQL 8.0 and the minor version is 35.
35655 Mysql8035,
35656 /// The database major version is MySQL 8.0 and the minor version is 36.
35657 Mysql8036,
35658 /// The database major version is MySQL 8.0 and the minor version is 37.
35659 Mysql8037,
35660 /// The database major version is MySQL 8.0 and the minor version is 39.
35661 Mysql8039,
35662 /// The database major version is MySQL 8.0 and the minor version is 40.
35663 Mysql8040,
35664 /// The database major version is MySQL 8.0 and the minor version is 41.
35665 Mysql8041,
35666 /// The database major version is MySQL 8.0 and the minor version is 42.
35667 Mysql8042,
35668 /// The database major version is MySQL 8.0 and the minor version is 43.
35669 Mysql8043,
35670 /// The database major version is MySQL 8.0 and the minor version is 44.
35671 Mysql8044,
35672 /// The database major version is MySQL 8.0 and the minor version is 45.
35673 Mysql8045,
35674 /// The database major version is MySQL 8.0 and the minor version is 46.
35675 Mysql8046,
35676 /// The database version is MySQL 8.4.
35677 Mysql84,
35678 /// The database version is MySQL 9.7.
35679 Mysql97,
35680 /// The database version is SQL Server 2017 Standard.
35681 Sqlserver2017Standard,
35682 /// The database version is SQL Server 2017 Enterprise.
35683 Sqlserver2017Enterprise,
35684 /// The database version is SQL Server 2017 Express.
35685 Sqlserver2017Express,
35686 /// The database version is SQL Server 2017 Web.
35687 Sqlserver2017Web,
35688 /// The database version is PostgreSQL 9.6.
35689 Postgres96,
35690 /// The database version is PostgreSQL 10.
35691 Postgres10,
35692 /// The database version is PostgreSQL 11.
35693 Postgres11,
35694 /// The database version is PostgreSQL 12.
35695 Postgres12,
35696 /// The database version is PostgreSQL 13.
35697 Postgres13,
35698 /// The database version is PostgreSQL 14.
35699 Postgres14,
35700 /// The database version is PostgreSQL 15.
35701 Postgres15,
35702 /// The database version is PostgreSQL 16.
35703 Postgres16,
35704 /// The database version is PostgreSQL 17.
35705 Postgres17,
35706 /// The database version is PostgreSQL 18.
35707 Postgres18,
35708 /// The database version is PostgreSQL 19.
35709 Postgres19,
35710 /// The database version is PostgreSQL 20.
35711 Postgres20,
35712 /// The database version is SQL Server 2019 Standard.
35713 Sqlserver2019Standard,
35714 /// The database version is SQL Server 2019 Enterprise.
35715 Sqlserver2019Enterprise,
35716 /// The database version is SQL Server 2019 Express.
35717 Sqlserver2019Express,
35718 /// The database version is SQL Server 2019 Web.
35719 Sqlserver2019Web,
35720 /// The database version is SQL Server 2022 Standard.
35721 Sqlserver2022Standard,
35722 /// The database version is SQL Server 2022 Enterprise.
35723 Sqlserver2022Enterprise,
35724 /// The database version is SQL Server 2022 Express.
35725 Sqlserver2022Express,
35726 /// The database version is SQL Server 2022 Web.
35727 Sqlserver2022Web,
35728 /// The database version is SQL Server 2025 Standard.
35729 Sqlserver2025Standard,
35730 /// The database version is SQL Server 2025 Enterprise.
35731 Sqlserver2025Enterprise,
35732 /// The database version is SQL Server 2025 Express.
35733 Sqlserver2025Express,
35734 /// If set, the enum was initialized with an unknown value.
35735 ///
35736 /// Applications can examine the value using [SqlDatabaseVersion::value] or
35737 /// [SqlDatabaseVersion::name].
35738 UnknownValue(sql_database_version::UnknownValue),
35739}
35740
35741#[doc(hidden)]
35742pub mod sql_database_version {
35743 #[allow(unused_imports)]
35744 use super::*;
35745 #[derive(Clone, Debug, PartialEq)]
35746 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35747}
35748
35749impl SqlDatabaseVersion {
35750 /// Gets the enum value.
35751 ///
35752 /// Returns `None` if the enum contains an unknown value deserialized from
35753 /// the string representation of enums.
35754 pub fn value(&self) -> std::option::Option<i32> {
35755 match self {
35756 Self::Unspecified => std::option::Option::Some(0),
35757 Self::Mysql51 => std::option::Option::Some(2),
35758 Self::Mysql55 => std::option::Option::Some(3),
35759 Self::Mysql56 => std::option::Option::Some(5),
35760 Self::Mysql57 => std::option::Option::Some(6),
35761 Self::Mysql80 => std::option::Option::Some(20),
35762 Self::Mysql8018 => std::option::Option::Some(41),
35763 Self::Mysql8026 => std::option::Option::Some(85),
35764 Self::Mysql8027 => std::option::Option::Some(111),
35765 Self::Mysql8028 => std::option::Option::Some(132),
35766 Self::Mysql8029 => std::option::Option::Some(148),
35767 Self::Mysql8030 => std::option::Option::Some(174),
35768 Self::Mysql8031 => std::option::Option::Some(197),
35769 Self::Mysql8032 => std::option::Option::Some(213),
35770 Self::Mysql8033 => std::option::Option::Some(238),
35771 Self::Mysql8034 => std::option::Option::Some(239),
35772 Self::Mysql8035 => std::option::Option::Some(240),
35773 Self::Mysql8036 => std::option::Option::Some(241),
35774 Self::Mysql8037 => std::option::Option::Some(355),
35775 Self::Mysql8039 => std::option::Option::Some(357),
35776 Self::Mysql8040 => std::option::Option::Some(358),
35777 Self::Mysql8041 => std::option::Option::Some(488),
35778 Self::Mysql8042 => std::option::Option::Some(489),
35779 Self::Mysql8043 => std::option::Option::Some(553),
35780 Self::Mysql8044 => std::option::Option::Some(554),
35781 Self::Mysql8045 => std::option::Option::Some(555),
35782 Self::Mysql8046 => std::option::Option::Some(556),
35783 Self::Mysql84 => std::option::Option::Some(398),
35784 Self::Mysql97 => std::option::Option::Some(654),
35785 Self::Sqlserver2017Standard => std::option::Option::Some(11),
35786 Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
35787 Self::Sqlserver2017Express => std::option::Option::Some(15),
35788 Self::Sqlserver2017Web => std::option::Option::Some(16),
35789 Self::Postgres96 => std::option::Option::Some(9),
35790 Self::Postgres10 => std::option::Option::Some(18),
35791 Self::Postgres11 => std::option::Option::Some(10),
35792 Self::Postgres12 => std::option::Option::Some(19),
35793 Self::Postgres13 => std::option::Option::Some(23),
35794 Self::Postgres14 => std::option::Option::Some(110),
35795 Self::Postgres15 => std::option::Option::Some(172),
35796 Self::Postgres16 => std::option::Option::Some(272),
35797 Self::Postgres17 => std::option::Option::Some(408),
35798 Self::Postgres18 => std::option::Option::Some(557),
35799 Self::Postgres19 => std::option::Option::Some(684),
35800 Self::Postgres20 => std::option::Option::Some(781),
35801 Self::Sqlserver2019Standard => std::option::Option::Some(26),
35802 Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
35803 Self::Sqlserver2019Express => std::option::Option::Some(28),
35804 Self::Sqlserver2019Web => std::option::Option::Some(29),
35805 Self::Sqlserver2022Standard => std::option::Option::Some(199),
35806 Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
35807 Self::Sqlserver2022Express => std::option::Option::Some(201),
35808 Self::Sqlserver2022Web => std::option::Option::Some(202),
35809 Self::Sqlserver2025Standard => std::option::Option::Some(549),
35810 Self::Sqlserver2025Enterprise => std::option::Option::Some(550),
35811 Self::Sqlserver2025Express => std::option::Option::Some(551),
35812 Self::UnknownValue(u) => u.0.value(),
35813 }
35814 }
35815
35816 /// Gets the enum value as a string.
35817 ///
35818 /// Returns `None` if the enum contains an unknown value deserialized from
35819 /// the integer representation of enums.
35820 pub fn name(&self) -> std::option::Option<&str> {
35821 match self {
35822 Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
35823 Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
35824 Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
35825 Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
35826 Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
35827 Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
35828 Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
35829 Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
35830 Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
35831 Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
35832 Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
35833 Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
35834 Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
35835 Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
35836 Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
35837 Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
35838 Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
35839 Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
35840 Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
35841 Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
35842 Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
35843 Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
35844 Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
35845 Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
35846 Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
35847 Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
35848 Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
35849 Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
35850 Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
35851 Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
35852 Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
35853 Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
35854 Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
35855 Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
35856 Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
35857 Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
35858 Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
35859 Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
35860 Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
35861 Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
35862 Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
35863 Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
35864 Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
35865 Self::Postgres19 => std::option::Option::Some("POSTGRES_19"),
35866 Self::Postgres20 => std::option::Option::Some("POSTGRES_20"),
35867 Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
35868 Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
35869 Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
35870 Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
35871 Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
35872 Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
35873 Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
35874 Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
35875 Self::Sqlserver2025Standard => std::option::Option::Some("SQLSERVER_2025_STANDARD"),
35876 Self::Sqlserver2025Enterprise => std::option::Option::Some("SQLSERVER_2025_ENTERPRISE"),
35877 Self::Sqlserver2025Express => std::option::Option::Some("SQLSERVER_2025_EXPRESS"),
35878 Self::UnknownValue(u) => u.0.name(),
35879 }
35880 }
35881}
35882
35883impl std::default::Default for SqlDatabaseVersion {
35884 fn default() -> Self {
35885 use std::convert::From;
35886 Self::from(0)
35887 }
35888}
35889
35890impl std::fmt::Display for SqlDatabaseVersion {
35891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35892 wkt::internal::display_enum(f, self.name(), self.value())
35893 }
35894}
35895
35896impl std::convert::From<i32> for SqlDatabaseVersion {
35897 fn from(value: i32) -> Self {
35898 match value {
35899 0 => Self::Unspecified,
35900 2 => Self::Mysql51,
35901 3 => Self::Mysql55,
35902 5 => Self::Mysql56,
35903 6 => Self::Mysql57,
35904 9 => Self::Postgres96,
35905 10 => Self::Postgres11,
35906 11 => Self::Sqlserver2017Standard,
35907 14 => Self::Sqlserver2017Enterprise,
35908 15 => Self::Sqlserver2017Express,
35909 16 => Self::Sqlserver2017Web,
35910 18 => Self::Postgres10,
35911 19 => Self::Postgres12,
35912 20 => Self::Mysql80,
35913 23 => Self::Postgres13,
35914 26 => Self::Sqlserver2019Standard,
35915 27 => Self::Sqlserver2019Enterprise,
35916 28 => Self::Sqlserver2019Express,
35917 29 => Self::Sqlserver2019Web,
35918 41 => Self::Mysql8018,
35919 85 => Self::Mysql8026,
35920 110 => Self::Postgres14,
35921 111 => Self::Mysql8027,
35922 132 => Self::Mysql8028,
35923 148 => Self::Mysql8029,
35924 172 => Self::Postgres15,
35925 174 => Self::Mysql8030,
35926 197 => Self::Mysql8031,
35927 199 => Self::Sqlserver2022Standard,
35928 200 => Self::Sqlserver2022Enterprise,
35929 201 => Self::Sqlserver2022Express,
35930 202 => Self::Sqlserver2022Web,
35931 213 => Self::Mysql8032,
35932 238 => Self::Mysql8033,
35933 239 => Self::Mysql8034,
35934 240 => Self::Mysql8035,
35935 241 => Self::Mysql8036,
35936 272 => Self::Postgres16,
35937 355 => Self::Mysql8037,
35938 357 => Self::Mysql8039,
35939 358 => Self::Mysql8040,
35940 398 => Self::Mysql84,
35941 408 => Self::Postgres17,
35942 488 => Self::Mysql8041,
35943 489 => Self::Mysql8042,
35944 549 => Self::Sqlserver2025Standard,
35945 550 => Self::Sqlserver2025Enterprise,
35946 551 => Self::Sqlserver2025Express,
35947 553 => Self::Mysql8043,
35948 554 => Self::Mysql8044,
35949 555 => Self::Mysql8045,
35950 556 => Self::Mysql8046,
35951 557 => Self::Postgres18,
35952 654 => Self::Mysql97,
35953 684 => Self::Postgres19,
35954 781 => Self::Postgres20,
35955 _ => Self::UnknownValue(sql_database_version::UnknownValue(
35956 wkt::internal::UnknownEnumValue::Integer(value),
35957 )),
35958 }
35959 }
35960}
35961
35962impl std::convert::From<&str> for SqlDatabaseVersion {
35963 fn from(value: &str) -> Self {
35964 use std::string::ToString;
35965 match value {
35966 "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
35967 "MYSQL_5_1" => Self::Mysql51,
35968 "MYSQL_5_5" => Self::Mysql55,
35969 "MYSQL_5_6" => Self::Mysql56,
35970 "MYSQL_5_7" => Self::Mysql57,
35971 "MYSQL_8_0" => Self::Mysql80,
35972 "MYSQL_8_0_18" => Self::Mysql8018,
35973 "MYSQL_8_0_26" => Self::Mysql8026,
35974 "MYSQL_8_0_27" => Self::Mysql8027,
35975 "MYSQL_8_0_28" => Self::Mysql8028,
35976 "MYSQL_8_0_29" => Self::Mysql8029,
35977 "MYSQL_8_0_30" => Self::Mysql8030,
35978 "MYSQL_8_0_31" => Self::Mysql8031,
35979 "MYSQL_8_0_32" => Self::Mysql8032,
35980 "MYSQL_8_0_33" => Self::Mysql8033,
35981 "MYSQL_8_0_34" => Self::Mysql8034,
35982 "MYSQL_8_0_35" => Self::Mysql8035,
35983 "MYSQL_8_0_36" => Self::Mysql8036,
35984 "MYSQL_8_0_37" => Self::Mysql8037,
35985 "MYSQL_8_0_39" => Self::Mysql8039,
35986 "MYSQL_8_0_40" => Self::Mysql8040,
35987 "MYSQL_8_0_41" => Self::Mysql8041,
35988 "MYSQL_8_0_42" => Self::Mysql8042,
35989 "MYSQL_8_0_43" => Self::Mysql8043,
35990 "MYSQL_8_0_44" => Self::Mysql8044,
35991 "MYSQL_8_0_45" => Self::Mysql8045,
35992 "MYSQL_8_0_46" => Self::Mysql8046,
35993 "MYSQL_8_4" => Self::Mysql84,
35994 "MYSQL_9_7" => Self::Mysql97,
35995 "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
35996 "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
35997 "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
35998 "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
35999 "POSTGRES_9_6" => Self::Postgres96,
36000 "POSTGRES_10" => Self::Postgres10,
36001 "POSTGRES_11" => Self::Postgres11,
36002 "POSTGRES_12" => Self::Postgres12,
36003 "POSTGRES_13" => Self::Postgres13,
36004 "POSTGRES_14" => Self::Postgres14,
36005 "POSTGRES_15" => Self::Postgres15,
36006 "POSTGRES_16" => Self::Postgres16,
36007 "POSTGRES_17" => Self::Postgres17,
36008 "POSTGRES_18" => Self::Postgres18,
36009 "POSTGRES_19" => Self::Postgres19,
36010 "POSTGRES_20" => Self::Postgres20,
36011 "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
36012 "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
36013 "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
36014 "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
36015 "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
36016 "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
36017 "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
36018 "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
36019 "SQLSERVER_2025_STANDARD" => Self::Sqlserver2025Standard,
36020 "SQLSERVER_2025_ENTERPRISE" => Self::Sqlserver2025Enterprise,
36021 "SQLSERVER_2025_EXPRESS" => Self::Sqlserver2025Express,
36022 _ => Self::UnknownValue(sql_database_version::UnknownValue(
36023 wkt::internal::UnknownEnumValue::String(value.to_string()),
36024 )),
36025 }
36026 }
36027}
36028
36029impl serde::ser::Serialize for SqlDatabaseVersion {
36030 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36031 where
36032 S: serde::Serializer,
36033 {
36034 match self {
36035 Self::Unspecified => serializer.serialize_i32(0),
36036 Self::Mysql51 => serializer.serialize_i32(2),
36037 Self::Mysql55 => serializer.serialize_i32(3),
36038 Self::Mysql56 => serializer.serialize_i32(5),
36039 Self::Mysql57 => serializer.serialize_i32(6),
36040 Self::Mysql80 => serializer.serialize_i32(20),
36041 Self::Mysql8018 => serializer.serialize_i32(41),
36042 Self::Mysql8026 => serializer.serialize_i32(85),
36043 Self::Mysql8027 => serializer.serialize_i32(111),
36044 Self::Mysql8028 => serializer.serialize_i32(132),
36045 Self::Mysql8029 => serializer.serialize_i32(148),
36046 Self::Mysql8030 => serializer.serialize_i32(174),
36047 Self::Mysql8031 => serializer.serialize_i32(197),
36048 Self::Mysql8032 => serializer.serialize_i32(213),
36049 Self::Mysql8033 => serializer.serialize_i32(238),
36050 Self::Mysql8034 => serializer.serialize_i32(239),
36051 Self::Mysql8035 => serializer.serialize_i32(240),
36052 Self::Mysql8036 => serializer.serialize_i32(241),
36053 Self::Mysql8037 => serializer.serialize_i32(355),
36054 Self::Mysql8039 => serializer.serialize_i32(357),
36055 Self::Mysql8040 => serializer.serialize_i32(358),
36056 Self::Mysql8041 => serializer.serialize_i32(488),
36057 Self::Mysql8042 => serializer.serialize_i32(489),
36058 Self::Mysql8043 => serializer.serialize_i32(553),
36059 Self::Mysql8044 => serializer.serialize_i32(554),
36060 Self::Mysql8045 => serializer.serialize_i32(555),
36061 Self::Mysql8046 => serializer.serialize_i32(556),
36062 Self::Mysql84 => serializer.serialize_i32(398),
36063 Self::Mysql97 => serializer.serialize_i32(654),
36064 Self::Sqlserver2017Standard => serializer.serialize_i32(11),
36065 Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
36066 Self::Sqlserver2017Express => serializer.serialize_i32(15),
36067 Self::Sqlserver2017Web => serializer.serialize_i32(16),
36068 Self::Postgres96 => serializer.serialize_i32(9),
36069 Self::Postgres10 => serializer.serialize_i32(18),
36070 Self::Postgres11 => serializer.serialize_i32(10),
36071 Self::Postgres12 => serializer.serialize_i32(19),
36072 Self::Postgres13 => serializer.serialize_i32(23),
36073 Self::Postgres14 => serializer.serialize_i32(110),
36074 Self::Postgres15 => serializer.serialize_i32(172),
36075 Self::Postgres16 => serializer.serialize_i32(272),
36076 Self::Postgres17 => serializer.serialize_i32(408),
36077 Self::Postgres18 => serializer.serialize_i32(557),
36078 Self::Postgres19 => serializer.serialize_i32(684),
36079 Self::Postgres20 => serializer.serialize_i32(781),
36080 Self::Sqlserver2019Standard => serializer.serialize_i32(26),
36081 Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
36082 Self::Sqlserver2019Express => serializer.serialize_i32(28),
36083 Self::Sqlserver2019Web => serializer.serialize_i32(29),
36084 Self::Sqlserver2022Standard => serializer.serialize_i32(199),
36085 Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
36086 Self::Sqlserver2022Express => serializer.serialize_i32(201),
36087 Self::Sqlserver2022Web => serializer.serialize_i32(202),
36088 Self::Sqlserver2025Standard => serializer.serialize_i32(549),
36089 Self::Sqlserver2025Enterprise => serializer.serialize_i32(550),
36090 Self::Sqlserver2025Express => serializer.serialize_i32(551),
36091 Self::UnknownValue(u) => u.0.serialize(serializer),
36092 }
36093 }
36094}
36095
36096impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
36097 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36098 where
36099 D: serde::Deserializer<'de>,
36100 {
36101 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
36102 ".google.cloud.sql.v1.SqlDatabaseVersion",
36103 ))
36104 }
36105}
36106
36107/// The pricing plan for this instance.
36108///
36109/// # Working with unknown values
36110///
36111/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36112/// additional enum variants at any time. Adding new variants is not considered
36113/// a breaking change. Applications should write their code in anticipation of:
36114///
36115/// - New values appearing in future releases of the client library, **and**
36116/// - New values received dynamically, without application changes.
36117///
36118/// Please consult the [Working with enums] section in the user guide for some
36119/// guidelines.
36120///
36121/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36122#[derive(Clone, Debug, PartialEq)]
36123#[non_exhaustive]
36124pub enum SqlPricingPlan {
36125 /// This is an unknown pricing plan for this instance.
36126 Unspecified,
36127 /// The instance is billed at a monthly flat rate.
36128 Package,
36129 /// The instance is billed per usage.
36130 PerUse,
36131 /// If set, the enum was initialized with an unknown value.
36132 ///
36133 /// Applications can examine the value using [SqlPricingPlan::value] or
36134 /// [SqlPricingPlan::name].
36135 UnknownValue(sql_pricing_plan::UnknownValue),
36136}
36137
36138#[doc(hidden)]
36139pub mod sql_pricing_plan {
36140 #[allow(unused_imports)]
36141 use super::*;
36142 #[derive(Clone, Debug, PartialEq)]
36143 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36144}
36145
36146impl SqlPricingPlan {
36147 /// Gets the enum value.
36148 ///
36149 /// Returns `None` if the enum contains an unknown value deserialized from
36150 /// the string representation of enums.
36151 pub fn value(&self) -> std::option::Option<i32> {
36152 match self {
36153 Self::Unspecified => std::option::Option::Some(0),
36154 Self::Package => std::option::Option::Some(1),
36155 Self::PerUse => std::option::Option::Some(2),
36156 Self::UnknownValue(u) => u.0.value(),
36157 }
36158 }
36159
36160 /// Gets the enum value as a string.
36161 ///
36162 /// Returns `None` if the enum contains an unknown value deserialized from
36163 /// the integer representation of enums.
36164 pub fn name(&self) -> std::option::Option<&str> {
36165 match self {
36166 Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
36167 Self::Package => std::option::Option::Some("PACKAGE"),
36168 Self::PerUse => std::option::Option::Some("PER_USE"),
36169 Self::UnknownValue(u) => u.0.name(),
36170 }
36171 }
36172}
36173
36174impl std::default::Default for SqlPricingPlan {
36175 fn default() -> Self {
36176 use std::convert::From;
36177 Self::from(0)
36178 }
36179}
36180
36181impl std::fmt::Display for SqlPricingPlan {
36182 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36183 wkt::internal::display_enum(f, self.name(), self.value())
36184 }
36185}
36186
36187impl std::convert::From<i32> for SqlPricingPlan {
36188 fn from(value: i32) -> Self {
36189 match value {
36190 0 => Self::Unspecified,
36191 1 => Self::Package,
36192 2 => Self::PerUse,
36193 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
36194 wkt::internal::UnknownEnumValue::Integer(value),
36195 )),
36196 }
36197 }
36198}
36199
36200impl std::convert::From<&str> for SqlPricingPlan {
36201 fn from(value: &str) -> Self {
36202 use std::string::ToString;
36203 match value {
36204 "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
36205 "PACKAGE" => Self::Package,
36206 "PER_USE" => Self::PerUse,
36207 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
36208 wkt::internal::UnknownEnumValue::String(value.to_string()),
36209 )),
36210 }
36211 }
36212}
36213
36214impl serde::ser::Serialize for SqlPricingPlan {
36215 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36216 where
36217 S: serde::Serializer,
36218 {
36219 match self {
36220 Self::Unspecified => serializer.serialize_i32(0),
36221 Self::Package => serializer.serialize_i32(1),
36222 Self::PerUse => serializer.serialize_i32(2),
36223 Self::UnknownValue(u) => u.0.serialize(serializer),
36224 }
36225 }
36226}
36227
36228impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
36229 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36230 where
36231 D: serde::Deserializer<'de>,
36232 {
36233 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
36234 ".google.cloud.sql.v1.SqlPricingPlan",
36235 ))
36236 }
36237}
36238
36239/// Enum for [SqlReplicationType].
36240///
36241/// # Working with unknown values
36242///
36243/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36244/// additional enum variants at any time. Adding new variants is not considered
36245/// a breaking change. Applications should write their code in anticipation of:
36246///
36247/// - New values appearing in future releases of the client library, **and**
36248/// - New values received dynamically, without application changes.
36249///
36250/// Please consult the [Working with enums] section in the user guide for some
36251/// guidelines.
36252///
36253/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36254#[derive(Clone, Debug, PartialEq)]
36255#[non_exhaustive]
36256pub enum SqlReplicationType {
36257 /// This is an unknown replication type for a Cloud SQL instance.
36258 Unspecified,
36259 /// The synchronous replication mode for First Generation instances. It is the
36260 /// default value.
36261 Synchronous,
36262 /// The asynchronous replication mode for First Generation instances. It
36263 /// provides a slight performance gain, but if an outage occurs while this
36264 /// option is set to asynchronous, you can lose up to a few seconds of updates
36265 /// to your data.
36266 Asynchronous,
36267 /// If set, the enum was initialized with an unknown value.
36268 ///
36269 /// Applications can examine the value using [SqlReplicationType::value] or
36270 /// [SqlReplicationType::name].
36271 UnknownValue(sql_replication_type::UnknownValue),
36272}
36273
36274#[doc(hidden)]
36275pub mod sql_replication_type {
36276 #[allow(unused_imports)]
36277 use super::*;
36278 #[derive(Clone, Debug, PartialEq)]
36279 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36280}
36281
36282impl SqlReplicationType {
36283 /// Gets the enum value.
36284 ///
36285 /// Returns `None` if the enum contains an unknown value deserialized from
36286 /// the string representation of enums.
36287 pub fn value(&self) -> std::option::Option<i32> {
36288 match self {
36289 Self::Unspecified => std::option::Option::Some(0),
36290 Self::Synchronous => std::option::Option::Some(1),
36291 Self::Asynchronous => std::option::Option::Some(2),
36292 Self::UnknownValue(u) => u.0.value(),
36293 }
36294 }
36295
36296 /// Gets the enum value as a string.
36297 ///
36298 /// Returns `None` if the enum contains an unknown value deserialized from
36299 /// the integer representation of enums.
36300 pub fn name(&self) -> std::option::Option<&str> {
36301 match self {
36302 Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
36303 Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
36304 Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
36305 Self::UnknownValue(u) => u.0.name(),
36306 }
36307 }
36308}
36309
36310impl std::default::Default for SqlReplicationType {
36311 fn default() -> Self {
36312 use std::convert::From;
36313 Self::from(0)
36314 }
36315}
36316
36317impl std::fmt::Display for SqlReplicationType {
36318 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36319 wkt::internal::display_enum(f, self.name(), self.value())
36320 }
36321}
36322
36323impl std::convert::From<i32> for SqlReplicationType {
36324 fn from(value: i32) -> Self {
36325 match value {
36326 0 => Self::Unspecified,
36327 1 => Self::Synchronous,
36328 2 => Self::Asynchronous,
36329 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
36330 wkt::internal::UnknownEnumValue::Integer(value),
36331 )),
36332 }
36333 }
36334}
36335
36336impl std::convert::From<&str> for SqlReplicationType {
36337 fn from(value: &str) -> Self {
36338 use std::string::ToString;
36339 match value {
36340 "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
36341 "SYNCHRONOUS" => Self::Synchronous,
36342 "ASYNCHRONOUS" => Self::Asynchronous,
36343 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
36344 wkt::internal::UnknownEnumValue::String(value.to_string()),
36345 )),
36346 }
36347 }
36348}
36349
36350impl serde::ser::Serialize for SqlReplicationType {
36351 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36352 where
36353 S: serde::Serializer,
36354 {
36355 match self {
36356 Self::Unspecified => serializer.serialize_i32(0),
36357 Self::Synchronous => serializer.serialize_i32(1),
36358 Self::Asynchronous => serializer.serialize_i32(2),
36359 Self::UnknownValue(u) => u.0.serialize(serializer),
36360 }
36361 }
36362}
36363
36364impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
36365 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36366 where
36367 D: serde::Deserializer<'de>,
36368 {
36369 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
36370 ".google.cloud.sql.v1.SqlReplicationType",
36371 ))
36372 }
36373}
36374
36375/// The type of disk that is used for a v2 instance to use.
36376///
36377/// # Working with unknown values
36378///
36379/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36380/// additional enum variants at any time. Adding new variants is not considered
36381/// a breaking change. Applications should write their code in anticipation of:
36382///
36383/// - New values appearing in future releases of the client library, **and**
36384/// - New values received dynamically, without application changes.
36385///
36386/// Please consult the [Working with enums] section in the user guide for some
36387/// guidelines.
36388///
36389/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36390#[derive(Clone, Debug, PartialEq)]
36391#[non_exhaustive]
36392pub enum SqlDataDiskType {
36393 /// This is an unknown data disk type.
36394 Unspecified,
36395 /// An SSD data disk.
36396 PdSsd,
36397 /// An HDD data disk.
36398 PdHdd,
36399 /// This field is deprecated and will be removed from a future version of the
36400 /// API.
36401 #[deprecated]
36402 ObsoleteLocalSsd,
36403 /// A Hyperdisk Balanced data disk.
36404 HyperdiskBalanced,
36405 /// If set, the enum was initialized with an unknown value.
36406 ///
36407 /// Applications can examine the value using [SqlDataDiskType::value] or
36408 /// [SqlDataDiskType::name].
36409 UnknownValue(sql_data_disk_type::UnknownValue),
36410}
36411
36412#[doc(hidden)]
36413pub mod sql_data_disk_type {
36414 #[allow(unused_imports)]
36415 use super::*;
36416 #[derive(Clone, Debug, PartialEq)]
36417 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36418}
36419
36420impl SqlDataDiskType {
36421 /// Gets the enum value.
36422 ///
36423 /// Returns `None` if the enum contains an unknown value deserialized from
36424 /// the string representation of enums.
36425 pub fn value(&self) -> std::option::Option<i32> {
36426 match self {
36427 Self::Unspecified => std::option::Option::Some(0),
36428 Self::PdSsd => std::option::Option::Some(1),
36429 Self::PdHdd => std::option::Option::Some(2),
36430 Self::ObsoleteLocalSsd => std::option::Option::Some(3),
36431 Self::HyperdiskBalanced => std::option::Option::Some(4),
36432 Self::UnknownValue(u) => u.0.value(),
36433 }
36434 }
36435
36436 /// Gets the enum value as a string.
36437 ///
36438 /// Returns `None` if the enum contains an unknown value deserialized from
36439 /// the integer representation of enums.
36440 pub fn name(&self) -> std::option::Option<&str> {
36441 match self {
36442 Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
36443 Self::PdSsd => std::option::Option::Some("PD_SSD"),
36444 Self::PdHdd => std::option::Option::Some("PD_HDD"),
36445 Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
36446 Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
36447 Self::UnknownValue(u) => u.0.name(),
36448 }
36449 }
36450}
36451
36452impl std::default::Default for SqlDataDiskType {
36453 fn default() -> Self {
36454 use std::convert::From;
36455 Self::from(0)
36456 }
36457}
36458
36459impl std::fmt::Display for SqlDataDiskType {
36460 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36461 wkt::internal::display_enum(f, self.name(), self.value())
36462 }
36463}
36464
36465impl std::convert::From<i32> for SqlDataDiskType {
36466 fn from(value: i32) -> Self {
36467 match value {
36468 0 => Self::Unspecified,
36469 1 => Self::PdSsd,
36470 2 => Self::PdHdd,
36471 3 => Self::ObsoleteLocalSsd,
36472 4 => Self::HyperdiskBalanced,
36473 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
36474 wkt::internal::UnknownEnumValue::Integer(value),
36475 )),
36476 }
36477 }
36478}
36479
36480impl std::convert::From<&str> for SqlDataDiskType {
36481 fn from(value: &str) -> Self {
36482 use std::string::ToString;
36483 match value {
36484 "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
36485 "PD_SSD" => Self::PdSsd,
36486 "PD_HDD" => Self::PdHdd,
36487 "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
36488 "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
36489 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
36490 wkt::internal::UnknownEnumValue::String(value.to_string()),
36491 )),
36492 }
36493 }
36494}
36495
36496impl serde::ser::Serialize for SqlDataDiskType {
36497 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36498 where
36499 S: serde::Serializer,
36500 {
36501 match self {
36502 Self::Unspecified => serializer.serialize_i32(0),
36503 Self::PdSsd => serializer.serialize_i32(1),
36504 Self::PdHdd => serializer.serialize_i32(2),
36505 Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
36506 Self::HyperdiskBalanced => serializer.serialize_i32(4),
36507 Self::UnknownValue(u) => u.0.serialize(serializer),
36508 }
36509 }
36510}
36511
36512impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
36513 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36514 where
36515 D: serde::Deserializer<'de>,
36516 {
36517 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
36518 ".google.cloud.sql.v1.SqlDataDiskType",
36519 ))
36520 }
36521}
36522
36523/// The availability type of the given Cloud SQL instance.
36524///
36525/// # Working with unknown values
36526///
36527/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36528/// additional enum variants at any time. Adding new variants is not considered
36529/// a breaking change. Applications should write their code in anticipation of:
36530///
36531/// - New values appearing in future releases of the client library, **and**
36532/// - New values received dynamically, without application changes.
36533///
36534/// Please consult the [Working with enums] section in the user guide for some
36535/// guidelines.
36536///
36537/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36538#[derive(Clone, Debug, PartialEq)]
36539#[non_exhaustive]
36540pub enum SqlAvailabilityType {
36541 /// This is an unknown Availability type.
36542 Unspecified,
36543 /// Zonal available instance.
36544 Zonal,
36545 /// Regional available instance.
36546 Regional,
36547 /// If set, the enum was initialized with an unknown value.
36548 ///
36549 /// Applications can examine the value using [SqlAvailabilityType::value] or
36550 /// [SqlAvailabilityType::name].
36551 UnknownValue(sql_availability_type::UnknownValue),
36552}
36553
36554#[doc(hidden)]
36555pub mod sql_availability_type {
36556 #[allow(unused_imports)]
36557 use super::*;
36558 #[derive(Clone, Debug, PartialEq)]
36559 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36560}
36561
36562impl SqlAvailabilityType {
36563 /// Gets the enum value.
36564 ///
36565 /// Returns `None` if the enum contains an unknown value deserialized from
36566 /// the string representation of enums.
36567 pub fn value(&self) -> std::option::Option<i32> {
36568 match self {
36569 Self::Unspecified => std::option::Option::Some(0),
36570 Self::Zonal => std::option::Option::Some(1),
36571 Self::Regional => std::option::Option::Some(2),
36572 Self::UnknownValue(u) => u.0.value(),
36573 }
36574 }
36575
36576 /// Gets the enum value as a string.
36577 ///
36578 /// Returns `None` if the enum contains an unknown value deserialized from
36579 /// the integer representation of enums.
36580 pub fn name(&self) -> std::option::Option<&str> {
36581 match self {
36582 Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
36583 Self::Zonal => std::option::Option::Some("ZONAL"),
36584 Self::Regional => std::option::Option::Some("REGIONAL"),
36585 Self::UnknownValue(u) => u.0.name(),
36586 }
36587 }
36588}
36589
36590impl std::default::Default for SqlAvailabilityType {
36591 fn default() -> Self {
36592 use std::convert::From;
36593 Self::from(0)
36594 }
36595}
36596
36597impl std::fmt::Display for SqlAvailabilityType {
36598 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36599 wkt::internal::display_enum(f, self.name(), self.value())
36600 }
36601}
36602
36603impl std::convert::From<i32> for SqlAvailabilityType {
36604 fn from(value: i32) -> Self {
36605 match value {
36606 0 => Self::Unspecified,
36607 1 => Self::Zonal,
36608 2 => Self::Regional,
36609 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
36610 wkt::internal::UnknownEnumValue::Integer(value),
36611 )),
36612 }
36613 }
36614}
36615
36616impl std::convert::From<&str> for SqlAvailabilityType {
36617 fn from(value: &str) -> Self {
36618 use std::string::ToString;
36619 match value {
36620 "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
36621 "ZONAL" => Self::Zonal,
36622 "REGIONAL" => Self::Regional,
36623 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
36624 wkt::internal::UnknownEnumValue::String(value.to_string()),
36625 )),
36626 }
36627 }
36628}
36629
36630impl serde::ser::Serialize for SqlAvailabilityType {
36631 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36632 where
36633 S: serde::Serializer,
36634 {
36635 match self {
36636 Self::Unspecified => serializer.serialize_i32(0),
36637 Self::Zonal => serializer.serialize_i32(1),
36638 Self::Regional => serializer.serialize_i32(2),
36639 Self::UnknownValue(u) => u.0.serialize(serializer),
36640 }
36641 }
36642}
36643
36644impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
36645 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36646 where
36647 D: serde::Deserializer<'de>,
36648 {
36649 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
36650 ".google.cloud.sql.v1.SqlAvailabilityType",
36651 ))
36652 }
36653}
36654
36655/// Enum for [SqlUpdateTrack].
36656///
36657/// # Working with unknown values
36658///
36659/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36660/// additional enum variants at any time. Adding new variants is not considered
36661/// a breaking change. Applications should write their code in anticipation of:
36662///
36663/// - New values appearing in future releases of the client library, **and**
36664/// - New values received dynamically, without application changes.
36665///
36666/// Please consult the [Working with enums] section in the user guide for some
36667/// guidelines.
36668///
36669/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36670#[derive(Clone, Debug, PartialEq)]
36671#[non_exhaustive]
36672pub enum SqlUpdateTrack {
36673 /// This is an unknown maintenance timing preference.
36674 Unspecified,
36675 /// For an instance with a scheduled maintenance window, this maintenance
36676 /// timing indicates that the maintenance update is scheduled 7 to 14 days
36677 /// after the notification is sent out. Also referred to as `Week 1` (Console)
36678 /// and `preview` (gcloud CLI).
36679 Canary,
36680 /// For an instance with a scheduled maintenance window, this maintenance
36681 /// timing indicates that the maintenance update is scheduled 15 to 21 days
36682 /// after the notification is sent out. Also referred to as `Week 2` (Console)
36683 /// and `production` (gcloud CLI).
36684 Stable,
36685 /// For instance with a scheduled maintenance window, this maintenance
36686 /// timing indicates that the maintenance update is scheduled 35 to 42 days
36687 /// after the notification is sent out.
36688 Week5,
36689 /// If set, the enum was initialized with an unknown value.
36690 ///
36691 /// Applications can examine the value using [SqlUpdateTrack::value] or
36692 /// [SqlUpdateTrack::name].
36693 UnknownValue(sql_update_track::UnknownValue),
36694}
36695
36696#[doc(hidden)]
36697pub mod sql_update_track {
36698 #[allow(unused_imports)]
36699 use super::*;
36700 #[derive(Clone, Debug, PartialEq)]
36701 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36702}
36703
36704impl SqlUpdateTrack {
36705 /// Gets the enum value.
36706 ///
36707 /// Returns `None` if the enum contains an unknown value deserialized from
36708 /// the string representation of enums.
36709 pub fn value(&self) -> std::option::Option<i32> {
36710 match self {
36711 Self::Unspecified => std::option::Option::Some(0),
36712 Self::Canary => std::option::Option::Some(1),
36713 Self::Stable => std::option::Option::Some(2),
36714 Self::Week5 => std::option::Option::Some(3),
36715 Self::UnknownValue(u) => u.0.value(),
36716 }
36717 }
36718
36719 /// Gets the enum value as a string.
36720 ///
36721 /// Returns `None` if the enum contains an unknown value deserialized from
36722 /// the integer representation of enums.
36723 pub fn name(&self) -> std::option::Option<&str> {
36724 match self {
36725 Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
36726 Self::Canary => std::option::Option::Some("canary"),
36727 Self::Stable => std::option::Option::Some("stable"),
36728 Self::Week5 => std::option::Option::Some("week5"),
36729 Self::UnknownValue(u) => u.0.name(),
36730 }
36731 }
36732}
36733
36734impl std::default::Default for SqlUpdateTrack {
36735 fn default() -> Self {
36736 use std::convert::From;
36737 Self::from(0)
36738 }
36739}
36740
36741impl std::fmt::Display for SqlUpdateTrack {
36742 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36743 wkt::internal::display_enum(f, self.name(), self.value())
36744 }
36745}
36746
36747impl std::convert::From<i32> for SqlUpdateTrack {
36748 fn from(value: i32) -> Self {
36749 match value {
36750 0 => Self::Unspecified,
36751 1 => Self::Canary,
36752 2 => Self::Stable,
36753 3 => Self::Week5,
36754 _ => Self::UnknownValue(sql_update_track::UnknownValue(
36755 wkt::internal::UnknownEnumValue::Integer(value),
36756 )),
36757 }
36758 }
36759}
36760
36761impl std::convert::From<&str> for SqlUpdateTrack {
36762 fn from(value: &str) -> Self {
36763 use std::string::ToString;
36764 match value {
36765 "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
36766 "canary" => Self::Canary,
36767 "stable" => Self::Stable,
36768 "week5" => Self::Week5,
36769 _ => Self::UnknownValue(sql_update_track::UnknownValue(
36770 wkt::internal::UnknownEnumValue::String(value.to_string()),
36771 )),
36772 }
36773 }
36774}
36775
36776impl serde::ser::Serialize for SqlUpdateTrack {
36777 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36778 where
36779 S: serde::Serializer,
36780 {
36781 match self {
36782 Self::Unspecified => serializer.serialize_i32(0),
36783 Self::Canary => serializer.serialize_i32(1),
36784 Self::Stable => serializer.serialize_i32(2),
36785 Self::Week5 => serializer.serialize_i32(3),
36786 Self::UnknownValue(u) => u.0.serialize(serializer),
36787 }
36788 }
36789}
36790
36791impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
36792 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36793 where
36794 D: serde::Deserializer<'de>,
36795 {
36796 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
36797 ".google.cloud.sql.v1.SqlUpdateTrack",
36798 ))
36799 }
36800}
36801
36802/// The status of automated DNS provisioning.
36803///
36804/// # Working with unknown values
36805///
36806/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36807/// additional enum variants at any time. Adding new variants is not considered
36808/// a breaking change. Applications should write their code in anticipation of:
36809///
36810/// - New values appearing in future releases of the client library, **and**
36811/// - New values received dynamically, without application changes.
36812///
36813/// Please consult the [Working with enums] section in the user guide for some
36814/// guidelines.
36815///
36816/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36817#[derive(Clone, Debug, PartialEq)]
36818#[non_exhaustive]
36819pub enum AutoDnsStatus {
36820 /// Unspecified status. This means status is missing from dependency service.
36821 Unspecified,
36822 /// DNS provisioning is OK.
36823 AutoDnsOk,
36824 /// DNS provisioning failed.
36825 AutoDnsFailed,
36826 /// DNS provisioning status is not recognized by Cloud SQL.
36827 AutoDnsUnknown,
36828 /// If set, the enum was initialized with an unknown value.
36829 ///
36830 /// Applications can examine the value using [AutoDnsStatus::value] or
36831 /// [AutoDnsStatus::name].
36832 UnknownValue(auto_dns_status::UnknownValue),
36833}
36834
36835#[doc(hidden)]
36836pub mod auto_dns_status {
36837 #[allow(unused_imports)]
36838 use super::*;
36839 #[derive(Clone, Debug, PartialEq)]
36840 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36841}
36842
36843impl AutoDnsStatus {
36844 /// Gets the enum value.
36845 ///
36846 /// Returns `None` if the enum contains an unknown value deserialized from
36847 /// the string representation of enums.
36848 pub fn value(&self) -> std::option::Option<i32> {
36849 match self {
36850 Self::Unspecified => std::option::Option::Some(0),
36851 Self::AutoDnsOk => std::option::Option::Some(1),
36852 Self::AutoDnsFailed => std::option::Option::Some(2),
36853 Self::AutoDnsUnknown => std::option::Option::Some(3),
36854 Self::UnknownValue(u) => u.0.value(),
36855 }
36856 }
36857
36858 /// Gets the enum value as a string.
36859 ///
36860 /// Returns `None` if the enum contains an unknown value deserialized from
36861 /// the integer representation of enums.
36862 pub fn name(&self) -> std::option::Option<&str> {
36863 match self {
36864 Self::Unspecified => std::option::Option::Some("AUTO_DNS_STATUS_UNSPECIFIED"),
36865 Self::AutoDnsOk => std::option::Option::Some("AUTO_DNS_OK"),
36866 Self::AutoDnsFailed => std::option::Option::Some("AUTO_DNS_FAILED"),
36867 Self::AutoDnsUnknown => std::option::Option::Some("AUTO_DNS_UNKNOWN"),
36868 Self::UnknownValue(u) => u.0.name(),
36869 }
36870 }
36871}
36872
36873impl std::default::Default for AutoDnsStatus {
36874 fn default() -> Self {
36875 use std::convert::From;
36876 Self::from(0)
36877 }
36878}
36879
36880impl std::fmt::Display for AutoDnsStatus {
36881 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36882 wkt::internal::display_enum(f, self.name(), self.value())
36883 }
36884}
36885
36886impl std::convert::From<i32> for AutoDnsStatus {
36887 fn from(value: i32) -> Self {
36888 match value {
36889 0 => Self::Unspecified,
36890 1 => Self::AutoDnsOk,
36891 2 => Self::AutoDnsFailed,
36892 3 => Self::AutoDnsUnknown,
36893 _ => Self::UnknownValue(auto_dns_status::UnknownValue(
36894 wkt::internal::UnknownEnumValue::Integer(value),
36895 )),
36896 }
36897 }
36898}
36899
36900impl std::convert::From<&str> for AutoDnsStatus {
36901 fn from(value: &str) -> Self {
36902 use std::string::ToString;
36903 match value {
36904 "AUTO_DNS_STATUS_UNSPECIFIED" => Self::Unspecified,
36905 "AUTO_DNS_OK" => Self::AutoDnsOk,
36906 "AUTO_DNS_FAILED" => Self::AutoDnsFailed,
36907 "AUTO_DNS_UNKNOWN" => Self::AutoDnsUnknown,
36908 _ => Self::UnknownValue(auto_dns_status::UnknownValue(
36909 wkt::internal::UnknownEnumValue::String(value.to_string()),
36910 )),
36911 }
36912 }
36913}
36914
36915impl serde::ser::Serialize for AutoDnsStatus {
36916 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36917 where
36918 S: serde::Serializer,
36919 {
36920 match self {
36921 Self::Unspecified => serializer.serialize_i32(0),
36922 Self::AutoDnsOk => serializer.serialize_i32(1),
36923 Self::AutoDnsFailed => serializer.serialize_i32(2),
36924 Self::AutoDnsUnknown => serializer.serialize_i32(3),
36925 Self::UnknownValue(u) => u.0.serialize(serializer),
36926 }
36927 }
36928}
36929
36930impl<'de> serde::de::Deserialize<'de> for AutoDnsStatus {
36931 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36932 where
36933 D: serde::Deserializer<'de>,
36934 {
36935 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoDnsStatus>::new(
36936 ".google.cloud.sql.v1.AutoDnsStatus",
36937 ))
36938 }
36939}