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 /// Optional. Region of the Cloud SQL instance.
3443 pub location: std::string::String,
3444
3445 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3446}
3447
3448impl SqlDatabasesDeleteRequest {
3449 /// Creates a new default instance.
3450 pub fn new() -> Self {
3451 std::default::Default::default()
3452 }
3453
3454 /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
3455 ///
3456 /// # Example
3457 /// ```ignore,no_run
3458 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3459 /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
3460 /// ```
3461 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3462 self.database = v.into();
3463 self
3464 }
3465
3466 /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
3467 ///
3468 /// # Example
3469 /// ```ignore,no_run
3470 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3471 /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
3472 /// ```
3473 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3474 self.instance = v.into();
3475 self
3476 }
3477
3478 /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
3479 ///
3480 /// # Example
3481 /// ```ignore,no_run
3482 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3483 /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
3484 /// ```
3485 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3486 self.project = v.into();
3487 self
3488 }
3489
3490 /// Sets the value of [location][crate::model::SqlDatabasesDeleteRequest::location].
3491 ///
3492 /// # Example
3493 /// ```ignore,no_run
3494 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3495 /// let x = SqlDatabasesDeleteRequest::new().set_location("example");
3496 /// ```
3497 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3498 self.location = v.into();
3499 self
3500 }
3501}
3502
3503impl wkt::message::Message for SqlDatabasesDeleteRequest {
3504 fn typename() -> &'static str {
3505 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
3506 }
3507}
3508
3509/// Database get request.
3510#[derive(Clone, Default, PartialEq)]
3511#[non_exhaustive]
3512pub struct SqlDatabasesGetRequest {
3513 /// Name of the database in the instance.
3514 pub database: std::string::String,
3515
3516 /// Database instance ID. This does not include the project ID.
3517 pub instance: std::string::String,
3518
3519 /// Project ID of the project that contains the instance.
3520 pub project: std::string::String,
3521
3522 /// Optional. Region of the Cloud SQL instance.
3523 pub location: std::string::String,
3524
3525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3526}
3527
3528impl SqlDatabasesGetRequest {
3529 /// Creates a new default instance.
3530 pub fn new() -> Self {
3531 std::default::Default::default()
3532 }
3533
3534 /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
3535 ///
3536 /// # Example
3537 /// ```ignore,no_run
3538 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3539 /// let x = SqlDatabasesGetRequest::new().set_database("example");
3540 /// ```
3541 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3542 self.database = v.into();
3543 self
3544 }
3545
3546 /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
3547 ///
3548 /// # Example
3549 /// ```ignore,no_run
3550 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3551 /// let x = SqlDatabasesGetRequest::new().set_instance("example");
3552 /// ```
3553 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3554 self.instance = v.into();
3555 self
3556 }
3557
3558 /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
3559 ///
3560 /// # Example
3561 /// ```ignore,no_run
3562 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3563 /// let x = SqlDatabasesGetRequest::new().set_project("example");
3564 /// ```
3565 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3566 self.project = v.into();
3567 self
3568 }
3569
3570 /// Sets the value of [location][crate::model::SqlDatabasesGetRequest::location].
3571 ///
3572 /// # Example
3573 /// ```ignore,no_run
3574 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3575 /// let x = SqlDatabasesGetRequest::new().set_location("example");
3576 /// ```
3577 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3578 self.location = v.into();
3579 self
3580 }
3581}
3582
3583impl wkt::message::Message for SqlDatabasesGetRequest {
3584 fn typename() -> &'static str {
3585 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
3586 }
3587}
3588
3589/// Database insert request.
3590#[derive(Clone, Default, PartialEq)]
3591#[non_exhaustive]
3592pub struct SqlDatabasesInsertRequest {
3593 /// Database instance ID. This does not include the project ID.
3594 pub instance: std::string::String,
3595
3596 /// Project ID of the project that contains the instance.
3597 pub project: std::string::String,
3598
3599 #[allow(missing_docs)]
3600 pub body: std::option::Option<crate::model::Database>,
3601
3602 /// Optional. Region of the Cloud SQL instance.
3603 pub location: std::string::String,
3604
3605 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3606}
3607
3608impl SqlDatabasesInsertRequest {
3609 /// Creates a new default instance.
3610 pub fn new() -> Self {
3611 std::default::Default::default()
3612 }
3613
3614 /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
3615 ///
3616 /// # Example
3617 /// ```ignore,no_run
3618 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3619 /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
3620 /// ```
3621 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3622 self.instance = v.into();
3623 self
3624 }
3625
3626 /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
3627 ///
3628 /// # Example
3629 /// ```ignore,no_run
3630 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3631 /// let x = SqlDatabasesInsertRequest::new().set_project("example");
3632 /// ```
3633 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3634 self.project = v.into();
3635 self
3636 }
3637
3638 /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3639 ///
3640 /// # Example
3641 /// ```ignore,no_run
3642 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3643 /// use google_cloud_sql_v1::model::Database;
3644 /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
3645 /// ```
3646 pub fn set_body<T>(mut self, v: T) -> Self
3647 where
3648 T: std::convert::Into<crate::model::Database>,
3649 {
3650 self.body = std::option::Option::Some(v.into());
3651 self
3652 }
3653
3654 /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3655 ///
3656 /// # Example
3657 /// ```ignore,no_run
3658 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3659 /// use google_cloud_sql_v1::model::Database;
3660 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3661 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
3662 /// ```
3663 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3664 where
3665 T: std::convert::Into<crate::model::Database>,
3666 {
3667 self.body = v.map(|x| x.into());
3668 self
3669 }
3670
3671 /// Sets the value of [location][crate::model::SqlDatabasesInsertRequest::location].
3672 ///
3673 /// # Example
3674 /// ```ignore,no_run
3675 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3676 /// let x = SqlDatabasesInsertRequest::new().set_location("example");
3677 /// ```
3678 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3679 self.location = v.into();
3680 self
3681 }
3682}
3683
3684impl wkt::message::Message for SqlDatabasesInsertRequest {
3685 fn typename() -> &'static str {
3686 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
3687 }
3688}
3689
3690/// Database list request.
3691#[derive(Clone, Default, PartialEq)]
3692#[non_exhaustive]
3693pub struct SqlDatabasesListRequest {
3694 /// Cloud SQL instance ID. This does not include the project ID.
3695 pub instance: std::string::String,
3696
3697 /// Project ID of the project that contains the instance.
3698 pub project: std::string::String,
3699
3700 /// Optional. Region of the Cloud SQL instance.
3701 pub location: std::string::String,
3702
3703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3704}
3705
3706impl SqlDatabasesListRequest {
3707 /// Creates a new default instance.
3708 pub fn new() -> Self {
3709 std::default::Default::default()
3710 }
3711
3712 /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
3713 ///
3714 /// # Example
3715 /// ```ignore,no_run
3716 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3717 /// let x = SqlDatabasesListRequest::new().set_instance("example");
3718 /// ```
3719 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3720 self.instance = v.into();
3721 self
3722 }
3723
3724 /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
3725 ///
3726 /// # Example
3727 /// ```ignore,no_run
3728 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3729 /// let x = SqlDatabasesListRequest::new().set_project("example");
3730 /// ```
3731 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3732 self.project = v.into();
3733 self
3734 }
3735
3736 /// Sets the value of [location][crate::model::SqlDatabasesListRequest::location].
3737 ///
3738 /// # Example
3739 /// ```ignore,no_run
3740 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3741 /// let x = SqlDatabasesListRequest::new().set_location("example");
3742 /// ```
3743 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3744 self.location = v.into();
3745 self
3746 }
3747}
3748
3749impl wkt::message::Message for SqlDatabasesListRequest {
3750 fn typename() -> &'static str {
3751 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
3752 }
3753}
3754
3755/// Database update request.
3756#[derive(Clone, Default, PartialEq)]
3757#[non_exhaustive]
3758pub struct SqlDatabasesUpdateRequest {
3759 /// Name of the database to be updated in the instance.
3760 pub database: std::string::String,
3761
3762 /// Database instance ID. This does not include the project ID.
3763 pub instance: std::string::String,
3764
3765 /// Project ID of the project that contains the instance.
3766 pub project: std::string::String,
3767
3768 #[allow(missing_docs)]
3769 pub body: std::option::Option<crate::model::Database>,
3770
3771 /// Optional. Region of the Cloud SQL instance.
3772 pub location: std::string::String,
3773
3774 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3775}
3776
3777impl SqlDatabasesUpdateRequest {
3778 /// Creates a new default instance.
3779 pub fn new() -> Self {
3780 std::default::Default::default()
3781 }
3782
3783 /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
3784 ///
3785 /// # Example
3786 /// ```ignore,no_run
3787 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3788 /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
3789 /// ```
3790 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3791 self.database = v.into();
3792 self
3793 }
3794
3795 /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
3796 ///
3797 /// # Example
3798 /// ```ignore,no_run
3799 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3800 /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
3801 /// ```
3802 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3803 self.instance = v.into();
3804 self
3805 }
3806
3807 /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
3808 ///
3809 /// # Example
3810 /// ```ignore,no_run
3811 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3812 /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
3813 /// ```
3814 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3815 self.project = v.into();
3816 self
3817 }
3818
3819 /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3820 ///
3821 /// # Example
3822 /// ```ignore,no_run
3823 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3824 /// use google_cloud_sql_v1::model::Database;
3825 /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
3826 /// ```
3827 pub fn set_body<T>(mut self, v: T) -> Self
3828 where
3829 T: std::convert::Into<crate::model::Database>,
3830 {
3831 self.body = std::option::Option::Some(v.into());
3832 self
3833 }
3834
3835 /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3836 ///
3837 /// # Example
3838 /// ```ignore,no_run
3839 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3840 /// use google_cloud_sql_v1::model::Database;
3841 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3842 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
3843 /// ```
3844 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3845 where
3846 T: std::convert::Into<crate::model::Database>,
3847 {
3848 self.body = v.map(|x| x.into());
3849 self
3850 }
3851
3852 /// Sets the value of [location][crate::model::SqlDatabasesUpdateRequest::location].
3853 ///
3854 /// # Example
3855 /// ```ignore,no_run
3856 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3857 /// let x = SqlDatabasesUpdateRequest::new().set_location("example");
3858 /// ```
3859 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3860 self.location = v.into();
3861 self
3862 }
3863}
3864
3865impl wkt::message::Message for SqlDatabasesUpdateRequest {
3866 fn typename() -> &'static str {
3867 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
3868 }
3869}
3870
3871/// Database list response.
3872#[derive(Clone, Default, PartialEq)]
3873#[non_exhaustive]
3874pub struct DatabasesListResponse {
3875 /// This is always `sql#databasesList`.
3876 pub kind: std::string::String,
3877
3878 /// List of database resources in the instance.
3879 pub items: std::vec::Vec<crate::model::Database>,
3880
3881 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3882}
3883
3884impl DatabasesListResponse {
3885 /// Creates a new default instance.
3886 pub fn new() -> Self {
3887 std::default::Default::default()
3888 }
3889
3890 /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
3891 ///
3892 /// # Example
3893 /// ```ignore,no_run
3894 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3895 /// let x = DatabasesListResponse::new().set_kind("example");
3896 /// ```
3897 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3898 self.kind = v.into();
3899 self
3900 }
3901
3902 /// Sets the value of [items][crate::model::DatabasesListResponse::items].
3903 ///
3904 /// # Example
3905 /// ```ignore,no_run
3906 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3907 /// use google_cloud_sql_v1::model::Database;
3908 /// let x = DatabasesListResponse::new()
3909 /// .set_items([
3910 /// Database::default()/* use setters */,
3911 /// Database::default()/* use (different) setters */,
3912 /// ]);
3913 /// ```
3914 pub fn set_items<T, V>(mut self, v: T) -> Self
3915 where
3916 T: std::iter::IntoIterator<Item = V>,
3917 V: std::convert::Into<crate::model::Database>,
3918 {
3919 use std::iter::Iterator;
3920 self.items = v.into_iter().map(|i| i.into()).collect();
3921 self
3922 }
3923}
3924
3925impl wkt::message::Message for DatabasesListResponse {
3926 fn typename() -> &'static str {
3927 "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
3928 }
3929}
3930
3931/// Flags list request.
3932#[derive(Clone, Default, PartialEq)]
3933#[non_exhaustive]
3934pub struct SqlFlagsListRequest {
3935 /// Database type and version you want to retrieve flags for. By default, this
3936 /// method returns flags for all database types and versions.
3937 pub database_version: std::string::String,
3938
3939 /// Optional. Specify the scope of flags to be returned by SqlFlagsListService.
3940 /// Return list of database flags if unspecified.
3941 pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
3942
3943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3944}
3945
3946impl SqlFlagsListRequest {
3947 /// Creates a new default instance.
3948 pub fn new() -> Self {
3949 std::default::Default::default()
3950 }
3951
3952 /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
3953 ///
3954 /// # Example
3955 /// ```ignore,no_run
3956 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3957 /// let x = SqlFlagsListRequest::new().set_database_version("example");
3958 /// ```
3959 pub fn set_database_version<T: std::convert::Into<std::string::String>>(
3960 mut self,
3961 v: T,
3962 ) -> Self {
3963 self.database_version = v.into();
3964 self
3965 }
3966
3967 /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3968 ///
3969 /// # Example
3970 /// ```ignore,no_run
3971 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3972 /// use google_cloud_sql_v1::model::SqlFlagScope;
3973 /// let x0 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::Database);
3974 /// let x1 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::ConnectionPool);
3975 /// ```
3976 pub fn set_flag_scope<T>(mut self, v: T) -> Self
3977 where
3978 T: std::convert::Into<crate::model::SqlFlagScope>,
3979 {
3980 self.flag_scope = std::option::Option::Some(v.into());
3981 self
3982 }
3983
3984 /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3985 ///
3986 /// # Example
3987 /// ```ignore,no_run
3988 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3989 /// use google_cloud_sql_v1::model::SqlFlagScope;
3990 /// let x0 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::Database));
3991 /// let x1 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::ConnectionPool));
3992 /// let x_none = SqlFlagsListRequest::new().set_or_clear_flag_scope(None::<SqlFlagScope>);
3993 /// ```
3994 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
3995 where
3996 T: std::convert::Into<crate::model::SqlFlagScope>,
3997 {
3998 self.flag_scope = v.map(|x| x.into());
3999 self
4000 }
4001}
4002
4003impl wkt::message::Message for SqlFlagsListRequest {
4004 fn typename() -> &'static str {
4005 "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
4006 }
4007}
4008
4009/// Flags list response.
4010#[derive(Clone, Default, PartialEq)]
4011#[non_exhaustive]
4012pub struct FlagsListResponse {
4013 /// This is always `sql#flagsList`.
4014 pub kind: std::string::String,
4015
4016 /// List of flags.
4017 pub items: std::vec::Vec<crate::model::Flag>,
4018
4019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4020}
4021
4022impl FlagsListResponse {
4023 /// Creates a new default instance.
4024 pub fn new() -> Self {
4025 std::default::Default::default()
4026 }
4027
4028 /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
4029 ///
4030 /// # Example
4031 /// ```ignore,no_run
4032 /// # use google_cloud_sql_v1::model::FlagsListResponse;
4033 /// let x = FlagsListResponse::new().set_kind("example");
4034 /// ```
4035 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4036 self.kind = v.into();
4037 self
4038 }
4039
4040 /// Sets the value of [items][crate::model::FlagsListResponse::items].
4041 ///
4042 /// # Example
4043 /// ```ignore,no_run
4044 /// # use google_cloud_sql_v1::model::FlagsListResponse;
4045 /// use google_cloud_sql_v1::model::Flag;
4046 /// let x = FlagsListResponse::new()
4047 /// .set_items([
4048 /// Flag::default()/* use setters */,
4049 /// Flag::default()/* use (different) setters */,
4050 /// ]);
4051 /// ```
4052 pub fn set_items<T, V>(mut self, v: T) -> Self
4053 where
4054 T: std::iter::IntoIterator<Item = V>,
4055 V: std::convert::Into<crate::model::Flag>,
4056 {
4057 use std::iter::Iterator;
4058 self.items = v.into_iter().map(|i| i.into()).collect();
4059 self
4060 }
4061}
4062
4063impl wkt::message::Message for FlagsListResponse {
4064 fn typename() -> &'static str {
4065 "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
4066 }
4067}
4068
4069/// A flag resource.
4070#[derive(Clone, Default, PartialEq)]
4071#[non_exhaustive]
4072pub struct Flag {
4073 /// This is the name of the flag. Flag names always use underscores, not
4074 /// hyphens, for example: `max_allowed_packet`
4075 pub name: std::string::String,
4076
4077 /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
4078 /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
4079 /// value, such as `skip_grant_tables`.
4080 pub r#type: crate::model::SqlFlagType,
4081
4082 /// The database version this flag applies to. Can be
4083 /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
4084 /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
4085 /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
4086 /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
4087 /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
4088 /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
4089 /// `SQLSERVER_2019_WEB`.
4090 /// See [the complete
4091 /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
4092 pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
4093
4094 /// For `STRING` flags, a list of strings that the value can be set to.
4095 pub allowed_string_values: std::vec::Vec<std::string::String>,
4096
4097 /// For `INTEGER` flags, the minimum allowed value.
4098 pub min_value: std::option::Option<wkt::Int64Value>,
4099
4100 /// For `INTEGER` flags, the maximum allowed value.
4101 pub max_value: std::option::Option<wkt::Int64Value>,
4102
4103 /// Indicates whether changing this flag will trigger a database restart. Only
4104 /// applicable to Second Generation instances.
4105 pub requires_restart: std::option::Option<wkt::BoolValue>,
4106
4107 /// This is always `sql#flag`.
4108 pub kind: std::string::String,
4109
4110 /// Whether or not the flag is considered in beta.
4111 pub in_beta: std::option::Option<wkt::BoolValue>,
4112
4113 /// Use this field if only certain integers are accepted. Can be combined
4114 /// with min_value and max_value to add additional values.
4115 pub allowed_int_values: std::vec::Vec<i64>,
4116
4117 /// Scope of flag.
4118 pub flag_scope: crate::model::SqlFlagScope,
4119
4120 /// Recommended flag value for UI display.
4121 pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
4122
4123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4124}
4125
4126impl Flag {
4127 /// Creates a new default instance.
4128 pub fn new() -> Self {
4129 std::default::Default::default()
4130 }
4131
4132 /// Sets the value of [name][crate::model::Flag::name].
4133 ///
4134 /// # Example
4135 /// ```ignore,no_run
4136 /// # use google_cloud_sql_v1::model::Flag;
4137 /// let x = Flag::new().set_name("example");
4138 /// ```
4139 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4140 self.name = v.into();
4141 self
4142 }
4143
4144 /// Sets the value of [r#type][crate::model::Flag::type].
4145 ///
4146 /// # Example
4147 /// ```ignore,no_run
4148 /// # use google_cloud_sql_v1::model::Flag;
4149 /// use google_cloud_sql_v1::model::SqlFlagType;
4150 /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
4151 /// let x1 = Flag::new().set_type(SqlFlagType::String);
4152 /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
4153 /// ```
4154 pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
4155 self.r#type = v.into();
4156 self
4157 }
4158
4159 /// Sets the value of [applies_to][crate::model::Flag::applies_to].
4160 ///
4161 /// # Example
4162 /// ```ignore,no_run
4163 /// # use google_cloud_sql_v1::model::Flag;
4164 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
4165 /// let x = Flag::new().set_applies_to([
4166 /// SqlDatabaseVersion::Mysql56,
4167 /// SqlDatabaseVersion::Mysql57,
4168 /// SqlDatabaseVersion::Mysql80,
4169 /// ]);
4170 /// ```
4171 pub fn set_applies_to<T, V>(mut self, v: T) -> Self
4172 where
4173 T: std::iter::IntoIterator<Item = V>,
4174 V: std::convert::Into<crate::model::SqlDatabaseVersion>,
4175 {
4176 use std::iter::Iterator;
4177 self.applies_to = v.into_iter().map(|i| i.into()).collect();
4178 self
4179 }
4180
4181 /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
4182 ///
4183 /// # Example
4184 /// ```ignore,no_run
4185 /// # use google_cloud_sql_v1::model::Flag;
4186 /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
4187 /// ```
4188 pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
4189 where
4190 T: std::iter::IntoIterator<Item = V>,
4191 V: std::convert::Into<std::string::String>,
4192 {
4193 use std::iter::Iterator;
4194 self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
4195 self
4196 }
4197
4198 /// Sets the value of [min_value][crate::model::Flag::min_value].
4199 ///
4200 /// # Example
4201 /// ```ignore,no_run
4202 /// # use google_cloud_sql_v1::model::Flag;
4203 /// use wkt::Int64Value;
4204 /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
4205 /// ```
4206 pub fn set_min_value<T>(mut self, v: T) -> Self
4207 where
4208 T: std::convert::Into<wkt::Int64Value>,
4209 {
4210 self.min_value = std::option::Option::Some(v.into());
4211 self
4212 }
4213
4214 /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
4215 ///
4216 /// # Example
4217 /// ```ignore,no_run
4218 /// # use google_cloud_sql_v1::model::Flag;
4219 /// use wkt::Int64Value;
4220 /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
4221 /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
4222 /// ```
4223 pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
4224 where
4225 T: std::convert::Into<wkt::Int64Value>,
4226 {
4227 self.min_value = v.map(|x| x.into());
4228 self
4229 }
4230
4231 /// Sets the value of [max_value][crate::model::Flag::max_value].
4232 ///
4233 /// # Example
4234 /// ```ignore,no_run
4235 /// # use google_cloud_sql_v1::model::Flag;
4236 /// use wkt::Int64Value;
4237 /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
4238 /// ```
4239 pub fn set_max_value<T>(mut self, v: T) -> Self
4240 where
4241 T: std::convert::Into<wkt::Int64Value>,
4242 {
4243 self.max_value = std::option::Option::Some(v.into());
4244 self
4245 }
4246
4247 /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
4248 ///
4249 /// # Example
4250 /// ```ignore,no_run
4251 /// # use google_cloud_sql_v1::model::Flag;
4252 /// use wkt::Int64Value;
4253 /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
4254 /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
4255 /// ```
4256 pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
4257 where
4258 T: std::convert::Into<wkt::Int64Value>,
4259 {
4260 self.max_value = v.map(|x| x.into());
4261 self
4262 }
4263
4264 /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
4265 ///
4266 /// # Example
4267 /// ```ignore,no_run
4268 /// # use google_cloud_sql_v1::model::Flag;
4269 /// use wkt::BoolValue;
4270 /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
4271 /// ```
4272 pub fn set_requires_restart<T>(mut self, v: T) -> Self
4273 where
4274 T: std::convert::Into<wkt::BoolValue>,
4275 {
4276 self.requires_restart = std::option::Option::Some(v.into());
4277 self
4278 }
4279
4280 /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
4281 ///
4282 /// # Example
4283 /// ```ignore,no_run
4284 /// # use google_cloud_sql_v1::model::Flag;
4285 /// use wkt::BoolValue;
4286 /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
4287 /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
4288 /// ```
4289 pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
4290 where
4291 T: std::convert::Into<wkt::BoolValue>,
4292 {
4293 self.requires_restart = v.map(|x| x.into());
4294 self
4295 }
4296
4297 /// Sets the value of [kind][crate::model::Flag::kind].
4298 ///
4299 /// # Example
4300 /// ```ignore,no_run
4301 /// # use google_cloud_sql_v1::model::Flag;
4302 /// let x = Flag::new().set_kind("example");
4303 /// ```
4304 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4305 self.kind = v.into();
4306 self
4307 }
4308
4309 /// Sets the value of [in_beta][crate::model::Flag::in_beta].
4310 ///
4311 /// # Example
4312 /// ```ignore,no_run
4313 /// # use google_cloud_sql_v1::model::Flag;
4314 /// use wkt::BoolValue;
4315 /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
4316 /// ```
4317 pub fn set_in_beta<T>(mut self, v: T) -> Self
4318 where
4319 T: std::convert::Into<wkt::BoolValue>,
4320 {
4321 self.in_beta = std::option::Option::Some(v.into());
4322 self
4323 }
4324
4325 /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
4326 ///
4327 /// # Example
4328 /// ```ignore,no_run
4329 /// # use google_cloud_sql_v1::model::Flag;
4330 /// use wkt::BoolValue;
4331 /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
4332 /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
4333 /// ```
4334 pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
4335 where
4336 T: std::convert::Into<wkt::BoolValue>,
4337 {
4338 self.in_beta = v.map(|x| x.into());
4339 self
4340 }
4341
4342 /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
4343 ///
4344 /// # Example
4345 /// ```ignore,no_run
4346 /// # use google_cloud_sql_v1::model::Flag;
4347 /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
4348 /// ```
4349 pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
4350 where
4351 T: std::iter::IntoIterator<Item = V>,
4352 V: std::convert::Into<i64>,
4353 {
4354 use std::iter::Iterator;
4355 self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
4356 self
4357 }
4358
4359 /// Sets the value of [flag_scope][crate::model::Flag::flag_scope].
4360 ///
4361 /// # Example
4362 /// ```ignore,no_run
4363 /// # use google_cloud_sql_v1::model::Flag;
4364 /// use google_cloud_sql_v1::model::SqlFlagScope;
4365 /// let x0 = Flag::new().set_flag_scope(SqlFlagScope::Database);
4366 /// let x1 = Flag::new().set_flag_scope(SqlFlagScope::ConnectionPool);
4367 /// ```
4368 pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
4369 mut self,
4370 v: T,
4371 ) -> Self {
4372 self.flag_scope = v.into();
4373 self
4374 }
4375
4376 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value].
4377 ///
4378 /// Note that all the setters affecting `recommended_value` are mutually
4379 /// exclusive.
4380 ///
4381 /// # Example
4382 /// ```ignore,no_run
4383 /// # use google_cloud_sql_v1::model::Flag;
4384 /// use google_cloud_sql_v1::model::flag::RecommendedValue;
4385 /// let x = Flag::new().set_recommended_value(Some(RecommendedValue::RecommendedStringValue("example".to_string())));
4386 /// ```
4387 pub fn set_recommended_value<
4388 T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
4389 >(
4390 mut self,
4391 v: T,
4392 ) -> Self {
4393 self.recommended_value = v.into();
4394 self
4395 }
4396
4397 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4398 /// if it holds a `RecommendedStringValue`, `None` if the field is not set or
4399 /// holds a different branch.
4400 pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
4401 #[allow(unreachable_patterns)]
4402 self.recommended_value.as_ref().and_then(|v| match v {
4403 crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
4404 std::option::Option::Some(v)
4405 }
4406 _ => std::option::Option::None,
4407 })
4408 }
4409
4410 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4411 /// to hold a `RecommendedStringValue`.
4412 ///
4413 /// Note that all the setters affecting `recommended_value` are
4414 /// mutually exclusive.
4415 ///
4416 /// # Example
4417 /// ```ignore,no_run
4418 /// # use google_cloud_sql_v1::model::Flag;
4419 /// let x = Flag::new().set_recommended_string_value("example");
4420 /// assert!(x.recommended_string_value().is_some());
4421 /// assert!(x.recommended_int_value().is_none());
4422 /// ```
4423 pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
4424 mut self,
4425 v: T,
4426 ) -> Self {
4427 self.recommended_value = std::option::Option::Some(
4428 crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
4429 );
4430 self
4431 }
4432
4433 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4434 /// if it holds a `RecommendedIntValue`, `None` if the field is not set or
4435 /// holds a different branch.
4436 pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
4437 #[allow(unreachable_patterns)]
4438 self.recommended_value.as_ref().and_then(|v| match v {
4439 crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
4440 std::option::Option::Some(v)
4441 }
4442 _ => std::option::Option::None,
4443 })
4444 }
4445
4446 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4447 /// to hold a `RecommendedIntValue`.
4448 ///
4449 /// Note that all the setters affecting `recommended_value` are
4450 /// mutually exclusive.
4451 ///
4452 /// # Example
4453 /// ```ignore,no_run
4454 /// # use google_cloud_sql_v1::model::Flag;
4455 /// use wkt::Int64Value;
4456 /// let x = Flag::new().set_recommended_int_value(Int64Value::default()/* use setters */);
4457 /// assert!(x.recommended_int_value().is_some());
4458 /// assert!(x.recommended_string_value().is_none());
4459 /// ```
4460 pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
4461 mut self,
4462 v: T,
4463 ) -> Self {
4464 self.recommended_value = std::option::Option::Some(
4465 crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
4466 );
4467 self
4468 }
4469}
4470
4471impl wkt::message::Message for Flag {
4472 fn typename() -> &'static str {
4473 "type.googleapis.com/google.cloud.sql.v1.Flag"
4474 }
4475}
4476
4477/// Defines additional types related to [Flag].
4478pub mod flag {
4479 #[allow(unused_imports)]
4480 use super::*;
4481
4482 /// Recommended flag value for UI display.
4483 #[derive(Clone, Debug, PartialEq)]
4484 #[non_exhaustive]
4485 pub enum RecommendedValue {
4486 /// Recommended string value in string format for UI display.
4487 RecommendedStringValue(std::string::String),
4488 /// Recommended int value in integer format for UI display.
4489 RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
4490 }
4491}
4492
4493/// Instance add server CA request.
4494#[derive(Clone, Default, PartialEq)]
4495#[non_exhaustive]
4496pub struct SqlInstancesAddServerCaRequest {
4497 /// Cloud SQL instance ID. This does not include the project ID.
4498 pub instance: std::string::String,
4499
4500 /// Project ID of the project that contains the instance.
4501 pub project: std::string::String,
4502
4503 /// Optional. Region of the Cloud SQL instance.
4504 pub location: std::string::String,
4505
4506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4507}
4508
4509impl SqlInstancesAddServerCaRequest {
4510 /// Creates a new default instance.
4511 pub fn new() -> Self {
4512 std::default::Default::default()
4513 }
4514
4515 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
4516 ///
4517 /// # Example
4518 /// ```ignore,no_run
4519 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4520 /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
4521 /// ```
4522 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4523 self.instance = v.into();
4524 self
4525 }
4526
4527 /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
4528 ///
4529 /// # Example
4530 /// ```ignore,no_run
4531 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4532 /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
4533 /// ```
4534 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4535 self.project = v.into();
4536 self
4537 }
4538
4539 /// Sets the value of [location][crate::model::SqlInstancesAddServerCaRequest::location].
4540 ///
4541 /// # Example
4542 /// ```ignore,no_run
4543 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4544 /// let x = SqlInstancesAddServerCaRequest::new().set_location("example");
4545 /// ```
4546 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4547 self.location = v.into();
4548 self
4549 }
4550}
4551
4552impl wkt::message::Message for SqlInstancesAddServerCaRequest {
4553 fn typename() -> &'static str {
4554 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
4555 }
4556}
4557
4558/// Instance add server certificate request.
4559#[derive(Clone, Default, PartialEq)]
4560#[non_exhaustive]
4561pub struct SqlInstancesAddServerCertificateRequest {
4562 /// Cloud SQL instance ID. This does not include the project ID.
4563 pub instance: std::string::String,
4564
4565 /// Project ID of the project that contains the instance.
4566 pub project: std::string::String,
4567
4568 /// Optional. Region of the Cloud SQL instance.
4569 pub location: std::string::String,
4570
4571 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4572}
4573
4574impl SqlInstancesAddServerCertificateRequest {
4575 /// Creates a new default instance.
4576 pub fn new() -> Self {
4577 std::default::Default::default()
4578 }
4579
4580 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
4581 ///
4582 /// # Example
4583 /// ```ignore,no_run
4584 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4585 /// let x = SqlInstancesAddServerCertificateRequest::new().set_instance("example");
4586 /// ```
4587 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4588 self.instance = v.into();
4589 self
4590 }
4591
4592 /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
4593 ///
4594 /// # Example
4595 /// ```ignore,no_run
4596 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4597 /// let x = SqlInstancesAddServerCertificateRequest::new().set_project("example");
4598 /// ```
4599 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4600 self.project = v.into();
4601 self
4602 }
4603
4604 /// Sets the value of [location][crate::model::SqlInstancesAddServerCertificateRequest::location].
4605 ///
4606 /// # Example
4607 /// ```ignore,no_run
4608 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4609 /// let x = SqlInstancesAddServerCertificateRequest::new().set_location("example");
4610 /// ```
4611 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4612 self.location = v.into();
4613 self
4614 }
4615}
4616
4617impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
4618 fn typename() -> &'static str {
4619 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
4620 }
4621}
4622
4623/// Instance add Entra ID certificate request.
4624#[derive(Clone, Default, PartialEq)]
4625#[non_exhaustive]
4626pub struct SqlInstancesAddEntraIdCertificateRequest {
4627 /// Required. Cloud SQL instance ID. This does not include the project ID.
4628 pub instance: std::string::String,
4629
4630 /// Required. Project ID of the project that contains the instance.
4631 pub project: std::string::String,
4632
4633 /// Optional. Region of the Cloud SQL instance.
4634 pub location: std::string::String,
4635
4636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4637}
4638
4639impl SqlInstancesAddEntraIdCertificateRequest {
4640 /// Creates a new default instance.
4641 pub fn new() -> Self {
4642 std::default::Default::default()
4643 }
4644
4645 /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
4646 ///
4647 /// # Example
4648 /// ```ignore,no_run
4649 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4650 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_instance("example");
4651 /// ```
4652 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4653 self.instance = v.into();
4654 self
4655 }
4656
4657 /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
4658 ///
4659 /// # Example
4660 /// ```ignore,no_run
4661 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4662 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_project("example");
4663 /// ```
4664 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4665 self.project = v.into();
4666 self
4667 }
4668
4669 /// Sets the value of [location][crate::model::SqlInstancesAddEntraIdCertificateRequest::location].
4670 ///
4671 /// # Example
4672 /// ```ignore,no_run
4673 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4674 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_location("example");
4675 /// ```
4676 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4677 self.location = v.into();
4678 self
4679 }
4680}
4681
4682impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
4683 fn typename() -> &'static str {
4684 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
4685 }
4686}
4687
4688/// Instance clone request.
4689#[derive(Clone, Default, PartialEq)]
4690#[non_exhaustive]
4691pub struct SqlInstancesCloneRequest {
4692 /// Required. The ID of the Cloud SQL instance to be cloned (source). This does
4693 /// not include the project ID.
4694 pub instance: std::string::String,
4695
4696 /// Required. Project ID of the source Cloud SQL instance.
4697 pub project: std::string::String,
4698
4699 #[allow(missing_docs)]
4700 pub body: std::option::Option<crate::model::InstancesCloneRequest>,
4701
4702 /// Optional. Region of the Cloud SQL instance.
4703 pub location: std::string::String,
4704
4705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4706}
4707
4708impl SqlInstancesCloneRequest {
4709 /// Creates a new default instance.
4710 pub fn new() -> Self {
4711 std::default::Default::default()
4712 }
4713
4714 /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
4715 ///
4716 /// # Example
4717 /// ```ignore,no_run
4718 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4719 /// let x = SqlInstancesCloneRequest::new().set_instance("example");
4720 /// ```
4721 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4722 self.instance = v.into();
4723 self
4724 }
4725
4726 /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
4727 ///
4728 /// # Example
4729 /// ```ignore,no_run
4730 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4731 /// let x = SqlInstancesCloneRequest::new().set_project("example");
4732 /// ```
4733 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4734 self.project = v.into();
4735 self
4736 }
4737
4738 /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
4739 ///
4740 /// # Example
4741 /// ```ignore,no_run
4742 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4743 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4744 /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
4745 /// ```
4746 pub fn set_body<T>(mut self, v: T) -> Self
4747 where
4748 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4749 {
4750 self.body = std::option::Option::Some(v.into());
4751 self
4752 }
4753
4754 /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
4755 ///
4756 /// # Example
4757 /// ```ignore,no_run
4758 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4759 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4760 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
4761 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
4762 /// ```
4763 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4764 where
4765 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4766 {
4767 self.body = v.map(|x| x.into());
4768 self
4769 }
4770
4771 /// Sets the value of [location][crate::model::SqlInstancesCloneRequest::location].
4772 ///
4773 /// # Example
4774 /// ```ignore,no_run
4775 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4776 /// let x = SqlInstancesCloneRequest::new().set_location("example");
4777 /// ```
4778 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4779 self.location = v.into();
4780 self
4781 }
4782}
4783
4784impl wkt::message::Message for SqlInstancesCloneRequest {
4785 fn typename() -> &'static str {
4786 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
4787 }
4788}
4789
4790/// Instance delete request.
4791#[derive(Clone, Default, PartialEq)]
4792#[non_exhaustive]
4793pub struct SqlInstancesDeleteRequest {
4794 /// Cloud SQL instance ID. This does not include the project ID.
4795 pub instance: std::string::String,
4796
4797 /// Project ID of the project that contains the instance to be deleted.
4798 pub project: std::string::String,
4799
4800 /// Flag to opt-in for final backup. By default, it is turned off.
4801 pub enable_final_backup: std::option::Option<bool>,
4802
4803 /// Optional. The description of the final backup.
4804 pub final_backup_description: std::string::String,
4805
4806 /// Optional. Region of the Cloud SQL instance.
4807 pub location: std::string::String,
4808
4809 #[allow(missing_docs)]
4810 pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4811
4812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4813}
4814
4815impl SqlInstancesDeleteRequest {
4816 /// Creates a new default instance.
4817 pub fn new() -> Self {
4818 std::default::Default::default()
4819 }
4820
4821 /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
4822 ///
4823 /// # Example
4824 /// ```ignore,no_run
4825 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4826 /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
4827 /// ```
4828 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4829 self.instance = v.into();
4830 self
4831 }
4832
4833 /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
4834 ///
4835 /// # Example
4836 /// ```ignore,no_run
4837 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4838 /// let x = SqlInstancesDeleteRequest::new().set_project("example");
4839 /// ```
4840 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4841 self.project = v.into();
4842 self
4843 }
4844
4845 /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4846 ///
4847 /// # Example
4848 /// ```ignore,no_run
4849 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4850 /// let x = SqlInstancesDeleteRequest::new().set_enable_final_backup(true);
4851 /// ```
4852 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
4853 where
4854 T: std::convert::Into<bool>,
4855 {
4856 self.enable_final_backup = std::option::Option::Some(v.into());
4857 self
4858 }
4859
4860 /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4861 ///
4862 /// # Example
4863 /// ```ignore,no_run
4864 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4865 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(Some(false));
4866 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(None::<bool>);
4867 /// ```
4868 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
4869 where
4870 T: std::convert::Into<bool>,
4871 {
4872 self.enable_final_backup = v.map(|x| x.into());
4873 self
4874 }
4875
4876 /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
4877 ///
4878 /// # Example
4879 /// ```ignore,no_run
4880 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4881 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_description("example");
4882 /// ```
4883 pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
4884 mut self,
4885 v: T,
4886 ) -> Self {
4887 self.final_backup_description = v.into();
4888 self
4889 }
4890
4891 /// Sets the value of [location][crate::model::SqlInstancesDeleteRequest::location].
4892 ///
4893 /// # Example
4894 /// ```ignore,no_run
4895 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4896 /// let x = SqlInstancesDeleteRequest::new().set_location("example");
4897 /// ```
4898 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4899 self.location = v.into();
4900 self
4901 }
4902
4903 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
4904 ///
4905 /// Note that all the setters affecting `expiration` are mutually
4906 /// exclusive.
4907 ///
4908 /// # Example
4909 /// ```ignore,no_run
4910 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4911 /// use google_cloud_sql_v1::model::sql_instances_delete_request::Expiration;
4912 /// let x = SqlInstancesDeleteRequest::new().set_expiration(Some(Expiration::FinalBackupTtlDays(42)));
4913 /// ```
4914 pub fn set_expiration<
4915 T: std::convert::Into<
4916 std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4917 >,
4918 >(
4919 mut self,
4920 v: T,
4921 ) -> Self {
4922 self.expiration = v.into();
4923 self
4924 }
4925
4926 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4927 /// if it holds a `FinalBackupTtlDays`, `None` if the field is not set or
4928 /// holds a different branch.
4929 pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
4930 #[allow(unreachable_patterns)]
4931 self.expiration.as_ref().and_then(|v| match v {
4932 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
4933 std::option::Option::Some(v)
4934 }
4935 _ => std::option::Option::None,
4936 })
4937 }
4938
4939 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4940 /// to hold a `FinalBackupTtlDays`.
4941 ///
4942 /// Note that all the setters affecting `expiration` are
4943 /// mutually exclusive.
4944 ///
4945 /// # Example
4946 /// ```ignore,no_run
4947 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4948 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_ttl_days(42);
4949 /// assert!(x.final_backup_ttl_days().is_some());
4950 /// assert!(x.final_backup_expiry_time().is_none());
4951 /// ```
4952 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4953 self.expiration = std::option::Option::Some(
4954 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
4955 );
4956 self
4957 }
4958
4959 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4960 /// if it holds a `FinalBackupExpiryTime`, `None` if the field is not set or
4961 /// holds a different branch.
4962 pub fn final_backup_expiry_time(
4963 &self,
4964 ) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4965 #[allow(unreachable_patterns)]
4966 self.expiration.as_ref().and_then(|v| match v {
4967 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
4968 std::option::Option::Some(v)
4969 }
4970 _ => std::option::Option::None,
4971 })
4972 }
4973
4974 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4975 /// to hold a `FinalBackupExpiryTime`.
4976 ///
4977 /// Note that all the setters affecting `expiration` are
4978 /// mutually exclusive.
4979 ///
4980 /// # Example
4981 /// ```ignore,no_run
4982 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4983 /// use wkt::Timestamp;
4984 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_expiry_time(Timestamp::default()/* use setters */);
4985 /// assert!(x.final_backup_expiry_time().is_some());
4986 /// assert!(x.final_backup_ttl_days().is_none());
4987 /// ```
4988 pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4989 mut self,
4990 v: T,
4991 ) -> Self {
4992 self.expiration = std::option::Option::Some(
4993 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
4994 );
4995 self
4996 }
4997}
4998
4999impl wkt::message::Message for SqlInstancesDeleteRequest {
5000 fn typename() -> &'static str {
5001 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
5002 }
5003}
5004
5005/// Defines additional types related to [SqlInstancesDeleteRequest].
5006pub mod sql_instances_delete_request {
5007 #[allow(unused_imports)]
5008 use super::*;
5009
5010 #[allow(missing_docs)]
5011 #[derive(Clone, Debug, PartialEq)]
5012 #[non_exhaustive]
5013 pub enum Expiration {
5014 /// Optional. Retention period of the final backup.
5015 FinalBackupTtlDays(i64),
5016 /// Optional. Final Backup expiration time.
5017 /// Timestamp in UTC of when this resource is considered expired.
5018 FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
5019 }
5020}
5021
5022/// Instance demote master request.
5023#[derive(Clone, Default, PartialEq)]
5024#[non_exhaustive]
5025pub struct SqlInstancesDemoteMasterRequest {
5026 /// Cloud SQL instance name.
5027 pub instance: std::string::String,
5028
5029 /// ID of the project that contains the instance.
5030 pub project: std::string::String,
5031
5032 #[allow(missing_docs)]
5033 pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
5034
5035 /// Optional. Region of the Cloud SQL instance.
5036 pub location: std::string::String,
5037
5038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5039}
5040
5041impl SqlInstancesDemoteMasterRequest {
5042 /// Creates a new default instance.
5043 pub fn new() -> Self {
5044 std::default::Default::default()
5045 }
5046
5047 /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
5048 ///
5049 /// # Example
5050 /// ```ignore,no_run
5051 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
5052 /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
5053 /// ```
5054 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5055 self.instance = v.into();
5056 self
5057 }
5058
5059 /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
5060 ///
5061 /// # Example
5062 /// ```ignore,no_run
5063 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
5064 /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
5065 /// ```
5066 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5067 self.project = v.into();
5068 self
5069 }
5070
5071 /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
5072 ///
5073 /// # Example
5074 /// ```ignore,no_run
5075 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
5076 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
5077 /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
5078 /// ```
5079 pub fn set_body<T>(mut self, v: T) -> Self
5080 where
5081 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
5082 {
5083 self.body = std::option::Option::Some(v.into());
5084 self
5085 }
5086
5087 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
5088 ///
5089 /// # Example
5090 /// ```ignore,no_run
5091 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
5092 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
5093 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
5094 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
5095 /// ```
5096 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5097 where
5098 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
5099 {
5100 self.body = v.map(|x| x.into());
5101 self
5102 }
5103
5104 /// Sets the value of [location][crate::model::SqlInstancesDemoteMasterRequest::location].
5105 ///
5106 /// # Example
5107 /// ```ignore,no_run
5108 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
5109 /// let x = SqlInstancesDemoteMasterRequest::new().set_location("example");
5110 /// ```
5111 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5112 self.location = v.into();
5113 self
5114 }
5115}
5116
5117impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
5118 fn typename() -> &'static str {
5119 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
5120 }
5121}
5122
5123/// Instance demote request.
5124#[derive(Clone, Default, PartialEq)]
5125#[non_exhaustive]
5126pub struct SqlInstancesDemoteRequest {
5127 /// Required. Cloud SQL instance name.
5128 pub instance: std::string::String,
5129
5130 /// Required. ID of the project that contains the instance.
5131 pub project: std::string::String,
5132
5133 /// Required. The request body.
5134 pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
5135
5136 /// Optional. Region of the Cloud SQL instance.
5137 pub location: std::string::String,
5138
5139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5140}
5141
5142impl SqlInstancesDemoteRequest {
5143 /// Creates a new default instance.
5144 pub fn new() -> Self {
5145 std::default::Default::default()
5146 }
5147
5148 /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
5149 ///
5150 /// # Example
5151 /// ```ignore,no_run
5152 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
5153 /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
5154 /// ```
5155 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5156 self.instance = v.into();
5157 self
5158 }
5159
5160 /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
5161 ///
5162 /// # Example
5163 /// ```ignore,no_run
5164 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
5165 /// let x = SqlInstancesDemoteRequest::new().set_project("example");
5166 /// ```
5167 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5168 self.project = v.into();
5169 self
5170 }
5171
5172 /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
5173 ///
5174 /// # Example
5175 /// ```ignore,no_run
5176 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
5177 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
5178 /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
5179 /// ```
5180 pub fn set_body<T>(mut self, v: T) -> Self
5181 where
5182 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
5183 {
5184 self.body = std::option::Option::Some(v.into());
5185 self
5186 }
5187
5188 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
5189 ///
5190 /// # Example
5191 /// ```ignore,no_run
5192 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
5193 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
5194 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
5195 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
5196 /// ```
5197 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5198 where
5199 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
5200 {
5201 self.body = v.map(|x| x.into());
5202 self
5203 }
5204
5205 /// Sets the value of [location][crate::model::SqlInstancesDemoteRequest::location].
5206 ///
5207 /// # Example
5208 /// ```ignore,no_run
5209 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
5210 /// let x = SqlInstancesDemoteRequest::new().set_location("example");
5211 /// ```
5212 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5213 self.location = v.into();
5214 self
5215 }
5216}
5217
5218impl wkt::message::Message for SqlInstancesDemoteRequest {
5219 fn typename() -> &'static str {
5220 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
5221 }
5222}
5223
5224/// Instance export request.
5225#[derive(Clone, Default, PartialEq)]
5226#[non_exhaustive]
5227pub struct SqlInstancesExportRequest {
5228 /// Cloud SQL instance ID. This does not include the project ID.
5229 pub instance: std::string::String,
5230
5231 /// Project ID of the project that contains the instance to be exported.
5232 pub project: std::string::String,
5233
5234 #[allow(missing_docs)]
5235 pub body: std::option::Option<crate::model::InstancesExportRequest>,
5236
5237 /// Optional. Region of the Cloud SQL instance.
5238 pub location: std::string::String,
5239
5240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5241}
5242
5243impl SqlInstancesExportRequest {
5244 /// Creates a new default instance.
5245 pub fn new() -> Self {
5246 std::default::Default::default()
5247 }
5248
5249 /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
5250 ///
5251 /// # Example
5252 /// ```ignore,no_run
5253 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5254 /// let x = SqlInstancesExportRequest::new().set_instance("example");
5255 /// ```
5256 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5257 self.instance = v.into();
5258 self
5259 }
5260
5261 /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
5262 ///
5263 /// # Example
5264 /// ```ignore,no_run
5265 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5266 /// let x = SqlInstancesExportRequest::new().set_project("example");
5267 /// ```
5268 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5269 self.project = v.into();
5270 self
5271 }
5272
5273 /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
5274 ///
5275 /// # Example
5276 /// ```ignore,no_run
5277 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5278 /// use google_cloud_sql_v1::model::InstancesExportRequest;
5279 /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
5280 /// ```
5281 pub fn set_body<T>(mut self, v: T) -> Self
5282 where
5283 T: std::convert::Into<crate::model::InstancesExportRequest>,
5284 {
5285 self.body = std::option::Option::Some(v.into());
5286 self
5287 }
5288
5289 /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
5290 ///
5291 /// # Example
5292 /// ```ignore,no_run
5293 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5294 /// use google_cloud_sql_v1::model::InstancesExportRequest;
5295 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
5296 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
5297 /// ```
5298 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5299 where
5300 T: std::convert::Into<crate::model::InstancesExportRequest>,
5301 {
5302 self.body = v.map(|x| x.into());
5303 self
5304 }
5305
5306 /// Sets the value of [location][crate::model::SqlInstancesExportRequest::location].
5307 ///
5308 /// # Example
5309 /// ```ignore,no_run
5310 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
5311 /// let x = SqlInstancesExportRequest::new().set_location("example");
5312 /// ```
5313 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5314 self.location = v.into();
5315 self
5316 }
5317}
5318
5319impl wkt::message::Message for SqlInstancesExportRequest {
5320 fn typename() -> &'static str {
5321 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
5322 }
5323}
5324
5325/// Instance failover request.
5326#[derive(Clone, Default, PartialEq)]
5327#[non_exhaustive]
5328pub struct SqlInstancesFailoverRequest {
5329 /// Cloud SQL instance ID. This does not include the project ID.
5330 pub instance: std::string::String,
5331
5332 /// ID of the project that contains the read replica.
5333 pub project: std::string::String,
5334
5335 #[allow(missing_docs)]
5336 pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
5337
5338 /// Optional. Region of the Cloud SQL instance.
5339 pub location: std::string::String,
5340
5341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5342}
5343
5344impl SqlInstancesFailoverRequest {
5345 /// Creates a new default instance.
5346 pub fn new() -> Self {
5347 std::default::Default::default()
5348 }
5349
5350 /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
5351 ///
5352 /// # Example
5353 /// ```ignore,no_run
5354 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5355 /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
5356 /// ```
5357 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5358 self.instance = v.into();
5359 self
5360 }
5361
5362 /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
5363 ///
5364 /// # Example
5365 /// ```ignore,no_run
5366 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5367 /// let x = SqlInstancesFailoverRequest::new().set_project("example");
5368 /// ```
5369 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5370 self.project = v.into();
5371 self
5372 }
5373
5374 /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5375 ///
5376 /// # Example
5377 /// ```ignore,no_run
5378 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5379 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5380 /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
5381 /// ```
5382 pub fn set_body<T>(mut self, v: T) -> Self
5383 where
5384 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5385 {
5386 self.body = std::option::Option::Some(v.into());
5387 self
5388 }
5389
5390 /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5391 ///
5392 /// # Example
5393 /// ```ignore,no_run
5394 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5395 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5396 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
5397 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
5398 /// ```
5399 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5400 where
5401 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5402 {
5403 self.body = v.map(|x| x.into());
5404 self
5405 }
5406
5407 /// Sets the value of [location][crate::model::SqlInstancesFailoverRequest::location].
5408 ///
5409 /// # Example
5410 /// ```ignore,no_run
5411 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5412 /// let x = SqlInstancesFailoverRequest::new().set_location("example");
5413 /// ```
5414 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5415 self.location = v.into();
5416 self
5417 }
5418}
5419
5420impl wkt::message::Message for SqlInstancesFailoverRequest {
5421 fn typename() -> &'static str {
5422 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
5423 }
5424}
5425
5426/// Instance get request.
5427#[derive(Clone, Default, PartialEq)]
5428#[non_exhaustive]
5429pub struct SqlInstancesGetRequest {
5430 /// Required. Database instance ID. This does not include the project ID.
5431 pub instance: std::string::String,
5432
5433 /// Required. Project ID of the project that contains the instance.
5434 pub project: std::string::String,
5435
5436 /// Optional. Region of the Cloud SQL instance.
5437 pub location: std::string::String,
5438
5439 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5440}
5441
5442impl SqlInstancesGetRequest {
5443 /// Creates a new default instance.
5444 pub fn new() -> Self {
5445 std::default::Default::default()
5446 }
5447
5448 /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
5449 ///
5450 /// # Example
5451 /// ```ignore,no_run
5452 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5453 /// let x = SqlInstancesGetRequest::new().set_instance("example");
5454 /// ```
5455 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5456 self.instance = v.into();
5457 self
5458 }
5459
5460 /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
5461 ///
5462 /// # Example
5463 /// ```ignore,no_run
5464 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5465 /// let x = SqlInstancesGetRequest::new().set_project("example");
5466 /// ```
5467 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5468 self.project = v.into();
5469 self
5470 }
5471
5472 /// Sets the value of [location][crate::model::SqlInstancesGetRequest::location].
5473 ///
5474 /// # Example
5475 /// ```ignore,no_run
5476 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5477 /// let x = SqlInstancesGetRequest::new().set_location("example");
5478 /// ```
5479 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5480 self.location = v.into();
5481 self
5482 }
5483}
5484
5485impl wkt::message::Message for SqlInstancesGetRequest {
5486 fn typename() -> &'static str {
5487 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
5488 }
5489}
5490
5491/// Instance import request.
5492#[derive(Clone, Default, PartialEq)]
5493#[non_exhaustive]
5494pub struct SqlInstancesImportRequest {
5495 /// Cloud SQL instance ID. This does not include the project ID.
5496 pub instance: std::string::String,
5497
5498 /// Project ID of the project that contains the instance.
5499 pub project: std::string::String,
5500
5501 #[allow(missing_docs)]
5502 pub body: std::option::Option<crate::model::InstancesImportRequest>,
5503
5504 /// Optional. Region of the Cloud SQL instance.
5505 pub location: std::string::String,
5506
5507 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5508}
5509
5510impl SqlInstancesImportRequest {
5511 /// Creates a new default instance.
5512 pub fn new() -> Self {
5513 std::default::Default::default()
5514 }
5515
5516 /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
5517 ///
5518 /// # Example
5519 /// ```ignore,no_run
5520 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5521 /// let x = SqlInstancesImportRequest::new().set_instance("example");
5522 /// ```
5523 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5524 self.instance = v.into();
5525 self
5526 }
5527
5528 /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
5529 ///
5530 /// # Example
5531 /// ```ignore,no_run
5532 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5533 /// let x = SqlInstancesImportRequest::new().set_project("example");
5534 /// ```
5535 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5536 self.project = v.into();
5537 self
5538 }
5539
5540 /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
5541 ///
5542 /// # Example
5543 /// ```ignore,no_run
5544 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5545 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5546 /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
5547 /// ```
5548 pub fn set_body<T>(mut self, v: T) -> Self
5549 where
5550 T: std::convert::Into<crate::model::InstancesImportRequest>,
5551 {
5552 self.body = std::option::Option::Some(v.into());
5553 self
5554 }
5555
5556 /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
5557 ///
5558 /// # Example
5559 /// ```ignore,no_run
5560 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5561 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5562 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
5563 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
5564 /// ```
5565 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5566 where
5567 T: std::convert::Into<crate::model::InstancesImportRequest>,
5568 {
5569 self.body = v.map(|x| x.into());
5570 self
5571 }
5572
5573 /// Sets the value of [location][crate::model::SqlInstancesImportRequest::location].
5574 ///
5575 /// # Example
5576 /// ```ignore,no_run
5577 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5578 /// let x = SqlInstancesImportRequest::new().set_location("example");
5579 /// ```
5580 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5581 self.location = v.into();
5582 self
5583 }
5584}
5585
5586impl wkt::message::Message for SqlInstancesImportRequest {
5587 fn typename() -> &'static str {
5588 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
5589 }
5590}
5591
5592/// Instance insert request.
5593#[derive(Clone, Default, PartialEq)]
5594#[non_exhaustive]
5595pub struct SqlInstancesInsertRequest {
5596 /// Project ID of the project to which the newly created Cloud SQL instances
5597 /// should belong.
5598 pub project: std::string::String,
5599
5600 #[allow(missing_docs)]
5601 pub body: std::option::Option<crate::model::DatabaseInstance>,
5602
5603 /// Optional. Region of the Cloud SQL instance.
5604 pub location: std::string::String,
5605
5606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5607}
5608
5609impl SqlInstancesInsertRequest {
5610 /// Creates a new default instance.
5611 pub fn new() -> Self {
5612 std::default::Default::default()
5613 }
5614
5615 /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
5616 ///
5617 /// # Example
5618 /// ```ignore,no_run
5619 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5620 /// let x = SqlInstancesInsertRequest::new().set_project("example");
5621 /// ```
5622 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5623 self.project = v.into();
5624 self
5625 }
5626
5627 /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
5628 ///
5629 /// # Example
5630 /// ```ignore,no_run
5631 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5632 /// use google_cloud_sql_v1::model::DatabaseInstance;
5633 /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5634 /// ```
5635 pub fn set_body<T>(mut self, v: T) -> Self
5636 where
5637 T: std::convert::Into<crate::model::DatabaseInstance>,
5638 {
5639 self.body = std::option::Option::Some(v.into());
5640 self
5641 }
5642
5643 /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
5644 ///
5645 /// # Example
5646 /// ```ignore,no_run
5647 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5648 /// use google_cloud_sql_v1::model::DatabaseInstance;
5649 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5650 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5651 /// ```
5652 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5653 where
5654 T: std::convert::Into<crate::model::DatabaseInstance>,
5655 {
5656 self.body = v.map(|x| x.into());
5657 self
5658 }
5659
5660 /// Sets the value of [location][crate::model::SqlInstancesInsertRequest::location].
5661 ///
5662 /// # Example
5663 /// ```ignore,no_run
5664 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5665 /// let x = SqlInstancesInsertRequest::new().set_location("example");
5666 /// ```
5667 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5668 self.location = v.into();
5669 self
5670 }
5671}
5672
5673impl wkt::message::Message for SqlInstancesInsertRequest {
5674 fn typename() -> &'static str {
5675 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
5676 }
5677}
5678
5679/// Instance list request.
5680#[derive(Clone, Default, PartialEq)]
5681#[non_exhaustive]
5682pub struct SqlInstancesListRequest {
5683 /// A filter expression that filters resources listed in the response.
5684 /// The expression is in the form of field:value. For example,
5685 /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
5686 /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
5687 ///
5688 /// Multiple filter queries are space-separated. For example.
5689 /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
5690 /// expression is an AND expression. However, you can include AND and OR
5691 /// expressions explicitly.
5692 pub filter: std::string::String,
5693
5694 /// The maximum number of instances to return. The service may return fewer
5695 /// than this value.
5696 /// If unspecified, at most 500 instances are returned.
5697 /// The maximum value is 1000; values above 1000 are coerced to 1000.
5698 pub max_results: u32,
5699
5700 /// A previously-returned page token representing part of the larger set of
5701 /// results to view.
5702 pub page_token: std::string::String,
5703
5704 /// Project ID of the project for which to list Cloud SQL instances.
5705 pub project: std::string::String,
5706
5707 /// Optional. Region of the Cloud SQL instance.
5708 pub location: std::string::String,
5709
5710 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5711}
5712
5713impl SqlInstancesListRequest {
5714 /// Creates a new default instance.
5715 pub fn new() -> Self {
5716 std::default::Default::default()
5717 }
5718
5719 /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
5720 ///
5721 /// # Example
5722 /// ```ignore,no_run
5723 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5724 /// let x = SqlInstancesListRequest::new().set_filter("example");
5725 /// ```
5726 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5727 self.filter = v.into();
5728 self
5729 }
5730
5731 /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
5732 ///
5733 /// # Example
5734 /// ```ignore,no_run
5735 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5736 /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
5737 /// ```
5738 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
5739 self.max_results = v.into();
5740 self
5741 }
5742
5743 /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
5744 ///
5745 /// # Example
5746 /// ```ignore,no_run
5747 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5748 /// let x = SqlInstancesListRequest::new().set_page_token("example");
5749 /// ```
5750 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5751 self.page_token = v.into();
5752 self
5753 }
5754
5755 /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
5756 ///
5757 /// # Example
5758 /// ```ignore,no_run
5759 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5760 /// let x = SqlInstancesListRequest::new().set_project("example");
5761 /// ```
5762 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5763 self.project = v.into();
5764 self
5765 }
5766
5767 /// Sets the value of [location][crate::model::SqlInstancesListRequest::location].
5768 ///
5769 /// # Example
5770 /// ```ignore,no_run
5771 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5772 /// let x = SqlInstancesListRequest::new().set_location("example");
5773 /// ```
5774 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5775 self.location = v.into();
5776 self
5777 }
5778}
5779
5780impl wkt::message::Message for SqlInstancesListRequest {
5781 fn typename() -> &'static str {
5782 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
5783 }
5784}
5785
5786/// Instance list server CAs request.
5787#[derive(Clone, Default, PartialEq)]
5788#[non_exhaustive]
5789pub struct SqlInstancesListServerCasRequest {
5790 /// Cloud SQL instance ID. This does not include the project ID.
5791 pub instance: std::string::String,
5792
5793 /// Project ID of the project that contains the instance.
5794 pub project: std::string::String,
5795
5796 /// Optional. Region of the Cloud SQL instance.
5797 pub location: std::string::String,
5798
5799 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5800}
5801
5802impl SqlInstancesListServerCasRequest {
5803 /// Creates a new default instance.
5804 pub fn new() -> Self {
5805 std::default::Default::default()
5806 }
5807
5808 /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
5809 ///
5810 /// # Example
5811 /// ```ignore,no_run
5812 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5813 /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
5814 /// ```
5815 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5816 self.instance = v.into();
5817 self
5818 }
5819
5820 /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
5821 ///
5822 /// # Example
5823 /// ```ignore,no_run
5824 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5825 /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
5826 /// ```
5827 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5828 self.project = v.into();
5829 self
5830 }
5831
5832 /// Sets the value of [location][crate::model::SqlInstancesListServerCasRequest::location].
5833 ///
5834 /// # Example
5835 /// ```ignore,no_run
5836 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5837 /// let x = SqlInstancesListServerCasRequest::new().set_location("example");
5838 /// ```
5839 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5840 self.location = v.into();
5841 self
5842 }
5843}
5844
5845impl wkt::message::Message for SqlInstancesListServerCasRequest {
5846 fn typename() -> &'static str {
5847 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
5848 }
5849}
5850
5851/// Instance list server certificates request.
5852#[derive(Clone, Default, PartialEq)]
5853#[non_exhaustive]
5854pub struct SqlInstancesListServerCertificatesRequest {
5855 /// Required. Cloud SQL instance ID. This does not include the project ID.
5856 pub instance: std::string::String,
5857
5858 /// Required. Project ID of the project that contains the instance.
5859 pub project: std::string::String,
5860
5861 /// Optional. Region of the Cloud SQL instance.
5862 pub location: std::string::String,
5863
5864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5865}
5866
5867impl SqlInstancesListServerCertificatesRequest {
5868 /// Creates a new default instance.
5869 pub fn new() -> Self {
5870 std::default::Default::default()
5871 }
5872
5873 /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
5874 ///
5875 /// # Example
5876 /// ```ignore,no_run
5877 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5878 /// let x = SqlInstancesListServerCertificatesRequest::new().set_instance("example");
5879 /// ```
5880 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5881 self.instance = v.into();
5882 self
5883 }
5884
5885 /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
5886 ///
5887 /// # Example
5888 /// ```ignore,no_run
5889 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5890 /// let x = SqlInstancesListServerCertificatesRequest::new().set_project("example");
5891 /// ```
5892 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5893 self.project = v.into();
5894 self
5895 }
5896
5897 /// Sets the value of [location][crate::model::SqlInstancesListServerCertificatesRequest::location].
5898 ///
5899 /// # Example
5900 /// ```ignore,no_run
5901 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5902 /// let x = SqlInstancesListServerCertificatesRequest::new().set_location("example");
5903 /// ```
5904 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5905 self.location = v.into();
5906 self
5907 }
5908}
5909
5910impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
5911 fn typename() -> &'static str {
5912 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
5913 }
5914}
5915
5916/// Instance list Entra ID certificates request.
5917#[derive(Clone, Default, PartialEq)]
5918#[non_exhaustive]
5919pub struct SqlInstancesListEntraIdCertificatesRequest {
5920 /// Required. Cloud SQL instance ID. This does not include the project ID.
5921 pub instance: std::string::String,
5922
5923 /// Required. Project ID of the project that contains the instance.
5924 pub project: std::string::String,
5925
5926 /// Optional. Region of the Cloud SQL instance.
5927 pub location: std::string::String,
5928
5929 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5930}
5931
5932impl SqlInstancesListEntraIdCertificatesRequest {
5933 /// Creates a new default instance.
5934 pub fn new() -> Self {
5935 std::default::Default::default()
5936 }
5937
5938 /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
5939 ///
5940 /// # Example
5941 /// ```ignore,no_run
5942 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5943 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_instance("example");
5944 /// ```
5945 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5946 self.instance = v.into();
5947 self
5948 }
5949
5950 /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
5951 ///
5952 /// # Example
5953 /// ```ignore,no_run
5954 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5955 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_project("example");
5956 /// ```
5957 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5958 self.project = v.into();
5959 self
5960 }
5961
5962 /// Sets the value of [location][crate::model::SqlInstancesListEntraIdCertificatesRequest::location].
5963 ///
5964 /// # Example
5965 /// ```ignore,no_run
5966 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5967 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_location("example");
5968 /// ```
5969 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5970 self.location = v.into();
5971 self
5972 }
5973}
5974
5975impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
5976 fn typename() -> &'static str {
5977 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
5978 }
5979}
5980
5981/// Instance patch request.
5982#[derive(Clone, Default, PartialEq)]
5983#[non_exhaustive]
5984pub struct SqlInstancesPatchRequest {
5985 /// Cloud SQL instance ID. This does not include the project ID.
5986 pub instance: std::string::String,
5987
5988 /// Project ID of the project that contains the instance.
5989 pub project: std::string::String,
5990
5991 /// Optional. Set PSC config to the same value as the existing config to
5992 /// reconcile the PSC networking.
5993 pub reconcile_psc_networking: std::option::Option<bool>,
5994
5995 /// Optional. Set PSC config to the same value as the existing config and force
5996 /// reconcile the PSC networking.
5997 pub reconcile_psc_networking_force: std::option::Option<bool>,
5998
5999 #[allow(missing_docs)]
6000 pub body: std::option::Option<crate::model::DatabaseInstance>,
6001
6002 /// Optional. Region of the Cloud SQL instance.
6003 pub location: std::string::String,
6004
6005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6006}
6007
6008impl SqlInstancesPatchRequest {
6009 /// Creates a new default instance.
6010 pub fn new() -> Self {
6011 std::default::Default::default()
6012 }
6013
6014 /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
6015 ///
6016 /// # Example
6017 /// ```ignore,no_run
6018 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6019 /// let x = SqlInstancesPatchRequest::new().set_instance("example");
6020 /// ```
6021 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6022 self.instance = v.into();
6023 self
6024 }
6025
6026 /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
6027 ///
6028 /// # Example
6029 /// ```ignore,no_run
6030 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6031 /// let x = SqlInstancesPatchRequest::new().set_project("example");
6032 /// ```
6033 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6034 self.project = v.into();
6035 self
6036 }
6037
6038 /// Sets the value of [reconcile_psc_networking][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking].
6039 ///
6040 /// # Example
6041 /// ```ignore,no_run
6042 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6043 /// let x = SqlInstancesPatchRequest::new().set_reconcile_psc_networking(true);
6044 /// ```
6045 pub fn set_reconcile_psc_networking<T>(mut self, v: T) -> Self
6046 where
6047 T: std::convert::Into<bool>,
6048 {
6049 self.reconcile_psc_networking = std::option::Option::Some(v.into());
6050 self
6051 }
6052
6053 /// Sets or clears the value of [reconcile_psc_networking][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking].
6054 ///
6055 /// # Example
6056 /// ```ignore,no_run
6057 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6058 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking(Some(false));
6059 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking(None::<bool>);
6060 /// ```
6061 pub fn set_or_clear_reconcile_psc_networking<T>(mut self, v: std::option::Option<T>) -> Self
6062 where
6063 T: std::convert::Into<bool>,
6064 {
6065 self.reconcile_psc_networking = v.map(|x| x.into());
6066 self
6067 }
6068
6069 /// Sets the value of [reconcile_psc_networking_force][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking_force].
6070 ///
6071 /// # Example
6072 /// ```ignore,no_run
6073 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6074 /// let x = SqlInstancesPatchRequest::new().set_reconcile_psc_networking_force(true);
6075 /// ```
6076 pub fn set_reconcile_psc_networking_force<T>(mut self, v: T) -> Self
6077 where
6078 T: std::convert::Into<bool>,
6079 {
6080 self.reconcile_psc_networking_force = std::option::Option::Some(v.into());
6081 self
6082 }
6083
6084 /// Sets or clears the value of [reconcile_psc_networking_force][crate::model::SqlInstancesPatchRequest::reconcile_psc_networking_force].
6085 ///
6086 /// # Example
6087 /// ```ignore,no_run
6088 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6089 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking_force(Some(false));
6090 /// let x = SqlInstancesPatchRequest::new().set_or_clear_reconcile_psc_networking_force(None::<bool>);
6091 /// ```
6092 pub fn set_or_clear_reconcile_psc_networking_force<T>(
6093 mut self,
6094 v: std::option::Option<T>,
6095 ) -> Self
6096 where
6097 T: std::convert::Into<bool>,
6098 {
6099 self.reconcile_psc_networking_force = v.map(|x| x.into());
6100 self
6101 }
6102
6103 /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
6104 ///
6105 /// # Example
6106 /// ```ignore,no_run
6107 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6108 /// use google_cloud_sql_v1::model::DatabaseInstance;
6109 /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
6110 /// ```
6111 pub fn set_body<T>(mut self, v: T) -> Self
6112 where
6113 T: std::convert::Into<crate::model::DatabaseInstance>,
6114 {
6115 self.body = std::option::Option::Some(v.into());
6116 self
6117 }
6118
6119 /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
6120 ///
6121 /// # Example
6122 /// ```ignore,no_run
6123 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6124 /// use google_cloud_sql_v1::model::DatabaseInstance;
6125 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
6126 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
6127 /// ```
6128 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6129 where
6130 T: std::convert::Into<crate::model::DatabaseInstance>,
6131 {
6132 self.body = v.map(|x| x.into());
6133 self
6134 }
6135
6136 /// Sets the value of [location][crate::model::SqlInstancesPatchRequest::location].
6137 ///
6138 /// # Example
6139 /// ```ignore,no_run
6140 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
6141 /// let x = SqlInstancesPatchRequest::new().set_location("example");
6142 /// ```
6143 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6144 self.location = v.into();
6145 self
6146 }
6147}
6148
6149impl wkt::message::Message for SqlInstancesPatchRequest {
6150 fn typename() -> &'static str {
6151 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
6152 }
6153}
6154
6155/// Instance promote replica request.
6156#[derive(Clone, Default, PartialEq)]
6157#[non_exhaustive]
6158pub struct SqlInstancesPromoteReplicaRequest {
6159 /// Cloud SQL read replica instance name.
6160 pub instance: std::string::String,
6161
6162 /// ID of the project that contains the read replica.
6163 pub project: std::string::String,
6164
6165 /// Set to true to invoke a replica failover to the DR
6166 /// replica. As part of replica failover, the promote operation attempts
6167 /// to add the original primary instance as a replica of the promoted
6168 /// DR replica when the original primary instance comes back online.
6169 /// If set to false or not specified, then the original primary
6170 /// instance becomes an independent Cloud SQL primary instance.
6171 pub failover: bool,
6172
6173 /// Optional. Region of the Cloud SQL instance.
6174 pub location: std::string::String,
6175
6176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6177}
6178
6179impl SqlInstancesPromoteReplicaRequest {
6180 /// Creates a new default instance.
6181 pub fn new() -> Self {
6182 std::default::Default::default()
6183 }
6184
6185 /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
6186 ///
6187 /// # Example
6188 /// ```ignore,no_run
6189 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
6190 /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
6191 /// ```
6192 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6193 self.instance = v.into();
6194 self
6195 }
6196
6197 /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
6198 ///
6199 /// # Example
6200 /// ```ignore,no_run
6201 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
6202 /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
6203 /// ```
6204 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6205 self.project = v.into();
6206 self
6207 }
6208
6209 /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
6210 ///
6211 /// # Example
6212 /// ```ignore,no_run
6213 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
6214 /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
6215 /// ```
6216 pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6217 self.failover = v.into();
6218 self
6219 }
6220
6221 /// Sets the value of [location][crate::model::SqlInstancesPromoteReplicaRequest::location].
6222 ///
6223 /// # Example
6224 /// ```ignore,no_run
6225 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
6226 /// let x = SqlInstancesPromoteReplicaRequest::new().set_location("example");
6227 /// ```
6228 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6229 self.location = v.into();
6230 self
6231 }
6232}
6233
6234impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
6235 fn typename() -> &'static str {
6236 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
6237 }
6238}
6239
6240/// Instance switchover request.
6241#[derive(Clone, Default, PartialEq)]
6242#[non_exhaustive]
6243pub struct SqlInstancesSwitchoverRequest {
6244 /// Cloud SQL read replica instance name.
6245 pub instance: std::string::String,
6246
6247 /// ID of the project that contains the replica.
6248 pub project: std::string::String,
6249
6250 /// Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
6251 /// timeout, which is a sum of all database operations. Default value is 10
6252 /// minutes and can be modified to a maximum value of 24 hours.
6253 pub db_timeout: std::option::Option<wkt::Duration>,
6254
6255 /// Optional. Region of the Cloud SQL instance.
6256 pub location: std::string::String,
6257
6258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6259}
6260
6261impl SqlInstancesSwitchoverRequest {
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::SqlInstancesSwitchoverRequest::instance].
6268 ///
6269 /// # Example
6270 /// ```ignore,no_run
6271 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
6272 /// let x = SqlInstancesSwitchoverRequest::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::SqlInstancesSwitchoverRequest::project].
6280 ///
6281 /// # Example
6282 /// ```ignore,no_run
6283 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
6284 /// let x = SqlInstancesSwitchoverRequest::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 [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
6292 ///
6293 /// # Example
6294 /// ```ignore,no_run
6295 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
6296 /// use wkt::Duration;
6297 /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
6298 /// ```
6299 pub fn set_db_timeout<T>(mut self, v: T) -> Self
6300 where
6301 T: std::convert::Into<wkt::Duration>,
6302 {
6303 self.db_timeout = std::option::Option::Some(v.into());
6304 self
6305 }
6306
6307 /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
6308 ///
6309 /// # Example
6310 /// ```ignore,no_run
6311 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
6312 /// use wkt::Duration;
6313 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
6314 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
6315 /// ```
6316 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
6317 where
6318 T: std::convert::Into<wkt::Duration>,
6319 {
6320 self.db_timeout = v.map(|x| x.into());
6321 self
6322 }
6323
6324 /// Sets the value of [location][crate::model::SqlInstancesSwitchoverRequest::location].
6325 ///
6326 /// # Example
6327 /// ```ignore,no_run
6328 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
6329 /// let x = SqlInstancesSwitchoverRequest::new().set_location("example");
6330 /// ```
6331 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6332 self.location = v.into();
6333 self
6334 }
6335}
6336
6337impl wkt::message::Message for SqlInstancesSwitchoverRequest {
6338 fn typename() -> &'static str {
6339 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
6340 }
6341}
6342
6343/// Instance reset SSL config request.
6344#[derive(Clone, Default, PartialEq)]
6345#[non_exhaustive]
6346pub struct SqlInstancesResetSslConfigRequest {
6347 /// Cloud SQL instance ID. This does not include the project ID.
6348 pub instance: std::string::String,
6349
6350 /// Project ID of the project that contains the instance.
6351 pub project: std::string::String,
6352
6353 /// Optional. Reset SSL mode to use.
6354 pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
6355
6356 /// Optional. Region of the Cloud SQL instance.
6357 pub location: std::string::String,
6358
6359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6360}
6361
6362impl SqlInstancesResetSslConfigRequest {
6363 /// Creates a new default instance.
6364 pub fn new() -> Self {
6365 std::default::Default::default()
6366 }
6367
6368 /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
6369 ///
6370 /// # Example
6371 /// ```ignore,no_run
6372 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
6373 /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
6374 /// ```
6375 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6376 self.instance = v.into();
6377 self
6378 }
6379
6380 /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
6381 ///
6382 /// # Example
6383 /// ```ignore,no_run
6384 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
6385 /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
6386 /// ```
6387 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6388 self.project = v.into();
6389 self
6390 }
6391
6392 /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
6393 ///
6394 /// # Example
6395 /// ```ignore,no_run
6396 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
6397 /// use google_cloud_sql_v1::model::sql_instances_reset_ssl_config_request::ResetSslMode;
6398 /// let x0 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::All);
6399 /// let x1 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::SyncFromPrimary);
6400 /// ```
6401 pub fn set_mode<
6402 T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
6403 >(
6404 mut self,
6405 v: T,
6406 ) -> Self {
6407 self.mode = v.into();
6408 self
6409 }
6410
6411 /// Sets the value of [location][crate::model::SqlInstancesResetSslConfigRequest::location].
6412 ///
6413 /// # Example
6414 /// ```ignore,no_run
6415 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
6416 /// let x = SqlInstancesResetSslConfigRequest::new().set_location("example");
6417 /// ```
6418 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6419 self.location = v.into();
6420 self
6421 }
6422}
6423
6424impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
6425 fn typename() -> &'static str {
6426 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
6427 }
6428}
6429
6430/// Defines additional types related to [SqlInstancesResetSslConfigRequest].
6431pub mod sql_instances_reset_ssl_config_request {
6432 #[allow(unused_imports)]
6433 use super::*;
6434
6435 /// Reset SSL mode to selectively refresh the SSL materials.
6436 ///
6437 /// # Working with unknown values
6438 ///
6439 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6440 /// additional enum variants at any time. Adding new variants is not considered
6441 /// a breaking change. Applications should write their code in anticipation of:
6442 ///
6443 /// - New values appearing in future releases of the client library, **and**
6444 /// - New values received dynamically, without application changes.
6445 ///
6446 /// Please consult the [Working with enums] section in the user guide for some
6447 /// guidelines.
6448 ///
6449 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6450 #[derive(Clone, Debug, PartialEq)]
6451 #[non_exhaustive]
6452 pub enum ResetSslMode {
6453 /// Reset SSL mode is not specified.
6454 Unspecified,
6455 /// Refresh all TLS configs. This is the default behaviour.
6456 All,
6457 /// Refreshes the replication-related TLS configuration settings provided by
6458 /// the primary instance.
6459 /// Not applicable to on-premises replication instances.
6460 SyncFromPrimary,
6461 /// If set, the enum was initialized with an unknown value.
6462 ///
6463 /// Applications can examine the value using [ResetSslMode::value] or
6464 /// [ResetSslMode::name].
6465 UnknownValue(reset_ssl_mode::UnknownValue),
6466 }
6467
6468 #[doc(hidden)]
6469 pub mod reset_ssl_mode {
6470 #[allow(unused_imports)]
6471 use super::*;
6472 #[derive(Clone, Debug, PartialEq)]
6473 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6474 }
6475
6476 impl ResetSslMode {
6477 /// Gets the enum value.
6478 ///
6479 /// Returns `None` if the enum contains an unknown value deserialized from
6480 /// the string representation of enums.
6481 pub fn value(&self) -> std::option::Option<i32> {
6482 match self {
6483 Self::Unspecified => std::option::Option::Some(0),
6484 Self::All => std::option::Option::Some(1),
6485 Self::SyncFromPrimary => std::option::Option::Some(2),
6486 Self::UnknownValue(u) => u.0.value(),
6487 }
6488 }
6489
6490 /// Gets the enum value as a string.
6491 ///
6492 /// Returns `None` if the enum contains an unknown value deserialized from
6493 /// the integer representation of enums.
6494 pub fn name(&self) -> std::option::Option<&str> {
6495 match self {
6496 Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
6497 Self::All => std::option::Option::Some("ALL"),
6498 Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
6499 Self::UnknownValue(u) => u.0.name(),
6500 }
6501 }
6502 }
6503
6504 impl std::default::Default for ResetSslMode {
6505 fn default() -> Self {
6506 use std::convert::From;
6507 Self::from(0)
6508 }
6509 }
6510
6511 impl std::fmt::Display for ResetSslMode {
6512 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6513 wkt::internal::display_enum(f, self.name(), self.value())
6514 }
6515 }
6516
6517 impl std::convert::From<i32> for ResetSslMode {
6518 fn from(value: i32) -> Self {
6519 match value {
6520 0 => Self::Unspecified,
6521 1 => Self::All,
6522 2 => Self::SyncFromPrimary,
6523 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6524 wkt::internal::UnknownEnumValue::Integer(value),
6525 )),
6526 }
6527 }
6528 }
6529
6530 impl std::convert::From<&str> for ResetSslMode {
6531 fn from(value: &str) -> Self {
6532 use std::string::ToString;
6533 match value {
6534 "RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
6535 "ALL" => Self::All,
6536 "SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
6537 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
6538 wkt::internal::UnknownEnumValue::String(value.to_string()),
6539 )),
6540 }
6541 }
6542 }
6543
6544 impl serde::ser::Serialize for ResetSslMode {
6545 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6546 where
6547 S: serde::Serializer,
6548 {
6549 match self {
6550 Self::Unspecified => serializer.serialize_i32(0),
6551 Self::All => serializer.serialize_i32(1),
6552 Self::SyncFromPrimary => serializer.serialize_i32(2),
6553 Self::UnknownValue(u) => u.0.serialize(serializer),
6554 }
6555 }
6556 }
6557
6558 impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
6559 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6560 where
6561 D: serde::Deserializer<'de>,
6562 {
6563 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
6564 ".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
6565 ))
6566 }
6567 }
6568}
6569
6570/// Instance restart request.
6571#[derive(Clone, Default, PartialEq)]
6572#[non_exhaustive]
6573pub struct SqlInstancesRestartRequest {
6574 /// Cloud SQL instance ID. This does not include the project ID.
6575 pub instance: std::string::String,
6576
6577 /// Project ID of the project that contains the instance to be restarted.
6578 pub project: std::string::String,
6579
6580 /// Optional. Region of the Cloud SQL instance.
6581 pub location: std::string::String,
6582
6583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6584}
6585
6586impl SqlInstancesRestartRequest {
6587 /// Creates a new default instance.
6588 pub fn new() -> Self {
6589 std::default::Default::default()
6590 }
6591
6592 /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
6593 ///
6594 /// # Example
6595 /// ```ignore,no_run
6596 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6597 /// let x = SqlInstancesRestartRequest::new().set_instance("example");
6598 /// ```
6599 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6600 self.instance = v.into();
6601 self
6602 }
6603
6604 /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
6605 ///
6606 /// # Example
6607 /// ```ignore,no_run
6608 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6609 /// let x = SqlInstancesRestartRequest::new().set_project("example");
6610 /// ```
6611 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6612 self.project = v.into();
6613 self
6614 }
6615
6616 /// Sets the value of [location][crate::model::SqlInstancesRestartRequest::location].
6617 ///
6618 /// # Example
6619 /// ```ignore,no_run
6620 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6621 /// let x = SqlInstancesRestartRequest::new().set_location("example");
6622 /// ```
6623 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6624 self.location = v.into();
6625 self
6626 }
6627}
6628
6629impl wkt::message::Message for SqlInstancesRestartRequest {
6630 fn typename() -> &'static str {
6631 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
6632 }
6633}
6634
6635/// Instance restore backup request.
6636#[derive(Clone, Default, PartialEq)]
6637#[non_exhaustive]
6638pub struct SqlInstancesRestoreBackupRequest {
6639 /// Cloud SQL instance ID. This does not include the project ID.
6640 pub instance: std::string::String,
6641
6642 /// Project ID of the project that contains the instance.
6643 pub project: std::string::String,
6644
6645 #[allow(missing_docs)]
6646 pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
6647
6648 /// Optional. Region of the Cloud SQL instance.
6649 pub location: std::string::String,
6650
6651 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6652}
6653
6654impl SqlInstancesRestoreBackupRequest {
6655 /// Creates a new default instance.
6656 pub fn new() -> Self {
6657 std::default::Default::default()
6658 }
6659
6660 /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
6661 ///
6662 /// # Example
6663 /// ```ignore,no_run
6664 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6665 /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
6666 /// ```
6667 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6668 self.instance = v.into();
6669 self
6670 }
6671
6672 /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
6673 ///
6674 /// # Example
6675 /// ```ignore,no_run
6676 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6677 /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
6678 /// ```
6679 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6680 self.project = v.into();
6681 self
6682 }
6683
6684 /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6685 ///
6686 /// # Example
6687 /// ```ignore,no_run
6688 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6689 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6690 /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
6691 /// ```
6692 pub fn set_body<T>(mut self, v: T) -> Self
6693 where
6694 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6695 {
6696 self.body = std::option::Option::Some(v.into());
6697 self
6698 }
6699
6700 /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6701 ///
6702 /// # Example
6703 /// ```ignore,no_run
6704 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6705 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6706 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
6707 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
6708 /// ```
6709 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6710 where
6711 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6712 {
6713 self.body = v.map(|x| x.into());
6714 self
6715 }
6716
6717 /// Sets the value of [location][crate::model::SqlInstancesRestoreBackupRequest::location].
6718 ///
6719 /// # Example
6720 /// ```ignore,no_run
6721 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6722 /// let x = SqlInstancesRestoreBackupRequest::new().set_location("example");
6723 /// ```
6724 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6725 self.location = v.into();
6726 self
6727 }
6728}
6729
6730impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
6731 fn typename() -> &'static str {
6732 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
6733 }
6734}
6735
6736/// Instance rotate server CA request.
6737#[derive(Clone, Default, PartialEq)]
6738#[non_exhaustive]
6739pub struct SqlInstancesRotateServerCaRequest {
6740 /// Cloud SQL instance ID. This does not include the project ID.
6741 pub instance: std::string::String,
6742
6743 /// Project ID of the project that contains the instance.
6744 pub project: std::string::String,
6745
6746 #[allow(missing_docs)]
6747 pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
6748
6749 /// Optional. Region of the Cloud SQL instance.
6750 pub location: std::string::String,
6751
6752 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6753}
6754
6755impl SqlInstancesRotateServerCaRequest {
6756 /// Creates a new default instance.
6757 pub fn new() -> Self {
6758 std::default::Default::default()
6759 }
6760
6761 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
6762 ///
6763 /// # Example
6764 /// ```ignore,no_run
6765 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6766 /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
6767 /// ```
6768 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6769 self.instance = v.into();
6770 self
6771 }
6772
6773 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
6774 ///
6775 /// # Example
6776 /// ```ignore,no_run
6777 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6778 /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
6779 /// ```
6780 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6781 self.project = v.into();
6782 self
6783 }
6784
6785 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6786 ///
6787 /// # Example
6788 /// ```ignore,no_run
6789 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6790 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6791 /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
6792 /// ```
6793 pub fn set_body<T>(mut self, v: T) -> Self
6794 where
6795 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6796 {
6797 self.body = std::option::Option::Some(v.into());
6798 self
6799 }
6800
6801 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6802 ///
6803 /// # Example
6804 /// ```ignore,no_run
6805 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6806 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6807 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
6808 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
6809 /// ```
6810 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6811 where
6812 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6813 {
6814 self.body = v.map(|x| x.into());
6815 self
6816 }
6817
6818 /// Sets the value of [location][crate::model::SqlInstancesRotateServerCaRequest::location].
6819 ///
6820 /// # Example
6821 /// ```ignore,no_run
6822 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6823 /// let x = SqlInstancesRotateServerCaRequest::new().set_location("example");
6824 /// ```
6825 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6826 self.location = v.into();
6827 self
6828 }
6829}
6830
6831impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
6832 fn typename() -> &'static str {
6833 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
6834 }
6835}
6836
6837/// Instance rotate server certificate request.
6838#[derive(Clone, Default, PartialEq)]
6839#[non_exhaustive]
6840pub struct SqlInstancesRotateServerCertificateRequest {
6841 /// Required. Cloud SQL instance ID. This does not include the project ID.
6842 pub instance: std::string::String,
6843
6844 /// Required. Project ID of the project that contains the instance.
6845 pub project: std::string::String,
6846
6847 /// Optional. Rotate server certificate request body.
6848 pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
6849
6850 /// Optional. Region of the Cloud SQL instance.
6851 pub location: std::string::String,
6852
6853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6854}
6855
6856impl SqlInstancesRotateServerCertificateRequest {
6857 /// Creates a new default instance.
6858 pub fn new() -> Self {
6859 std::default::Default::default()
6860 }
6861
6862 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
6863 ///
6864 /// # Example
6865 /// ```ignore,no_run
6866 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6867 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_instance("example");
6868 /// ```
6869 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6870 self.instance = v.into();
6871 self
6872 }
6873
6874 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
6875 ///
6876 /// # Example
6877 /// ```ignore,no_run
6878 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6879 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_project("example");
6880 /// ```
6881 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6882 self.project = v.into();
6883 self
6884 }
6885
6886 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6887 ///
6888 /// # Example
6889 /// ```ignore,no_run
6890 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6891 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6892 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_body(InstancesRotateServerCertificateRequest::default()/* use setters */);
6893 /// ```
6894 pub fn set_body<T>(mut self, v: T) -> Self
6895 where
6896 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6897 {
6898 self.body = std::option::Option::Some(v.into());
6899 self
6900 }
6901
6902 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6903 ///
6904 /// # Example
6905 /// ```ignore,no_run
6906 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6907 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6908 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(Some(InstancesRotateServerCertificateRequest::default()/* use setters */));
6909 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(None::<InstancesRotateServerCertificateRequest>);
6910 /// ```
6911 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6912 where
6913 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6914 {
6915 self.body = v.map(|x| x.into());
6916 self
6917 }
6918
6919 /// Sets the value of [location][crate::model::SqlInstancesRotateServerCertificateRequest::location].
6920 ///
6921 /// # Example
6922 /// ```ignore,no_run
6923 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6924 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_location("example");
6925 /// ```
6926 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6927 self.location = v.into();
6928 self
6929 }
6930}
6931
6932impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
6933 fn typename() -> &'static str {
6934 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
6935 }
6936}
6937
6938/// Instance rotate server certificate request.
6939#[derive(Clone, Default, PartialEq)]
6940#[non_exhaustive]
6941pub struct SqlInstancesRotateEntraIdCertificateRequest {
6942 /// Required. Cloud SQL instance ID. This does not include the project ID.
6943 pub instance: std::string::String,
6944
6945 /// Required. Project ID of the project that contains the instance.
6946 pub project: std::string::String,
6947
6948 /// Optional. Rotate Entra ID certificate request body.
6949 pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
6950
6951 /// Optional. Region of the Cloud SQL instance.
6952 pub location: std::string::String,
6953
6954 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6955}
6956
6957impl SqlInstancesRotateEntraIdCertificateRequest {
6958 /// Creates a new default instance.
6959 pub fn new() -> Self {
6960 std::default::Default::default()
6961 }
6962
6963 /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
6964 ///
6965 /// # Example
6966 /// ```ignore,no_run
6967 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6968 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_instance("example");
6969 /// ```
6970 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6971 self.instance = v.into();
6972 self
6973 }
6974
6975 /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
6976 ///
6977 /// # Example
6978 /// ```ignore,no_run
6979 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6980 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_project("example");
6981 /// ```
6982 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6983 self.project = v.into();
6984 self
6985 }
6986
6987 /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6988 ///
6989 /// # Example
6990 /// ```ignore,no_run
6991 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6992 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6993 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_body(InstancesRotateEntraIdCertificateRequest::default()/* use setters */);
6994 /// ```
6995 pub fn set_body<T>(mut self, v: T) -> Self
6996 where
6997 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6998 {
6999 self.body = std::option::Option::Some(v.into());
7000 self
7001 }
7002
7003 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
7004 ///
7005 /// # Example
7006 /// ```ignore,no_run
7007 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
7008 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
7009 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(Some(InstancesRotateEntraIdCertificateRequest::default()/* use setters */));
7010 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(None::<InstancesRotateEntraIdCertificateRequest>);
7011 /// ```
7012 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7013 where
7014 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
7015 {
7016 self.body = v.map(|x| x.into());
7017 self
7018 }
7019
7020 /// Sets the value of [location][crate::model::SqlInstancesRotateEntraIdCertificateRequest::location].
7021 ///
7022 /// # Example
7023 /// ```ignore,no_run
7024 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
7025 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_location("example");
7026 /// ```
7027 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7028 self.location = v.into();
7029 self
7030 }
7031}
7032
7033impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
7034 fn typename() -> &'static str {
7035 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
7036 }
7037}
7038
7039/// Instance start replica request.
7040#[derive(Clone, Default, PartialEq)]
7041#[non_exhaustive]
7042pub struct SqlInstancesStartReplicaRequest {
7043 /// Cloud SQL read replica instance name.
7044 pub instance: std::string::String,
7045
7046 /// ID of the project that contains the read replica.
7047 pub project: std::string::String,
7048
7049 /// Optional. Region of the Cloud SQL instance.
7050 pub location: std::string::String,
7051
7052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7053}
7054
7055impl SqlInstancesStartReplicaRequest {
7056 /// Creates a new default instance.
7057 pub fn new() -> Self {
7058 std::default::Default::default()
7059 }
7060
7061 /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
7062 ///
7063 /// # Example
7064 /// ```ignore,no_run
7065 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
7066 /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
7067 /// ```
7068 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7069 self.instance = v.into();
7070 self
7071 }
7072
7073 /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
7074 ///
7075 /// # Example
7076 /// ```ignore,no_run
7077 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
7078 /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
7079 /// ```
7080 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7081 self.project = v.into();
7082 self
7083 }
7084
7085 /// Sets the value of [location][crate::model::SqlInstancesStartReplicaRequest::location].
7086 ///
7087 /// # Example
7088 /// ```ignore,no_run
7089 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
7090 /// let x = SqlInstancesStartReplicaRequest::new().set_location("example");
7091 /// ```
7092 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7093 self.location = v.into();
7094 self
7095 }
7096}
7097
7098impl wkt::message::Message for SqlInstancesStartReplicaRequest {
7099 fn typename() -> &'static str {
7100 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
7101 }
7102}
7103
7104/// Instance stop replica request.
7105#[derive(Clone, Default, PartialEq)]
7106#[non_exhaustive]
7107pub struct SqlInstancesStopReplicaRequest {
7108 /// Cloud SQL read replica instance name.
7109 pub instance: std::string::String,
7110
7111 /// ID of the project that contains the read replica.
7112 pub project: std::string::String,
7113
7114 /// Optional. Region of the Cloud SQL instance.
7115 pub location: std::string::String,
7116
7117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7118}
7119
7120impl SqlInstancesStopReplicaRequest {
7121 /// Creates a new default instance.
7122 pub fn new() -> Self {
7123 std::default::Default::default()
7124 }
7125
7126 /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
7127 ///
7128 /// # Example
7129 /// ```ignore,no_run
7130 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
7131 /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
7132 /// ```
7133 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7134 self.instance = v.into();
7135 self
7136 }
7137
7138 /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
7139 ///
7140 /// # Example
7141 /// ```ignore,no_run
7142 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
7143 /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
7144 /// ```
7145 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7146 self.project = v.into();
7147 self
7148 }
7149
7150 /// Sets the value of [location][crate::model::SqlInstancesStopReplicaRequest::location].
7151 ///
7152 /// # Example
7153 /// ```ignore,no_run
7154 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
7155 /// let x = SqlInstancesStopReplicaRequest::new().set_location("example");
7156 /// ```
7157 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7158 self.location = v.into();
7159 self
7160 }
7161}
7162
7163impl wkt::message::Message for SqlInstancesStopReplicaRequest {
7164 fn typename() -> &'static str {
7165 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
7166 }
7167}
7168
7169/// Instance truncate log request.
7170#[derive(Clone, Default, PartialEq)]
7171#[non_exhaustive]
7172pub struct SqlInstancesTruncateLogRequest {
7173 /// Cloud SQL instance ID. This does not include the project ID.
7174 pub instance: std::string::String,
7175
7176 /// Project ID of the Cloud SQL project.
7177 pub project: std::string::String,
7178
7179 #[allow(missing_docs)]
7180 pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
7181
7182 /// Optional. Region of the Cloud SQL instance.
7183 pub location: std::string::String,
7184
7185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7186}
7187
7188impl SqlInstancesTruncateLogRequest {
7189 /// Creates a new default instance.
7190 pub fn new() -> Self {
7191 std::default::Default::default()
7192 }
7193
7194 /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
7195 ///
7196 /// # Example
7197 /// ```ignore,no_run
7198 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
7199 /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
7200 /// ```
7201 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7202 self.instance = v.into();
7203 self
7204 }
7205
7206 /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
7207 ///
7208 /// # Example
7209 /// ```ignore,no_run
7210 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
7211 /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
7212 /// ```
7213 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7214 self.project = v.into();
7215 self
7216 }
7217
7218 /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
7219 ///
7220 /// # Example
7221 /// ```ignore,no_run
7222 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
7223 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
7224 /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
7225 /// ```
7226 pub fn set_body<T>(mut self, v: T) -> Self
7227 where
7228 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
7229 {
7230 self.body = std::option::Option::Some(v.into());
7231 self
7232 }
7233
7234 /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
7235 ///
7236 /// # Example
7237 /// ```ignore,no_run
7238 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
7239 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
7240 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
7241 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
7242 /// ```
7243 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7244 where
7245 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
7246 {
7247 self.body = v.map(|x| x.into());
7248 self
7249 }
7250
7251 /// Sets the value of [location][crate::model::SqlInstancesTruncateLogRequest::location].
7252 ///
7253 /// # Example
7254 /// ```ignore,no_run
7255 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
7256 /// let x = SqlInstancesTruncateLogRequest::new().set_location("example");
7257 /// ```
7258 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7259 self.location = v.into();
7260 self
7261 }
7262}
7263
7264impl wkt::message::Message for SqlInstancesTruncateLogRequest {
7265 fn typename() -> &'static str {
7266 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
7267 }
7268}
7269
7270/// Instance perform disk shrink request.
7271#[derive(Clone, Default, PartialEq)]
7272#[non_exhaustive]
7273pub struct SqlInstancesPerformDiskShrinkRequest {
7274 /// Cloud SQL instance ID. This does not include the project ID.
7275 pub instance: std::string::String,
7276
7277 /// Project ID of the project that contains the instance.
7278 pub project: std::string::String,
7279
7280 /// Perform disk shrink context.
7281 pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
7282
7283 /// Optional. Region of the Cloud SQL instance.
7284 pub location: std::string::String,
7285
7286 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7287}
7288
7289impl SqlInstancesPerformDiskShrinkRequest {
7290 /// Creates a new default instance.
7291 pub fn new() -> Self {
7292 std::default::Default::default()
7293 }
7294
7295 /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
7296 ///
7297 /// # Example
7298 /// ```ignore,no_run
7299 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
7300 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
7301 /// ```
7302 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7303 self.instance = v.into();
7304 self
7305 }
7306
7307 /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
7308 ///
7309 /// # Example
7310 /// ```ignore,no_run
7311 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
7312 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
7313 /// ```
7314 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7315 self.project = v.into();
7316 self
7317 }
7318
7319 /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
7320 ///
7321 /// # Example
7322 /// ```ignore,no_run
7323 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
7324 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
7325 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
7326 /// ```
7327 pub fn set_body<T>(mut self, v: T) -> Self
7328 where
7329 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
7330 {
7331 self.body = std::option::Option::Some(v.into());
7332 self
7333 }
7334
7335 /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
7336 ///
7337 /// # Example
7338 /// ```ignore,no_run
7339 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
7340 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
7341 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
7342 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
7343 /// ```
7344 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7345 where
7346 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
7347 {
7348 self.body = v.map(|x| x.into());
7349 self
7350 }
7351
7352 /// Sets the value of [location][crate::model::SqlInstancesPerformDiskShrinkRequest::location].
7353 ///
7354 /// # Example
7355 /// ```ignore,no_run
7356 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
7357 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_location("example");
7358 /// ```
7359 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7360 self.location = v.into();
7361 self
7362 }
7363}
7364
7365impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
7366 fn typename() -> &'static str {
7367 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
7368 }
7369}
7370
7371/// Instance update request.
7372#[derive(Clone, Default, PartialEq)]
7373#[non_exhaustive]
7374pub struct SqlInstancesUpdateRequest {
7375 /// Cloud SQL instance ID. This does not include the project ID.
7376 pub instance: std::string::String,
7377
7378 /// Project ID of the project that contains the instance.
7379 pub project: std::string::String,
7380
7381 #[allow(missing_docs)]
7382 pub body: std::option::Option<crate::model::DatabaseInstance>,
7383
7384 /// Optional. Region of the Cloud SQL instance.
7385 pub location: std::string::String,
7386
7387 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7388}
7389
7390impl SqlInstancesUpdateRequest {
7391 /// Creates a new default instance.
7392 pub fn new() -> Self {
7393 std::default::Default::default()
7394 }
7395
7396 /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
7397 ///
7398 /// # Example
7399 /// ```ignore,no_run
7400 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
7401 /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
7402 /// ```
7403 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7404 self.instance = v.into();
7405 self
7406 }
7407
7408 /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
7409 ///
7410 /// # Example
7411 /// ```ignore,no_run
7412 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
7413 /// let x = SqlInstancesUpdateRequest::new().set_project("example");
7414 /// ```
7415 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7416 self.project = v.into();
7417 self
7418 }
7419
7420 /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
7421 ///
7422 /// # Example
7423 /// ```ignore,no_run
7424 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
7425 /// use google_cloud_sql_v1::model::DatabaseInstance;
7426 /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
7427 /// ```
7428 pub fn set_body<T>(mut self, v: T) -> Self
7429 where
7430 T: std::convert::Into<crate::model::DatabaseInstance>,
7431 {
7432 self.body = std::option::Option::Some(v.into());
7433 self
7434 }
7435
7436 /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
7437 ///
7438 /// # Example
7439 /// ```ignore,no_run
7440 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
7441 /// use google_cloud_sql_v1::model::DatabaseInstance;
7442 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
7443 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
7444 /// ```
7445 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7446 where
7447 T: std::convert::Into<crate::model::DatabaseInstance>,
7448 {
7449 self.body = v.map(|x| x.into());
7450 self
7451 }
7452
7453 /// Sets the value of [location][crate::model::SqlInstancesUpdateRequest::location].
7454 ///
7455 /// # Example
7456 /// ```ignore,no_run
7457 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
7458 /// let x = SqlInstancesUpdateRequest::new().set_location("example");
7459 /// ```
7460 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7461 self.location = v.into();
7462 self
7463 }
7464}
7465
7466impl wkt::message::Message for SqlInstancesUpdateRequest {
7467 fn typename() -> &'static str {
7468 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
7469 }
7470}
7471
7472/// Instance reschedule maintenance request.
7473#[derive(Clone, Default, PartialEq)]
7474#[non_exhaustive]
7475pub struct SqlInstancesRescheduleMaintenanceRequest {
7476 /// Cloud SQL instance ID. This does not include the project ID.
7477 pub instance: std::string::String,
7478
7479 /// ID of the project that contains the instance.
7480 pub project: std::string::String,
7481
7482 #[allow(missing_docs)]
7483 pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
7484
7485 /// Optional. Region of the Cloud SQL instance.
7486 pub location: std::string::String,
7487
7488 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7489}
7490
7491impl SqlInstancesRescheduleMaintenanceRequest {
7492 /// Creates a new default instance.
7493 pub fn new() -> Self {
7494 std::default::Default::default()
7495 }
7496
7497 /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
7498 ///
7499 /// # Example
7500 /// ```ignore,no_run
7501 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
7502 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
7503 /// ```
7504 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7505 self.instance = v.into();
7506 self
7507 }
7508
7509 /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
7510 ///
7511 /// # Example
7512 /// ```ignore,no_run
7513 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
7514 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
7515 /// ```
7516 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7517 self.project = v.into();
7518 self
7519 }
7520
7521 /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
7522 ///
7523 /// # Example
7524 /// ```ignore,no_run
7525 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
7526 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
7527 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
7528 /// ```
7529 pub fn set_body<T>(mut self, v: T) -> Self
7530 where
7531 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
7532 {
7533 self.body = std::option::Option::Some(v.into());
7534 self
7535 }
7536
7537 /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
7538 ///
7539 /// # Example
7540 /// ```ignore,no_run
7541 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
7542 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
7543 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
7544 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
7545 /// ```
7546 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7547 where
7548 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
7549 {
7550 self.body = v.map(|x| x.into());
7551 self
7552 }
7553
7554 /// Sets the value of [location][crate::model::SqlInstancesRescheduleMaintenanceRequest::location].
7555 ///
7556 /// # Example
7557 /// ```ignore,no_run
7558 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
7559 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_location("example");
7560 /// ```
7561 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7562 self.location = v.into();
7563 self
7564 }
7565}
7566
7567impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
7568 fn typename() -> &'static str {
7569 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
7570 }
7571}
7572
7573/// Instance reencrypt request.
7574#[derive(Clone, Default, PartialEq)]
7575#[non_exhaustive]
7576pub struct SqlInstancesReencryptRequest {
7577 /// Cloud SQL instance ID. This does not include the project ID.
7578 pub instance: std::string::String,
7579
7580 /// ID of the project that contains the instance.
7581 pub project: std::string::String,
7582
7583 /// Reencrypt body that users request
7584 pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
7585
7586 /// Optional. Region of the Cloud SQL instance.
7587 pub location: std::string::String,
7588
7589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7590}
7591
7592impl SqlInstancesReencryptRequest {
7593 /// Creates a new default instance.
7594 pub fn new() -> Self {
7595 std::default::Default::default()
7596 }
7597
7598 /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
7599 ///
7600 /// # Example
7601 /// ```ignore,no_run
7602 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7603 /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
7604 /// ```
7605 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7606 self.instance = v.into();
7607 self
7608 }
7609
7610 /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
7611 ///
7612 /// # Example
7613 /// ```ignore,no_run
7614 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7615 /// let x = SqlInstancesReencryptRequest::new().set_project("example");
7616 /// ```
7617 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7618 self.project = v.into();
7619 self
7620 }
7621
7622 /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
7623 ///
7624 /// # Example
7625 /// ```ignore,no_run
7626 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7627 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
7628 /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
7629 /// ```
7630 pub fn set_body<T>(mut self, v: T) -> Self
7631 where
7632 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
7633 {
7634 self.body = std::option::Option::Some(v.into());
7635 self
7636 }
7637
7638 /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
7639 ///
7640 /// # Example
7641 /// ```ignore,no_run
7642 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7643 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
7644 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
7645 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
7646 /// ```
7647 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7648 where
7649 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
7650 {
7651 self.body = v.map(|x| x.into());
7652 self
7653 }
7654
7655 /// Sets the value of [location][crate::model::SqlInstancesReencryptRequest::location].
7656 ///
7657 /// # Example
7658 /// ```ignore,no_run
7659 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
7660 /// let x = SqlInstancesReencryptRequest::new().set_location("example");
7661 /// ```
7662 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7663 self.location = v.into();
7664 self
7665 }
7666}
7667
7668impl wkt::message::Message for SqlInstancesReencryptRequest {
7669 fn typename() -> &'static str {
7670 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
7671 }
7672}
7673
7674/// Database Instance reencrypt request.
7675#[derive(Clone, Default, PartialEq)]
7676#[non_exhaustive]
7677pub struct InstancesReencryptRequest {
7678 /// Configuration specific to backup re-encryption
7679 pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
7680
7681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7682}
7683
7684impl InstancesReencryptRequest {
7685 /// Creates a new default instance.
7686 pub fn new() -> Self {
7687 std::default::Default::default()
7688 }
7689
7690 /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
7691 ///
7692 /// # Example
7693 /// ```ignore,no_run
7694 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
7695 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
7696 /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
7697 /// ```
7698 pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
7699 where
7700 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
7701 {
7702 self.backup_reencryption_config = std::option::Option::Some(v.into());
7703 self
7704 }
7705
7706 /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
7707 ///
7708 /// # Example
7709 /// ```ignore,no_run
7710 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
7711 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
7712 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
7713 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
7714 /// ```
7715 pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
7716 where
7717 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
7718 {
7719 self.backup_reencryption_config = v.map(|x| x.into());
7720 self
7721 }
7722}
7723
7724impl wkt::message::Message for InstancesReencryptRequest {
7725 fn typename() -> &'static str {
7726 "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
7727 }
7728}
7729
7730/// Backup Reencryption Config
7731#[derive(Clone, Default, PartialEq)]
7732#[non_exhaustive]
7733pub struct BackupReencryptionConfig {
7734 /// Backup re-encryption limit
7735 pub backup_limit: std::option::Option<i32>,
7736
7737 /// Type of backups users want to re-encrypt.
7738 pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
7739
7740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7741}
7742
7743impl BackupReencryptionConfig {
7744 /// Creates a new default instance.
7745 pub fn new() -> Self {
7746 std::default::Default::default()
7747 }
7748
7749 /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7750 ///
7751 /// # Example
7752 /// ```ignore,no_run
7753 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7754 /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
7755 /// ```
7756 pub fn set_backup_limit<T>(mut self, v: T) -> Self
7757 where
7758 T: std::convert::Into<i32>,
7759 {
7760 self.backup_limit = std::option::Option::Some(v.into());
7761 self
7762 }
7763
7764 /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
7765 ///
7766 /// # Example
7767 /// ```ignore,no_run
7768 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7769 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
7770 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
7771 /// ```
7772 pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
7773 where
7774 T: std::convert::Into<i32>,
7775 {
7776 self.backup_limit = v.map(|x| x.into());
7777 self
7778 }
7779
7780 /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7781 ///
7782 /// # Example
7783 /// ```ignore,no_run
7784 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7785 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7786 /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
7787 /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
7788 /// ```
7789 pub fn set_backup_type<T>(mut self, v: T) -> Self
7790 where
7791 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7792 {
7793 self.backup_type = std::option::Option::Some(v.into());
7794 self
7795 }
7796
7797 /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7798 ///
7799 /// # Example
7800 /// ```ignore,no_run
7801 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7802 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7803 /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
7804 /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
7805 /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
7806 /// ```
7807 pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
7808 where
7809 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7810 {
7811 self.backup_type = v.map(|x| x.into());
7812 self
7813 }
7814}
7815
7816impl wkt::message::Message for BackupReencryptionConfig {
7817 fn typename() -> &'static str {
7818 "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
7819 }
7820}
7821
7822/// Defines additional types related to [BackupReencryptionConfig].
7823pub mod backup_reencryption_config {
7824 #[allow(unused_imports)]
7825 use super::*;
7826
7827 /// Backup type for re-encryption
7828 ///
7829 /// # Working with unknown values
7830 ///
7831 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7832 /// additional enum variants at any time. Adding new variants is not considered
7833 /// a breaking change. Applications should write their code in anticipation of:
7834 ///
7835 /// - New values appearing in future releases of the client library, **and**
7836 /// - New values received dynamically, without application changes.
7837 ///
7838 /// Please consult the [Working with enums] section in the user guide for some
7839 /// guidelines.
7840 ///
7841 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7842 #[derive(Clone, Debug, PartialEq)]
7843 #[non_exhaustive]
7844 pub enum BackupType {
7845 /// Unknown backup type, will be defaulted to AUTOMATIC backup type
7846 Unspecified,
7847 /// Reencrypt automatic backups
7848 Automated,
7849 /// Reencrypt on-demand backups
7850 OnDemand,
7851 /// If set, the enum was initialized with an unknown value.
7852 ///
7853 /// Applications can examine the value using [BackupType::value] or
7854 /// [BackupType::name].
7855 UnknownValue(backup_type::UnknownValue),
7856 }
7857
7858 #[doc(hidden)]
7859 pub mod backup_type {
7860 #[allow(unused_imports)]
7861 use super::*;
7862 #[derive(Clone, Debug, PartialEq)]
7863 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7864 }
7865
7866 impl BackupType {
7867 /// Gets the enum value.
7868 ///
7869 /// Returns `None` if the enum contains an unknown value deserialized from
7870 /// the string representation of enums.
7871 pub fn value(&self) -> std::option::Option<i32> {
7872 match self {
7873 Self::Unspecified => std::option::Option::Some(0),
7874 Self::Automated => std::option::Option::Some(1),
7875 Self::OnDemand => std::option::Option::Some(2),
7876 Self::UnknownValue(u) => u.0.value(),
7877 }
7878 }
7879
7880 /// Gets the enum value as a string.
7881 ///
7882 /// Returns `None` if the enum contains an unknown value deserialized from
7883 /// the integer representation of enums.
7884 pub fn name(&self) -> std::option::Option<&str> {
7885 match self {
7886 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
7887 Self::Automated => std::option::Option::Some("AUTOMATED"),
7888 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
7889 Self::UnknownValue(u) => u.0.name(),
7890 }
7891 }
7892 }
7893
7894 impl std::default::Default for BackupType {
7895 fn default() -> Self {
7896 use std::convert::From;
7897 Self::from(0)
7898 }
7899 }
7900
7901 impl std::fmt::Display for BackupType {
7902 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7903 wkt::internal::display_enum(f, self.name(), self.value())
7904 }
7905 }
7906
7907 impl std::convert::From<i32> for BackupType {
7908 fn from(value: i32) -> Self {
7909 match value {
7910 0 => Self::Unspecified,
7911 1 => Self::Automated,
7912 2 => Self::OnDemand,
7913 _ => Self::UnknownValue(backup_type::UnknownValue(
7914 wkt::internal::UnknownEnumValue::Integer(value),
7915 )),
7916 }
7917 }
7918 }
7919
7920 impl std::convert::From<&str> for BackupType {
7921 fn from(value: &str) -> Self {
7922 use std::string::ToString;
7923 match value {
7924 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
7925 "AUTOMATED" => Self::Automated,
7926 "ON_DEMAND" => Self::OnDemand,
7927 _ => Self::UnknownValue(backup_type::UnknownValue(
7928 wkt::internal::UnknownEnumValue::String(value.to_string()),
7929 )),
7930 }
7931 }
7932 }
7933
7934 impl serde::ser::Serialize for BackupType {
7935 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7936 where
7937 S: serde::Serializer,
7938 {
7939 match self {
7940 Self::Unspecified => serializer.serialize_i32(0),
7941 Self::Automated => serializer.serialize_i32(1),
7942 Self::OnDemand => serializer.serialize_i32(2),
7943 Self::UnknownValue(u) => u.0.serialize(serializer),
7944 }
7945 }
7946 }
7947
7948 impl<'de> serde::de::Deserialize<'de> for BackupType {
7949 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7950 where
7951 D: serde::Deserializer<'de>,
7952 {
7953 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
7954 ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
7955 ))
7956 }
7957 }
7958}
7959
7960/// The selected object that Cloud SQL migrates.
7961#[derive(Clone, Default, PartialEq)]
7962#[non_exhaustive]
7963pub struct ExternalSyncSelectedObject {
7964 /// The name of the database that Cloud SQL migrates.
7965 pub database: std::string::String,
7966
7967 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7968}
7969
7970impl ExternalSyncSelectedObject {
7971 /// Creates a new default instance.
7972 pub fn new() -> Self {
7973 std::default::Default::default()
7974 }
7975
7976 /// Sets the value of [database][crate::model::ExternalSyncSelectedObject::database].
7977 ///
7978 /// # Example
7979 /// ```ignore,no_run
7980 /// # use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7981 /// let x = ExternalSyncSelectedObject::new().set_database("example");
7982 /// ```
7983 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7984 self.database = v.into();
7985 self
7986 }
7987}
7988
7989impl wkt::message::Message for ExternalSyncSelectedObject {
7990 fn typename() -> &'static str {
7991 "type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
7992 }
7993}
7994
7995/// Instance get disk shrink config request.
7996#[derive(Clone, Default, PartialEq)]
7997#[non_exhaustive]
7998pub struct SqlInstancesGetDiskShrinkConfigRequest {
7999 /// Cloud SQL instance ID. This does not include the project ID.
8000 pub instance: std::string::String,
8001
8002 /// Project ID of the project that contains the instance.
8003 pub project: std::string::String,
8004
8005 /// Optional. Region of the Cloud SQL instance.
8006 pub location: std::string::String,
8007
8008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8009}
8010
8011impl SqlInstancesGetDiskShrinkConfigRequest {
8012 /// Creates a new default instance.
8013 pub fn new() -> Self {
8014 std::default::Default::default()
8015 }
8016
8017 /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
8018 ///
8019 /// # Example
8020 /// ```ignore,no_run
8021 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
8022 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
8023 /// ```
8024 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8025 self.instance = v.into();
8026 self
8027 }
8028
8029 /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
8030 ///
8031 /// # Example
8032 /// ```ignore,no_run
8033 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
8034 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
8035 /// ```
8036 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8037 self.project = v.into();
8038 self
8039 }
8040
8041 /// Sets the value of [location][crate::model::SqlInstancesGetDiskShrinkConfigRequest::location].
8042 ///
8043 /// # Example
8044 /// ```ignore,no_run
8045 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
8046 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_location("example");
8047 /// ```
8048 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8049 self.location = v.into();
8050 self
8051 }
8052}
8053
8054impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
8055 fn typename() -> &'static str {
8056 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
8057 }
8058}
8059
8060/// Instance verify external sync settings request.
8061#[derive(Clone, Default, PartialEq)]
8062#[non_exhaustive]
8063pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
8064 /// Cloud SQL instance ID. This does not include the project ID.
8065 pub instance: std::string::String,
8066
8067 /// Project ID of the project that contains the instance.
8068 pub project: std::string::String,
8069
8070 /// Flag to enable verifying connection only
8071 pub verify_connection_only: bool,
8072
8073 /// External sync mode
8074 pub sync_mode:
8075 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
8076
8077 /// Optional. Flag to verify settings required by replication setup only
8078 pub verify_replication_only: bool,
8079
8080 /// Optional. MigrationType configures the migration to use physical files or
8081 /// logical dump files. If not set, then the logical dump file configuration is
8082 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
8083 pub migration_type:
8084 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8085
8086 /// Optional. Parallel level for initial data sync. Only applicable for
8087 /// PostgreSQL.
8088 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
8089
8090 /// Optional. Migrate only the specified objects from the source instance. If
8091 /// this field is empty, then migrate all objects.
8092 pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
8093
8094 /// Optional. Region of the Cloud SQL instance.
8095 pub location: std::string::String,
8096
8097 #[allow(missing_docs)]
8098 pub sync_config: std::option::Option<
8099 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
8100 >,
8101
8102 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8103}
8104
8105impl SqlInstancesVerifyExternalSyncSettingsRequest {
8106 /// Creates a new default instance.
8107 pub fn new() -> Self {
8108 std::default::Default::default()
8109 }
8110
8111 /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
8112 ///
8113 /// # Example
8114 /// ```ignore,no_run
8115 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8116 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
8117 /// ```
8118 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8119 self.instance = v.into();
8120 self
8121 }
8122
8123 /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
8124 ///
8125 /// # Example
8126 /// ```ignore,no_run
8127 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8128 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
8129 /// ```
8130 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8131 self.project = v.into();
8132 self
8133 }
8134
8135 /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
8136 ///
8137 /// # Example
8138 /// ```ignore,no_run
8139 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8140 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
8141 /// ```
8142 pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8143 self.verify_connection_only = v.into();
8144 self
8145 }
8146
8147 /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
8148 ///
8149 /// # Example
8150 /// ```ignore,no_run
8151 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8152 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
8153 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
8154 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
8155 /// ```
8156 pub fn set_sync_mode<
8157 T: std::convert::Into<
8158 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
8159 >,
8160 >(
8161 mut self,
8162 v: T,
8163 ) -> Self {
8164 self.sync_mode = v.into();
8165 self
8166 }
8167
8168 /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
8169 ///
8170 /// # Example
8171 /// ```ignore,no_run
8172 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8173 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
8174 /// ```
8175 pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8176 self.verify_replication_only = v.into();
8177 self
8178 }
8179
8180 /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
8181 ///
8182 /// # Example
8183 /// ```ignore,no_run
8184 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8185 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
8186 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
8187 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
8188 /// ```
8189 pub fn set_migration_type<
8190 T: std::convert::Into<
8191 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8192 >,
8193 >(
8194 mut self,
8195 v: T,
8196 ) -> Self {
8197 self.migration_type = v.into();
8198 self
8199 }
8200
8201 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
8202 ///
8203 /// # Example
8204 /// ```ignore,no_run
8205 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8206 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
8207 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
8208 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
8209 /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
8210 /// ```
8211 pub fn set_sync_parallel_level<
8212 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
8213 >(
8214 mut self,
8215 v: T,
8216 ) -> Self {
8217 self.sync_parallel_level = v.into();
8218 self
8219 }
8220
8221 /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
8222 ///
8223 /// # Example
8224 /// ```ignore,no_run
8225 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8226 /// use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
8227 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new()
8228 /// .set_selected_objects([
8229 /// ExternalSyncSelectedObject::default()/* use setters */,
8230 /// ExternalSyncSelectedObject::default()/* use (different) setters */,
8231 /// ]);
8232 /// ```
8233 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
8234 where
8235 T: std::iter::IntoIterator<Item = V>,
8236 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
8237 {
8238 use std::iter::Iterator;
8239 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
8240 self
8241 }
8242
8243 /// Sets the value of [location][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::location].
8244 ///
8245 /// # Example
8246 /// ```ignore,no_run
8247 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8248 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_location("example");
8249 /// ```
8250 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8251 self.location = v.into();
8252 self
8253 }
8254
8255 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
8256 ///
8257 /// Note that all the setters affecting `sync_config` are mutually
8258 /// exclusive.
8259 ///
8260 /// # Example
8261 /// ```ignore,no_run
8262 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8263 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8264 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
8265 /// google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
8266 /// ```
8267 pub fn set_sync_config<
8268 T: std::convert::Into<
8269 std::option::Option<
8270 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
8271 >,
8272 >,
8273 >(
8274 mut self,
8275 v: T,
8276 ) -> Self {
8277 self.sync_config = v.into();
8278 self
8279 }
8280
8281 /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
8282 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
8283 /// holds a different branch.
8284 pub fn mysql_sync_config(
8285 &self,
8286 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
8287 #[allow(unreachable_patterns)]
8288 self.sync_config.as_ref().and_then(|v| match v {
8289 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
8290 _ => std::option::Option::None,
8291 })
8292 }
8293
8294 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
8295 /// to hold a `MysqlSyncConfig`.
8296 ///
8297 /// Note that all the setters affecting `sync_config` are
8298 /// mutually exclusive.
8299 ///
8300 /// # Example
8301 /// ```ignore,no_run
8302 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
8303 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8304 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
8305 /// assert!(x.mysql_sync_config().is_some());
8306 /// ```
8307 pub fn set_mysql_sync_config<
8308 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
8309 >(
8310 mut self,
8311 v: T,
8312 ) -> Self {
8313 self.sync_config = std::option::Option::Some(
8314 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
8315 v.into()
8316 )
8317 );
8318 self
8319 }
8320}
8321
8322impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
8323 fn typename() -> &'static str {
8324 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
8325 }
8326}
8327
8328/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
8329pub mod sql_instances_verify_external_sync_settings_request {
8330 #[allow(unused_imports)]
8331 use super::*;
8332
8333 /// Enum for [ExternalSyncMode].
8334 ///
8335 /// # Working with unknown values
8336 ///
8337 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8338 /// additional enum variants at any time. Adding new variants is not considered
8339 /// a breaking change. Applications should write their code in anticipation of:
8340 ///
8341 /// - New values appearing in future releases of the client library, **and**
8342 /// - New values received dynamically, without application changes.
8343 ///
8344 /// Please consult the [Working with enums] section in the user guide for some
8345 /// guidelines.
8346 ///
8347 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8348 #[derive(Clone, Debug, PartialEq)]
8349 #[non_exhaustive]
8350 pub enum ExternalSyncMode {
8351 /// Unknown external sync mode, will be defaulted to ONLINE mode
8352 Unspecified,
8353 /// Online external sync will set up replication after initial data external
8354 /// sync
8355 Online,
8356 /// Offline external sync only dumps and loads a one-time snapshot of
8357 /// the primary instance's data
8358 Offline,
8359 /// If set, the enum was initialized with an unknown value.
8360 ///
8361 /// Applications can examine the value using [ExternalSyncMode::value] or
8362 /// [ExternalSyncMode::name].
8363 UnknownValue(external_sync_mode::UnknownValue),
8364 }
8365
8366 #[doc(hidden)]
8367 pub mod external_sync_mode {
8368 #[allow(unused_imports)]
8369 use super::*;
8370 #[derive(Clone, Debug, PartialEq)]
8371 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8372 }
8373
8374 impl ExternalSyncMode {
8375 /// Gets the enum value.
8376 ///
8377 /// Returns `None` if the enum contains an unknown value deserialized from
8378 /// the string representation of enums.
8379 pub fn value(&self) -> std::option::Option<i32> {
8380 match self {
8381 Self::Unspecified => std::option::Option::Some(0),
8382 Self::Online => std::option::Option::Some(1),
8383 Self::Offline => std::option::Option::Some(2),
8384 Self::UnknownValue(u) => u.0.value(),
8385 }
8386 }
8387
8388 /// Gets the enum value as a string.
8389 ///
8390 /// Returns `None` if the enum contains an unknown value deserialized from
8391 /// the integer representation of enums.
8392 pub fn name(&self) -> std::option::Option<&str> {
8393 match self {
8394 Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
8395 Self::Online => std::option::Option::Some("ONLINE"),
8396 Self::Offline => std::option::Option::Some("OFFLINE"),
8397 Self::UnknownValue(u) => u.0.name(),
8398 }
8399 }
8400 }
8401
8402 impl std::default::Default for ExternalSyncMode {
8403 fn default() -> Self {
8404 use std::convert::From;
8405 Self::from(0)
8406 }
8407 }
8408
8409 impl std::fmt::Display for ExternalSyncMode {
8410 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8411 wkt::internal::display_enum(f, self.name(), self.value())
8412 }
8413 }
8414
8415 impl std::convert::From<i32> for ExternalSyncMode {
8416 fn from(value: i32) -> Self {
8417 match value {
8418 0 => Self::Unspecified,
8419 1 => Self::Online,
8420 2 => Self::Offline,
8421 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
8422 wkt::internal::UnknownEnumValue::Integer(value),
8423 )),
8424 }
8425 }
8426 }
8427
8428 impl std::convert::From<&str> for ExternalSyncMode {
8429 fn from(value: &str) -> Self {
8430 use std::string::ToString;
8431 match value {
8432 "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
8433 "ONLINE" => Self::Online,
8434 "OFFLINE" => Self::Offline,
8435 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
8436 wkt::internal::UnknownEnumValue::String(value.to_string()),
8437 )),
8438 }
8439 }
8440 }
8441
8442 impl serde::ser::Serialize for ExternalSyncMode {
8443 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8444 where
8445 S: serde::Serializer,
8446 {
8447 match self {
8448 Self::Unspecified => serializer.serialize_i32(0),
8449 Self::Online => serializer.serialize_i32(1),
8450 Self::Offline => serializer.serialize_i32(2),
8451 Self::UnknownValue(u) => u.0.serialize(serializer),
8452 }
8453 }
8454 }
8455
8456 impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
8457 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8458 where
8459 D: serde::Deserializer<'de>,
8460 {
8461 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
8462 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
8463 }
8464 }
8465
8466 /// MigrationType determines whether the migration is a physical file-based
8467 /// migration or a logical dump file-based migration.
8468 ///
8469 /// # Working with unknown values
8470 ///
8471 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8472 /// additional enum variants at any time. Adding new variants is not considered
8473 /// a breaking change. Applications should write their code in anticipation of:
8474 ///
8475 /// - New values appearing in future releases of the client library, **and**
8476 /// - New values received dynamically, without application changes.
8477 ///
8478 /// Please consult the [Working with enums] section in the user guide for some
8479 /// guidelines.
8480 ///
8481 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8482 #[derive(Clone, Debug, PartialEq)]
8483 #[non_exhaustive]
8484 pub enum MigrationType {
8485 /// Default value is a logical dump file-based migration
8486 Unspecified,
8487 /// Logical dump file-based migration
8488 Logical,
8489 /// Physical file-based migration
8490 Physical,
8491 /// If set, the enum was initialized with an unknown value.
8492 ///
8493 /// Applications can examine the value using [MigrationType::value] or
8494 /// [MigrationType::name].
8495 UnknownValue(migration_type::UnknownValue),
8496 }
8497
8498 #[doc(hidden)]
8499 pub mod migration_type {
8500 #[allow(unused_imports)]
8501 use super::*;
8502 #[derive(Clone, Debug, PartialEq)]
8503 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8504 }
8505
8506 impl MigrationType {
8507 /// Gets the enum value.
8508 ///
8509 /// Returns `None` if the enum contains an unknown value deserialized from
8510 /// the string representation of enums.
8511 pub fn value(&self) -> std::option::Option<i32> {
8512 match self {
8513 Self::Unspecified => std::option::Option::Some(0),
8514 Self::Logical => std::option::Option::Some(1),
8515 Self::Physical => std::option::Option::Some(2),
8516 Self::UnknownValue(u) => u.0.value(),
8517 }
8518 }
8519
8520 /// Gets the enum value as a string.
8521 ///
8522 /// Returns `None` if the enum contains an unknown value deserialized from
8523 /// the integer representation of enums.
8524 pub fn name(&self) -> std::option::Option<&str> {
8525 match self {
8526 Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
8527 Self::Logical => std::option::Option::Some("LOGICAL"),
8528 Self::Physical => std::option::Option::Some("PHYSICAL"),
8529 Self::UnknownValue(u) => u.0.name(),
8530 }
8531 }
8532 }
8533
8534 impl std::default::Default for MigrationType {
8535 fn default() -> Self {
8536 use std::convert::From;
8537 Self::from(0)
8538 }
8539 }
8540
8541 impl std::fmt::Display for MigrationType {
8542 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8543 wkt::internal::display_enum(f, self.name(), self.value())
8544 }
8545 }
8546
8547 impl std::convert::From<i32> for MigrationType {
8548 fn from(value: i32) -> Self {
8549 match value {
8550 0 => Self::Unspecified,
8551 1 => Self::Logical,
8552 2 => Self::Physical,
8553 _ => Self::UnknownValue(migration_type::UnknownValue(
8554 wkt::internal::UnknownEnumValue::Integer(value),
8555 )),
8556 }
8557 }
8558 }
8559
8560 impl std::convert::From<&str> for MigrationType {
8561 fn from(value: &str) -> Self {
8562 use std::string::ToString;
8563 match value {
8564 "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
8565 "LOGICAL" => Self::Logical,
8566 "PHYSICAL" => Self::Physical,
8567 _ => Self::UnknownValue(migration_type::UnknownValue(
8568 wkt::internal::UnknownEnumValue::String(value.to_string()),
8569 )),
8570 }
8571 }
8572 }
8573
8574 impl serde::ser::Serialize for MigrationType {
8575 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8576 where
8577 S: serde::Serializer,
8578 {
8579 match self {
8580 Self::Unspecified => serializer.serialize_i32(0),
8581 Self::Logical => serializer.serialize_i32(1),
8582 Self::Physical => serializer.serialize_i32(2),
8583 Self::UnknownValue(u) => u.0.serialize(serializer),
8584 }
8585 }
8586 }
8587
8588 impl<'de> serde::de::Deserialize<'de> for MigrationType {
8589 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8590 where
8591 D: serde::Deserializer<'de>,
8592 {
8593 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
8594 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
8595 ))
8596 }
8597 }
8598
8599 #[allow(missing_docs)]
8600 #[derive(Clone, Debug, PartialEq)]
8601 #[non_exhaustive]
8602 pub enum SyncConfig {
8603 /// Optional. MySQL-specific settings for start external sync.
8604 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8605 }
8606}
8607
8608/// Instance start external sync request.
8609#[derive(Clone, Default, PartialEq)]
8610#[non_exhaustive]
8611pub struct SqlInstancesStartExternalSyncRequest {
8612 /// Cloud SQL instance ID. This does not include the project ID.
8613 pub instance: std::string::String,
8614
8615 /// ID of the project that contains the instance.
8616 pub project: std::string::String,
8617
8618 /// External sync mode.
8619 pub sync_mode:
8620 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
8621
8622 /// Whether to skip the verification step (VESS).
8623 pub skip_verification: bool,
8624
8625 /// Optional. Parallel level for initial data sync. Currently only applicable
8626 /// for MySQL.
8627 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
8628
8629 /// Optional. MigrationType configures the migration to use physical files or
8630 /// logical dump files. If not set, then the logical dump file configuration is
8631 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
8632 pub migration_type:
8633 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8634
8635 /// Optional. MySQL only. True if end-user has confirmed that this SES call
8636 /// will wipe replica databases overlapping with the proposed selected_objects.
8637 /// If this field is not set and there are both overlapping and additional
8638 /// databases proposed, an error will be returned.
8639 pub replica_overwrite_enabled: bool,
8640
8641 /// Optional. Region of the Cloud SQL instance.
8642 pub location: std::string::String,
8643
8644 #[allow(missing_docs)]
8645 pub sync_config:
8646 std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
8647
8648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8649}
8650
8651impl SqlInstancesStartExternalSyncRequest {
8652 /// Creates a new default instance.
8653 pub fn new() -> Self {
8654 std::default::Default::default()
8655 }
8656
8657 /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
8658 ///
8659 /// # Example
8660 /// ```ignore,no_run
8661 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8662 /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
8663 /// ```
8664 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8665 self.instance = v.into();
8666 self
8667 }
8668
8669 /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
8670 ///
8671 /// # Example
8672 /// ```ignore,no_run
8673 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8674 /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
8675 /// ```
8676 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8677 self.project = v.into();
8678 self
8679 }
8680
8681 /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
8682 ///
8683 /// # Example
8684 /// ```ignore,no_run
8685 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8686 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
8687 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
8688 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
8689 /// ```
8690 pub fn set_sync_mode<
8691 T: std::convert::Into<
8692 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
8693 >,
8694 >(
8695 mut self,
8696 v: T,
8697 ) -> Self {
8698 self.sync_mode = v.into();
8699 self
8700 }
8701
8702 /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
8703 ///
8704 /// # Example
8705 /// ```ignore,no_run
8706 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8707 /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
8708 /// ```
8709 pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8710 self.skip_verification = v.into();
8711 self
8712 }
8713
8714 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
8715 ///
8716 /// # Example
8717 /// ```ignore,no_run
8718 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8719 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
8720 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
8721 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
8722 /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
8723 /// ```
8724 pub fn set_sync_parallel_level<
8725 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
8726 >(
8727 mut self,
8728 v: T,
8729 ) -> Self {
8730 self.sync_parallel_level = v.into();
8731 self
8732 }
8733
8734 /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
8735 ///
8736 /// # Example
8737 /// ```ignore,no_run
8738 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8739 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
8740 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
8741 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
8742 /// ```
8743 pub fn set_migration_type<
8744 T: std::convert::Into<
8745 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
8746 >,
8747 >(
8748 mut self,
8749 v: T,
8750 ) -> Self {
8751 self.migration_type = v.into();
8752 self
8753 }
8754
8755 /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
8756 ///
8757 /// # Example
8758 /// ```ignore,no_run
8759 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8760 /// let x = SqlInstancesStartExternalSyncRequest::new().set_replica_overwrite_enabled(true);
8761 /// ```
8762 pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8763 self.replica_overwrite_enabled = v.into();
8764 self
8765 }
8766
8767 /// Sets the value of [location][crate::model::SqlInstancesStartExternalSyncRequest::location].
8768 ///
8769 /// # Example
8770 /// ```ignore,no_run
8771 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8772 /// let x = SqlInstancesStartExternalSyncRequest::new().set_location("example");
8773 /// ```
8774 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8775 self.location = v.into();
8776 self
8777 }
8778
8779 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
8780 ///
8781 /// Note that all the setters affecting `sync_config` are mutually
8782 /// exclusive.
8783 ///
8784 /// # Example
8785 /// ```ignore,no_run
8786 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8787 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8788 /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
8789 /// google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
8790 /// ```
8791 pub fn set_sync_config<
8792 T: std::convert::Into<
8793 std::option::Option<
8794 crate::model::sql_instances_start_external_sync_request::SyncConfig,
8795 >,
8796 >,
8797 >(
8798 mut self,
8799 v: T,
8800 ) -> Self {
8801 self.sync_config = v.into();
8802 self
8803 }
8804
8805 /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8806 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
8807 /// holds a different branch.
8808 pub fn mysql_sync_config(
8809 &self,
8810 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
8811 #[allow(unreachable_patterns)]
8812 self.sync_config.as_ref().and_then(|v| match v {
8813 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
8814 _ => std::option::Option::None,
8815 })
8816 }
8817
8818 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
8819 /// to hold a `MysqlSyncConfig`.
8820 ///
8821 /// Note that all the setters affecting `sync_config` are
8822 /// mutually exclusive.
8823 ///
8824 /// # Example
8825 /// ```ignore,no_run
8826 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
8827 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
8828 /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
8829 /// assert!(x.mysql_sync_config().is_some());
8830 /// ```
8831 pub fn set_mysql_sync_config<
8832 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
8833 >(
8834 mut self,
8835 v: T,
8836 ) -> Self {
8837 self.sync_config = std::option::Option::Some(
8838 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
8839 v.into(),
8840 ),
8841 );
8842 self
8843 }
8844}
8845
8846impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
8847 fn typename() -> &'static str {
8848 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
8849 }
8850}
8851
8852/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
8853pub mod sql_instances_start_external_sync_request {
8854 #[allow(unused_imports)]
8855 use super::*;
8856
8857 #[allow(missing_docs)]
8858 #[derive(Clone, Debug, PartialEq)]
8859 #[non_exhaustive]
8860 pub enum SyncConfig {
8861 /// MySQL-specific settings for start external sync.
8862 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8863 }
8864}
8865
8866/// Instance reset replica size request.
8867#[derive(Clone, Default, PartialEq)]
8868#[non_exhaustive]
8869pub struct SqlInstancesResetReplicaSizeRequest {
8870 /// Cloud SQL read replica instance name.
8871 pub instance: std::string::String,
8872
8873 /// ID of the project that contains the read replica.
8874 pub project: std::string::String,
8875
8876 /// Optional. Region of the Cloud SQL instance.
8877 pub location: std::string::String,
8878
8879 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8880}
8881
8882impl SqlInstancesResetReplicaSizeRequest {
8883 /// Creates a new default instance.
8884 pub fn new() -> Self {
8885 std::default::Default::default()
8886 }
8887
8888 /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
8889 ///
8890 /// # Example
8891 /// ```ignore,no_run
8892 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8893 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
8894 /// ```
8895 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8896 self.instance = v.into();
8897 self
8898 }
8899
8900 /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
8901 ///
8902 /// # Example
8903 /// ```ignore,no_run
8904 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8905 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
8906 /// ```
8907 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8908 self.project = v.into();
8909 self
8910 }
8911
8912 /// Sets the value of [location][crate::model::SqlInstancesResetReplicaSizeRequest::location].
8913 ///
8914 /// # Example
8915 /// ```ignore,no_run
8916 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8917 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_location("example");
8918 /// ```
8919 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8920 self.location = v.into();
8921 self
8922 }
8923}
8924
8925impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
8926 fn typename() -> &'static str {
8927 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
8928 }
8929}
8930
8931/// Instance create ephemeral certificate request.
8932#[derive(Clone, Default, PartialEq)]
8933#[non_exhaustive]
8934pub struct SqlInstancesCreateEphemeralCertRequest {
8935 /// Cloud SQL instance ID. This does not include the project ID.
8936 pub instance: std::string::String,
8937
8938 /// Project ID of the Cloud SQL project.
8939 pub project: std::string::String,
8940
8941 #[allow(missing_docs)]
8942 pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
8943
8944 /// Optional. Region of the Cloud SQL instance.
8945 pub location: std::string::String,
8946
8947 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8948}
8949
8950impl SqlInstancesCreateEphemeralCertRequest {
8951 /// Creates a new default instance.
8952 pub fn new() -> Self {
8953 std::default::Default::default()
8954 }
8955
8956 /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
8957 ///
8958 /// # Example
8959 /// ```ignore,no_run
8960 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8961 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
8962 /// ```
8963 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8964 self.instance = v.into();
8965 self
8966 }
8967
8968 /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
8969 ///
8970 /// # Example
8971 /// ```ignore,no_run
8972 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8973 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
8974 /// ```
8975 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8976 self.project = v.into();
8977 self
8978 }
8979
8980 /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8981 ///
8982 /// # Example
8983 /// ```ignore,no_run
8984 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8985 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8986 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
8987 /// ```
8988 pub fn set_body<T>(mut self, v: T) -> Self
8989 where
8990 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8991 {
8992 self.body = std::option::Option::Some(v.into());
8993 self
8994 }
8995
8996 /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8997 ///
8998 /// # Example
8999 /// ```ignore,no_run
9000 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
9001 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
9002 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
9003 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
9004 /// ```
9005 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9006 where
9007 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
9008 {
9009 self.body = v.map(|x| x.into());
9010 self
9011 }
9012
9013 /// Sets the value of [location][crate::model::SqlInstancesCreateEphemeralCertRequest::location].
9014 ///
9015 /// # Example
9016 /// ```ignore,no_run
9017 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
9018 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_location("example");
9019 /// ```
9020 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9021 self.location = v.into();
9022 self
9023 }
9024}
9025
9026impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
9027 fn typename() -> &'static str {
9028 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
9029 }
9030}
9031
9032/// Database instance clone request.
9033#[derive(Clone, Default, PartialEq)]
9034#[non_exhaustive]
9035pub struct InstancesCloneRequest {
9036 /// Required. Contains details about the clone operation.
9037 pub clone_context: std::option::Option<crate::model::CloneContext>,
9038
9039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9040}
9041
9042impl InstancesCloneRequest {
9043 /// Creates a new default instance.
9044 pub fn new() -> Self {
9045 std::default::Default::default()
9046 }
9047
9048 /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
9049 ///
9050 /// # Example
9051 /// ```ignore,no_run
9052 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
9053 /// use google_cloud_sql_v1::model::CloneContext;
9054 /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
9055 /// ```
9056 pub fn set_clone_context<T>(mut self, v: T) -> Self
9057 where
9058 T: std::convert::Into<crate::model::CloneContext>,
9059 {
9060 self.clone_context = std::option::Option::Some(v.into());
9061 self
9062 }
9063
9064 /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
9065 ///
9066 /// # Example
9067 /// ```ignore,no_run
9068 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
9069 /// use google_cloud_sql_v1::model::CloneContext;
9070 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
9071 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
9072 /// ```
9073 pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
9074 where
9075 T: std::convert::Into<crate::model::CloneContext>,
9076 {
9077 self.clone_context = v.map(|x| x.into());
9078 self
9079 }
9080}
9081
9082impl wkt::message::Message for InstancesCloneRequest {
9083 fn typename() -> &'static str {
9084 "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
9085 }
9086}
9087
9088/// Database demote primary instance request.
9089#[derive(Clone, Default, PartialEq)]
9090#[non_exhaustive]
9091pub struct InstancesDemoteMasterRequest {
9092 /// Contains details about the demoteMaster operation.
9093 pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
9094
9095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9096}
9097
9098impl InstancesDemoteMasterRequest {
9099 /// Creates a new default instance.
9100 pub fn new() -> Self {
9101 std::default::Default::default()
9102 }
9103
9104 /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
9105 ///
9106 /// # Example
9107 /// ```ignore,no_run
9108 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
9109 /// use google_cloud_sql_v1::model::DemoteMasterContext;
9110 /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
9111 /// ```
9112 pub fn set_demote_master_context<T>(mut self, v: T) -> Self
9113 where
9114 T: std::convert::Into<crate::model::DemoteMasterContext>,
9115 {
9116 self.demote_master_context = std::option::Option::Some(v.into());
9117 self
9118 }
9119
9120 /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
9121 ///
9122 /// # Example
9123 /// ```ignore,no_run
9124 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
9125 /// use google_cloud_sql_v1::model::DemoteMasterContext;
9126 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
9127 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
9128 /// ```
9129 pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
9130 where
9131 T: std::convert::Into<crate::model::DemoteMasterContext>,
9132 {
9133 self.demote_master_context = v.map(|x| x.into());
9134 self
9135 }
9136}
9137
9138impl wkt::message::Message for InstancesDemoteMasterRequest {
9139 fn typename() -> &'static str {
9140 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
9141 }
9142}
9143
9144/// This request is used to demote an existing standalone instance to be a
9145/// Cloud SQL read replica for an external database server.
9146#[derive(Clone, Default, PartialEq)]
9147#[non_exhaustive]
9148pub struct InstancesDemoteRequest {
9149 /// Required. Contains details about the demote operation.
9150 pub demote_context: std::option::Option<crate::model::DemoteContext>,
9151
9152 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9153}
9154
9155impl InstancesDemoteRequest {
9156 /// Creates a new default instance.
9157 pub fn new() -> Self {
9158 std::default::Default::default()
9159 }
9160
9161 /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
9162 ///
9163 /// # Example
9164 /// ```ignore,no_run
9165 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
9166 /// use google_cloud_sql_v1::model::DemoteContext;
9167 /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
9168 /// ```
9169 pub fn set_demote_context<T>(mut self, v: T) -> Self
9170 where
9171 T: std::convert::Into<crate::model::DemoteContext>,
9172 {
9173 self.demote_context = std::option::Option::Some(v.into());
9174 self
9175 }
9176
9177 /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
9178 ///
9179 /// # Example
9180 /// ```ignore,no_run
9181 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
9182 /// use google_cloud_sql_v1::model::DemoteContext;
9183 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
9184 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
9185 /// ```
9186 pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
9187 where
9188 T: std::convert::Into<crate::model::DemoteContext>,
9189 {
9190 self.demote_context = v.map(|x| x.into());
9191 self
9192 }
9193}
9194
9195impl wkt::message::Message for InstancesDemoteRequest {
9196 fn typename() -> &'static str {
9197 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
9198 }
9199}
9200
9201/// Database instance export request.
9202#[derive(Clone, Default, PartialEq)]
9203#[non_exhaustive]
9204pub struct InstancesExportRequest {
9205 /// Contains details about the export operation.
9206 pub export_context: std::option::Option<crate::model::ExportContext>,
9207
9208 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9209}
9210
9211impl InstancesExportRequest {
9212 /// Creates a new default instance.
9213 pub fn new() -> Self {
9214 std::default::Default::default()
9215 }
9216
9217 /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
9218 ///
9219 /// # Example
9220 /// ```ignore,no_run
9221 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
9222 /// use google_cloud_sql_v1::model::ExportContext;
9223 /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
9224 /// ```
9225 pub fn set_export_context<T>(mut self, v: T) -> Self
9226 where
9227 T: std::convert::Into<crate::model::ExportContext>,
9228 {
9229 self.export_context = std::option::Option::Some(v.into());
9230 self
9231 }
9232
9233 /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
9234 ///
9235 /// # Example
9236 /// ```ignore,no_run
9237 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
9238 /// use google_cloud_sql_v1::model::ExportContext;
9239 /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
9240 /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
9241 /// ```
9242 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
9243 where
9244 T: std::convert::Into<crate::model::ExportContext>,
9245 {
9246 self.export_context = v.map(|x| x.into());
9247 self
9248 }
9249}
9250
9251impl wkt::message::Message for InstancesExportRequest {
9252 fn typename() -> &'static str {
9253 "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
9254 }
9255}
9256
9257/// Instance failover request.
9258#[derive(Clone, Default, PartialEq)]
9259#[non_exhaustive]
9260pub struct InstancesFailoverRequest {
9261 /// Failover Context.
9262 pub failover_context: std::option::Option<crate::model::FailoverContext>,
9263
9264 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9265}
9266
9267impl InstancesFailoverRequest {
9268 /// Creates a new default instance.
9269 pub fn new() -> Self {
9270 std::default::Default::default()
9271 }
9272
9273 /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
9274 ///
9275 /// # Example
9276 /// ```ignore,no_run
9277 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
9278 /// use google_cloud_sql_v1::model::FailoverContext;
9279 /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
9280 /// ```
9281 pub fn set_failover_context<T>(mut self, v: T) -> Self
9282 where
9283 T: std::convert::Into<crate::model::FailoverContext>,
9284 {
9285 self.failover_context = std::option::Option::Some(v.into());
9286 self
9287 }
9288
9289 /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
9290 ///
9291 /// # Example
9292 /// ```ignore,no_run
9293 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
9294 /// use google_cloud_sql_v1::model::FailoverContext;
9295 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
9296 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
9297 /// ```
9298 pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
9299 where
9300 T: std::convert::Into<crate::model::FailoverContext>,
9301 {
9302 self.failover_context = v.map(|x| x.into());
9303 self
9304 }
9305}
9306
9307impl wkt::message::Message for InstancesFailoverRequest {
9308 fn typename() -> &'static str {
9309 "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
9310 }
9311}
9312
9313/// SslCerts create ephemeral certificate request.
9314#[derive(Clone, Default, PartialEq)]
9315#[non_exhaustive]
9316pub struct SslCertsCreateEphemeralRequest {
9317 /// PEM encoded public key to include in the signed certificate.
9318 pub public_key: std::string::String,
9319
9320 /// Access token to include in the signed certificate.
9321 pub access_token: std::string::String,
9322
9323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9324}
9325
9326impl SslCertsCreateEphemeralRequest {
9327 /// Creates a new default instance.
9328 pub fn new() -> Self {
9329 std::default::Default::default()
9330 }
9331
9332 /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
9333 ///
9334 /// # Example
9335 /// ```ignore,no_run
9336 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
9337 /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
9338 /// ```
9339 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9340 self.public_key = v.into();
9341 self
9342 }
9343
9344 /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
9345 ///
9346 /// # Example
9347 /// ```ignore,no_run
9348 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
9349 /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
9350 /// ```
9351 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9352 self.access_token = v.into();
9353 self
9354 }
9355}
9356
9357impl wkt::message::Message for SslCertsCreateEphemeralRequest {
9358 fn typename() -> &'static str {
9359 "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
9360 }
9361}
9362
9363/// Database instance import request.
9364#[derive(Clone, Default, PartialEq)]
9365#[non_exhaustive]
9366pub struct InstancesImportRequest {
9367 /// Contains details about the import operation.
9368 pub import_context: std::option::Option<crate::model::ImportContext>,
9369
9370 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9371}
9372
9373impl InstancesImportRequest {
9374 /// Creates a new default instance.
9375 pub fn new() -> Self {
9376 std::default::Default::default()
9377 }
9378
9379 /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
9380 ///
9381 /// # Example
9382 /// ```ignore,no_run
9383 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
9384 /// use google_cloud_sql_v1::model::ImportContext;
9385 /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
9386 /// ```
9387 pub fn set_import_context<T>(mut self, v: T) -> Self
9388 where
9389 T: std::convert::Into<crate::model::ImportContext>,
9390 {
9391 self.import_context = std::option::Option::Some(v.into());
9392 self
9393 }
9394
9395 /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
9396 ///
9397 /// # Example
9398 /// ```ignore,no_run
9399 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
9400 /// use google_cloud_sql_v1::model::ImportContext;
9401 /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
9402 /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
9403 /// ```
9404 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
9405 where
9406 T: std::convert::Into<crate::model::ImportContext>,
9407 {
9408 self.import_context = v.map(|x| x.into());
9409 self
9410 }
9411}
9412
9413impl wkt::message::Message for InstancesImportRequest {
9414 fn typename() -> &'static str {
9415 "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
9416 }
9417}
9418
9419/// Request for Pre-checks for MVU
9420#[derive(Clone, Default, PartialEq)]
9421#[non_exhaustive]
9422pub struct InstancesPreCheckMajorVersionUpgradeRequest {
9423 /// Required. Contains details about the pre-check major version upgrade
9424 /// operation.
9425 pub pre_check_major_version_upgrade_context:
9426 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
9427
9428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9429}
9430
9431impl InstancesPreCheckMajorVersionUpgradeRequest {
9432 /// Creates a new default instance.
9433 pub fn new() -> Self {
9434 std::default::Default::default()
9435 }
9436
9437 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
9438 ///
9439 /// # Example
9440 /// ```ignore,no_run
9441 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9442 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
9443 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
9444 /// ```
9445 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
9446 where
9447 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
9448 {
9449 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
9450 self
9451 }
9452
9453 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
9454 ///
9455 /// # Example
9456 /// ```ignore,no_run
9457 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9458 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
9459 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
9460 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
9461 /// ```
9462 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
9463 mut self,
9464 v: std::option::Option<T>,
9465 ) -> Self
9466 where
9467 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
9468 {
9469 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
9470 self
9471 }
9472}
9473
9474impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
9475 fn typename() -> &'static str {
9476 "type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
9477 }
9478}
9479
9480/// Database instances list response.
9481#[derive(Clone, Default, PartialEq)]
9482#[non_exhaustive]
9483pub struct InstancesListResponse {
9484 /// This is always `sql#instancesList`.
9485 pub kind: std::string::String,
9486
9487 /// List of warnings that occurred while handling the request.
9488 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
9489
9490 /// List of database instance resources.
9491 pub items: std::vec::Vec<crate::model::DatabaseInstance>,
9492
9493 /// The continuation token, used to page through large result sets. Provide
9494 /// this value in a subsequent request to return the next page of results.
9495 pub next_page_token: std::string::String,
9496
9497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9498}
9499
9500impl InstancesListResponse {
9501 /// Creates a new default instance.
9502 pub fn new() -> Self {
9503 std::default::Default::default()
9504 }
9505
9506 /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
9507 ///
9508 /// # Example
9509 /// ```ignore,no_run
9510 /// # use google_cloud_sql_v1::model::InstancesListResponse;
9511 /// let x = InstancesListResponse::new().set_kind("example");
9512 /// ```
9513 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9514 self.kind = v.into();
9515 self
9516 }
9517
9518 /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
9519 ///
9520 /// # Example
9521 /// ```ignore,no_run
9522 /// # use google_cloud_sql_v1::model::InstancesListResponse;
9523 /// use google_cloud_sql_v1::model::ApiWarning;
9524 /// let x = InstancesListResponse::new()
9525 /// .set_warnings([
9526 /// ApiWarning::default()/* use setters */,
9527 /// ApiWarning::default()/* use (different) setters */,
9528 /// ]);
9529 /// ```
9530 pub fn set_warnings<T, V>(mut self, v: T) -> Self
9531 where
9532 T: std::iter::IntoIterator<Item = V>,
9533 V: std::convert::Into<crate::model::ApiWarning>,
9534 {
9535 use std::iter::Iterator;
9536 self.warnings = v.into_iter().map(|i| i.into()).collect();
9537 self
9538 }
9539
9540 /// Sets the value of [items][crate::model::InstancesListResponse::items].
9541 ///
9542 /// # Example
9543 /// ```ignore,no_run
9544 /// # use google_cloud_sql_v1::model::InstancesListResponse;
9545 /// use google_cloud_sql_v1::model::DatabaseInstance;
9546 /// let x = InstancesListResponse::new()
9547 /// .set_items([
9548 /// DatabaseInstance::default()/* use setters */,
9549 /// DatabaseInstance::default()/* use (different) setters */,
9550 /// ]);
9551 /// ```
9552 pub fn set_items<T, V>(mut self, v: T) -> Self
9553 where
9554 T: std::iter::IntoIterator<Item = V>,
9555 V: std::convert::Into<crate::model::DatabaseInstance>,
9556 {
9557 use std::iter::Iterator;
9558 self.items = v.into_iter().map(|i| i.into()).collect();
9559 self
9560 }
9561
9562 /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
9563 ///
9564 /// # Example
9565 /// ```ignore,no_run
9566 /// # use google_cloud_sql_v1::model::InstancesListResponse;
9567 /// let x = InstancesListResponse::new().set_next_page_token("example");
9568 /// ```
9569 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9570 self.next_page_token = v.into();
9571 self
9572 }
9573}
9574
9575impl wkt::message::Message for InstancesListResponse {
9576 fn typename() -> &'static str {
9577 "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
9578 }
9579}
9580
9581#[doc(hidden)]
9582impl google_cloud_gax::paginator::internal::PageableResponse for InstancesListResponse {
9583 type PageItem = crate::model::DatabaseInstance;
9584
9585 fn items(self) -> std::vec::Vec<Self::PageItem> {
9586 self.items
9587 }
9588
9589 fn next_page_token(&self) -> std::string::String {
9590 use std::clone::Clone;
9591 self.next_page_token.clone()
9592 }
9593}
9594
9595/// Instances ListServerCas response.
9596#[derive(Clone, Default, PartialEq)]
9597#[non_exhaustive]
9598pub struct InstancesListServerCasResponse {
9599 /// List of server CA certificates for the instance.
9600 pub certs: std::vec::Vec<crate::model::SslCert>,
9601
9602 #[allow(missing_docs)]
9603 pub active_version: std::string::String,
9604
9605 /// This is always `sql#instancesListServerCas`.
9606 pub kind: std::string::String,
9607
9608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9609}
9610
9611impl InstancesListServerCasResponse {
9612 /// Creates a new default instance.
9613 pub fn new() -> Self {
9614 std::default::Default::default()
9615 }
9616
9617 /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
9618 ///
9619 /// # Example
9620 /// ```ignore,no_run
9621 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
9622 /// use google_cloud_sql_v1::model::SslCert;
9623 /// let x = InstancesListServerCasResponse::new()
9624 /// .set_certs([
9625 /// SslCert::default()/* use setters */,
9626 /// SslCert::default()/* use (different) setters */,
9627 /// ]);
9628 /// ```
9629 pub fn set_certs<T, V>(mut self, v: T) -> Self
9630 where
9631 T: std::iter::IntoIterator<Item = V>,
9632 V: std::convert::Into<crate::model::SslCert>,
9633 {
9634 use std::iter::Iterator;
9635 self.certs = v.into_iter().map(|i| i.into()).collect();
9636 self
9637 }
9638
9639 /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
9640 ///
9641 /// # Example
9642 /// ```ignore,no_run
9643 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
9644 /// let x = InstancesListServerCasResponse::new().set_active_version("example");
9645 /// ```
9646 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9647 self.active_version = v.into();
9648 self
9649 }
9650
9651 /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
9652 ///
9653 /// # Example
9654 /// ```ignore,no_run
9655 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
9656 /// let x = InstancesListServerCasResponse::new().set_kind("example");
9657 /// ```
9658 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9659 self.kind = v.into();
9660 self
9661 }
9662}
9663
9664impl wkt::message::Message for InstancesListServerCasResponse {
9665 fn typename() -> &'static str {
9666 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
9667 }
9668}
9669
9670/// Instances ListServerCertificates response.
9671#[derive(Clone, Default, PartialEq)]
9672#[non_exhaustive]
9673pub struct InstancesListServerCertificatesResponse {
9674 /// List of server CA certificates for the instance.
9675 pub ca_certs: std::vec::Vec<crate::model::SslCert>,
9676
9677 /// List of server certificates for the instance, signed by the corresponding
9678 /// CA from the `ca_certs` list.
9679 pub server_certs: std::vec::Vec<crate::model::SslCert>,
9680
9681 /// The `sha1_fingerprint` of the active certificate from `server_certs`.
9682 pub active_version: std::string::String,
9683
9684 /// This is always `sql#instancesListServerCertificates`.
9685 pub kind: std::string::String,
9686
9687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9688}
9689
9690impl InstancesListServerCertificatesResponse {
9691 /// Creates a new default instance.
9692 pub fn new() -> Self {
9693 std::default::Default::default()
9694 }
9695
9696 /// Sets the value of [ca_certs][crate::model::InstancesListServerCertificatesResponse::ca_certs].
9697 ///
9698 /// # Example
9699 /// ```ignore,no_run
9700 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9701 /// use google_cloud_sql_v1::model::SslCert;
9702 /// let x = InstancesListServerCertificatesResponse::new()
9703 /// .set_ca_certs([
9704 /// SslCert::default()/* use setters */,
9705 /// SslCert::default()/* use (different) setters */,
9706 /// ]);
9707 /// ```
9708 pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
9709 where
9710 T: std::iter::IntoIterator<Item = V>,
9711 V: std::convert::Into<crate::model::SslCert>,
9712 {
9713 use std::iter::Iterator;
9714 self.ca_certs = v.into_iter().map(|i| i.into()).collect();
9715 self
9716 }
9717
9718 /// Sets the value of [server_certs][crate::model::InstancesListServerCertificatesResponse::server_certs].
9719 ///
9720 /// # Example
9721 /// ```ignore,no_run
9722 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9723 /// use google_cloud_sql_v1::model::SslCert;
9724 /// let x = InstancesListServerCertificatesResponse::new()
9725 /// .set_server_certs([
9726 /// SslCert::default()/* use setters */,
9727 /// SslCert::default()/* use (different) setters */,
9728 /// ]);
9729 /// ```
9730 pub fn set_server_certs<T, V>(mut self, v: T) -> Self
9731 where
9732 T: std::iter::IntoIterator<Item = V>,
9733 V: std::convert::Into<crate::model::SslCert>,
9734 {
9735 use std::iter::Iterator;
9736 self.server_certs = v.into_iter().map(|i| i.into()).collect();
9737 self
9738 }
9739
9740 /// Sets the value of [active_version][crate::model::InstancesListServerCertificatesResponse::active_version].
9741 ///
9742 /// # Example
9743 /// ```ignore,no_run
9744 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9745 /// let x = InstancesListServerCertificatesResponse::new().set_active_version("example");
9746 /// ```
9747 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9748 self.active_version = v.into();
9749 self
9750 }
9751
9752 /// Sets the value of [kind][crate::model::InstancesListServerCertificatesResponse::kind].
9753 ///
9754 /// # Example
9755 /// ```ignore,no_run
9756 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
9757 /// let x = InstancesListServerCertificatesResponse::new().set_kind("example");
9758 /// ```
9759 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9760 self.kind = v.into();
9761 self
9762 }
9763}
9764
9765impl wkt::message::Message for InstancesListServerCertificatesResponse {
9766 fn typename() -> &'static str {
9767 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
9768 }
9769}
9770
9771/// Instances ListEntraIdCertificates response.
9772#[derive(Clone, Default, PartialEq)]
9773#[non_exhaustive]
9774pub struct InstancesListEntraIdCertificatesResponse {
9775 /// List of Entra ID certificates for the instance.
9776 pub certs: std::vec::Vec<crate::model::SslCert>,
9777
9778 /// The `sha1_fingerprint` of the active certificate from `certs`.
9779 pub active_version: std::string::String,
9780
9781 /// This is always `sql#instancesListEntraIdCertificates`.
9782 pub kind: std::string::String,
9783
9784 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9785}
9786
9787impl InstancesListEntraIdCertificatesResponse {
9788 /// Creates a new default instance.
9789 pub fn new() -> Self {
9790 std::default::Default::default()
9791 }
9792
9793 /// Sets the value of [certs][crate::model::InstancesListEntraIdCertificatesResponse::certs].
9794 ///
9795 /// # Example
9796 /// ```ignore,no_run
9797 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9798 /// use google_cloud_sql_v1::model::SslCert;
9799 /// let x = InstancesListEntraIdCertificatesResponse::new()
9800 /// .set_certs([
9801 /// SslCert::default()/* use setters */,
9802 /// SslCert::default()/* use (different) setters */,
9803 /// ]);
9804 /// ```
9805 pub fn set_certs<T, V>(mut self, v: T) -> Self
9806 where
9807 T: std::iter::IntoIterator<Item = V>,
9808 V: std::convert::Into<crate::model::SslCert>,
9809 {
9810 use std::iter::Iterator;
9811 self.certs = v.into_iter().map(|i| i.into()).collect();
9812 self
9813 }
9814
9815 /// Sets the value of [active_version][crate::model::InstancesListEntraIdCertificatesResponse::active_version].
9816 ///
9817 /// # Example
9818 /// ```ignore,no_run
9819 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9820 /// let x = InstancesListEntraIdCertificatesResponse::new().set_active_version("example");
9821 /// ```
9822 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9823 self.active_version = v.into();
9824 self
9825 }
9826
9827 /// Sets the value of [kind][crate::model::InstancesListEntraIdCertificatesResponse::kind].
9828 ///
9829 /// # Example
9830 /// ```ignore,no_run
9831 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
9832 /// let x = InstancesListEntraIdCertificatesResponse::new().set_kind("example");
9833 /// ```
9834 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9835 self.kind = v.into();
9836 self
9837 }
9838}
9839
9840impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
9841 fn typename() -> &'static str {
9842 "type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
9843 }
9844}
9845
9846/// Database instance restore backup request.
9847#[derive(Clone, Default, PartialEq)]
9848#[non_exhaustive]
9849pub struct InstancesRestoreBackupRequest {
9850 /// Parameters required to perform the restore backup operation.
9851 pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
9852
9853 /// The name of the backup that's used to restore a Cloud SQL instance:
9854 /// Format: projects/{project-id}/backups/{backup-uid}. Only one of
9855 /// restore_backup_context, backup, backupdr_backup can be passed to the input.
9856 pub backup: std::string::String,
9857
9858 /// The name of the backup that's used to restore a Cloud SQL instance:
9859 /// Format:
9860 /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
9861 /// Only one of restore_backup_context, backup, backupdr_backup can be
9862 /// passed to the input.
9863 pub backupdr_backup: std::string::String,
9864
9865 /// Optional. By using this parameter, Cloud SQL overrides any instance
9866 /// settings stored in the backup you are restoring from. You can't change the
9867 /// instance's major database version and you can only increase the disk size.
9868 /// You can use this field to restore new instances only. This field is not
9869 /// applicable for restore to existing instances.
9870 pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
9871
9872 /// Optional. This field has the same purpose as restore_instance_settings,
9873 /// changes any instance settings stored in the backup you are restoring from.
9874 /// With the difference that these fields are cleared in the settings.
9875 pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
9876
9877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9878}
9879
9880impl InstancesRestoreBackupRequest {
9881 /// Creates a new default instance.
9882 pub fn new() -> Self {
9883 std::default::Default::default()
9884 }
9885
9886 /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9887 ///
9888 /// # Example
9889 /// ```ignore,no_run
9890 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9891 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9892 /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
9893 /// ```
9894 pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
9895 where
9896 T: std::convert::Into<crate::model::RestoreBackupContext>,
9897 {
9898 self.restore_backup_context = std::option::Option::Some(v.into());
9899 self
9900 }
9901
9902 /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9903 ///
9904 /// # Example
9905 /// ```ignore,no_run
9906 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9907 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9908 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
9909 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
9910 /// ```
9911 pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
9912 where
9913 T: std::convert::Into<crate::model::RestoreBackupContext>,
9914 {
9915 self.restore_backup_context = v.map(|x| x.into());
9916 self
9917 }
9918
9919 /// Sets the value of [backup][crate::model::InstancesRestoreBackupRequest::backup].
9920 ///
9921 /// # Example
9922 /// ```ignore,no_run
9923 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9924 /// # let project_id = "project_id";
9925 /// # let backup_id = "backup_id";
9926 /// let x = InstancesRestoreBackupRequest::new().set_backup(format!("projects/{project_id}/backups/{backup_id}"));
9927 /// ```
9928 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9929 self.backup = v.into();
9930 self
9931 }
9932
9933 /// Sets the value of [backupdr_backup][crate::model::InstancesRestoreBackupRequest::backupdr_backup].
9934 ///
9935 /// # Example
9936 /// ```ignore,no_run
9937 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9938 /// let x = InstancesRestoreBackupRequest::new().set_backupdr_backup("example");
9939 /// ```
9940 pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9941 self.backupdr_backup = v.into();
9942 self
9943 }
9944
9945 /// Sets the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9946 ///
9947 /// # Example
9948 /// ```ignore,no_run
9949 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9950 /// use google_cloud_sql_v1::model::DatabaseInstance;
9951 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_settings(DatabaseInstance::default()/* use setters */);
9952 /// ```
9953 pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
9954 where
9955 T: std::convert::Into<crate::model::DatabaseInstance>,
9956 {
9957 self.restore_instance_settings = std::option::Option::Some(v.into());
9958 self
9959 }
9960
9961 /// Sets or clears the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9962 ///
9963 /// # Example
9964 /// ```ignore,no_run
9965 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9966 /// use google_cloud_sql_v1::model::DatabaseInstance;
9967 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(Some(DatabaseInstance::default()/* use setters */));
9968 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(None::<DatabaseInstance>);
9969 /// ```
9970 pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
9971 where
9972 T: std::convert::Into<crate::model::DatabaseInstance>,
9973 {
9974 self.restore_instance_settings = v.map(|x| x.into());
9975 self
9976 }
9977
9978 /// Sets the value of [restore_instance_clear_overrides_field_names][crate::model::InstancesRestoreBackupRequest::restore_instance_clear_overrides_field_names].
9979 ///
9980 /// # Example
9981 /// ```ignore,no_run
9982 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9983 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_clear_overrides_field_names(["a", "b", "c"]);
9984 /// ```
9985 pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
9986 where
9987 T: std::iter::IntoIterator<Item = V>,
9988 V: std::convert::Into<std::string::String>,
9989 {
9990 use std::iter::Iterator;
9991 self.restore_instance_clear_overrides_field_names =
9992 v.into_iter().map(|i| i.into()).collect();
9993 self
9994 }
9995}
9996
9997impl wkt::message::Message for InstancesRestoreBackupRequest {
9998 fn typename() -> &'static str {
9999 "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
10000 }
10001}
10002
10003/// Rotate server CA request.
10004#[derive(Clone, Default, PartialEq)]
10005#[non_exhaustive]
10006pub struct InstancesRotateServerCaRequest {
10007 /// Contains details about the rotate server CA operation.
10008 pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
10009
10010 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10011}
10012
10013impl InstancesRotateServerCaRequest {
10014 /// Creates a new default instance.
10015 pub fn new() -> Self {
10016 std::default::Default::default()
10017 }
10018
10019 /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
10020 ///
10021 /// # Example
10022 /// ```ignore,no_run
10023 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
10024 /// use google_cloud_sql_v1::model::RotateServerCaContext;
10025 /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
10026 /// ```
10027 pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
10028 where
10029 T: std::convert::Into<crate::model::RotateServerCaContext>,
10030 {
10031 self.rotate_server_ca_context = std::option::Option::Some(v.into());
10032 self
10033 }
10034
10035 /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
10036 ///
10037 /// # Example
10038 /// ```ignore,no_run
10039 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
10040 /// use google_cloud_sql_v1::model::RotateServerCaContext;
10041 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
10042 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
10043 /// ```
10044 pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
10045 where
10046 T: std::convert::Into<crate::model::RotateServerCaContext>,
10047 {
10048 self.rotate_server_ca_context = v.map(|x| x.into());
10049 self
10050 }
10051}
10052
10053impl wkt::message::Message for InstancesRotateServerCaRequest {
10054 fn typename() -> &'static str {
10055 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
10056 }
10057}
10058
10059/// Rotate server certificate request.
10060#[derive(Clone, Default, PartialEq)]
10061#[non_exhaustive]
10062pub struct InstancesRotateServerCertificateRequest {
10063 /// Optional. Contains details about the rotate server certificate operation.
10064 pub rotate_server_certificate_context:
10065 std::option::Option<crate::model::RotateServerCertificateContext>,
10066
10067 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10068}
10069
10070impl InstancesRotateServerCertificateRequest {
10071 /// Creates a new default instance.
10072 pub fn new() -> Self {
10073 std::default::Default::default()
10074 }
10075
10076 /// Sets the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
10077 ///
10078 /// # Example
10079 /// ```ignore,no_run
10080 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
10081 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
10082 /// let x = InstancesRotateServerCertificateRequest::new().set_rotate_server_certificate_context(RotateServerCertificateContext::default()/* use setters */);
10083 /// ```
10084 pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
10085 where
10086 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
10087 {
10088 self.rotate_server_certificate_context = std::option::Option::Some(v.into());
10089 self
10090 }
10091
10092 /// Sets or clears the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
10093 ///
10094 /// # Example
10095 /// ```ignore,no_run
10096 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
10097 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
10098 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(Some(RotateServerCertificateContext::default()/* use setters */));
10099 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(None::<RotateServerCertificateContext>);
10100 /// ```
10101 pub fn set_or_clear_rotate_server_certificate_context<T>(
10102 mut self,
10103 v: std::option::Option<T>,
10104 ) -> Self
10105 where
10106 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
10107 {
10108 self.rotate_server_certificate_context = v.map(|x| x.into());
10109 self
10110 }
10111}
10112
10113impl wkt::message::Message for InstancesRotateServerCertificateRequest {
10114 fn typename() -> &'static str {
10115 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
10116 }
10117}
10118
10119/// Rotate Entra ID certificate request.
10120#[derive(Clone, Default, PartialEq)]
10121#[non_exhaustive]
10122pub struct InstancesRotateEntraIdCertificateRequest {
10123 /// Optional. Contains details about the rotate server certificate operation.
10124 pub rotate_entra_id_certificate_context:
10125 std::option::Option<crate::model::RotateEntraIdCertificateContext>,
10126
10127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10128}
10129
10130impl InstancesRotateEntraIdCertificateRequest {
10131 /// Creates a new default instance.
10132 pub fn new() -> Self {
10133 std::default::Default::default()
10134 }
10135
10136 /// Sets the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
10137 ///
10138 /// # Example
10139 /// ```ignore,no_run
10140 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
10141 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
10142 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_rotate_entra_id_certificate_context(RotateEntraIdCertificateContext::default()/* use setters */);
10143 /// ```
10144 pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
10145 where
10146 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
10147 {
10148 self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
10149 self
10150 }
10151
10152 /// Sets or clears the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
10153 ///
10154 /// # Example
10155 /// ```ignore,no_run
10156 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
10157 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
10158 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(Some(RotateEntraIdCertificateContext::default()/* use setters */));
10159 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(None::<RotateEntraIdCertificateContext>);
10160 /// ```
10161 pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
10162 mut self,
10163 v: std::option::Option<T>,
10164 ) -> Self
10165 where
10166 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
10167 {
10168 self.rotate_entra_id_certificate_context = v.map(|x| x.into());
10169 self
10170 }
10171}
10172
10173impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
10174 fn typename() -> &'static str {
10175 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
10176 }
10177}
10178
10179/// Instance truncate log request.
10180#[derive(Clone, Default, PartialEq)]
10181#[non_exhaustive]
10182pub struct InstancesTruncateLogRequest {
10183 /// Contains details about the truncate log operation.
10184 pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
10185
10186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10187}
10188
10189impl InstancesTruncateLogRequest {
10190 /// Creates a new default instance.
10191 pub fn new() -> Self {
10192 std::default::Default::default()
10193 }
10194
10195 /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
10196 ///
10197 /// # Example
10198 /// ```ignore,no_run
10199 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
10200 /// use google_cloud_sql_v1::model::TruncateLogContext;
10201 /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
10202 /// ```
10203 pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
10204 where
10205 T: std::convert::Into<crate::model::TruncateLogContext>,
10206 {
10207 self.truncate_log_context = std::option::Option::Some(v.into());
10208 self
10209 }
10210
10211 /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
10212 ///
10213 /// # Example
10214 /// ```ignore,no_run
10215 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
10216 /// use google_cloud_sql_v1::model::TruncateLogContext;
10217 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
10218 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
10219 /// ```
10220 pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
10221 where
10222 T: std::convert::Into<crate::model::TruncateLogContext>,
10223 {
10224 self.truncate_log_context = v.map(|x| x.into());
10225 self
10226 }
10227}
10228
10229impl wkt::message::Message for InstancesTruncateLogRequest {
10230 fn typename() -> &'static str {
10231 "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
10232 }
10233}
10234
10235/// Request to acquire a lease for SSRS.
10236#[derive(Clone, Default, PartialEq)]
10237#[non_exhaustive]
10238pub struct InstancesAcquireSsrsLeaseRequest {
10239 /// Contains details about the acquire SSRS lease operation.
10240 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
10241
10242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10243}
10244
10245impl InstancesAcquireSsrsLeaseRequest {
10246 /// Creates a new default instance.
10247 pub fn new() -> Self {
10248 std::default::Default::default()
10249 }
10250
10251 /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
10252 ///
10253 /// # Example
10254 /// ```ignore,no_run
10255 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
10256 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
10257 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
10258 /// ```
10259 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
10260 where
10261 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
10262 {
10263 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
10264 self
10265 }
10266
10267 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
10268 ///
10269 /// # Example
10270 /// ```ignore,no_run
10271 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
10272 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
10273 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
10274 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
10275 /// ```
10276 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
10277 where
10278 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
10279 {
10280 self.acquire_ssrs_lease_context = v.map(|x| x.into());
10281 self
10282 }
10283}
10284
10285impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
10286 fn typename() -> &'static str {
10287 "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
10288 }
10289}
10290
10291/// Request for Pre-checks for MVU
10292#[derive(Clone, Default, PartialEq)]
10293#[non_exhaustive]
10294pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
10295 /// Required. Cloud SQL instance ID. This does not include the project ID.
10296 pub instance: std::string::String,
10297
10298 /// Required. Project ID of the project that contains the instance.
10299 pub project: std::string::String,
10300
10301 /// Required. The context for request to perform the pre-check major version
10302 /// upgrade operation.
10303 pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
10304
10305 /// Optional. Region of the Cloud SQL instance.
10306 pub location: std::string::String,
10307
10308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10309}
10310
10311impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
10312 /// Creates a new default instance.
10313 pub fn new() -> Self {
10314 std::default::Default::default()
10315 }
10316
10317 /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
10318 ///
10319 /// # Example
10320 /// ```ignore,no_run
10321 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
10322 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_instance("example");
10323 /// ```
10324 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10325 self.instance = v.into();
10326 self
10327 }
10328
10329 /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
10330 ///
10331 /// # Example
10332 /// ```ignore,no_run
10333 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
10334 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_project("example");
10335 /// ```
10336 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10337 self.project = v.into();
10338 self
10339 }
10340
10341 /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
10342 ///
10343 /// # Example
10344 /// ```ignore,no_run
10345 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
10346 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
10347 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_body(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */);
10348 /// ```
10349 pub fn set_body<T>(mut self, v: T) -> Self
10350 where
10351 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
10352 {
10353 self.body = std::option::Option::Some(v.into());
10354 self
10355 }
10356
10357 /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
10358 ///
10359 /// # Example
10360 /// ```ignore,no_run
10361 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
10362 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
10363 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(Some(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */));
10364 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(None::<InstancesPreCheckMajorVersionUpgradeRequest>);
10365 /// ```
10366 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
10367 where
10368 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
10369 {
10370 self.body = v.map(|x| x.into());
10371 self
10372 }
10373
10374 /// Sets the value of [location][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::location].
10375 ///
10376 /// # Example
10377 /// ```ignore,no_run
10378 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
10379 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_location("example");
10380 /// ```
10381 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10382 self.location = v.into();
10383 self
10384 }
10385}
10386
10387impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
10388 fn typename() -> &'static str {
10389 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
10390 }
10391}
10392
10393/// Instance verify external sync settings response.
10394#[derive(Clone, Default, PartialEq)]
10395#[non_exhaustive]
10396pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
10397 /// This is always `sql#migrationSettingErrorList`.
10398 pub kind: std::string::String,
10399
10400 /// List of migration violations.
10401 pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
10402
10403 /// List of migration warnings.
10404 pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
10405
10406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10407}
10408
10409impl SqlInstancesVerifyExternalSyncSettingsResponse {
10410 /// Creates a new default instance.
10411 pub fn new() -> Self {
10412 std::default::Default::default()
10413 }
10414
10415 /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
10416 ///
10417 /// # Example
10418 /// ```ignore,no_run
10419 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
10420 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new().set_kind("example");
10421 /// ```
10422 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10423 self.kind = v.into();
10424 self
10425 }
10426
10427 /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
10428 ///
10429 /// # Example
10430 /// ```ignore,no_run
10431 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
10432 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
10433 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
10434 /// .set_errors([
10435 /// SqlExternalSyncSettingError::default()/* use setters */,
10436 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
10437 /// ]);
10438 /// ```
10439 pub fn set_errors<T, V>(mut self, v: T) -> Self
10440 where
10441 T: std::iter::IntoIterator<Item = V>,
10442 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
10443 {
10444 use std::iter::Iterator;
10445 self.errors = v.into_iter().map(|i| i.into()).collect();
10446 self
10447 }
10448
10449 /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
10450 ///
10451 /// # Example
10452 /// ```ignore,no_run
10453 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
10454 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
10455 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
10456 /// .set_warnings([
10457 /// SqlExternalSyncSettingError::default()/* use setters */,
10458 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
10459 /// ]);
10460 /// ```
10461 pub fn set_warnings<T, V>(mut self, v: T) -> Self
10462 where
10463 T: std::iter::IntoIterator<Item = V>,
10464 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
10465 {
10466 use std::iter::Iterator;
10467 self.warnings = v.into_iter().map(|i| i.into()).collect();
10468 self
10469 }
10470}
10471
10472impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
10473 fn typename() -> &'static str {
10474 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
10475 }
10476}
10477
10478/// Instance get disk shrink config response.
10479#[derive(Clone, Default, PartialEq)]
10480#[non_exhaustive]
10481pub struct SqlInstancesGetDiskShrinkConfigResponse {
10482 /// This is always `sql#getDiskShrinkConfig`.
10483 pub kind: std::string::String,
10484
10485 /// The minimum size to which a disk can be shrunk in GigaBytes.
10486 pub minimal_target_size_gb: i64,
10487
10488 /// Additional message to customers.
10489 pub message: std::string::String,
10490
10491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10492}
10493
10494impl SqlInstancesGetDiskShrinkConfigResponse {
10495 /// Creates a new default instance.
10496 pub fn new() -> Self {
10497 std::default::Default::default()
10498 }
10499
10500 /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
10501 ///
10502 /// # Example
10503 /// ```ignore,no_run
10504 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
10505 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
10506 /// ```
10507 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10508 self.kind = v.into();
10509 self
10510 }
10511
10512 /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
10513 ///
10514 /// # Example
10515 /// ```ignore,no_run
10516 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
10517 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
10518 /// ```
10519 pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10520 self.minimal_target_size_gb = v.into();
10521 self
10522 }
10523
10524 /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
10525 ///
10526 /// # Example
10527 /// ```ignore,no_run
10528 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
10529 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
10530 /// ```
10531 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10532 self.message = v.into();
10533 self
10534 }
10535}
10536
10537impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
10538 fn typename() -> &'static str {
10539 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
10540 }
10541}
10542
10543/// Instance get latest recovery time request.
10544#[derive(Clone, Default, PartialEq)]
10545#[non_exhaustive]
10546pub struct SqlInstancesGetLatestRecoveryTimeRequest {
10547 /// Cloud SQL instance ID. This does not include the project ID.
10548 pub instance: std::string::String,
10549
10550 /// Project ID of the project that contains the instance.
10551 pub project: std::string::String,
10552
10553 /// The timestamp used to identify the time when the source instance is
10554 /// deleted. If this instance is deleted, then you must set the timestamp.
10555 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
10556
10557 /// Optional. Region of the Cloud SQL instance.
10558 pub location: std::string::String,
10559
10560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10561}
10562
10563impl SqlInstancesGetLatestRecoveryTimeRequest {
10564 /// Creates a new default instance.
10565 pub fn new() -> Self {
10566 std::default::Default::default()
10567 }
10568
10569 /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
10570 ///
10571 /// # Example
10572 /// ```ignore,no_run
10573 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
10574 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
10575 /// ```
10576 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10577 self.instance = v.into();
10578 self
10579 }
10580
10581 /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
10582 ///
10583 /// # Example
10584 /// ```ignore,no_run
10585 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
10586 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
10587 /// ```
10588 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10589 self.project = v.into();
10590 self
10591 }
10592
10593 /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
10594 ///
10595 /// # Example
10596 /// ```ignore,no_run
10597 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
10598 /// use wkt::Timestamp;
10599 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
10600 /// ```
10601 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
10602 where
10603 T: std::convert::Into<wkt::Timestamp>,
10604 {
10605 self.source_instance_deletion_time = std::option::Option::Some(v.into());
10606 self
10607 }
10608
10609 /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
10610 ///
10611 /// # Example
10612 /// ```ignore,no_run
10613 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
10614 /// use wkt::Timestamp;
10615 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
10616 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
10617 /// ```
10618 pub fn set_or_clear_source_instance_deletion_time<T>(
10619 mut self,
10620 v: std::option::Option<T>,
10621 ) -> Self
10622 where
10623 T: std::convert::Into<wkt::Timestamp>,
10624 {
10625 self.source_instance_deletion_time = v.map(|x| x.into());
10626 self
10627 }
10628
10629 /// Sets the value of [location][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::location].
10630 ///
10631 /// # Example
10632 /// ```ignore,no_run
10633 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
10634 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_location("example");
10635 /// ```
10636 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10637 self.location = v.into();
10638 self
10639 }
10640}
10641
10642impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
10643 fn typename() -> &'static str {
10644 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
10645 }
10646}
10647
10648/// Instance get latest recovery time response.
10649#[derive(Clone, Default, PartialEq)]
10650#[non_exhaustive]
10651pub struct SqlInstancesGetLatestRecoveryTimeResponse {
10652 /// This is always `sql#getLatestRecoveryTime`.
10653 pub kind: std::string::String,
10654
10655 /// Timestamp, identifies the latest recovery time of the source instance.
10656 pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
10657
10658 /// Timestamp, identifies the earliest recovery time of the source instance.
10659 pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
10660
10661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10662}
10663
10664impl SqlInstancesGetLatestRecoveryTimeResponse {
10665 /// Creates a new default instance.
10666 pub fn new() -> Self {
10667 std::default::Default::default()
10668 }
10669
10670 /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
10671 ///
10672 /// # Example
10673 /// ```ignore,no_run
10674 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10675 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
10676 /// ```
10677 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10678 self.kind = v.into();
10679 self
10680 }
10681
10682 /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
10683 ///
10684 /// # Example
10685 /// ```ignore,no_run
10686 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10687 /// use wkt::Timestamp;
10688 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
10689 /// ```
10690 pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
10691 where
10692 T: std::convert::Into<wkt::Timestamp>,
10693 {
10694 self.latest_recovery_time = std::option::Option::Some(v.into());
10695 self
10696 }
10697
10698 /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
10699 ///
10700 /// # Example
10701 /// ```ignore,no_run
10702 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10703 /// use wkt::Timestamp;
10704 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
10705 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
10706 /// ```
10707 pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
10708 where
10709 T: std::convert::Into<wkt::Timestamp>,
10710 {
10711 self.latest_recovery_time = v.map(|x| x.into());
10712 self
10713 }
10714
10715 /// Sets the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
10716 ///
10717 /// # Example
10718 /// ```ignore,no_run
10719 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10720 /// use wkt::Timestamp;
10721 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_earliest_recovery_time(Timestamp::default()/* use setters */);
10722 /// ```
10723 pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
10724 where
10725 T: std::convert::Into<wkt::Timestamp>,
10726 {
10727 self.earliest_recovery_time = std::option::Option::Some(v.into());
10728 self
10729 }
10730
10731 /// Sets or clears the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
10732 ///
10733 /// # Example
10734 /// ```ignore,no_run
10735 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
10736 /// use wkt::Timestamp;
10737 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(Some(Timestamp::default()/* use setters */));
10738 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(None::<Timestamp>);
10739 /// ```
10740 pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
10741 where
10742 T: std::convert::Into<wkt::Timestamp>,
10743 {
10744 self.earliest_recovery_time = v.map(|x| x.into());
10745 self
10746 }
10747}
10748
10749impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
10750 fn typename() -> &'static str {
10751 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
10752 }
10753}
10754
10755/// Database instance clone context.
10756#[derive(Clone, Default, PartialEq)]
10757#[non_exhaustive]
10758pub struct CloneContext {
10759 /// This is always `sql#cloneContext`.
10760 pub kind: std::string::String,
10761
10762 /// Reserved for future use.
10763 pub pitr_timestamp_ms: i64,
10764
10765 /// Required. Name of the Cloud SQL instance to be created as a clone.
10766 pub destination_instance_name: std::string::String,
10767
10768 /// Binary log coordinates, if specified, identify the position up to which the
10769 /// source instance is cloned. If not specified, the source instance is
10770 /// cloned up to the most recent binary log coordinates.
10771 pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
10772
10773 /// Timestamp, if specified, identifies the time to which the source instance
10774 /// is cloned.
10775 pub point_in_time: std::option::Option<wkt::Timestamp>,
10776
10777 /// The name of the allocated ip range for the private ip Cloud SQL instance.
10778 /// For example: "google-managed-services-default". If set, the cloned instance
10779 /// ip will be created in the allocated range. The range name must comply with
10780 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
10781 /// must be 1-63 characters long and match the regular expression
10782 /// [a-z]([-a-z0-9]*[a-z0-9])?.
10783 /// Reserved for future use.
10784 pub allocated_ip_range: std::string::String,
10785
10786 /// (SQL Server only) Clone only the specified databases from the source
10787 /// instance. Clone all databases if empty.
10788 pub database_names: std::vec::Vec<std::string::String>,
10789
10790 /// Optional. Copy clone and point-in-time recovery clone of an instance to the
10791 /// specified zone. If no zone is specified, clone to the same primary zone as
10792 /// the source instance. This field applies to all DB types.
10793 pub preferred_zone: std::option::Option<std::string::String>,
10794
10795 /// Optional. Copy clone and point-in-time recovery clone of a regional
10796 /// instance in the specified zones. If not specified, clone to the same
10797 /// secondary zone as the source instance. This value cannot be the same as the
10798 /// preferred_zone field. This field applies to all DB types.
10799 pub preferred_secondary_zone: std::option::Option<std::string::String>,
10800
10801 /// The timestamp used to identify the time when the source instance is
10802 /// deleted. If this instance is deleted, then you must set the timestamp.
10803 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
10804
10805 /// Optional. The project ID of the destination project where the cloned
10806 /// instance will be created. To perform a cross-project clone, this field is
10807 /// required. If not specified, the clone is created in the same project
10808 /// as the source instance.
10809 pub destination_project: std::option::Option<std::string::String>,
10810
10811 /// Optional. The fully qualified URI of the VPC network to which the cloned
10812 /// instance will be connected via private services access for private IP. For
10813 /// example:`projects/my-network-project/global/networks/my-network`. This
10814 /// field is only required for cross-project cloning.
10815 pub destination_network: std::option::Option<std::string::String>,
10816
10817 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10818}
10819
10820impl CloneContext {
10821 /// Creates a new default instance.
10822 pub fn new() -> Self {
10823 std::default::Default::default()
10824 }
10825
10826 /// Sets the value of [kind][crate::model::CloneContext::kind].
10827 ///
10828 /// # Example
10829 /// ```ignore,no_run
10830 /// # use google_cloud_sql_v1::model::CloneContext;
10831 /// let x = CloneContext::new().set_kind("example");
10832 /// ```
10833 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10834 self.kind = v.into();
10835 self
10836 }
10837
10838 /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
10839 ///
10840 /// # Example
10841 /// ```ignore,no_run
10842 /// # use google_cloud_sql_v1::model::CloneContext;
10843 /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
10844 /// ```
10845 pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10846 self.pitr_timestamp_ms = v.into();
10847 self
10848 }
10849
10850 /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
10851 ///
10852 /// # Example
10853 /// ```ignore,no_run
10854 /// # use google_cloud_sql_v1::model::CloneContext;
10855 /// let x = CloneContext::new().set_destination_instance_name("example");
10856 /// ```
10857 pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
10858 mut self,
10859 v: T,
10860 ) -> Self {
10861 self.destination_instance_name = v.into();
10862 self
10863 }
10864
10865 /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10866 ///
10867 /// # Example
10868 /// ```ignore,no_run
10869 /// # use google_cloud_sql_v1::model::CloneContext;
10870 /// use google_cloud_sql_v1::model::BinLogCoordinates;
10871 /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
10872 /// ```
10873 pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
10874 where
10875 T: std::convert::Into<crate::model::BinLogCoordinates>,
10876 {
10877 self.bin_log_coordinates = std::option::Option::Some(v.into());
10878 self
10879 }
10880
10881 /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
10882 ///
10883 /// # Example
10884 /// ```ignore,no_run
10885 /// # use google_cloud_sql_v1::model::CloneContext;
10886 /// use google_cloud_sql_v1::model::BinLogCoordinates;
10887 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
10888 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
10889 /// ```
10890 pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
10891 where
10892 T: std::convert::Into<crate::model::BinLogCoordinates>,
10893 {
10894 self.bin_log_coordinates = v.map(|x| x.into());
10895 self
10896 }
10897
10898 /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
10899 ///
10900 /// # Example
10901 /// ```ignore,no_run
10902 /// # use google_cloud_sql_v1::model::CloneContext;
10903 /// use wkt::Timestamp;
10904 /// let x = CloneContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10905 /// ```
10906 pub fn set_point_in_time<T>(mut self, v: T) -> Self
10907 where
10908 T: std::convert::Into<wkt::Timestamp>,
10909 {
10910 self.point_in_time = std::option::Option::Some(v.into());
10911 self
10912 }
10913
10914 /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
10915 ///
10916 /// # Example
10917 /// ```ignore,no_run
10918 /// # use google_cloud_sql_v1::model::CloneContext;
10919 /// use wkt::Timestamp;
10920 /// let x = CloneContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10921 /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10922 /// ```
10923 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10924 where
10925 T: std::convert::Into<wkt::Timestamp>,
10926 {
10927 self.point_in_time = v.map(|x| x.into());
10928 self
10929 }
10930
10931 /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
10932 ///
10933 /// # Example
10934 /// ```ignore,no_run
10935 /// # use google_cloud_sql_v1::model::CloneContext;
10936 /// let x = CloneContext::new().set_allocated_ip_range("example");
10937 /// ```
10938 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10939 mut self,
10940 v: T,
10941 ) -> Self {
10942 self.allocated_ip_range = v.into();
10943 self
10944 }
10945
10946 /// Sets the value of [database_names][crate::model::CloneContext::database_names].
10947 ///
10948 /// # Example
10949 /// ```ignore,no_run
10950 /// # use google_cloud_sql_v1::model::CloneContext;
10951 /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
10952 /// ```
10953 pub fn set_database_names<T, V>(mut self, v: T) -> Self
10954 where
10955 T: std::iter::IntoIterator<Item = V>,
10956 V: std::convert::Into<std::string::String>,
10957 {
10958 use std::iter::Iterator;
10959 self.database_names = v.into_iter().map(|i| i.into()).collect();
10960 self
10961 }
10962
10963 /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10964 ///
10965 /// # Example
10966 /// ```ignore,no_run
10967 /// # use google_cloud_sql_v1::model::CloneContext;
10968 /// let x = CloneContext::new().set_preferred_zone("example");
10969 /// ```
10970 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10971 where
10972 T: std::convert::Into<std::string::String>,
10973 {
10974 self.preferred_zone = std::option::Option::Some(v.into());
10975 self
10976 }
10977
10978 /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10979 ///
10980 /// # Example
10981 /// ```ignore,no_run
10982 /// # use google_cloud_sql_v1::model::CloneContext;
10983 /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
10984 /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
10985 /// ```
10986 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10987 where
10988 T: std::convert::Into<std::string::String>,
10989 {
10990 self.preferred_zone = v.map(|x| x.into());
10991 self
10992 }
10993
10994 /// Sets the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10995 ///
10996 /// # Example
10997 /// ```ignore,no_run
10998 /// # use google_cloud_sql_v1::model::CloneContext;
10999 /// let x = CloneContext::new().set_preferred_secondary_zone("example");
11000 /// ```
11001 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
11002 where
11003 T: std::convert::Into<std::string::String>,
11004 {
11005 self.preferred_secondary_zone = std::option::Option::Some(v.into());
11006 self
11007 }
11008
11009 /// Sets or clears the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
11010 ///
11011 /// # Example
11012 /// ```ignore,no_run
11013 /// # use google_cloud_sql_v1::model::CloneContext;
11014 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
11015 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
11016 /// ```
11017 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
11018 where
11019 T: std::convert::Into<std::string::String>,
11020 {
11021 self.preferred_secondary_zone = v.map(|x| x.into());
11022 self
11023 }
11024
11025 /// Sets the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
11026 ///
11027 /// # Example
11028 /// ```ignore,no_run
11029 /// # use google_cloud_sql_v1::model::CloneContext;
11030 /// use wkt::Timestamp;
11031 /// let x = CloneContext::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
11032 /// ```
11033 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
11034 where
11035 T: std::convert::Into<wkt::Timestamp>,
11036 {
11037 self.source_instance_deletion_time = std::option::Option::Some(v.into());
11038 self
11039 }
11040
11041 /// Sets or clears the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
11042 ///
11043 /// # Example
11044 /// ```ignore,no_run
11045 /// # use google_cloud_sql_v1::model::CloneContext;
11046 /// use wkt::Timestamp;
11047 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
11048 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
11049 /// ```
11050 pub fn set_or_clear_source_instance_deletion_time<T>(
11051 mut self,
11052 v: std::option::Option<T>,
11053 ) -> Self
11054 where
11055 T: std::convert::Into<wkt::Timestamp>,
11056 {
11057 self.source_instance_deletion_time = v.map(|x| x.into());
11058 self
11059 }
11060
11061 /// Sets the value of [destination_project][crate::model::CloneContext::destination_project].
11062 ///
11063 /// # Example
11064 /// ```ignore,no_run
11065 /// # use google_cloud_sql_v1::model::CloneContext;
11066 /// let x = CloneContext::new().set_destination_project("example");
11067 /// ```
11068 pub fn set_destination_project<T>(mut self, v: T) -> Self
11069 where
11070 T: std::convert::Into<std::string::String>,
11071 {
11072 self.destination_project = std::option::Option::Some(v.into());
11073 self
11074 }
11075
11076 /// Sets or clears the value of [destination_project][crate::model::CloneContext::destination_project].
11077 ///
11078 /// # Example
11079 /// ```ignore,no_run
11080 /// # use google_cloud_sql_v1::model::CloneContext;
11081 /// let x = CloneContext::new().set_or_clear_destination_project(Some("example"));
11082 /// let x = CloneContext::new().set_or_clear_destination_project(None::<String>);
11083 /// ```
11084 pub fn set_or_clear_destination_project<T>(mut self, v: std::option::Option<T>) -> Self
11085 where
11086 T: std::convert::Into<std::string::String>,
11087 {
11088 self.destination_project = v.map(|x| x.into());
11089 self
11090 }
11091
11092 /// Sets the value of [destination_network][crate::model::CloneContext::destination_network].
11093 ///
11094 /// # Example
11095 /// ```ignore,no_run
11096 /// # use google_cloud_sql_v1::model::CloneContext;
11097 /// let x = CloneContext::new().set_destination_network("example");
11098 /// ```
11099 pub fn set_destination_network<T>(mut self, v: T) -> Self
11100 where
11101 T: std::convert::Into<std::string::String>,
11102 {
11103 self.destination_network = std::option::Option::Some(v.into());
11104 self
11105 }
11106
11107 /// Sets or clears the value of [destination_network][crate::model::CloneContext::destination_network].
11108 ///
11109 /// # Example
11110 /// ```ignore,no_run
11111 /// # use google_cloud_sql_v1::model::CloneContext;
11112 /// let x = CloneContext::new().set_or_clear_destination_network(Some("example"));
11113 /// let x = CloneContext::new().set_or_clear_destination_network(None::<String>);
11114 /// ```
11115 pub fn set_or_clear_destination_network<T>(mut self, v: std::option::Option<T>) -> Self
11116 where
11117 T: std::convert::Into<std::string::String>,
11118 {
11119 self.destination_network = v.map(|x| x.into());
11120 self
11121 }
11122}
11123
11124impl wkt::message::Message for CloneContext {
11125 fn typename() -> &'static str {
11126 "type.googleapis.com/google.cloud.sql.v1.CloneContext"
11127 }
11128}
11129
11130/// The context to perform a point-in-time recovery of an instance managed by
11131/// Backup and Disaster Recovery (DR) Service.
11132#[derive(Clone, Default, PartialEq)]
11133#[non_exhaustive]
11134pub struct PointInTimeRestoreContext {
11135 /// The Backup and Disaster Recovery (DR) Service Datasource URI.
11136 /// Format:
11137 /// projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
11138 pub datasource: std::option::Option<std::string::String>,
11139
11140 /// Required. The date and time to which you want to restore the instance.
11141 pub point_in_time: std::option::Option<wkt::Timestamp>,
11142
11143 /// Target instance name.
11144 pub target_instance: std::option::Option<std::string::String>,
11145
11146 /// Optional. The resource link for the VPC network from which the Cloud SQL
11147 /// instance is accessible for private IP. For example,
11148 /// `/projects/myProject/global/networks/default`.
11149 pub private_network: std::option::Option<std::string::String>,
11150
11151 /// Optional. The name of the allocated IP range for the internal IP Cloud SQL
11152 /// instance. For example: "google-managed-services-default". If you set this,
11153 /// then Cloud SQL creates the IP address for the cloned instance in the
11154 /// allocated range. This range must comply with [RFC
11155 /// 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
11156 /// name must be 1-63 characters long and match the regular expression
11157 /// [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
11158 pub allocated_ip_range: std::option::Option<std::string::String>,
11159
11160 /// Optional. Point-in-time recovery of an instance to the specified zone. If
11161 /// no zone is specified, then clone to the same primary zone as the source
11162 /// instance.
11163 pub preferred_zone: std::option::Option<std::string::String>,
11164
11165 /// Optional. Point-in-time recovery of a regional instance in the specified
11166 /// zones. If not specified, clone to the same secondary zone as the source
11167 /// instance. This value cannot be the same as the preferred_zone field.
11168 pub preferred_secondary_zone: std::option::Option<std::string::String>,
11169
11170 /// Optional. Specifies the instance settings that will be overridden from the
11171 /// source instance. This field is only applicable for cross project PITRs.
11172 pub target_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
11173
11174 /// Optional. Specifies the instance settings that will be cleared from the
11175 /// source instance. This field is only applicable for cross project PITRs.
11176 pub target_instance_clear_settings_field_names: std::vec::Vec<std::string::String>,
11177
11178 /// Optional. The region of the target instance where the datasource will be
11179 /// restored. For example: "us-central1".
11180 pub region: std::option::Option<std::string::String>,
11181
11182 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11183}
11184
11185impl PointInTimeRestoreContext {
11186 /// Creates a new default instance.
11187 pub fn new() -> Self {
11188 std::default::Default::default()
11189 }
11190
11191 /// Sets the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
11192 ///
11193 /// # Example
11194 /// ```ignore,no_run
11195 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11196 /// let x = PointInTimeRestoreContext::new().set_datasource("example");
11197 /// ```
11198 pub fn set_datasource<T>(mut self, v: T) -> Self
11199 where
11200 T: std::convert::Into<std::string::String>,
11201 {
11202 self.datasource = std::option::Option::Some(v.into());
11203 self
11204 }
11205
11206 /// Sets or clears the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
11207 ///
11208 /// # Example
11209 /// ```ignore,no_run
11210 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11211 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(Some("example"));
11212 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(None::<String>);
11213 /// ```
11214 pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
11215 where
11216 T: std::convert::Into<std::string::String>,
11217 {
11218 self.datasource = v.map(|x| x.into());
11219 self
11220 }
11221
11222 /// Sets the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
11223 ///
11224 /// # Example
11225 /// ```ignore,no_run
11226 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11227 /// use wkt::Timestamp;
11228 /// let x = PointInTimeRestoreContext::new().set_point_in_time(Timestamp::default()/* use setters */);
11229 /// ```
11230 pub fn set_point_in_time<T>(mut self, v: T) -> Self
11231 where
11232 T: std::convert::Into<wkt::Timestamp>,
11233 {
11234 self.point_in_time = std::option::Option::Some(v.into());
11235 self
11236 }
11237
11238 /// Sets or clears the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
11239 ///
11240 /// # Example
11241 /// ```ignore,no_run
11242 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11243 /// use wkt::Timestamp;
11244 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
11245 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(None::<Timestamp>);
11246 /// ```
11247 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
11248 where
11249 T: std::convert::Into<wkt::Timestamp>,
11250 {
11251 self.point_in_time = v.map(|x| x.into());
11252 self
11253 }
11254
11255 /// Sets the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
11256 ///
11257 /// # Example
11258 /// ```ignore,no_run
11259 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11260 /// let x = PointInTimeRestoreContext::new().set_target_instance("example");
11261 /// ```
11262 pub fn set_target_instance<T>(mut self, v: T) -> Self
11263 where
11264 T: std::convert::Into<std::string::String>,
11265 {
11266 self.target_instance = std::option::Option::Some(v.into());
11267 self
11268 }
11269
11270 /// Sets or clears the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
11271 ///
11272 /// # Example
11273 /// ```ignore,no_run
11274 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11275 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(Some("example"));
11276 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(None::<String>);
11277 /// ```
11278 pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
11279 where
11280 T: std::convert::Into<std::string::String>,
11281 {
11282 self.target_instance = v.map(|x| x.into());
11283 self
11284 }
11285
11286 /// Sets the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
11287 ///
11288 /// # Example
11289 /// ```ignore,no_run
11290 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11291 /// let x = PointInTimeRestoreContext::new().set_private_network("example");
11292 /// ```
11293 pub fn set_private_network<T>(mut self, v: T) -> Self
11294 where
11295 T: std::convert::Into<std::string::String>,
11296 {
11297 self.private_network = std::option::Option::Some(v.into());
11298 self
11299 }
11300
11301 /// Sets or clears the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
11302 ///
11303 /// # Example
11304 /// ```ignore,no_run
11305 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11306 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(Some("example"));
11307 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(None::<String>);
11308 /// ```
11309 pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
11310 where
11311 T: std::convert::Into<std::string::String>,
11312 {
11313 self.private_network = v.map(|x| x.into());
11314 self
11315 }
11316
11317 /// Sets the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
11318 ///
11319 /// # Example
11320 /// ```ignore,no_run
11321 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11322 /// let x = PointInTimeRestoreContext::new().set_allocated_ip_range("example");
11323 /// ```
11324 pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
11325 where
11326 T: std::convert::Into<std::string::String>,
11327 {
11328 self.allocated_ip_range = std::option::Option::Some(v.into());
11329 self
11330 }
11331
11332 /// Sets or clears the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
11333 ///
11334 /// # Example
11335 /// ```ignore,no_run
11336 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11337 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(Some("example"));
11338 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(None::<String>);
11339 /// ```
11340 pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
11341 where
11342 T: std::convert::Into<std::string::String>,
11343 {
11344 self.allocated_ip_range = v.map(|x| x.into());
11345 self
11346 }
11347
11348 /// Sets the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
11349 ///
11350 /// # Example
11351 /// ```ignore,no_run
11352 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11353 /// let x = PointInTimeRestoreContext::new().set_preferred_zone("example");
11354 /// ```
11355 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
11356 where
11357 T: std::convert::Into<std::string::String>,
11358 {
11359 self.preferred_zone = std::option::Option::Some(v.into());
11360 self
11361 }
11362
11363 /// Sets or clears the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
11364 ///
11365 /// # Example
11366 /// ```ignore,no_run
11367 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11368 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(Some("example"));
11369 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(None::<String>);
11370 /// ```
11371 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
11372 where
11373 T: std::convert::Into<std::string::String>,
11374 {
11375 self.preferred_zone = v.map(|x| x.into());
11376 self
11377 }
11378
11379 /// Sets the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
11380 ///
11381 /// # Example
11382 /// ```ignore,no_run
11383 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11384 /// let x = PointInTimeRestoreContext::new().set_preferred_secondary_zone("example");
11385 /// ```
11386 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
11387 where
11388 T: std::convert::Into<std::string::String>,
11389 {
11390 self.preferred_secondary_zone = std::option::Option::Some(v.into());
11391 self
11392 }
11393
11394 /// Sets or clears the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
11395 ///
11396 /// # Example
11397 /// ```ignore,no_run
11398 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11399 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
11400 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
11401 /// ```
11402 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
11403 where
11404 T: std::convert::Into<std::string::String>,
11405 {
11406 self.preferred_secondary_zone = v.map(|x| x.into());
11407 self
11408 }
11409
11410 /// Sets the value of [target_instance_settings][crate::model::PointInTimeRestoreContext::target_instance_settings].
11411 ///
11412 /// # Example
11413 /// ```ignore,no_run
11414 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11415 /// use google_cloud_sql_v1::model::DatabaseInstance;
11416 /// let x = PointInTimeRestoreContext::new().set_target_instance_settings(DatabaseInstance::default()/* use setters */);
11417 /// ```
11418 pub fn set_target_instance_settings<T>(mut self, v: T) -> Self
11419 where
11420 T: std::convert::Into<crate::model::DatabaseInstance>,
11421 {
11422 self.target_instance_settings = std::option::Option::Some(v.into());
11423 self
11424 }
11425
11426 /// Sets or clears the value of [target_instance_settings][crate::model::PointInTimeRestoreContext::target_instance_settings].
11427 ///
11428 /// # Example
11429 /// ```ignore,no_run
11430 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11431 /// use google_cloud_sql_v1::model::DatabaseInstance;
11432 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance_settings(Some(DatabaseInstance::default()/* use setters */));
11433 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance_settings(None::<DatabaseInstance>);
11434 /// ```
11435 pub fn set_or_clear_target_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
11436 where
11437 T: std::convert::Into<crate::model::DatabaseInstance>,
11438 {
11439 self.target_instance_settings = v.map(|x| x.into());
11440 self
11441 }
11442
11443 /// Sets the value of [target_instance_clear_settings_field_names][crate::model::PointInTimeRestoreContext::target_instance_clear_settings_field_names].
11444 ///
11445 /// # Example
11446 /// ```ignore,no_run
11447 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11448 /// let x = PointInTimeRestoreContext::new().set_target_instance_clear_settings_field_names(["a", "b", "c"]);
11449 /// ```
11450 pub fn set_target_instance_clear_settings_field_names<T, V>(mut self, v: T) -> Self
11451 where
11452 T: std::iter::IntoIterator<Item = V>,
11453 V: std::convert::Into<std::string::String>,
11454 {
11455 use std::iter::Iterator;
11456 self.target_instance_clear_settings_field_names = v.into_iter().map(|i| i.into()).collect();
11457 self
11458 }
11459
11460 /// Sets the value of [region][crate::model::PointInTimeRestoreContext::region].
11461 ///
11462 /// # Example
11463 /// ```ignore,no_run
11464 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11465 /// let x = PointInTimeRestoreContext::new().set_region("example");
11466 /// ```
11467 pub fn set_region<T>(mut self, v: T) -> Self
11468 where
11469 T: std::convert::Into<std::string::String>,
11470 {
11471 self.region = std::option::Option::Some(v.into());
11472 self
11473 }
11474
11475 /// Sets or clears the value of [region][crate::model::PointInTimeRestoreContext::region].
11476 ///
11477 /// # Example
11478 /// ```ignore,no_run
11479 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
11480 /// let x = PointInTimeRestoreContext::new().set_or_clear_region(Some("example"));
11481 /// let x = PointInTimeRestoreContext::new().set_or_clear_region(None::<String>);
11482 /// ```
11483 pub fn set_or_clear_region<T>(mut self, v: std::option::Option<T>) -> Self
11484 where
11485 T: std::convert::Into<std::string::String>,
11486 {
11487 self.region = v.map(|x| x.into());
11488 self
11489 }
11490}
11491
11492impl wkt::message::Message for PointInTimeRestoreContext {
11493 fn typename() -> &'static str {
11494 "type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
11495 }
11496}
11497
11498/// Binary log coordinates.
11499#[derive(Clone, Default, PartialEq)]
11500#[non_exhaustive]
11501pub struct BinLogCoordinates {
11502 /// Name of the binary log file for a Cloud SQL instance.
11503 pub bin_log_file_name: std::string::String,
11504
11505 /// Position (offset) within the binary log file.
11506 pub bin_log_position: i64,
11507
11508 /// This is always `sql#binLogCoordinates`.
11509 pub kind: std::string::String,
11510
11511 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11512}
11513
11514impl BinLogCoordinates {
11515 /// Creates a new default instance.
11516 pub fn new() -> Self {
11517 std::default::Default::default()
11518 }
11519
11520 /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
11521 ///
11522 /// # Example
11523 /// ```ignore,no_run
11524 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
11525 /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
11526 /// ```
11527 pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
11528 mut self,
11529 v: T,
11530 ) -> Self {
11531 self.bin_log_file_name = v.into();
11532 self
11533 }
11534
11535 /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
11536 ///
11537 /// # Example
11538 /// ```ignore,no_run
11539 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
11540 /// let x = BinLogCoordinates::new().set_bin_log_position(42);
11541 /// ```
11542 pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11543 self.bin_log_position = v.into();
11544 self
11545 }
11546
11547 /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
11548 ///
11549 /// # Example
11550 /// ```ignore,no_run
11551 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
11552 /// let x = BinLogCoordinates::new().set_kind("example");
11553 /// ```
11554 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11555 self.kind = v.into();
11556 self
11557 }
11558}
11559
11560impl wkt::message::Message for BinLogCoordinates {
11561 fn typename() -> &'static str {
11562 "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
11563 }
11564}
11565
11566/// A Cloud SQL instance resource.
11567#[derive(Clone, Default, PartialEq)]
11568#[non_exhaustive]
11569pub struct DatabaseInstance {
11570 /// This is always `sql#instance`.
11571 pub kind: std::string::String,
11572
11573 /// The current serving state of the Cloud SQL instance.
11574 pub state: crate::model::database_instance::SqlInstanceState,
11575
11576 /// The database engine type and version. The `databaseVersion` field cannot
11577 /// be changed after instance creation.
11578 pub database_version: crate::model::SqlDatabaseVersion,
11579
11580 /// The user settings.
11581 pub settings: std::option::Option<crate::model::Settings>,
11582
11583 /// This field is deprecated and will be removed from a future version of the
11584 /// API. Use the `settings.settingsVersion` field instead.
11585 pub etag: std::string::String,
11586
11587 /// The name and status of the failover replica.
11588 pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
11589
11590 /// The name of the instance which will act as primary in the replication
11591 /// setup.
11592 pub master_instance_name: std::string::String,
11593
11594 /// The replicas of the instance.
11595 pub replica_names: std::vec::Vec<std::string::String>,
11596
11597 /// The maximum disk size of the instance in bytes.
11598 #[deprecated]
11599 pub max_disk_size: std::option::Option<wkt::Int64Value>,
11600
11601 /// The current disk usage of the instance in bytes. This property has been
11602 /// deprecated. Use the
11603 /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
11604 /// Monitoring API instead. Please see [this
11605 /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
11606 /// for details.
11607 #[deprecated]
11608 pub current_disk_size: std::option::Option<wkt::Int64Value>,
11609
11610 /// The assigned IP addresses for the instance.
11611 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
11612
11613 /// SSL configuration.
11614 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
11615
11616 /// The instance type.
11617 pub instance_type: crate::model::SqlInstanceType,
11618
11619 /// The project ID of the project containing the Cloud SQL instance. The Google
11620 /// apps domain is prefixed if applicable.
11621 pub project: std::string::String,
11622
11623 /// The IPv6 address assigned to the instance.
11624 /// (Deprecated) This property was applicable only
11625 /// to First Generation instances.
11626 #[deprecated]
11627 pub ipv6_address: std::string::String,
11628
11629 /// The service account email address assigned to the instance.\This
11630 /// property is read-only.
11631 pub service_account_email_address: std::string::String,
11632
11633 /// Configuration specific to on-premises instances.
11634 pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
11635
11636 /// Configuration specific to failover replicas and read replicas.
11637 pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
11638
11639 /// The backend type.
11640 /// `SECOND_GEN`: Cloud SQL database instance.
11641 /// `EXTERNAL`: A database server that is not managed by Google.
11642 ///
11643 /// This property is read-only; use the `tier` property in the `settings`
11644 /// object to determine the database type.
11645 pub backend_type: crate::model::SqlBackendType,
11646
11647 /// The URI of this resource.
11648 pub self_link: std::string::String,
11649
11650 /// If the instance state is SUSPENDED, the reason for the suspension.
11651 pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
11652
11653 /// Connection name of the Cloud SQL instance used in connection strings.
11654 pub connection_name: std::string::String,
11655
11656 /// Name of the Cloud SQL instance. This does not include the project ID.
11657 pub name: std::string::String,
11658
11659 /// The geographical region of the Cloud SQL instance.
11660 ///
11661 /// It can be one of the
11662 /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
11663 /// where Cloud SQL operates:
11664 ///
11665 /// For example, `asia-east1`, `europe-west1`, and `us-central1`.
11666 /// The default value is `us-central1`.
11667 pub region: std::string::String,
11668
11669 /// The Compute Engine zone that the instance is currently serving from. This
11670 /// value could be different from the zone that was specified when the instance
11671 /// was created if the instance has failed over to its secondary zone. WARNING:
11672 /// Changing this might restart the instance.
11673 pub gce_zone: std::string::String,
11674
11675 /// The Compute Engine zone that the failover instance is currently serving
11676 /// from for a regional instance. This value could be different
11677 /// from the zone that was specified when the instance
11678 /// was created if the instance has failed over to its secondary/failover zone.
11679 pub secondary_gce_zone: std::string::String,
11680
11681 /// Disk encryption configuration specific to an instance.
11682 pub disk_encryption_configuration:
11683 std::option::Option<crate::model::DiskEncryptionConfiguration>,
11684
11685 /// Disk encryption status specific to an instance.
11686 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
11687
11688 /// Initial root password. Use only on creation. You must set root passwords
11689 /// before you can connect to PostgreSQL instances.
11690 pub root_password: std::string::String,
11691
11692 /// The start time of any upcoming scheduled maintenance for this instance.
11693 pub scheduled_maintenance:
11694 std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
11695
11696 /// This status indicates whether the instance satisfies PZS.
11697 ///
11698 /// The status is reserved for future use.
11699 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
11700
11701 /// Output only. Stores the current database version running on the instance
11702 /// including minor version such as `MYSQL_8_0_18`.
11703 pub database_installed_version: std::string::String,
11704
11705 /// This field represents the report generated by the proactive database
11706 /// wellness job for OutOfDisk issues.
11707 ///
11708 /// * Writers:
11709 /// * the proactive database wellness job for OOD.
11710 /// * Readers:
11711 /// * the proactive database wellness job
11712 pub out_of_disk_report:
11713 std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
11714
11715 /// Output only. The time when the instance was created in
11716 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
11717 /// `2012-11-15T16:19:00.094Z`.
11718 pub create_time: std::option::Option<wkt::Timestamp>,
11719
11720 /// Output only. List all maintenance versions applicable on the instance
11721 pub available_maintenance_versions: std::vec::Vec<std::string::String>,
11722
11723 /// The current software version on the instance.
11724 pub maintenance_version: std::string::String,
11725
11726 /// Output only. All database versions that are available for upgrade.
11727 pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
11728
11729 #[allow(missing_docs)]
11730 pub sql_network_architecture:
11731 std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
11732
11733 /// Output only. The link to service attachment of PSC instance.
11734 pub psc_service_attachment_link: std::option::Option<std::string::String>,
11735
11736 /// Output only. The dns name of the instance.
11737 pub dns_name: std::option::Option<std::string::String>,
11738
11739 /// Output only. DEPRECATED: please use write_endpoint instead.
11740 #[deprecated]
11741 pub primary_dns_name: std::option::Option<std::string::String>,
11742
11743 /// Output only. The dns name of the primary instance in a replication group.
11744 pub write_endpoint: std::option::Option<std::string::String>,
11745
11746 /// Optional. A primary instance and disaster recovery (DR) replica pair.
11747 /// A DR replica is a cross-region replica that you designate
11748 /// for failover in the event that the primary instance
11749 /// experiences regional failure.
11750 /// Applicable to MySQL and PostgreSQL.
11751 pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
11752
11753 /// Gemini instance configuration.
11754 pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
11755
11756 /// Output only. This status indicates whether the instance satisfies PZI.
11757 ///
11758 /// The status is reserved for future use.
11759 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
11760
11761 /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
11762 /// recovery log files from a data disk to Cloud Storage.
11763 pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
11764
11765 /// Input only. Determines whether an in-place major version upgrade of
11766 /// replicas happens when an in-place major version upgrade of a primary
11767 /// instance is initiated.
11768 pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
11769
11770 /// Optional. Input only. Immutable. Tag keys and tag values that are bound to
11771 /// this instance. You must represent each item in the map as:
11772 /// `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
11773 ///
11774 /// For example, a single resource can have the following tags:
11775 ///
11776 /// ```norust
11777 /// "123/environment": "production",
11778 /// "123/costCenter": "marketing",
11779 /// ```
11780 ///
11781 /// For more information on tag creation and management, see
11782 /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview>.
11783 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
11784
11785 /// The number of read pool nodes in a read pool.
11786 pub node_count: std::option::Option<i32>,
11787
11788 /// Output only. Entries containing information about each read pool node of
11789 /// the read pool.
11790 pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
11791
11792 /// Output only. The list of DNS names used by this instance.
11793 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
11794
11795 /// Optional. If true, instance metadata is sent to the Database Center. If
11796 /// false, instance metadata is not sent to the Database Center.
11797 pub database_center_integration_enabled: std::option::Option<wkt::BoolValue>,
11798
11799 /// Optional. State of the Database Center integration for this instance.
11800 /// When unspecified, Database Center integration is enabled by default.
11801 pub database_center_integration:
11802 std::option::Option<crate::model::database_instance::DatabaseCenterIntegration>,
11803
11804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11805}
11806
11807impl DatabaseInstance {
11808 /// Creates a new default instance.
11809 pub fn new() -> Self {
11810 std::default::Default::default()
11811 }
11812
11813 /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
11814 ///
11815 /// # Example
11816 /// ```ignore,no_run
11817 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11818 /// let x = DatabaseInstance::new().set_kind("example");
11819 /// ```
11820 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11821 self.kind = v.into();
11822 self
11823 }
11824
11825 /// Sets the value of [state][crate::model::DatabaseInstance::state].
11826 ///
11827 /// # Example
11828 /// ```ignore,no_run
11829 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11830 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
11831 /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
11832 /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
11833 /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
11834 /// ```
11835 pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
11836 mut self,
11837 v: T,
11838 ) -> Self {
11839 self.state = v.into();
11840 self
11841 }
11842
11843 /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
11844 ///
11845 /// # Example
11846 /// ```ignore,no_run
11847 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11848 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
11849 /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
11850 /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
11851 /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
11852 /// ```
11853 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
11854 mut self,
11855 v: T,
11856 ) -> Self {
11857 self.database_version = v.into();
11858 self
11859 }
11860
11861 /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
11862 ///
11863 /// # Example
11864 /// ```ignore,no_run
11865 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11866 /// use google_cloud_sql_v1::model::Settings;
11867 /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
11868 /// ```
11869 pub fn set_settings<T>(mut self, v: T) -> Self
11870 where
11871 T: std::convert::Into<crate::model::Settings>,
11872 {
11873 self.settings = std::option::Option::Some(v.into());
11874 self
11875 }
11876
11877 /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
11878 ///
11879 /// # Example
11880 /// ```ignore,no_run
11881 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11882 /// use google_cloud_sql_v1::model::Settings;
11883 /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
11884 /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
11885 /// ```
11886 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
11887 where
11888 T: std::convert::Into<crate::model::Settings>,
11889 {
11890 self.settings = v.map(|x| x.into());
11891 self
11892 }
11893
11894 /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
11895 ///
11896 /// # Example
11897 /// ```ignore,no_run
11898 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11899 /// let x = DatabaseInstance::new().set_etag("example");
11900 /// ```
11901 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11902 self.etag = v.into();
11903 self
11904 }
11905
11906 /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11907 ///
11908 /// # Example
11909 /// ```ignore,no_run
11910 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11911 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11912 /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
11913 /// ```
11914 pub fn set_failover_replica<T>(mut self, v: T) -> Self
11915 where
11916 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11917 {
11918 self.failover_replica = std::option::Option::Some(v.into());
11919 self
11920 }
11921
11922 /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
11923 ///
11924 /// # Example
11925 /// ```ignore,no_run
11926 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11927 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
11928 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
11929 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
11930 /// ```
11931 pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
11932 where
11933 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
11934 {
11935 self.failover_replica = v.map(|x| x.into());
11936 self
11937 }
11938
11939 /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
11940 ///
11941 /// # Example
11942 /// ```ignore,no_run
11943 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11944 /// let x = DatabaseInstance::new().set_master_instance_name("example");
11945 /// ```
11946 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
11947 mut self,
11948 v: T,
11949 ) -> Self {
11950 self.master_instance_name = v.into();
11951 self
11952 }
11953
11954 /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
11955 ///
11956 /// # Example
11957 /// ```ignore,no_run
11958 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11959 /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
11960 /// ```
11961 pub fn set_replica_names<T, V>(mut self, v: T) -> Self
11962 where
11963 T: std::iter::IntoIterator<Item = V>,
11964 V: std::convert::Into<std::string::String>,
11965 {
11966 use std::iter::Iterator;
11967 self.replica_names = v.into_iter().map(|i| i.into()).collect();
11968 self
11969 }
11970
11971 /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11972 ///
11973 /// # Example
11974 /// ```ignore,no_run
11975 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11976 /// use wkt::Int64Value;
11977 /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
11978 /// ```
11979 #[deprecated]
11980 pub fn set_max_disk_size<T>(mut self, v: T) -> Self
11981 where
11982 T: std::convert::Into<wkt::Int64Value>,
11983 {
11984 self.max_disk_size = std::option::Option::Some(v.into());
11985 self
11986 }
11987
11988 /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
11989 ///
11990 /// # Example
11991 /// ```ignore,no_run
11992 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11993 /// use wkt::Int64Value;
11994 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
11995 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
11996 /// ```
11997 #[deprecated]
11998 pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11999 where
12000 T: std::convert::Into<wkt::Int64Value>,
12001 {
12002 self.max_disk_size = v.map(|x| x.into());
12003 self
12004 }
12005
12006 /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
12007 ///
12008 /// # Example
12009 /// ```ignore,no_run
12010 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12011 /// use wkt::Int64Value;
12012 /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
12013 /// ```
12014 #[deprecated]
12015 pub fn set_current_disk_size<T>(mut self, v: T) -> Self
12016 where
12017 T: std::convert::Into<wkt::Int64Value>,
12018 {
12019 self.current_disk_size = std::option::Option::Some(v.into());
12020 self
12021 }
12022
12023 /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
12024 ///
12025 /// # Example
12026 /// ```ignore,no_run
12027 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12028 /// use wkt::Int64Value;
12029 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
12030 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
12031 /// ```
12032 #[deprecated]
12033 pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
12034 where
12035 T: std::convert::Into<wkt::Int64Value>,
12036 {
12037 self.current_disk_size = v.map(|x| x.into());
12038 self
12039 }
12040
12041 /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
12042 ///
12043 /// # Example
12044 /// ```ignore,no_run
12045 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12046 /// use google_cloud_sql_v1::model::IpMapping;
12047 /// let x = DatabaseInstance::new()
12048 /// .set_ip_addresses([
12049 /// IpMapping::default()/* use setters */,
12050 /// IpMapping::default()/* use (different) setters */,
12051 /// ]);
12052 /// ```
12053 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12054 where
12055 T: std::iter::IntoIterator<Item = V>,
12056 V: std::convert::Into<crate::model::IpMapping>,
12057 {
12058 use std::iter::Iterator;
12059 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
12060 self
12061 }
12062
12063 /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
12064 ///
12065 /// # Example
12066 /// ```ignore,no_run
12067 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12068 /// use google_cloud_sql_v1::model::SslCert;
12069 /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
12070 /// ```
12071 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
12072 where
12073 T: std::convert::Into<crate::model::SslCert>,
12074 {
12075 self.server_ca_cert = std::option::Option::Some(v.into());
12076 self
12077 }
12078
12079 /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
12080 ///
12081 /// # Example
12082 /// ```ignore,no_run
12083 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12084 /// use google_cloud_sql_v1::model::SslCert;
12085 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
12086 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
12087 /// ```
12088 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
12089 where
12090 T: std::convert::Into<crate::model::SslCert>,
12091 {
12092 self.server_ca_cert = v.map(|x| x.into());
12093 self
12094 }
12095
12096 /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
12097 ///
12098 /// # Example
12099 /// ```ignore,no_run
12100 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12101 /// use google_cloud_sql_v1::model::SqlInstanceType;
12102 /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
12103 /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
12104 /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
12105 /// ```
12106 pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
12107 mut self,
12108 v: T,
12109 ) -> Self {
12110 self.instance_type = v.into();
12111 self
12112 }
12113
12114 /// Sets the value of [project][crate::model::DatabaseInstance::project].
12115 ///
12116 /// # Example
12117 /// ```ignore,no_run
12118 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12119 /// let x = DatabaseInstance::new().set_project("example");
12120 /// ```
12121 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12122 self.project = v.into();
12123 self
12124 }
12125
12126 /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
12127 ///
12128 /// # Example
12129 /// ```ignore,no_run
12130 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12131 /// let x = DatabaseInstance::new().set_ipv6_address("example");
12132 /// ```
12133 #[deprecated]
12134 pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12135 self.ipv6_address = v.into();
12136 self
12137 }
12138
12139 /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
12140 ///
12141 /// # Example
12142 /// ```ignore,no_run
12143 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12144 /// let x = DatabaseInstance::new().set_service_account_email_address("example");
12145 /// ```
12146 pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
12147 mut self,
12148 v: T,
12149 ) -> Self {
12150 self.service_account_email_address = v.into();
12151 self
12152 }
12153
12154 /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
12155 ///
12156 /// # Example
12157 /// ```ignore,no_run
12158 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12159 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
12160 /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
12161 /// ```
12162 pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
12163 where
12164 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
12165 {
12166 self.on_premises_configuration = std::option::Option::Some(v.into());
12167 self
12168 }
12169
12170 /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
12171 ///
12172 /// # Example
12173 /// ```ignore,no_run
12174 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12175 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
12176 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
12177 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
12178 /// ```
12179 pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
12180 where
12181 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
12182 {
12183 self.on_premises_configuration = v.map(|x| x.into());
12184 self
12185 }
12186
12187 /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
12188 ///
12189 /// # Example
12190 /// ```ignore,no_run
12191 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12192 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
12193 /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
12194 /// ```
12195 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
12196 where
12197 T: std::convert::Into<crate::model::ReplicaConfiguration>,
12198 {
12199 self.replica_configuration = std::option::Option::Some(v.into());
12200 self
12201 }
12202
12203 /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
12204 ///
12205 /// # Example
12206 /// ```ignore,no_run
12207 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12208 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
12209 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
12210 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
12211 /// ```
12212 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
12213 where
12214 T: std::convert::Into<crate::model::ReplicaConfiguration>,
12215 {
12216 self.replica_configuration = v.map(|x| x.into());
12217 self
12218 }
12219
12220 /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
12221 ///
12222 /// # Example
12223 /// ```ignore,no_run
12224 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12225 /// use google_cloud_sql_v1::model::SqlBackendType;
12226 /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
12227 /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
12228 /// ```
12229 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
12230 mut self,
12231 v: T,
12232 ) -> Self {
12233 self.backend_type = v.into();
12234 self
12235 }
12236
12237 /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
12238 ///
12239 /// # Example
12240 /// ```ignore,no_run
12241 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12242 /// let x = DatabaseInstance::new().set_self_link("example");
12243 /// ```
12244 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12245 self.self_link = v.into();
12246 self
12247 }
12248
12249 /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
12250 ///
12251 /// # Example
12252 /// ```ignore,no_run
12253 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12254 /// use google_cloud_sql_v1::model::SqlSuspensionReason;
12255 /// let x = DatabaseInstance::new().set_suspension_reason([
12256 /// SqlSuspensionReason::BillingIssue,
12257 /// SqlSuspensionReason::LegalIssue,
12258 /// SqlSuspensionReason::OperationalIssue,
12259 /// ]);
12260 /// ```
12261 pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
12262 where
12263 T: std::iter::IntoIterator<Item = V>,
12264 V: std::convert::Into<crate::model::SqlSuspensionReason>,
12265 {
12266 use std::iter::Iterator;
12267 self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
12268 self
12269 }
12270
12271 /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
12272 ///
12273 /// # Example
12274 /// ```ignore,no_run
12275 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12276 /// let x = DatabaseInstance::new().set_connection_name("example");
12277 /// ```
12278 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12279 self.connection_name = v.into();
12280 self
12281 }
12282
12283 /// Sets the value of [name][crate::model::DatabaseInstance::name].
12284 ///
12285 /// # Example
12286 /// ```ignore,no_run
12287 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12288 /// let x = DatabaseInstance::new().set_name("example");
12289 /// ```
12290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12291 self.name = v.into();
12292 self
12293 }
12294
12295 /// Sets the value of [region][crate::model::DatabaseInstance::region].
12296 ///
12297 /// # Example
12298 /// ```ignore,no_run
12299 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12300 /// let x = DatabaseInstance::new().set_region("example");
12301 /// ```
12302 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12303 self.region = v.into();
12304 self
12305 }
12306
12307 /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
12308 ///
12309 /// # Example
12310 /// ```ignore,no_run
12311 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12312 /// let x = DatabaseInstance::new().set_gce_zone("example");
12313 /// ```
12314 pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12315 self.gce_zone = v.into();
12316 self
12317 }
12318
12319 /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
12320 ///
12321 /// # Example
12322 /// ```ignore,no_run
12323 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12324 /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
12325 /// ```
12326 pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
12327 mut self,
12328 v: T,
12329 ) -> Self {
12330 self.secondary_gce_zone = v.into();
12331 self
12332 }
12333
12334 /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
12335 ///
12336 /// # Example
12337 /// ```ignore,no_run
12338 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12339 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
12340 /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
12341 /// ```
12342 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
12343 where
12344 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
12345 {
12346 self.disk_encryption_configuration = std::option::Option::Some(v.into());
12347 self
12348 }
12349
12350 /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
12351 ///
12352 /// # Example
12353 /// ```ignore,no_run
12354 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12355 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
12356 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
12357 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
12358 /// ```
12359 pub fn set_or_clear_disk_encryption_configuration<T>(
12360 mut self,
12361 v: std::option::Option<T>,
12362 ) -> Self
12363 where
12364 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
12365 {
12366 self.disk_encryption_configuration = v.map(|x| x.into());
12367 self
12368 }
12369
12370 /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
12371 ///
12372 /// # Example
12373 /// ```ignore,no_run
12374 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12375 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
12376 /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
12377 /// ```
12378 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
12379 where
12380 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
12381 {
12382 self.disk_encryption_status = std::option::Option::Some(v.into());
12383 self
12384 }
12385
12386 /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
12387 ///
12388 /// # Example
12389 /// ```ignore,no_run
12390 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12391 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
12392 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
12393 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
12394 /// ```
12395 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
12396 where
12397 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
12398 {
12399 self.disk_encryption_status = v.map(|x| x.into());
12400 self
12401 }
12402
12403 /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
12404 ///
12405 /// # Example
12406 /// ```ignore,no_run
12407 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12408 /// let x = DatabaseInstance::new().set_root_password("example");
12409 /// ```
12410 pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12411 self.root_password = v.into();
12412 self
12413 }
12414
12415 /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
12416 ///
12417 /// # Example
12418 /// ```ignore,no_run
12419 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12420 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12421 /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
12422 /// ```
12423 pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
12424 where
12425 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
12426 {
12427 self.scheduled_maintenance = std::option::Option::Some(v.into());
12428 self
12429 }
12430
12431 /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
12432 ///
12433 /// # Example
12434 /// ```ignore,no_run
12435 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12436 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12437 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
12438 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
12439 /// ```
12440 pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
12441 where
12442 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
12443 {
12444 self.scheduled_maintenance = v.map(|x| x.into());
12445 self
12446 }
12447
12448 /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
12449 ///
12450 /// # Example
12451 /// ```ignore,no_run
12452 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12453 /// use wkt::BoolValue;
12454 /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
12455 /// ```
12456 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
12457 where
12458 T: std::convert::Into<wkt::BoolValue>,
12459 {
12460 self.satisfies_pzs = std::option::Option::Some(v.into());
12461 self
12462 }
12463
12464 /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
12465 ///
12466 /// # Example
12467 /// ```ignore,no_run
12468 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12469 /// use wkt::BoolValue;
12470 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
12471 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
12472 /// ```
12473 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
12474 where
12475 T: std::convert::Into<wkt::BoolValue>,
12476 {
12477 self.satisfies_pzs = v.map(|x| x.into());
12478 self
12479 }
12480
12481 /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
12482 ///
12483 /// # Example
12484 /// ```ignore,no_run
12485 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12486 /// let x = DatabaseInstance::new().set_database_installed_version("example");
12487 /// ```
12488 pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
12489 mut self,
12490 v: T,
12491 ) -> Self {
12492 self.database_installed_version = v.into();
12493 self
12494 }
12495
12496 /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
12497 ///
12498 /// # Example
12499 /// ```ignore,no_run
12500 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12501 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12502 /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
12503 /// ```
12504 pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
12505 where
12506 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
12507 {
12508 self.out_of_disk_report = std::option::Option::Some(v.into());
12509 self
12510 }
12511
12512 /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
12513 ///
12514 /// # Example
12515 /// ```ignore,no_run
12516 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12517 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12518 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
12519 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
12520 /// ```
12521 pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
12522 where
12523 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
12524 {
12525 self.out_of_disk_report = v.map(|x| x.into());
12526 self
12527 }
12528
12529 /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
12530 ///
12531 /// # Example
12532 /// ```ignore,no_run
12533 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12534 /// use wkt::Timestamp;
12535 /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
12536 /// ```
12537 pub fn set_create_time<T>(mut self, v: T) -> Self
12538 where
12539 T: std::convert::Into<wkt::Timestamp>,
12540 {
12541 self.create_time = std::option::Option::Some(v.into());
12542 self
12543 }
12544
12545 /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
12546 ///
12547 /// # Example
12548 /// ```ignore,no_run
12549 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12550 /// use wkt::Timestamp;
12551 /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12552 /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
12553 /// ```
12554 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12555 where
12556 T: std::convert::Into<wkt::Timestamp>,
12557 {
12558 self.create_time = v.map(|x| x.into());
12559 self
12560 }
12561
12562 /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
12563 ///
12564 /// # Example
12565 /// ```ignore,no_run
12566 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12567 /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
12568 /// ```
12569 pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
12570 where
12571 T: std::iter::IntoIterator<Item = V>,
12572 V: std::convert::Into<std::string::String>,
12573 {
12574 use std::iter::Iterator;
12575 self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
12576 self
12577 }
12578
12579 /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
12580 ///
12581 /// # Example
12582 /// ```ignore,no_run
12583 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12584 /// let x = DatabaseInstance::new().set_maintenance_version("example");
12585 /// ```
12586 pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
12587 mut self,
12588 v: T,
12589 ) -> Self {
12590 self.maintenance_version = v.into();
12591 self
12592 }
12593
12594 /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
12595 ///
12596 /// # Example
12597 /// ```ignore,no_run
12598 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12599 /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
12600 /// let x = DatabaseInstance::new()
12601 /// .set_upgradable_database_versions([
12602 /// AvailableDatabaseVersion::default()/* use setters */,
12603 /// AvailableDatabaseVersion::default()/* use (different) setters */,
12604 /// ]);
12605 /// ```
12606 pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
12607 where
12608 T: std::iter::IntoIterator<Item = V>,
12609 V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
12610 {
12611 use std::iter::Iterator;
12612 self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
12613 self
12614 }
12615
12616 /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
12617 ///
12618 /// # Example
12619 /// ```ignore,no_run
12620 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12621 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
12622 /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
12623 /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
12624 /// ```
12625 pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
12626 where
12627 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
12628 {
12629 self.sql_network_architecture = std::option::Option::Some(v.into());
12630 self
12631 }
12632
12633 /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
12634 ///
12635 /// # Example
12636 /// ```ignore,no_run
12637 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12638 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
12639 /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
12640 /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
12641 /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
12642 /// ```
12643 pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
12644 where
12645 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
12646 {
12647 self.sql_network_architecture = v.map(|x| x.into());
12648 self
12649 }
12650
12651 /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
12652 ///
12653 /// # Example
12654 /// ```ignore,no_run
12655 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12656 /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
12657 /// ```
12658 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
12659 where
12660 T: std::convert::Into<std::string::String>,
12661 {
12662 self.psc_service_attachment_link = std::option::Option::Some(v.into());
12663 self
12664 }
12665
12666 /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
12667 ///
12668 /// # Example
12669 /// ```ignore,no_run
12670 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12671 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
12672 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
12673 /// ```
12674 pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
12675 where
12676 T: std::convert::Into<std::string::String>,
12677 {
12678 self.psc_service_attachment_link = v.map(|x| x.into());
12679 self
12680 }
12681
12682 /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
12683 ///
12684 /// # Example
12685 /// ```ignore,no_run
12686 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12687 /// let x = DatabaseInstance::new().set_dns_name("example");
12688 /// ```
12689 pub fn set_dns_name<T>(mut self, v: T) -> Self
12690 where
12691 T: std::convert::Into<std::string::String>,
12692 {
12693 self.dns_name = std::option::Option::Some(v.into());
12694 self
12695 }
12696
12697 /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
12698 ///
12699 /// # Example
12700 /// ```ignore,no_run
12701 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12702 /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
12703 /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
12704 /// ```
12705 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12706 where
12707 T: std::convert::Into<std::string::String>,
12708 {
12709 self.dns_name = v.map(|x| x.into());
12710 self
12711 }
12712
12713 /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
12714 ///
12715 /// # Example
12716 /// ```ignore,no_run
12717 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12718 /// let x = DatabaseInstance::new().set_primary_dns_name("example");
12719 /// ```
12720 #[deprecated]
12721 pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
12722 where
12723 T: std::convert::Into<std::string::String>,
12724 {
12725 self.primary_dns_name = std::option::Option::Some(v.into());
12726 self
12727 }
12728
12729 /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
12730 ///
12731 /// # Example
12732 /// ```ignore,no_run
12733 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12734 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
12735 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
12736 /// ```
12737 #[deprecated]
12738 pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12739 where
12740 T: std::convert::Into<std::string::String>,
12741 {
12742 self.primary_dns_name = v.map(|x| x.into());
12743 self
12744 }
12745
12746 /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
12747 ///
12748 /// # Example
12749 /// ```ignore,no_run
12750 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12751 /// let x = DatabaseInstance::new().set_write_endpoint("example");
12752 /// ```
12753 pub fn set_write_endpoint<T>(mut self, v: T) -> Self
12754 where
12755 T: std::convert::Into<std::string::String>,
12756 {
12757 self.write_endpoint = std::option::Option::Some(v.into());
12758 self
12759 }
12760
12761 /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
12762 ///
12763 /// # Example
12764 /// ```ignore,no_run
12765 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12766 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
12767 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
12768 /// ```
12769 pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
12770 where
12771 T: std::convert::Into<std::string::String>,
12772 {
12773 self.write_endpoint = v.map(|x| x.into());
12774 self
12775 }
12776
12777 /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
12778 ///
12779 /// # Example
12780 /// ```ignore,no_run
12781 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12782 /// use google_cloud_sql_v1::model::ReplicationCluster;
12783 /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
12784 /// ```
12785 pub fn set_replication_cluster<T>(mut self, v: T) -> Self
12786 where
12787 T: std::convert::Into<crate::model::ReplicationCluster>,
12788 {
12789 self.replication_cluster = std::option::Option::Some(v.into());
12790 self
12791 }
12792
12793 /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
12794 ///
12795 /// # Example
12796 /// ```ignore,no_run
12797 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12798 /// use google_cloud_sql_v1::model::ReplicationCluster;
12799 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
12800 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
12801 /// ```
12802 pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
12803 where
12804 T: std::convert::Into<crate::model::ReplicationCluster>,
12805 {
12806 self.replication_cluster = v.map(|x| x.into());
12807 self
12808 }
12809
12810 /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12811 ///
12812 /// # Example
12813 /// ```ignore,no_run
12814 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12815 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12816 /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
12817 /// ```
12818 pub fn set_gemini_config<T>(mut self, v: T) -> Self
12819 where
12820 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12821 {
12822 self.gemini_config = std::option::Option::Some(v.into());
12823 self
12824 }
12825
12826 /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
12827 ///
12828 /// # Example
12829 /// ```ignore,no_run
12830 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12831 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
12832 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
12833 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
12834 /// ```
12835 pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
12836 where
12837 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
12838 {
12839 self.gemini_config = v.map(|x| x.into());
12840 self
12841 }
12842
12843 /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12844 ///
12845 /// # Example
12846 /// ```ignore,no_run
12847 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12848 /// use wkt::BoolValue;
12849 /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
12850 /// ```
12851 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
12852 where
12853 T: std::convert::Into<wkt::BoolValue>,
12854 {
12855 self.satisfies_pzi = std::option::Option::Some(v.into());
12856 self
12857 }
12858
12859 /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
12860 ///
12861 /// # Example
12862 /// ```ignore,no_run
12863 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12864 /// use wkt::BoolValue;
12865 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
12866 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
12867 /// ```
12868 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
12869 where
12870 T: std::convert::Into<wkt::BoolValue>,
12871 {
12872 self.satisfies_pzi = v.map(|x| x.into());
12873 self
12874 }
12875
12876 /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12877 ///
12878 /// # Example
12879 /// ```ignore,no_run
12880 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12881 /// use wkt::BoolValue;
12882 /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
12883 /// ```
12884 pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
12885 where
12886 T: std::convert::Into<wkt::BoolValue>,
12887 {
12888 self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
12889 self
12890 }
12891
12892 /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
12893 ///
12894 /// # Example
12895 /// ```ignore,no_run
12896 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12897 /// use wkt::BoolValue;
12898 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
12899 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
12900 /// ```
12901 pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
12902 mut self,
12903 v: std::option::Option<T>,
12904 ) -> Self
12905 where
12906 T: std::convert::Into<wkt::BoolValue>,
12907 {
12908 self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
12909 self
12910 }
12911
12912 /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12913 ///
12914 /// # Example
12915 /// ```ignore,no_run
12916 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12917 /// use wkt::BoolValue;
12918 /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
12919 /// ```
12920 pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
12921 where
12922 T: std::convert::Into<wkt::BoolValue>,
12923 {
12924 self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
12925 self
12926 }
12927
12928 /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
12929 ///
12930 /// # Example
12931 /// ```ignore,no_run
12932 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12933 /// use wkt::BoolValue;
12934 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
12935 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
12936 /// ```
12937 pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
12938 mut self,
12939 v: std::option::Option<T>,
12940 ) -> Self
12941 where
12942 T: std::convert::Into<wkt::BoolValue>,
12943 {
12944 self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
12945 self
12946 }
12947
12948 /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
12949 ///
12950 /// # Example
12951 /// ```ignore,no_run
12952 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12953 /// let x = DatabaseInstance::new().set_tags([
12954 /// ("key0", "abc"),
12955 /// ("key1", "xyz"),
12956 /// ]);
12957 /// ```
12958 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
12959 where
12960 T: std::iter::IntoIterator<Item = (K, V)>,
12961 K: std::convert::Into<std::string::String>,
12962 V: std::convert::Into<std::string::String>,
12963 {
12964 use std::iter::Iterator;
12965 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12966 self
12967 }
12968
12969 /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
12970 ///
12971 /// # Example
12972 /// ```ignore,no_run
12973 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12974 /// let x = DatabaseInstance::new().set_node_count(42);
12975 /// ```
12976 pub fn set_node_count<T>(mut self, v: T) -> Self
12977 where
12978 T: std::convert::Into<i32>,
12979 {
12980 self.node_count = std::option::Option::Some(v.into());
12981 self
12982 }
12983
12984 /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
12985 ///
12986 /// # Example
12987 /// ```ignore,no_run
12988 /// # use google_cloud_sql_v1::model::DatabaseInstance;
12989 /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
12990 /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
12991 /// ```
12992 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
12993 where
12994 T: std::convert::Into<i32>,
12995 {
12996 self.node_count = v.map(|x| x.into());
12997 self
12998 }
12999
13000 /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
13001 ///
13002 /// # Example
13003 /// ```ignore,no_run
13004 /// # use google_cloud_sql_v1::model::DatabaseInstance;
13005 /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13006 /// let x = DatabaseInstance::new()
13007 /// .set_nodes([
13008 /// PoolNodeConfig::default()/* use setters */,
13009 /// PoolNodeConfig::default()/* use (different) setters */,
13010 /// ]);
13011 /// ```
13012 pub fn set_nodes<T, V>(mut self, v: T) -> Self
13013 where
13014 T: std::iter::IntoIterator<Item = V>,
13015 V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
13016 {
13017 use std::iter::Iterator;
13018 self.nodes = v.into_iter().map(|i| i.into()).collect();
13019 self
13020 }
13021
13022 /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
13023 ///
13024 /// # Example
13025 /// ```ignore,no_run
13026 /// # use google_cloud_sql_v1::model::DatabaseInstance;
13027 /// use google_cloud_sql_v1::model::DnsNameMapping;
13028 /// let x = DatabaseInstance::new()
13029 /// .set_dns_names([
13030 /// DnsNameMapping::default()/* use setters */,
13031 /// DnsNameMapping::default()/* use (different) setters */,
13032 /// ]);
13033 /// ```
13034 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
13035 where
13036 T: std::iter::IntoIterator<Item = V>,
13037 V: std::convert::Into<crate::model::DnsNameMapping>,
13038 {
13039 use std::iter::Iterator;
13040 self.dns_names = v.into_iter().map(|i| i.into()).collect();
13041 self
13042 }
13043
13044 /// Sets the value of [database_center_integration_enabled][crate::model::DatabaseInstance::database_center_integration_enabled].
13045 ///
13046 /// # Example
13047 /// ```ignore,no_run
13048 /// # use google_cloud_sql_v1::model::DatabaseInstance;
13049 /// use wkt::BoolValue;
13050 /// let x = DatabaseInstance::new().set_database_center_integration_enabled(BoolValue::default()/* use setters */);
13051 /// ```
13052 pub fn set_database_center_integration_enabled<T>(mut self, v: T) -> Self
13053 where
13054 T: std::convert::Into<wkt::BoolValue>,
13055 {
13056 self.database_center_integration_enabled = std::option::Option::Some(v.into());
13057 self
13058 }
13059
13060 /// Sets or clears the value of [database_center_integration_enabled][crate::model::DatabaseInstance::database_center_integration_enabled].
13061 ///
13062 /// # Example
13063 /// ```ignore,no_run
13064 /// # use google_cloud_sql_v1::model::DatabaseInstance;
13065 /// use wkt::BoolValue;
13066 /// let x = DatabaseInstance::new().set_or_clear_database_center_integration_enabled(Some(BoolValue::default()/* use setters */));
13067 /// let x = DatabaseInstance::new().set_or_clear_database_center_integration_enabled(None::<BoolValue>);
13068 /// ```
13069 pub fn set_or_clear_database_center_integration_enabled<T>(
13070 mut self,
13071 v: std::option::Option<T>,
13072 ) -> Self
13073 where
13074 T: std::convert::Into<wkt::BoolValue>,
13075 {
13076 self.database_center_integration_enabled = v.map(|x| x.into());
13077 self
13078 }
13079
13080 /// Sets the value of [database_center_integration][crate::model::DatabaseInstance::database_center_integration].
13081 ///
13082 /// # Example
13083 /// ```ignore,no_run
13084 /// # use google_cloud_sql_v1::model::DatabaseInstance;
13085 /// use google_cloud_sql_v1::model::database_instance::DatabaseCenterIntegration;
13086 /// let x0 = DatabaseInstance::new().set_database_center_integration(DatabaseCenterIntegration::Enabled);
13087 /// let x1 = DatabaseInstance::new().set_database_center_integration(DatabaseCenterIntegration::Disabled);
13088 /// ```
13089 pub fn set_database_center_integration<T>(mut self, v: T) -> Self
13090 where
13091 T: std::convert::Into<crate::model::database_instance::DatabaseCenterIntegration>,
13092 {
13093 self.database_center_integration = std::option::Option::Some(v.into());
13094 self
13095 }
13096
13097 /// Sets or clears the value of [database_center_integration][crate::model::DatabaseInstance::database_center_integration].
13098 ///
13099 /// # Example
13100 /// ```ignore,no_run
13101 /// # use google_cloud_sql_v1::model::DatabaseInstance;
13102 /// use google_cloud_sql_v1::model::database_instance::DatabaseCenterIntegration;
13103 /// let x0 = DatabaseInstance::new().set_or_clear_database_center_integration(Some(DatabaseCenterIntegration::Enabled));
13104 /// let x1 = DatabaseInstance::new().set_or_clear_database_center_integration(Some(DatabaseCenterIntegration::Disabled));
13105 /// let x_none = DatabaseInstance::new().set_or_clear_database_center_integration(None::<DatabaseCenterIntegration>);
13106 /// ```
13107 pub fn set_or_clear_database_center_integration<T>(mut self, v: std::option::Option<T>) -> Self
13108 where
13109 T: std::convert::Into<crate::model::database_instance::DatabaseCenterIntegration>,
13110 {
13111 self.database_center_integration = v.map(|x| x.into());
13112 self
13113 }
13114}
13115
13116impl wkt::message::Message for DatabaseInstance {
13117 fn typename() -> &'static str {
13118 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
13119 }
13120}
13121
13122/// Defines additional types related to [DatabaseInstance].
13123pub mod database_instance {
13124 #[allow(unused_imports)]
13125 use super::*;
13126
13127 #[allow(missing_docs)]
13128 #[derive(Clone, Default, PartialEq)]
13129 #[non_exhaustive]
13130 pub struct SqlFailoverReplica {
13131 /// The name of the failover replica. If specified at instance creation, a
13132 /// failover replica is created for the instance. The name
13133 /// doesn't include the project ID.
13134 pub name: std::string::String,
13135
13136 /// The availability status of the failover replica. A false status indicates
13137 /// that the failover replica is out of sync. The primary instance can only
13138 /// failover to the failover replica when the status is true.
13139 pub available: std::option::Option<wkt::BoolValue>,
13140
13141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13142 }
13143
13144 impl SqlFailoverReplica {
13145 /// Creates a new default instance.
13146 pub fn new() -> Self {
13147 std::default::Default::default()
13148 }
13149
13150 /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
13151 ///
13152 /// # Example
13153 /// ```ignore,no_run
13154 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
13155 /// let x = SqlFailoverReplica::new().set_name("example");
13156 /// ```
13157 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13158 self.name = v.into();
13159 self
13160 }
13161
13162 /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
13163 ///
13164 /// # Example
13165 /// ```ignore,no_run
13166 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
13167 /// use wkt::BoolValue;
13168 /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
13169 /// ```
13170 pub fn set_available<T>(mut self, v: T) -> Self
13171 where
13172 T: std::convert::Into<wkt::BoolValue>,
13173 {
13174 self.available = std::option::Option::Some(v.into());
13175 self
13176 }
13177
13178 /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
13179 ///
13180 /// # Example
13181 /// ```ignore,no_run
13182 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
13183 /// use wkt::BoolValue;
13184 /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
13185 /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
13186 /// ```
13187 pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
13188 where
13189 T: std::convert::Into<wkt::BoolValue>,
13190 {
13191 self.available = v.map(|x| x.into());
13192 self
13193 }
13194 }
13195
13196 impl wkt::message::Message for SqlFailoverReplica {
13197 fn typename() -> &'static str {
13198 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
13199 }
13200 }
13201
13202 /// Any scheduled maintenance for this instance.
13203 #[derive(Clone, Default, PartialEq)]
13204 #[non_exhaustive]
13205 pub struct SqlScheduledMaintenance {
13206 /// The start time of any upcoming scheduled maintenance for this instance.
13207 pub start_time: std::option::Option<wkt::Timestamp>,
13208
13209 #[allow(missing_docs)]
13210 #[deprecated]
13211 pub can_defer: bool,
13212
13213 /// If the scheduled maintenance can be rescheduled.
13214 pub can_reschedule: bool,
13215
13216 /// Maintenance cannot be rescheduled to start beyond this deadline.
13217 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
13218
13219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13220 }
13221
13222 impl SqlScheduledMaintenance {
13223 /// Creates a new default instance.
13224 pub fn new() -> Self {
13225 std::default::Default::default()
13226 }
13227
13228 /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
13229 ///
13230 /// # Example
13231 /// ```ignore,no_run
13232 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
13233 /// use wkt::Timestamp;
13234 /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
13235 /// ```
13236 pub fn set_start_time<T>(mut self, v: T) -> Self
13237 where
13238 T: std::convert::Into<wkt::Timestamp>,
13239 {
13240 self.start_time = std::option::Option::Some(v.into());
13241 self
13242 }
13243
13244 /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
13245 ///
13246 /// # Example
13247 /// ```ignore,no_run
13248 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
13249 /// use wkt::Timestamp;
13250 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
13251 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
13252 /// ```
13253 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
13254 where
13255 T: std::convert::Into<wkt::Timestamp>,
13256 {
13257 self.start_time = v.map(|x| x.into());
13258 self
13259 }
13260
13261 /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
13262 ///
13263 /// # Example
13264 /// ```ignore,no_run
13265 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
13266 /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
13267 /// ```
13268 #[deprecated]
13269 pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13270 self.can_defer = v.into();
13271 self
13272 }
13273
13274 /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
13275 ///
13276 /// # Example
13277 /// ```ignore,no_run
13278 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
13279 /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
13280 /// ```
13281 pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13282 self.can_reschedule = v.into();
13283 self
13284 }
13285
13286 /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
13287 ///
13288 /// # Example
13289 /// ```ignore,no_run
13290 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
13291 /// use wkt::Timestamp;
13292 /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
13293 /// ```
13294 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
13295 where
13296 T: std::convert::Into<wkt::Timestamp>,
13297 {
13298 self.schedule_deadline_time = std::option::Option::Some(v.into());
13299 self
13300 }
13301
13302 /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
13303 ///
13304 /// # Example
13305 /// ```ignore,no_run
13306 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
13307 /// use wkt::Timestamp;
13308 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
13309 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
13310 /// ```
13311 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
13312 where
13313 T: std::convert::Into<wkt::Timestamp>,
13314 {
13315 self.schedule_deadline_time = v.map(|x| x.into());
13316 self
13317 }
13318 }
13319
13320 impl wkt::message::Message for SqlScheduledMaintenance {
13321 fn typename() -> &'static str {
13322 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
13323 }
13324 }
13325
13326 /// This message wraps up the information written by out-of-disk detection job.
13327 #[derive(Clone, Default, PartialEq)]
13328 #[non_exhaustive]
13329 pub struct SqlOutOfDiskReport {
13330 /// This field represents the state generated by the proactive database
13331 /// wellness job for OutOfDisk issues.
13332 ///
13333 /// * Writers:
13334 /// * the proactive database wellness job for OOD.
13335 /// * Readers:
13336 /// * the proactive database wellness job
13337 pub sql_out_of_disk_state: std::option::Option<
13338 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
13339 >,
13340
13341 /// The minimum recommended increase size in GigaBytes
13342 /// This field is consumed by the frontend
13343 ///
13344 /// * Writers:
13345 /// * the proactive database wellness job for OOD.
13346 /// * Readers:
13347 pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
13348
13349 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13350 }
13351
13352 impl SqlOutOfDiskReport {
13353 /// Creates a new default instance.
13354 pub fn new() -> Self {
13355 std::default::Default::default()
13356 }
13357
13358 /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
13359 ///
13360 /// # Example
13361 /// ```ignore,no_run
13362 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
13363 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
13364 /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
13365 /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
13366 /// ```
13367 pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
13368 where
13369 T: std::convert::Into<
13370 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
13371 >,
13372 {
13373 self.sql_out_of_disk_state = std::option::Option::Some(v.into());
13374 self
13375 }
13376
13377 /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
13378 ///
13379 /// # Example
13380 /// ```ignore,no_run
13381 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
13382 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
13383 /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
13384 /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
13385 /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
13386 /// ```
13387 pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
13388 where
13389 T: std::convert::Into<
13390 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
13391 >,
13392 {
13393 self.sql_out_of_disk_state = v.map(|x| x.into());
13394 self
13395 }
13396
13397 /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
13398 ///
13399 /// # Example
13400 /// ```ignore,no_run
13401 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
13402 /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
13403 /// ```
13404 pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
13405 where
13406 T: std::convert::Into<i32>,
13407 {
13408 self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
13409 self
13410 }
13411
13412 /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
13413 ///
13414 /// # Example
13415 /// ```ignore,no_run
13416 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
13417 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
13418 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
13419 /// ```
13420 pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
13421 mut self,
13422 v: std::option::Option<T>,
13423 ) -> Self
13424 where
13425 T: std::convert::Into<i32>,
13426 {
13427 self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
13428 self
13429 }
13430 }
13431
13432 impl wkt::message::Message for SqlOutOfDiskReport {
13433 fn typename() -> &'static str {
13434 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
13435 }
13436 }
13437
13438 /// Defines additional types related to [SqlOutOfDiskReport].
13439 pub mod sql_out_of_disk_report {
13440 #[allow(unused_imports)]
13441 use super::*;
13442
13443 /// This enum lists all possible states regarding out-of-disk issues.
13444 ///
13445 /// # Working with unknown values
13446 ///
13447 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13448 /// additional enum variants at any time. Adding new variants is not considered
13449 /// a breaking change. Applications should write their code in anticipation of:
13450 ///
13451 /// - New values appearing in future releases of the client library, **and**
13452 /// - New values received dynamically, without application changes.
13453 ///
13454 /// Please consult the [Working with enums] section in the user guide for some
13455 /// guidelines.
13456 ///
13457 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13458 #[derive(Clone, Debug, PartialEq)]
13459 #[non_exhaustive]
13460 pub enum SqlOutOfDiskState {
13461 /// Unspecified state
13462 Unspecified,
13463 /// The instance has plenty space on data disk
13464 Normal,
13465 /// Data disk is almost used up. It is shutdown to prevent data
13466 /// corruption.
13467 SoftShutdown,
13468 /// If set, the enum was initialized with an unknown value.
13469 ///
13470 /// Applications can examine the value using [SqlOutOfDiskState::value] or
13471 /// [SqlOutOfDiskState::name].
13472 UnknownValue(sql_out_of_disk_state::UnknownValue),
13473 }
13474
13475 #[doc(hidden)]
13476 pub mod sql_out_of_disk_state {
13477 #[allow(unused_imports)]
13478 use super::*;
13479 #[derive(Clone, Debug, PartialEq)]
13480 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13481 }
13482
13483 impl SqlOutOfDiskState {
13484 /// Gets the enum value.
13485 ///
13486 /// Returns `None` if the enum contains an unknown value deserialized from
13487 /// the string representation of enums.
13488 pub fn value(&self) -> std::option::Option<i32> {
13489 match self {
13490 Self::Unspecified => std::option::Option::Some(0),
13491 Self::Normal => std::option::Option::Some(1),
13492 Self::SoftShutdown => std::option::Option::Some(2),
13493 Self::UnknownValue(u) => u.0.value(),
13494 }
13495 }
13496
13497 /// Gets the enum value as a string.
13498 ///
13499 /// Returns `None` if the enum contains an unknown value deserialized from
13500 /// the integer representation of enums.
13501 pub fn name(&self) -> std::option::Option<&str> {
13502 match self {
13503 Self::Unspecified => {
13504 std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
13505 }
13506 Self::Normal => std::option::Option::Some("NORMAL"),
13507 Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
13508 Self::UnknownValue(u) => u.0.name(),
13509 }
13510 }
13511 }
13512
13513 impl std::default::Default for SqlOutOfDiskState {
13514 fn default() -> Self {
13515 use std::convert::From;
13516 Self::from(0)
13517 }
13518 }
13519
13520 impl std::fmt::Display for SqlOutOfDiskState {
13521 fn fmt(
13522 &self,
13523 f: &mut std::fmt::Formatter<'_>,
13524 ) -> std::result::Result<(), std::fmt::Error> {
13525 wkt::internal::display_enum(f, self.name(), self.value())
13526 }
13527 }
13528
13529 impl std::convert::From<i32> for SqlOutOfDiskState {
13530 fn from(value: i32) -> Self {
13531 match value {
13532 0 => Self::Unspecified,
13533 1 => Self::Normal,
13534 2 => Self::SoftShutdown,
13535 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
13536 wkt::internal::UnknownEnumValue::Integer(value),
13537 )),
13538 }
13539 }
13540 }
13541
13542 impl std::convert::From<&str> for SqlOutOfDiskState {
13543 fn from(value: &str) -> Self {
13544 use std::string::ToString;
13545 match value {
13546 "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
13547 "NORMAL" => Self::Normal,
13548 "SOFT_SHUTDOWN" => Self::SoftShutdown,
13549 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
13550 wkt::internal::UnknownEnumValue::String(value.to_string()),
13551 )),
13552 }
13553 }
13554 }
13555
13556 impl serde::ser::Serialize for SqlOutOfDiskState {
13557 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13558 where
13559 S: serde::Serializer,
13560 {
13561 match self {
13562 Self::Unspecified => serializer.serialize_i32(0),
13563 Self::Normal => serializer.serialize_i32(1),
13564 Self::SoftShutdown => serializer.serialize_i32(2),
13565 Self::UnknownValue(u) => u.0.serialize(serializer),
13566 }
13567 }
13568 }
13569
13570 impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
13571 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13572 where
13573 D: serde::Deserializer<'de>,
13574 {
13575 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
13576 ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
13577 ))
13578 }
13579 }
13580 }
13581
13582 /// Details of a single read pool node of a read pool.
13583 #[derive(Clone, Default, PartialEq)]
13584 #[non_exhaustive]
13585 pub struct PoolNodeConfig {
13586 /// Output only. The name of the read pool node, to be used for retrieving
13587 /// metrics and logs.
13588 pub name: std::option::Option<std::string::String>,
13589
13590 /// Output only. The zone of the read pool node.
13591 pub gce_zone: std::option::Option<std::string::String>,
13592
13593 /// Output only. Mappings containing IP addresses that can be used to connect
13594 /// to the read pool node.
13595 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
13596
13597 /// Output only. The DNS name of the read pool node.
13598 pub dns_name: std::option::Option<std::string::String>,
13599
13600 /// Output only. The current state of the read pool node.
13601 pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
13602
13603 /// Output only. The list of DNS names used by this read pool node.
13604 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
13605
13606 /// Output only. The Private Service Connect (PSC) service attachment of the
13607 /// read pool node.
13608 pub psc_service_attachment_link: std::option::Option<std::string::String>,
13609
13610 /// Output only. The list of settings for requested automatically-setup
13611 /// Private Service Connect (PSC) consumer endpoints that can be used to
13612 /// connect to this read pool node.
13613 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
13614
13615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13616 }
13617
13618 impl PoolNodeConfig {
13619 /// Creates a new default instance.
13620 pub fn new() -> Self {
13621 std::default::Default::default()
13622 }
13623
13624 /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
13625 ///
13626 /// # Example
13627 /// ```ignore,no_run
13628 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13629 /// let x = PoolNodeConfig::new().set_name("example");
13630 /// ```
13631 pub fn set_name<T>(mut self, v: T) -> Self
13632 where
13633 T: std::convert::Into<std::string::String>,
13634 {
13635 self.name = std::option::Option::Some(v.into());
13636 self
13637 }
13638
13639 /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
13640 ///
13641 /// # Example
13642 /// ```ignore,no_run
13643 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13644 /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
13645 /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
13646 /// ```
13647 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13648 where
13649 T: std::convert::Into<std::string::String>,
13650 {
13651 self.name = v.map(|x| x.into());
13652 self
13653 }
13654
13655 /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
13656 ///
13657 /// # Example
13658 /// ```ignore,no_run
13659 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13660 /// let x = PoolNodeConfig::new().set_gce_zone("example");
13661 /// ```
13662 pub fn set_gce_zone<T>(mut self, v: T) -> Self
13663 where
13664 T: std::convert::Into<std::string::String>,
13665 {
13666 self.gce_zone = std::option::Option::Some(v.into());
13667 self
13668 }
13669
13670 /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
13671 ///
13672 /// # Example
13673 /// ```ignore,no_run
13674 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13675 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
13676 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
13677 /// ```
13678 pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
13679 where
13680 T: std::convert::Into<std::string::String>,
13681 {
13682 self.gce_zone = v.map(|x| x.into());
13683 self
13684 }
13685
13686 /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
13687 ///
13688 /// # Example
13689 /// ```ignore,no_run
13690 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13691 /// use google_cloud_sql_v1::model::IpMapping;
13692 /// let x = PoolNodeConfig::new()
13693 /// .set_ip_addresses([
13694 /// IpMapping::default()/* use setters */,
13695 /// IpMapping::default()/* use (different) setters */,
13696 /// ]);
13697 /// ```
13698 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
13699 where
13700 T: std::iter::IntoIterator<Item = V>,
13701 V: std::convert::Into<crate::model::IpMapping>,
13702 {
13703 use std::iter::Iterator;
13704 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
13705 self
13706 }
13707
13708 /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
13709 ///
13710 /// # Example
13711 /// ```ignore,no_run
13712 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13713 /// let x = PoolNodeConfig::new().set_dns_name("example");
13714 /// ```
13715 pub fn set_dns_name<T>(mut self, v: T) -> Self
13716 where
13717 T: std::convert::Into<std::string::String>,
13718 {
13719 self.dns_name = std::option::Option::Some(v.into());
13720 self
13721 }
13722
13723 /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
13724 ///
13725 /// # Example
13726 /// ```ignore,no_run
13727 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13728 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
13729 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
13730 /// ```
13731 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
13732 where
13733 T: std::convert::Into<std::string::String>,
13734 {
13735 self.dns_name = v.map(|x| x.into());
13736 self
13737 }
13738
13739 /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
13740 ///
13741 /// # Example
13742 /// ```ignore,no_run
13743 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13744 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
13745 /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
13746 /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
13747 /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
13748 /// ```
13749 pub fn set_state<T>(mut self, v: T) -> Self
13750 where
13751 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
13752 {
13753 self.state = std::option::Option::Some(v.into());
13754 self
13755 }
13756
13757 /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
13758 ///
13759 /// # Example
13760 /// ```ignore,no_run
13761 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13762 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
13763 /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
13764 /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
13765 /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
13766 /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
13767 /// ```
13768 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
13769 where
13770 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
13771 {
13772 self.state = v.map(|x| x.into());
13773 self
13774 }
13775
13776 /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
13777 ///
13778 /// # Example
13779 /// ```ignore,no_run
13780 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13781 /// use google_cloud_sql_v1::model::DnsNameMapping;
13782 /// let x = PoolNodeConfig::new()
13783 /// .set_dns_names([
13784 /// DnsNameMapping::default()/* use setters */,
13785 /// DnsNameMapping::default()/* use (different) setters */,
13786 /// ]);
13787 /// ```
13788 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
13789 where
13790 T: std::iter::IntoIterator<Item = V>,
13791 V: std::convert::Into<crate::model::DnsNameMapping>,
13792 {
13793 use std::iter::Iterator;
13794 self.dns_names = v.into_iter().map(|i| i.into()).collect();
13795 self
13796 }
13797
13798 /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
13799 ///
13800 /// # Example
13801 /// ```ignore,no_run
13802 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13803 /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
13804 /// ```
13805 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
13806 where
13807 T: std::convert::Into<std::string::String>,
13808 {
13809 self.psc_service_attachment_link = std::option::Option::Some(v.into());
13810 self
13811 }
13812
13813 /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
13814 ///
13815 /// # Example
13816 /// ```ignore,no_run
13817 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13818 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
13819 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
13820 /// ```
13821 pub fn set_or_clear_psc_service_attachment_link<T>(
13822 mut self,
13823 v: std::option::Option<T>,
13824 ) -> Self
13825 where
13826 T: std::convert::Into<std::string::String>,
13827 {
13828 self.psc_service_attachment_link = v.map(|x| x.into());
13829 self
13830 }
13831
13832 /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
13833 ///
13834 /// # Example
13835 /// ```ignore,no_run
13836 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
13837 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
13838 /// let x = PoolNodeConfig::new()
13839 /// .set_psc_auto_connections([
13840 /// PscAutoConnectionConfig::default()/* use setters */,
13841 /// PscAutoConnectionConfig::default()/* use (different) setters */,
13842 /// ]);
13843 /// ```
13844 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
13845 where
13846 T: std::iter::IntoIterator<Item = V>,
13847 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
13848 {
13849 use std::iter::Iterator;
13850 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
13851 self
13852 }
13853 }
13854
13855 impl wkt::message::Message for PoolNodeConfig {
13856 fn typename() -> &'static str {
13857 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
13858 }
13859 }
13860
13861 /// The current serving state of the database instance.
13862 ///
13863 /// # Working with unknown values
13864 ///
13865 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13866 /// additional enum variants at any time. Adding new variants is not considered
13867 /// a breaking change. Applications should write their code in anticipation of:
13868 ///
13869 /// - New values appearing in future releases of the client library, **and**
13870 /// - New values received dynamically, without application changes.
13871 ///
13872 /// Please consult the [Working with enums] section in the user guide for some
13873 /// guidelines.
13874 ///
13875 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13876 #[derive(Clone, Debug, PartialEq)]
13877 #[non_exhaustive]
13878 pub enum SqlInstanceState {
13879 /// The state of the instance is unknown.
13880 Unspecified,
13881 /// The instance is running, or has been stopped by owner.
13882 Runnable,
13883 /// The instance is not available, for example due to problems with billing.
13884 Suspended,
13885 /// The instance is being deleted.
13886 PendingDelete,
13887 /// The instance is being created.
13888 PendingCreate,
13889 /// The instance is down for maintenance.
13890 Maintenance,
13891 /// The creation of the instance failed or a fatal error occurred during
13892 /// maintenance.
13893 Failed,
13894 /// Deprecated
13895 #[deprecated]
13896 OnlineMaintenance,
13897 /// (Applicable to read pool nodes only.) The read pool node needs to be
13898 /// repaired. The database might be unavailable.
13899 Repairing,
13900 /// If set, the enum was initialized with an unknown value.
13901 ///
13902 /// Applications can examine the value using [SqlInstanceState::value] or
13903 /// [SqlInstanceState::name].
13904 UnknownValue(sql_instance_state::UnknownValue),
13905 }
13906
13907 #[doc(hidden)]
13908 pub mod sql_instance_state {
13909 #[allow(unused_imports)]
13910 use super::*;
13911 #[derive(Clone, Debug, PartialEq)]
13912 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13913 }
13914
13915 impl SqlInstanceState {
13916 /// Gets the enum value.
13917 ///
13918 /// Returns `None` if the enum contains an unknown value deserialized from
13919 /// the string representation of enums.
13920 pub fn value(&self) -> std::option::Option<i32> {
13921 match self {
13922 Self::Unspecified => std::option::Option::Some(0),
13923 Self::Runnable => std::option::Option::Some(1),
13924 Self::Suspended => std::option::Option::Some(2),
13925 Self::PendingDelete => std::option::Option::Some(3),
13926 Self::PendingCreate => std::option::Option::Some(4),
13927 Self::Maintenance => std::option::Option::Some(5),
13928 Self::Failed => std::option::Option::Some(6),
13929 Self::OnlineMaintenance => std::option::Option::Some(7),
13930 Self::Repairing => std::option::Option::Some(8),
13931 Self::UnknownValue(u) => u.0.value(),
13932 }
13933 }
13934
13935 /// Gets the enum value as a string.
13936 ///
13937 /// Returns `None` if the enum contains an unknown value deserialized from
13938 /// the integer representation of enums.
13939 pub fn name(&self) -> std::option::Option<&str> {
13940 match self {
13941 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
13942 Self::Runnable => std::option::Option::Some("RUNNABLE"),
13943 Self::Suspended => std::option::Option::Some("SUSPENDED"),
13944 Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
13945 Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
13946 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
13947 Self::Failed => std::option::Option::Some("FAILED"),
13948 Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
13949 Self::Repairing => std::option::Option::Some("REPAIRING"),
13950 Self::UnknownValue(u) => u.0.name(),
13951 }
13952 }
13953 }
13954
13955 impl std::default::Default for SqlInstanceState {
13956 fn default() -> Self {
13957 use std::convert::From;
13958 Self::from(0)
13959 }
13960 }
13961
13962 impl std::fmt::Display for SqlInstanceState {
13963 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13964 wkt::internal::display_enum(f, self.name(), self.value())
13965 }
13966 }
13967
13968 impl std::convert::From<i32> for SqlInstanceState {
13969 fn from(value: i32) -> Self {
13970 match value {
13971 0 => Self::Unspecified,
13972 1 => Self::Runnable,
13973 2 => Self::Suspended,
13974 3 => Self::PendingDelete,
13975 4 => Self::PendingCreate,
13976 5 => Self::Maintenance,
13977 6 => Self::Failed,
13978 7 => Self::OnlineMaintenance,
13979 8 => Self::Repairing,
13980 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
13981 wkt::internal::UnknownEnumValue::Integer(value),
13982 )),
13983 }
13984 }
13985 }
13986
13987 impl std::convert::From<&str> for SqlInstanceState {
13988 fn from(value: &str) -> Self {
13989 use std::string::ToString;
13990 match value {
13991 "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
13992 "RUNNABLE" => Self::Runnable,
13993 "SUSPENDED" => Self::Suspended,
13994 "PENDING_DELETE" => Self::PendingDelete,
13995 "PENDING_CREATE" => Self::PendingCreate,
13996 "MAINTENANCE" => Self::Maintenance,
13997 "FAILED" => Self::Failed,
13998 "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
13999 "REPAIRING" => Self::Repairing,
14000 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
14001 wkt::internal::UnknownEnumValue::String(value.to_string()),
14002 )),
14003 }
14004 }
14005 }
14006
14007 impl serde::ser::Serialize for SqlInstanceState {
14008 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14009 where
14010 S: serde::Serializer,
14011 {
14012 match self {
14013 Self::Unspecified => serializer.serialize_i32(0),
14014 Self::Runnable => serializer.serialize_i32(1),
14015 Self::Suspended => serializer.serialize_i32(2),
14016 Self::PendingDelete => serializer.serialize_i32(3),
14017 Self::PendingCreate => serializer.serialize_i32(4),
14018 Self::Maintenance => serializer.serialize_i32(5),
14019 Self::Failed => serializer.serialize_i32(6),
14020 Self::OnlineMaintenance => serializer.serialize_i32(7),
14021 Self::Repairing => serializer.serialize_i32(8),
14022 Self::UnknownValue(u) => u.0.serialize(serializer),
14023 }
14024 }
14025 }
14026
14027 impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
14028 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14029 where
14030 D: serde::Deserializer<'de>,
14031 {
14032 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
14033 ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
14034 ))
14035 }
14036 }
14037
14038 /// The SQL network architecture for the instance.
14039 ///
14040 /// # Working with unknown values
14041 ///
14042 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14043 /// additional enum variants at any time. Adding new variants is not considered
14044 /// a breaking change. Applications should write their code in anticipation of:
14045 ///
14046 /// - New values appearing in future releases of the client library, **and**
14047 /// - New values received dynamically, without application changes.
14048 ///
14049 /// Please consult the [Working with enums] section in the user guide for some
14050 /// guidelines.
14051 ///
14052 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14053 #[derive(Clone, Debug, PartialEq)]
14054 #[non_exhaustive]
14055 pub enum SqlNetworkArchitecture {
14056 #[allow(missing_docs)]
14057 Unspecified,
14058 /// The instance uses the new network architecture.
14059 NewNetworkArchitecture,
14060 /// The instance uses the old network architecture.
14061 OldNetworkArchitecture,
14062 /// If set, the enum was initialized with an unknown value.
14063 ///
14064 /// Applications can examine the value using [SqlNetworkArchitecture::value] or
14065 /// [SqlNetworkArchitecture::name].
14066 UnknownValue(sql_network_architecture::UnknownValue),
14067 }
14068
14069 #[doc(hidden)]
14070 pub mod sql_network_architecture {
14071 #[allow(unused_imports)]
14072 use super::*;
14073 #[derive(Clone, Debug, PartialEq)]
14074 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14075 }
14076
14077 impl SqlNetworkArchitecture {
14078 /// Gets the enum value.
14079 ///
14080 /// Returns `None` if the enum contains an unknown value deserialized from
14081 /// the string representation of enums.
14082 pub fn value(&self) -> std::option::Option<i32> {
14083 match self {
14084 Self::Unspecified => std::option::Option::Some(0),
14085 Self::NewNetworkArchitecture => std::option::Option::Some(1),
14086 Self::OldNetworkArchitecture => std::option::Option::Some(2),
14087 Self::UnknownValue(u) => u.0.value(),
14088 }
14089 }
14090
14091 /// Gets the enum value as a string.
14092 ///
14093 /// Returns `None` if the enum contains an unknown value deserialized from
14094 /// the integer representation of enums.
14095 pub fn name(&self) -> std::option::Option<&str> {
14096 match self {
14097 Self::Unspecified => {
14098 std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
14099 }
14100 Self::NewNetworkArchitecture => {
14101 std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
14102 }
14103 Self::OldNetworkArchitecture => {
14104 std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
14105 }
14106 Self::UnknownValue(u) => u.0.name(),
14107 }
14108 }
14109 }
14110
14111 impl std::default::Default for SqlNetworkArchitecture {
14112 fn default() -> Self {
14113 use std::convert::From;
14114 Self::from(0)
14115 }
14116 }
14117
14118 impl std::fmt::Display for SqlNetworkArchitecture {
14119 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14120 wkt::internal::display_enum(f, self.name(), self.value())
14121 }
14122 }
14123
14124 impl std::convert::From<i32> for SqlNetworkArchitecture {
14125 fn from(value: i32) -> Self {
14126 match value {
14127 0 => Self::Unspecified,
14128 1 => Self::NewNetworkArchitecture,
14129 2 => Self::OldNetworkArchitecture,
14130 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
14131 wkt::internal::UnknownEnumValue::Integer(value),
14132 )),
14133 }
14134 }
14135 }
14136
14137 impl std::convert::From<&str> for SqlNetworkArchitecture {
14138 fn from(value: &str) -> Self {
14139 use std::string::ToString;
14140 match value {
14141 "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
14142 "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
14143 "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
14144 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
14145 wkt::internal::UnknownEnumValue::String(value.to_string()),
14146 )),
14147 }
14148 }
14149 }
14150
14151 impl serde::ser::Serialize for SqlNetworkArchitecture {
14152 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14153 where
14154 S: serde::Serializer,
14155 {
14156 match self {
14157 Self::Unspecified => serializer.serialize_i32(0),
14158 Self::NewNetworkArchitecture => serializer.serialize_i32(1),
14159 Self::OldNetworkArchitecture => serializer.serialize_i32(2),
14160 Self::UnknownValue(u) => u.0.serialize(serializer),
14161 }
14162 }
14163 }
14164
14165 impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
14166 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14167 where
14168 D: serde::Deserializer<'de>,
14169 {
14170 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
14171 ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
14172 ))
14173 }
14174 }
14175
14176 /// State of the integration with Database Center.
14177 ///
14178 /// # Working with unknown values
14179 ///
14180 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14181 /// additional enum variants at any time. Adding new variants is not considered
14182 /// a breaking change. Applications should write their code in anticipation of:
14183 ///
14184 /// - New values appearing in future releases of the client library, **and**
14185 /// - New values received dynamically, without application changes.
14186 ///
14187 /// Please consult the [Working with enums] section in the user guide for some
14188 /// guidelines.
14189 ///
14190 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14191 #[derive(Clone, Debug, PartialEq)]
14192 #[non_exhaustive]
14193 pub enum DatabaseCenterIntegration {
14194 /// Default value. The integration state is unspecified. When unspecified,
14195 /// Database Center integration is enabled by default.
14196 Unspecified,
14197 /// Database Center integration is enabled.
14198 Enabled,
14199 /// Database Center integration is disabled.
14200 Disabled,
14201 /// If set, the enum was initialized with an unknown value.
14202 ///
14203 /// Applications can examine the value using [DatabaseCenterIntegration::value] or
14204 /// [DatabaseCenterIntegration::name].
14205 UnknownValue(database_center_integration::UnknownValue),
14206 }
14207
14208 #[doc(hidden)]
14209 pub mod database_center_integration {
14210 #[allow(unused_imports)]
14211 use super::*;
14212 #[derive(Clone, Debug, PartialEq)]
14213 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14214 }
14215
14216 impl DatabaseCenterIntegration {
14217 /// Gets the enum value.
14218 ///
14219 /// Returns `None` if the enum contains an unknown value deserialized from
14220 /// the string representation of enums.
14221 pub fn value(&self) -> std::option::Option<i32> {
14222 match self {
14223 Self::Unspecified => std::option::Option::Some(0),
14224 Self::Enabled => std::option::Option::Some(1),
14225 Self::Disabled => std::option::Option::Some(2),
14226 Self::UnknownValue(u) => u.0.value(),
14227 }
14228 }
14229
14230 /// Gets the enum value as a string.
14231 ///
14232 /// Returns `None` if the enum contains an unknown value deserialized from
14233 /// the integer representation of enums.
14234 pub fn name(&self) -> std::option::Option<&str> {
14235 match self {
14236 Self::Unspecified => {
14237 std::option::Option::Some("DATABASE_CENTER_INTEGRATION_UNSPECIFIED")
14238 }
14239 Self::Enabled => std::option::Option::Some("ENABLED"),
14240 Self::Disabled => std::option::Option::Some("DISABLED"),
14241 Self::UnknownValue(u) => u.0.name(),
14242 }
14243 }
14244 }
14245
14246 impl std::default::Default for DatabaseCenterIntegration {
14247 fn default() -> Self {
14248 use std::convert::From;
14249 Self::from(0)
14250 }
14251 }
14252
14253 impl std::fmt::Display for DatabaseCenterIntegration {
14254 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14255 wkt::internal::display_enum(f, self.name(), self.value())
14256 }
14257 }
14258
14259 impl std::convert::From<i32> for DatabaseCenterIntegration {
14260 fn from(value: i32) -> Self {
14261 match value {
14262 0 => Self::Unspecified,
14263 1 => Self::Enabled,
14264 2 => Self::Disabled,
14265 _ => Self::UnknownValue(database_center_integration::UnknownValue(
14266 wkt::internal::UnknownEnumValue::Integer(value),
14267 )),
14268 }
14269 }
14270 }
14271
14272 impl std::convert::From<&str> for DatabaseCenterIntegration {
14273 fn from(value: &str) -> Self {
14274 use std::string::ToString;
14275 match value {
14276 "DATABASE_CENTER_INTEGRATION_UNSPECIFIED" => Self::Unspecified,
14277 "ENABLED" => Self::Enabled,
14278 "DISABLED" => Self::Disabled,
14279 _ => Self::UnknownValue(database_center_integration::UnknownValue(
14280 wkt::internal::UnknownEnumValue::String(value.to_string()),
14281 )),
14282 }
14283 }
14284 }
14285
14286 impl serde::ser::Serialize for DatabaseCenterIntegration {
14287 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14288 where
14289 S: serde::Serializer,
14290 {
14291 match self {
14292 Self::Unspecified => serializer.serialize_i32(0),
14293 Self::Enabled => serializer.serialize_i32(1),
14294 Self::Disabled => serializer.serialize_i32(2),
14295 Self::UnknownValue(u) => u.0.serialize(serializer),
14296 }
14297 }
14298 }
14299
14300 impl<'de> serde::de::Deserialize<'de> for DatabaseCenterIntegration {
14301 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14302 where
14303 D: serde::Deserializer<'de>,
14304 {
14305 deserializer.deserialize_any(
14306 wkt::internal::EnumVisitor::<DatabaseCenterIntegration>::new(
14307 ".google.cloud.sql.v1.DatabaseInstance.DatabaseCenterIntegration",
14308 ),
14309 )
14310 }
14311 }
14312}
14313
14314/// Gemini instance configuration.
14315#[derive(Clone, Default, PartialEq)]
14316#[non_exhaustive]
14317pub struct GeminiInstanceConfig {
14318 /// Output only. Whether Gemini is enabled.
14319 pub entitled: std::option::Option<bool>,
14320
14321 /// Output only. Whether the vacuum management is enabled.
14322 pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
14323
14324 /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
14325 pub oom_session_cancel_enabled: std::option::Option<bool>,
14326
14327 /// Output only. Whether the active query is enabled.
14328 pub active_query_enabled: std::option::Option<bool>,
14329
14330 /// Output only. Whether the index advisor is enabled.
14331 pub index_advisor_enabled: std::option::Option<bool>,
14332
14333 /// Output only. Whether the flag recommender is enabled.
14334 pub flag_recommender_enabled: std::option::Option<bool>,
14335
14336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14337}
14338
14339impl GeminiInstanceConfig {
14340 /// Creates a new default instance.
14341 pub fn new() -> Self {
14342 std::default::Default::default()
14343 }
14344
14345 /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
14346 ///
14347 /// # Example
14348 /// ```ignore,no_run
14349 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14350 /// let x = GeminiInstanceConfig::new().set_entitled(true);
14351 /// ```
14352 pub fn set_entitled<T>(mut self, v: T) -> Self
14353 where
14354 T: std::convert::Into<bool>,
14355 {
14356 self.entitled = std::option::Option::Some(v.into());
14357 self
14358 }
14359
14360 /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
14361 ///
14362 /// # Example
14363 /// ```ignore,no_run
14364 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14365 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
14366 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
14367 /// ```
14368 pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
14369 where
14370 T: std::convert::Into<bool>,
14371 {
14372 self.entitled = v.map(|x| x.into());
14373 self
14374 }
14375
14376 /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
14377 ///
14378 /// # Example
14379 /// ```ignore,no_run
14380 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14381 /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
14382 /// ```
14383 pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
14384 where
14385 T: std::convert::Into<bool>,
14386 {
14387 self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
14388 self
14389 }
14390
14391 /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
14392 ///
14393 /// # Example
14394 /// ```ignore,no_run
14395 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14396 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
14397 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
14398 /// ```
14399 pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14400 where
14401 T: std::convert::Into<bool>,
14402 {
14403 self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
14404 self
14405 }
14406
14407 /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
14408 ///
14409 /// # Example
14410 /// ```ignore,no_run
14411 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14412 /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
14413 /// ```
14414 pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
14415 where
14416 T: std::convert::Into<bool>,
14417 {
14418 self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
14419 self
14420 }
14421
14422 /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
14423 ///
14424 /// # Example
14425 /// ```ignore,no_run
14426 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14427 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
14428 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
14429 /// ```
14430 pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14431 where
14432 T: std::convert::Into<bool>,
14433 {
14434 self.oom_session_cancel_enabled = v.map(|x| x.into());
14435 self
14436 }
14437
14438 /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
14439 ///
14440 /// # Example
14441 /// ```ignore,no_run
14442 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14443 /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
14444 /// ```
14445 pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
14446 where
14447 T: std::convert::Into<bool>,
14448 {
14449 self.active_query_enabled = std::option::Option::Some(v.into());
14450 self
14451 }
14452
14453 /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
14454 ///
14455 /// # Example
14456 /// ```ignore,no_run
14457 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14458 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
14459 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
14460 /// ```
14461 pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14462 where
14463 T: std::convert::Into<bool>,
14464 {
14465 self.active_query_enabled = v.map(|x| x.into());
14466 self
14467 }
14468
14469 /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
14470 ///
14471 /// # Example
14472 /// ```ignore,no_run
14473 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14474 /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
14475 /// ```
14476 pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
14477 where
14478 T: std::convert::Into<bool>,
14479 {
14480 self.index_advisor_enabled = std::option::Option::Some(v.into());
14481 self
14482 }
14483
14484 /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
14485 ///
14486 /// # Example
14487 /// ```ignore,no_run
14488 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14489 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
14490 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
14491 /// ```
14492 pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14493 where
14494 T: std::convert::Into<bool>,
14495 {
14496 self.index_advisor_enabled = v.map(|x| x.into());
14497 self
14498 }
14499
14500 /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
14501 ///
14502 /// # Example
14503 /// ```ignore,no_run
14504 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14505 /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
14506 /// ```
14507 pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
14508 where
14509 T: std::convert::Into<bool>,
14510 {
14511 self.flag_recommender_enabled = std::option::Option::Some(v.into());
14512 self
14513 }
14514
14515 /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
14516 ///
14517 /// # Example
14518 /// ```ignore,no_run
14519 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
14520 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
14521 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
14522 /// ```
14523 pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14524 where
14525 T: std::convert::Into<bool>,
14526 {
14527 self.flag_recommender_enabled = v.map(|x| x.into());
14528 self
14529 }
14530}
14531
14532impl wkt::message::Message for GeminiInstanceConfig {
14533 fn typename() -> &'static str {
14534 "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
14535 }
14536}
14537
14538/// A primary instance and disaster recovery (DR) replica pair.
14539/// A DR replica is a cross-region replica that you designate for failover in
14540/// the event that the primary instance experiences regional failure.
14541/// Applicable to MySQL and PostgreSQL.
14542#[derive(Clone, Default, PartialEq)]
14543#[non_exhaustive]
14544pub struct ReplicationCluster {
14545 /// Output only. If set, this field indicates this instance has a private
14546 /// service access (PSA) DNS endpoint that is pointing to the primary instance
14547 /// of the cluster. If this instance is the primary, then the DNS endpoint
14548 /// points to this instance. After a switchover or replica failover operation,
14549 /// this DNS endpoint points to the promoted instance. This is a read-only
14550 /// field, returned to the user as information. This field can exist even if a
14551 /// standalone instance doesn't have a DR replica yet or the DR replica is
14552 /// deleted.
14553 pub psa_write_endpoint: std::string::String,
14554
14555 /// Optional. If the instance is a primary instance, then this field identifies
14556 /// the disaster recovery (DR) replica. A DR replica is an optional
14557 /// configuration for Enterprise Plus edition instances. If the instance is a
14558 /// read replica, then the field is not set. Set this field to a replica name
14559 /// to designate a DR replica for a primary instance. Remove the replica name
14560 /// to remove the DR replica designation.
14561 pub failover_dr_replica_name: std::string::String,
14562
14563 /// Output only. Read-only field that indicates whether the replica is a DR
14564 /// replica. This field is not set if the instance is a primary instance.
14565 pub dr_replica: bool,
14566
14567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14568}
14569
14570impl ReplicationCluster {
14571 /// Creates a new default instance.
14572 pub fn new() -> Self {
14573 std::default::Default::default()
14574 }
14575
14576 /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
14577 ///
14578 /// # Example
14579 /// ```ignore,no_run
14580 /// # use google_cloud_sql_v1::model::ReplicationCluster;
14581 /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
14582 /// ```
14583 pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
14584 mut self,
14585 v: T,
14586 ) -> Self {
14587 self.psa_write_endpoint = v.into();
14588 self
14589 }
14590
14591 /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
14592 ///
14593 /// # Example
14594 /// ```ignore,no_run
14595 /// # use google_cloud_sql_v1::model::ReplicationCluster;
14596 /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
14597 /// ```
14598 pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
14599 mut self,
14600 v: T,
14601 ) -> Self {
14602 self.failover_dr_replica_name = v.into();
14603 self
14604 }
14605
14606 /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
14607 ///
14608 /// # Example
14609 /// ```ignore,no_run
14610 /// # use google_cloud_sql_v1::model::ReplicationCluster;
14611 /// let x = ReplicationCluster::new().set_dr_replica(true);
14612 /// ```
14613 pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14614 self.dr_replica = v.into();
14615 self
14616 }
14617}
14618
14619impl wkt::message::Message for ReplicationCluster {
14620 fn typename() -> &'static str {
14621 "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
14622 }
14623}
14624
14625/// An available database version. It can be a major or a minor version.
14626#[derive(Clone, Default, PartialEq)]
14627#[non_exhaustive]
14628pub struct AvailableDatabaseVersion {
14629 /// The version's major version name.
14630 pub major_version: std::option::Option<std::string::String>,
14631
14632 /// The database version name. For MySQL 8.0, this string provides the database
14633 /// major and minor version.
14634 pub name: std::option::Option<std::string::String>,
14635
14636 /// The database version's display name.
14637 pub display_name: std::option::Option<std::string::String>,
14638
14639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14640}
14641
14642impl AvailableDatabaseVersion {
14643 /// Creates a new default instance.
14644 pub fn new() -> Self {
14645 std::default::Default::default()
14646 }
14647
14648 /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
14649 ///
14650 /// # Example
14651 /// ```ignore,no_run
14652 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
14653 /// let x = AvailableDatabaseVersion::new().set_major_version("example");
14654 /// ```
14655 pub fn set_major_version<T>(mut self, v: T) -> Self
14656 where
14657 T: std::convert::Into<std::string::String>,
14658 {
14659 self.major_version = std::option::Option::Some(v.into());
14660 self
14661 }
14662
14663 /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
14664 ///
14665 /// # Example
14666 /// ```ignore,no_run
14667 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
14668 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
14669 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
14670 /// ```
14671 pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
14672 where
14673 T: std::convert::Into<std::string::String>,
14674 {
14675 self.major_version = v.map(|x| x.into());
14676 self
14677 }
14678
14679 /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
14680 ///
14681 /// # Example
14682 /// ```ignore,no_run
14683 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
14684 /// let x = AvailableDatabaseVersion::new().set_name("example");
14685 /// ```
14686 pub fn set_name<T>(mut self, v: T) -> Self
14687 where
14688 T: std::convert::Into<std::string::String>,
14689 {
14690 self.name = std::option::Option::Some(v.into());
14691 self
14692 }
14693
14694 /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
14695 ///
14696 /// # Example
14697 /// ```ignore,no_run
14698 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
14699 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
14700 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
14701 /// ```
14702 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
14703 where
14704 T: std::convert::Into<std::string::String>,
14705 {
14706 self.name = v.map(|x| x.into());
14707 self
14708 }
14709
14710 /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
14711 ///
14712 /// # Example
14713 /// ```ignore,no_run
14714 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
14715 /// let x = AvailableDatabaseVersion::new().set_display_name("example");
14716 /// ```
14717 pub fn set_display_name<T>(mut self, v: T) -> Self
14718 where
14719 T: std::convert::Into<std::string::String>,
14720 {
14721 self.display_name = std::option::Option::Some(v.into());
14722 self
14723 }
14724
14725 /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
14726 ///
14727 /// # Example
14728 /// ```ignore,no_run
14729 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
14730 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
14731 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
14732 /// ```
14733 pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
14734 where
14735 T: std::convert::Into<std::string::String>,
14736 {
14737 self.display_name = v.map(|x| x.into());
14738 self
14739 }
14740}
14741
14742impl wkt::message::Message for AvailableDatabaseVersion {
14743 fn typename() -> &'static str {
14744 "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
14745 }
14746}
14747
14748/// Reschedule options for maintenance windows.
14749#[derive(Clone, Default, PartialEq)]
14750#[non_exhaustive]
14751pub struct SqlInstancesRescheduleMaintenanceRequestBody {
14752 /// Required. The type of the reschedule the user wants.
14753 pub reschedule: std::option::Option<
14754 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
14755 >,
14756
14757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14758}
14759
14760impl SqlInstancesRescheduleMaintenanceRequestBody {
14761 /// Creates a new default instance.
14762 pub fn new() -> Self {
14763 std::default::Default::default()
14764 }
14765
14766 /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
14767 ///
14768 /// # Example
14769 /// ```ignore,no_run
14770 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
14771 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14772 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
14773 /// ```
14774 pub fn set_reschedule<T>(mut self, v: T) -> Self
14775 where
14776 T: std::convert::Into<
14777 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
14778 >,
14779 {
14780 self.reschedule = std::option::Option::Some(v.into());
14781 self
14782 }
14783
14784 /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
14785 ///
14786 /// # Example
14787 /// ```ignore,no_run
14788 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
14789 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14790 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
14791 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
14792 /// ```
14793 pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
14794 where
14795 T: std::convert::Into<
14796 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
14797 >,
14798 {
14799 self.reschedule = v.map(|x| x.into());
14800 self
14801 }
14802}
14803
14804impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
14805 fn typename() -> &'static str {
14806 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
14807 }
14808}
14809
14810/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
14811pub mod sql_instances_reschedule_maintenance_request_body {
14812 #[allow(unused_imports)]
14813 use super::*;
14814
14815 #[allow(missing_docs)]
14816 #[derive(Clone, Default, PartialEq)]
14817 #[non_exhaustive]
14818 pub struct Reschedule {
14819 /// Required. The type of the reschedule.
14820 pub reschedule_type:
14821 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
14822
14823 /// Optional. Timestamp when the maintenance shall be rescheduled to if
14824 /// reschedule_type=SPECIFIC_TIME, in
14825 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
14826 /// `2012-11-15T16:19:00.094Z`.
14827 pub schedule_time: std::option::Option<wkt::Timestamp>,
14828
14829 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14830 }
14831
14832 impl Reschedule {
14833 /// Creates a new default instance.
14834 pub fn new() -> Self {
14835 std::default::Default::default()
14836 }
14837
14838 /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
14839 ///
14840 /// # Example
14841 /// ```ignore,no_run
14842 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14843 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
14844 /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
14845 /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
14846 /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
14847 /// ```
14848 pub fn set_reschedule_type<
14849 T: std::convert::Into<
14850 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
14851 >,
14852 >(
14853 mut self,
14854 v: T,
14855 ) -> Self {
14856 self.reschedule_type = v.into();
14857 self
14858 }
14859
14860 /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
14861 ///
14862 /// # Example
14863 /// ```ignore,no_run
14864 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14865 /// use wkt::Timestamp;
14866 /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
14867 /// ```
14868 pub fn set_schedule_time<T>(mut self, v: T) -> Self
14869 where
14870 T: std::convert::Into<wkt::Timestamp>,
14871 {
14872 self.schedule_time = std::option::Option::Some(v.into());
14873 self
14874 }
14875
14876 /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
14877 ///
14878 /// # Example
14879 /// ```ignore,no_run
14880 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
14881 /// use wkt::Timestamp;
14882 /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
14883 /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
14884 /// ```
14885 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
14886 where
14887 T: std::convert::Into<wkt::Timestamp>,
14888 {
14889 self.schedule_time = v.map(|x| x.into());
14890 self
14891 }
14892 }
14893
14894 impl wkt::message::Message for Reschedule {
14895 fn typename() -> &'static str {
14896 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
14897 }
14898 }
14899
14900 /// Enum for [RescheduleType].
14901 ///
14902 /// # Working with unknown values
14903 ///
14904 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14905 /// additional enum variants at any time. Adding new variants is not considered
14906 /// a breaking change. Applications should write their code in anticipation of:
14907 ///
14908 /// - New values appearing in future releases of the client library, **and**
14909 /// - New values received dynamically, without application changes.
14910 ///
14911 /// Please consult the [Working with enums] section in the user guide for some
14912 /// guidelines.
14913 ///
14914 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14915 #[derive(Clone, Debug, PartialEq)]
14916 #[non_exhaustive]
14917 pub enum RescheduleType {
14918 #[allow(missing_docs)]
14919 Unspecified,
14920 /// Reschedules maintenance to happen now (within 5 minutes).
14921 Immediate,
14922 /// Reschedules maintenance to occur within one week from the originally
14923 /// scheduled day and time.
14924 NextAvailableWindow,
14925 /// Reschedules maintenance to a specific time and day.
14926 SpecificTime,
14927 /// If set, the enum was initialized with an unknown value.
14928 ///
14929 /// Applications can examine the value using [RescheduleType::value] or
14930 /// [RescheduleType::name].
14931 UnknownValue(reschedule_type::UnknownValue),
14932 }
14933
14934 #[doc(hidden)]
14935 pub mod reschedule_type {
14936 #[allow(unused_imports)]
14937 use super::*;
14938 #[derive(Clone, Debug, PartialEq)]
14939 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14940 }
14941
14942 impl RescheduleType {
14943 /// Gets the enum value.
14944 ///
14945 /// Returns `None` if the enum contains an unknown value deserialized from
14946 /// the string representation of enums.
14947 pub fn value(&self) -> std::option::Option<i32> {
14948 match self {
14949 Self::Unspecified => std::option::Option::Some(0),
14950 Self::Immediate => std::option::Option::Some(1),
14951 Self::NextAvailableWindow => std::option::Option::Some(2),
14952 Self::SpecificTime => std::option::Option::Some(3),
14953 Self::UnknownValue(u) => u.0.value(),
14954 }
14955 }
14956
14957 /// Gets the enum value as a string.
14958 ///
14959 /// Returns `None` if the enum contains an unknown value deserialized from
14960 /// the integer representation of enums.
14961 pub fn name(&self) -> std::option::Option<&str> {
14962 match self {
14963 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
14964 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
14965 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
14966 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
14967 Self::UnknownValue(u) => u.0.name(),
14968 }
14969 }
14970 }
14971
14972 impl std::default::Default for RescheduleType {
14973 fn default() -> Self {
14974 use std::convert::From;
14975 Self::from(0)
14976 }
14977 }
14978
14979 impl std::fmt::Display for RescheduleType {
14980 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14981 wkt::internal::display_enum(f, self.name(), self.value())
14982 }
14983 }
14984
14985 impl std::convert::From<i32> for RescheduleType {
14986 fn from(value: i32) -> Self {
14987 match value {
14988 0 => Self::Unspecified,
14989 1 => Self::Immediate,
14990 2 => Self::NextAvailableWindow,
14991 3 => Self::SpecificTime,
14992 _ => Self::UnknownValue(reschedule_type::UnknownValue(
14993 wkt::internal::UnknownEnumValue::Integer(value),
14994 )),
14995 }
14996 }
14997 }
14998
14999 impl std::convert::From<&str> for RescheduleType {
15000 fn from(value: &str) -> Self {
15001 use std::string::ToString;
15002 match value {
15003 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
15004 "IMMEDIATE" => Self::Immediate,
15005 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
15006 "SPECIFIC_TIME" => Self::SpecificTime,
15007 _ => Self::UnknownValue(reschedule_type::UnknownValue(
15008 wkt::internal::UnknownEnumValue::String(value.to_string()),
15009 )),
15010 }
15011 }
15012 }
15013
15014 impl serde::ser::Serialize for RescheduleType {
15015 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15016 where
15017 S: serde::Serializer,
15018 {
15019 match self {
15020 Self::Unspecified => serializer.serialize_i32(0),
15021 Self::Immediate => serializer.serialize_i32(1),
15022 Self::NextAvailableWindow => serializer.serialize_i32(2),
15023 Self::SpecificTime => serializer.serialize_i32(3),
15024 Self::UnknownValue(u) => u.0.serialize(serializer),
15025 }
15026 }
15027 }
15028
15029 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
15030 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15031 where
15032 D: serde::Deserializer<'de>,
15033 {
15034 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
15035 ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
15036 ))
15037 }
15038 }
15039}
15040
15041/// Database instance demote primary instance context.
15042#[derive(Clone, Default, PartialEq)]
15043#[non_exhaustive]
15044pub struct DemoteMasterContext {
15045 /// This is always `sql#demoteMasterContext`.
15046 pub kind: std::string::String,
15047
15048 /// Verify the GTID consistency for demote operation. Default value:
15049 /// `True`. Setting this flag to `false` enables you to bypass the GTID
15050 /// consistency check between on-premises primary instance and Cloud SQL
15051 /// instance during the demotion operation but also exposes you to the risk of
15052 /// future replication failures. Change the value only if you know the reason
15053 /// for the GTID divergence and are confident that doing so will not cause any
15054 /// replication issues.
15055 pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
15056
15057 /// The name of the instance which will act as on-premises primary instance
15058 /// in the replication setup.
15059 pub master_instance_name: std::string::String,
15060
15061 /// Configuration specific to read-replicas replicating from the on-premises
15062 /// primary instance.
15063 pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
15064
15065 /// Flag to skip replication setup on the instance.
15066 pub skip_replication_setup: bool,
15067
15068 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15069}
15070
15071impl DemoteMasterContext {
15072 /// Creates a new default instance.
15073 pub fn new() -> Self {
15074 std::default::Default::default()
15075 }
15076
15077 /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
15078 ///
15079 /// # Example
15080 /// ```ignore,no_run
15081 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
15082 /// let x = DemoteMasterContext::new().set_kind("example");
15083 /// ```
15084 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15085 self.kind = v.into();
15086 self
15087 }
15088
15089 /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
15090 ///
15091 /// # Example
15092 /// ```ignore,no_run
15093 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
15094 /// use wkt::BoolValue;
15095 /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
15096 /// ```
15097 pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
15098 where
15099 T: std::convert::Into<wkt::BoolValue>,
15100 {
15101 self.verify_gtid_consistency = std::option::Option::Some(v.into());
15102 self
15103 }
15104
15105 /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
15106 ///
15107 /// # Example
15108 /// ```ignore,no_run
15109 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
15110 /// use wkt::BoolValue;
15111 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
15112 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
15113 /// ```
15114 pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
15115 where
15116 T: std::convert::Into<wkt::BoolValue>,
15117 {
15118 self.verify_gtid_consistency = v.map(|x| x.into());
15119 self
15120 }
15121
15122 /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
15123 ///
15124 /// # Example
15125 /// ```ignore,no_run
15126 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
15127 /// let x = DemoteMasterContext::new().set_master_instance_name("example");
15128 /// ```
15129 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
15130 mut self,
15131 v: T,
15132 ) -> Self {
15133 self.master_instance_name = v.into();
15134 self
15135 }
15136
15137 /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
15138 ///
15139 /// # Example
15140 /// ```ignore,no_run
15141 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
15142 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
15143 /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
15144 /// ```
15145 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
15146 where
15147 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
15148 {
15149 self.replica_configuration = std::option::Option::Some(v.into());
15150 self
15151 }
15152
15153 /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
15154 ///
15155 /// # Example
15156 /// ```ignore,no_run
15157 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
15158 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
15159 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
15160 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
15161 /// ```
15162 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15163 where
15164 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
15165 {
15166 self.replica_configuration = v.map(|x| x.into());
15167 self
15168 }
15169
15170 /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
15171 ///
15172 /// # Example
15173 /// ```ignore,no_run
15174 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
15175 /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
15176 /// ```
15177 pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15178 self.skip_replication_setup = v.into();
15179 self
15180 }
15181}
15182
15183impl wkt::message::Message for DemoteMasterContext {
15184 fn typename() -> &'static str {
15185 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
15186 }
15187}
15188
15189/// This context is used to demote an existing standalone instance to be
15190/// a Cloud SQL read replica for an external database server.
15191#[derive(Clone, Default, PartialEq)]
15192#[non_exhaustive]
15193pub struct DemoteContext {
15194 /// This is always `sql#demoteContext`.
15195 pub kind: std::string::String,
15196
15197 /// Required. The name of the instance which acts as the on-premises primary
15198 /// instance in the replication setup.
15199 pub source_representative_instance_name: std::string::String,
15200
15201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15202}
15203
15204impl DemoteContext {
15205 /// Creates a new default instance.
15206 pub fn new() -> Self {
15207 std::default::Default::default()
15208 }
15209
15210 /// Sets the value of [kind][crate::model::DemoteContext::kind].
15211 ///
15212 /// # Example
15213 /// ```ignore,no_run
15214 /// # use google_cloud_sql_v1::model::DemoteContext;
15215 /// let x = DemoteContext::new().set_kind("example");
15216 /// ```
15217 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15218 self.kind = v.into();
15219 self
15220 }
15221
15222 /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
15223 ///
15224 /// # Example
15225 /// ```ignore,no_run
15226 /// # use google_cloud_sql_v1::model::DemoteContext;
15227 /// let x = DemoteContext::new().set_source_representative_instance_name("example");
15228 /// ```
15229 pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
15230 mut self,
15231 v: T,
15232 ) -> Self {
15233 self.source_representative_instance_name = v.into();
15234 self
15235 }
15236}
15237
15238impl wkt::message::Message for DemoteContext {
15239 fn typename() -> &'static str {
15240 "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
15241 }
15242}
15243
15244/// Database instance failover context.
15245#[derive(Clone, Default, PartialEq)]
15246#[non_exhaustive]
15247pub struct FailoverContext {
15248 /// The current settings version of this instance. Request will be rejected if
15249 /// this version doesn't match the current settings version.
15250 pub settings_version: i64,
15251
15252 /// This is always `sql#failoverContext`.
15253 pub kind: std::string::String,
15254
15255 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15256}
15257
15258impl FailoverContext {
15259 /// Creates a new default instance.
15260 pub fn new() -> Self {
15261 std::default::Default::default()
15262 }
15263
15264 /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
15265 ///
15266 /// # Example
15267 /// ```ignore,no_run
15268 /// # use google_cloud_sql_v1::model::FailoverContext;
15269 /// let x = FailoverContext::new().set_settings_version(42);
15270 /// ```
15271 pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15272 self.settings_version = v.into();
15273 self
15274 }
15275
15276 /// Sets the value of [kind][crate::model::FailoverContext::kind].
15277 ///
15278 /// # Example
15279 /// ```ignore,no_run
15280 /// # use google_cloud_sql_v1::model::FailoverContext;
15281 /// let x = FailoverContext::new().set_kind("example");
15282 /// ```
15283 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15284 self.kind = v.into();
15285 self
15286 }
15287}
15288
15289impl wkt::message::Message for FailoverContext {
15290 fn typename() -> &'static str {
15291 "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
15292 }
15293}
15294
15295/// Database instance restore from backup context.
15296/// Backup context contains source instance id and project id.
15297#[derive(Clone, Default, PartialEq)]
15298#[non_exhaustive]
15299pub struct RestoreBackupContext {
15300 /// This is always `sql#restoreBackupContext`.
15301 pub kind: std::string::String,
15302
15303 /// The ID of the backup run to restore from.
15304 pub backup_run_id: i64,
15305
15306 /// The ID of the instance that the backup was taken from.
15307 pub instance_id: std::string::String,
15308
15309 /// The full project ID of the source instance.
15310 pub project: std::string::String,
15311
15312 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15313}
15314
15315impl RestoreBackupContext {
15316 /// Creates a new default instance.
15317 pub fn new() -> Self {
15318 std::default::Default::default()
15319 }
15320
15321 /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
15322 ///
15323 /// # Example
15324 /// ```ignore,no_run
15325 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
15326 /// let x = RestoreBackupContext::new().set_kind("example");
15327 /// ```
15328 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15329 self.kind = v.into();
15330 self
15331 }
15332
15333 /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
15334 ///
15335 /// # Example
15336 /// ```ignore,no_run
15337 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
15338 /// let x = RestoreBackupContext::new().set_backup_run_id(42);
15339 /// ```
15340 pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15341 self.backup_run_id = v.into();
15342 self
15343 }
15344
15345 /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
15346 ///
15347 /// # Example
15348 /// ```ignore,no_run
15349 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
15350 /// let x = RestoreBackupContext::new().set_instance_id("example");
15351 /// ```
15352 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15353 self.instance_id = v.into();
15354 self
15355 }
15356
15357 /// Sets the value of [project][crate::model::RestoreBackupContext::project].
15358 ///
15359 /// # Example
15360 /// ```ignore,no_run
15361 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
15362 /// let x = RestoreBackupContext::new().set_project("example");
15363 /// ```
15364 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15365 self.project = v.into();
15366 self
15367 }
15368}
15369
15370impl wkt::message::Message for RestoreBackupContext {
15371 fn typename() -> &'static str {
15372 "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
15373 }
15374}
15375
15376/// Instance rotate server CA context.
15377#[derive(Clone, Default, PartialEq)]
15378#[non_exhaustive]
15379pub struct RotateServerCaContext {
15380 /// This is always `sql#rotateServerCaContext`.
15381 pub kind: std::string::String,
15382
15383 /// The fingerprint of the next version to be rotated to. If left unspecified,
15384 /// will be rotated to the most recently added server CA version.
15385 pub next_version: std::string::String,
15386
15387 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15388}
15389
15390impl RotateServerCaContext {
15391 /// Creates a new default instance.
15392 pub fn new() -> Self {
15393 std::default::Default::default()
15394 }
15395
15396 /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
15397 ///
15398 /// # Example
15399 /// ```ignore,no_run
15400 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
15401 /// let x = RotateServerCaContext::new().set_kind("example");
15402 /// ```
15403 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15404 self.kind = v.into();
15405 self
15406 }
15407
15408 /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
15409 ///
15410 /// # Example
15411 /// ```ignore,no_run
15412 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
15413 /// let x = RotateServerCaContext::new().set_next_version("example");
15414 /// ```
15415 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15416 self.next_version = v.into();
15417 self
15418 }
15419}
15420
15421impl wkt::message::Message for RotateServerCaContext {
15422 fn typename() -> &'static str {
15423 "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
15424 }
15425}
15426
15427/// Instance rotate server certificate context.
15428#[derive(Clone, Default, PartialEq)]
15429#[non_exhaustive]
15430pub struct RotateServerCertificateContext {
15431 /// Optional. This is always `sql#rotateServerCertificateContext`.
15432 pub kind: std::string::String,
15433
15434 /// The fingerprint of the next version to be rotated to. If left unspecified,
15435 /// will be rotated to the most recently added server certificate version.
15436 pub next_version: std::string::String,
15437
15438 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15439}
15440
15441impl RotateServerCertificateContext {
15442 /// Creates a new default instance.
15443 pub fn new() -> Self {
15444 std::default::Default::default()
15445 }
15446
15447 /// Sets the value of [kind][crate::model::RotateServerCertificateContext::kind].
15448 ///
15449 /// # Example
15450 /// ```ignore,no_run
15451 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
15452 /// let x = RotateServerCertificateContext::new().set_kind("example");
15453 /// ```
15454 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15455 self.kind = v.into();
15456 self
15457 }
15458
15459 /// Sets the value of [next_version][crate::model::RotateServerCertificateContext::next_version].
15460 ///
15461 /// # Example
15462 /// ```ignore,no_run
15463 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
15464 /// let x = RotateServerCertificateContext::new().set_next_version("example");
15465 /// ```
15466 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15467 self.next_version = v.into();
15468 self
15469 }
15470}
15471
15472impl wkt::message::Message for RotateServerCertificateContext {
15473 fn typename() -> &'static str {
15474 "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
15475 }
15476}
15477
15478/// Instance rotate Entra ID certificate context.
15479#[derive(Clone, Default, PartialEq)]
15480#[non_exhaustive]
15481pub struct RotateEntraIdCertificateContext {
15482 /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
15483 pub kind: std::string::String,
15484
15485 /// Optional. The fingerprint of the next version to be rotated to. If left
15486 /// unspecified, will be rotated to the most recently added server certificate
15487 /// version.
15488 pub next_version: std::string::String,
15489
15490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15491}
15492
15493impl RotateEntraIdCertificateContext {
15494 /// Creates a new default instance.
15495 pub fn new() -> Self {
15496 std::default::Default::default()
15497 }
15498
15499 /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
15500 ///
15501 /// # Example
15502 /// ```ignore,no_run
15503 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
15504 /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
15505 /// ```
15506 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15507 self.kind = v.into();
15508 self
15509 }
15510
15511 /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
15512 ///
15513 /// # Example
15514 /// ```ignore,no_run
15515 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
15516 /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
15517 /// ```
15518 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15519 self.next_version = v.into();
15520 self
15521 }
15522}
15523
15524impl wkt::message::Message for RotateEntraIdCertificateContext {
15525 fn typename() -> &'static str {
15526 "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
15527 }
15528}
15529
15530/// Database Instance truncate log context.
15531#[derive(Clone, Default, PartialEq)]
15532#[non_exhaustive]
15533pub struct TruncateLogContext {
15534 /// This is always `sql#truncateLogContext`.
15535 pub kind: std::string::String,
15536
15537 /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
15538 /// `MYSQL_SLOW_TABLE`.
15539 pub log_type: std::string::String,
15540
15541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15542}
15543
15544impl TruncateLogContext {
15545 /// Creates a new default instance.
15546 pub fn new() -> Self {
15547 std::default::Default::default()
15548 }
15549
15550 /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
15551 ///
15552 /// # Example
15553 /// ```ignore,no_run
15554 /// # use google_cloud_sql_v1::model::TruncateLogContext;
15555 /// let x = TruncateLogContext::new().set_kind("example");
15556 /// ```
15557 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15558 self.kind = v.into();
15559 self
15560 }
15561
15562 /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
15563 ///
15564 /// # Example
15565 /// ```ignore,no_run
15566 /// # use google_cloud_sql_v1::model::TruncateLogContext;
15567 /// let x = TruncateLogContext::new().set_log_type("example");
15568 /// ```
15569 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15570 self.log_type = v.into();
15571 self
15572 }
15573}
15574
15575impl wkt::message::Message for TruncateLogContext {
15576 fn typename() -> &'static str {
15577 "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
15578 }
15579}
15580
15581/// External primary instance migration setting error/warning.
15582#[derive(Clone, Default, PartialEq)]
15583#[non_exhaustive]
15584pub struct SqlExternalSyncSettingError {
15585 /// Can be `sql#externalSyncSettingError` or
15586 /// `sql#externalSyncSettingWarning`.
15587 pub kind: std::string::String,
15588
15589 /// Identifies the specific error that occurred.
15590 pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
15591
15592 /// Additional information about the error encountered.
15593 pub detail: std::string::String,
15594
15595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15596}
15597
15598impl SqlExternalSyncSettingError {
15599 /// Creates a new default instance.
15600 pub fn new() -> Self {
15601 std::default::Default::default()
15602 }
15603
15604 /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
15605 ///
15606 /// # Example
15607 /// ```ignore,no_run
15608 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
15609 /// let x = SqlExternalSyncSettingError::new().set_kind("example");
15610 /// ```
15611 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15612 self.kind = v.into();
15613 self
15614 }
15615
15616 /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
15617 ///
15618 /// # Example
15619 /// ```ignore,no_run
15620 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
15621 /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
15622 /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
15623 /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
15624 /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
15625 /// ```
15626 pub fn set_type<
15627 T: std::convert::Into<
15628 crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
15629 >,
15630 >(
15631 mut self,
15632 v: T,
15633 ) -> Self {
15634 self.r#type = v.into();
15635 self
15636 }
15637
15638 /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
15639 ///
15640 /// # Example
15641 /// ```ignore,no_run
15642 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
15643 /// let x = SqlExternalSyncSettingError::new().set_detail("example");
15644 /// ```
15645 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15646 self.detail = v.into();
15647 self
15648 }
15649}
15650
15651impl wkt::message::Message for SqlExternalSyncSettingError {
15652 fn typename() -> &'static str {
15653 "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
15654 }
15655}
15656
15657/// Defines additional types related to [SqlExternalSyncSettingError].
15658pub mod sql_external_sync_setting_error {
15659 #[allow(unused_imports)]
15660 use super::*;
15661
15662 /// Enum for [SqlExternalSyncSettingErrorType].
15663 ///
15664 /// # Working with unknown values
15665 ///
15666 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15667 /// additional enum variants at any time. Adding new variants is not considered
15668 /// a breaking change. Applications should write their code in anticipation of:
15669 ///
15670 /// - New values appearing in future releases of the client library, **and**
15671 /// - New values received dynamically, without application changes.
15672 ///
15673 /// Please consult the [Working with enums] section in the user guide for some
15674 /// guidelines.
15675 ///
15676 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15677 #[derive(Clone, Debug, PartialEq)]
15678 #[non_exhaustive]
15679 pub enum SqlExternalSyncSettingErrorType {
15680 #[allow(missing_docs)]
15681 Unspecified,
15682 #[allow(missing_docs)]
15683 ConnectionFailure,
15684 #[allow(missing_docs)]
15685 BinlogNotEnabled,
15686 #[allow(missing_docs)]
15687 IncompatibleDatabaseVersion,
15688 #[allow(missing_docs)]
15689 ReplicaAlreadySetup,
15690 /// The replication user is missing privileges that are required.
15691 InsufficientPrivilege,
15692 /// Unsupported migration type.
15693 UnsupportedMigrationType,
15694 /// No pglogical extension installed on databases, applicable for postgres.
15695 NoPglogicalInstalled,
15696 /// pglogical node already exists on databases, applicable for postgres.
15697 PglogicalNodeAlreadyExists,
15698 /// The value of parameter wal_level is not set to logical.
15699 InvalidWalLevel,
15700 /// The value of parameter shared_preload_libraries does not include
15701 /// pglogical.
15702 InvalidSharedPreloadLibrary,
15703 /// The value of parameter max_replication_slots is not sufficient.
15704 InsufficientMaxReplicationSlots,
15705 /// The value of parameter max_wal_senders is not sufficient.
15706 InsufficientMaxWalSenders,
15707 /// The value of parameter max_worker_processes is not sufficient.
15708 InsufficientMaxWorkerProcesses,
15709 /// Extensions installed are either not supported or having unsupported
15710 /// versions.
15711 UnsupportedExtensions,
15712 /// The value of parameter rds.logical_replication is not set to 1.
15713 InvalidRdsLogicalReplication,
15714 /// The primary instance logging setup doesn't allow EM sync.
15715 InvalidLoggingSetup,
15716 /// The primary instance database parameter setup doesn't allow EM sync.
15717 InvalidDbParam,
15718 /// The gtid_mode is not supported, applicable for MySQL.
15719 UnsupportedGtidMode,
15720 /// SQL Server Agent is not running.
15721 SqlserverAgentNotRunning,
15722 /// The table definition is not support due to missing primary key or replica
15723 /// identity, applicable for postgres. Note that this is a warning and won't
15724 /// block the migration.
15725 UnsupportedTableDefinition,
15726 /// The customer has a definer that will break EM setup.
15727 UnsupportedDefiner,
15728 /// SQL Server @@SERVERNAME does not match actual host name.
15729 SqlserverServernameMismatch,
15730 /// The primary instance has been setup and will fail the setup.
15731 PrimaryAlreadySetup,
15732 /// The primary instance has unsupported binary log format.
15733 UnsupportedBinlogFormat,
15734 /// The primary instance's binary log retention setting.
15735 BinlogRetentionSetting,
15736 /// The primary instance has tables with unsupported storage engine.
15737 UnsupportedStorageEngine,
15738 /// Source has tables with limited support
15739 /// eg: PostgreSQL tables without primary keys.
15740 LimitedSupportTables,
15741 /// The replica instance contains existing data.
15742 ExistingDataInReplica,
15743 /// The replication user is missing privileges that are optional.
15744 MissingOptionalPrivileges,
15745 /// Additional BACKUP_ADMIN privilege is granted to the replication user
15746 /// which may lock source MySQL 8 instance for DDLs during initial sync.
15747 RiskyBackupAdminPrivilege,
15748 /// The Cloud Storage bucket is missing necessary permissions.
15749 InsufficientGcsPermissions,
15750 /// The Cloud Storage bucket has an error in the file or contains invalid
15751 /// file information.
15752 InvalidFileInfo,
15753 /// The source instance has unsupported database settings for migration.
15754 UnsupportedDatabaseSettings,
15755 /// The replication user is missing parallel import specific privileges.
15756 /// (e.g. LOCK TABLES) for MySQL.
15757 MysqlParallelImportInsufficientPrivilege,
15758 /// The global variable local_infile is off on external server replica.
15759 LocalInfileOff,
15760 /// This code instructs customers to turn on point-in-time recovery manually
15761 /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
15762 TurnOnPitrAfterPromote,
15763 /// The minor version of replica database is incompatible with the source.
15764 IncompatibleDatabaseMinorVersion,
15765 /// This warning message indicates that Cloud SQL uses the maximum number of
15766 /// subscriptions to migrate data from the source to the destination.
15767 SourceMaxSubscriptions,
15768 /// Unable to verify definers on the source for MySQL.
15769 UnableToVerifyDefiners,
15770 /// If a time out occurs while the subscription counts are calculated, then
15771 /// this value is set to 1. Otherwise, this value is set to 2.
15772 SubscriptionCalculationStatus,
15773 /// Count of subscriptions needed to sync source data for PostgreSQL
15774 /// database.
15775 PgSubscriptionCount,
15776 /// Final parallel level that is used to do migration.
15777 PgSyncParallelLevel,
15778 /// The disk size of the replica instance is smaller than the data size of
15779 /// the source instance.
15780 InsufficientDiskSize,
15781 /// The data size of the source instance is greater than 1 TB, the number of
15782 /// cores of the replica instance is less than 8, and the memory of the
15783 /// replica is less than 32 GB.
15784 InsufficientMachineTier,
15785 /// The warning message indicates the unsupported extensions will not be
15786 /// migrated to the destination.
15787 UnsupportedExtensionsNotMigrated,
15788 /// The warning message indicates the pg_cron extension and settings will not
15789 /// be migrated to the destination.
15790 ExtensionsNotMigrated,
15791 /// The error message indicates that pg_cron flags are enabled on the
15792 /// destination which is not supported during the migration.
15793 PgCronFlagEnabledInReplica,
15794 /// This error message indicates that the specified extensions are not
15795 /// enabled on destination instance. For example, before you can migrate
15796 /// data to the destination instance, you must enable the PGAudit extension
15797 /// on the instance.
15798 ExtensionsNotEnabledInReplica,
15799 /// The source database has generated columns that can't be migrated. Please
15800 /// change them to regular columns before migration.
15801 UnsupportedColumns,
15802 /// The source database has users that aren't created in the replica.
15803 /// First, create all users, which are in the pg_user_mappings table
15804 /// of the source database, in the destination instance. Then, perform the
15805 /// migration.
15806 UsersNotCreatedInReplica,
15807 /// The selected objects include system objects that aren't supported for
15808 /// migration.
15809 UnsupportedSystemObjects,
15810 /// The source database has tables with the FULL or NOTHING replica identity.
15811 /// Before starting your migration, either remove the identity or change it
15812 /// to DEFAULT. Note that this is an error and will block the migration.
15813 UnsupportedTablesWithReplicaIdentity,
15814 /// The selected objects don't exist on the source instance.
15815 SelectedObjectsNotExistOnSource,
15816 /// PSC only destination instance does not have a network attachment URI.
15817 PscOnlyInstanceWithNoNetworkAttachmentUri,
15818 /// Selected objects reference unselected objects. Based on their object type
15819 /// (foreign key constraint or view), selected objects will fail during
15820 /// migration.
15821 SelectedObjectsReferenceUnselectedObjects,
15822 /// The migration will delete existing data in the replica; set
15823 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
15824 /// in the request to acknowledge this. This is an error. MySQL only.
15825 ///
15826 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
15827 PromptDeleteExisting,
15828 /// The migration will delete existing data in the replica;
15829 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
15830 /// was set in the request acknowledging this. This is a warning rather than
15831 /// an error. MySQL only.
15832 ///
15833 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
15834 WillDeleteExisting,
15835 /// The replication user is missing specific privileges to setup DDL
15836 /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
15837 PgDdlReplicationInsufficientPrivilege,
15838 /// If set, the enum was initialized with an unknown value.
15839 ///
15840 /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
15841 /// [SqlExternalSyncSettingErrorType::name].
15842 UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
15843 }
15844
15845 #[doc(hidden)]
15846 pub mod sql_external_sync_setting_error_type {
15847 #[allow(unused_imports)]
15848 use super::*;
15849 #[derive(Clone, Debug, PartialEq)]
15850 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15851 }
15852
15853 impl SqlExternalSyncSettingErrorType {
15854 /// Gets the enum value.
15855 ///
15856 /// Returns `None` if the enum contains an unknown value deserialized from
15857 /// the string representation of enums.
15858 pub fn value(&self) -> std::option::Option<i32> {
15859 match self {
15860 Self::Unspecified => std::option::Option::Some(0),
15861 Self::ConnectionFailure => std::option::Option::Some(1),
15862 Self::BinlogNotEnabled => std::option::Option::Some(2),
15863 Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
15864 Self::ReplicaAlreadySetup => std::option::Option::Some(4),
15865 Self::InsufficientPrivilege => std::option::Option::Some(5),
15866 Self::UnsupportedMigrationType => std::option::Option::Some(6),
15867 Self::NoPglogicalInstalled => std::option::Option::Some(7),
15868 Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
15869 Self::InvalidWalLevel => std::option::Option::Some(9),
15870 Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
15871 Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
15872 Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
15873 Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
15874 Self::UnsupportedExtensions => std::option::Option::Some(14),
15875 Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
15876 Self::InvalidLoggingSetup => std::option::Option::Some(16),
15877 Self::InvalidDbParam => std::option::Option::Some(17),
15878 Self::UnsupportedGtidMode => std::option::Option::Some(18),
15879 Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
15880 Self::UnsupportedTableDefinition => std::option::Option::Some(20),
15881 Self::UnsupportedDefiner => std::option::Option::Some(21),
15882 Self::SqlserverServernameMismatch => std::option::Option::Some(22),
15883 Self::PrimaryAlreadySetup => std::option::Option::Some(23),
15884 Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
15885 Self::BinlogRetentionSetting => std::option::Option::Some(25),
15886 Self::UnsupportedStorageEngine => std::option::Option::Some(26),
15887 Self::LimitedSupportTables => std::option::Option::Some(27),
15888 Self::ExistingDataInReplica => std::option::Option::Some(28),
15889 Self::MissingOptionalPrivileges => std::option::Option::Some(29),
15890 Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
15891 Self::InsufficientGcsPermissions => std::option::Option::Some(31),
15892 Self::InvalidFileInfo => std::option::Option::Some(32),
15893 Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
15894 Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
15895 Self::LocalInfileOff => std::option::Option::Some(35),
15896 Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
15897 Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
15898 Self::SourceMaxSubscriptions => std::option::Option::Some(38),
15899 Self::UnableToVerifyDefiners => std::option::Option::Some(39),
15900 Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
15901 Self::PgSubscriptionCount => std::option::Option::Some(41),
15902 Self::PgSyncParallelLevel => std::option::Option::Some(42),
15903 Self::InsufficientDiskSize => std::option::Option::Some(43),
15904 Self::InsufficientMachineTier => std::option::Option::Some(44),
15905 Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
15906 Self::ExtensionsNotMigrated => std::option::Option::Some(46),
15907 Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
15908 Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
15909 Self::UnsupportedColumns => std::option::Option::Some(49),
15910 Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
15911 Self::UnsupportedSystemObjects => std::option::Option::Some(51),
15912 Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
15913 Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
15914 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
15915 Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
15916 Self::PromptDeleteExisting => std::option::Option::Some(56),
15917 Self::WillDeleteExisting => std::option::Option::Some(57),
15918 Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
15919 Self::UnknownValue(u) => u.0.value(),
15920 }
15921 }
15922
15923 /// Gets the enum value as a string.
15924 ///
15925 /// Returns `None` if the enum contains an unknown value deserialized from
15926 /// the integer representation of enums.
15927 pub fn name(&self) -> std::option::Option<&str> {
15928 match self {
15929 Self::Unspecified => {
15930 std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
15931 }
15932 Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
15933 Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
15934 Self::IncompatibleDatabaseVersion => {
15935 std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
15936 }
15937 Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
15938 Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
15939 Self::UnsupportedMigrationType => {
15940 std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
15941 }
15942 Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
15943 Self::PglogicalNodeAlreadyExists => {
15944 std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
15945 }
15946 Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
15947 Self::InvalidSharedPreloadLibrary => {
15948 std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
15949 }
15950 Self::InsufficientMaxReplicationSlots => {
15951 std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
15952 }
15953 Self::InsufficientMaxWalSenders => {
15954 std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
15955 }
15956 Self::InsufficientMaxWorkerProcesses => {
15957 std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
15958 }
15959 Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
15960 Self::InvalidRdsLogicalReplication => {
15961 std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
15962 }
15963 Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
15964 Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
15965 Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
15966 Self::SqlserverAgentNotRunning => {
15967 std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
15968 }
15969 Self::UnsupportedTableDefinition => {
15970 std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
15971 }
15972 Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
15973 Self::SqlserverServernameMismatch => {
15974 std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
15975 }
15976 Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
15977 Self::UnsupportedBinlogFormat => {
15978 std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
15979 }
15980 Self::BinlogRetentionSetting => {
15981 std::option::Option::Some("BINLOG_RETENTION_SETTING")
15982 }
15983 Self::UnsupportedStorageEngine => {
15984 std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
15985 }
15986 Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
15987 Self::ExistingDataInReplica => {
15988 std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
15989 }
15990 Self::MissingOptionalPrivileges => {
15991 std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
15992 }
15993 Self::RiskyBackupAdminPrivilege => {
15994 std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
15995 }
15996 Self::InsufficientGcsPermissions => {
15997 std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
15998 }
15999 Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
16000 Self::UnsupportedDatabaseSettings => {
16001 std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
16002 }
16003 Self::MysqlParallelImportInsufficientPrivilege => {
16004 std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
16005 }
16006 Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
16007 Self::TurnOnPitrAfterPromote => {
16008 std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
16009 }
16010 Self::IncompatibleDatabaseMinorVersion => {
16011 std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
16012 }
16013 Self::SourceMaxSubscriptions => {
16014 std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
16015 }
16016 Self::UnableToVerifyDefiners => {
16017 std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
16018 }
16019 Self::SubscriptionCalculationStatus => {
16020 std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
16021 }
16022 Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
16023 Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
16024 Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
16025 Self::InsufficientMachineTier => {
16026 std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
16027 }
16028 Self::UnsupportedExtensionsNotMigrated => {
16029 std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
16030 }
16031 Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
16032 Self::PgCronFlagEnabledInReplica => {
16033 std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
16034 }
16035 Self::ExtensionsNotEnabledInReplica => {
16036 std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
16037 }
16038 Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
16039 Self::UsersNotCreatedInReplica => {
16040 std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
16041 }
16042 Self::UnsupportedSystemObjects => {
16043 std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
16044 }
16045 Self::UnsupportedTablesWithReplicaIdentity => {
16046 std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
16047 }
16048 Self::SelectedObjectsNotExistOnSource => {
16049 std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
16050 }
16051 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
16052 std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
16053 }
16054 Self::SelectedObjectsReferenceUnselectedObjects => {
16055 std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
16056 }
16057 Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
16058 Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
16059 Self::PgDdlReplicationInsufficientPrivilege => {
16060 std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
16061 }
16062 Self::UnknownValue(u) => u.0.name(),
16063 }
16064 }
16065 }
16066
16067 impl std::default::Default for SqlExternalSyncSettingErrorType {
16068 fn default() -> Self {
16069 use std::convert::From;
16070 Self::from(0)
16071 }
16072 }
16073
16074 impl std::fmt::Display for SqlExternalSyncSettingErrorType {
16075 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16076 wkt::internal::display_enum(f, self.name(), self.value())
16077 }
16078 }
16079
16080 impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
16081 fn from(value: i32) -> Self {
16082 match value {
16083 0 => Self::Unspecified,
16084 1 => Self::ConnectionFailure,
16085 2 => Self::BinlogNotEnabled,
16086 3 => Self::IncompatibleDatabaseVersion,
16087 4 => Self::ReplicaAlreadySetup,
16088 5 => Self::InsufficientPrivilege,
16089 6 => Self::UnsupportedMigrationType,
16090 7 => Self::NoPglogicalInstalled,
16091 8 => Self::PglogicalNodeAlreadyExists,
16092 9 => Self::InvalidWalLevel,
16093 10 => Self::InvalidSharedPreloadLibrary,
16094 11 => Self::InsufficientMaxReplicationSlots,
16095 12 => Self::InsufficientMaxWalSenders,
16096 13 => Self::InsufficientMaxWorkerProcesses,
16097 14 => Self::UnsupportedExtensions,
16098 15 => Self::InvalidRdsLogicalReplication,
16099 16 => Self::InvalidLoggingSetup,
16100 17 => Self::InvalidDbParam,
16101 18 => Self::UnsupportedGtidMode,
16102 19 => Self::SqlserverAgentNotRunning,
16103 20 => Self::UnsupportedTableDefinition,
16104 21 => Self::UnsupportedDefiner,
16105 22 => Self::SqlserverServernameMismatch,
16106 23 => Self::PrimaryAlreadySetup,
16107 24 => Self::UnsupportedBinlogFormat,
16108 25 => Self::BinlogRetentionSetting,
16109 26 => Self::UnsupportedStorageEngine,
16110 27 => Self::LimitedSupportTables,
16111 28 => Self::ExistingDataInReplica,
16112 29 => Self::MissingOptionalPrivileges,
16113 30 => Self::RiskyBackupAdminPrivilege,
16114 31 => Self::InsufficientGcsPermissions,
16115 32 => Self::InvalidFileInfo,
16116 33 => Self::UnsupportedDatabaseSettings,
16117 34 => Self::MysqlParallelImportInsufficientPrivilege,
16118 35 => Self::LocalInfileOff,
16119 36 => Self::TurnOnPitrAfterPromote,
16120 37 => Self::IncompatibleDatabaseMinorVersion,
16121 38 => Self::SourceMaxSubscriptions,
16122 39 => Self::UnableToVerifyDefiners,
16123 40 => Self::SubscriptionCalculationStatus,
16124 41 => Self::PgSubscriptionCount,
16125 42 => Self::PgSyncParallelLevel,
16126 43 => Self::InsufficientDiskSize,
16127 44 => Self::InsufficientMachineTier,
16128 45 => Self::UnsupportedExtensionsNotMigrated,
16129 46 => Self::ExtensionsNotMigrated,
16130 47 => Self::PgCronFlagEnabledInReplica,
16131 48 => Self::ExtensionsNotEnabledInReplica,
16132 49 => Self::UnsupportedColumns,
16133 50 => Self::UsersNotCreatedInReplica,
16134 51 => Self::UnsupportedSystemObjects,
16135 52 => Self::UnsupportedTablesWithReplicaIdentity,
16136 53 => Self::SelectedObjectsNotExistOnSource,
16137 54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
16138 55 => Self::SelectedObjectsReferenceUnselectedObjects,
16139 56 => Self::PromptDeleteExisting,
16140 57 => Self::WillDeleteExisting,
16141 58 => Self::PgDdlReplicationInsufficientPrivilege,
16142 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
16143 wkt::internal::UnknownEnumValue::Integer(value),
16144 )),
16145 }
16146 }
16147 }
16148
16149 impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
16150 fn from(value: &str) -> Self {
16151 use std::string::ToString;
16152 match value {
16153 "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
16154 "CONNECTION_FAILURE" => Self::ConnectionFailure,
16155 "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
16156 "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
16157 "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
16158 "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
16159 "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
16160 "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
16161 "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
16162 "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
16163 "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
16164 "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
16165 "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
16166 "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
16167 "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
16168 "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
16169 "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
16170 "INVALID_DB_PARAM" => Self::InvalidDbParam,
16171 "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
16172 "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
16173 "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
16174 "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
16175 "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
16176 "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
16177 "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
16178 "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
16179 "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
16180 "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
16181 "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
16182 "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
16183 "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
16184 "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
16185 "INVALID_FILE_INFO" => Self::InvalidFileInfo,
16186 "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
16187 "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
16188 Self::MysqlParallelImportInsufficientPrivilege
16189 }
16190 "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
16191 "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
16192 "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
16193 "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
16194 "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
16195 "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
16196 "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
16197 "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
16198 "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
16199 "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
16200 "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
16201 "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
16202 "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
16203 "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
16204 "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
16205 "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
16206 "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
16207 "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
16208 Self::UnsupportedTablesWithReplicaIdentity
16209 }
16210 "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
16211 "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
16212 Self::PscOnlyInstanceWithNoNetworkAttachmentUri
16213 }
16214 "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
16215 Self::SelectedObjectsReferenceUnselectedObjects
16216 }
16217 "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
16218 "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
16219 "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
16220 Self::PgDdlReplicationInsufficientPrivilege
16221 }
16222 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
16223 wkt::internal::UnknownEnumValue::String(value.to_string()),
16224 )),
16225 }
16226 }
16227 }
16228
16229 impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
16230 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16231 where
16232 S: serde::Serializer,
16233 {
16234 match self {
16235 Self::Unspecified => serializer.serialize_i32(0),
16236 Self::ConnectionFailure => serializer.serialize_i32(1),
16237 Self::BinlogNotEnabled => serializer.serialize_i32(2),
16238 Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
16239 Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
16240 Self::InsufficientPrivilege => serializer.serialize_i32(5),
16241 Self::UnsupportedMigrationType => serializer.serialize_i32(6),
16242 Self::NoPglogicalInstalled => serializer.serialize_i32(7),
16243 Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
16244 Self::InvalidWalLevel => serializer.serialize_i32(9),
16245 Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
16246 Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
16247 Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
16248 Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
16249 Self::UnsupportedExtensions => serializer.serialize_i32(14),
16250 Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
16251 Self::InvalidLoggingSetup => serializer.serialize_i32(16),
16252 Self::InvalidDbParam => serializer.serialize_i32(17),
16253 Self::UnsupportedGtidMode => serializer.serialize_i32(18),
16254 Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
16255 Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
16256 Self::UnsupportedDefiner => serializer.serialize_i32(21),
16257 Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
16258 Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
16259 Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
16260 Self::BinlogRetentionSetting => serializer.serialize_i32(25),
16261 Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
16262 Self::LimitedSupportTables => serializer.serialize_i32(27),
16263 Self::ExistingDataInReplica => serializer.serialize_i32(28),
16264 Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
16265 Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
16266 Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
16267 Self::InvalidFileInfo => serializer.serialize_i32(32),
16268 Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
16269 Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
16270 Self::LocalInfileOff => serializer.serialize_i32(35),
16271 Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
16272 Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
16273 Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
16274 Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
16275 Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
16276 Self::PgSubscriptionCount => serializer.serialize_i32(41),
16277 Self::PgSyncParallelLevel => serializer.serialize_i32(42),
16278 Self::InsufficientDiskSize => serializer.serialize_i32(43),
16279 Self::InsufficientMachineTier => serializer.serialize_i32(44),
16280 Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
16281 Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
16282 Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
16283 Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
16284 Self::UnsupportedColumns => serializer.serialize_i32(49),
16285 Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
16286 Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
16287 Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
16288 Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
16289 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
16290 Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
16291 Self::PromptDeleteExisting => serializer.serialize_i32(56),
16292 Self::WillDeleteExisting => serializer.serialize_i32(57),
16293 Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
16294 Self::UnknownValue(u) => u.0.serialize(serializer),
16295 }
16296 }
16297 }
16298
16299 impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
16300 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16301 where
16302 D: serde::Deserializer<'de>,
16303 {
16304 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
16305 SqlExternalSyncSettingErrorType,
16306 >::new(
16307 ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
16308 ))
16309 }
16310 }
16311}
16312
16313/// A list of objects that the user selects for replication from an external
16314/// source instance.
16315#[derive(Clone, Default, PartialEq)]
16316#[non_exhaustive]
16317pub struct SelectedObjects {
16318 /// Required. The name of the database to migrate.
16319 pub database: std::string::String,
16320
16321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16322}
16323
16324impl SelectedObjects {
16325 /// Creates a new default instance.
16326 pub fn new() -> Self {
16327 std::default::Default::default()
16328 }
16329
16330 /// Sets the value of [database][crate::model::SelectedObjects::database].
16331 ///
16332 /// # Example
16333 /// ```ignore,no_run
16334 /// # use google_cloud_sql_v1::model::SelectedObjects;
16335 /// let x = SelectedObjects::new().set_database("example");
16336 /// ```
16337 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16338 self.database = v.into();
16339 self
16340 }
16341}
16342
16343impl wkt::message::Message for SelectedObjects {
16344 fn typename() -> &'static str {
16345 "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
16346 }
16347}
16348
16349/// On-premises instance configuration.
16350#[derive(Clone, Default, PartialEq)]
16351#[non_exhaustive]
16352pub struct OnPremisesConfiguration {
16353 /// The host and port of the on-premises instance in host:port format
16354 pub host_port: std::string::String,
16355
16356 /// This is always `sql#onPremisesConfiguration`.
16357 pub kind: std::string::String,
16358
16359 /// The username for connecting to on-premises instance.
16360 pub username: std::string::String,
16361
16362 /// The password for connecting to on-premises instance.
16363 pub password: std::string::String,
16364
16365 /// PEM representation of the trusted CA's x509 certificate.
16366 pub ca_certificate: std::string::String,
16367
16368 /// PEM representation of the replica's x509 certificate.
16369 pub client_certificate: std::string::String,
16370
16371 /// PEM representation of the replica's private key. The corresponding public
16372 /// key is encoded in the client's certificate.
16373 pub client_key: std::string::String,
16374
16375 /// The dump file to create the Cloud SQL replica.
16376 pub dump_file_path: std::string::String,
16377
16378 /// The reference to Cloud SQL instance if the source is Cloud SQL.
16379 pub source_instance: std::option::Option<crate::model::InstanceReference>,
16380
16381 /// Optional. A list of objects that the user selects for replication from an
16382 /// external source instance.
16383 pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
16384
16385 /// Optional. SSL option for replica connection to the on-premises source.
16386 pub ssl_option: crate::model::on_premises_configuration::SslOption,
16387
16388 /// Output only. Indicates whether the resource is managed by Database
16389 /// Migration Service.
16390 pub dms_managed: bool,
16391
16392 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16393}
16394
16395impl OnPremisesConfiguration {
16396 /// Creates a new default instance.
16397 pub fn new() -> Self {
16398 std::default::Default::default()
16399 }
16400
16401 /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
16402 ///
16403 /// # Example
16404 /// ```ignore,no_run
16405 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16406 /// let x = OnPremisesConfiguration::new().set_host_port("example");
16407 /// ```
16408 pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16409 self.host_port = v.into();
16410 self
16411 }
16412
16413 /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
16414 ///
16415 /// # Example
16416 /// ```ignore,no_run
16417 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16418 /// let x = OnPremisesConfiguration::new().set_kind("example");
16419 /// ```
16420 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16421 self.kind = v.into();
16422 self
16423 }
16424
16425 /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
16426 ///
16427 /// # Example
16428 /// ```ignore,no_run
16429 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16430 /// let x = OnPremisesConfiguration::new().set_username("example");
16431 /// ```
16432 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16433 self.username = v.into();
16434 self
16435 }
16436
16437 /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
16438 ///
16439 /// # Example
16440 /// ```ignore,no_run
16441 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16442 /// let x = OnPremisesConfiguration::new().set_password("example");
16443 /// ```
16444 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16445 self.password = v.into();
16446 self
16447 }
16448
16449 /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
16450 ///
16451 /// # Example
16452 /// ```ignore,no_run
16453 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16454 /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
16455 /// ```
16456 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16457 self.ca_certificate = v.into();
16458 self
16459 }
16460
16461 /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
16462 ///
16463 /// # Example
16464 /// ```ignore,no_run
16465 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16466 /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
16467 /// ```
16468 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
16469 mut self,
16470 v: T,
16471 ) -> Self {
16472 self.client_certificate = v.into();
16473 self
16474 }
16475
16476 /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
16477 ///
16478 /// # Example
16479 /// ```ignore,no_run
16480 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16481 /// let x = OnPremisesConfiguration::new().set_client_key("example");
16482 /// ```
16483 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16484 self.client_key = v.into();
16485 self
16486 }
16487
16488 /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
16489 ///
16490 /// # Example
16491 /// ```ignore,no_run
16492 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16493 /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
16494 /// ```
16495 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16496 self.dump_file_path = v.into();
16497 self
16498 }
16499
16500 /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
16501 ///
16502 /// # Example
16503 /// ```ignore,no_run
16504 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16505 /// use google_cloud_sql_v1::model::InstanceReference;
16506 /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
16507 /// ```
16508 pub fn set_source_instance<T>(mut self, v: T) -> Self
16509 where
16510 T: std::convert::Into<crate::model::InstanceReference>,
16511 {
16512 self.source_instance = std::option::Option::Some(v.into());
16513 self
16514 }
16515
16516 /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
16517 ///
16518 /// # Example
16519 /// ```ignore,no_run
16520 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16521 /// use google_cloud_sql_v1::model::InstanceReference;
16522 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
16523 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
16524 /// ```
16525 pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
16526 where
16527 T: std::convert::Into<crate::model::InstanceReference>,
16528 {
16529 self.source_instance = v.map(|x| x.into());
16530 self
16531 }
16532
16533 /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
16534 ///
16535 /// # Example
16536 /// ```ignore,no_run
16537 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16538 /// use google_cloud_sql_v1::model::SelectedObjects;
16539 /// let x = OnPremisesConfiguration::new()
16540 /// .set_selected_objects([
16541 /// SelectedObjects::default()/* use setters */,
16542 /// SelectedObjects::default()/* use (different) setters */,
16543 /// ]);
16544 /// ```
16545 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
16546 where
16547 T: std::iter::IntoIterator<Item = V>,
16548 V: std::convert::Into<crate::model::SelectedObjects>,
16549 {
16550 use std::iter::Iterator;
16551 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
16552 self
16553 }
16554
16555 /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
16556 ///
16557 /// # Example
16558 /// ```ignore,no_run
16559 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16560 /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
16561 /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
16562 /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
16563 /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
16564 /// ```
16565 pub fn set_ssl_option<
16566 T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
16567 >(
16568 mut self,
16569 v: T,
16570 ) -> Self {
16571 self.ssl_option = v.into();
16572 self
16573 }
16574
16575 /// Sets the value of [dms_managed][crate::model::OnPremisesConfiguration::dms_managed].
16576 ///
16577 /// # Example
16578 /// ```ignore,no_run
16579 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
16580 /// let x = OnPremisesConfiguration::new().set_dms_managed(true);
16581 /// ```
16582 pub fn set_dms_managed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16583 self.dms_managed = v.into();
16584 self
16585 }
16586}
16587
16588impl wkt::message::Message for OnPremisesConfiguration {
16589 fn typename() -> &'static str {
16590 "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
16591 }
16592}
16593
16594/// Defines additional types related to [OnPremisesConfiguration].
16595pub mod on_premises_configuration {
16596 #[allow(unused_imports)]
16597 use super::*;
16598
16599 /// SslOption defines the SSL mode to be used for replica connection to the
16600 /// on-premises source.
16601 ///
16602 /// # Working with unknown values
16603 ///
16604 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16605 /// additional enum variants at any time. Adding new variants is not considered
16606 /// a breaking change. Applications should write their code in anticipation of:
16607 ///
16608 /// - New values appearing in future releases of the client library, **and**
16609 /// - New values received dynamically, without application changes.
16610 ///
16611 /// Please consult the [Working with enums] section in the user guide for some
16612 /// guidelines.
16613 ///
16614 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16615 #[derive(Clone, Debug, PartialEq)]
16616 #[non_exhaustive]
16617 pub enum SslOption {
16618 /// Unknown SSL option i.e. SSL option not specified by user.
16619 Unspecified,
16620 /// SSL is not used for replica connection to the on-premises source.
16621 Disable,
16622 /// SSL is required for replica connection to the on-premises source.
16623 Require,
16624 /// Verify CA is required for replica connection to the on-premises source.
16625 VerifyCa,
16626 /// If set, the enum was initialized with an unknown value.
16627 ///
16628 /// Applications can examine the value using [SslOption::value] or
16629 /// [SslOption::name].
16630 UnknownValue(ssl_option::UnknownValue),
16631 }
16632
16633 #[doc(hidden)]
16634 pub mod ssl_option {
16635 #[allow(unused_imports)]
16636 use super::*;
16637 #[derive(Clone, Debug, PartialEq)]
16638 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16639 }
16640
16641 impl SslOption {
16642 /// Gets the enum value.
16643 ///
16644 /// Returns `None` if the enum contains an unknown value deserialized from
16645 /// the string representation of enums.
16646 pub fn value(&self) -> std::option::Option<i32> {
16647 match self {
16648 Self::Unspecified => std::option::Option::Some(0),
16649 Self::Disable => std::option::Option::Some(1),
16650 Self::Require => std::option::Option::Some(2),
16651 Self::VerifyCa => std::option::Option::Some(3),
16652 Self::UnknownValue(u) => u.0.value(),
16653 }
16654 }
16655
16656 /// Gets the enum value as a string.
16657 ///
16658 /// Returns `None` if the enum contains an unknown value deserialized from
16659 /// the integer representation of enums.
16660 pub fn name(&self) -> std::option::Option<&str> {
16661 match self {
16662 Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
16663 Self::Disable => std::option::Option::Some("DISABLE"),
16664 Self::Require => std::option::Option::Some("REQUIRE"),
16665 Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
16666 Self::UnknownValue(u) => u.0.name(),
16667 }
16668 }
16669 }
16670
16671 impl std::default::Default for SslOption {
16672 fn default() -> Self {
16673 use std::convert::From;
16674 Self::from(0)
16675 }
16676 }
16677
16678 impl std::fmt::Display for SslOption {
16679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16680 wkt::internal::display_enum(f, self.name(), self.value())
16681 }
16682 }
16683
16684 impl std::convert::From<i32> for SslOption {
16685 fn from(value: i32) -> Self {
16686 match value {
16687 0 => Self::Unspecified,
16688 1 => Self::Disable,
16689 2 => Self::Require,
16690 3 => Self::VerifyCa,
16691 _ => Self::UnknownValue(ssl_option::UnknownValue(
16692 wkt::internal::UnknownEnumValue::Integer(value),
16693 )),
16694 }
16695 }
16696 }
16697
16698 impl std::convert::From<&str> for SslOption {
16699 fn from(value: &str) -> Self {
16700 use std::string::ToString;
16701 match value {
16702 "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
16703 "DISABLE" => Self::Disable,
16704 "REQUIRE" => Self::Require,
16705 "VERIFY_CA" => Self::VerifyCa,
16706 _ => Self::UnknownValue(ssl_option::UnknownValue(
16707 wkt::internal::UnknownEnumValue::String(value.to_string()),
16708 )),
16709 }
16710 }
16711 }
16712
16713 impl serde::ser::Serialize for SslOption {
16714 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16715 where
16716 S: serde::Serializer,
16717 {
16718 match self {
16719 Self::Unspecified => serializer.serialize_i32(0),
16720 Self::Disable => serializer.serialize_i32(1),
16721 Self::Require => serializer.serialize_i32(2),
16722 Self::VerifyCa => serializer.serialize_i32(3),
16723 Self::UnknownValue(u) => u.0.serialize(serializer),
16724 }
16725 }
16726 }
16727
16728 impl<'de> serde::de::Deserialize<'de> for SslOption {
16729 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16730 where
16731 D: serde::Deserializer<'de>,
16732 {
16733 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
16734 ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
16735 ))
16736 }
16737 }
16738}
16739
16740/// Read-replica configuration for connecting to the primary instance.
16741#[derive(Clone, Default, PartialEq)]
16742#[non_exhaustive]
16743pub struct ReplicaConfiguration {
16744 /// This is always `sql#replicaConfiguration`.
16745 pub kind: std::string::String,
16746
16747 /// MySQL specific configuration when replicating from a MySQL on-premises
16748 /// primary instance. Replication configuration information such as the
16749 /// username, password, certificates, and keys are not stored in the instance
16750 /// metadata. The configuration information is used only to set up the
16751 /// replication connection and is stored by MySQL in a file named
16752 /// `master.info` in the data directory.
16753 pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
16754
16755 /// Specifies if the replica is the failover target. If the field is set to
16756 /// `true`, the replica will be designated as a failover replica. In case the
16757 /// primary instance fails, the replica instance will be promoted as the new
16758 /// primary instance. Only one replica can be specified as failover target, and
16759 /// the replica has to be in different zone with the primary instance.
16760 pub failover_target: std::option::Option<wkt::BoolValue>,
16761
16762 /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
16763 /// cascadable replica is a SQL Server cross region replica that supports
16764 /// replica(s) under it.
16765 pub cascadable_replica: std::option::Option<wkt::BoolValue>,
16766
16767 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16768}
16769
16770impl ReplicaConfiguration {
16771 /// Creates a new default instance.
16772 pub fn new() -> Self {
16773 std::default::Default::default()
16774 }
16775
16776 /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
16777 ///
16778 /// # Example
16779 /// ```ignore,no_run
16780 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16781 /// let x = ReplicaConfiguration::new().set_kind("example");
16782 /// ```
16783 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16784 self.kind = v.into();
16785 self
16786 }
16787
16788 /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
16789 ///
16790 /// # Example
16791 /// ```ignore,no_run
16792 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16793 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16794 /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
16795 /// ```
16796 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
16797 where
16798 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
16799 {
16800 self.mysql_replica_configuration = std::option::Option::Some(v.into());
16801 self
16802 }
16803
16804 /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
16805 ///
16806 /// # Example
16807 /// ```ignore,no_run
16808 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16809 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
16810 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
16811 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
16812 /// ```
16813 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
16814 where
16815 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
16816 {
16817 self.mysql_replica_configuration = v.map(|x| x.into());
16818 self
16819 }
16820
16821 /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
16822 ///
16823 /// # Example
16824 /// ```ignore,no_run
16825 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16826 /// use wkt::BoolValue;
16827 /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
16828 /// ```
16829 pub fn set_failover_target<T>(mut self, v: T) -> Self
16830 where
16831 T: std::convert::Into<wkt::BoolValue>,
16832 {
16833 self.failover_target = std::option::Option::Some(v.into());
16834 self
16835 }
16836
16837 /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
16838 ///
16839 /// # Example
16840 /// ```ignore,no_run
16841 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16842 /// use wkt::BoolValue;
16843 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
16844 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
16845 /// ```
16846 pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
16847 where
16848 T: std::convert::Into<wkt::BoolValue>,
16849 {
16850 self.failover_target = v.map(|x| x.into());
16851 self
16852 }
16853
16854 /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
16855 ///
16856 /// # Example
16857 /// ```ignore,no_run
16858 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16859 /// use wkt::BoolValue;
16860 /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
16861 /// ```
16862 pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
16863 where
16864 T: std::convert::Into<wkt::BoolValue>,
16865 {
16866 self.cascadable_replica = std::option::Option::Some(v.into());
16867 self
16868 }
16869
16870 /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
16871 ///
16872 /// # Example
16873 /// ```ignore,no_run
16874 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
16875 /// use wkt::BoolValue;
16876 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
16877 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
16878 /// ```
16879 pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
16880 where
16881 T: std::convert::Into<wkt::BoolValue>,
16882 {
16883 self.cascadable_replica = v.map(|x| x.into());
16884 self
16885 }
16886}
16887
16888impl wkt::message::Message for ReplicaConfiguration {
16889 fn typename() -> &'static str {
16890 "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
16891 }
16892}
16893
16894/// Execute SQL statements request.
16895#[derive(Clone, Default, PartialEq)]
16896#[non_exhaustive]
16897pub struct SqlInstancesExecuteSqlRequest {
16898 /// Required. Database instance ID. This does not include the project ID.
16899 pub instance: std::string::String,
16900
16901 /// Required. Project ID of the project that contains the instance.
16902 pub project: std::string::String,
16903
16904 /// The request body.
16905 pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
16906
16907 /// Optional. Region of the Cloud SQL instance.
16908 pub location: std::string::String,
16909
16910 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16911}
16912
16913impl SqlInstancesExecuteSqlRequest {
16914 /// Creates a new default instance.
16915 pub fn new() -> Self {
16916 std::default::Default::default()
16917 }
16918
16919 /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
16920 ///
16921 /// # Example
16922 /// ```ignore,no_run
16923 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16924 /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
16925 /// ```
16926 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16927 self.instance = v.into();
16928 self
16929 }
16930
16931 /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
16932 ///
16933 /// # Example
16934 /// ```ignore,no_run
16935 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16936 /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
16937 /// ```
16938 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16939 self.project = v.into();
16940 self
16941 }
16942
16943 /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
16944 ///
16945 /// # Example
16946 /// ```ignore,no_run
16947 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16948 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
16949 /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
16950 /// ```
16951 pub fn set_body<T>(mut self, v: T) -> Self
16952 where
16953 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
16954 {
16955 self.body = std::option::Option::Some(v.into());
16956 self
16957 }
16958
16959 /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
16960 ///
16961 /// # Example
16962 /// ```ignore,no_run
16963 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16964 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
16965 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
16966 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
16967 /// ```
16968 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16969 where
16970 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
16971 {
16972 self.body = v.map(|x| x.into());
16973 self
16974 }
16975
16976 /// Sets the value of [location][crate::model::SqlInstancesExecuteSqlRequest::location].
16977 ///
16978 /// # Example
16979 /// ```ignore,no_run
16980 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
16981 /// let x = SqlInstancesExecuteSqlRequest::new().set_location("example");
16982 /// ```
16983 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16984 self.location = v.into();
16985 self
16986 }
16987}
16988
16989impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
16990 fn typename() -> &'static str {
16991 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
16992 }
16993}
16994
16995/// The request payload used to execute SQL statements.
16996#[derive(Clone, Default, PartialEq)]
16997#[non_exhaustive]
16998pub struct ExecuteSqlPayload {
16999 /// Optional. The name of an existing database user to connect to the database.
17000 /// When `auto_iam_authn` is set to true, this field is ignored and the API
17001 /// caller's IAM user is used.
17002 pub user: std::string::String,
17003
17004 /// Required. SQL statements to run on the database. It can be a single
17005 /// statement or a sequence of statements separated by semicolons.
17006 pub sql_statement: std::string::String,
17007
17008 /// Optional. Name of the database on which the statement will be executed.
17009 pub database: std::string::String,
17010
17011 /// Optional. The maximum number of rows returned per SQL statement.
17012 pub row_limit: i64,
17013
17014 /// Optional. Controls how the API should respond when the SQL execution result
17015 /// is incomplete due to the size limit or another error. The default mode is
17016 /// to throw an error.
17017 pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
17018
17019 /// Optional. Specifies the name of the application that is making the request.
17020 /// This field is used for telemetry. Only alphanumeric characters, dashes, and
17021 /// underscores are allowed. The maximum length is 32 characters.
17022 pub application: std::string::String,
17023
17024 /// Credentials for the database connection.
17025 pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
17026
17027 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17028}
17029
17030impl ExecuteSqlPayload {
17031 /// Creates a new default instance.
17032 pub fn new() -> Self {
17033 std::default::Default::default()
17034 }
17035
17036 /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
17037 ///
17038 /// # Example
17039 /// ```ignore,no_run
17040 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17041 /// let x = ExecuteSqlPayload::new().set_user("example");
17042 /// ```
17043 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17044 self.user = v.into();
17045 self
17046 }
17047
17048 /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
17049 ///
17050 /// # Example
17051 /// ```ignore,no_run
17052 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17053 /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
17054 /// ```
17055 pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17056 self.sql_statement = v.into();
17057 self
17058 }
17059
17060 /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
17061 ///
17062 /// # Example
17063 /// ```ignore,no_run
17064 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17065 /// let x = ExecuteSqlPayload::new().set_database("example");
17066 /// ```
17067 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17068 self.database = v.into();
17069 self
17070 }
17071
17072 /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
17073 ///
17074 /// # Example
17075 /// ```ignore,no_run
17076 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17077 /// let x = ExecuteSqlPayload::new().set_row_limit(42);
17078 /// ```
17079 pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
17080 self.row_limit = v.into();
17081 self
17082 }
17083
17084 /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
17085 ///
17086 /// # Example
17087 /// ```ignore,no_run
17088 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17089 /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
17090 /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
17091 /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
17092 /// ```
17093 pub fn set_partial_result_mode<
17094 T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
17095 >(
17096 mut self,
17097 v: T,
17098 ) -> Self {
17099 self.partial_result_mode = v.into();
17100 self
17101 }
17102
17103 /// Sets the value of [application][crate::model::ExecuteSqlPayload::application].
17104 ///
17105 /// # Example
17106 /// ```ignore,no_run
17107 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17108 /// let x = ExecuteSqlPayload::new().set_application("example");
17109 /// ```
17110 pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17111 self.application = v.into();
17112 self
17113 }
17114
17115 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
17116 ///
17117 /// Note that all the setters affecting `user_password` are mutually
17118 /// exclusive.
17119 ///
17120 /// # Example
17121 /// ```ignore,no_run
17122 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17123 /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
17124 /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::PasswordSecretVersion("example".to_string())));
17125 /// ```
17126 pub fn set_user_password<
17127 T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
17128 >(
17129 mut self,
17130 v: T,
17131 ) -> Self {
17132 self.user_password = v.into();
17133 self
17134 }
17135
17136 /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
17137 /// if it holds a `PasswordSecretVersion`, `None` if the field is not set or
17138 /// holds a different branch.
17139 pub fn password_secret_version(&self) -> std::option::Option<&std::string::String> {
17140 #[allow(unreachable_patterns)]
17141 self.user_password.as_ref().and_then(|v| match v {
17142 crate::model::execute_sql_payload::UserPassword::PasswordSecretVersion(v) => {
17143 std::option::Option::Some(v)
17144 }
17145 _ => std::option::Option::None,
17146 })
17147 }
17148
17149 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
17150 /// to hold a `PasswordSecretVersion`.
17151 ///
17152 /// Note that all the setters affecting `user_password` are
17153 /// mutually exclusive.
17154 ///
17155 /// # Example
17156 /// ```ignore,no_run
17157 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17158 /// let x = ExecuteSqlPayload::new().set_password_secret_version("example");
17159 /// assert!(x.password_secret_version().is_some());
17160 /// assert!(x.auto_iam_authn().is_none());
17161 /// ```
17162 pub fn set_password_secret_version<T: std::convert::Into<std::string::String>>(
17163 mut self,
17164 v: T,
17165 ) -> Self {
17166 self.user_password = std::option::Option::Some(
17167 crate::model::execute_sql_payload::UserPassword::PasswordSecretVersion(v.into()),
17168 );
17169 self
17170 }
17171
17172 /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
17173 /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
17174 /// holds a different branch.
17175 pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
17176 #[allow(unreachable_patterns)]
17177 self.user_password.as_ref().and_then(|v| match v {
17178 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
17179 std::option::Option::Some(v)
17180 }
17181 _ => std::option::Option::None,
17182 })
17183 }
17184
17185 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
17186 /// to hold a `AutoIamAuthn`.
17187 ///
17188 /// Note that all the setters affecting `user_password` are
17189 /// mutually exclusive.
17190 ///
17191 /// # Example
17192 /// ```ignore,no_run
17193 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
17194 /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
17195 /// assert!(x.auto_iam_authn().is_some());
17196 /// assert!(x.password_secret_version().is_none());
17197 /// ```
17198 pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17199 self.user_password = std::option::Option::Some(
17200 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
17201 );
17202 self
17203 }
17204}
17205
17206impl wkt::message::Message for ExecuteSqlPayload {
17207 fn typename() -> &'static str {
17208 "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
17209 }
17210}
17211
17212/// Defines additional types related to [ExecuteSqlPayload].
17213pub mod execute_sql_payload {
17214 #[allow(unused_imports)]
17215 use super::*;
17216
17217 /// Controls how the API should respond when the SQL execution result exceeds
17218 /// 10 MB.
17219 ///
17220 /// # Working with unknown values
17221 ///
17222 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17223 /// additional enum variants at any time. Adding new variants is not considered
17224 /// a breaking change. Applications should write their code in anticipation of:
17225 ///
17226 /// - New values appearing in future releases of the client library, **and**
17227 /// - New values received dynamically, without application changes.
17228 ///
17229 /// Please consult the [Working with enums] section in the user guide for some
17230 /// guidelines.
17231 ///
17232 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17233 #[derive(Clone, Debug, PartialEq)]
17234 #[non_exhaustive]
17235 pub enum PartialResultMode {
17236 /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
17237 Unspecified,
17238 /// Throw an error if the result exceeds 10 MB or if only a partial result
17239 /// can be retrieved. Don't return the result.
17240 FailPartialResult,
17241 /// Return a truncated result and set `partial_result` to true if the result
17242 /// exceeds 10 MB or if only a partial result can be retrieved due to error.
17243 /// Don't throw an error.
17244 AllowPartialResult,
17245 /// If set, the enum was initialized with an unknown value.
17246 ///
17247 /// Applications can examine the value using [PartialResultMode::value] or
17248 /// [PartialResultMode::name].
17249 UnknownValue(partial_result_mode::UnknownValue),
17250 }
17251
17252 #[doc(hidden)]
17253 pub mod partial_result_mode {
17254 #[allow(unused_imports)]
17255 use super::*;
17256 #[derive(Clone, Debug, PartialEq)]
17257 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17258 }
17259
17260 impl PartialResultMode {
17261 /// Gets the enum value.
17262 ///
17263 /// Returns `None` if the enum contains an unknown value deserialized from
17264 /// the string representation of enums.
17265 pub fn value(&self) -> std::option::Option<i32> {
17266 match self {
17267 Self::Unspecified => std::option::Option::Some(0),
17268 Self::FailPartialResult => std::option::Option::Some(1),
17269 Self::AllowPartialResult => std::option::Option::Some(2),
17270 Self::UnknownValue(u) => u.0.value(),
17271 }
17272 }
17273
17274 /// Gets the enum value as a string.
17275 ///
17276 /// Returns `None` if the enum contains an unknown value deserialized from
17277 /// the integer representation of enums.
17278 pub fn name(&self) -> std::option::Option<&str> {
17279 match self {
17280 Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
17281 Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
17282 Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
17283 Self::UnknownValue(u) => u.0.name(),
17284 }
17285 }
17286 }
17287
17288 impl std::default::Default for PartialResultMode {
17289 fn default() -> Self {
17290 use std::convert::From;
17291 Self::from(0)
17292 }
17293 }
17294
17295 impl std::fmt::Display for PartialResultMode {
17296 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17297 wkt::internal::display_enum(f, self.name(), self.value())
17298 }
17299 }
17300
17301 impl std::convert::From<i32> for PartialResultMode {
17302 fn from(value: i32) -> Self {
17303 match value {
17304 0 => Self::Unspecified,
17305 1 => Self::FailPartialResult,
17306 2 => Self::AllowPartialResult,
17307 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
17308 wkt::internal::UnknownEnumValue::Integer(value),
17309 )),
17310 }
17311 }
17312 }
17313
17314 impl std::convert::From<&str> for PartialResultMode {
17315 fn from(value: &str) -> Self {
17316 use std::string::ToString;
17317 match value {
17318 "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
17319 "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
17320 "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
17321 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
17322 wkt::internal::UnknownEnumValue::String(value.to_string()),
17323 )),
17324 }
17325 }
17326 }
17327
17328 impl serde::ser::Serialize for PartialResultMode {
17329 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17330 where
17331 S: serde::Serializer,
17332 {
17333 match self {
17334 Self::Unspecified => serializer.serialize_i32(0),
17335 Self::FailPartialResult => serializer.serialize_i32(1),
17336 Self::AllowPartialResult => serializer.serialize_i32(2),
17337 Self::UnknownValue(u) => u.0.serialize(serializer),
17338 }
17339 }
17340 }
17341
17342 impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
17343 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17344 where
17345 D: serde::Deserializer<'de>,
17346 {
17347 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
17348 ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
17349 ))
17350 }
17351 }
17352
17353 /// Credentials for the database connection.
17354 #[derive(Clone, Debug, PartialEq)]
17355 #[non_exhaustive]
17356 pub enum UserPassword {
17357 /// Optional. The resource name of the Secret Manager secret holding the
17358 /// password for the user to log into the database. The secret should be
17359 /// created using the regional endpoint (for API) or from the Regional
17360 /// Secrets page (for UI), and stored in the same region as the Cloud SQL
17361 /// instance. The expected resource name format is
17362 /// `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}`.
17363 /// Used together with the `user` field.
17364 /// The secret resource name will not be stored.
17365 PasswordSecretVersion(std::string::String),
17366 /// Optional. When set to `true`, the API caller identity associated with the
17367 /// request is used for database authentication. The API caller must be an
17368 /// IAM user in the database.
17369 AutoIamAuthn(bool),
17370 }
17371}
17372
17373/// Execute SQL statements response.
17374#[derive(Clone, Default, PartialEq)]
17375#[non_exhaustive]
17376pub struct SqlInstancesExecuteSqlResponse {
17377 /// A list of notices and warnings generated during query execution.
17378 /// For PostgreSQL, this includes all notices and warnings.
17379 /// For MySQL, this includes warnings generated by the last executed statement.
17380 /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
17381 /// be executed after each statement.
17382 pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
17383
17384 /// The additional metadata information regarding the execution of the SQL
17385 /// statements.
17386 pub metadata: std::option::Option<crate::model::Metadata>,
17387
17388 /// The list of results after executing all the SQL statements.
17389 pub results: std::vec::Vec<crate::model::QueryResult>,
17390
17391 /// Contains the error from the database if the SQL execution failed.
17392 pub status: std::option::Option<google_cloud_rpc::model::Status>,
17393
17394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17395}
17396
17397impl SqlInstancesExecuteSqlResponse {
17398 /// Creates a new default instance.
17399 pub fn new() -> Self {
17400 std::default::Default::default()
17401 }
17402
17403 /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
17404 ///
17405 /// # Example
17406 /// ```ignore,no_run
17407 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
17408 /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
17409 /// let x = SqlInstancesExecuteSqlResponse::new()
17410 /// .set_messages([
17411 /// Message::default()/* use setters */,
17412 /// Message::default()/* use (different) setters */,
17413 /// ]);
17414 /// ```
17415 pub fn set_messages<T, V>(mut self, v: T) -> Self
17416 where
17417 T: std::iter::IntoIterator<Item = V>,
17418 V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
17419 {
17420 use std::iter::Iterator;
17421 self.messages = v.into_iter().map(|i| i.into()).collect();
17422 self
17423 }
17424
17425 /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
17426 ///
17427 /// # Example
17428 /// ```ignore,no_run
17429 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
17430 /// use google_cloud_sql_v1::model::Metadata;
17431 /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
17432 /// ```
17433 pub fn set_metadata<T>(mut self, v: T) -> Self
17434 where
17435 T: std::convert::Into<crate::model::Metadata>,
17436 {
17437 self.metadata = std::option::Option::Some(v.into());
17438 self
17439 }
17440
17441 /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
17442 ///
17443 /// # Example
17444 /// ```ignore,no_run
17445 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
17446 /// use google_cloud_sql_v1::model::Metadata;
17447 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
17448 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
17449 /// ```
17450 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
17451 where
17452 T: std::convert::Into<crate::model::Metadata>,
17453 {
17454 self.metadata = v.map(|x| x.into());
17455 self
17456 }
17457
17458 /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
17459 ///
17460 /// # Example
17461 /// ```ignore,no_run
17462 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
17463 /// use google_cloud_sql_v1::model::QueryResult;
17464 /// let x = SqlInstancesExecuteSqlResponse::new()
17465 /// .set_results([
17466 /// QueryResult::default()/* use setters */,
17467 /// QueryResult::default()/* use (different) setters */,
17468 /// ]);
17469 /// ```
17470 pub fn set_results<T, V>(mut self, v: T) -> Self
17471 where
17472 T: std::iter::IntoIterator<Item = V>,
17473 V: std::convert::Into<crate::model::QueryResult>,
17474 {
17475 use std::iter::Iterator;
17476 self.results = v.into_iter().map(|i| i.into()).collect();
17477 self
17478 }
17479
17480 /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
17481 ///
17482 /// # Example
17483 /// ```ignore,no_run
17484 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
17485 /// use google_cloud_rpc::model::Status;
17486 /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
17487 /// ```
17488 pub fn set_status<T>(mut self, v: T) -> Self
17489 where
17490 T: std::convert::Into<google_cloud_rpc::model::Status>,
17491 {
17492 self.status = std::option::Option::Some(v.into());
17493 self
17494 }
17495
17496 /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
17497 ///
17498 /// # Example
17499 /// ```ignore,no_run
17500 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
17501 /// use google_cloud_rpc::model::Status;
17502 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
17503 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
17504 /// ```
17505 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
17506 where
17507 T: std::convert::Into<google_cloud_rpc::model::Status>,
17508 {
17509 self.status = v.map(|x| x.into());
17510 self
17511 }
17512}
17513
17514impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
17515 fn typename() -> &'static str {
17516 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
17517 }
17518}
17519
17520/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
17521pub mod sql_instances_execute_sql_response {
17522 #[allow(unused_imports)]
17523 use super::*;
17524
17525 /// Represents a notice or warning message from the database.
17526 #[derive(Clone, Default, PartialEq)]
17527 #[non_exhaustive]
17528 pub struct Message {
17529 /// The full message string.
17530 /// For PostgreSQL, this is a formatted string that may include severity,
17531 /// code, and the notice/warning message.
17532 /// For MySQL, this contains the warning message.
17533 pub message: std::option::Option<std::string::String>,
17534
17535 /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
17536 /// MySQL).
17537 pub severity: std::option::Option<std::string::String>,
17538
17539 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17540 }
17541
17542 impl Message {
17543 /// Creates a new default instance.
17544 pub fn new() -> Self {
17545 std::default::Default::default()
17546 }
17547
17548 /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
17549 ///
17550 /// # Example
17551 /// ```ignore,no_run
17552 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
17553 /// let x = Message::new().set_message("example");
17554 /// ```
17555 pub fn set_message<T>(mut self, v: T) -> Self
17556 where
17557 T: std::convert::Into<std::string::String>,
17558 {
17559 self.message = std::option::Option::Some(v.into());
17560 self
17561 }
17562
17563 /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
17564 ///
17565 /// # Example
17566 /// ```ignore,no_run
17567 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
17568 /// let x = Message::new().set_or_clear_message(Some("example"));
17569 /// let x = Message::new().set_or_clear_message(None::<String>);
17570 /// ```
17571 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
17572 where
17573 T: std::convert::Into<std::string::String>,
17574 {
17575 self.message = v.map(|x| x.into());
17576 self
17577 }
17578
17579 /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
17580 ///
17581 /// # Example
17582 /// ```ignore,no_run
17583 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
17584 /// let x = Message::new().set_severity("example");
17585 /// ```
17586 pub fn set_severity<T>(mut self, v: T) -> Self
17587 where
17588 T: std::convert::Into<std::string::String>,
17589 {
17590 self.severity = std::option::Option::Some(v.into());
17591 self
17592 }
17593
17594 /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
17595 ///
17596 /// # Example
17597 /// ```ignore,no_run
17598 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
17599 /// let x = Message::new().set_or_clear_severity(Some("example"));
17600 /// let x = Message::new().set_or_clear_severity(None::<String>);
17601 /// ```
17602 pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
17603 where
17604 T: std::convert::Into<std::string::String>,
17605 {
17606 self.severity = v.map(|x| x.into());
17607 self
17608 }
17609 }
17610
17611 impl wkt::message::Message for Message {
17612 fn typename() -> &'static str {
17613 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
17614 }
17615 }
17616}
17617
17618/// QueryResult contains the result of executing a single SQL statement.
17619#[derive(Clone, Default, PartialEq)]
17620#[non_exhaustive]
17621pub struct QueryResult {
17622 /// List of columns included in the result. This also includes the data type
17623 /// of the column.
17624 pub columns: std::vec::Vec<crate::model::Column>,
17625
17626 /// Rows returned by the SQL statement.
17627 pub rows: std::vec::Vec<crate::model::Row>,
17628
17629 /// Message related to the SQL execution result.
17630 pub message: std::string::String,
17631
17632 /// Set to true if the SQL execution's result is truncated due to size limits
17633 /// or an error retrieving results.
17634 pub partial_result: bool,
17635
17636 /// If results were truncated due to an error, details of that error.
17637 pub status: std::option::Option<google_cloud_rpc::model::Status>,
17638
17639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17640}
17641
17642impl QueryResult {
17643 /// Creates a new default instance.
17644 pub fn new() -> Self {
17645 std::default::Default::default()
17646 }
17647
17648 /// Sets the value of [columns][crate::model::QueryResult::columns].
17649 ///
17650 /// # Example
17651 /// ```ignore,no_run
17652 /// # use google_cloud_sql_v1::model::QueryResult;
17653 /// use google_cloud_sql_v1::model::Column;
17654 /// let x = QueryResult::new()
17655 /// .set_columns([
17656 /// Column::default()/* use setters */,
17657 /// Column::default()/* use (different) setters */,
17658 /// ]);
17659 /// ```
17660 pub fn set_columns<T, V>(mut self, v: T) -> Self
17661 where
17662 T: std::iter::IntoIterator<Item = V>,
17663 V: std::convert::Into<crate::model::Column>,
17664 {
17665 use std::iter::Iterator;
17666 self.columns = v.into_iter().map(|i| i.into()).collect();
17667 self
17668 }
17669
17670 /// Sets the value of [rows][crate::model::QueryResult::rows].
17671 ///
17672 /// # Example
17673 /// ```ignore,no_run
17674 /// # use google_cloud_sql_v1::model::QueryResult;
17675 /// use google_cloud_sql_v1::model::Row;
17676 /// let x = QueryResult::new()
17677 /// .set_rows([
17678 /// Row::default()/* use setters */,
17679 /// Row::default()/* use (different) setters */,
17680 /// ]);
17681 /// ```
17682 pub fn set_rows<T, V>(mut self, v: T) -> Self
17683 where
17684 T: std::iter::IntoIterator<Item = V>,
17685 V: std::convert::Into<crate::model::Row>,
17686 {
17687 use std::iter::Iterator;
17688 self.rows = v.into_iter().map(|i| i.into()).collect();
17689 self
17690 }
17691
17692 /// Sets the value of [message][crate::model::QueryResult::message].
17693 ///
17694 /// # Example
17695 /// ```ignore,no_run
17696 /// # use google_cloud_sql_v1::model::QueryResult;
17697 /// let x = QueryResult::new().set_message("example");
17698 /// ```
17699 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17700 self.message = v.into();
17701 self
17702 }
17703
17704 /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
17705 ///
17706 /// # Example
17707 /// ```ignore,no_run
17708 /// # use google_cloud_sql_v1::model::QueryResult;
17709 /// let x = QueryResult::new().set_partial_result(true);
17710 /// ```
17711 pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17712 self.partial_result = v.into();
17713 self
17714 }
17715
17716 /// Sets the value of [status][crate::model::QueryResult::status].
17717 ///
17718 /// # Example
17719 /// ```ignore,no_run
17720 /// # use google_cloud_sql_v1::model::QueryResult;
17721 /// use google_cloud_rpc::model::Status;
17722 /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
17723 /// ```
17724 pub fn set_status<T>(mut self, v: T) -> Self
17725 where
17726 T: std::convert::Into<google_cloud_rpc::model::Status>,
17727 {
17728 self.status = std::option::Option::Some(v.into());
17729 self
17730 }
17731
17732 /// Sets or clears the value of [status][crate::model::QueryResult::status].
17733 ///
17734 /// # Example
17735 /// ```ignore,no_run
17736 /// # use google_cloud_sql_v1::model::QueryResult;
17737 /// use google_cloud_rpc::model::Status;
17738 /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
17739 /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
17740 /// ```
17741 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
17742 where
17743 T: std::convert::Into<google_cloud_rpc::model::Status>,
17744 {
17745 self.status = v.map(|x| x.into());
17746 self
17747 }
17748}
17749
17750impl wkt::message::Message for QueryResult {
17751 fn typename() -> &'static str {
17752 "type.googleapis.com/google.cloud.sql.v1.QueryResult"
17753 }
17754}
17755
17756/// Contains the name and datatype of a column.
17757#[derive(Clone, Default, PartialEq)]
17758#[non_exhaustive]
17759pub struct Column {
17760 /// Name of the column.
17761 pub name: std::string::String,
17762
17763 /// Datatype of the column.
17764 pub r#type: std::string::String,
17765
17766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17767}
17768
17769impl Column {
17770 /// Creates a new default instance.
17771 pub fn new() -> Self {
17772 std::default::Default::default()
17773 }
17774
17775 /// Sets the value of [name][crate::model::Column::name].
17776 ///
17777 /// # Example
17778 /// ```ignore,no_run
17779 /// # use google_cloud_sql_v1::model::Column;
17780 /// let x = Column::new().set_name("example");
17781 /// ```
17782 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17783 self.name = v.into();
17784 self
17785 }
17786
17787 /// Sets the value of [r#type][crate::model::Column::type].
17788 ///
17789 /// # Example
17790 /// ```ignore,no_run
17791 /// # use google_cloud_sql_v1::model::Column;
17792 /// let x = Column::new().set_type("example");
17793 /// ```
17794 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17795 self.r#type = v.into();
17796 self
17797 }
17798}
17799
17800impl wkt::message::Message for Column {
17801 fn typename() -> &'static str {
17802 "type.googleapis.com/google.cloud.sql.v1.Column"
17803 }
17804}
17805
17806/// Contains the values for a row.
17807#[derive(Clone, Default, PartialEq)]
17808#[non_exhaustive]
17809pub struct Row {
17810 /// The values for the row.
17811 pub values: std::vec::Vec<crate::model::Value>,
17812
17813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17814}
17815
17816impl Row {
17817 /// Creates a new default instance.
17818 pub fn new() -> Self {
17819 std::default::Default::default()
17820 }
17821
17822 /// Sets the value of [values][crate::model::Row::values].
17823 ///
17824 /// # Example
17825 /// ```ignore,no_run
17826 /// # use google_cloud_sql_v1::model::Row;
17827 /// use google_cloud_sql_v1::model::Value;
17828 /// let x = Row::new()
17829 /// .set_values([
17830 /// Value::default()/* use setters */,
17831 /// Value::default()/* use (different) setters */,
17832 /// ]);
17833 /// ```
17834 pub fn set_values<T, V>(mut self, v: T) -> Self
17835 where
17836 T: std::iter::IntoIterator<Item = V>,
17837 V: std::convert::Into<crate::model::Value>,
17838 {
17839 use std::iter::Iterator;
17840 self.values = v.into_iter().map(|i| i.into()).collect();
17841 self
17842 }
17843}
17844
17845impl wkt::message::Message for Row {
17846 fn typename() -> &'static str {
17847 "type.googleapis.com/google.cloud.sql.v1.Row"
17848 }
17849}
17850
17851/// The cell value of the table.
17852#[derive(Clone, Default, PartialEq)]
17853#[non_exhaustive]
17854pub struct Value {
17855 /// The cell value in string format.
17856 pub value: std::string::String,
17857
17858 /// If cell value is null, then this flag will be set to true.
17859 pub null_value: bool,
17860
17861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17862}
17863
17864impl Value {
17865 /// Creates a new default instance.
17866 pub fn new() -> Self {
17867 std::default::Default::default()
17868 }
17869
17870 /// Sets the value of [value][crate::model::Value::value].
17871 ///
17872 /// # Example
17873 /// ```ignore,no_run
17874 /// # use google_cloud_sql_v1::model::Value;
17875 /// let x = Value::new().set_value("example");
17876 /// ```
17877 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17878 self.value = v.into();
17879 self
17880 }
17881
17882 /// Sets the value of [null_value][crate::model::Value::null_value].
17883 ///
17884 /// # Example
17885 /// ```ignore,no_run
17886 /// # use google_cloud_sql_v1::model::Value;
17887 /// let x = Value::new().set_null_value(true);
17888 /// ```
17889 pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
17890 self.null_value = v.into();
17891 self
17892 }
17893}
17894
17895impl wkt::message::Message for Value {
17896 fn typename() -> &'static str {
17897 "type.googleapis.com/google.cloud.sql.v1.Value"
17898 }
17899}
17900
17901/// The additional metadata information regarding the execution of the SQL
17902/// statements.
17903#[derive(Clone, Default, PartialEq)]
17904#[non_exhaustive]
17905pub struct Metadata {
17906 /// The time taken to execute the SQL statements.
17907 pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
17908
17909 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17910}
17911
17912impl Metadata {
17913 /// Creates a new default instance.
17914 pub fn new() -> Self {
17915 std::default::Default::default()
17916 }
17917
17918 /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
17919 ///
17920 /// # Example
17921 /// ```ignore,no_run
17922 /// # use google_cloud_sql_v1::model::Metadata;
17923 /// use wkt::Duration;
17924 /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
17925 /// ```
17926 pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
17927 where
17928 T: std::convert::Into<wkt::Duration>,
17929 {
17930 self.sql_statement_execution_time = std::option::Option::Some(v.into());
17931 self
17932 }
17933
17934 /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
17935 ///
17936 /// # Example
17937 /// ```ignore,no_run
17938 /// # use google_cloud_sql_v1::model::Metadata;
17939 /// use wkt::Duration;
17940 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
17941 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
17942 /// ```
17943 pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
17944 where
17945 T: std::convert::Into<wkt::Duration>,
17946 {
17947 self.sql_statement_execution_time = v.map(|x| x.into());
17948 self
17949 }
17950}
17951
17952impl wkt::message::Message for Metadata {
17953 fn typename() -> &'static str {
17954 "type.googleapis.com/google.cloud.sql.v1.Metadata"
17955 }
17956}
17957
17958/// Request to acquire a lease for SSRS.
17959#[derive(Clone, Default, PartialEq)]
17960#[non_exhaustive]
17961pub struct SqlInstancesAcquireSsrsLeaseRequest {
17962 /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
17963 /// composed of lowercase letters, numbers, and hyphens, and it must start with
17964 /// a letter. The total length must be 98 characters or less (Example:
17965 /// instance-id).
17966 pub instance: std::string::String,
17967
17968 /// Required. Project ID of the project that contains the instance (Example:
17969 /// project-id).
17970 pub project: std::string::String,
17971
17972 /// Required. The request body.
17973 pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
17974
17975 /// Optional. Region of the Cloud SQL instance.
17976 pub location: std::string::String,
17977
17978 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17979}
17980
17981impl SqlInstancesAcquireSsrsLeaseRequest {
17982 /// Creates a new default instance.
17983 pub fn new() -> Self {
17984 std::default::Default::default()
17985 }
17986
17987 /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
17988 ///
17989 /// # Example
17990 /// ```ignore,no_run
17991 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
17992 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
17993 /// ```
17994 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17995 self.instance = v.into();
17996 self
17997 }
17998
17999 /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
18000 ///
18001 /// # Example
18002 /// ```ignore,no_run
18003 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
18004 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
18005 /// ```
18006 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18007 self.project = v.into();
18008 self
18009 }
18010
18011 /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
18012 ///
18013 /// # Example
18014 /// ```ignore,no_run
18015 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
18016 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
18017 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
18018 /// ```
18019 pub fn set_body<T>(mut self, v: T) -> Self
18020 where
18021 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
18022 {
18023 self.body = std::option::Option::Some(v.into());
18024 self
18025 }
18026
18027 /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
18028 ///
18029 /// # Example
18030 /// ```ignore,no_run
18031 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
18032 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
18033 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
18034 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
18035 /// ```
18036 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
18037 where
18038 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
18039 {
18040 self.body = v.map(|x| x.into());
18041 self
18042 }
18043
18044 /// Sets the value of [location][crate::model::SqlInstancesAcquireSsrsLeaseRequest::location].
18045 ///
18046 /// # Example
18047 /// ```ignore,no_run
18048 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
18049 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_location("example");
18050 /// ```
18051 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18052 self.location = v.into();
18053 self
18054 }
18055}
18056
18057impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
18058 fn typename() -> &'static str {
18059 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
18060 }
18061}
18062
18063/// Response for the acquire SSRS lease request.
18064#[derive(Clone, Default, PartialEq)]
18065#[non_exhaustive]
18066pub struct SqlInstancesAcquireSsrsLeaseResponse {
18067 /// The unique identifier for this operation.
18068 pub operation_id: std::string::String,
18069
18070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18071}
18072
18073impl SqlInstancesAcquireSsrsLeaseResponse {
18074 /// Creates a new default instance.
18075 pub fn new() -> Self {
18076 std::default::Default::default()
18077 }
18078
18079 /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
18080 ///
18081 /// # Example
18082 /// ```ignore,no_run
18083 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
18084 /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
18085 /// ```
18086 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18087 self.operation_id = v.into();
18088 self
18089 }
18090}
18091
18092impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
18093 fn typename() -> &'static str {
18094 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
18095 }
18096}
18097
18098/// Request to release a lease for SSRS.
18099#[derive(Clone, Default, PartialEq)]
18100#[non_exhaustive]
18101pub struct SqlInstancesReleaseSsrsLeaseRequest {
18102 /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
18103 /// The instance ID contains lowercase letters, numbers, and hyphens, and it
18104 /// must start with a letter. This ID can have a maximum length of 98
18105 /// characters.
18106 pub instance: std::string::String,
18107
18108 /// Required. The project ID that contains the instance.
18109 pub project: std::string::String,
18110
18111 /// Optional. Region of the Cloud SQL instance.
18112 pub location: std::string::String,
18113
18114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18115}
18116
18117impl SqlInstancesReleaseSsrsLeaseRequest {
18118 /// Creates a new default instance.
18119 pub fn new() -> Self {
18120 std::default::Default::default()
18121 }
18122
18123 /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
18124 ///
18125 /// # Example
18126 /// ```ignore,no_run
18127 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
18128 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
18129 /// ```
18130 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18131 self.instance = v.into();
18132 self
18133 }
18134
18135 /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
18136 ///
18137 /// # Example
18138 /// ```ignore,no_run
18139 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
18140 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
18141 /// ```
18142 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18143 self.project = v.into();
18144 self
18145 }
18146
18147 /// Sets the value of [location][crate::model::SqlInstancesReleaseSsrsLeaseRequest::location].
18148 ///
18149 /// # Example
18150 /// ```ignore,no_run
18151 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
18152 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_location("example");
18153 /// ```
18154 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18155 self.location = v.into();
18156 self
18157 }
18158}
18159
18160impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
18161 fn typename() -> &'static str {
18162 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
18163 }
18164}
18165
18166/// Response for the release SSRS lease request.
18167#[derive(Clone, Default, PartialEq)]
18168#[non_exhaustive]
18169pub struct SqlInstancesReleaseSsrsLeaseResponse {
18170 /// The unique identifier for this operation.
18171 pub operation_id: std::string::String,
18172
18173 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18174}
18175
18176impl SqlInstancesReleaseSsrsLeaseResponse {
18177 /// Creates a new default instance.
18178 pub fn new() -> Self {
18179 std::default::Default::default()
18180 }
18181
18182 /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
18183 ///
18184 /// # Example
18185 /// ```ignore,no_run
18186 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
18187 /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
18188 /// ```
18189 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18190 self.operation_id = v.into();
18191 self
18192 }
18193}
18194
18195impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
18196 fn typename() -> &'static str {
18197 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
18198 }
18199}
18200
18201/// Request to perform a point in time restore on a Google Cloud Backup and
18202/// Disaster Recovery managed instance.
18203#[derive(Clone, Default, PartialEq)]
18204#[non_exhaustive]
18205pub struct SqlInstancesPointInTimeRestoreRequest {
18206 /// Required. The parent resource where you created this instance.
18207 /// Format: projects/{project}
18208 pub parent: std::string::String,
18209
18210 /// Required. The context for request to perform a PITR on a Google Cloud
18211 /// Backup and Disaster Recovery managed instance.
18212 pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
18213
18214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18215}
18216
18217impl SqlInstancesPointInTimeRestoreRequest {
18218 /// Creates a new default instance.
18219 pub fn new() -> Self {
18220 std::default::Default::default()
18221 }
18222
18223 /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
18224 ///
18225 /// # Example
18226 /// ```ignore,no_run
18227 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
18228 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
18229 /// ```
18230 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18231 self.parent = v.into();
18232 self
18233 }
18234
18235 /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
18236 ///
18237 /// # Example
18238 /// ```ignore,no_run
18239 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
18240 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
18241 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
18242 /// ```
18243 pub fn set_context<T>(mut self, v: T) -> Self
18244 where
18245 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
18246 {
18247 self.context = std::option::Option::Some(v.into());
18248 self
18249 }
18250
18251 /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
18252 ///
18253 /// # Example
18254 /// ```ignore,no_run
18255 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
18256 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
18257 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
18258 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
18259 /// ```
18260 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
18261 where
18262 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
18263 {
18264 self.context = v.map(|x| x.into());
18265 self
18266 }
18267}
18268
18269impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
18270 fn typename() -> &'static str {
18271 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
18272 }
18273}
18274
18275/// Operations get request.
18276#[derive(Clone, Default, PartialEq)]
18277#[non_exhaustive]
18278pub struct SqlOperationsGetRequest {
18279 /// Required. Instance operation ID.
18280 pub operation: std::string::String,
18281
18282 /// Required. Project ID of the project that contains the instance.
18283 pub project: std::string::String,
18284
18285 /// Optional. Region of the Cloud SQL instance.
18286 pub location: std::string::String,
18287
18288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18289}
18290
18291impl SqlOperationsGetRequest {
18292 /// Creates a new default instance.
18293 pub fn new() -> Self {
18294 std::default::Default::default()
18295 }
18296
18297 /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
18298 ///
18299 /// # Example
18300 /// ```ignore,no_run
18301 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
18302 /// let x = SqlOperationsGetRequest::new().set_operation("example");
18303 /// ```
18304 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18305 self.operation = v.into();
18306 self
18307 }
18308
18309 /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
18310 ///
18311 /// # Example
18312 /// ```ignore,no_run
18313 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
18314 /// let x = SqlOperationsGetRequest::new().set_project("example");
18315 /// ```
18316 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18317 self.project = v.into();
18318 self
18319 }
18320
18321 /// Sets the value of [location][crate::model::SqlOperationsGetRequest::location].
18322 ///
18323 /// # Example
18324 /// ```ignore,no_run
18325 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
18326 /// let x = SqlOperationsGetRequest::new().set_location("example");
18327 /// ```
18328 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18329 self.location = v.into();
18330 self
18331 }
18332}
18333
18334impl wkt::message::Message for SqlOperationsGetRequest {
18335 fn typename() -> &'static str {
18336 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
18337 }
18338}
18339
18340/// Operations list request.
18341#[derive(Clone, Default, PartialEq)]
18342#[non_exhaustive]
18343pub struct SqlOperationsListRequest {
18344 /// Cloud SQL instance ID. This does not include the project ID.
18345 pub instance: std::string::String,
18346
18347 /// Maximum number of operations per response.
18348 pub max_results: u32,
18349
18350 /// A previously-returned page token representing part of the larger set of
18351 /// results to view.
18352 pub page_token: std::string::String,
18353
18354 /// Project ID of the project that contains the instance.
18355 pub project: std::string::String,
18356
18357 /// Optional. Region of the Cloud SQL instance.
18358 pub location: std::string::String,
18359
18360 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18361}
18362
18363impl SqlOperationsListRequest {
18364 /// Creates a new default instance.
18365 pub fn new() -> Self {
18366 std::default::Default::default()
18367 }
18368
18369 /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
18370 ///
18371 /// # Example
18372 /// ```ignore,no_run
18373 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
18374 /// let x = SqlOperationsListRequest::new().set_instance("example");
18375 /// ```
18376 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18377 self.instance = v.into();
18378 self
18379 }
18380
18381 /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
18382 ///
18383 /// # Example
18384 /// ```ignore,no_run
18385 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
18386 /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
18387 /// ```
18388 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
18389 self.max_results = v.into();
18390 self
18391 }
18392
18393 /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
18394 ///
18395 /// # Example
18396 /// ```ignore,no_run
18397 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
18398 /// let x = SqlOperationsListRequest::new().set_page_token("example");
18399 /// ```
18400 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18401 self.page_token = v.into();
18402 self
18403 }
18404
18405 /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
18406 ///
18407 /// # Example
18408 /// ```ignore,no_run
18409 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
18410 /// let x = SqlOperationsListRequest::new().set_project("example");
18411 /// ```
18412 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18413 self.project = v.into();
18414 self
18415 }
18416
18417 /// Sets the value of [location][crate::model::SqlOperationsListRequest::location].
18418 ///
18419 /// # Example
18420 /// ```ignore,no_run
18421 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
18422 /// let x = SqlOperationsListRequest::new().set_location("example");
18423 /// ```
18424 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18425 self.location = v.into();
18426 self
18427 }
18428}
18429
18430impl wkt::message::Message for SqlOperationsListRequest {
18431 fn typename() -> &'static str {
18432 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
18433 }
18434}
18435
18436/// Operations list response.
18437#[derive(Clone, Default, PartialEq)]
18438#[non_exhaustive]
18439pub struct OperationsListResponse {
18440 /// This is always `sql#operationsList`.
18441 pub kind: std::string::String,
18442
18443 /// List of operation resources.
18444 pub items: std::vec::Vec<crate::model::Operation>,
18445
18446 /// The continuation token, used to page through large result sets. Provide
18447 /// this value in a subsequent request to return the next page of results.
18448 pub next_page_token: std::string::String,
18449
18450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18451}
18452
18453impl OperationsListResponse {
18454 /// Creates a new default instance.
18455 pub fn new() -> Self {
18456 std::default::Default::default()
18457 }
18458
18459 /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
18460 ///
18461 /// # Example
18462 /// ```ignore,no_run
18463 /// # use google_cloud_sql_v1::model::OperationsListResponse;
18464 /// let x = OperationsListResponse::new().set_kind("example");
18465 /// ```
18466 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18467 self.kind = v.into();
18468 self
18469 }
18470
18471 /// Sets the value of [items][crate::model::OperationsListResponse::items].
18472 ///
18473 /// # Example
18474 /// ```ignore,no_run
18475 /// # use google_cloud_sql_v1::model::OperationsListResponse;
18476 /// use google_cloud_sql_v1::model::Operation;
18477 /// let x = OperationsListResponse::new()
18478 /// .set_items([
18479 /// Operation::default()/* use setters */,
18480 /// Operation::default()/* use (different) setters */,
18481 /// ]);
18482 /// ```
18483 pub fn set_items<T, V>(mut self, v: T) -> Self
18484 where
18485 T: std::iter::IntoIterator<Item = V>,
18486 V: std::convert::Into<crate::model::Operation>,
18487 {
18488 use std::iter::Iterator;
18489 self.items = v.into_iter().map(|i| i.into()).collect();
18490 self
18491 }
18492
18493 /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
18494 ///
18495 /// # Example
18496 /// ```ignore,no_run
18497 /// # use google_cloud_sql_v1::model::OperationsListResponse;
18498 /// let x = OperationsListResponse::new().set_next_page_token("example");
18499 /// ```
18500 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18501 self.next_page_token = v.into();
18502 self
18503 }
18504}
18505
18506impl wkt::message::Message for OperationsListResponse {
18507 fn typename() -> &'static str {
18508 "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
18509 }
18510}
18511
18512#[doc(hidden)]
18513impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
18514 type PageItem = crate::model::Operation;
18515
18516 fn items(self) -> std::vec::Vec<Self::PageItem> {
18517 self.items
18518 }
18519
18520 fn next_page_token(&self) -> std::string::String {
18521 use std::clone::Clone;
18522 self.next_page_token.clone()
18523 }
18524}
18525
18526/// Operations cancel request.
18527#[derive(Clone, Default, PartialEq)]
18528#[non_exhaustive]
18529pub struct SqlOperationsCancelRequest {
18530 /// Instance operation ID.
18531 pub operation: std::string::String,
18532
18533 /// Project ID of the project that contains the instance.
18534 pub project: std::string::String,
18535
18536 /// Optional. Region of the Cloud SQL instance.
18537 pub location: std::string::String,
18538
18539 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18540}
18541
18542impl SqlOperationsCancelRequest {
18543 /// Creates a new default instance.
18544 pub fn new() -> Self {
18545 std::default::Default::default()
18546 }
18547
18548 /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
18549 ///
18550 /// # Example
18551 /// ```ignore,no_run
18552 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
18553 /// let x = SqlOperationsCancelRequest::new().set_operation("example");
18554 /// ```
18555 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18556 self.operation = v.into();
18557 self
18558 }
18559
18560 /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
18561 ///
18562 /// # Example
18563 /// ```ignore,no_run
18564 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
18565 /// let x = SqlOperationsCancelRequest::new().set_project("example");
18566 /// ```
18567 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18568 self.project = v.into();
18569 self
18570 }
18571
18572 /// Sets the value of [location][crate::model::SqlOperationsCancelRequest::location].
18573 ///
18574 /// # Example
18575 /// ```ignore,no_run
18576 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
18577 /// let x = SqlOperationsCancelRequest::new().set_location("example");
18578 /// ```
18579 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18580 self.location = v.into();
18581 self
18582 }
18583}
18584
18585impl wkt::message::Message for SqlOperationsCancelRequest {
18586 fn typename() -> &'static str {
18587 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
18588 }
18589}
18590
18591/// An entry for an Access Control list.
18592#[derive(Clone, Default, PartialEq)]
18593#[non_exhaustive]
18594pub struct AclEntry {
18595 /// The allowlisted value for the access control list.
18596 pub value: std::string::String,
18597
18598 /// The time when this access control entry expires in
18599 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
18600 /// `2012-11-15T16:19:00.094Z`.
18601 pub expiration_time: std::option::Option<wkt::Timestamp>,
18602
18603 /// Optional. A label to identify this entry.
18604 pub name: std::string::String,
18605
18606 /// This is always `sql#aclEntry`.
18607 pub kind: std::string::String,
18608
18609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18610}
18611
18612impl AclEntry {
18613 /// Creates a new default instance.
18614 pub fn new() -> Self {
18615 std::default::Default::default()
18616 }
18617
18618 /// Sets the value of [value][crate::model::AclEntry::value].
18619 ///
18620 /// # Example
18621 /// ```ignore,no_run
18622 /// # use google_cloud_sql_v1::model::AclEntry;
18623 /// let x = AclEntry::new().set_value("example");
18624 /// ```
18625 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18626 self.value = v.into();
18627 self
18628 }
18629
18630 /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
18631 ///
18632 /// # Example
18633 /// ```ignore,no_run
18634 /// # use google_cloud_sql_v1::model::AclEntry;
18635 /// use wkt::Timestamp;
18636 /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
18637 /// ```
18638 pub fn set_expiration_time<T>(mut self, v: T) -> Self
18639 where
18640 T: std::convert::Into<wkt::Timestamp>,
18641 {
18642 self.expiration_time = std::option::Option::Some(v.into());
18643 self
18644 }
18645
18646 /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
18647 ///
18648 /// # Example
18649 /// ```ignore,no_run
18650 /// # use google_cloud_sql_v1::model::AclEntry;
18651 /// use wkt::Timestamp;
18652 /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
18653 /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
18654 /// ```
18655 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
18656 where
18657 T: std::convert::Into<wkt::Timestamp>,
18658 {
18659 self.expiration_time = v.map(|x| x.into());
18660 self
18661 }
18662
18663 /// Sets the value of [name][crate::model::AclEntry::name].
18664 ///
18665 /// # Example
18666 /// ```ignore,no_run
18667 /// # use google_cloud_sql_v1::model::AclEntry;
18668 /// let x = AclEntry::new().set_name("example");
18669 /// ```
18670 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18671 self.name = v.into();
18672 self
18673 }
18674
18675 /// Sets the value of [kind][crate::model::AclEntry::kind].
18676 ///
18677 /// # Example
18678 /// ```ignore,no_run
18679 /// # use google_cloud_sql_v1::model::AclEntry;
18680 /// let x = AclEntry::new().set_kind("example");
18681 /// ```
18682 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18683 self.kind = v.into();
18684 self
18685 }
18686}
18687
18688impl wkt::message::Message for AclEntry {
18689 fn typename() -> &'static str {
18690 "type.googleapis.com/google.cloud.sql.v1.AclEntry"
18691 }
18692}
18693
18694/// An Admin API warning message.
18695#[derive(Clone, Default, PartialEq)]
18696#[non_exhaustive]
18697pub struct ApiWarning {
18698 /// Code to uniquely identify the warning type.
18699 pub code: crate::model::api_warning::SqlApiWarningCode,
18700
18701 /// The warning message.
18702 pub message: std::string::String,
18703
18704 /// The region name for REGION_UNREACHABLE warning.
18705 pub region: std::string::String,
18706
18707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18708}
18709
18710impl ApiWarning {
18711 /// Creates a new default instance.
18712 pub fn new() -> Self {
18713 std::default::Default::default()
18714 }
18715
18716 /// Sets the value of [code][crate::model::ApiWarning::code].
18717 ///
18718 /// # Example
18719 /// ```ignore,no_run
18720 /// # use google_cloud_sql_v1::model::ApiWarning;
18721 /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
18722 /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
18723 /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
18724 /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
18725 /// ```
18726 pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
18727 mut self,
18728 v: T,
18729 ) -> Self {
18730 self.code = v.into();
18731 self
18732 }
18733
18734 /// Sets the value of [message][crate::model::ApiWarning::message].
18735 ///
18736 /// # Example
18737 /// ```ignore,no_run
18738 /// # use google_cloud_sql_v1::model::ApiWarning;
18739 /// let x = ApiWarning::new().set_message("example");
18740 /// ```
18741 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18742 self.message = v.into();
18743 self
18744 }
18745
18746 /// Sets the value of [region][crate::model::ApiWarning::region].
18747 ///
18748 /// # Example
18749 /// ```ignore,no_run
18750 /// # use google_cloud_sql_v1::model::ApiWarning;
18751 /// let x = ApiWarning::new().set_region("example");
18752 /// ```
18753 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18754 self.region = v.into();
18755 self
18756 }
18757}
18758
18759impl wkt::message::Message for ApiWarning {
18760 fn typename() -> &'static str {
18761 "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
18762 }
18763}
18764
18765/// Defines additional types related to [ApiWarning].
18766pub mod api_warning {
18767 #[allow(unused_imports)]
18768 use super::*;
18769
18770 /// Enum for [SqlApiWarningCode].
18771 ///
18772 /// # Working with unknown values
18773 ///
18774 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18775 /// additional enum variants at any time. Adding new variants is not considered
18776 /// a breaking change. Applications should write their code in anticipation of:
18777 ///
18778 /// - New values appearing in future releases of the client library, **and**
18779 /// - New values received dynamically, without application changes.
18780 ///
18781 /// Please consult the [Working with enums] section in the user guide for some
18782 /// guidelines.
18783 ///
18784 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18785 #[derive(Clone, Debug, PartialEq)]
18786 #[non_exhaustive]
18787 pub enum SqlApiWarningCode {
18788 /// An unknown or unset warning type from Cloud SQL API.
18789 Unspecified,
18790 /// Warning when one or more regions are not reachable. The returned result
18791 /// set may be incomplete.
18792 RegionUnreachable,
18793 /// Warning when user provided maxResults parameter exceeds the limit. The
18794 /// returned result set may be incomplete.
18795 MaxResultsExceedsLimit,
18796 /// Warning when user tries to create/update a user with credentials that
18797 /// have previously been compromised by a public data breach.
18798 CompromisedCredentials,
18799 /// Warning when the operation succeeds but some non-critical workflow state
18800 /// failed.
18801 InternalStateFailure,
18802 /// If set, the enum was initialized with an unknown value.
18803 ///
18804 /// Applications can examine the value using [SqlApiWarningCode::value] or
18805 /// [SqlApiWarningCode::name].
18806 UnknownValue(sql_api_warning_code::UnknownValue),
18807 }
18808
18809 #[doc(hidden)]
18810 pub mod sql_api_warning_code {
18811 #[allow(unused_imports)]
18812 use super::*;
18813 #[derive(Clone, Debug, PartialEq)]
18814 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18815 }
18816
18817 impl SqlApiWarningCode {
18818 /// Gets the enum value.
18819 ///
18820 /// Returns `None` if the enum contains an unknown value deserialized from
18821 /// the string representation of enums.
18822 pub fn value(&self) -> std::option::Option<i32> {
18823 match self {
18824 Self::Unspecified => std::option::Option::Some(0),
18825 Self::RegionUnreachable => std::option::Option::Some(1),
18826 Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
18827 Self::CompromisedCredentials => std::option::Option::Some(3),
18828 Self::InternalStateFailure => std::option::Option::Some(4),
18829 Self::UnknownValue(u) => u.0.value(),
18830 }
18831 }
18832
18833 /// Gets the enum value as a string.
18834 ///
18835 /// Returns `None` if the enum contains an unknown value deserialized from
18836 /// the integer representation of enums.
18837 pub fn name(&self) -> std::option::Option<&str> {
18838 match self {
18839 Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
18840 Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
18841 Self::MaxResultsExceedsLimit => {
18842 std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
18843 }
18844 Self::CompromisedCredentials => {
18845 std::option::Option::Some("COMPROMISED_CREDENTIALS")
18846 }
18847 Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
18848 Self::UnknownValue(u) => u.0.name(),
18849 }
18850 }
18851 }
18852
18853 impl std::default::Default for SqlApiWarningCode {
18854 fn default() -> Self {
18855 use std::convert::From;
18856 Self::from(0)
18857 }
18858 }
18859
18860 impl std::fmt::Display for SqlApiWarningCode {
18861 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18862 wkt::internal::display_enum(f, self.name(), self.value())
18863 }
18864 }
18865
18866 impl std::convert::From<i32> for SqlApiWarningCode {
18867 fn from(value: i32) -> Self {
18868 match value {
18869 0 => Self::Unspecified,
18870 1 => Self::RegionUnreachable,
18871 2 => Self::MaxResultsExceedsLimit,
18872 3 => Self::CompromisedCredentials,
18873 4 => Self::InternalStateFailure,
18874 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
18875 wkt::internal::UnknownEnumValue::Integer(value),
18876 )),
18877 }
18878 }
18879 }
18880
18881 impl std::convert::From<&str> for SqlApiWarningCode {
18882 fn from(value: &str) -> Self {
18883 use std::string::ToString;
18884 match value {
18885 "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
18886 "REGION_UNREACHABLE" => Self::RegionUnreachable,
18887 "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
18888 "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
18889 "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
18890 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
18891 wkt::internal::UnknownEnumValue::String(value.to_string()),
18892 )),
18893 }
18894 }
18895 }
18896
18897 impl serde::ser::Serialize for SqlApiWarningCode {
18898 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18899 where
18900 S: serde::Serializer,
18901 {
18902 match self {
18903 Self::Unspecified => serializer.serialize_i32(0),
18904 Self::RegionUnreachable => serializer.serialize_i32(1),
18905 Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
18906 Self::CompromisedCredentials => serializer.serialize_i32(3),
18907 Self::InternalStateFailure => serializer.serialize_i32(4),
18908 Self::UnknownValue(u) => u.0.serialize(serializer),
18909 }
18910 }
18911 }
18912
18913 impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
18914 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18915 where
18916 D: serde::Deserializer<'de>,
18917 {
18918 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
18919 ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
18920 ))
18921 }
18922 }
18923}
18924
18925/// We currently only support backup retention by specifying the number
18926/// of backups we will retain.
18927#[derive(Clone, Default, PartialEq)]
18928#[non_exhaustive]
18929pub struct BackupRetentionSettings {
18930 /// The unit that 'retained_backups' represents.
18931 pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
18932
18933 /// Depending on the value of retention_unit, this is used to determine
18934 /// if a backup needs to be deleted. If retention_unit is 'COUNT', we will
18935 /// retain this many backups.
18936 pub retained_backups: std::option::Option<wkt::Int32Value>,
18937
18938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18939}
18940
18941impl BackupRetentionSettings {
18942 /// Creates a new default instance.
18943 pub fn new() -> Self {
18944 std::default::Default::default()
18945 }
18946
18947 /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
18948 ///
18949 /// # Example
18950 /// ```ignore,no_run
18951 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
18952 /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
18953 /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
18954 /// ```
18955 pub fn set_retention_unit<
18956 T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
18957 >(
18958 mut self,
18959 v: T,
18960 ) -> Self {
18961 self.retention_unit = v.into();
18962 self
18963 }
18964
18965 /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
18966 ///
18967 /// # Example
18968 /// ```ignore,no_run
18969 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
18970 /// use wkt::Int32Value;
18971 /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
18972 /// ```
18973 pub fn set_retained_backups<T>(mut self, v: T) -> Self
18974 where
18975 T: std::convert::Into<wkt::Int32Value>,
18976 {
18977 self.retained_backups = std::option::Option::Some(v.into());
18978 self
18979 }
18980
18981 /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
18982 ///
18983 /// # Example
18984 /// ```ignore,no_run
18985 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
18986 /// use wkt::Int32Value;
18987 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
18988 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
18989 /// ```
18990 pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
18991 where
18992 T: std::convert::Into<wkt::Int32Value>,
18993 {
18994 self.retained_backups = v.map(|x| x.into());
18995 self
18996 }
18997}
18998
18999impl wkt::message::Message for BackupRetentionSettings {
19000 fn typename() -> &'static str {
19001 "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
19002 }
19003}
19004
19005/// Defines additional types related to [BackupRetentionSettings].
19006pub mod backup_retention_settings {
19007 #[allow(unused_imports)]
19008 use super::*;
19009
19010 /// The units that retained_backups specifies, we only support COUNT.
19011 ///
19012 /// # Working with unknown values
19013 ///
19014 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19015 /// additional enum variants at any time. Adding new variants is not considered
19016 /// a breaking change. Applications should write their code in anticipation of:
19017 ///
19018 /// - New values appearing in future releases of the client library, **and**
19019 /// - New values received dynamically, without application changes.
19020 ///
19021 /// Please consult the [Working with enums] section in the user guide for some
19022 /// guidelines.
19023 ///
19024 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19025 #[derive(Clone, Debug, PartialEq)]
19026 #[non_exhaustive]
19027 pub enum RetentionUnit {
19028 /// Backup retention unit is unspecified, will be treated as COUNT.
19029 Unspecified,
19030 /// Retention will be by count, eg. "retain the most recent 7 backups".
19031 Count,
19032 /// If set, the enum was initialized with an unknown value.
19033 ///
19034 /// Applications can examine the value using [RetentionUnit::value] or
19035 /// [RetentionUnit::name].
19036 UnknownValue(retention_unit::UnknownValue),
19037 }
19038
19039 #[doc(hidden)]
19040 pub mod retention_unit {
19041 #[allow(unused_imports)]
19042 use super::*;
19043 #[derive(Clone, Debug, PartialEq)]
19044 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19045 }
19046
19047 impl RetentionUnit {
19048 /// Gets the enum value.
19049 ///
19050 /// Returns `None` if the enum contains an unknown value deserialized from
19051 /// the string representation of enums.
19052 pub fn value(&self) -> std::option::Option<i32> {
19053 match self {
19054 Self::Unspecified => std::option::Option::Some(0),
19055 Self::Count => std::option::Option::Some(1),
19056 Self::UnknownValue(u) => u.0.value(),
19057 }
19058 }
19059
19060 /// Gets the enum value as a string.
19061 ///
19062 /// Returns `None` if the enum contains an unknown value deserialized from
19063 /// the integer representation of enums.
19064 pub fn name(&self) -> std::option::Option<&str> {
19065 match self {
19066 Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
19067 Self::Count => std::option::Option::Some("COUNT"),
19068 Self::UnknownValue(u) => u.0.name(),
19069 }
19070 }
19071 }
19072
19073 impl std::default::Default for RetentionUnit {
19074 fn default() -> Self {
19075 use std::convert::From;
19076 Self::from(0)
19077 }
19078 }
19079
19080 impl std::fmt::Display for RetentionUnit {
19081 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19082 wkt::internal::display_enum(f, self.name(), self.value())
19083 }
19084 }
19085
19086 impl std::convert::From<i32> for RetentionUnit {
19087 fn from(value: i32) -> Self {
19088 match value {
19089 0 => Self::Unspecified,
19090 1 => Self::Count,
19091 _ => Self::UnknownValue(retention_unit::UnknownValue(
19092 wkt::internal::UnknownEnumValue::Integer(value),
19093 )),
19094 }
19095 }
19096 }
19097
19098 impl std::convert::From<&str> for RetentionUnit {
19099 fn from(value: &str) -> Self {
19100 use std::string::ToString;
19101 match value {
19102 "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
19103 "COUNT" => Self::Count,
19104 _ => Self::UnknownValue(retention_unit::UnknownValue(
19105 wkt::internal::UnknownEnumValue::String(value.to_string()),
19106 )),
19107 }
19108 }
19109 }
19110
19111 impl serde::ser::Serialize for RetentionUnit {
19112 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19113 where
19114 S: serde::Serializer,
19115 {
19116 match self {
19117 Self::Unspecified => serializer.serialize_i32(0),
19118 Self::Count => serializer.serialize_i32(1),
19119 Self::UnknownValue(u) => u.0.serialize(serializer),
19120 }
19121 }
19122 }
19123
19124 impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
19125 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19126 where
19127 D: serde::Deserializer<'de>,
19128 {
19129 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
19130 ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
19131 ))
19132 }
19133 }
19134}
19135
19136/// Database instance backup configuration.
19137#[derive(Clone, Default, PartialEq)]
19138#[non_exhaustive]
19139pub struct BackupConfiguration {
19140 /// Start time for the daily backup configuration in UTC timezone in the 24
19141 /// hour format - `HH:MM`.
19142 pub start_time: std::string::String,
19143
19144 /// Whether this configuration is enabled.
19145 pub enabled: std::option::Option<wkt::BoolValue>,
19146
19147 /// This is always `sql#backupConfiguration`.
19148 pub kind: std::string::String,
19149
19150 /// (MySQL only) Whether binary log is enabled. If backup configuration is
19151 /// disabled, binarylog must be disabled as well.
19152 pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
19153
19154 /// Optional. Deprecated: replication_log_archiving_enabled is deprecated and
19155 /// will be removed from a future version of the API. Use
19156 /// [point_in_time_recovery_enabled][google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]
19157 /// instead.
19158 ///
19159 /// [google.cloud.sql.v1.BackupConfiguration.point_in_time_recovery_enabled]: crate::model::BackupConfiguration::point_in_time_recovery_enabled
19160 #[deprecated]
19161 pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
19162
19163 /// Location of the backup
19164 pub location: std::string::String,
19165
19166 /// Whether point in time recovery is enabled.
19167 pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
19168
19169 /// Backup retention settings.
19170 pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
19171
19172 /// The number of days of transaction logs we retain for point in time
19173 /// restore, from 1-7.
19174 pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
19175
19176 /// Output only. This value contains the storage location of transactional logs
19177 /// used to perform point-in-time recovery (PITR) for the database.
19178 pub transactional_log_storage_state:
19179 std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
19180
19181 /// Output only. Backup tier that manages the backups for the instance.
19182 pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
19183
19184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19185}
19186
19187impl BackupConfiguration {
19188 /// Creates a new default instance.
19189 pub fn new() -> Self {
19190 std::default::Default::default()
19191 }
19192
19193 /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
19194 ///
19195 /// # Example
19196 /// ```ignore,no_run
19197 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19198 /// let x = BackupConfiguration::new().set_start_time("example");
19199 /// ```
19200 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19201 self.start_time = v.into();
19202 self
19203 }
19204
19205 /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
19206 ///
19207 /// # Example
19208 /// ```ignore,no_run
19209 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19210 /// use wkt::BoolValue;
19211 /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
19212 /// ```
19213 pub fn set_enabled<T>(mut self, v: T) -> Self
19214 where
19215 T: std::convert::Into<wkt::BoolValue>,
19216 {
19217 self.enabled = std::option::Option::Some(v.into());
19218 self
19219 }
19220
19221 /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
19222 ///
19223 /// # Example
19224 /// ```ignore,no_run
19225 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19226 /// use wkt::BoolValue;
19227 /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
19228 /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
19229 /// ```
19230 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
19231 where
19232 T: std::convert::Into<wkt::BoolValue>,
19233 {
19234 self.enabled = v.map(|x| x.into());
19235 self
19236 }
19237
19238 /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
19239 ///
19240 /// # Example
19241 /// ```ignore,no_run
19242 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19243 /// let x = BackupConfiguration::new().set_kind("example");
19244 /// ```
19245 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19246 self.kind = v.into();
19247 self
19248 }
19249
19250 /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
19251 ///
19252 /// # Example
19253 /// ```ignore,no_run
19254 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19255 /// use wkt::BoolValue;
19256 /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
19257 /// ```
19258 pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
19259 where
19260 T: std::convert::Into<wkt::BoolValue>,
19261 {
19262 self.binary_log_enabled = std::option::Option::Some(v.into());
19263 self
19264 }
19265
19266 /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
19267 ///
19268 /// # Example
19269 /// ```ignore,no_run
19270 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19271 /// use wkt::BoolValue;
19272 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
19273 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
19274 /// ```
19275 pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
19276 where
19277 T: std::convert::Into<wkt::BoolValue>,
19278 {
19279 self.binary_log_enabled = v.map(|x| x.into());
19280 self
19281 }
19282
19283 /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
19284 ///
19285 /// # Example
19286 /// ```ignore,no_run
19287 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19288 /// use wkt::BoolValue;
19289 /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
19290 /// ```
19291 #[deprecated]
19292 pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
19293 where
19294 T: std::convert::Into<wkt::BoolValue>,
19295 {
19296 self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
19297 self
19298 }
19299
19300 /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
19301 ///
19302 /// # Example
19303 /// ```ignore,no_run
19304 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19305 /// use wkt::BoolValue;
19306 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
19307 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
19308 /// ```
19309 #[deprecated]
19310 pub fn set_or_clear_replication_log_archiving_enabled<T>(
19311 mut self,
19312 v: std::option::Option<T>,
19313 ) -> Self
19314 where
19315 T: std::convert::Into<wkt::BoolValue>,
19316 {
19317 self.replication_log_archiving_enabled = v.map(|x| x.into());
19318 self
19319 }
19320
19321 /// Sets the value of [location][crate::model::BackupConfiguration::location].
19322 ///
19323 /// # Example
19324 /// ```ignore,no_run
19325 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19326 /// let x = BackupConfiguration::new().set_location("example");
19327 /// ```
19328 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19329 self.location = v.into();
19330 self
19331 }
19332
19333 /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
19334 ///
19335 /// # Example
19336 /// ```ignore,no_run
19337 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19338 /// use wkt::BoolValue;
19339 /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
19340 /// ```
19341 pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
19342 where
19343 T: std::convert::Into<wkt::BoolValue>,
19344 {
19345 self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
19346 self
19347 }
19348
19349 /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
19350 ///
19351 /// # Example
19352 /// ```ignore,no_run
19353 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19354 /// use wkt::BoolValue;
19355 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
19356 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
19357 /// ```
19358 pub fn set_or_clear_point_in_time_recovery_enabled<T>(
19359 mut self,
19360 v: std::option::Option<T>,
19361 ) -> Self
19362 where
19363 T: std::convert::Into<wkt::BoolValue>,
19364 {
19365 self.point_in_time_recovery_enabled = v.map(|x| x.into());
19366 self
19367 }
19368
19369 /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
19370 ///
19371 /// # Example
19372 /// ```ignore,no_run
19373 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19374 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
19375 /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
19376 /// ```
19377 pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
19378 where
19379 T: std::convert::Into<crate::model::BackupRetentionSettings>,
19380 {
19381 self.backup_retention_settings = std::option::Option::Some(v.into());
19382 self
19383 }
19384
19385 /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
19386 ///
19387 /// # Example
19388 /// ```ignore,no_run
19389 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19390 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
19391 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
19392 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
19393 /// ```
19394 pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
19395 where
19396 T: std::convert::Into<crate::model::BackupRetentionSettings>,
19397 {
19398 self.backup_retention_settings = v.map(|x| x.into());
19399 self
19400 }
19401
19402 /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
19403 ///
19404 /// # Example
19405 /// ```ignore,no_run
19406 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19407 /// use wkt::Int32Value;
19408 /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
19409 /// ```
19410 pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
19411 where
19412 T: std::convert::Into<wkt::Int32Value>,
19413 {
19414 self.transaction_log_retention_days = std::option::Option::Some(v.into());
19415 self
19416 }
19417
19418 /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
19419 ///
19420 /// # Example
19421 /// ```ignore,no_run
19422 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19423 /// use wkt::Int32Value;
19424 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
19425 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
19426 /// ```
19427 pub fn set_or_clear_transaction_log_retention_days<T>(
19428 mut self,
19429 v: std::option::Option<T>,
19430 ) -> Self
19431 where
19432 T: std::convert::Into<wkt::Int32Value>,
19433 {
19434 self.transaction_log_retention_days = v.map(|x| x.into());
19435 self
19436 }
19437
19438 /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
19439 ///
19440 /// # Example
19441 /// ```ignore,no_run
19442 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19443 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
19444 /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
19445 /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
19446 /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
19447 /// ```
19448 pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
19449 where
19450 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
19451 {
19452 self.transactional_log_storage_state = std::option::Option::Some(v.into());
19453 self
19454 }
19455
19456 /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
19457 ///
19458 /// # Example
19459 /// ```ignore,no_run
19460 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19461 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
19462 /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
19463 /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
19464 /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
19465 /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
19466 /// ```
19467 pub fn set_or_clear_transactional_log_storage_state<T>(
19468 mut self,
19469 v: std::option::Option<T>,
19470 ) -> Self
19471 where
19472 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
19473 {
19474 self.transactional_log_storage_state = v.map(|x| x.into());
19475 self
19476 }
19477
19478 /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
19479 ///
19480 /// # Example
19481 /// ```ignore,no_run
19482 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19483 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
19484 /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
19485 /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
19486 /// ```
19487 pub fn set_backup_tier<T>(mut self, v: T) -> Self
19488 where
19489 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
19490 {
19491 self.backup_tier = std::option::Option::Some(v.into());
19492 self
19493 }
19494
19495 /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
19496 ///
19497 /// # Example
19498 /// ```ignore,no_run
19499 /// # use google_cloud_sql_v1::model::BackupConfiguration;
19500 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
19501 /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
19502 /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
19503 /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
19504 /// ```
19505 pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
19506 where
19507 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
19508 {
19509 self.backup_tier = v.map(|x| x.into());
19510 self
19511 }
19512}
19513
19514impl wkt::message::Message for BackupConfiguration {
19515 fn typename() -> &'static str {
19516 "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
19517 }
19518}
19519
19520/// Defines additional types related to [BackupConfiguration].
19521pub mod backup_configuration {
19522 #[allow(unused_imports)]
19523 use super::*;
19524
19525 /// This value contains the storage location of the transactional logs
19526 /// used to perform point-in-time recovery (PITR) for the database.
19527 ///
19528 /// # Working with unknown values
19529 ///
19530 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19531 /// additional enum variants at any time. Adding new variants is not considered
19532 /// a breaking change. Applications should write their code in anticipation of:
19533 ///
19534 /// - New values appearing in future releases of the client library, **and**
19535 /// - New values received dynamically, without application changes.
19536 ///
19537 /// Please consult the [Working with enums] section in the user guide for some
19538 /// guidelines.
19539 ///
19540 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19541 #[derive(Clone, Debug, PartialEq)]
19542 #[non_exhaustive]
19543 pub enum TransactionalLogStorageState {
19544 /// Unspecified.
19545 Unspecified,
19546 /// The transaction logs used for PITR for the instance are stored
19547 /// on a data disk.
19548 Disk,
19549 /// The transaction logs used for PITR for the instance are switching from
19550 /// being stored on a data disk to being stored in Cloud Storage.
19551 /// Only applicable to MySQL.
19552 SwitchingToCloudStorage,
19553 /// The transaction logs used for PITR for the instance are now stored
19554 /// in Cloud Storage. Previously, they were stored on a data disk.
19555 /// Only applicable to MySQL.
19556 SwitchedToCloudStorage,
19557 /// The transaction logs used for PITR for the instance are stored in
19558 /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
19559 CloudStorage,
19560 /// If set, the enum was initialized with an unknown value.
19561 ///
19562 /// Applications can examine the value using [TransactionalLogStorageState::value] or
19563 /// [TransactionalLogStorageState::name].
19564 UnknownValue(transactional_log_storage_state::UnknownValue),
19565 }
19566
19567 #[doc(hidden)]
19568 pub mod transactional_log_storage_state {
19569 #[allow(unused_imports)]
19570 use super::*;
19571 #[derive(Clone, Debug, PartialEq)]
19572 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19573 }
19574
19575 impl TransactionalLogStorageState {
19576 /// Gets the enum value.
19577 ///
19578 /// Returns `None` if the enum contains an unknown value deserialized from
19579 /// the string representation of enums.
19580 pub fn value(&self) -> std::option::Option<i32> {
19581 match self {
19582 Self::Unspecified => std::option::Option::Some(0),
19583 Self::Disk => std::option::Option::Some(1),
19584 Self::SwitchingToCloudStorage => std::option::Option::Some(2),
19585 Self::SwitchedToCloudStorage => std::option::Option::Some(3),
19586 Self::CloudStorage => std::option::Option::Some(4),
19587 Self::UnknownValue(u) => u.0.value(),
19588 }
19589 }
19590
19591 /// Gets the enum value as a string.
19592 ///
19593 /// Returns `None` if the enum contains an unknown value deserialized from
19594 /// the integer representation of enums.
19595 pub fn name(&self) -> std::option::Option<&str> {
19596 match self {
19597 Self::Unspecified => {
19598 std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
19599 }
19600 Self::Disk => std::option::Option::Some("DISK"),
19601 Self::SwitchingToCloudStorage => {
19602 std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
19603 }
19604 Self::SwitchedToCloudStorage => {
19605 std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
19606 }
19607 Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
19608 Self::UnknownValue(u) => u.0.name(),
19609 }
19610 }
19611 }
19612
19613 impl std::default::Default for TransactionalLogStorageState {
19614 fn default() -> Self {
19615 use std::convert::From;
19616 Self::from(0)
19617 }
19618 }
19619
19620 impl std::fmt::Display for TransactionalLogStorageState {
19621 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19622 wkt::internal::display_enum(f, self.name(), self.value())
19623 }
19624 }
19625
19626 impl std::convert::From<i32> for TransactionalLogStorageState {
19627 fn from(value: i32) -> Self {
19628 match value {
19629 0 => Self::Unspecified,
19630 1 => Self::Disk,
19631 2 => Self::SwitchingToCloudStorage,
19632 3 => Self::SwitchedToCloudStorage,
19633 4 => Self::CloudStorage,
19634 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
19635 wkt::internal::UnknownEnumValue::Integer(value),
19636 )),
19637 }
19638 }
19639 }
19640
19641 impl std::convert::From<&str> for TransactionalLogStorageState {
19642 fn from(value: &str) -> Self {
19643 use std::string::ToString;
19644 match value {
19645 "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
19646 "DISK" => Self::Disk,
19647 "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
19648 "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
19649 "CLOUD_STORAGE" => Self::CloudStorage,
19650 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
19651 wkt::internal::UnknownEnumValue::String(value.to_string()),
19652 )),
19653 }
19654 }
19655 }
19656
19657 impl serde::ser::Serialize for TransactionalLogStorageState {
19658 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19659 where
19660 S: serde::Serializer,
19661 {
19662 match self {
19663 Self::Unspecified => serializer.serialize_i32(0),
19664 Self::Disk => serializer.serialize_i32(1),
19665 Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
19666 Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
19667 Self::CloudStorage => serializer.serialize_i32(4),
19668 Self::UnknownValue(u) => u.0.serialize(serializer),
19669 }
19670 }
19671 }
19672
19673 impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
19674 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19675 where
19676 D: serde::Deserializer<'de>,
19677 {
19678 deserializer.deserialize_any(
19679 wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
19680 ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
19681 ),
19682 )
19683 }
19684 }
19685
19686 /// Backup tier that manages the backups for the instance.
19687 ///
19688 /// # Working with unknown values
19689 ///
19690 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19691 /// additional enum variants at any time. Adding new variants is not considered
19692 /// a breaking change. Applications should write their code in anticipation of:
19693 ///
19694 /// - New values appearing in future releases of the client library, **and**
19695 /// - New values received dynamically, without application changes.
19696 ///
19697 /// Please consult the [Working with enums] section in the user guide for some
19698 /// guidelines.
19699 ///
19700 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19701 #[derive(Clone, Debug, PartialEq)]
19702 #[non_exhaustive]
19703 pub enum BackupTier {
19704 /// Unspecified.
19705 Unspecified,
19706 /// Instance is managed by Cloud SQL.
19707 Standard,
19708 /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
19709 #[deprecated]
19710 Advanced,
19711 /// Instance is managed by Google Cloud Backup and DR Service.
19712 Enhanced,
19713 /// If set, the enum was initialized with an unknown value.
19714 ///
19715 /// Applications can examine the value using [BackupTier::value] or
19716 /// [BackupTier::name].
19717 UnknownValue(backup_tier::UnknownValue),
19718 }
19719
19720 #[doc(hidden)]
19721 pub mod backup_tier {
19722 #[allow(unused_imports)]
19723 use super::*;
19724 #[derive(Clone, Debug, PartialEq)]
19725 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19726 }
19727
19728 impl BackupTier {
19729 /// Gets the enum value.
19730 ///
19731 /// Returns `None` if the enum contains an unknown value deserialized from
19732 /// the string representation of enums.
19733 pub fn value(&self) -> std::option::Option<i32> {
19734 match self {
19735 Self::Unspecified => std::option::Option::Some(0),
19736 Self::Standard => std::option::Option::Some(1),
19737 Self::Advanced => std::option::Option::Some(2),
19738 Self::Enhanced => std::option::Option::Some(3),
19739 Self::UnknownValue(u) => u.0.value(),
19740 }
19741 }
19742
19743 /// Gets the enum value as a string.
19744 ///
19745 /// Returns `None` if the enum contains an unknown value deserialized from
19746 /// the integer representation of enums.
19747 pub fn name(&self) -> std::option::Option<&str> {
19748 match self {
19749 Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
19750 Self::Standard => std::option::Option::Some("STANDARD"),
19751 Self::Advanced => std::option::Option::Some("ADVANCED"),
19752 Self::Enhanced => std::option::Option::Some("ENHANCED"),
19753 Self::UnknownValue(u) => u.0.name(),
19754 }
19755 }
19756 }
19757
19758 impl std::default::Default for BackupTier {
19759 fn default() -> Self {
19760 use std::convert::From;
19761 Self::from(0)
19762 }
19763 }
19764
19765 impl std::fmt::Display for BackupTier {
19766 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19767 wkt::internal::display_enum(f, self.name(), self.value())
19768 }
19769 }
19770
19771 impl std::convert::From<i32> for BackupTier {
19772 fn from(value: i32) -> Self {
19773 match value {
19774 0 => Self::Unspecified,
19775 1 => Self::Standard,
19776 2 => Self::Advanced,
19777 3 => Self::Enhanced,
19778 _ => Self::UnknownValue(backup_tier::UnknownValue(
19779 wkt::internal::UnknownEnumValue::Integer(value),
19780 )),
19781 }
19782 }
19783 }
19784
19785 impl std::convert::From<&str> for BackupTier {
19786 fn from(value: &str) -> Self {
19787 use std::string::ToString;
19788 match value {
19789 "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
19790 "STANDARD" => Self::Standard,
19791 "ADVANCED" => Self::Advanced,
19792 "ENHANCED" => Self::Enhanced,
19793 _ => Self::UnknownValue(backup_tier::UnknownValue(
19794 wkt::internal::UnknownEnumValue::String(value.to_string()),
19795 )),
19796 }
19797 }
19798 }
19799
19800 impl serde::ser::Serialize for BackupTier {
19801 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19802 where
19803 S: serde::Serializer,
19804 {
19805 match self {
19806 Self::Unspecified => serializer.serialize_i32(0),
19807 Self::Standard => serializer.serialize_i32(1),
19808 Self::Advanced => serializer.serialize_i32(2),
19809 Self::Enhanced => serializer.serialize_i32(3),
19810 Self::UnknownValue(u) => u.0.serialize(serializer),
19811 }
19812 }
19813 }
19814
19815 impl<'de> serde::de::Deserialize<'de> for BackupTier {
19816 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19817 where
19818 D: serde::Deserializer<'de>,
19819 {
19820 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
19821 ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
19822 ))
19823 }
19824 }
19825}
19826
19827/// Perform disk shrink context.
19828#[derive(Clone, Default, PartialEq)]
19829#[non_exhaustive]
19830pub struct PerformDiskShrinkContext {
19831 /// The target disk shrink size in GigaBytes.
19832 pub target_size_gb: i64,
19833
19834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19835}
19836
19837impl PerformDiskShrinkContext {
19838 /// Creates a new default instance.
19839 pub fn new() -> Self {
19840 std::default::Default::default()
19841 }
19842
19843 /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
19844 ///
19845 /// # Example
19846 /// ```ignore,no_run
19847 /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
19848 /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
19849 /// ```
19850 pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
19851 self.target_size_gb = v.into();
19852 self
19853 }
19854}
19855
19856impl wkt::message::Message for PerformDiskShrinkContext {
19857 fn typename() -> &'static str {
19858 "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
19859 }
19860}
19861
19862/// Structured PreCheckResponse containing message, type, and required
19863/// actions.
19864#[derive(Clone, Default, PartialEq)]
19865#[non_exhaustive]
19866pub struct PreCheckResponse {
19867 /// The message to be displayed to the user.
19868 pub message: std::option::Option<std::string::String>,
19869
19870 /// The type of message whether it is an info, warning, or error.
19871 pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
19872
19873 /// The actions that the user needs to take. Use repeated for multiple
19874 /// actions.
19875 pub actions_required: std::vec::Vec<std::string::String>,
19876
19877 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19878}
19879
19880impl PreCheckResponse {
19881 /// Creates a new default instance.
19882 pub fn new() -> Self {
19883 std::default::Default::default()
19884 }
19885
19886 /// Sets the value of [message][crate::model::PreCheckResponse::message].
19887 ///
19888 /// # Example
19889 /// ```ignore,no_run
19890 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19891 /// let x = PreCheckResponse::new().set_message("example");
19892 /// ```
19893 pub fn set_message<T>(mut self, v: T) -> Self
19894 where
19895 T: std::convert::Into<std::string::String>,
19896 {
19897 self.message = std::option::Option::Some(v.into());
19898 self
19899 }
19900
19901 /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
19902 ///
19903 /// # Example
19904 /// ```ignore,no_run
19905 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19906 /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
19907 /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
19908 /// ```
19909 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
19910 where
19911 T: std::convert::Into<std::string::String>,
19912 {
19913 self.message = v.map(|x| x.into());
19914 self
19915 }
19916
19917 /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
19918 ///
19919 /// # Example
19920 /// ```ignore,no_run
19921 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19922 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
19923 /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
19924 /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
19925 /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
19926 /// ```
19927 pub fn set_message_type<T>(mut self, v: T) -> Self
19928 where
19929 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
19930 {
19931 self.message_type = std::option::Option::Some(v.into());
19932 self
19933 }
19934
19935 /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
19936 ///
19937 /// # Example
19938 /// ```ignore,no_run
19939 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19940 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
19941 /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
19942 /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
19943 /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
19944 /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
19945 /// ```
19946 pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
19947 where
19948 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
19949 {
19950 self.message_type = v.map(|x| x.into());
19951 self
19952 }
19953
19954 /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
19955 ///
19956 /// # Example
19957 /// ```ignore,no_run
19958 /// # use google_cloud_sql_v1::model::PreCheckResponse;
19959 /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
19960 /// ```
19961 pub fn set_actions_required<T, V>(mut self, v: T) -> Self
19962 where
19963 T: std::iter::IntoIterator<Item = V>,
19964 V: std::convert::Into<std::string::String>,
19965 {
19966 use std::iter::Iterator;
19967 self.actions_required = v.into_iter().map(|i| i.into()).collect();
19968 self
19969 }
19970}
19971
19972impl wkt::message::Message for PreCheckResponse {
19973 fn typename() -> &'static str {
19974 "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
19975 }
19976}
19977
19978/// Defines additional types related to [PreCheckResponse].
19979pub mod pre_check_response {
19980 #[allow(unused_imports)]
19981 use super::*;
19982
19983 /// The type of message which can be an info, a warning, or an error that
19984 /// requires user intervention.
19985 ///
19986 /// # Working with unknown values
19987 ///
19988 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19989 /// additional enum variants at any time. Adding new variants is not considered
19990 /// a breaking change. Applications should write their code in anticipation of:
19991 ///
19992 /// - New values appearing in future releases of the client library, **and**
19993 /// - New values received dynamically, without application changes.
19994 ///
19995 /// Please consult the [Working with enums] section in the user guide for some
19996 /// guidelines.
19997 ///
19998 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19999 #[derive(Clone, Debug, PartialEq)]
20000 #[non_exhaustive]
20001 pub enum MessageType {
20002 /// Default unspecified value to prevent unintended behavior changes.
20003 Unspecified,
20004 /// General informational messages that don't require action.
20005 Info,
20006 /// Warnings that might impact the upgrade but don't block it.
20007 Warning,
20008 /// Errors that a user must resolve before proceeding with the upgrade.
20009 Error,
20010 /// If set, the enum was initialized with an unknown value.
20011 ///
20012 /// Applications can examine the value using [MessageType::value] or
20013 /// [MessageType::name].
20014 UnknownValue(message_type::UnknownValue),
20015 }
20016
20017 #[doc(hidden)]
20018 pub mod message_type {
20019 #[allow(unused_imports)]
20020 use super::*;
20021 #[derive(Clone, Debug, PartialEq)]
20022 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20023 }
20024
20025 impl MessageType {
20026 /// Gets the enum value.
20027 ///
20028 /// Returns `None` if the enum contains an unknown value deserialized from
20029 /// the string representation of enums.
20030 pub fn value(&self) -> std::option::Option<i32> {
20031 match self {
20032 Self::Unspecified => std::option::Option::Some(0),
20033 Self::Info => std::option::Option::Some(1),
20034 Self::Warning => std::option::Option::Some(2),
20035 Self::Error => std::option::Option::Some(3),
20036 Self::UnknownValue(u) => u.0.value(),
20037 }
20038 }
20039
20040 /// Gets the enum value as a string.
20041 ///
20042 /// Returns `None` if the enum contains an unknown value deserialized from
20043 /// the integer representation of enums.
20044 pub fn name(&self) -> std::option::Option<&str> {
20045 match self {
20046 Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
20047 Self::Info => std::option::Option::Some("INFO"),
20048 Self::Warning => std::option::Option::Some("WARNING"),
20049 Self::Error => std::option::Option::Some("ERROR"),
20050 Self::UnknownValue(u) => u.0.name(),
20051 }
20052 }
20053 }
20054
20055 impl std::default::Default for MessageType {
20056 fn default() -> Self {
20057 use std::convert::From;
20058 Self::from(0)
20059 }
20060 }
20061
20062 impl std::fmt::Display for MessageType {
20063 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20064 wkt::internal::display_enum(f, self.name(), self.value())
20065 }
20066 }
20067
20068 impl std::convert::From<i32> for MessageType {
20069 fn from(value: i32) -> Self {
20070 match value {
20071 0 => Self::Unspecified,
20072 1 => Self::Info,
20073 2 => Self::Warning,
20074 3 => Self::Error,
20075 _ => Self::UnknownValue(message_type::UnknownValue(
20076 wkt::internal::UnknownEnumValue::Integer(value),
20077 )),
20078 }
20079 }
20080 }
20081
20082 impl std::convert::From<&str> for MessageType {
20083 fn from(value: &str) -> Self {
20084 use std::string::ToString;
20085 match value {
20086 "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
20087 "INFO" => Self::Info,
20088 "WARNING" => Self::Warning,
20089 "ERROR" => Self::Error,
20090 _ => Self::UnknownValue(message_type::UnknownValue(
20091 wkt::internal::UnknownEnumValue::String(value.to_string()),
20092 )),
20093 }
20094 }
20095 }
20096
20097 impl serde::ser::Serialize for MessageType {
20098 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20099 where
20100 S: serde::Serializer,
20101 {
20102 match self {
20103 Self::Unspecified => serializer.serialize_i32(0),
20104 Self::Info => serializer.serialize_i32(1),
20105 Self::Warning => serializer.serialize_i32(2),
20106 Self::Error => serializer.serialize_i32(3),
20107 Self::UnknownValue(u) => u.0.serialize(serializer),
20108 }
20109 }
20110 }
20111
20112 impl<'de> serde::de::Deserialize<'de> for MessageType {
20113 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20114 where
20115 D: serde::Deserializer<'de>,
20116 {
20117 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
20118 ".google.cloud.sql.v1.PreCheckResponse.MessageType",
20119 ))
20120 }
20121 }
20122}
20123
20124/// Pre-check major version upgrade context.
20125#[derive(Clone, Default, PartialEq)]
20126#[non_exhaustive]
20127pub struct PreCheckMajorVersionUpgradeContext {
20128 /// Required. The target database version to upgrade to.
20129 pub target_database_version: crate::model::SqlDatabaseVersion,
20130
20131 /// Output only. The responses from the precheck operation.
20132 pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
20133
20134 /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
20135 pub kind: std::string::String,
20136
20137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20138}
20139
20140impl PreCheckMajorVersionUpgradeContext {
20141 /// Creates a new default instance.
20142 pub fn new() -> Self {
20143 std::default::Default::default()
20144 }
20145
20146 /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
20147 ///
20148 /// # Example
20149 /// ```ignore,no_run
20150 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
20151 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
20152 /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
20153 /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
20154 /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
20155 /// ```
20156 pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
20157 mut self,
20158 v: T,
20159 ) -> Self {
20160 self.target_database_version = v.into();
20161 self
20162 }
20163
20164 /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
20165 ///
20166 /// # Example
20167 /// ```ignore,no_run
20168 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
20169 /// use google_cloud_sql_v1::model::PreCheckResponse;
20170 /// let x = PreCheckMajorVersionUpgradeContext::new()
20171 /// .set_pre_check_response([
20172 /// PreCheckResponse::default()/* use setters */,
20173 /// PreCheckResponse::default()/* use (different) setters */,
20174 /// ]);
20175 /// ```
20176 pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
20177 where
20178 T: std::iter::IntoIterator<Item = V>,
20179 V: std::convert::Into<crate::model::PreCheckResponse>,
20180 {
20181 use std::iter::Iterator;
20182 self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
20183 self
20184 }
20185
20186 /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
20187 ///
20188 /// # Example
20189 /// ```ignore,no_run
20190 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
20191 /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
20192 /// ```
20193 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20194 self.kind = v.into();
20195 self
20196 }
20197}
20198
20199impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
20200 fn typename() -> &'static str {
20201 "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
20202 }
20203}
20204
20205/// Backup context.
20206#[derive(Clone, Default, PartialEq)]
20207#[non_exhaustive]
20208pub struct BackupContext {
20209 /// The identifier of the backup.
20210 pub backup_id: i64,
20211
20212 /// This is always `sql#backupContext`.
20213 pub kind: std::string::String,
20214
20215 /// The name of the backup.
20216 /// Format: projects/{project}/backups/{backup}
20217 pub name: std::string::String,
20218
20219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20220}
20221
20222impl BackupContext {
20223 /// Creates a new default instance.
20224 pub fn new() -> Self {
20225 std::default::Default::default()
20226 }
20227
20228 /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
20229 ///
20230 /// # Example
20231 /// ```ignore,no_run
20232 /// # use google_cloud_sql_v1::model::BackupContext;
20233 /// let x = BackupContext::new().set_backup_id(42);
20234 /// ```
20235 pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
20236 self.backup_id = v.into();
20237 self
20238 }
20239
20240 /// Sets the value of [kind][crate::model::BackupContext::kind].
20241 ///
20242 /// # Example
20243 /// ```ignore,no_run
20244 /// # use google_cloud_sql_v1::model::BackupContext;
20245 /// let x = BackupContext::new().set_kind("example");
20246 /// ```
20247 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20248 self.kind = v.into();
20249 self
20250 }
20251
20252 /// Sets the value of [name][crate::model::BackupContext::name].
20253 ///
20254 /// # Example
20255 /// ```ignore,no_run
20256 /// # use google_cloud_sql_v1::model::BackupContext;
20257 /// let x = BackupContext::new().set_name("example");
20258 /// ```
20259 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20260 self.name = v.into();
20261 self
20262 }
20263}
20264
20265impl wkt::message::Message for BackupContext {
20266 fn typename() -> &'static str {
20267 "type.googleapis.com/google.cloud.sql.v1.BackupContext"
20268 }
20269}
20270
20271/// Represents a SQL database on the Cloud SQL instance.
20272#[derive(Clone, Default, PartialEq)]
20273#[non_exhaustive]
20274pub struct Database {
20275 /// This is always `sql#database`.
20276 pub kind: std::string::String,
20277
20278 /// The Cloud SQL charset value.
20279 pub charset: std::string::String,
20280
20281 /// The Cloud SQL collation value.
20282 pub collation: std::string::String,
20283
20284 /// This field is deprecated and will be removed from a future version of the
20285 /// API.
20286 pub etag: std::string::String,
20287
20288 /// The name of the database in the Cloud SQL instance. This does not include
20289 /// the project ID or instance name.
20290 pub name: std::string::String,
20291
20292 /// The name of the Cloud SQL instance. This does not include the project ID.
20293 pub instance: std::string::String,
20294
20295 /// The URI of this resource.
20296 pub self_link: std::string::String,
20297
20298 /// The project ID of the project containing the Cloud SQL database. The Google
20299 /// apps domain is prefixed if applicable.
20300 pub project: std::string::String,
20301
20302 #[allow(missing_docs)]
20303 pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
20304
20305 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20306}
20307
20308impl Database {
20309 /// Creates a new default instance.
20310 pub fn new() -> Self {
20311 std::default::Default::default()
20312 }
20313
20314 /// Sets the value of [kind][crate::model::Database::kind].
20315 ///
20316 /// # Example
20317 /// ```ignore,no_run
20318 /// # use google_cloud_sql_v1::model::Database;
20319 /// let x = Database::new().set_kind("example");
20320 /// ```
20321 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20322 self.kind = v.into();
20323 self
20324 }
20325
20326 /// Sets the value of [charset][crate::model::Database::charset].
20327 ///
20328 /// # Example
20329 /// ```ignore,no_run
20330 /// # use google_cloud_sql_v1::model::Database;
20331 /// let x = Database::new().set_charset("example");
20332 /// ```
20333 pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20334 self.charset = v.into();
20335 self
20336 }
20337
20338 /// Sets the value of [collation][crate::model::Database::collation].
20339 ///
20340 /// # Example
20341 /// ```ignore,no_run
20342 /// # use google_cloud_sql_v1::model::Database;
20343 /// let x = Database::new().set_collation("example");
20344 /// ```
20345 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20346 self.collation = v.into();
20347 self
20348 }
20349
20350 /// Sets the value of [etag][crate::model::Database::etag].
20351 ///
20352 /// # Example
20353 /// ```ignore,no_run
20354 /// # use google_cloud_sql_v1::model::Database;
20355 /// let x = Database::new().set_etag("example");
20356 /// ```
20357 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20358 self.etag = v.into();
20359 self
20360 }
20361
20362 /// Sets the value of [name][crate::model::Database::name].
20363 ///
20364 /// # Example
20365 /// ```ignore,no_run
20366 /// # use google_cloud_sql_v1::model::Database;
20367 /// let x = Database::new().set_name("example");
20368 /// ```
20369 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20370 self.name = v.into();
20371 self
20372 }
20373
20374 /// Sets the value of [instance][crate::model::Database::instance].
20375 ///
20376 /// # Example
20377 /// ```ignore,no_run
20378 /// # use google_cloud_sql_v1::model::Database;
20379 /// let x = Database::new().set_instance("example");
20380 /// ```
20381 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20382 self.instance = v.into();
20383 self
20384 }
20385
20386 /// Sets the value of [self_link][crate::model::Database::self_link].
20387 ///
20388 /// # Example
20389 /// ```ignore,no_run
20390 /// # use google_cloud_sql_v1::model::Database;
20391 /// let x = Database::new().set_self_link("example");
20392 /// ```
20393 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20394 self.self_link = v.into();
20395 self
20396 }
20397
20398 /// Sets the value of [project][crate::model::Database::project].
20399 ///
20400 /// # Example
20401 /// ```ignore,no_run
20402 /// # use google_cloud_sql_v1::model::Database;
20403 /// let x = Database::new().set_project("example");
20404 /// ```
20405 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20406 self.project = v.into();
20407 self
20408 }
20409
20410 /// Sets the value of [database_details][crate::model::Database::database_details].
20411 ///
20412 /// Note that all the setters affecting `database_details` are mutually
20413 /// exclusive.
20414 ///
20415 /// # Example
20416 /// ```ignore,no_run
20417 /// # use google_cloud_sql_v1::model::Database;
20418 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
20419 /// let x = Database::new().set_database_details(Some(
20420 /// google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
20421 /// ```
20422 pub fn set_database_details<
20423 T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
20424 >(
20425 mut self,
20426 v: T,
20427 ) -> Self {
20428 self.database_details = v.into();
20429 self
20430 }
20431
20432 /// The value of [database_details][crate::model::Database::database_details]
20433 /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
20434 /// holds a different branch.
20435 pub fn sqlserver_database_details(
20436 &self,
20437 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
20438 #[allow(unreachable_patterns)]
20439 self.database_details.as_ref().and_then(|v| match v {
20440 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
20441 std::option::Option::Some(v)
20442 }
20443 _ => std::option::Option::None,
20444 })
20445 }
20446
20447 /// Sets the value of [database_details][crate::model::Database::database_details]
20448 /// to hold a `SqlserverDatabaseDetails`.
20449 ///
20450 /// Note that all the setters affecting `database_details` are
20451 /// mutually exclusive.
20452 ///
20453 /// # Example
20454 /// ```ignore,no_run
20455 /// # use google_cloud_sql_v1::model::Database;
20456 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
20457 /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
20458 /// assert!(x.sqlserver_database_details().is_some());
20459 /// ```
20460 pub fn set_sqlserver_database_details<
20461 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
20462 >(
20463 mut self,
20464 v: T,
20465 ) -> Self {
20466 self.database_details = std::option::Option::Some(
20467 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
20468 );
20469 self
20470 }
20471}
20472
20473impl wkt::message::Message for Database {
20474 fn typename() -> &'static str {
20475 "type.googleapis.com/google.cloud.sql.v1.Database"
20476 }
20477}
20478
20479/// Defines additional types related to [Database].
20480pub mod database {
20481 #[allow(unused_imports)]
20482 use super::*;
20483
20484 #[allow(missing_docs)]
20485 #[derive(Clone, Debug, PartialEq)]
20486 #[non_exhaustive]
20487 pub enum DatabaseDetails {
20488 #[allow(missing_docs)]
20489 SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
20490 }
20491}
20492
20493/// Represents a Sql Server database on the Cloud SQL instance.
20494#[derive(Clone, Default, PartialEq)]
20495#[non_exhaustive]
20496pub struct SqlServerDatabaseDetails {
20497 /// The version of SQL Server with which the database is to be made compatible
20498 pub compatibility_level: i32,
20499
20500 /// The recovery model of a SQL Server database
20501 pub recovery_model: std::string::String,
20502
20503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20504}
20505
20506impl SqlServerDatabaseDetails {
20507 /// Creates a new default instance.
20508 pub fn new() -> Self {
20509 std::default::Default::default()
20510 }
20511
20512 /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
20513 ///
20514 /// # Example
20515 /// ```ignore,no_run
20516 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
20517 /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
20518 /// ```
20519 pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
20520 self.compatibility_level = v.into();
20521 self
20522 }
20523
20524 /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
20525 ///
20526 /// # Example
20527 /// ```ignore,no_run
20528 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
20529 /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
20530 /// ```
20531 pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20532 self.recovery_model = v.into();
20533 self
20534 }
20535}
20536
20537impl wkt::message::Message for SqlServerDatabaseDetails {
20538 fn typename() -> &'static str {
20539 "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
20540 }
20541}
20542
20543/// Database flags for Cloud SQL instances.
20544#[derive(Clone, Default, PartialEq)]
20545#[non_exhaustive]
20546pub struct DatabaseFlags {
20547 /// The name of the flag. These flags are passed at instance startup, so
20548 /// include both server options and system variables. Flags are
20549 /// specified with underscores, not hyphens. For more information, see
20550 /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
20551 /// in the Cloud SQL documentation.
20552 pub name: std::string::String,
20553
20554 /// The value of the flag. Boolean flags are set to `on` for true
20555 /// and `off` for false. This field must be omitted if the flag
20556 /// doesn't take a value.
20557 pub value: std::string::String,
20558
20559 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20560}
20561
20562impl DatabaseFlags {
20563 /// Creates a new default instance.
20564 pub fn new() -> Self {
20565 std::default::Default::default()
20566 }
20567
20568 /// Sets the value of [name][crate::model::DatabaseFlags::name].
20569 ///
20570 /// # Example
20571 /// ```ignore,no_run
20572 /// # use google_cloud_sql_v1::model::DatabaseFlags;
20573 /// let x = DatabaseFlags::new().set_name("example");
20574 /// ```
20575 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20576 self.name = v.into();
20577 self
20578 }
20579
20580 /// Sets the value of [value][crate::model::DatabaseFlags::value].
20581 ///
20582 /// # Example
20583 /// ```ignore,no_run
20584 /// # use google_cloud_sql_v1::model::DatabaseFlags;
20585 /// let x = DatabaseFlags::new().set_value("example");
20586 /// ```
20587 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20588 self.value = v.into();
20589 self
20590 }
20591}
20592
20593impl wkt::message::Message for DatabaseFlags {
20594 fn typename() -> &'static str {
20595 "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
20596 }
20597}
20598
20599/// MySQL-specific external server sync settings.
20600#[derive(Clone, Default, PartialEq)]
20601#[non_exhaustive]
20602pub struct MySqlSyncConfig {
20603 /// Flags to use for the initial dump.
20604 pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
20605
20606 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20607}
20608
20609impl MySqlSyncConfig {
20610 /// Creates a new default instance.
20611 pub fn new() -> Self {
20612 std::default::Default::default()
20613 }
20614
20615 /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
20616 ///
20617 /// # Example
20618 /// ```ignore,no_run
20619 /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
20620 /// use google_cloud_sql_v1::model::SyncFlags;
20621 /// let x = MySqlSyncConfig::new()
20622 /// .set_initial_sync_flags([
20623 /// SyncFlags::default()/* use setters */,
20624 /// SyncFlags::default()/* use (different) setters */,
20625 /// ]);
20626 /// ```
20627 pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
20628 where
20629 T: std::iter::IntoIterator<Item = V>,
20630 V: std::convert::Into<crate::model::SyncFlags>,
20631 {
20632 use std::iter::Iterator;
20633 self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
20634 self
20635 }
20636}
20637
20638impl wkt::message::Message for MySqlSyncConfig {
20639 fn typename() -> &'static str {
20640 "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
20641 }
20642}
20643
20644/// Initial sync flags for certain Cloud SQL APIs.
20645/// Currently used for the MySQL external server initial dump.
20646#[derive(Clone, Default, PartialEq)]
20647#[non_exhaustive]
20648pub struct SyncFlags {
20649 /// The name of the flag.
20650 pub name: std::string::String,
20651
20652 /// The value of the flag. This field must be omitted if the flag
20653 /// doesn't take a value.
20654 pub value: std::string::String,
20655
20656 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20657}
20658
20659impl SyncFlags {
20660 /// Creates a new default instance.
20661 pub fn new() -> Self {
20662 std::default::Default::default()
20663 }
20664
20665 /// Sets the value of [name][crate::model::SyncFlags::name].
20666 ///
20667 /// # Example
20668 /// ```ignore,no_run
20669 /// # use google_cloud_sql_v1::model::SyncFlags;
20670 /// let x = SyncFlags::new().set_name("example");
20671 /// ```
20672 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20673 self.name = v.into();
20674 self
20675 }
20676
20677 /// Sets the value of [value][crate::model::SyncFlags::value].
20678 ///
20679 /// # Example
20680 /// ```ignore,no_run
20681 /// # use google_cloud_sql_v1::model::SyncFlags;
20682 /// let x = SyncFlags::new().set_value("example");
20683 /// ```
20684 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20685 self.value = v.into();
20686 self
20687 }
20688}
20689
20690impl wkt::message::Message for SyncFlags {
20691 fn typename() -> &'static str {
20692 "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
20693 }
20694}
20695
20696/// Reference to another Cloud SQL instance.
20697#[derive(Clone, Default, PartialEq)]
20698#[non_exhaustive]
20699pub struct InstanceReference {
20700 /// The name of the Cloud SQL instance being referenced.
20701 /// This does not include the project ID.
20702 pub name: std::string::String,
20703
20704 /// The region of the Cloud SQL instance being referenced.
20705 pub region: std::string::String,
20706
20707 /// The project ID of the Cloud SQL instance being referenced.
20708 /// The default is the same project ID as the instance references it.
20709 pub project: std::string::String,
20710
20711 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20712}
20713
20714impl InstanceReference {
20715 /// Creates a new default instance.
20716 pub fn new() -> Self {
20717 std::default::Default::default()
20718 }
20719
20720 /// Sets the value of [name][crate::model::InstanceReference::name].
20721 ///
20722 /// # Example
20723 /// ```ignore,no_run
20724 /// # use google_cloud_sql_v1::model::InstanceReference;
20725 /// let x = InstanceReference::new().set_name("example");
20726 /// ```
20727 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20728 self.name = v.into();
20729 self
20730 }
20731
20732 /// Sets the value of [region][crate::model::InstanceReference::region].
20733 ///
20734 /// # Example
20735 /// ```ignore,no_run
20736 /// # use google_cloud_sql_v1::model::InstanceReference;
20737 /// let x = InstanceReference::new().set_region("example");
20738 /// ```
20739 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20740 self.region = v.into();
20741 self
20742 }
20743
20744 /// Sets the value of [project][crate::model::InstanceReference::project].
20745 ///
20746 /// # Example
20747 /// ```ignore,no_run
20748 /// # use google_cloud_sql_v1::model::InstanceReference;
20749 /// let x = InstanceReference::new().set_project("example");
20750 /// ```
20751 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20752 self.project = v.into();
20753 self
20754 }
20755}
20756
20757impl wkt::message::Message for InstanceReference {
20758 fn typename() -> &'static str {
20759 "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
20760 }
20761}
20762
20763/// Read-replica configuration for connecting to the on-premises primary
20764/// instance.
20765#[derive(Clone, Default, PartialEq)]
20766#[non_exhaustive]
20767pub struct DemoteMasterConfiguration {
20768 /// This is always `sql#demoteMasterConfiguration`.
20769 pub kind: std::string::String,
20770
20771 /// MySQL specific configuration when replicating from a MySQL on-premises
20772 /// primary instance. Replication configuration information such as the
20773 /// username, password, certificates, and keys are not stored in the instance
20774 /// metadata. The configuration information is used only to set up the
20775 /// replication connection and is stored by MySQL in a file named
20776 /// `master.info` in the data directory.
20777 pub mysql_replica_configuration:
20778 std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
20779
20780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20781}
20782
20783impl DemoteMasterConfiguration {
20784 /// Creates a new default instance.
20785 pub fn new() -> Self {
20786 std::default::Default::default()
20787 }
20788
20789 /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
20790 ///
20791 /// # Example
20792 /// ```ignore,no_run
20793 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
20794 /// let x = DemoteMasterConfiguration::new().set_kind("example");
20795 /// ```
20796 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20797 self.kind = v.into();
20798 self
20799 }
20800
20801 /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
20802 ///
20803 /// # Example
20804 /// ```ignore,no_run
20805 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
20806 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20807 /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
20808 /// ```
20809 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
20810 where
20811 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
20812 {
20813 self.mysql_replica_configuration = std::option::Option::Some(v.into());
20814 self
20815 }
20816
20817 /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
20818 ///
20819 /// # Example
20820 /// ```ignore,no_run
20821 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
20822 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20823 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
20824 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
20825 /// ```
20826 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
20827 where
20828 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
20829 {
20830 self.mysql_replica_configuration = v.map(|x| x.into());
20831 self
20832 }
20833}
20834
20835impl wkt::message::Message for DemoteMasterConfiguration {
20836 fn typename() -> &'static str {
20837 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
20838 }
20839}
20840
20841/// Read-replica configuration specific to MySQL databases.
20842#[derive(Clone, Default, PartialEq)]
20843#[non_exhaustive]
20844pub struct DemoteMasterMySqlReplicaConfiguration {
20845 /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
20846 pub kind: std::string::String,
20847
20848 /// The username for the replication connection.
20849 pub username: std::string::String,
20850
20851 /// The password for the replication connection.
20852 pub password: std::string::String,
20853
20854 /// PEM representation of the replica's private key. The corresponding public
20855 /// key is encoded in the client's certificate. The format of the replica's
20856 /// private key can be either PKCS #1 or PKCS #8.
20857 pub client_key: std::string::String,
20858
20859 /// PEM representation of the replica's x509 certificate.
20860 pub client_certificate: std::string::String,
20861
20862 /// PEM representation of the trusted CA's x509 certificate.
20863 pub ca_certificate: std::string::String,
20864
20865 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20866}
20867
20868impl DemoteMasterMySqlReplicaConfiguration {
20869 /// Creates a new default instance.
20870 pub fn new() -> Self {
20871 std::default::Default::default()
20872 }
20873
20874 /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
20875 ///
20876 /// # Example
20877 /// ```ignore,no_run
20878 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20879 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
20880 /// ```
20881 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20882 self.kind = v.into();
20883 self
20884 }
20885
20886 /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
20887 ///
20888 /// # Example
20889 /// ```ignore,no_run
20890 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20891 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
20892 /// ```
20893 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20894 self.username = v.into();
20895 self
20896 }
20897
20898 /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
20899 ///
20900 /// # Example
20901 /// ```ignore,no_run
20902 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20903 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
20904 /// ```
20905 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20906 self.password = v.into();
20907 self
20908 }
20909
20910 /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
20911 ///
20912 /// # Example
20913 /// ```ignore,no_run
20914 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20915 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
20916 /// ```
20917 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20918 self.client_key = v.into();
20919 self
20920 }
20921
20922 /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
20923 ///
20924 /// # Example
20925 /// ```ignore,no_run
20926 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20927 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
20928 /// ```
20929 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
20930 mut self,
20931 v: T,
20932 ) -> Self {
20933 self.client_certificate = v.into();
20934 self
20935 }
20936
20937 /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
20938 ///
20939 /// # Example
20940 /// ```ignore,no_run
20941 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
20942 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
20943 /// ```
20944 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20945 self.ca_certificate = v.into();
20946 self
20947 }
20948}
20949
20950impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
20951 fn typename() -> &'static str {
20952 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
20953 }
20954}
20955
20956/// Database instance export context.
20957#[derive(Clone, Default, PartialEq)]
20958#[non_exhaustive]
20959pub struct ExportContext {
20960 /// The path to the file in Google Cloud Storage where the export will be
20961 /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
20962 /// already exists, the request succeeds, but the operation fails. If
20963 /// `fileType` is `SQL` and the filename ends with .gz,
20964 /// the contents are compressed.
20965 pub uri: std::string::String,
20966
20967 /// Databases to be exported. <br /> `MySQL instances:` If
20968 /// `fileType` is `SQL` and no database is specified, all
20969 /// databases are exported, except for the `mysql` system database.
20970 /// If `fileType` is `CSV`, you can specify one database,
20971 /// either by using this property or by using the
20972 /// `csvExportOptions.selectQuery` property, which takes precedence
20973 /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
20974 /// database by name, all user databases in the instance are exported.
20975 /// This excludes system databases and Cloud SQL databases used to manage
20976 /// internal operations. Exporting all user databases is only available for
20977 /// directory-formatted parallel export. If `fileType` is `CSV`,
20978 /// this database must match the one specified in the
20979 /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
20980 /// instances:` You must specify one database to be exported, and the
20981 /// `fileType` must be `BAK`.
20982 pub databases: std::vec::Vec<std::string::String>,
20983
20984 /// This is always `sql#exportContext`.
20985 pub kind: std::string::String,
20986
20987 /// Options for exporting data as SQL statements.
20988 pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
20989
20990 /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
20991 /// instances only.
20992 pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
20993
20994 /// The file type for the specified uri.
20995 pub file_type: crate::model::SqlFileType,
20996
20997 /// Whether to perform a serverless export.
20998 pub offload: std::option::Option<wkt::BoolValue>,
20999
21000 /// Options for exporting data as BAK files.
21001 pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
21002
21003 /// Optional. Export parameters specific to SQL Server TDE certificates
21004 pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
21005
21006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21007}
21008
21009impl ExportContext {
21010 /// Creates a new default instance.
21011 pub fn new() -> Self {
21012 std::default::Default::default()
21013 }
21014
21015 /// Sets the value of [uri][crate::model::ExportContext::uri].
21016 ///
21017 /// # Example
21018 /// ```ignore,no_run
21019 /// # use google_cloud_sql_v1::model::ExportContext;
21020 /// let x = ExportContext::new().set_uri("example");
21021 /// ```
21022 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21023 self.uri = v.into();
21024 self
21025 }
21026
21027 /// Sets the value of [databases][crate::model::ExportContext::databases].
21028 ///
21029 /// # Example
21030 /// ```ignore,no_run
21031 /// # use google_cloud_sql_v1::model::ExportContext;
21032 /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
21033 /// ```
21034 pub fn set_databases<T, V>(mut self, v: T) -> Self
21035 where
21036 T: std::iter::IntoIterator<Item = V>,
21037 V: std::convert::Into<std::string::String>,
21038 {
21039 use std::iter::Iterator;
21040 self.databases = v.into_iter().map(|i| i.into()).collect();
21041 self
21042 }
21043
21044 /// Sets the value of [kind][crate::model::ExportContext::kind].
21045 ///
21046 /// # Example
21047 /// ```ignore,no_run
21048 /// # use google_cloud_sql_v1::model::ExportContext;
21049 /// let x = ExportContext::new().set_kind("example");
21050 /// ```
21051 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21052 self.kind = v.into();
21053 self
21054 }
21055
21056 /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
21057 ///
21058 /// # Example
21059 /// ```ignore,no_run
21060 /// # use google_cloud_sql_v1::model::ExportContext;
21061 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21062 /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
21063 /// ```
21064 pub fn set_sql_export_options<T>(mut self, v: T) -> Self
21065 where
21066 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
21067 {
21068 self.sql_export_options = std::option::Option::Some(v.into());
21069 self
21070 }
21071
21072 /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
21073 ///
21074 /// # Example
21075 /// ```ignore,no_run
21076 /// # use google_cloud_sql_v1::model::ExportContext;
21077 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21078 /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
21079 /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
21080 /// ```
21081 pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
21082 where
21083 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
21084 {
21085 self.sql_export_options = v.map(|x| x.into());
21086 self
21087 }
21088
21089 /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
21090 ///
21091 /// # Example
21092 /// ```ignore,no_run
21093 /// # use google_cloud_sql_v1::model::ExportContext;
21094 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
21095 /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
21096 /// ```
21097 pub fn set_csv_export_options<T>(mut self, v: T) -> Self
21098 where
21099 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
21100 {
21101 self.csv_export_options = std::option::Option::Some(v.into());
21102 self
21103 }
21104
21105 /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
21106 ///
21107 /// # Example
21108 /// ```ignore,no_run
21109 /// # use google_cloud_sql_v1::model::ExportContext;
21110 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
21111 /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
21112 /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
21113 /// ```
21114 pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
21115 where
21116 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
21117 {
21118 self.csv_export_options = v.map(|x| x.into());
21119 self
21120 }
21121
21122 /// Sets the value of [file_type][crate::model::ExportContext::file_type].
21123 ///
21124 /// # Example
21125 /// ```ignore,no_run
21126 /// # use google_cloud_sql_v1::model::ExportContext;
21127 /// use google_cloud_sql_v1::model::SqlFileType;
21128 /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
21129 /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
21130 /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
21131 /// ```
21132 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
21133 self.file_type = v.into();
21134 self
21135 }
21136
21137 /// Sets the value of [offload][crate::model::ExportContext::offload].
21138 ///
21139 /// # Example
21140 /// ```ignore,no_run
21141 /// # use google_cloud_sql_v1::model::ExportContext;
21142 /// use wkt::BoolValue;
21143 /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
21144 /// ```
21145 pub fn set_offload<T>(mut self, v: T) -> Self
21146 where
21147 T: std::convert::Into<wkt::BoolValue>,
21148 {
21149 self.offload = std::option::Option::Some(v.into());
21150 self
21151 }
21152
21153 /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
21154 ///
21155 /// # Example
21156 /// ```ignore,no_run
21157 /// # use google_cloud_sql_v1::model::ExportContext;
21158 /// use wkt::BoolValue;
21159 /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
21160 /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
21161 /// ```
21162 pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
21163 where
21164 T: std::convert::Into<wkt::BoolValue>,
21165 {
21166 self.offload = v.map(|x| x.into());
21167 self
21168 }
21169
21170 /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
21171 ///
21172 /// # Example
21173 /// ```ignore,no_run
21174 /// # use google_cloud_sql_v1::model::ExportContext;
21175 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21176 /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
21177 /// ```
21178 pub fn set_bak_export_options<T>(mut self, v: T) -> Self
21179 where
21180 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
21181 {
21182 self.bak_export_options = std::option::Option::Some(v.into());
21183 self
21184 }
21185
21186 /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
21187 ///
21188 /// # Example
21189 /// ```ignore,no_run
21190 /// # use google_cloud_sql_v1::model::ExportContext;
21191 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21192 /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
21193 /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
21194 /// ```
21195 pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
21196 where
21197 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
21198 {
21199 self.bak_export_options = v.map(|x| x.into());
21200 self
21201 }
21202
21203 /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
21204 ///
21205 /// # Example
21206 /// ```ignore,no_run
21207 /// # use google_cloud_sql_v1::model::ExportContext;
21208 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21209 /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
21210 /// ```
21211 pub fn set_tde_export_options<T>(mut self, v: T) -> Self
21212 where
21213 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
21214 {
21215 self.tde_export_options = std::option::Option::Some(v.into());
21216 self
21217 }
21218
21219 /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
21220 ///
21221 /// # Example
21222 /// ```ignore,no_run
21223 /// # use google_cloud_sql_v1::model::ExportContext;
21224 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
21225 /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
21226 /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
21227 /// ```
21228 pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
21229 where
21230 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
21231 {
21232 self.tde_export_options = v.map(|x| x.into());
21233 self
21234 }
21235}
21236
21237impl wkt::message::Message for ExportContext {
21238 fn typename() -> &'static str {
21239 "type.googleapis.com/google.cloud.sql.v1.ExportContext"
21240 }
21241}
21242
21243/// Defines additional types related to [ExportContext].
21244pub mod export_context {
21245 #[allow(unused_imports)]
21246 use super::*;
21247
21248 #[allow(missing_docs)]
21249 #[derive(Clone, Default, PartialEq)]
21250 #[non_exhaustive]
21251 pub struct SqlCsvExportOptions {
21252 /// The select query used to extract the data.
21253 pub select_query: std::string::String,
21254
21255 /// Specifies the character that should appear before a data character that
21256 /// needs to be escaped.
21257 pub escape_character: std::string::String,
21258
21259 /// Specifies the quoting character to be used when a data value is quoted.
21260 pub quote_character: std::string::String,
21261
21262 /// Specifies the character that separates columns within each row (line) of
21263 /// the file.
21264 pub fields_terminated_by: std::string::String,
21265
21266 /// This is used to separate lines. If a line does not contain all fields,
21267 /// the rest of the columns are set to their default values.
21268 pub lines_terminated_by: std::string::String,
21269
21270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21271 }
21272
21273 impl SqlCsvExportOptions {
21274 /// Creates a new default instance.
21275 pub fn new() -> Self {
21276 std::default::Default::default()
21277 }
21278
21279 /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
21280 ///
21281 /// # Example
21282 /// ```ignore,no_run
21283 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
21284 /// let x = SqlCsvExportOptions::new().set_select_query("example");
21285 /// ```
21286 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
21287 mut self,
21288 v: T,
21289 ) -> Self {
21290 self.select_query = v.into();
21291 self
21292 }
21293
21294 /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
21295 ///
21296 /// # Example
21297 /// ```ignore,no_run
21298 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
21299 /// let x = SqlCsvExportOptions::new().set_escape_character("example");
21300 /// ```
21301 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21302 mut self,
21303 v: T,
21304 ) -> Self {
21305 self.escape_character = v.into();
21306 self
21307 }
21308
21309 /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
21310 ///
21311 /// # Example
21312 /// ```ignore,no_run
21313 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
21314 /// let x = SqlCsvExportOptions::new().set_quote_character("example");
21315 /// ```
21316 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21317 mut self,
21318 v: T,
21319 ) -> Self {
21320 self.quote_character = v.into();
21321 self
21322 }
21323
21324 /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
21325 ///
21326 /// # Example
21327 /// ```ignore,no_run
21328 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
21329 /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
21330 /// ```
21331 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21332 mut self,
21333 v: T,
21334 ) -> Self {
21335 self.fields_terminated_by = v.into();
21336 self
21337 }
21338
21339 /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
21340 ///
21341 /// # Example
21342 /// ```ignore,no_run
21343 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
21344 /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
21345 /// ```
21346 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21347 mut self,
21348 v: T,
21349 ) -> Self {
21350 self.lines_terminated_by = v.into();
21351 self
21352 }
21353 }
21354
21355 impl wkt::message::Message for SqlCsvExportOptions {
21356 fn typename() -> &'static str {
21357 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
21358 }
21359 }
21360
21361 #[allow(missing_docs)]
21362 #[derive(Clone, Default, PartialEq)]
21363 #[non_exhaustive]
21364 pub struct SqlExportOptions {
21365 /// Tables to export, or that were exported, from the specified database. If
21366 /// you specify tables, specify one and only one database. For PostgreSQL
21367 /// instances, you can specify only one table.
21368 pub tables: std::vec::Vec<std::string::String>,
21369
21370 /// Export only schemas.
21371 pub schema_only: std::option::Option<wkt::BoolValue>,
21372
21373 #[allow(missing_docs)]
21374 pub mysql_export_options: std::option::Option<
21375 crate::model::export_context::sql_export_options::MysqlExportOptions,
21376 >,
21377
21378 /// Optional. The number of threads to use for parallel export.
21379 pub threads: std::option::Option<wkt::Int32Value>,
21380
21381 /// Optional. Whether or not the export should be parallel.
21382 pub parallel: std::option::Option<wkt::BoolValue>,
21383
21384 /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
21385 pub postgres_export_options: std::option::Option<
21386 crate::model::export_context::sql_export_options::PostgresExportOptions,
21387 >,
21388
21389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21390 }
21391
21392 impl SqlExportOptions {
21393 /// Creates a new default instance.
21394 pub fn new() -> Self {
21395 std::default::Default::default()
21396 }
21397
21398 /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
21399 ///
21400 /// # Example
21401 /// ```ignore,no_run
21402 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21403 /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
21404 /// ```
21405 pub fn set_tables<T, V>(mut self, v: T) -> Self
21406 where
21407 T: std::iter::IntoIterator<Item = V>,
21408 V: std::convert::Into<std::string::String>,
21409 {
21410 use std::iter::Iterator;
21411 self.tables = v.into_iter().map(|i| i.into()).collect();
21412 self
21413 }
21414
21415 /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
21416 ///
21417 /// # Example
21418 /// ```ignore,no_run
21419 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21420 /// use wkt::BoolValue;
21421 /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
21422 /// ```
21423 pub fn set_schema_only<T>(mut self, v: T) -> Self
21424 where
21425 T: std::convert::Into<wkt::BoolValue>,
21426 {
21427 self.schema_only = std::option::Option::Some(v.into());
21428 self
21429 }
21430
21431 /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
21432 ///
21433 /// # Example
21434 /// ```ignore,no_run
21435 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21436 /// use wkt::BoolValue;
21437 /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
21438 /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
21439 /// ```
21440 pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
21441 where
21442 T: std::convert::Into<wkt::BoolValue>,
21443 {
21444 self.schema_only = v.map(|x| x.into());
21445 self
21446 }
21447
21448 /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
21449 ///
21450 /// # Example
21451 /// ```ignore,no_run
21452 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21453 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
21454 /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
21455 /// ```
21456 pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
21457 where
21458 T: std::convert::Into<
21459 crate::model::export_context::sql_export_options::MysqlExportOptions,
21460 >,
21461 {
21462 self.mysql_export_options = std::option::Option::Some(v.into());
21463 self
21464 }
21465
21466 /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
21467 ///
21468 /// # Example
21469 /// ```ignore,no_run
21470 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21471 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
21472 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
21473 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
21474 /// ```
21475 pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
21476 where
21477 T: std::convert::Into<
21478 crate::model::export_context::sql_export_options::MysqlExportOptions,
21479 >,
21480 {
21481 self.mysql_export_options = v.map(|x| x.into());
21482 self
21483 }
21484
21485 /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
21486 ///
21487 /// # Example
21488 /// ```ignore,no_run
21489 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21490 /// use wkt::Int32Value;
21491 /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
21492 /// ```
21493 pub fn set_threads<T>(mut self, v: T) -> Self
21494 where
21495 T: std::convert::Into<wkt::Int32Value>,
21496 {
21497 self.threads = std::option::Option::Some(v.into());
21498 self
21499 }
21500
21501 /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
21502 ///
21503 /// # Example
21504 /// ```ignore,no_run
21505 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21506 /// use wkt::Int32Value;
21507 /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
21508 /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
21509 /// ```
21510 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
21511 where
21512 T: std::convert::Into<wkt::Int32Value>,
21513 {
21514 self.threads = v.map(|x| x.into());
21515 self
21516 }
21517
21518 /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
21519 ///
21520 /// # Example
21521 /// ```ignore,no_run
21522 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21523 /// use wkt::BoolValue;
21524 /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
21525 /// ```
21526 pub fn set_parallel<T>(mut self, v: T) -> Self
21527 where
21528 T: std::convert::Into<wkt::BoolValue>,
21529 {
21530 self.parallel = std::option::Option::Some(v.into());
21531 self
21532 }
21533
21534 /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
21535 ///
21536 /// # Example
21537 /// ```ignore,no_run
21538 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21539 /// use wkt::BoolValue;
21540 /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
21541 /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
21542 /// ```
21543 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
21544 where
21545 T: std::convert::Into<wkt::BoolValue>,
21546 {
21547 self.parallel = v.map(|x| x.into());
21548 self
21549 }
21550
21551 /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
21552 ///
21553 /// # Example
21554 /// ```ignore,no_run
21555 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21556 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
21557 /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
21558 /// ```
21559 pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
21560 where
21561 T: std::convert::Into<
21562 crate::model::export_context::sql_export_options::PostgresExportOptions,
21563 >,
21564 {
21565 self.postgres_export_options = std::option::Option::Some(v.into());
21566 self
21567 }
21568
21569 /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
21570 ///
21571 /// # Example
21572 /// ```ignore,no_run
21573 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
21574 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
21575 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
21576 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
21577 /// ```
21578 pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
21579 where
21580 T: std::convert::Into<
21581 crate::model::export_context::sql_export_options::PostgresExportOptions,
21582 >,
21583 {
21584 self.postgres_export_options = v.map(|x| x.into());
21585 self
21586 }
21587 }
21588
21589 impl wkt::message::Message for SqlExportOptions {
21590 fn typename() -> &'static str {
21591 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
21592 }
21593 }
21594
21595 /// Defines additional types related to [SqlExportOptions].
21596 pub mod sql_export_options {
21597 #[allow(unused_imports)]
21598 use super::*;
21599
21600 /// Options for exporting from MySQL.
21601 #[derive(Clone, Default, PartialEq)]
21602 #[non_exhaustive]
21603 pub struct MysqlExportOptions {
21604 /// Option to include SQL statement required to set up replication. If set
21605 /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
21606 /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
21607 /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
21608 /// has no effect. If set to any value other than `1`, --set-gtid-purged
21609 /// is set to OFF.
21610 pub master_data: std::option::Option<wkt::Int32Value>,
21611
21612 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21613 }
21614
21615 impl MysqlExportOptions {
21616 /// Creates a new default instance.
21617 pub fn new() -> Self {
21618 std::default::Default::default()
21619 }
21620
21621 /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
21622 ///
21623 /// # Example
21624 /// ```ignore,no_run
21625 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
21626 /// use wkt::Int32Value;
21627 /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
21628 /// ```
21629 pub fn set_master_data<T>(mut self, v: T) -> Self
21630 where
21631 T: std::convert::Into<wkt::Int32Value>,
21632 {
21633 self.master_data = std::option::Option::Some(v.into());
21634 self
21635 }
21636
21637 /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
21638 ///
21639 /// # Example
21640 /// ```ignore,no_run
21641 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
21642 /// use wkt::Int32Value;
21643 /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
21644 /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
21645 /// ```
21646 pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
21647 where
21648 T: std::convert::Into<wkt::Int32Value>,
21649 {
21650 self.master_data = v.map(|x| x.into());
21651 self
21652 }
21653 }
21654
21655 impl wkt::message::Message for MysqlExportOptions {
21656 fn typename() -> &'static str {
21657 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
21658 }
21659 }
21660
21661 /// Options for exporting from a Cloud SQL for PostgreSQL instance.
21662 #[derive(Clone, Default, PartialEq)]
21663 #[non_exhaustive]
21664 pub struct PostgresExportOptions {
21665 /// Optional. Use this option to include DROP \<code\><object>\</code\>
21666 /// SQL statements. Use these statements to delete database objects before
21667 /// running the import operation.
21668 pub clean: std::option::Option<wkt::BoolValue>,
21669
21670 /// Optional. Option to include an IF EXISTS SQL statement with each DROP
21671 /// statement produced by clean.
21672 pub if_exists: std::option::Option<wkt::BoolValue>,
21673
21674 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21675 }
21676
21677 impl PostgresExportOptions {
21678 /// Creates a new default instance.
21679 pub fn new() -> Self {
21680 std::default::Default::default()
21681 }
21682
21683 /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
21684 ///
21685 /// # Example
21686 /// ```ignore,no_run
21687 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
21688 /// use wkt::BoolValue;
21689 /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
21690 /// ```
21691 pub fn set_clean<T>(mut self, v: T) -> Self
21692 where
21693 T: std::convert::Into<wkt::BoolValue>,
21694 {
21695 self.clean = std::option::Option::Some(v.into());
21696 self
21697 }
21698
21699 /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
21700 ///
21701 /// # Example
21702 /// ```ignore,no_run
21703 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
21704 /// use wkt::BoolValue;
21705 /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
21706 /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
21707 /// ```
21708 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
21709 where
21710 T: std::convert::Into<wkt::BoolValue>,
21711 {
21712 self.clean = v.map(|x| x.into());
21713 self
21714 }
21715
21716 /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
21717 ///
21718 /// # Example
21719 /// ```ignore,no_run
21720 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
21721 /// use wkt::BoolValue;
21722 /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21723 /// ```
21724 pub fn set_if_exists<T>(mut self, v: T) -> Self
21725 where
21726 T: std::convert::Into<wkt::BoolValue>,
21727 {
21728 self.if_exists = std::option::Option::Some(v.into());
21729 self
21730 }
21731
21732 /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
21733 ///
21734 /// # Example
21735 /// ```ignore,no_run
21736 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
21737 /// use wkt::BoolValue;
21738 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21739 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21740 /// ```
21741 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21742 where
21743 T: std::convert::Into<wkt::BoolValue>,
21744 {
21745 self.if_exists = v.map(|x| x.into());
21746 self
21747 }
21748 }
21749
21750 impl wkt::message::Message for PostgresExportOptions {
21751 fn typename() -> &'static str {
21752 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
21753 }
21754 }
21755 }
21756
21757 /// Options for exporting BAK files (SQL Server-only)
21758 #[derive(Clone, Default, PartialEq)]
21759 #[non_exhaustive]
21760 pub struct SqlBakExportOptions {
21761 /// Whether or not the export should be striped.
21762 pub striped: std::option::Option<wkt::BoolValue>,
21763
21764 /// Option for specifying how many stripes to use for the export.
21765 /// If blank, and the value of the striped field is true,
21766 /// the number of stripes is automatically chosen.
21767 pub stripe_count: std::option::Option<wkt::Int32Value>,
21768
21769 /// Type of this bak file will be export, FULL or DIFF, SQL Server only
21770 pub bak_type: crate::model::BakType,
21771
21772 /// Deprecated: copy_only is deprecated. Use differential_base instead
21773 #[deprecated]
21774 pub copy_only: std::option::Option<wkt::BoolValue>,
21775
21776 /// Whether or not the backup can be used as a differential base
21777 /// copy_only backup can not be served as differential base
21778 pub differential_base: std::option::Option<wkt::BoolValue>,
21779
21780 /// Optional. The begin timestamp when transaction log will be included in
21781 /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
21782 /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
21783 /// available logs from the beginning of retention period will be included.
21784 /// Only applied to Cloud SQL for SQL Server.
21785 pub export_log_start_time: std::option::Option<wkt::Timestamp>,
21786
21787 /// Optional. The end timestamp when transaction log will be included in the
21788 /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
21789 /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
21790 /// available logs until current time will be included. Only applied to Cloud
21791 /// SQL for SQL Server.
21792 pub export_log_end_time: std::option::Option<wkt::Timestamp>,
21793
21794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21795 }
21796
21797 impl SqlBakExportOptions {
21798 /// Creates a new default instance.
21799 pub fn new() -> Self {
21800 std::default::Default::default()
21801 }
21802
21803 /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
21804 ///
21805 /// # Example
21806 /// ```ignore,no_run
21807 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21808 /// use wkt::BoolValue;
21809 /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
21810 /// ```
21811 pub fn set_striped<T>(mut self, v: T) -> Self
21812 where
21813 T: std::convert::Into<wkt::BoolValue>,
21814 {
21815 self.striped = std::option::Option::Some(v.into());
21816 self
21817 }
21818
21819 /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
21820 ///
21821 /// # Example
21822 /// ```ignore,no_run
21823 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21824 /// use wkt::BoolValue;
21825 /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21826 /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
21827 /// ```
21828 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21829 where
21830 T: std::convert::Into<wkt::BoolValue>,
21831 {
21832 self.striped = v.map(|x| x.into());
21833 self
21834 }
21835
21836 /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
21837 ///
21838 /// # Example
21839 /// ```ignore,no_run
21840 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21841 /// use wkt::Int32Value;
21842 /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
21843 /// ```
21844 pub fn set_stripe_count<T>(mut self, v: T) -> Self
21845 where
21846 T: std::convert::Into<wkt::Int32Value>,
21847 {
21848 self.stripe_count = std::option::Option::Some(v.into());
21849 self
21850 }
21851
21852 /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
21853 ///
21854 /// # Example
21855 /// ```ignore,no_run
21856 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21857 /// use wkt::Int32Value;
21858 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
21859 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
21860 /// ```
21861 pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
21862 where
21863 T: std::convert::Into<wkt::Int32Value>,
21864 {
21865 self.stripe_count = v.map(|x| x.into());
21866 self
21867 }
21868
21869 /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
21870 ///
21871 /// # Example
21872 /// ```ignore,no_run
21873 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21874 /// use google_cloud_sql_v1::model::BakType;
21875 /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
21876 /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
21877 /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
21878 /// ```
21879 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
21880 self.bak_type = v.into();
21881 self
21882 }
21883
21884 /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
21885 ///
21886 /// # Example
21887 /// ```ignore,no_run
21888 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21889 /// use wkt::BoolValue;
21890 /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
21891 /// ```
21892 #[deprecated]
21893 pub fn set_copy_only<T>(mut self, v: T) -> Self
21894 where
21895 T: std::convert::Into<wkt::BoolValue>,
21896 {
21897 self.copy_only = std::option::Option::Some(v.into());
21898 self
21899 }
21900
21901 /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
21902 ///
21903 /// # Example
21904 /// ```ignore,no_run
21905 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21906 /// use wkt::BoolValue;
21907 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
21908 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
21909 /// ```
21910 #[deprecated]
21911 pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
21912 where
21913 T: std::convert::Into<wkt::BoolValue>,
21914 {
21915 self.copy_only = v.map(|x| x.into());
21916 self
21917 }
21918
21919 /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
21920 ///
21921 /// # Example
21922 /// ```ignore,no_run
21923 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21924 /// use wkt::BoolValue;
21925 /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
21926 /// ```
21927 pub fn set_differential_base<T>(mut self, v: T) -> Self
21928 where
21929 T: std::convert::Into<wkt::BoolValue>,
21930 {
21931 self.differential_base = std::option::Option::Some(v.into());
21932 self
21933 }
21934
21935 /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
21936 ///
21937 /// # Example
21938 /// ```ignore,no_run
21939 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21940 /// use wkt::BoolValue;
21941 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
21942 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
21943 /// ```
21944 pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
21945 where
21946 T: std::convert::Into<wkt::BoolValue>,
21947 {
21948 self.differential_base = v.map(|x| x.into());
21949 self
21950 }
21951
21952 /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
21953 ///
21954 /// # Example
21955 /// ```ignore,no_run
21956 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21957 /// use wkt::Timestamp;
21958 /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
21959 /// ```
21960 pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
21961 where
21962 T: std::convert::Into<wkt::Timestamp>,
21963 {
21964 self.export_log_start_time = std::option::Option::Some(v.into());
21965 self
21966 }
21967
21968 /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
21969 ///
21970 /// # Example
21971 /// ```ignore,no_run
21972 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21973 /// use wkt::Timestamp;
21974 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
21975 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
21976 /// ```
21977 pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
21978 where
21979 T: std::convert::Into<wkt::Timestamp>,
21980 {
21981 self.export_log_start_time = v.map(|x| x.into());
21982 self
21983 }
21984
21985 /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
21986 ///
21987 /// # Example
21988 /// ```ignore,no_run
21989 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
21990 /// use wkt::Timestamp;
21991 /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
21992 /// ```
21993 pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
21994 where
21995 T: std::convert::Into<wkt::Timestamp>,
21996 {
21997 self.export_log_end_time = std::option::Option::Some(v.into());
21998 self
21999 }
22000
22001 /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
22002 ///
22003 /// # Example
22004 /// ```ignore,no_run
22005 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
22006 /// use wkt::Timestamp;
22007 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
22008 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
22009 /// ```
22010 pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
22011 where
22012 T: std::convert::Into<wkt::Timestamp>,
22013 {
22014 self.export_log_end_time = v.map(|x| x.into());
22015 self
22016 }
22017 }
22018
22019 impl wkt::message::Message for SqlBakExportOptions {
22020 fn typename() -> &'static str {
22021 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
22022 }
22023 }
22024
22025 #[allow(missing_docs)]
22026 #[derive(Clone, Default, PartialEq)]
22027 #[non_exhaustive]
22028 pub struct SqlTdeExportOptions {
22029 /// Required. Path to the TDE certificate public key
22030 /// in the form gs://bucketName/fileName.
22031 /// The instance must have write access to the bucket.
22032 /// Applicable only for SQL Server instances.
22033 pub certificate_path: std::string::String,
22034
22035 /// Required. Path to the TDE certificate private key
22036 /// in the form gs://bucketName/fileName.
22037 /// The instance must have write access to the location.
22038 /// Applicable only for SQL Server instances.
22039 pub private_key_path: std::string::String,
22040
22041 /// Required. Password that encrypts the private key.
22042 pub private_key_password: std::string::String,
22043
22044 /// Required. Certificate name.
22045 /// Applicable only for SQL Server instances.
22046 pub name: std::string::String,
22047
22048 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22049 }
22050
22051 impl SqlTdeExportOptions {
22052 /// Creates a new default instance.
22053 pub fn new() -> Self {
22054 std::default::Default::default()
22055 }
22056
22057 /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
22058 ///
22059 /// # Example
22060 /// ```ignore,no_run
22061 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
22062 /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
22063 /// ```
22064 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
22065 mut self,
22066 v: T,
22067 ) -> Self {
22068 self.certificate_path = v.into();
22069 self
22070 }
22071
22072 /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
22073 ///
22074 /// # Example
22075 /// ```ignore,no_run
22076 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
22077 /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
22078 /// ```
22079 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
22080 mut self,
22081 v: T,
22082 ) -> Self {
22083 self.private_key_path = v.into();
22084 self
22085 }
22086
22087 /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
22088 ///
22089 /// # Example
22090 /// ```ignore,no_run
22091 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
22092 /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
22093 /// ```
22094 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
22095 mut self,
22096 v: T,
22097 ) -> Self {
22098 self.private_key_password = v.into();
22099 self
22100 }
22101
22102 /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
22103 ///
22104 /// # Example
22105 /// ```ignore,no_run
22106 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
22107 /// let x = SqlTdeExportOptions::new().set_name("example");
22108 /// ```
22109 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22110 self.name = v.into();
22111 self
22112 }
22113 }
22114
22115 impl wkt::message::Message for SqlTdeExportOptions {
22116 fn typename() -> &'static str {
22117 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
22118 }
22119 }
22120}
22121
22122/// Database instance import context.
22123#[derive(Clone, Default, PartialEq)]
22124#[non_exhaustive]
22125pub struct ImportContext {
22126 /// Path to the import file in Cloud Storage, in the form
22127 /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
22128 /// when `fileType` is `SQL`. The instance must have
22129 /// write permissions to the bucket and read access to the file.
22130 pub uri: std::string::String,
22131
22132 /// The target database for the import. If `fileType` is `SQL`, this field
22133 /// is required only if the import file does not specify a database, and is
22134 /// overridden by any database specification in the import file. For entire
22135 /// instance parallel import operations, the database is overridden by the
22136 /// database name stored in subdirectory name. If
22137 /// `fileType` is `CSV`, one database must be specified.
22138 pub database: std::string::String,
22139
22140 /// This is always `sql#importContext`.
22141 pub kind: std::string::String,
22142
22143 /// The file type for the specified uri.\`SQL`: The file
22144 /// contains SQL statements. \`CSV`: The file contains CSV data.
22145 pub file_type: crate::model::SqlFileType,
22146
22147 /// Options for importing data as CSV.
22148 pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
22149
22150 /// The PostgreSQL user for this import operation. PostgreSQL instances only.
22151 pub import_user: std::string::String,
22152
22153 /// Import parameters specific to SQL Server .BAK files
22154 pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
22155
22156 /// Optional. Options for importing data from SQL statements.
22157 pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
22158
22159 /// Optional. Import parameters specific to SQL Server TDE certificates
22160 pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
22161
22162 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22163}
22164
22165impl ImportContext {
22166 /// Creates a new default instance.
22167 pub fn new() -> Self {
22168 std::default::Default::default()
22169 }
22170
22171 /// Sets the value of [uri][crate::model::ImportContext::uri].
22172 ///
22173 /// # Example
22174 /// ```ignore,no_run
22175 /// # use google_cloud_sql_v1::model::ImportContext;
22176 /// let x = ImportContext::new().set_uri("example");
22177 /// ```
22178 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22179 self.uri = v.into();
22180 self
22181 }
22182
22183 /// Sets the value of [database][crate::model::ImportContext::database].
22184 ///
22185 /// # Example
22186 /// ```ignore,no_run
22187 /// # use google_cloud_sql_v1::model::ImportContext;
22188 /// let x = ImportContext::new().set_database("example");
22189 /// ```
22190 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22191 self.database = v.into();
22192 self
22193 }
22194
22195 /// Sets the value of [kind][crate::model::ImportContext::kind].
22196 ///
22197 /// # Example
22198 /// ```ignore,no_run
22199 /// # use google_cloud_sql_v1::model::ImportContext;
22200 /// let x = ImportContext::new().set_kind("example");
22201 /// ```
22202 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22203 self.kind = v.into();
22204 self
22205 }
22206
22207 /// Sets the value of [file_type][crate::model::ImportContext::file_type].
22208 ///
22209 /// # Example
22210 /// ```ignore,no_run
22211 /// # use google_cloud_sql_v1::model::ImportContext;
22212 /// use google_cloud_sql_v1::model::SqlFileType;
22213 /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
22214 /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
22215 /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
22216 /// ```
22217 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
22218 self.file_type = v.into();
22219 self
22220 }
22221
22222 /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
22223 ///
22224 /// # Example
22225 /// ```ignore,no_run
22226 /// # use google_cloud_sql_v1::model::ImportContext;
22227 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22228 /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
22229 /// ```
22230 pub fn set_csv_import_options<T>(mut self, v: T) -> Self
22231 where
22232 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
22233 {
22234 self.csv_import_options = std::option::Option::Some(v.into());
22235 self
22236 }
22237
22238 /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
22239 ///
22240 /// # Example
22241 /// ```ignore,no_run
22242 /// # use google_cloud_sql_v1::model::ImportContext;
22243 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22244 /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
22245 /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
22246 /// ```
22247 pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
22248 where
22249 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
22250 {
22251 self.csv_import_options = v.map(|x| x.into());
22252 self
22253 }
22254
22255 /// Sets the value of [import_user][crate::model::ImportContext::import_user].
22256 ///
22257 /// # Example
22258 /// ```ignore,no_run
22259 /// # use google_cloud_sql_v1::model::ImportContext;
22260 /// let x = ImportContext::new().set_import_user("example");
22261 /// ```
22262 pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22263 self.import_user = v.into();
22264 self
22265 }
22266
22267 /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
22268 ///
22269 /// # Example
22270 /// ```ignore,no_run
22271 /// # use google_cloud_sql_v1::model::ImportContext;
22272 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22273 /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
22274 /// ```
22275 pub fn set_bak_import_options<T>(mut self, v: T) -> Self
22276 where
22277 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
22278 {
22279 self.bak_import_options = std::option::Option::Some(v.into());
22280 self
22281 }
22282
22283 /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
22284 ///
22285 /// # Example
22286 /// ```ignore,no_run
22287 /// # use google_cloud_sql_v1::model::ImportContext;
22288 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22289 /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
22290 /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
22291 /// ```
22292 pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
22293 where
22294 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
22295 {
22296 self.bak_import_options = v.map(|x| x.into());
22297 self
22298 }
22299
22300 /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
22301 ///
22302 /// # Example
22303 /// ```ignore,no_run
22304 /// # use google_cloud_sql_v1::model::ImportContext;
22305 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22306 /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
22307 /// ```
22308 pub fn set_sql_import_options<T>(mut self, v: T) -> Self
22309 where
22310 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
22311 {
22312 self.sql_import_options = std::option::Option::Some(v.into());
22313 self
22314 }
22315
22316 /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
22317 ///
22318 /// # Example
22319 /// ```ignore,no_run
22320 /// # use google_cloud_sql_v1::model::ImportContext;
22321 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22322 /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
22323 /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
22324 /// ```
22325 pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
22326 where
22327 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
22328 {
22329 self.sql_import_options = v.map(|x| x.into());
22330 self
22331 }
22332
22333 /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
22334 ///
22335 /// # Example
22336 /// ```ignore,no_run
22337 /// # use google_cloud_sql_v1::model::ImportContext;
22338 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22339 /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
22340 /// ```
22341 pub fn set_tde_import_options<T>(mut self, v: T) -> Self
22342 where
22343 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
22344 {
22345 self.tde_import_options = std::option::Option::Some(v.into());
22346 self
22347 }
22348
22349 /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
22350 ///
22351 /// # Example
22352 /// ```ignore,no_run
22353 /// # use google_cloud_sql_v1::model::ImportContext;
22354 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
22355 /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
22356 /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
22357 /// ```
22358 pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
22359 where
22360 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
22361 {
22362 self.tde_import_options = v.map(|x| x.into());
22363 self
22364 }
22365}
22366
22367impl wkt::message::Message for ImportContext {
22368 fn typename() -> &'static str {
22369 "type.googleapis.com/google.cloud.sql.v1.ImportContext"
22370 }
22371}
22372
22373/// Defines additional types related to [ImportContext].
22374pub mod import_context {
22375 #[allow(unused_imports)]
22376 use super::*;
22377
22378 #[allow(missing_docs)]
22379 #[derive(Clone, Default, PartialEq)]
22380 #[non_exhaustive]
22381 pub struct SqlImportOptions {
22382 /// Optional. The number of threads to use for parallel import.
22383 pub threads: std::option::Option<wkt::Int32Value>,
22384
22385 /// Optional. Whether or not the import should be parallel.
22386 pub parallel: std::option::Option<wkt::BoolValue>,
22387
22388 /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
22389 pub postgres_import_options: std::option::Option<
22390 crate::model::import_context::sql_import_options::PostgresImportOptions,
22391 >,
22392
22393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22394 }
22395
22396 impl SqlImportOptions {
22397 /// Creates a new default instance.
22398 pub fn new() -> Self {
22399 std::default::Default::default()
22400 }
22401
22402 /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
22403 ///
22404 /// # Example
22405 /// ```ignore,no_run
22406 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22407 /// use wkt::Int32Value;
22408 /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
22409 /// ```
22410 pub fn set_threads<T>(mut self, v: T) -> Self
22411 where
22412 T: std::convert::Into<wkt::Int32Value>,
22413 {
22414 self.threads = std::option::Option::Some(v.into());
22415 self
22416 }
22417
22418 /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
22419 ///
22420 /// # Example
22421 /// ```ignore,no_run
22422 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22423 /// use wkt::Int32Value;
22424 /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
22425 /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
22426 /// ```
22427 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
22428 where
22429 T: std::convert::Into<wkt::Int32Value>,
22430 {
22431 self.threads = v.map(|x| x.into());
22432 self
22433 }
22434
22435 /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
22436 ///
22437 /// # Example
22438 /// ```ignore,no_run
22439 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22440 /// use wkt::BoolValue;
22441 /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
22442 /// ```
22443 pub fn set_parallel<T>(mut self, v: T) -> Self
22444 where
22445 T: std::convert::Into<wkt::BoolValue>,
22446 {
22447 self.parallel = std::option::Option::Some(v.into());
22448 self
22449 }
22450
22451 /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
22452 ///
22453 /// # Example
22454 /// ```ignore,no_run
22455 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22456 /// use wkt::BoolValue;
22457 /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
22458 /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
22459 /// ```
22460 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
22461 where
22462 T: std::convert::Into<wkt::BoolValue>,
22463 {
22464 self.parallel = v.map(|x| x.into());
22465 self
22466 }
22467
22468 /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
22469 ///
22470 /// # Example
22471 /// ```ignore,no_run
22472 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22473 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
22474 /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
22475 /// ```
22476 pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
22477 where
22478 T: std::convert::Into<
22479 crate::model::import_context::sql_import_options::PostgresImportOptions,
22480 >,
22481 {
22482 self.postgres_import_options = std::option::Option::Some(v.into());
22483 self
22484 }
22485
22486 /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
22487 ///
22488 /// # Example
22489 /// ```ignore,no_run
22490 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
22491 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
22492 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
22493 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
22494 /// ```
22495 pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
22496 where
22497 T: std::convert::Into<
22498 crate::model::import_context::sql_import_options::PostgresImportOptions,
22499 >,
22500 {
22501 self.postgres_import_options = v.map(|x| x.into());
22502 self
22503 }
22504 }
22505
22506 impl wkt::message::Message for SqlImportOptions {
22507 fn typename() -> &'static str {
22508 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
22509 }
22510 }
22511
22512 /// Defines additional types related to [SqlImportOptions].
22513 pub mod sql_import_options {
22514 #[allow(unused_imports)]
22515 use super::*;
22516
22517 #[allow(missing_docs)]
22518 #[derive(Clone, Default, PartialEq)]
22519 #[non_exhaustive]
22520 pub struct PostgresImportOptions {
22521 /// Optional. The --clean flag for the pg_restore utility. This flag
22522 /// applies only if you enabled Cloud SQL to import files in parallel.
22523 pub clean: std::option::Option<wkt::BoolValue>,
22524
22525 /// Optional. The --if-exists flag for the pg_restore utility. This flag
22526 /// applies only if you enabled Cloud SQL to import files in parallel.
22527 pub if_exists: std::option::Option<wkt::BoolValue>,
22528
22529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22530 }
22531
22532 impl PostgresImportOptions {
22533 /// Creates a new default instance.
22534 pub fn new() -> Self {
22535 std::default::Default::default()
22536 }
22537
22538 /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
22539 ///
22540 /// # Example
22541 /// ```ignore,no_run
22542 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
22543 /// use wkt::BoolValue;
22544 /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
22545 /// ```
22546 pub fn set_clean<T>(mut self, v: T) -> Self
22547 where
22548 T: std::convert::Into<wkt::BoolValue>,
22549 {
22550 self.clean = std::option::Option::Some(v.into());
22551 self
22552 }
22553
22554 /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
22555 ///
22556 /// # Example
22557 /// ```ignore,no_run
22558 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
22559 /// use wkt::BoolValue;
22560 /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
22561 /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
22562 /// ```
22563 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
22564 where
22565 T: std::convert::Into<wkt::BoolValue>,
22566 {
22567 self.clean = v.map(|x| x.into());
22568 self
22569 }
22570
22571 /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
22572 ///
22573 /// # Example
22574 /// ```ignore,no_run
22575 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
22576 /// use wkt::BoolValue;
22577 /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
22578 /// ```
22579 pub fn set_if_exists<T>(mut self, v: T) -> Self
22580 where
22581 T: std::convert::Into<wkt::BoolValue>,
22582 {
22583 self.if_exists = std::option::Option::Some(v.into());
22584 self
22585 }
22586
22587 /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
22588 ///
22589 /// # Example
22590 /// ```ignore,no_run
22591 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
22592 /// use wkt::BoolValue;
22593 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
22594 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
22595 /// ```
22596 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
22597 where
22598 T: std::convert::Into<wkt::BoolValue>,
22599 {
22600 self.if_exists = v.map(|x| x.into());
22601 self
22602 }
22603 }
22604
22605 impl wkt::message::Message for PostgresImportOptions {
22606 fn typename() -> &'static str {
22607 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
22608 }
22609 }
22610 }
22611
22612 #[allow(missing_docs)]
22613 #[derive(Clone, Default, PartialEq)]
22614 #[non_exhaustive]
22615 pub struct SqlCsvImportOptions {
22616 /// The table to which CSV data is imported.
22617 pub table: std::string::String,
22618
22619 /// The columns to which CSV data is imported. If not specified, all columns
22620 /// of the database table are loaded with CSV data.
22621 pub columns: std::vec::Vec<std::string::String>,
22622
22623 /// Specifies the character that should appear before a data character that
22624 /// needs to be escaped.
22625 pub escape_character: std::string::String,
22626
22627 /// Specifies the quoting character to be used when a data value is quoted.
22628 pub quote_character: std::string::String,
22629
22630 /// Specifies the character that separates columns within each row (line) of
22631 /// the file.
22632 pub fields_terminated_by: std::string::String,
22633
22634 /// This is used to separate lines. If a line does not contain all fields,
22635 /// the rest of the columns are set to their default values.
22636 pub lines_terminated_by: std::string::String,
22637
22638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22639 }
22640
22641 impl SqlCsvImportOptions {
22642 /// Creates a new default instance.
22643 pub fn new() -> Self {
22644 std::default::Default::default()
22645 }
22646
22647 /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
22648 ///
22649 /// # Example
22650 /// ```ignore,no_run
22651 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22652 /// let x = SqlCsvImportOptions::new().set_table("example");
22653 /// ```
22654 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22655 self.table = v.into();
22656 self
22657 }
22658
22659 /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
22660 ///
22661 /// # Example
22662 /// ```ignore,no_run
22663 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22664 /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
22665 /// ```
22666 pub fn set_columns<T, V>(mut self, v: T) -> Self
22667 where
22668 T: std::iter::IntoIterator<Item = V>,
22669 V: std::convert::Into<std::string::String>,
22670 {
22671 use std::iter::Iterator;
22672 self.columns = v.into_iter().map(|i| i.into()).collect();
22673 self
22674 }
22675
22676 /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
22677 ///
22678 /// # Example
22679 /// ```ignore,no_run
22680 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22681 /// let x = SqlCsvImportOptions::new().set_escape_character("example");
22682 /// ```
22683 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
22684 mut self,
22685 v: T,
22686 ) -> Self {
22687 self.escape_character = v.into();
22688 self
22689 }
22690
22691 /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
22692 ///
22693 /// # Example
22694 /// ```ignore,no_run
22695 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22696 /// let x = SqlCsvImportOptions::new().set_quote_character("example");
22697 /// ```
22698 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
22699 mut self,
22700 v: T,
22701 ) -> Self {
22702 self.quote_character = v.into();
22703 self
22704 }
22705
22706 /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
22707 ///
22708 /// # Example
22709 /// ```ignore,no_run
22710 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22711 /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
22712 /// ```
22713 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
22714 mut self,
22715 v: T,
22716 ) -> Self {
22717 self.fields_terminated_by = v.into();
22718 self
22719 }
22720
22721 /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
22722 ///
22723 /// # Example
22724 /// ```ignore,no_run
22725 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
22726 /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
22727 /// ```
22728 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
22729 mut self,
22730 v: T,
22731 ) -> Self {
22732 self.lines_terminated_by = v.into();
22733 self
22734 }
22735 }
22736
22737 impl wkt::message::Message for SqlCsvImportOptions {
22738 fn typename() -> &'static str {
22739 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
22740 }
22741 }
22742
22743 #[allow(missing_docs)]
22744 #[derive(Clone, Default, PartialEq)]
22745 #[non_exhaustive]
22746 pub struct SqlBakImportOptions {
22747 #[allow(missing_docs)]
22748 pub encryption_options: std::option::Option<
22749 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
22750 >,
22751
22752 /// Whether or not the backup set being restored is striped.
22753 /// Applies only to Cloud SQL for SQL Server.
22754 pub striped: std::option::Option<wkt::BoolValue>,
22755
22756 /// Whether or not the backup importing will restore database
22757 /// with NORECOVERY option.
22758 /// Applies only to Cloud SQL for SQL Server.
22759 pub no_recovery: std::option::Option<wkt::BoolValue>,
22760
22761 /// Whether or not the backup importing request will just bring database
22762 /// online without downloading Bak content only one of "no_recovery" and
22763 /// "recovery_only" can be true otherwise error will return. Applies only to
22764 /// Cloud SQL for SQL Server.
22765 pub recovery_only: std::option::Option<wkt::BoolValue>,
22766
22767 /// Type of the bak content, FULL or DIFF
22768 pub bak_type: crate::model::BakType,
22769
22770 /// Optional. The timestamp when the import should stop. This timestamp is in
22771 /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
22772 /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
22773 /// keyword and applies to Cloud SQL for SQL Server only.
22774 pub stop_at: std::option::Option<wkt::Timestamp>,
22775
22776 /// Optional. The marked transaction where the import should stop. This field
22777 /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
22778 /// Server only.
22779 pub stop_at_mark: std::string::String,
22780
22781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22782 }
22783
22784 impl SqlBakImportOptions {
22785 /// Creates a new default instance.
22786 pub fn new() -> Self {
22787 std::default::Default::default()
22788 }
22789
22790 /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
22791 ///
22792 /// # Example
22793 /// ```ignore,no_run
22794 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22795 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22796 /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
22797 /// ```
22798 pub fn set_encryption_options<T>(mut self, v: T) -> Self
22799 where
22800 T: std::convert::Into<
22801 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
22802 >,
22803 {
22804 self.encryption_options = std::option::Option::Some(v.into());
22805 self
22806 }
22807
22808 /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
22809 ///
22810 /// # Example
22811 /// ```ignore,no_run
22812 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22813 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
22814 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
22815 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
22816 /// ```
22817 pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
22818 where
22819 T: std::convert::Into<
22820 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
22821 >,
22822 {
22823 self.encryption_options = v.map(|x| x.into());
22824 self
22825 }
22826
22827 /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
22828 ///
22829 /// # Example
22830 /// ```ignore,no_run
22831 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22832 /// use wkt::BoolValue;
22833 /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
22834 /// ```
22835 pub fn set_striped<T>(mut self, v: T) -> Self
22836 where
22837 T: std::convert::Into<wkt::BoolValue>,
22838 {
22839 self.striped = std::option::Option::Some(v.into());
22840 self
22841 }
22842
22843 /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
22844 ///
22845 /// # Example
22846 /// ```ignore,no_run
22847 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22848 /// use wkt::BoolValue;
22849 /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
22850 /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
22851 /// ```
22852 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
22853 where
22854 T: std::convert::Into<wkt::BoolValue>,
22855 {
22856 self.striped = v.map(|x| x.into());
22857 self
22858 }
22859
22860 /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
22861 ///
22862 /// # Example
22863 /// ```ignore,no_run
22864 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22865 /// use wkt::BoolValue;
22866 /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
22867 /// ```
22868 pub fn set_no_recovery<T>(mut self, v: T) -> Self
22869 where
22870 T: std::convert::Into<wkt::BoolValue>,
22871 {
22872 self.no_recovery = std::option::Option::Some(v.into());
22873 self
22874 }
22875
22876 /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
22877 ///
22878 /// # Example
22879 /// ```ignore,no_run
22880 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22881 /// use wkt::BoolValue;
22882 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
22883 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
22884 /// ```
22885 pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
22886 where
22887 T: std::convert::Into<wkt::BoolValue>,
22888 {
22889 self.no_recovery = v.map(|x| x.into());
22890 self
22891 }
22892
22893 /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
22894 ///
22895 /// # Example
22896 /// ```ignore,no_run
22897 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22898 /// use wkt::BoolValue;
22899 /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
22900 /// ```
22901 pub fn set_recovery_only<T>(mut self, v: T) -> Self
22902 where
22903 T: std::convert::Into<wkt::BoolValue>,
22904 {
22905 self.recovery_only = std::option::Option::Some(v.into());
22906 self
22907 }
22908
22909 /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
22910 ///
22911 /// # Example
22912 /// ```ignore,no_run
22913 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22914 /// use wkt::BoolValue;
22915 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
22916 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
22917 /// ```
22918 pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
22919 where
22920 T: std::convert::Into<wkt::BoolValue>,
22921 {
22922 self.recovery_only = v.map(|x| x.into());
22923 self
22924 }
22925
22926 /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
22927 ///
22928 /// # Example
22929 /// ```ignore,no_run
22930 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22931 /// use google_cloud_sql_v1::model::BakType;
22932 /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
22933 /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
22934 /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
22935 /// ```
22936 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
22937 self.bak_type = v.into();
22938 self
22939 }
22940
22941 /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
22942 ///
22943 /// # Example
22944 /// ```ignore,no_run
22945 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22946 /// use wkt::Timestamp;
22947 /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
22948 /// ```
22949 pub fn set_stop_at<T>(mut self, v: T) -> Self
22950 where
22951 T: std::convert::Into<wkt::Timestamp>,
22952 {
22953 self.stop_at = std::option::Option::Some(v.into());
22954 self
22955 }
22956
22957 /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
22958 ///
22959 /// # Example
22960 /// ```ignore,no_run
22961 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22962 /// use wkt::Timestamp;
22963 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
22964 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
22965 /// ```
22966 pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
22967 where
22968 T: std::convert::Into<wkt::Timestamp>,
22969 {
22970 self.stop_at = v.map(|x| x.into());
22971 self
22972 }
22973
22974 /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
22975 ///
22976 /// # Example
22977 /// ```ignore,no_run
22978 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
22979 /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
22980 /// ```
22981 pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
22982 mut self,
22983 v: T,
22984 ) -> Self {
22985 self.stop_at_mark = v.into();
22986 self
22987 }
22988 }
22989
22990 impl wkt::message::Message for SqlBakImportOptions {
22991 fn typename() -> &'static str {
22992 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
22993 }
22994 }
22995
22996 /// Defines additional types related to [SqlBakImportOptions].
22997 pub mod sql_bak_import_options {
22998 #[allow(unused_imports)]
22999 use super::*;
23000
23001 #[allow(missing_docs)]
23002 #[derive(Clone, Default, PartialEq)]
23003 #[non_exhaustive]
23004 pub struct EncryptionOptions {
23005 /// Path to the Certificate (.cer) in Cloud Storage, in the form
23006 /// `gs://bucketName/fileName`. The instance must have
23007 /// write permissions to the bucket and read access to the file.
23008 pub cert_path: std::string::String,
23009
23010 /// Path to the Certificate Private Key (.pvk) in Cloud Storage, in the
23011 /// form `gs://bucketName/fileName`. The instance must have
23012 /// write permissions to the bucket and read access to the file.
23013 pub pvk_path: std::string::String,
23014
23015 /// Password that encrypts the private key
23016 pub pvk_password: std::string::String,
23017
23018 /// Optional. Whether the imported file remains encrypted.
23019 pub keep_encrypted: std::option::Option<wkt::BoolValue>,
23020
23021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23022 }
23023
23024 impl EncryptionOptions {
23025 /// Creates a new default instance.
23026 pub fn new() -> Self {
23027 std::default::Default::default()
23028 }
23029
23030 /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
23031 ///
23032 /// # Example
23033 /// ```ignore,no_run
23034 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
23035 /// let x = EncryptionOptions::new().set_cert_path("example");
23036 /// ```
23037 pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
23038 mut self,
23039 v: T,
23040 ) -> Self {
23041 self.cert_path = v.into();
23042 self
23043 }
23044
23045 /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
23046 ///
23047 /// # Example
23048 /// ```ignore,no_run
23049 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
23050 /// let x = EncryptionOptions::new().set_pvk_path("example");
23051 /// ```
23052 pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
23053 mut self,
23054 v: T,
23055 ) -> Self {
23056 self.pvk_path = v.into();
23057 self
23058 }
23059
23060 /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
23061 ///
23062 /// # Example
23063 /// ```ignore,no_run
23064 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
23065 /// let x = EncryptionOptions::new().set_pvk_password("example");
23066 /// ```
23067 pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
23068 mut self,
23069 v: T,
23070 ) -> Self {
23071 self.pvk_password = v.into();
23072 self
23073 }
23074
23075 /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
23076 ///
23077 /// # Example
23078 /// ```ignore,no_run
23079 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
23080 /// use wkt::BoolValue;
23081 /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
23082 /// ```
23083 pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
23084 where
23085 T: std::convert::Into<wkt::BoolValue>,
23086 {
23087 self.keep_encrypted = std::option::Option::Some(v.into());
23088 self
23089 }
23090
23091 /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
23092 ///
23093 /// # Example
23094 /// ```ignore,no_run
23095 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
23096 /// use wkt::BoolValue;
23097 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
23098 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
23099 /// ```
23100 pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
23101 where
23102 T: std::convert::Into<wkt::BoolValue>,
23103 {
23104 self.keep_encrypted = v.map(|x| x.into());
23105 self
23106 }
23107 }
23108
23109 impl wkt::message::Message for EncryptionOptions {
23110 fn typename() -> &'static str {
23111 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
23112 }
23113 }
23114 }
23115
23116 #[allow(missing_docs)]
23117 #[derive(Clone, Default, PartialEq)]
23118 #[non_exhaustive]
23119 pub struct SqlTdeImportOptions {
23120 /// Required. Path to the TDE certificate public key
23121 /// in the form gs://bucketName/fileName.
23122 /// The instance must have read access to the file.
23123 /// Applicable only for SQL Server instances.
23124 pub certificate_path: std::string::String,
23125
23126 /// Required. Path to the TDE certificate private key
23127 /// in the form gs://bucketName/fileName.
23128 /// The instance must have read access to the file.
23129 /// Applicable only for SQL Server instances.
23130 pub private_key_path: std::string::String,
23131
23132 /// Required. Password that encrypts the private key.
23133 pub private_key_password: std::string::String,
23134
23135 /// Required. Certificate name.
23136 /// Applicable only for SQL Server instances.
23137 pub name: std::string::String,
23138
23139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23140 }
23141
23142 impl SqlTdeImportOptions {
23143 /// Creates a new default instance.
23144 pub fn new() -> Self {
23145 std::default::Default::default()
23146 }
23147
23148 /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
23149 ///
23150 /// # Example
23151 /// ```ignore,no_run
23152 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
23153 /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
23154 /// ```
23155 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
23156 mut self,
23157 v: T,
23158 ) -> Self {
23159 self.certificate_path = v.into();
23160 self
23161 }
23162
23163 /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
23164 ///
23165 /// # Example
23166 /// ```ignore,no_run
23167 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
23168 /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
23169 /// ```
23170 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
23171 mut self,
23172 v: T,
23173 ) -> Self {
23174 self.private_key_path = v.into();
23175 self
23176 }
23177
23178 /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
23179 ///
23180 /// # Example
23181 /// ```ignore,no_run
23182 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
23183 /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
23184 /// ```
23185 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
23186 mut self,
23187 v: T,
23188 ) -> Self {
23189 self.private_key_password = v.into();
23190 self
23191 }
23192
23193 /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
23194 ///
23195 /// # Example
23196 /// ```ignore,no_run
23197 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
23198 /// let x = SqlTdeImportOptions::new().set_name("example");
23199 /// ```
23200 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23201 self.name = v.into();
23202 self
23203 }
23204 }
23205
23206 impl wkt::message::Message for SqlTdeImportOptions {
23207 fn typename() -> &'static str {
23208 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
23209 }
23210 }
23211}
23212
23213/// IP Management configuration.
23214#[derive(Clone, Default, PartialEq)]
23215#[non_exhaustive]
23216pub struct IpConfiguration {
23217 /// Whether the instance is assigned a public IP address or not.
23218 pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
23219
23220 /// The resource link for the VPC network from which the Cloud SQL instance is
23221 /// accessible for private IP. For example,
23222 /// `/projects/myProject/global/networks/default`. This setting can
23223 /// be updated, but it cannot be removed after it is set.
23224 pub private_network: std::string::String,
23225
23226 /// Use `ssl_mode` instead.
23227 ///
23228 /// Whether SSL/TLS connections over IP are enforced.
23229 /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
23230 /// For SSL/TLS connections, the client certificate won't be verified. If
23231 /// set to true, then only allow connections encrypted with SSL/TLS and with
23232 /// valid client certificates. If you want to enforce SSL/TLS without enforcing
23233 /// the requirement for valid client certificates, then use the `ssl_mode` flag
23234 /// instead of the `require_ssl` flag.
23235 pub require_ssl: std::option::Option<wkt::BoolValue>,
23236
23237 /// The list of external networks that are allowed to connect to the instance
23238 /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
23239 /// example: `157.197.200.0/24`).
23240 pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
23241
23242 /// The name of the allocated ip range for the private ip Cloud SQL instance.
23243 /// For example: "google-managed-services-default". If set, the instance ip
23244 /// will be created in the allocated range. The range name must comply with
23245 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
23246 /// must be 1-63 characters long and match the regular expression
23247 /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
23248 pub allocated_ip_range: std::string::String,
23249
23250 /// Controls connectivity to private IP instances from Google services,
23251 /// such as BigQuery.
23252 pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
23253
23254 /// Specify how SSL/TLS is enforced in database connections. If you must use
23255 /// the `require_ssl` flag for backward compatibility, then only the following
23256 /// value pairs are valid:
23257 ///
23258 /// For PostgreSQL and MySQL:
23259 ///
23260 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
23261 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
23262 /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
23263 ///
23264 /// For SQL Server:
23265 ///
23266 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
23267 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
23268 ///
23269 /// The value of `ssl_mode` has priority over the value of `require_ssl`.
23270 ///
23271 /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
23272 /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
23273 /// connections, while `require_ssl=false` means accept both non-SSL
23274 /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
23275 /// `ssl_mode` and accepts only SSL connections.
23276 pub ssl_mode: crate::model::ip_configuration::SslMode,
23277
23278 /// PSC settings for this instance.
23279 pub psc_config: std::option::Option<crate::model::PscConfig>,
23280
23281 /// Specify what type of CA is used for the server certificate.
23282 pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
23283
23284 /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
23285 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
23286
23287 /// Optional. The resource name of the server CA pool for an instance with
23288 /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
23289 /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
23290 pub server_ca_pool: std::option::Option<std::string::String>,
23291
23292 /// Optional. Controls the automatic server certificate rotation feature. This
23293 /// feature is disabled by default. When enabled, the server certificate will
23294 /// be automatically rotated during Cloud SQL scheduled maintenance or
23295 /// self-service maintenance updates up to six months before it expires. This
23296 /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
23297 /// or CUSTOMER_MANAGED_CAS_CA.
23298 pub server_certificate_rotation_mode:
23299 std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
23300
23301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23302}
23303
23304impl IpConfiguration {
23305 /// Creates a new default instance.
23306 pub fn new() -> Self {
23307 std::default::Default::default()
23308 }
23309
23310 /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
23311 ///
23312 /// # Example
23313 /// ```ignore,no_run
23314 /// # use google_cloud_sql_v1::model::IpConfiguration;
23315 /// use wkt::BoolValue;
23316 /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
23317 /// ```
23318 pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
23319 where
23320 T: std::convert::Into<wkt::BoolValue>,
23321 {
23322 self.ipv4_enabled = std::option::Option::Some(v.into());
23323 self
23324 }
23325
23326 /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
23327 ///
23328 /// # Example
23329 /// ```ignore,no_run
23330 /// # use google_cloud_sql_v1::model::IpConfiguration;
23331 /// use wkt::BoolValue;
23332 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
23333 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
23334 /// ```
23335 pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
23336 where
23337 T: std::convert::Into<wkt::BoolValue>,
23338 {
23339 self.ipv4_enabled = v.map(|x| x.into());
23340 self
23341 }
23342
23343 /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
23344 ///
23345 /// # Example
23346 /// ```ignore,no_run
23347 /// # use google_cloud_sql_v1::model::IpConfiguration;
23348 /// let x = IpConfiguration::new().set_private_network("example");
23349 /// ```
23350 pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23351 self.private_network = v.into();
23352 self
23353 }
23354
23355 /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
23356 ///
23357 /// # Example
23358 /// ```ignore,no_run
23359 /// # use google_cloud_sql_v1::model::IpConfiguration;
23360 /// use wkt::BoolValue;
23361 /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
23362 /// ```
23363 pub fn set_require_ssl<T>(mut self, v: T) -> Self
23364 where
23365 T: std::convert::Into<wkt::BoolValue>,
23366 {
23367 self.require_ssl = std::option::Option::Some(v.into());
23368 self
23369 }
23370
23371 /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
23372 ///
23373 /// # Example
23374 /// ```ignore,no_run
23375 /// # use google_cloud_sql_v1::model::IpConfiguration;
23376 /// use wkt::BoolValue;
23377 /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
23378 /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
23379 /// ```
23380 pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
23381 where
23382 T: std::convert::Into<wkt::BoolValue>,
23383 {
23384 self.require_ssl = v.map(|x| x.into());
23385 self
23386 }
23387
23388 /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
23389 ///
23390 /// # Example
23391 /// ```ignore,no_run
23392 /// # use google_cloud_sql_v1::model::IpConfiguration;
23393 /// use google_cloud_sql_v1::model::AclEntry;
23394 /// let x = IpConfiguration::new()
23395 /// .set_authorized_networks([
23396 /// AclEntry::default()/* use setters */,
23397 /// AclEntry::default()/* use (different) setters */,
23398 /// ]);
23399 /// ```
23400 pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
23401 where
23402 T: std::iter::IntoIterator<Item = V>,
23403 V: std::convert::Into<crate::model::AclEntry>,
23404 {
23405 use std::iter::Iterator;
23406 self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
23407 self
23408 }
23409
23410 /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
23411 ///
23412 /// # Example
23413 /// ```ignore,no_run
23414 /// # use google_cloud_sql_v1::model::IpConfiguration;
23415 /// let x = IpConfiguration::new().set_allocated_ip_range("example");
23416 /// ```
23417 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
23418 mut self,
23419 v: T,
23420 ) -> Self {
23421 self.allocated_ip_range = v.into();
23422 self
23423 }
23424
23425 /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
23426 ///
23427 /// # Example
23428 /// ```ignore,no_run
23429 /// # use google_cloud_sql_v1::model::IpConfiguration;
23430 /// use wkt::BoolValue;
23431 /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
23432 /// ```
23433 pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
23434 where
23435 T: std::convert::Into<wkt::BoolValue>,
23436 {
23437 self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
23438 self
23439 }
23440
23441 /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
23442 ///
23443 /// # Example
23444 /// ```ignore,no_run
23445 /// # use google_cloud_sql_v1::model::IpConfiguration;
23446 /// use wkt::BoolValue;
23447 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
23448 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
23449 /// ```
23450 pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
23451 mut self,
23452 v: std::option::Option<T>,
23453 ) -> Self
23454 where
23455 T: std::convert::Into<wkt::BoolValue>,
23456 {
23457 self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
23458 self
23459 }
23460
23461 /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
23462 ///
23463 /// # Example
23464 /// ```ignore,no_run
23465 /// # use google_cloud_sql_v1::model::IpConfiguration;
23466 /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
23467 /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
23468 /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
23469 /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
23470 /// ```
23471 pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
23472 mut self,
23473 v: T,
23474 ) -> Self {
23475 self.ssl_mode = v.into();
23476 self
23477 }
23478
23479 /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
23480 ///
23481 /// # Example
23482 /// ```ignore,no_run
23483 /// # use google_cloud_sql_v1::model::IpConfiguration;
23484 /// use google_cloud_sql_v1::model::PscConfig;
23485 /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
23486 /// ```
23487 pub fn set_psc_config<T>(mut self, v: T) -> Self
23488 where
23489 T: std::convert::Into<crate::model::PscConfig>,
23490 {
23491 self.psc_config = std::option::Option::Some(v.into());
23492 self
23493 }
23494
23495 /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
23496 ///
23497 /// # Example
23498 /// ```ignore,no_run
23499 /// # use google_cloud_sql_v1::model::IpConfiguration;
23500 /// use google_cloud_sql_v1::model::PscConfig;
23501 /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
23502 /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
23503 /// ```
23504 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
23505 where
23506 T: std::convert::Into<crate::model::PscConfig>,
23507 {
23508 self.psc_config = v.map(|x| x.into());
23509 self
23510 }
23511
23512 /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
23513 ///
23514 /// # Example
23515 /// ```ignore,no_run
23516 /// # use google_cloud_sql_v1::model::IpConfiguration;
23517 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
23518 /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
23519 /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
23520 /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
23521 /// ```
23522 pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
23523 where
23524 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
23525 {
23526 self.server_ca_mode = std::option::Option::Some(v.into());
23527 self
23528 }
23529
23530 /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
23531 ///
23532 /// # Example
23533 /// ```ignore,no_run
23534 /// # use google_cloud_sql_v1::model::IpConfiguration;
23535 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
23536 /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
23537 /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
23538 /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
23539 /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
23540 /// ```
23541 pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
23542 where
23543 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
23544 {
23545 self.server_ca_mode = v.map(|x| x.into());
23546 self
23547 }
23548
23549 /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
23550 ///
23551 /// # Example
23552 /// ```ignore,no_run
23553 /// # use google_cloud_sql_v1::model::IpConfiguration;
23554 /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
23555 /// ```
23556 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
23557 where
23558 T: std::iter::IntoIterator<Item = V>,
23559 V: std::convert::Into<std::string::String>,
23560 {
23561 use std::iter::Iterator;
23562 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
23563 self
23564 }
23565
23566 /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
23567 ///
23568 /// # Example
23569 /// ```ignore,no_run
23570 /// # use google_cloud_sql_v1::model::IpConfiguration;
23571 /// let x = IpConfiguration::new().set_server_ca_pool("example");
23572 /// ```
23573 pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
23574 where
23575 T: std::convert::Into<std::string::String>,
23576 {
23577 self.server_ca_pool = std::option::Option::Some(v.into());
23578 self
23579 }
23580
23581 /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
23582 ///
23583 /// # Example
23584 /// ```ignore,no_run
23585 /// # use google_cloud_sql_v1::model::IpConfiguration;
23586 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
23587 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
23588 /// ```
23589 pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
23590 where
23591 T: std::convert::Into<std::string::String>,
23592 {
23593 self.server_ca_pool = v.map(|x| x.into());
23594 self
23595 }
23596
23597 /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
23598 ///
23599 /// # Example
23600 /// ```ignore,no_run
23601 /// # use google_cloud_sql_v1::model::IpConfiguration;
23602 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
23603 /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
23604 /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
23605 /// ```
23606 pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
23607 where
23608 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
23609 {
23610 self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
23611 self
23612 }
23613
23614 /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
23615 ///
23616 /// # Example
23617 /// ```ignore,no_run
23618 /// # use google_cloud_sql_v1::model::IpConfiguration;
23619 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
23620 /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
23621 /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
23622 /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
23623 /// ```
23624 pub fn set_or_clear_server_certificate_rotation_mode<T>(
23625 mut self,
23626 v: std::option::Option<T>,
23627 ) -> Self
23628 where
23629 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
23630 {
23631 self.server_certificate_rotation_mode = v.map(|x| x.into());
23632 self
23633 }
23634}
23635
23636impl wkt::message::Message for IpConfiguration {
23637 fn typename() -> &'static str {
23638 "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
23639 }
23640}
23641
23642/// Defines additional types related to [IpConfiguration].
23643pub mod ip_configuration {
23644 #[allow(unused_imports)]
23645 use super::*;
23646
23647 /// The SSL options for database connections.
23648 ///
23649 /// # Working with unknown values
23650 ///
23651 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23652 /// additional enum variants at any time. Adding new variants is not considered
23653 /// a breaking change. Applications should write their code in anticipation of:
23654 ///
23655 /// - New values appearing in future releases of the client library, **and**
23656 /// - New values received dynamically, without application changes.
23657 ///
23658 /// Please consult the [Working with enums] section in the user guide for some
23659 /// guidelines.
23660 ///
23661 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23662 #[derive(Clone, Debug, PartialEq)]
23663 #[non_exhaustive]
23664 pub enum SslMode {
23665 /// The SSL mode is unknown.
23666 Unspecified,
23667 /// Allow non-SSL/non-TLS and SSL/TLS connections.
23668 /// For SSL connections to MySQL and PostgreSQL, the client certificate
23669 /// isn't verified.
23670 ///
23671 /// When this value is used, the legacy `require_ssl` flag must be false or
23672 /// cleared to avoid a conflict between the values of the two flags.
23673 AllowUnencryptedAndEncrypted,
23674 /// Only allow connections encrypted with SSL/TLS.
23675 /// For SSL connections to MySQL and PostgreSQL, the client certificate
23676 /// isn't verified.
23677 ///
23678 /// When this value is used, the legacy `require_ssl` flag must be false or
23679 /// cleared to avoid a conflict between the values of the two flags.
23680 EncryptedOnly,
23681 /// Only allow connections encrypted with SSL/TLS and with valid
23682 /// client certificates.
23683 ///
23684 /// When this value is used, the legacy `require_ssl` flag must be true or
23685 /// cleared to avoid the conflict between values of two flags.
23686 /// PostgreSQL clients or users that connect using IAM database
23687 /// authentication must use either the
23688 /// [Cloud SQL Auth
23689 /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
23690 /// [Cloud SQL
23691 /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
23692 /// to enforce client identity verification.
23693 ///
23694 /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
23695 TrustedClientCertificateRequired,
23696 /// If set, the enum was initialized with an unknown value.
23697 ///
23698 /// Applications can examine the value using [SslMode::value] or
23699 /// [SslMode::name].
23700 UnknownValue(ssl_mode::UnknownValue),
23701 }
23702
23703 #[doc(hidden)]
23704 pub mod ssl_mode {
23705 #[allow(unused_imports)]
23706 use super::*;
23707 #[derive(Clone, Debug, PartialEq)]
23708 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23709 }
23710
23711 impl SslMode {
23712 /// Gets the enum value.
23713 ///
23714 /// Returns `None` if the enum contains an unknown value deserialized from
23715 /// the string representation of enums.
23716 pub fn value(&self) -> std::option::Option<i32> {
23717 match self {
23718 Self::Unspecified => std::option::Option::Some(0),
23719 Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
23720 Self::EncryptedOnly => std::option::Option::Some(2),
23721 Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
23722 Self::UnknownValue(u) => u.0.value(),
23723 }
23724 }
23725
23726 /// Gets the enum value as a string.
23727 ///
23728 /// Returns `None` if the enum contains an unknown value deserialized from
23729 /// the integer representation of enums.
23730 pub fn name(&self) -> std::option::Option<&str> {
23731 match self {
23732 Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
23733 Self::AllowUnencryptedAndEncrypted => {
23734 std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
23735 }
23736 Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
23737 Self::TrustedClientCertificateRequired => {
23738 std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
23739 }
23740 Self::UnknownValue(u) => u.0.name(),
23741 }
23742 }
23743 }
23744
23745 impl std::default::Default for SslMode {
23746 fn default() -> Self {
23747 use std::convert::From;
23748 Self::from(0)
23749 }
23750 }
23751
23752 impl std::fmt::Display for SslMode {
23753 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23754 wkt::internal::display_enum(f, self.name(), self.value())
23755 }
23756 }
23757
23758 impl std::convert::From<i32> for SslMode {
23759 fn from(value: i32) -> Self {
23760 match value {
23761 0 => Self::Unspecified,
23762 1 => Self::AllowUnencryptedAndEncrypted,
23763 2 => Self::EncryptedOnly,
23764 3 => Self::TrustedClientCertificateRequired,
23765 _ => Self::UnknownValue(ssl_mode::UnknownValue(
23766 wkt::internal::UnknownEnumValue::Integer(value),
23767 )),
23768 }
23769 }
23770 }
23771
23772 impl std::convert::From<&str> for SslMode {
23773 fn from(value: &str) -> Self {
23774 use std::string::ToString;
23775 match value {
23776 "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
23777 "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
23778 "ENCRYPTED_ONLY" => Self::EncryptedOnly,
23779 "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
23780 _ => Self::UnknownValue(ssl_mode::UnknownValue(
23781 wkt::internal::UnknownEnumValue::String(value.to_string()),
23782 )),
23783 }
23784 }
23785 }
23786
23787 impl serde::ser::Serialize for SslMode {
23788 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23789 where
23790 S: serde::Serializer,
23791 {
23792 match self {
23793 Self::Unspecified => serializer.serialize_i32(0),
23794 Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
23795 Self::EncryptedOnly => serializer.serialize_i32(2),
23796 Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
23797 Self::UnknownValue(u) => u.0.serialize(serializer),
23798 }
23799 }
23800 }
23801
23802 impl<'de> serde::de::Deserialize<'de> for SslMode {
23803 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23804 where
23805 D: serde::Deserializer<'de>,
23806 {
23807 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
23808 ".google.cloud.sql.v1.IpConfiguration.SslMode",
23809 ))
23810 }
23811 }
23812
23813 /// Various Certificate Authority (CA) modes for certificate signing.
23814 ///
23815 /// # Working with unknown values
23816 ///
23817 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23818 /// additional enum variants at any time. Adding new variants is not considered
23819 /// a breaking change. Applications should write their code in anticipation of:
23820 ///
23821 /// - New values appearing in future releases of the client library, **and**
23822 /// - New values received dynamically, without application changes.
23823 ///
23824 /// Please consult the [Working with enums] section in the user guide for some
23825 /// guidelines.
23826 ///
23827 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23828 #[derive(Clone, Debug, PartialEq)]
23829 #[non_exhaustive]
23830 pub enum CaMode {
23831 /// CA mode is unspecified. It is effectively the same as
23832 /// `GOOGLE_MANAGED_INTERNAL_CA`.
23833 Unspecified,
23834 /// Google-managed self-signed internal CA.
23835 GoogleManagedInternalCa,
23836 /// Google-managed regional CA part of root CA hierarchy hosted on Google
23837 /// Cloud's Certificate Authority Service (CAS).
23838 GoogleManagedCasCa,
23839 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
23840 /// Service (CAS).
23841 CustomerManagedCasCa,
23842 /// If set, the enum was initialized with an unknown value.
23843 ///
23844 /// Applications can examine the value using [CaMode::value] or
23845 /// [CaMode::name].
23846 UnknownValue(ca_mode::UnknownValue),
23847 }
23848
23849 #[doc(hidden)]
23850 pub mod ca_mode {
23851 #[allow(unused_imports)]
23852 use super::*;
23853 #[derive(Clone, Debug, PartialEq)]
23854 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
23855 }
23856
23857 impl CaMode {
23858 /// Gets the enum value.
23859 ///
23860 /// Returns `None` if the enum contains an unknown value deserialized from
23861 /// the string representation of enums.
23862 pub fn value(&self) -> std::option::Option<i32> {
23863 match self {
23864 Self::Unspecified => std::option::Option::Some(0),
23865 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
23866 Self::GoogleManagedCasCa => std::option::Option::Some(2),
23867 Self::CustomerManagedCasCa => std::option::Option::Some(3),
23868 Self::UnknownValue(u) => u.0.value(),
23869 }
23870 }
23871
23872 /// Gets the enum value as a string.
23873 ///
23874 /// Returns `None` if the enum contains an unknown value deserialized from
23875 /// the integer representation of enums.
23876 pub fn name(&self) -> std::option::Option<&str> {
23877 match self {
23878 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
23879 Self::GoogleManagedInternalCa => {
23880 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
23881 }
23882 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
23883 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
23884 Self::UnknownValue(u) => u.0.name(),
23885 }
23886 }
23887 }
23888
23889 impl std::default::Default for CaMode {
23890 fn default() -> Self {
23891 use std::convert::From;
23892 Self::from(0)
23893 }
23894 }
23895
23896 impl std::fmt::Display for CaMode {
23897 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
23898 wkt::internal::display_enum(f, self.name(), self.value())
23899 }
23900 }
23901
23902 impl std::convert::From<i32> for CaMode {
23903 fn from(value: i32) -> Self {
23904 match value {
23905 0 => Self::Unspecified,
23906 1 => Self::GoogleManagedInternalCa,
23907 2 => Self::GoogleManagedCasCa,
23908 3 => Self::CustomerManagedCasCa,
23909 _ => Self::UnknownValue(ca_mode::UnknownValue(
23910 wkt::internal::UnknownEnumValue::Integer(value),
23911 )),
23912 }
23913 }
23914 }
23915
23916 impl std::convert::From<&str> for CaMode {
23917 fn from(value: &str) -> Self {
23918 use std::string::ToString;
23919 match value {
23920 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
23921 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
23922 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
23923 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
23924 _ => Self::UnknownValue(ca_mode::UnknownValue(
23925 wkt::internal::UnknownEnumValue::String(value.to_string()),
23926 )),
23927 }
23928 }
23929 }
23930
23931 impl serde::ser::Serialize for CaMode {
23932 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
23933 where
23934 S: serde::Serializer,
23935 {
23936 match self {
23937 Self::Unspecified => serializer.serialize_i32(0),
23938 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
23939 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
23940 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
23941 Self::UnknownValue(u) => u.0.serialize(serializer),
23942 }
23943 }
23944 }
23945
23946 impl<'de> serde::de::Deserialize<'de> for CaMode {
23947 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
23948 where
23949 D: serde::Deserializer<'de>,
23950 {
23951 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
23952 ".google.cloud.sql.v1.IpConfiguration.CaMode",
23953 ))
23954 }
23955 }
23956
23957 /// Settings for automatic server certificate rotation.
23958 ///
23959 /// # Working with unknown values
23960 ///
23961 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
23962 /// additional enum variants at any time. Adding new variants is not considered
23963 /// a breaking change. Applications should write their code in anticipation of:
23964 ///
23965 /// - New values appearing in future releases of the client library, **and**
23966 /// - New values received dynamically, without application changes.
23967 ///
23968 /// Please consult the [Working with enums] section in the user guide for some
23969 /// guidelines.
23970 ///
23971 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
23972 #[derive(Clone, Debug, PartialEq)]
23973 #[non_exhaustive]
23974 pub enum ServerCertificateRotationMode {
23975 /// Unspecified: no automatic server certificate rotation.
23976 Unspecified,
23977 /// No automatic server certificate rotation. The user must [manage server
23978 /// certificate
23979 /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
23980 /// on their side.
23981 NoAutomaticRotation,
23982 /// Automatic server certificate rotation during Cloud SQL scheduled
23983 /// maintenance or self-service maintenance updates. Requires
23984 /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
23985 /// `CUSTOMER_MANAGED_CAS_CA`.
23986 AutomaticRotationDuringMaintenance,
23987 /// If set, the enum was initialized with an unknown value.
23988 ///
23989 /// Applications can examine the value using [ServerCertificateRotationMode::value] or
23990 /// [ServerCertificateRotationMode::name].
23991 UnknownValue(server_certificate_rotation_mode::UnknownValue),
23992 }
23993
23994 #[doc(hidden)]
23995 pub mod server_certificate_rotation_mode {
23996 #[allow(unused_imports)]
23997 use super::*;
23998 #[derive(Clone, Debug, PartialEq)]
23999 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24000 }
24001
24002 impl ServerCertificateRotationMode {
24003 /// Gets the enum value.
24004 ///
24005 /// Returns `None` if the enum contains an unknown value deserialized from
24006 /// the string representation of enums.
24007 pub fn value(&self) -> std::option::Option<i32> {
24008 match self {
24009 Self::Unspecified => std::option::Option::Some(0),
24010 Self::NoAutomaticRotation => std::option::Option::Some(1),
24011 Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
24012 Self::UnknownValue(u) => u.0.value(),
24013 }
24014 }
24015
24016 /// Gets the enum value as a string.
24017 ///
24018 /// Returns `None` if the enum contains an unknown value deserialized from
24019 /// the integer representation of enums.
24020 pub fn name(&self) -> std::option::Option<&str> {
24021 match self {
24022 Self::Unspecified => {
24023 std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
24024 }
24025 Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
24026 Self::AutomaticRotationDuringMaintenance => {
24027 std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
24028 }
24029 Self::UnknownValue(u) => u.0.name(),
24030 }
24031 }
24032 }
24033
24034 impl std::default::Default for ServerCertificateRotationMode {
24035 fn default() -> Self {
24036 use std::convert::From;
24037 Self::from(0)
24038 }
24039 }
24040
24041 impl std::fmt::Display for ServerCertificateRotationMode {
24042 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24043 wkt::internal::display_enum(f, self.name(), self.value())
24044 }
24045 }
24046
24047 impl std::convert::From<i32> for ServerCertificateRotationMode {
24048 fn from(value: i32) -> Self {
24049 match value {
24050 0 => Self::Unspecified,
24051 1 => Self::NoAutomaticRotation,
24052 2 => Self::AutomaticRotationDuringMaintenance,
24053 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
24054 wkt::internal::UnknownEnumValue::Integer(value),
24055 )),
24056 }
24057 }
24058 }
24059
24060 impl std::convert::From<&str> for ServerCertificateRotationMode {
24061 fn from(value: &str) -> Self {
24062 use std::string::ToString;
24063 match value {
24064 "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
24065 "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
24066 "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
24067 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
24068 wkt::internal::UnknownEnumValue::String(value.to_string()),
24069 )),
24070 }
24071 }
24072 }
24073
24074 impl serde::ser::Serialize for ServerCertificateRotationMode {
24075 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24076 where
24077 S: serde::Serializer,
24078 {
24079 match self {
24080 Self::Unspecified => serializer.serialize_i32(0),
24081 Self::NoAutomaticRotation => serializer.serialize_i32(1),
24082 Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
24083 Self::UnknownValue(u) => u.0.serialize(serializer),
24084 }
24085 }
24086 }
24087
24088 impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
24089 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
24090 where
24091 D: serde::Deserializer<'de>,
24092 {
24093 deserializer.deserialize_any(
24094 wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
24095 ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
24096 ),
24097 )
24098 }
24099 }
24100}
24101
24102/// PSC settings for a Cloud SQL instance.
24103#[derive(Clone, Default, PartialEq)]
24104#[non_exhaustive]
24105pub struct PscConfig {
24106 /// Whether PSC connectivity is enabled for this instance.
24107 pub psc_enabled: std::option::Option<bool>,
24108
24109 /// Optional. The list of consumer projects that are allow-listed for PSC
24110 /// connections to this instance. This instance can be connected to with PSC
24111 /// from any network in these projects.
24112 ///
24113 /// Each consumer project in this list may be represented by a project number
24114 /// (numeric) or by a project id (alphanumeric).
24115 pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
24116
24117 /// Optional. The list of settings for requested Private Service Connect
24118 /// consumer endpoints that can be used to connect to this Cloud SQL instance.
24119 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
24120
24121 /// Optional. The network attachment of the consumer network that the
24122 /// Private Service Connect enabled Cloud SQL instance is
24123 /// authorized to connect via PSC interface.
24124 /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
24125 pub network_attachment_uri: std::string::String,
24126
24127 /// Optional. Indicates whether Private Service Connect DNS automation is
24128 /// enabled for this instance. When enabled, Cloud SQL provisions a universal
24129 /// DNS record across all networks configured with Private Service Connect
24130 /// auto-connections. This will default to true for new instances when
24131 /// Private Service Connect is enabled.
24132 pub psc_auto_dns_enabled: std::option::Option<bool>,
24133
24134 /// Optional. Indicates whether Private Service Connect write endpoint DNS
24135 /// automation is enabled for this instance. When enabled, Cloud SQL provisions
24136 /// a universal global DNS record across all networks configured with Private
24137 /// Service Connect auto-connections that points to the cluster primary
24138 /// instance. This feature is only supported for Enterprise Plus edition. This
24139 /// will default to true for new Enterprise Plus instances when
24140 /// `psc_auto_dns_enabled` is enabled.
24141 pub psc_write_endpoint_dns_enabled: std::option::Option<bool>,
24142
24143 /// Optional. Whether to set up the PSC service connection policy
24144 /// automatically.
24145 pub psc_auto_connection_policy_enabled: std::option::Option<bool>,
24146
24147 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24148}
24149
24150impl PscConfig {
24151 /// Creates a new default instance.
24152 pub fn new() -> Self {
24153 std::default::Default::default()
24154 }
24155
24156 /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
24157 ///
24158 /// # Example
24159 /// ```ignore,no_run
24160 /// # use google_cloud_sql_v1::model::PscConfig;
24161 /// let x = PscConfig::new().set_psc_enabled(true);
24162 /// ```
24163 pub fn set_psc_enabled<T>(mut self, v: T) -> Self
24164 where
24165 T: std::convert::Into<bool>,
24166 {
24167 self.psc_enabled = std::option::Option::Some(v.into());
24168 self
24169 }
24170
24171 /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
24172 ///
24173 /// # Example
24174 /// ```ignore,no_run
24175 /// # use google_cloud_sql_v1::model::PscConfig;
24176 /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
24177 /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
24178 /// ```
24179 pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
24180 where
24181 T: std::convert::Into<bool>,
24182 {
24183 self.psc_enabled = v.map(|x| x.into());
24184 self
24185 }
24186
24187 /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
24188 ///
24189 /// # Example
24190 /// ```ignore,no_run
24191 /// # use google_cloud_sql_v1::model::PscConfig;
24192 /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
24193 /// ```
24194 pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
24195 where
24196 T: std::iter::IntoIterator<Item = V>,
24197 V: std::convert::Into<std::string::String>,
24198 {
24199 use std::iter::Iterator;
24200 self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
24201 self
24202 }
24203
24204 /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
24205 ///
24206 /// # Example
24207 /// ```ignore,no_run
24208 /// # use google_cloud_sql_v1::model::PscConfig;
24209 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24210 /// let x = PscConfig::new()
24211 /// .set_psc_auto_connections([
24212 /// PscAutoConnectionConfig::default()/* use setters */,
24213 /// PscAutoConnectionConfig::default()/* use (different) setters */,
24214 /// ]);
24215 /// ```
24216 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
24217 where
24218 T: std::iter::IntoIterator<Item = V>,
24219 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
24220 {
24221 use std::iter::Iterator;
24222 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
24223 self
24224 }
24225
24226 /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
24227 ///
24228 /// # Example
24229 /// ```ignore,no_run
24230 /// # use google_cloud_sql_v1::model::PscConfig;
24231 /// let x = PscConfig::new().set_network_attachment_uri("example");
24232 /// ```
24233 pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
24234 mut self,
24235 v: T,
24236 ) -> Self {
24237 self.network_attachment_uri = v.into();
24238 self
24239 }
24240
24241 /// Sets the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
24242 ///
24243 /// # Example
24244 /// ```ignore,no_run
24245 /// # use google_cloud_sql_v1::model::PscConfig;
24246 /// let x = PscConfig::new().set_psc_auto_dns_enabled(true);
24247 /// ```
24248 pub fn set_psc_auto_dns_enabled<T>(mut self, v: T) -> Self
24249 where
24250 T: std::convert::Into<bool>,
24251 {
24252 self.psc_auto_dns_enabled = std::option::Option::Some(v.into());
24253 self
24254 }
24255
24256 /// Sets or clears the value of [psc_auto_dns_enabled][crate::model::PscConfig::psc_auto_dns_enabled].
24257 ///
24258 /// # Example
24259 /// ```ignore,no_run
24260 /// # use google_cloud_sql_v1::model::PscConfig;
24261 /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(Some(false));
24262 /// let x = PscConfig::new().set_or_clear_psc_auto_dns_enabled(None::<bool>);
24263 /// ```
24264 pub fn set_or_clear_psc_auto_dns_enabled<T>(mut self, v: std::option::Option<T>) -> Self
24265 where
24266 T: std::convert::Into<bool>,
24267 {
24268 self.psc_auto_dns_enabled = v.map(|x| x.into());
24269 self
24270 }
24271
24272 /// Sets the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
24273 ///
24274 /// # Example
24275 /// ```ignore,no_run
24276 /// # use google_cloud_sql_v1::model::PscConfig;
24277 /// let x = PscConfig::new().set_psc_write_endpoint_dns_enabled(true);
24278 /// ```
24279 pub fn set_psc_write_endpoint_dns_enabled<T>(mut self, v: T) -> Self
24280 where
24281 T: std::convert::Into<bool>,
24282 {
24283 self.psc_write_endpoint_dns_enabled = std::option::Option::Some(v.into());
24284 self
24285 }
24286
24287 /// Sets or clears the value of [psc_write_endpoint_dns_enabled][crate::model::PscConfig::psc_write_endpoint_dns_enabled].
24288 ///
24289 /// # Example
24290 /// ```ignore,no_run
24291 /// # use google_cloud_sql_v1::model::PscConfig;
24292 /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(Some(false));
24293 /// let x = PscConfig::new().set_or_clear_psc_write_endpoint_dns_enabled(None::<bool>);
24294 /// ```
24295 pub fn set_or_clear_psc_write_endpoint_dns_enabled<T>(
24296 mut self,
24297 v: std::option::Option<T>,
24298 ) -> Self
24299 where
24300 T: std::convert::Into<bool>,
24301 {
24302 self.psc_write_endpoint_dns_enabled = v.map(|x| x.into());
24303 self
24304 }
24305
24306 /// Sets the value of [psc_auto_connection_policy_enabled][crate::model::PscConfig::psc_auto_connection_policy_enabled].
24307 ///
24308 /// # Example
24309 /// ```ignore,no_run
24310 /// # use google_cloud_sql_v1::model::PscConfig;
24311 /// let x = PscConfig::new().set_psc_auto_connection_policy_enabled(true);
24312 /// ```
24313 pub fn set_psc_auto_connection_policy_enabled<T>(mut self, v: T) -> Self
24314 where
24315 T: std::convert::Into<bool>,
24316 {
24317 self.psc_auto_connection_policy_enabled = std::option::Option::Some(v.into());
24318 self
24319 }
24320
24321 /// Sets or clears the value of [psc_auto_connection_policy_enabled][crate::model::PscConfig::psc_auto_connection_policy_enabled].
24322 ///
24323 /// # Example
24324 /// ```ignore,no_run
24325 /// # use google_cloud_sql_v1::model::PscConfig;
24326 /// let x = PscConfig::new().set_or_clear_psc_auto_connection_policy_enabled(Some(false));
24327 /// let x = PscConfig::new().set_or_clear_psc_auto_connection_policy_enabled(None::<bool>);
24328 /// ```
24329 pub fn set_or_clear_psc_auto_connection_policy_enabled<T>(
24330 mut self,
24331 v: std::option::Option<T>,
24332 ) -> Self
24333 where
24334 T: std::convert::Into<bool>,
24335 {
24336 self.psc_auto_connection_policy_enabled = v.map(|x| x.into());
24337 self
24338 }
24339}
24340
24341impl wkt::message::Message for PscConfig {
24342 fn typename() -> &'static str {
24343 "type.googleapis.com/google.cloud.sql.v1.PscConfig"
24344 }
24345}
24346
24347/// Settings for an automatically-setup Private Service Connect consumer endpoint
24348/// that is used to connect to a Cloud SQL instance.
24349#[derive(Clone, Default, PartialEq)]
24350#[non_exhaustive]
24351pub struct PscAutoConnectionConfig {
24352 /// Optional. This is the project ID of consumer service project of this
24353 /// consumer endpoint.
24354 ///
24355 /// This is only applicable if `consumer_network` is a shared VPC
24356 /// network.
24357 pub consumer_project: std::string::String,
24358
24359 /// Optional. The consumer network of this consumer endpoint. This must be a
24360 /// resource path that includes both the host project and the network name.
24361 ///
24362 /// For example, `projects/project1/global/networks/network1`.
24363 ///
24364 /// The consumer host project of this network might be different from the
24365 /// consumer service project.
24366 pub consumer_network: std::string::String,
24367
24368 /// The IP address of the consumer endpoint.
24369 pub ip_address: std::option::Option<std::string::String>,
24370
24371 /// The connection status of the consumer endpoint.
24372 pub status: std::option::Option<std::string::String>,
24373
24374 /// The connection policy status of the consumer network.
24375 pub consumer_network_status: std::option::Option<std::string::String>,
24376
24377 /// Output only. The service connection policy created automatically for the
24378 /// consumer network when `psc_auto_connection_policy_enabled` is true. It is
24379 /// in the format of:
24380 /// `projects/{project}/regions/{region}/serviceConnectionPolicies/{policy_id}`
24381 /// The `policy_id` is in format of `$NETWORK-$RANDOM`.
24382 pub service_connection_policy: std::option::Option<std::string::String>,
24383
24384 /// Output only. The status of service connection policy creation.
24385 pub service_connection_policy_creation_result: std::option::Option<std::string::String>,
24386
24387 /// Output only. The status of automated DNS provisioning.
24388 pub instance_auto_dns_status: std::option::Option<crate::model::AutoDnsStatus>,
24389
24390 /// Output only. The status of automated DNS provisioning for the write
24391 /// endpoint.
24392 pub write_endpoint_auto_dns_status: std::option::Option<crate::model::AutoDnsStatus>,
24393
24394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24395}
24396
24397impl PscAutoConnectionConfig {
24398 /// Creates a new default instance.
24399 pub fn new() -> Self {
24400 std::default::Default::default()
24401 }
24402
24403 /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
24404 ///
24405 /// # Example
24406 /// ```ignore,no_run
24407 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24408 /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
24409 /// ```
24410 pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
24411 mut self,
24412 v: T,
24413 ) -> Self {
24414 self.consumer_project = v.into();
24415 self
24416 }
24417
24418 /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
24419 ///
24420 /// # Example
24421 /// ```ignore,no_run
24422 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24423 /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
24424 /// ```
24425 pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
24426 mut self,
24427 v: T,
24428 ) -> Self {
24429 self.consumer_network = v.into();
24430 self
24431 }
24432
24433 /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
24434 ///
24435 /// # Example
24436 /// ```ignore,no_run
24437 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24438 /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
24439 /// ```
24440 pub fn set_ip_address<T>(mut self, v: T) -> Self
24441 where
24442 T: std::convert::Into<std::string::String>,
24443 {
24444 self.ip_address = std::option::Option::Some(v.into());
24445 self
24446 }
24447
24448 /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
24449 ///
24450 /// # Example
24451 /// ```ignore,no_run
24452 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24453 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
24454 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
24455 /// ```
24456 pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
24457 where
24458 T: std::convert::Into<std::string::String>,
24459 {
24460 self.ip_address = v.map(|x| x.into());
24461 self
24462 }
24463
24464 /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
24465 ///
24466 /// # Example
24467 /// ```ignore,no_run
24468 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24469 /// let x = PscAutoConnectionConfig::new().set_status("example");
24470 /// ```
24471 pub fn set_status<T>(mut self, v: T) -> Self
24472 where
24473 T: std::convert::Into<std::string::String>,
24474 {
24475 self.status = std::option::Option::Some(v.into());
24476 self
24477 }
24478
24479 /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
24480 ///
24481 /// # Example
24482 /// ```ignore,no_run
24483 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24484 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
24485 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
24486 /// ```
24487 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
24488 where
24489 T: std::convert::Into<std::string::String>,
24490 {
24491 self.status = v.map(|x| x.into());
24492 self
24493 }
24494
24495 /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
24496 ///
24497 /// # Example
24498 /// ```ignore,no_run
24499 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24500 /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
24501 /// ```
24502 pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
24503 where
24504 T: std::convert::Into<std::string::String>,
24505 {
24506 self.consumer_network_status = std::option::Option::Some(v.into());
24507 self
24508 }
24509
24510 /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
24511 ///
24512 /// # Example
24513 /// ```ignore,no_run
24514 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24515 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
24516 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
24517 /// ```
24518 pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
24519 where
24520 T: std::convert::Into<std::string::String>,
24521 {
24522 self.consumer_network_status = v.map(|x| x.into());
24523 self
24524 }
24525
24526 /// Sets the value of [service_connection_policy][crate::model::PscAutoConnectionConfig::service_connection_policy].
24527 ///
24528 /// # Example
24529 /// ```ignore,no_run
24530 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24531 /// let x = PscAutoConnectionConfig::new().set_service_connection_policy("example");
24532 /// ```
24533 pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
24534 where
24535 T: std::convert::Into<std::string::String>,
24536 {
24537 self.service_connection_policy = std::option::Option::Some(v.into());
24538 self
24539 }
24540
24541 /// Sets or clears the value of [service_connection_policy][crate::model::PscAutoConnectionConfig::service_connection_policy].
24542 ///
24543 /// # Example
24544 /// ```ignore,no_run
24545 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24546 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy(Some("example"));
24547 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy(None::<String>);
24548 /// ```
24549 pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
24550 where
24551 T: std::convert::Into<std::string::String>,
24552 {
24553 self.service_connection_policy = v.map(|x| x.into());
24554 self
24555 }
24556
24557 /// Sets the value of [service_connection_policy_creation_result][crate::model::PscAutoConnectionConfig::service_connection_policy_creation_result].
24558 ///
24559 /// # Example
24560 /// ```ignore,no_run
24561 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24562 /// let x = PscAutoConnectionConfig::new().set_service_connection_policy_creation_result("example");
24563 /// ```
24564 pub fn set_service_connection_policy_creation_result<T>(mut self, v: T) -> Self
24565 where
24566 T: std::convert::Into<std::string::String>,
24567 {
24568 self.service_connection_policy_creation_result = std::option::Option::Some(v.into());
24569 self
24570 }
24571
24572 /// Sets or clears the value of [service_connection_policy_creation_result][crate::model::PscAutoConnectionConfig::service_connection_policy_creation_result].
24573 ///
24574 /// # Example
24575 /// ```ignore,no_run
24576 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24577 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy_creation_result(Some("example"));
24578 /// let x = PscAutoConnectionConfig::new().set_or_clear_service_connection_policy_creation_result(None::<String>);
24579 /// ```
24580 pub fn set_or_clear_service_connection_policy_creation_result<T>(
24581 mut self,
24582 v: std::option::Option<T>,
24583 ) -> Self
24584 where
24585 T: std::convert::Into<std::string::String>,
24586 {
24587 self.service_connection_policy_creation_result = v.map(|x| x.into());
24588 self
24589 }
24590
24591 /// Sets the value of [instance_auto_dns_status][crate::model::PscAutoConnectionConfig::instance_auto_dns_status].
24592 ///
24593 /// # Example
24594 /// ```ignore,no_run
24595 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24596 /// use google_cloud_sql_v1::model::AutoDnsStatus;
24597 /// let x0 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsOk);
24598 /// let x1 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsFailed);
24599 /// let x2 = PscAutoConnectionConfig::new().set_instance_auto_dns_status(AutoDnsStatus::AutoDnsUnknown);
24600 /// ```
24601 pub fn set_instance_auto_dns_status<T>(mut self, v: T) -> Self
24602 where
24603 T: std::convert::Into<crate::model::AutoDnsStatus>,
24604 {
24605 self.instance_auto_dns_status = std::option::Option::Some(v.into());
24606 self
24607 }
24608
24609 /// Sets or clears the value of [instance_auto_dns_status][crate::model::PscAutoConnectionConfig::instance_auto_dns_status].
24610 ///
24611 /// # Example
24612 /// ```ignore,no_run
24613 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24614 /// use google_cloud_sql_v1::model::AutoDnsStatus;
24615 /// let x0 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsOk));
24616 /// let x1 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsFailed));
24617 /// let x2 = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(Some(AutoDnsStatus::AutoDnsUnknown));
24618 /// let x_none = PscAutoConnectionConfig::new().set_or_clear_instance_auto_dns_status(None::<AutoDnsStatus>);
24619 /// ```
24620 pub fn set_or_clear_instance_auto_dns_status<T>(mut self, v: std::option::Option<T>) -> Self
24621 where
24622 T: std::convert::Into<crate::model::AutoDnsStatus>,
24623 {
24624 self.instance_auto_dns_status = v.map(|x| x.into());
24625 self
24626 }
24627
24628 /// Sets the value of [write_endpoint_auto_dns_status][crate::model::PscAutoConnectionConfig::write_endpoint_auto_dns_status].
24629 ///
24630 /// # Example
24631 /// ```ignore,no_run
24632 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24633 /// use google_cloud_sql_v1::model::AutoDnsStatus;
24634 /// let x0 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsOk);
24635 /// let x1 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsFailed);
24636 /// let x2 = PscAutoConnectionConfig::new().set_write_endpoint_auto_dns_status(AutoDnsStatus::AutoDnsUnknown);
24637 /// ```
24638 pub fn set_write_endpoint_auto_dns_status<T>(mut self, v: T) -> Self
24639 where
24640 T: std::convert::Into<crate::model::AutoDnsStatus>,
24641 {
24642 self.write_endpoint_auto_dns_status = std::option::Option::Some(v.into());
24643 self
24644 }
24645
24646 /// Sets or clears the value of [write_endpoint_auto_dns_status][crate::model::PscAutoConnectionConfig::write_endpoint_auto_dns_status].
24647 ///
24648 /// # Example
24649 /// ```ignore,no_run
24650 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
24651 /// use google_cloud_sql_v1::model::AutoDnsStatus;
24652 /// let x0 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsOk));
24653 /// let x1 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsFailed));
24654 /// let x2 = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(Some(AutoDnsStatus::AutoDnsUnknown));
24655 /// let x_none = PscAutoConnectionConfig::new().set_or_clear_write_endpoint_auto_dns_status(None::<AutoDnsStatus>);
24656 /// ```
24657 pub fn set_or_clear_write_endpoint_auto_dns_status<T>(
24658 mut self,
24659 v: std::option::Option<T>,
24660 ) -> Self
24661 where
24662 T: std::convert::Into<crate::model::AutoDnsStatus>,
24663 {
24664 self.write_endpoint_auto_dns_status = v.map(|x| x.into());
24665 self
24666 }
24667}
24668
24669impl wkt::message::Message for PscAutoConnectionConfig {
24670 fn typename() -> &'static str {
24671 "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
24672 }
24673}
24674
24675/// Preferred location. This specifies where a Cloud SQL instance is located.
24676/// Note that if the preferred location is not available, the instance will be
24677/// located as close as possible within the region. Only one location may be
24678/// specified.
24679#[derive(Clone, Default, PartialEq)]
24680#[non_exhaustive]
24681pub struct LocationPreference {
24682 /// The App Engine application to follow, it must be in the same region as the
24683 /// Cloud SQL instance. WARNING: Changing this might restart the instance.
24684 #[deprecated]
24685 pub follow_gae_application: std::string::String,
24686
24687 /// The preferred Compute Engine zone (for example: us-central1-a,
24688 /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
24689 pub zone: std::string::String,
24690
24691 /// The preferred Compute Engine zone for the secondary/failover
24692 /// (for example: us-central1-a, us-central1-b, etc.).
24693 /// To disable this field, set it to 'no_secondary_zone'.
24694 pub secondary_zone: std::string::String,
24695
24696 /// This is always `sql#locationPreference`.
24697 pub kind: std::string::String,
24698
24699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24700}
24701
24702impl LocationPreference {
24703 /// Creates a new default instance.
24704 pub fn new() -> Self {
24705 std::default::Default::default()
24706 }
24707
24708 /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
24709 ///
24710 /// # Example
24711 /// ```ignore,no_run
24712 /// # use google_cloud_sql_v1::model::LocationPreference;
24713 /// let x = LocationPreference::new().set_follow_gae_application("example");
24714 /// ```
24715 #[deprecated]
24716 pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
24717 mut self,
24718 v: T,
24719 ) -> Self {
24720 self.follow_gae_application = v.into();
24721 self
24722 }
24723
24724 /// Sets the value of [zone][crate::model::LocationPreference::zone].
24725 ///
24726 /// # Example
24727 /// ```ignore,no_run
24728 /// # use google_cloud_sql_v1::model::LocationPreference;
24729 /// let x = LocationPreference::new().set_zone("example");
24730 /// ```
24731 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24732 self.zone = v.into();
24733 self
24734 }
24735
24736 /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
24737 ///
24738 /// # Example
24739 /// ```ignore,no_run
24740 /// # use google_cloud_sql_v1::model::LocationPreference;
24741 /// let x = LocationPreference::new().set_secondary_zone("example");
24742 /// ```
24743 pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24744 self.secondary_zone = v.into();
24745 self
24746 }
24747
24748 /// Sets the value of [kind][crate::model::LocationPreference::kind].
24749 ///
24750 /// # Example
24751 /// ```ignore,no_run
24752 /// # use google_cloud_sql_v1::model::LocationPreference;
24753 /// let x = LocationPreference::new().set_kind("example");
24754 /// ```
24755 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24756 self.kind = v.into();
24757 self
24758 }
24759}
24760
24761impl wkt::message::Message for LocationPreference {
24762 fn typename() -> &'static str {
24763 "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
24764 }
24765}
24766
24767/// Maintenance window. This specifies when a Cloud SQL instance is
24768/// restarted for system maintenance purposes.
24769#[derive(Clone, Default, PartialEq)]
24770#[non_exhaustive]
24771pub struct MaintenanceWindow {
24772 /// Hour of day - 0 to 23. Specify in the UTC time zone.
24773 pub hour: std::option::Option<wkt::Int32Value>,
24774
24775 /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
24776 /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
24777 /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
24778 pub day: std::option::Option<wkt::Int32Value>,
24779
24780 /// Maintenance timing settings: `canary`, `stable`, or `week5`.
24781 /// For more information, see [About maintenance on Cloud SQL
24782 /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
24783 pub update_track: crate::model::SqlUpdateTrack,
24784
24785 /// This is always `sql#maintenanceWindow`.
24786 pub kind: std::string::String,
24787
24788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24789}
24790
24791impl MaintenanceWindow {
24792 /// Creates a new default instance.
24793 pub fn new() -> Self {
24794 std::default::Default::default()
24795 }
24796
24797 /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
24798 ///
24799 /// # Example
24800 /// ```ignore,no_run
24801 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
24802 /// use wkt::Int32Value;
24803 /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
24804 /// ```
24805 pub fn set_hour<T>(mut self, v: T) -> Self
24806 where
24807 T: std::convert::Into<wkt::Int32Value>,
24808 {
24809 self.hour = std::option::Option::Some(v.into());
24810 self
24811 }
24812
24813 /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
24814 ///
24815 /// # Example
24816 /// ```ignore,no_run
24817 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
24818 /// use wkt::Int32Value;
24819 /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
24820 /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
24821 /// ```
24822 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
24823 where
24824 T: std::convert::Into<wkt::Int32Value>,
24825 {
24826 self.hour = v.map(|x| x.into());
24827 self
24828 }
24829
24830 /// Sets the value of [day][crate::model::MaintenanceWindow::day].
24831 ///
24832 /// # Example
24833 /// ```ignore,no_run
24834 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
24835 /// use wkt::Int32Value;
24836 /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
24837 /// ```
24838 pub fn set_day<T>(mut self, v: T) -> Self
24839 where
24840 T: std::convert::Into<wkt::Int32Value>,
24841 {
24842 self.day = std::option::Option::Some(v.into());
24843 self
24844 }
24845
24846 /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
24847 ///
24848 /// # Example
24849 /// ```ignore,no_run
24850 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
24851 /// use wkt::Int32Value;
24852 /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
24853 /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
24854 /// ```
24855 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
24856 where
24857 T: std::convert::Into<wkt::Int32Value>,
24858 {
24859 self.day = v.map(|x| x.into());
24860 self
24861 }
24862
24863 /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
24864 ///
24865 /// # Example
24866 /// ```ignore,no_run
24867 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
24868 /// use google_cloud_sql_v1::model::SqlUpdateTrack;
24869 /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
24870 /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
24871 /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
24872 /// ```
24873 pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
24874 mut self,
24875 v: T,
24876 ) -> Self {
24877 self.update_track = v.into();
24878 self
24879 }
24880
24881 /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
24882 ///
24883 /// # Example
24884 /// ```ignore,no_run
24885 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
24886 /// let x = MaintenanceWindow::new().set_kind("example");
24887 /// ```
24888 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24889 self.kind = v.into();
24890 self
24891 }
24892}
24893
24894impl wkt::message::Message for MaintenanceWindow {
24895 fn typename() -> &'static str {
24896 "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
24897 }
24898}
24899
24900/// Deny maintenance Periods. This specifies a date range during when all CSA
24901/// rollout will be denied.
24902#[derive(Clone, Default, PartialEq)]
24903#[non_exhaustive]
24904pub struct DenyMaintenancePeriod {
24905 /// "deny maintenance period" start date. If the year of the start date is
24906 /// empty, the year of the end date also must be empty. In this case, it means
24907 /// the deny maintenance period recurs every year. The date is in format
24908 /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
24909 pub start_date: std::string::String,
24910
24911 /// "deny maintenance period" end date. If the year of the end date is empty,
24912 /// the year of the start date also must be empty. In this case, it means the
24913 /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
24914 /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
24915 pub end_date: std::string::String,
24916
24917 /// Time in UTC when the "deny maintenance period" starts on start_date and
24918 /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
24919 pub time: std::string::String,
24920
24921 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24922}
24923
24924impl DenyMaintenancePeriod {
24925 /// Creates a new default instance.
24926 pub fn new() -> Self {
24927 std::default::Default::default()
24928 }
24929
24930 /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
24931 ///
24932 /// # Example
24933 /// ```ignore,no_run
24934 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
24935 /// let x = DenyMaintenancePeriod::new().set_start_date("example");
24936 /// ```
24937 pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24938 self.start_date = v.into();
24939 self
24940 }
24941
24942 /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
24943 ///
24944 /// # Example
24945 /// ```ignore,no_run
24946 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
24947 /// let x = DenyMaintenancePeriod::new().set_end_date("example");
24948 /// ```
24949 pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24950 self.end_date = v.into();
24951 self
24952 }
24953
24954 /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
24955 ///
24956 /// # Example
24957 /// ```ignore,no_run
24958 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
24959 /// let x = DenyMaintenancePeriod::new().set_time("example");
24960 /// ```
24961 pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24962 self.time = v.into();
24963 self
24964 }
24965}
24966
24967impl wkt::message::Message for DenyMaintenancePeriod {
24968 fn typename() -> &'static str {
24969 "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
24970 }
24971}
24972
24973/// Insights configuration. This specifies when Cloud SQL Insights feature is
24974/// enabled and optional configuration.
24975#[derive(Clone, Default, PartialEq)]
24976#[non_exhaustive]
24977pub struct InsightsConfig {
24978 /// Whether Query Insights feature is enabled.
24979 pub query_insights_enabled: bool,
24980
24981 /// Whether Query Insights will record client address when enabled.
24982 pub record_client_address: bool,
24983
24984 /// Whether Query Insights will record application tags from query when
24985 /// enabled.
24986 pub record_application_tags: bool,
24987
24988 /// Maximum query length stored in bytes. Default value: 1024 bytes.
24989 /// Range: 256-4500 bytes. Query lengths greater than this field value will be
24990 /// truncated to this value. When unset, query length will be the default
24991 /// value. Changing query length will restart the database.
24992 pub query_string_length: std::option::Option<wkt::Int32Value>,
24993
24994 /// Number of query execution plans captured by Insights per minute
24995 /// for all queries combined. Default is 5.
24996 pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
24997
24998 /// Optional. Whether enhanced query insights feature is enabled.
24999 pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
25000
25001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25002}
25003
25004impl InsightsConfig {
25005 /// Creates a new default instance.
25006 pub fn new() -> Self {
25007 std::default::Default::default()
25008 }
25009
25010 /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
25011 ///
25012 /// # Example
25013 /// ```ignore,no_run
25014 /// # use google_cloud_sql_v1::model::InsightsConfig;
25015 /// let x = InsightsConfig::new().set_query_insights_enabled(true);
25016 /// ```
25017 pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25018 self.query_insights_enabled = v.into();
25019 self
25020 }
25021
25022 /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
25023 ///
25024 /// # Example
25025 /// ```ignore,no_run
25026 /// # use google_cloud_sql_v1::model::InsightsConfig;
25027 /// let x = InsightsConfig::new().set_record_client_address(true);
25028 /// ```
25029 pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25030 self.record_client_address = v.into();
25031 self
25032 }
25033
25034 /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
25035 ///
25036 /// # Example
25037 /// ```ignore,no_run
25038 /// # use google_cloud_sql_v1::model::InsightsConfig;
25039 /// let x = InsightsConfig::new().set_record_application_tags(true);
25040 /// ```
25041 pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25042 self.record_application_tags = v.into();
25043 self
25044 }
25045
25046 /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
25047 ///
25048 /// # Example
25049 /// ```ignore,no_run
25050 /// # use google_cloud_sql_v1::model::InsightsConfig;
25051 /// use wkt::Int32Value;
25052 /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
25053 /// ```
25054 pub fn set_query_string_length<T>(mut self, v: T) -> Self
25055 where
25056 T: std::convert::Into<wkt::Int32Value>,
25057 {
25058 self.query_string_length = std::option::Option::Some(v.into());
25059 self
25060 }
25061
25062 /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
25063 ///
25064 /// # Example
25065 /// ```ignore,no_run
25066 /// # use google_cloud_sql_v1::model::InsightsConfig;
25067 /// use wkt::Int32Value;
25068 /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
25069 /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
25070 /// ```
25071 pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
25072 where
25073 T: std::convert::Into<wkt::Int32Value>,
25074 {
25075 self.query_string_length = v.map(|x| x.into());
25076 self
25077 }
25078
25079 /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
25080 ///
25081 /// # Example
25082 /// ```ignore,no_run
25083 /// # use google_cloud_sql_v1::model::InsightsConfig;
25084 /// use wkt::Int32Value;
25085 /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
25086 /// ```
25087 pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
25088 where
25089 T: std::convert::Into<wkt::Int32Value>,
25090 {
25091 self.query_plans_per_minute = std::option::Option::Some(v.into());
25092 self
25093 }
25094
25095 /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
25096 ///
25097 /// # Example
25098 /// ```ignore,no_run
25099 /// # use google_cloud_sql_v1::model::InsightsConfig;
25100 /// use wkt::Int32Value;
25101 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
25102 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
25103 /// ```
25104 pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
25105 where
25106 T: std::convert::Into<wkt::Int32Value>,
25107 {
25108 self.query_plans_per_minute = v.map(|x| x.into());
25109 self
25110 }
25111
25112 /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
25113 ///
25114 /// # Example
25115 /// ```ignore,no_run
25116 /// # use google_cloud_sql_v1::model::InsightsConfig;
25117 /// use wkt::BoolValue;
25118 /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
25119 /// ```
25120 pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
25121 where
25122 T: std::convert::Into<wkt::BoolValue>,
25123 {
25124 self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
25125 self
25126 }
25127
25128 /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
25129 ///
25130 /// # Example
25131 /// ```ignore,no_run
25132 /// # use google_cloud_sql_v1::model::InsightsConfig;
25133 /// use wkt::BoolValue;
25134 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
25135 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
25136 /// ```
25137 pub fn set_or_clear_enhanced_query_insights_enabled<T>(
25138 mut self,
25139 v: std::option::Option<T>,
25140 ) -> Self
25141 where
25142 T: std::convert::Into<wkt::BoolValue>,
25143 {
25144 self.enhanced_query_insights_enabled = v.map(|x| x.into());
25145 self
25146 }
25147}
25148
25149impl wkt::message::Message for InsightsConfig {
25150 fn typename() -> &'static str {
25151 "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
25152 }
25153}
25154
25155/// Read-replica configuration specific to MySQL databases.
25156#[derive(Clone, Default, PartialEq)]
25157#[non_exhaustive]
25158pub struct MySqlReplicaConfiguration {
25159 /// Path to a SQL dump file in Google Cloud Storage from which the replica
25160 /// instance is to be created. The URI is in the form gs://bucketName/fileName.
25161 /// Compressed gzip files (.gz) are also supported.
25162 /// Dumps have the binlog co-ordinates from which replication
25163 /// begins. This can be accomplished by setting --master-data to 1 when using
25164 /// mysqldump.
25165 pub dump_file_path: std::string::String,
25166
25167 /// The username for the replication connection.
25168 pub username: std::string::String,
25169
25170 /// The password for the replication connection.
25171 pub password: std::string::String,
25172
25173 /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
25174 pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
25175
25176 /// Interval in milliseconds between replication heartbeats.
25177 pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
25178
25179 /// PEM representation of the trusted CA's x509 certificate.
25180 pub ca_certificate: std::string::String,
25181
25182 /// PEM representation of the replica's x509 certificate.
25183 pub client_certificate: std::string::String,
25184
25185 /// PEM representation of the replica's private key. The corresponding public
25186 /// key is encoded in the client's certificate.
25187 pub client_key: std::string::String,
25188
25189 /// A list of permissible ciphers to use for SSL encryption.
25190 pub ssl_cipher: std::string::String,
25191
25192 /// Whether or not to check the primary instance's Common Name value in the
25193 /// certificate that it sends during the SSL handshake.
25194 pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
25195
25196 /// This is always `sql#mysqlReplicaConfiguration`.
25197 pub kind: std::string::String,
25198
25199 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25200}
25201
25202impl MySqlReplicaConfiguration {
25203 /// Creates a new default instance.
25204 pub fn new() -> Self {
25205 std::default::Default::default()
25206 }
25207
25208 /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
25209 ///
25210 /// # Example
25211 /// ```ignore,no_run
25212 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25213 /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
25214 /// ```
25215 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25216 self.dump_file_path = v.into();
25217 self
25218 }
25219
25220 /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
25221 ///
25222 /// # Example
25223 /// ```ignore,no_run
25224 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25225 /// let x = MySqlReplicaConfiguration::new().set_username("example");
25226 /// ```
25227 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25228 self.username = v.into();
25229 self
25230 }
25231
25232 /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
25233 ///
25234 /// # Example
25235 /// ```ignore,no_run
25236 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25237 /// let x = MySqlReplicaConfiguration::new().set_password("example");
25238 /// ```
25239 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25240 self.password = v.into();
25241 self
25242 }
25243
25244 /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
25245 ///
25246 /// # Example
25247 /// ```ignore,no_run
25248 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25249 /// use wkt::Int32Value;
25250 /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
25251 /// ```
25252 pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
25253 where
25254 T: std::convert::Into<wkt::Int32Value>,
25255 {
25256 self.connect_retry_interval = std::option::Option::Some(v.into());
25257 self
25258 }
25259
25260 /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
25261 ///
25262 /// # Example
25263 /// ```ignore,no_run
25264 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25265 /// use wkt::Int32Value;
25266 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
25267 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
25268 /// ```
25269 pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
25270 where
25271 T: std::convert::Into<wkt::Int32Value>,
25272 {
25273 self.connect_retry_interval = v.map(|x| x.into());
25274 self
25275 }
25276
25277 /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
25278 ///
25279 /// # Example
25280 /// ```ignore,no_run
25281 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25282 /// use wkt::Int64Value;
25283 /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
25284 /// ```
25285 pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
25286 where
25287 T: std::convert::Into<wkt::Int64Value>,
25288 {
25289 self.master_heartbeat_period = std::option::Option::Some(v.into());
25290 self
25291 }
25292
25293 /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
25294 ///
25295 /// # Example
25296 /// ```ignore,no_run
25297 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25298 /// use wkt::Int64Value;
25299 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
25300 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
25301 /// ```
25302 pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
25303 where
25304 T: std::convert::Into<wkt::Int64Value>,
25305 {
25306 self.master_heartbeat_period = v.map(|x| x.into());
25307 self
25308 }
25309
25310 /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
25311 ///
25312 /// # Example
25313 /// ```ignore,no_run
25314 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25315 /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
25316 /// ```
25317 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25318 self.ca_certificate = v.into();
25319 self
25320 }
25321
25322 /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
25323 ///
25324 /// # Example
25325 /// ```ignore,no_run
25326 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25327 /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
25328 /// ```
25329 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
25330 mut self,
25331 v: T,
25332 ) -> Self {
25333 self.client_certificate = v.into();
25334 self
25335 }
25336
25337 /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
25338 ///
25339 /// # Example
25340 /// ```ignore,no_run
25341 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25342 /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
25343 /// ```
25344 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25345 self.client_key = v.into();
25346 self
25347 }
25348
25349 /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
25350 ///
25351 /// # Example
25352 /// ```ignore,no_run
25353 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25354 /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
25355 /// ```
25356 pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25357 self.ssl_cipher = v.into();
25358 self
25359 }
25360
25361 /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
25362 ///
25363 /// # Example
25364 /// ```ignore,no_run
25365 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25366 /// use wkt::BoolValue;
25367 /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
25368 /// ```
25369 pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
25370 where
25371 T: std::convert::Into<wkt::BoolValue>,
25372 {
25373 self.verify_server_certificate = std::option::Option::Some(v.into());
25374 self
25375 }
25376
25377 /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
25378 ///
25379 /// # Example
25380 /// ```ignore,no_run
25381 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25382 /// use wkt::BoolValue;
25383 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
25384 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
25385 /// ```
25386 pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
25387 where
25388 T: std::convert::Into<wkt::BoolValue>,
25389 {
25390 self.verify_server_certificate = v.map(|x| x.into());
25391 self
25392 }
25393
25394 /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
25395 ///
25396 /// # Example
25397 /// ```ignore,no_run
25398 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
25399 /// let x = MySqlReplicaConfiguration::new().set_kind("example");
25400 /// ```
25401 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25402 self.kind = v.into();
25403 self
25404 }
25405}
25406
25407impl wkt::message::Message for MySqlReplicaConfiguration {
25408 fn typename() -> &'static str {
25409 "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
25410 }
25411}
25412
25413/// Disk encryption configuration for an instance.
25414#[derive(Clone, Default, PartialEq)]
25415#[non_exhaustive]
25416pub struct DiskEncryptionConfiguration {
25417 /// Resource name of KMS key for disk encryption
25418 pub kms_key_name: std::string::String,
25419
25420 /// This is always `sql#diskEncryptionConfiguration`.
25421 pub kind: std::string::String,
25422
25423 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25424}
25425
25426impl DiskEncryptionConfiguration {
25427 /// Creates a new default instance.
25428 pub fn new() -> Self {
25429 std::default::Default::default()
25430 }
25431
25432 /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
25433 ///
25434 /// # Example
25435 /// ```ignore,no_run
25436 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
25437 /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
25438 /// ```
25439 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25440 self.kms_key_name = v.into();
25441 self
25442 }
25443
25444 /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
25445 ///
25446 /// # Example
25447 /// ```ignore,no_run
25448 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
25449 /// let x = DiskEncryptionConfiguration::new().set_kind("example");
25450 /// ```
25451 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25452 self.kind = v.into();
25453 self
25454 }
25455}
25456
25457impl wkt::message::Message for DiskEncryptionConfiguration {
25458 fn typename() -> &'static str {
25459 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
25460 }
25461}
25462
25463/// Disk encryption status for an instance.
25464#[derive(Clone, Default, PartialEq)]
25465#[non_exhaustive]
25466pub struct DiskEncryptionStatus {
25467 /// KMS key version used to encrypt the Cloud SQL instance resource
25468 pub kms_key_version_name: std::string::String,
25469
25470 /// This is always `sql#diskEncryptionStatus`.
25471 pub kind: std::string::String,
25472
25473 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25474}
25475
25476impl DiskEncryptionStatus {
25477 /// Creates a new default instance.
25478 pub fn new() -> Self {
25479 std::default::Default::default()
25480 }
25481
25482 /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
25483 ///
25484 /// # Example
25485 /// ```ignore,no_run
25486 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
25487 /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
25488 /// ```
25489 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
25490 mut self,
25491 v: T,
25492 ) -> Self {
25493 self.kms_key_version_name = v.into();
25494 self
25495 }
25496
25497 /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
25498 ///
25499 /// # Example
25500 /// ```ignore,no_run
25501 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
25502 /// let x = DiskEncryptionStatus::new().set_kind("example");
25503 /// ```
25504 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25505 self.kind = v.into();
25506 self
25507 }
25508}
25509
25510impl wkt::message::Message for DiskEncryptionStatus {
25511 fn typename() -> &'static str {
25512 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
25513 }
25514}
25515
25516/// Database instance IP mapping
25517#[derive(Clone, Default, PartialEq)]
25518#[non_exhaustive]
25519pub struct IpMapping {
25520 /// The type of this IP address. A `PRIMARY` address is a public address that
25521 /// can accept incoming connections. A `PRIVATE` address is a private address
25522 /// that can accept incoming connections. An `OUTGOING` address is the source
25523 /// address of connections originating from the instance, if supported.
25524 pub r#type: crate::model::SqlIpAddressType,
25525
25526 /// The IP address assigned.
25527 pub ip_address: std::string::String,
25528
25529 /// The due time for this IP to be retired in
25530 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
25531 /// `2012-11-15T16:19:00.094Z`. This field is only available when
25532 /// the IP is scheduled to be retired.
25533 pub time_to_retire: std::option::Option<wkt::Timestamp>,
25534
25535 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25536}
25537
25538impl IpMapping {
25539 /// Creates a new default instance.
25540 pub fn new() -> Self {
25541 std::default::Default::default()
25542 }
25543
25544 /// Sets the value of [r#type][crate::model::IpMapping::type].
25545 ///
25546 /// # Example
25547 /// ```ignore,no_run
25548 /// # use google_cloud_sql_v1::model::IpMapping;
25549 /// use google_cloud_sql_v1::model::SqlIpAddressType;
25550 /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
25551 /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
25552 /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
25553 /// ```
25554 pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
25555 self.r#type = v.into();
25556 self
25557 }
25558
25559 /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
25560 ///
25561 /// # Example
25562 /// ```ignore,no_run
25563 /// # use google_cloud_sql_v1::model::IpMapping;
25564 /// let x = IpMapping::new().set_ip_address("example");
25565 /// ```
25566 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25567 self.ip_address = v.into();
25568 self
25569 }
25570
25571 /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
25572 ///
25573 /// # Example
25574 /// ```ignore,no_run
25575 /// # use google_cloud_sql_v1::model::IpMapping;
25576 /// use wkt::Timestamp;
25577 /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
25578 /// ```
25579 pub fn set_time_to_retire<T>(mut self, v: T) -> Self
25580 where
25581 T: std::convert::Into<wkt::Timestamp>,
25582 {
25583 self.time_to_retire = std::option::Option::Some(v.into());
25584 self
25585 }
25586
25587 /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
25588 ///
25589 /// # Example
25590 /// ```ignore,no_run
25591 /// # use google_cloud_sql_v1::model::IpMapping;
25592 /// use wkt::Timestamp;
25593 /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
25594 /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
25595 /// ```
25596 pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
25597 where
25598 T: std::convert::Into<wkt::Timestamp>,
25599 {
25600 self.time_to_retire = v.map(|x| x.into());
25601 self
25602 }
25603}
25604
25605impl wkt::message::Message for IpMapping {
25606 fn typename() -> &'static str {
25607 "type.googleapis.com/google.cloud.sql.v1.IpMapping"
25608 }
25609}
25610
25611/// The sub operation type based on the operation type.
25612#[derive(Clone, Default, PartialEq)]
25613#[non_exhaustive]
25614pub struct SqlSubOperationType {
25615 /// Sub operation details corresponding to the operation type.
25616 pub sub_operation_details:
25617 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
25618
25619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25620}
25621
25622impl SqlSubOperationType {
25623 /// Creates a new default instance.
25624 pub fn new() -> Self {
25625 std::default::Default::default()
25626 }
25627
25628 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
25629 ///
25630 /// Note that all the setters affecting `sub_operation_details` are mutually
25631 /// exclusive.
25632 ///
25633 /// # Example
25634 /// ```ignore,no_run
25635 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
25636 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
25637 /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
25638 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
25639 /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
25640 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
25641 /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
25642 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
25643 /// ```
25644 pub fn set_sub_operation_details<
25645 T: std::convert::Into<
25646 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
25647 >,
25648 >(
25649 mut self,
25650 v: T,
25651 ) -> Self {
25652 self.sub_operation_details = v.into();
25653 self
25654 }
25655
25656 /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
25657 /// if it holds a `MaintenanceType`, `None` if the field is not set or
25658 /// holds a different branch.
25659 pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
25660 #[allow(unreachable_patterns)]
25661 self.sub_operation_details.as_ref().and_then(|v| match v {
25662 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
25663 std::option::Option::Some(v)
25664 }
25665 _ => std::option::Option::None,
25666 })
25667 }
25668
25669 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
25670 /// to hold a `MaintenanceType`.
25671 ///
25672 /// Note that all the setters affecting `sub_operation_details` are
25673 /// mutually exclusive.
25674 ///
25675 /// # Example
25676 /// ```ignore,no_run
25677 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
25678 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
25679 /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
25680 /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
25681 /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
25682 /// assert!(x0.maintenance_type().is_some());
25683 /// assert!(x1.maintenance_type().is_some());
25684 /// assert!(x2.maintenance_type().is_some());
25685 /// ```
25686 pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
25687 mut self,
25688 v: T,
25689 ) -> Self {
25690 self.sub_operation_details = std::option::Option::Some(
25691 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
25692 );
25693 self
25694 }
25695}
25696
25697impl wkt::message::Message for SqlSubOperationType {
25698 fn typename() -> &'static str {
25699 "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
25700 }
25701}
25702
25703/// Defines additional types related to [SqlSubOperationType].
25704pub mod sql_sub_operation_type {
25705 #[allow(unused_imports)]
25706 use super::*;
25707
25708 /// Sub operation details corresponding to the operation type.
25709 #[derive(Clone, Debug, PartialEq)]
25710 #[non_exhaustive]
25711 pub enum SubOperationDetails {
25712 /// The type of maintenance to be performed on the instance.
25713 MaintenanceType(crate::model::SqlMaintenanceType),
25714 }
25715}
25716
25717/// An Operation resource. For successful operations that return an
25718/// Operation resource, only the fields relevant to the operation are populated
25719/// in the resource.
25720#[derive(Clone, Default, PartialEq)]
25721#[non_exhaustive]
25722pub struct Operation {
25723 /// This is always `sql#operation`.
25724 pub kind: std::string::String,
25725
25726 #[allow(missing_docs)]
25727 pub target_link: std::string::String,
25728
25729 /// The status of an operation.
25730 pub status: crate::model::operation::SqlOperationStatus,
25731
25732 /// The email address of the user who initiated this operation.
25733 pub user: std::string::String,
25734
25735 /// The time this operation was enqueued in UTC timezone in [RFC
25736 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
25737 /// `2012-11-15T16:19:00.094Z`.
25738 pub insert_time: std::option::Option<wkt::Timestamp>,
25739
25740 /// The time this operation actually started in UTC timezone in [RFC
25741 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
25742 /// `2012-11-15T16:19:00.094Z`.
25743 pub start_time: std::option::Option<wkt::Timestamp>,
25744
25745 /// The time this operation finished in UTC timezone in [RFC
25746 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
25747 /// `2012-11-15T16:19:00.094Z`.
25748 pub end_time: std::option::Option<wkt::Timestamp>,
25749
25750 /// If errors occurred during processing of this operation, this field will be
25751 /// populated.
25752 pub error: std::option::Option<crate::model::OperationErrors>,
25753
25754 /// An Admin API warning message.
25755 pub api_warning: std::option::Option<crate::model::ApiWarning>,
25756
25757 /// The type of the operation. Valid values are:
25758 ///
25759 /// * `CREATE`
25760 /// * `DELETE`
25761 /// * `UPDATE`
25762 /// * `RESTART`
25763 /// * `IMPORT`
25764 /// * `EXPORT`
25765 /// * `BACKUP_VOLUME`
25766 /// * `RESTORE_VOLUME`
25767 /// * `CREATE_USER`
25768 /// * `DELETE_USER`
25769 /// * `CREATE_DATABASE`
25770 /// * `DELETE_DATABASE`
25771 pub operation_type: crate::model::operation::SqlOperationType,
25772
25773 /// The context for import operation, if applicable.
25774 pub import_context: std::option::Option<crate::model::ImportContext>,
25775
25776 /// The context for export operation, if applicable.
25777 pub export_context: std::option::Option<crate::model::ExportContext>,
25778
25779 /// The context for backup operation, if applicable.
25780 pub backup_context: std::option::Option<crate::model::BackupContext>,
25781
25782 /// This field is only populated when the operation_type is
25783 /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
25784 /// The PreCheckMajorVersionUpgradeContext message itself contains the details
25785 /// for that pre-check, such as the target database version for the upgrade
25786 /// and the results of the check (including any warnings or errors found).
25787 pub pre_check_major_version_upgrade_context:
25788 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
25789
25790 /// An identifier that uniquely identifies the operation. You can use this
25791 /// identifier to retrieve the Operations resource that has information about
25792 /// the operation.
25793 pub name: std::string::String,
25794
25795 /// Name of the resource on which this operation runs.
25796 pub target_id: std::string::String,
25797
25798 /// The URI of this resource.
25799 pub self_link: std::string::String,
25800
25801 /// The project ID of the target instance related to this operation.
25802 pub target_project: std::string::String,
25803
25804 /// The context for acquire SSRS lease operation, if applicable.
25805 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
25806
25807 /// Optional. The sub operation based on the operation type.
25808 pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
25809
25810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25811}
25812
25813impl Operation {
25814 /// Creates a new default instance.
25815 pub fn new() -> Self {
25816 std::default::Default::default()
25817 }
25818
25819 /// Sets the value of [kind][crate::model::Operation::kind].
25820 ///
25821 /// # Example
25822 /// ```ignore,no_run
25823 /// # use google_cloud_sql_v1::model::Operation;
25824 /// let x = Operation::new().set_kind("example");
25825 /// ```
25826 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25827 self.kind = v.into();
25828 self
25829 }
25830
25831 /// Sets the value of [target_link][crate::model::Operation::target_link].
25832 ///
25833 /// # Example
25834 /// ```ignore,no_run
25835 /// # use google_cloud_sql_v1::model::Operation;
25836 /// let x = Operation::new().set_target_link("example");
25837 /// ```
25838 pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25839 self.target_link = v.into();
25840 self
25841 }
25842
25843 /// Sets the value of [status][crate::model::Operation::status].
25844 ///
25845 /// # Example
25846 /// ```ignore,no_run
25847 /// # use google_cloud_sql_v1::model::Operation;
25848 /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
25849 /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
25850 /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
25851 /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
25852 /// ```
25853 pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
25854 mut self,
25855 v: T,
25856 ) -> Self {
25857 self.status = v.into();
25858 self
25859 }
25860
25861 /// Sets the value of [user][crate::model::Operation::user].
25862 ///
25863 /// # Example
25864 /// ```ignore,no_run
25865 /// # use google_cloud_sql_v1::model::Operation;
25866 /// let x = Operation::new().set_user("example");
25867 /// ```
25868 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25869 self.user = v.into();
25870 self
25871 }
25872
25873 /// Sets the value of [insert_time][crate::model::Operation::insert_time].
25874 ///
25875 /// # Example
25876 /// ```ignore,no_run
25877 /// # use google_cloud_sql_v1::model::Operation;
25878 /// use wkt::Timestamp;
25879 /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
25880 /// ```
25881 pub fn set_insert_time<T>(mut self, v: T) -> Self
25882 where
25883 T: std::convert::Into<wkt::Timestamp>,
25884 {
25885 self.insert_time = std::option::Option::Some(v.into());
25886 self
25887 }
25888
25889 /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
25890 ///
25891 /// # Example
25892 /// ```ignore,no_run
25893 /// # use google_cloud_sql_v1::model::Operation;
25894 /// use wkt::Timestamp;
25895 /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
25896 /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
25897 /// ```
25898 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
25899 where
25900 T: std::convert::Into<wkt::Timestamp>,
25901 {
25902 self.insert_time = v.map(|x| x.into());
25903 self
25904 }
25905
25906 /// Sets the value of [start_time][crate::model::Operation::start_time].
25907 ///
25908 /// # Example
25909 /// ```ignore,no_run
25910 /// # use google_cloud_sql_v1::model::Operation;
25911 /// use wkt::Timestamp;
25912 /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
25913 /// ```
25914 pub fn set_start_time<T>(mut self, v: T) -> Self
25915 where
25916 T: std::convert::Into<wkt::Timestamp>,
25917 {
25918 self.start_time = std::option::Option::Some(v.into());
25919 self
25920 }
25921
25922 /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
25923 ///
25924 /// # Example
25925 /// ```ignore,no_run
25926 /// # use google_cloud_sql_v1::model::Operation;
25927 /// use wkt::Timestamp;
25928 /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
25929 /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
25930 /// ```
25931 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
25932 where
25933 T: std::convert::Into<wkt::Timestamp>,
25934 {
25935 self.start_time = v.map(|x| x.into());
25936 self
25937 }
25938
25939 /// Sets the value of [end_time][crate::model::Operation::end_time].
25940 ///
25941 /// # Example
25942 /// ```ignore,no_run
25943 /// # use google_cloud_sql_v1::model::Operation;
25944 /// use wkt::Timestamp;
25945 /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
25946 /// ```
25947 pub fn set_end_time<T>(mut self, v: T) -> Self
25948 where
25949 T: std::convert::Into<wkt::Timestamp>,
25950 {
25951 self.end_time = std::option::Option::Some(v.into());
25952 self
25953 }
25954
25955 /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
25956 ///
25957 /// # Example
25958 /// ```ignore,no_run
25959 /// # use google_cloud_sql_v1::model::Operation;
25960 /// use wkt::Timestamp;
25961 /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
25962 /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
25963 /// ```
25964 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
25965 where
25966 T: std::convert::Into<wkt::Timestamp>,
25967 {
25968 self.end_time = v.map(|x| x.into());
25969 self
25970 }
25971
25972 /// Sets the value of [error][crate::model::Operation::error].
25973 ///
25974 /// # Example
25975 /// ```ignore,no_run
25976 /// # use google_cloud_sql_v1::model::Operation;
25977 /// use google_cloud_sql_v1::model::OperationErrors;
25978 /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
25979 /// ```
25980 pub fn set_error<T>(mut self, v: T) -> Self
25981 where
25982 T: std::convert::Into<crate::model::OperationErrors>,
25983 {
25984 self.error = std::option::Option::Some(v.into());
25985 self
25986 }
25987
25988 /// Sets or clears the value of [error][crate::model::Operation::error].
25989 ///
25990 /// # Example
25991 /// ```ignore,no_run
25992 /// # use google_cloud_sql_v1::model::Operation;
25993 /// use google_cloud_sql_v1::model::OperationErrors;
25994 /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
25995 /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
25996 /// ```
25997 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
25998 where
25999 T: std::convert::Into<crate::model::OperationErrors>,
26000 {
26001 self.error = v.map(|x| x.into());
26002 self
26003 }
26004
26005 /// Sets the value of [api_warning][crate::model::Operation::api_warning].
26006 ///
26007 /// # Example
26008 /// ```ignore,no_run
26009 /// # use google_cloud_sql_v1::model::Operation;
26010 /// use google_cloud_sql_v1::model::ApiWarning;
26011 /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
26012 /// ```
26013 pub fn set_api_warning<T>(mut self, v: T) -> Self
26014 where
26015 T: std::convert::Into<crate::model::ApiWarning>,
26016 {
26017 self.api_warning = std::option::Option::Some(v.into());
26018 self
26019 }
26020
26021 /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
26022 ///
26023 /// # Example
26024 /// ```ignore,no_run
26025 /// # use google_cloud_sql_v1::model::Operation;
26026 /// use google_cloud_sql_v1::model::ApiWarning;
26027 /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
26028 /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
26029 /// ```
26030 pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
26031 where
26032 T: std::convert::Into<crate::model::ApiWarning>,
26033 {
26034 self.api_warning = v.map(|x| x.into());
26035 self
26036 }
26037
26038 /// Sets the value of [operation_type][crate::model::Operation::operation_type].
26039 ///
26040 /// # Example
26041 /// ```ignore,no_run
26042 /// # use google_cloud_sql_v1::model::Operation;
26043 /// use google_cloud_sql_v1::model::operation::SqlOperationType;
26044 /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
26045 /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
26046 /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
26047 /// ```
26048 pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
26049 mut self,
26050 v: T,
26051 ) -> Self {
26052 self.operation_type = v.into();
26053 self
26054 }
26055
26056 /// Sets the value of [import_context][crate::model::Operation::import_context].
26057 ///
26058 /// # Example
26059 /// ```ignore,no_run
26060 /// # use google_cloud_sql_v1::model::Operation;
26061 /// use google_cloud_sql_v1::model::ImportContext;
26062 /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
26063 /// ```
26064 pub fn set_import_context<T>(mut self, v: T) -> Self
26065 where
26066 T: std::convert::Into<crate::model::ImportContext>,
26067 {
26068 self.import_context = std::option::Option::Some(v.into());
26069 self
26070 }
26071
26072 /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
26073 ///
26074 /// # Example
26075 /// ```ignore,no_run
26076 /// # use google_cloud_sql_v1::model::Operation;
26077 /// use google_cloud_sql_v1::model::ImportContext;
26078 /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
26079 /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
26080 /// ```
26081 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
26082 where
26083 T: std::convert::Into<crate::model::ImportContext>,
26084 {
26085 self.import_context = v.map(|x| x.into());
26086 self
26087 }
26088
26089 /// Sets the value of [export_context][crate::model::Operation::export_context].
26090 ///
26091 /// # Example
26092 /// ```ignore,no_run
26093 /// # use google_cloud_sql_v1::model::Operation;
26094 /// use google_cloud_sql_v1::model::ExportContext;
26095 /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
26096 /// ```
26097 pub fn set_export_context<T>(mut self, v: T) -> Self
26098 where
26099 T: std::convert::Into<crate::model::ExportContext>,
26100 {
26101 self.export_context = std::option::Option::Some(v.into());
26102 self
26103 }
26104
26105 /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
26106 ///
26107 /// # Example
26108 /// ```ignore,no_run
26109 /// # use google_cloud_sql_v1::model::Operation;
26110 /// use google_cloud_sql_v1::model::ExportContext;
26111 /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
26112 /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
26113 /// ```
26114 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
26115 where
26116 T: std::convert::Into<crate::model::ExportContext>,
26117 {
26118 self.export_context = v.map(|x| x.into());
26119 self
26120 }
26121
26122 /// Sets the value of [backup_context][crate::model::Operation::backup_context].
26123 ///
26124 /// # Example
26125 /// ```ignore,no_run
26126 /// # use google_cloud_sql_v1::model::Operation;
26127 /// use google_cloud_sql_v1::model::BackupContext;
26128 /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
26129 /// ```
26130 pub fn set_backup_context<T>(mut self, v: T) -> Self
26131 where
26132 T: std::convert::Into<crate::model::BackupContext>,
26133 {
26134 self.backup_context = std::option::Option::Some(v.into());
26135 self
26136 }
26137
26138 /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
26139 ///
26140 /// # Example
26141 /// ```ignore,no_run
26142 /// # use google_cloud_sql_v1::model::Operation;
26143 /// use google_cloud_sql_v1::model::BackupContext;
26144 /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
26145 /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
26146 /// ```
26147 pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
26148 where
26149 T: std::convert::Into<crate::model::BackupContext>,
26150 {
26151 self.backup_context = v.map(|x| x.into());
26152 self
26153 }
26154
26155 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
26156 ///
26157 /// # Example
26158 /// ```ignore,no_run
26159 /// # use google_cloud_sql_v1::model::Operation;
26160 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
26161 /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
26162 /// ```
26163 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
26164 where
26165 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
26166 {
26167 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
26168 self
26169 }
26170
26171 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
26172 ///
26173 /// # Example
26174 /// ```ignore,no_run
26175 /// # use google_cloud_sql_v1::model::Operation;
26176 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
26177 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
26178 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
26179 /// ```
26180 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
26181 mut self,
26182 v: std::option::Option<T>,
26183 ) -> Self
26184 where
26185 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
26186 {
26187 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
26188 self
26189 }
26190
26191 /// Sets the value of [name][crate::model::Operation::name].
26192 ///
26193 /// # Example
26194 /// ```ignore,no_run
26195 /// # use google_cloud_sql_v1::model::Operation;
26196 /// let x = Operation::new().set_name("example");
26197 /// ```
26198 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26199 self.name = v.into();
26200 self
26201 }
26202
26203 /// Sets the value of [target_id][crate::model::Operation::target_id].
26204 ///
26205 /// # Example
26206 /// ```ignore,no_run
26207 /// # use google_cloud_sql_v1::model::Operation;
26208 /// let x = Operation::new().set_target_id("example");
26209 /// ```
26210 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26211 self.target_id = v.into();
26212 self
26213 }
26214
26215 /// Sets the value of [self_link][crate::model::Operation::self_link].
26216 ///
26217 /// # Example
26218 /// ```ignore,no_run
26219 /// # use google_cloud_sql_v1::model::Operation;
26220 /// let x = Operation::new().set_self_link("example");
26221 /// ```
26222 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26223 self.self_link = v.into();
26224 self
26225 }
26226
26227 /// Sets the value of [target_project][crate::model::Operation::target_project].
26228 ///
26229 /// # Example
26230 /// ```ignore,no_run
26231 /// # use google_cloud_sql_v1::model::Operation;
26232 /// let x = Operation::new().set_target_project("example");
26233 /// ```
26234 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26235 self.target_project = v.into();
26236 self
26237 }
26238
26239 /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
26240 ///
26241 /// # Example
26242 /// ```ignore,no_run
26243 /// # use google_cloud_sql_v1::model::Operation;
26244 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
26245 /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
26246 /// ```
26247 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
26248 where
26249 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
26250 {
26251 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
26252 self
26253 }
26254
26255 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
26256 ///
26257 /// # Example
26258 /// ```ignore,no_run
26259 /// # use google_cloud_sql_v1::model::Operation;
26260 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
26261 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
26262 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
26263 /// ```
26264 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
26265 where
26266 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
26267 {
26268 self.acquire_ssrs_lease_context = v.map(|x| x.into());
26269 self
26270 }
26271
26272 /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
26273 ///
26274 /// # Example
26275 /// ```ignore,no_run
26276 /// # use google_cloud_sql_v1::model::Operation;
26277 /// use google_cloud_sql_v1::model::SqlSubOperationType;
26278 /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
26279 /// ```
26280 pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
26281 where
26282 T: std::convert::Into<crate::model::SqlSubOperationType>,
26283 {
26284 self.sub_operation_type = std::option::Option::Some(v.into());
26285 self
26286 }
26287
26288 /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
26289 ///
26290 /// # Example
26291 /// ```ignore,no_run
26292 /// # use google_cloud_sql_v1::model::Operation;
26293 /// use google_cloud_sql_v1::model::SqlSubOperationType;
26294 /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
26295 /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
26296 /// ```
26297 pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
26298 where
26299 T: std::convert::Into<crate::model::SqlSubOperationType>,
26300 {
26301 self.sub_operation_type = v.map(|x| x.into());
26302 self
26303 }
26304}
26305
26306impl wkt::message::Message for Operation {
26307 fn typename() -> &'static str {
26308 "type.googleapis.com/google.cloud.sql.v1.Operation"
26309 }
26310}
26311
26312/// Defines additional types related to [Operation].
26313pub mod operation {
26314 #[allow(unused_imports)]
26315 use super::*;
26316
26317 /// The type of Cloud SQL operation.
26318 ///
26319 /// # Working with unknown values
26320 ///
26321 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26322 /// additional enum variants at any time. Adding new variants is not considered
26323 /// a breaking change. Applications should write their code in anticipation of:
26324 ///
26325 /// - New values appearing in future releases of the client library, **and**
26326 /// - New values received dynamically, without application changes.
26327 ///
26328 /// Please consult the [Working with enums] section in the user guide for some
26329 /// guidelines.
26330 ///
26331 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26332 #[derive(Clone, Debug, PartialEq)]
26333 #[non_exhaustive]
26334 pub enum SqlOperationType {
26335 /// Unknown operation type.
26336 Unspecified,
26337 /// Imports data into a Cloud SQL instance.
26338 Import,
26339 /// Exports data from a Cloud SQL instance to a Cloud Storage
26340 /// bucket.
26341 Export,
26342 /// Creates a new Cloud SQL instance.
26343 Create,
26344 /// Updates the settings of a Cloud SQL instance.
26345 Update,
26346 /// Deletes a Cloud SQL instance.
26347 Delete,
26348 /// Restarts the Cloud SQL instance.
26349 Restart,
26350 #[allow(missing_docs)]
26351 #[deprecated]
26352 Backup,
26353 #[allow(missing_docs)]
26354 #[deprecated]
26355 Snapshot,
26356 /// Performs instance backup.
26357 BackupVolume,
26358 /// Deletes an instance backup.
26359 DeleteVolume,
26360 /// Restores an instance backup.
26361 RestoreVolume,
26362 /// Injects a privileged user in mysql for MOB instances.
26363 InjectUser,
26364 /// Clones a Cloud SQL instance.
26365 Clone,
26366 /// Stops replication on a Cloud SQL read replica instance.
26367 StopReplica,
26368 /// Starts replication on a Cloud SQL read replica instance.
26369 StartReplica,
26370 /// Promotes a Cloud SQL replica instance.
26371 PromoteReplica,
26372 /// Creates a Cloud SQL replica instance.
26373 CreateReplica,
26374 /// Creates a new user in a Cloud SQL instance.
26375 CreateUser,
26376 /// Deletes a user from a Cloud SQL instance.
26377 DeleteUser,
26378 /// Updates an existing user in a Cloud SQL instance. If a user with the
26379 /// specified username doesn't exist, a new user is created.
26380 UpdateUser,
26381 /// Creates a database in the Cloud SQL instance.
26382 CreateDatabase,
26383 /// Deletes a database in the Cloud SQL instance.
26384 DeleteDatabase,
26385 /// Updates a database in the Cloud SQL instance.
26386 UpdateDatabase,
26387 /// Performs failover of an HA-enabled Cloud SQL
26388 /// failover replica.
26389 Failover,
26390 /// Deletes the backup taken by a backup run.
26391 DeleteBackup,
26392 #[allow(missing_docs)]
26393 RecreateReplica,
26394 /// Truncates a general or slow log table in MySQL.
26395 TruncateLog,
26396 /// Demotes the stand-alone instance to be a Cloud SQL
26397 /// read replica for an external database server.
26398 DemoteMaster,
26399 /// Indicates that the instance is currently in maintenance. Maintenance
26400 /// typically causes the instance to be unavailable for 1-3 minutes.
26401 Maintenance,
26402 /// This field is deprecated, and will be removed in future version of API.
26403 #[deprecated]
26404 EnablePrivateIp,
26405 #[allow(missing_docs)]
26406 #[deprecated]
26407 DeferMaintenance,
26408 /// Creates clone instance.
26409 #[deprecated]
26410 CreateClone,
26411 /// Reschedule maintenance to another time.
26412 RescheduleMaintenance,
26413 /// Starts external sync of a Cloud SQL EM replica to an external primary
26414 /// instance.
26415 StartExternalSync,
26416 /// Recovers logs from an instance's old data disk.
26417 LogCleanup,
26418 /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
26419 /// recovery.
26420 AutoRestart,
26421 /// Re-encrypts CMEK instances with latest key version.
26422 Reencrypt,
26423 /// Switches the roles of the primary and replica pair. The target instance
26424 /// should be the replica.
26425 Switchover,
26426 /// Update a backup.
26427 UpdateBackup,
26428 /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
26429 AcquireSsrsLease,
26430 /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
26431 ReleaseSsrsLease,
26432 /// Reconfigures old primary after a promote replica operation. Effect of a
26433 /// promote operation to the old primary is executed in this operation,
26434 /// asynchronously from the promote replica operation executed to the
26435 /// replica.
26436 ReconfigureOldPrimary,
26437 /// Indicates that the instance, its read replicas, and its cascading
26438 /// replicas are in maintenance. Maintenance typically gets initiated on
26439 /// groups of replicas first, followed by the primary instance. For each
26440 /// instance, maintenance typically causes the instance to be unavailable for
26441 /// 1-3 minutes.
26442 #[deprecated]
26443 ClusterMaintenance,
26444 /// Indicates that the instance (and any of its replicas) are currently in
26445 /// maintenance. This is initiated as a self-service request by using SSM.
26446 /// Maintenance typically causes the instance to be unavailable for 1-3
26447 /// minutes.
26448 #[deprecated]
26449 SelfServiceMaintenance,
26450 /// Switches a primary instance to a replica. This operation runs as part of
26451 /// a switchover operation to the original primary instance.
26452 SwitchoverToReplica,
26453 /// Updates the major version of a Cloud SQL instance.
26454 MajorVersionUpgrade,
26455 /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
26456 #[deprecated]
26457 AdvancedBackup,
26458 /// Changes the BackupTier of a Cloud SQL instance.
26459 ManageBackup,
26460 /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
26461 EnhancedBackup,
26462 /// Repairs entire read pool or specified read pool nodes in the read pool.
26463 RepairReadPool,
26464 /// Creates a Cloud SQL read pool instance.
26465 CreateReadPool,
26466 /// Pre-checks the major version upgrade operation.
26467 PreCheckMajorVersionUpgrade,
26468 /// This operation type represents individual steps in a multi-step setup
26469 /// migration workflow: including configuration, replication,
26470 /// switchover/back, and data reseeding, as defined by operation's intent.
26471 SetupMigration,
26472 /// If set, the enum was initialized with an unknown value.
26473 ///
26474 /// Applications can examine the value using [SqlOperationType::value] or
26475 /// [SqlOperationType::name].
26476 UnknownValue(sql_operation_type::UnknownValue),
26477 }
26478
26479 #[doc(hidden)]
26480 pub mod sql_operation_type {
26481 #[allow(unused_imports)]
26482 use super::*;
26483 #[derive(Clone, Debug, PartialEq)]
26484 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26485 }
26486
26487 impl SqlOperationType {
26488 /// Gets the enum value.
26489 ///
26490 /// Returns `None` if the enum contains an unknown value deserialized from
26491 /// the string representation of enums.
26492 pub fn value(&self) -> std::option::Option<i32> {
26493 match self {
26494 Self::Unspecified => std::option::Option::Some(0),
26495 Self::Import => std::option::Option::Some(1),
26496 Self::Export => std::option::Option::Some(2),
26497 Self::Create => std::option::Option::Some(3),
26498 Self::Update => std::option::Option::Some(4),
26499 Self::Delete => std::option::Option::Some(5),
26500 Self::Restart => std::option::Option::Some(6),
26501 Self::Backup => std::option::Option::Some(7),
26502 Self::Snapshot => std::option::Option::Some(8),
26503 Self::BackupVolume => std::option::Option::Some(9),
26504 Self::DeleteVolume => std::option::Option::Some(10),
26505 Self::RestoreVolume => std::option::Option::Some(11),
26506 Self::InjectUser => std::option::Option::Some(12),
26507 Self::Clone => std::option::Option::Some(14),
26508 Self::StopReplica => std::option::Option::Some(15),
26509 Self::StartReplica => std::option::Option::Some(16),
26510 Self::PromoteReplica => std::option::Option::Some(17),
26511 Self::CreateReplica => std::option::Option::Some(18),
26512 Self::CreateUser => std::option::Option::Some(19),
26513 Self::DeleteUser => std::option::Option::Some(20),
26514 Self::UpdateUser => std::option::Option::Some(21),
26515 Self::CreateDatabase => std::option::Option::Some(22),
26516 Self::DeleteDatabase => std::option::Option::Some(23),
26517 Self::UpdateDatabase => std::option::Option::Some(24),
26518 Self::Failover => std::option::Option::Some(25),
26519 Self::DeleteBackup => std::option::Option::Some(26),
26520 Self::RecreateReplica => std::option::Option::Some(27),
26521 Self::TruncateLog => std::option::Option::Some(28),
26522 Self::DemoteMaster => std::option::Option::Some(29),
26523 Self::Maintenance => std::option::Option::Some(30),
26524 Self::EnablePrivateIp => std::option::Option::Some(31),
26525 Self::DeferMaintenance => std::option::Option::Some(32),
26526 Self::CreateClone => std::option::Option::Some(33),
26527 Self::RescheduleMaintenance => std::option::Option::Some(34),
26528 Self::StartExternalSync => std::option::Option::Some(35),
26529 Self::LogCleanup => std::option::Option::Some(36),
26530 Self::AutoRestart => std::option::Option::Some(37),
26531 Self::Reencrypt => std::option::Option::Some(38),
26532 Self::Switchover => std::option::Option::Some(39),
26533 Self::UpdateBackup => std::option::Option::Some(40),
26534 Self::AcquireSsrsLease => std::option::Option::Some(42),
26535 Self::ReleaseSsrsLease => std::option::Option::Some(43),
26536 Self::ReconfigureOldPrimary => std::option::Option::Some(44),
26537 Self::ClusterMaintenance => std::option::Option::Some(45),
26538 Self::SelfServiceMaintenance => std::option::Option::Some(46),
26539 Self::SwitchoverToReplica => std::option::Option::Some(47),
26540 Self::MajorVersionUpgrade => std::option::Option::Some(48),
26541 Self::AdvancedBackup => std::option::Option::Some(49),
26542 Self::ManageBackup => std::option::Option::Some(50),
26543 Self::EnhancedBackup => std::option::Option::Some(51),
26544 Self::RepairReadPool => std::option::Option::Some(52),
26545 Self::CreateReadPool => std::option::Option::Some(53),
26546 Self::PreCheckMajorVersionUpgrade => std::option::Option::Some(54),
26547 Self::SetupMigration => std::option::Option::Some(55),
26548 Self::UnknownValue(u) => u.0.value(),
26549 }
26550 }
26551
26552 /// Gets the enum value as a string.
26553 ///
26554 /// Returns `None` if the enum contains an unknown value deserialized from
26555 /// the integer representation of enums.
26556 pub fn name(&self) -> std::option::Option<&str> {
26557 match self {
26558 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
26559 Self::Import => std::option::Option::Some("IMPORT"),
26560 Self::Export => std::option::Option::Some("EXPORT"),
26561 Self::Create => std::option::Option::Some("CREATE"),
26562 Self::Update => std::option::Option::Some("UPDATE"),
26563 Self::Delete => std::option::Option::Some("DELETE"),
26564 Self::Restart => std::option::Option::Some("RESTART"),
26565 Self::Backup => std::option::Option::Some("BACKUP"),
26566 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
26567 Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
26568 Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
26569 Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
26570 Self::InjectUser => std::option::Option::Some("INJECT_USER"),
26571 Self::Clone => std::option::Option::Some("CLONE"),
26572 Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
26573 Self::StartReplica => std::option::Option::Some("START_REPLICA"),
26574 Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
26575 Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
26576 Self::CreateUser => std::option::Option::Some("CREATE_USER"),
26577 Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
26578 Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
26579 Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
26580 Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
26581 Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
26582 Self::Failover => std::option::Option::Some("FAILOVER"),
26583 Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
26584 Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
26585 Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
26586 Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
26587 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
26588 Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
26589 Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
26590 Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
26591 Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
26592 Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
26593 Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
26594 Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
26595 Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
26596 Self::Switchover => std::option::Option::Some("SWITCHOVER"),
26597 Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
26598 Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
26599 Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
26600 Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
26601 Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
26602 Self::SelfServiceMaintenance => {
26603 std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
26604 }
26605 Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
26606 Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
26607 Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
26608 Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
26609 Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
26610 Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
26611 Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
26612 Self::PreCheckMajorVersionUpgrade => {
26613 std::option::Option::Some("PRE_CHECK_MAJOR_VERSION_UPGRADE")
26614 }
26615 Self::SetupMigration => std::option::Option::Some("SETUP_MIGRATION"),
26616 Self::UnknownValue(u) => u.0.name(),
26617 }
26618 }
26619 }
26620
26621 impl std::default::Default for SqlOperationType {
26622 fn default() -> Self {
26623 use std::convert::From;
26624 Self::from(0)
26625 }
26626 }
26627
26628 impl std::fmt::Display for SqlOperationType {
26629 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26630 wkt::internal::display_enum(f, self.name(), self.value())
26631 }
26632 }
26633
26634 impl std::convert::From<i32> for SqlOperationType {
26635 fn from(value: i32) -> Self {
26636 match value {
26637 0 => Self::Unspecified,
26638 1 => Self::Import,
26639 2 => Self::Export,
26640 3 => Self::Create,
26641 4 => Self::Update,
26642 5 => Self::Delete,
26643 6 => Self::Restart,
26644 7 => Self::Backup,
26645 8 => Self::Snapshot,
26646 9 => Self::BackupVolume,
26647 10 => Self::DeleteVolume,
26648 11 => Self::RestoreVolume,
26649 12 => Self::InjectUser,
26650 14 => Self::Clone,
26651 15 => Self::StopReplica,
26652 16 => Self::StartReplica,
26653 17 => Self::PromoteReplica,
26654 18 => Self::CreateReplica,
26655 19 => Self::CreateUser,
26656 20 => Self::DeleteUser,
26657 21 => Self::UpdateUser,
26658 22 => Self::CreateDatabase,
26659 23 => Self::DeleteDatabase,
26660 24 => Self::UpdateDatabase,
26661 25 => Self::Failover,
26662 26 => Self::DeleteBackup,
26663 27 => Self::RecreateReplica,
26664 28 => Self::TruncateLog,
26665 29 => Self::DemoteMaster,
26666 30 => Self::Maintenance,
26667 31 => Self::EnablePrivateIp,
26668 32 => Self::DeferMaintenance,
26669 33 => Self::CreateClone,
26670 34 => Self::RescheduleMaintenance,
26671 35 => Self::StartExternalSync,
26672 36 => Self::LogCleanup,
26673 37 => Self::AutoRestart,
26674 38 => Self::Reencrypt,
26675 39 => Self::Switchover,
26676 40 => Self::UpdateBackup,
26677 42 => Self::AcquireSsrsLease,
26678 43 => Self::ReleaseSsrsLease,
26679 44 => Self::ReconfigureOldPrimary,
26680 45 => Self::ClusterMaintenance,
26681 46 => Self::SelfServiceMaintenance,
26682 47 => Self::SwitchoverToReplica,
26683 48 => Self::MajorVersionUpgrade,
26684 49 => Self::AdvancedBackup,
26685 50 => Self::ManageBackup,
26686 51 => Self::EnhancedBackup,
26687 52 => Self::RepairReadPool,
26688 53 => Self::CreateReadPool,
26689 54 => Self::PreCheckMajorVersionUpgrade,
26690 55 => Self::SetupMigration,
26691 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
26692 wkt::internal::UnknownEnumValue::Integer(value),
26693 )),
26694 }
26695 }
26696 }
26697
26698 impl std::convert::From<&str> for SqlOperationType {
26699 fn from(value: &str) -> Self {
26700 use std::string::ToString;
26701 match value {
26702 "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
26703 "IMPORT" => Self::Import,
26704 "EXPORT" => Self::Export,
26705 "CREATE" => Self::Create,
26706 "UPDATE" => Self::Update,
26707 "DELETE" => Self::Delete,
26708 "RESTART" => Self::Restart,
26709 "BACKUP" => Self::Backup,
26710 "SNAPSHOT" => Self::Snapshot,
26711 "BACKUP_VOLUME" => Self::BackupVolume,
26712 "DELETE_VOLUME" => Self::DeleteVolume,
26713 "RESTORE_VOLUME" => Self::RestoreVolume,
26714 "INJECT_USER" => Self::InjectUser,
26715 "CLONE" => Self::Clone,
26716 "STOP_REPLICA" => Self::StopReplica,
26717 "START_REPLICA" => Self::StartReplica,
26718 "PROMOTE_REPLICA" => Self::PromoteReplica,
26719 "CREATE_REPLICA" => Self::CreateReplica,
26720 "CREATE_USER" => Self::CreateUser,
26721 "DELETE_USER" => Self::DeleteUser,
26722 "UPDATE_USER" => Self::UpdateUser,
26723 "CREATE_DATABASE" => Self::CreateDatabase,
26724 "DELETE_DATABASE" => Self::DeleteDatabase,
26725 "UPDATE_DATABASE" => Self::UpdateDatabase,
26726 "FAILOVER" => Self::Failover,
26727 "DELETE_BACKUP" => Self::DeleteBackup,
26728 "RECREATE_REPLICA" => Self::RecreateReplica,
26729 "TRUNCATE_LOG" => Self::TruncateLog,
26730 "DEMOTE_MASTER" => Self::DemoteMaster,
26731 "MAINTENANCE" => Self::Maintenance,
26732 "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
26733 "DEFER_MAINTENANCE" => Self::DeferMaintenance,
26734 "CREATE_CLONE" => Self::CreateClone,
26735 "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
26736 "START_EXTERNAL_SYNC" => Self::StartExternalSync,
26737 "LOG_CLEANUP" => Self::LogCleanup,
26738 "AUTO_RESTART" => Self::AutoRestart,
26739 "REENCRYPT" => Self::Reencrypt,
26740 "SWITCHOVER" => Self::Switchover,
26741 "UPDATE_BACKUP" => Self::UpdateBackup,
26742 "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
26743 "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
26744 "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
26745 "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
26746 "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
26747 "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
26748 "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
26749 "ADVANCED_BACKUP" => Self::AdvancedBackup,
26750 "MANAGE_BACKUP" => Self::ManageBackup,
26751 "ENHANCED_BACKUP" => Self::EnhancedBackup,
26752 "REPAIR_READ_POOL" => Self::RepairReadPool,
26753 "CREATE_READ_POOL" => Self::CreateReadPool,
26754 "PRE_CHECK_MAJOR_VERSION_UPGRADE" => Self::PreCheckMajorVersionUpgrade,
26755 "SETUP_MIGRATION" => Self::SetupMigration,
26756 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
26757 wkt::internal::UnknownEnumValue::String(value.to_string()),
26758 )),
26759 }
26760 }
26761 }
26762
26763 impl serde::ser::Serialize for SqlOperationType {
26764 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26765 where
26766 S: serde::Serializer,
26767 {
26768 match self {
26769 Self::Unspecified => serializer.serialize_i32(0),
26770 Self::Import => serializer.serialize_i32(1),
26771 Self::Export => serializer.serialize_i32(2),
26772 Self::Create => serializer.serialize_i32(3),
26773 Self::Update => serializer.serialize_i32(4),
26774 Self::Delete => serializer.serialize_i32(5),
26775 Self::Restart => serializer.serialize_i32(6),
26776 Self::Backup => serializer.serialize_i32(7),
26777 Self::Snapshot => serializer.serialize_i32(8),
26778 Self::BackupVolume => serializer.serialize_i32(9),
26779 Self::DeleteVolume => serializer.serialize_i32(10),
26780 Self::RestoreVolume => serializer.serialize_i32(11),
26781 Self::InjectUser => serializer.serialize_i32(12),
26782 Self::Clone => serializer.serialize_i32(14),
26783 Self::StopReplica => serializer.serialize_i32(15),
26784 Self::StartReplica => serializer.serialize_i32(16),
26785 Self::PromoteReplica => serializer.serialize_i32(17),
26786 Self::CreateReplica => serializer.serialize_i32(18),
26787 Self::CreateUser => serializer.serialize_i32(19),
26788 Self::DeleteUser => serializer.serialize_i32(20),
26789 Self::UpdateUser => serializer.serialize_i32(21),
26790 Self::CreateDatabase => serializer.serialize_i32(22),
26791 Self::DeleteDatabase => serializer.serialize_i32(23),
26792 Self::UpdateDatabase => serializer.serialize_i32(24),
26793 Self::Failover => serializer.serialize_i32(25),
26794 Self::DeleteBackup => serializer.serialize_i32(26),
26795 Self::RecreateReplica => serializer.serialize_i32(27),
26796 Self::TruncateLog => serializer.serialize_i32(28),
26797 Self::DemoteMaster => serializer.serialize_i32(29),
26798 Self::Maintenance => serializer.serialize_i32(30),
26799 Self::EnablePrivateIp => serializer.serialize_i32(31),
26800 Self::DeferMaintenance => serializer.serialize_i32(32),
26801 Self::CreateClone => serializer.serialize_i32(33),
26802 Self::RescheduleMaintenance => serializer.serialize_i32(34),
26803 Self::StartExternalSync => serializer.serialize_i32(35),
26804 Self::LogCleanup => serializer.serialize_i32(36),
26805 Self::AutoRestart => serializer.serialize_i32(37),
26806 Self::Reencrypt => serializer.serialize_i32(38),
26807 Self::Switchover => serializer.serialize_i32(39),
26808 Self::UpdateBackup => serializer.serialize_i32(40),
26809 Self::AcquireSsrsLease => serializer.serialize_i32(42),
26810 Self::ReleaseSsrsLease => serializer.serialize_i32(43),
26811 Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
26812 Self::ClusterMaintenance => serializer.serialize_i32(45),
26813 Self::SelfServiceMaintenance => serializer.serialize_i32(46),
26814 Self::SwitchoverToReplica => serializer.serialize_i32(47),
26815 Self::MajorVersionUpgrade => serializer.serialize_i32(48),
26816 Self::AdvancedBackup => serializer.serialize_i32(49),
26817 Self::ManageBackup => serializer.serialize_i32(50),
26818 Self::EnhancedBackup => serializer.serialize_i32(51),
26819 Self::RepairReadPool => serializer.serialize_i32(52),
26820 Self::CreateReadPool => serializer.serialize_i32(53),
26821 Self::PreCheckMajorVersionUpgrade => serializer.serialize_i32(54),
26822 Self::SetupMigration => serializer.serialize_i32(55),
26823 Self::UnknownValue(u) => u.0.serialize(serializer),
26824 }
26825 }
26826 }
26827
26828 impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
26829 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26830 where
26831 D: serde::Deserializer<'de>,
26832 {
26833 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
26834 ".google.cloud.sql.v1.Operation.SqlOperationType",
26835 ))
26836 }
26837 }
26838
26839 /// The status of an operation.
26840 ///
26841 /// # Working with unknown values
26842 ///
26843 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
26844 /// additional enum variants at any time. Adding new variants is not considered
26845 /// a breaking change. Applications should write their code in anticipation of:
26846 ///
26847 /// - New values appearing in future releases of the client library, **and**
26848 /// - New values received dynamically, without application changes.
26849 ///
26850 /// Please consult the [Working with enums] section in the user guide for some
26851 /// guidelines.
26852 ///
26853 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
26854 #[derive(Clone, Debug, PartialEq)]
26855 #[non_exhaustive]
26856 pub enum SqlOperationStatus {
26857 /// The state of the operation is unknown.
26858 Unspecified,
26859 /// The operation has been queued, but has not started yet.
26860 Pending,
26861 /// The operation is running.
26862 Running,
26863 /// The operation completed.
26864 Done,
26865 /// If set, the enum was initialized with an unknown value.
26866 ///
26867 /// Applications can examine the value using [SqlOperationStatus::value] or
26868 /// [SqlOperationStatus::name].
26869 UnknownValue(sql_operation_status::UnknownValue),
26870 }
26871
26872 #[doc(hidden)]
26873 pub mod sql_operation_status {
26874 #[allow(unused_imports)]
26875 use super::*;
26876 #[derive(Clone, Debug, PartialEq)]
26877 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
26878 }
26879
26880 impl SqlOperationStatus {
26881 /// Gets the enum value.
26882 ///
26883 /// Returns `None` if the enum contains an unknown value deserialized from
26884 /// the string representation of enums.
26885 pub fn value(&self) -> std::option::Option<i32> {
26886 match self {
26887 Self::Unspecified => std::option::Option::Some(0),
26888 Self::Pending => std::option::Option::Some(1),
26889 Self::Running => std::option::Option::Some(2),
26890 Self::Done => std::option::Option::Some(3),
26891 Self::UnknownValue(u) => u.0.value(),
26892 }
26893 }
26894
26895 /// Gets the enum value as a string.
26896 ///
26897 /// Returns `None` if the enum contains an unknown value deserialized from
26898 /// the integer representation of enums.
26899 pub fn name(&self) -> std::option::Option<&str> {
26900 match self {
26901 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
26902 Self::Pending => std::option::Option::Some("PENDING"),
26903 Self::Running => std::option::Option::Some("RUNNING"),
26904 Self::Done => std::option::Option::Some("DONE"),
26905 Self::UnknownValue(u) => u.0.name(),
26906 }
26907 }
26908 }
26909
26910 impl std::default::Default for SqlOperationStatus {
26911 fn default() -> Self {
26912 use std::convert::From;
26913 Self::from(0)
26914 }
26915 }
26916
26917 impl std::fmt::Display for SqlOperationStatus {
26918 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
26919 wkt::internal::display_enum(f, self.name(), self.value())
26920 }
26921 }
26922
26923 impl std::convert::From<i32> for SqlOperationStatus {
26924 fn from(value: i32) -> Self {
26925 match value {
26926 0 => Self::Unspecified,
26927 1 => Self::Pending,
26928 2 => Self::Running,
26929 3 => Self::Done,
26930 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
26931 wkt::internal::UnknownEnumValue::Integer(value),
26932 )),
26933 }
26934 }
26935 }
26936
26937 impl std::convert::From<&str> for SqlOperationStatus {
26938 fn from(value: &str) -> Self {
26939 use std::string::ToString;
26940 match value {
26941 "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
26942 "PENDING" => Self::Pending,
26943 "RUNNING" => Self::Running,
26944 "DONE" => Self::Done,
26945 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
26946 wkt::internal::UnknownEnumValue::String(value.to_string()),
26947 )),
26948 }
26949 }
26950 }
26951
26952 impl serde::ser::Serialize for SqlOperationStatus {
26953 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
26954 where
26955 S: serde::Serializer,
26956 {
26957 match self {
26958 Self::Unspecified => serializer.serialize_i32(0),
26959 Self::Pending => serializer.serialize_i32(1),
26960 Self::Running => serializer.serialize_i32(2),
26961 Self::Done => serializer.serialize_i32(3),
26962 Self::UnknownValue(u) => u.0.serialize(serializer),
26963 }
26964 }
26965 }
26966
26967 impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
26968 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
26969 where
26970 D: serde::Deserializer<'de>,
26971 {
26972 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
26973 ".google.cloud.sql.v1.Operation.SqlOperationStatus",
26974 ))
26975 }
26976 }
26977}
26978
26979/// Database instance operation error.
26980#[derive(Clone, Default, PartialEq)]
26981#[non_exhaustive]
26982pub struct OperationError {
26983 /// This is always `sql#operationError`.
26984 pub kind: std::string::String,
26985
26986 /// Identifies the specific error that occurred.
26987 pub code: std::string::String,
26988
26989 /// Additional information about the error encountered.
26990 pub message: std::string::String,
26991
26992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26993}
26994
26995impl OperationError {
26996 /// Creates a new default instance.
26997 pub fn new() -> Self {
26998 std::default::Default::default()
26999 }
27000
27001 /// Sets the value of [kind][crate::model::OperationError::kind].
27002 ///
27003 /// # Example
27004 /// ```ignore,no_run
27005 /// # use google_cloud_sql_v1::model::OperationError;
27006 /// let x = OperationError::new().set_kind("example");
27007 /// ```
27008 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27009 self.kind = v.into();
27010 self
27011 }
27012
27013 /// Sets the value of [code][crate::model::OperationError::code].
27014 ///
27015 /// # Example
27016 /// ```ignore,no_run
27017 /// # use google_cloud_sql_v1::model::OperationError;
27018 /// let x = OperationError::new().set_code("example");
27019 /// ```
27020 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27021 self.code = v.into();
27022 self
27023 }
27024
27025 /// Sets the value of [message][crate::model::OperationError::message].
27026 ///
27027 /// # Example
27028 /// ```ignore,no_run
27029 /// # use google_cloud_sql_v1::model::OperationError;
27030 /// let x = OperationError::new().set_message("example");
27031 /// ```
27032 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27033 self.message = v.into();
27034 self
27035 }
27036}
27037
27038impl wkt::message::Message for OperationError {
27039 fn typename() -> &'static str {
27040 "type.googleapis.com/google.cloud.sql.v1.OperationError"
27041 }
27042}
27043
27044/// Database instance operation errors list wrapper.
27045#[derive(Clone, Default, PartialEq)]
27046#[non_exhaustive]
27047pub struct OperationErrors {
27048 /// This is always `sql#operationErrors`.
27049 pub kind: std::string::String,
27050
27051 /// The list of errors encountered while processing this operation.
27052 pub errors: std::vec::Vec<crate::model::OperationError>,
27053
27054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27055}
27056
27057impl OperationErrors {
27058 /// Creates a new default instance.
27059 pub fn new() -> Self {
27060 std::default::Default::default()
27061 }
27062
27063 /// Sets the value of [kind][crate::model::OperationErrors::kind].
27064 ///
27065 /// # Example
27066 /// ```ignore,no_run
27067 /// # use google_cloud_sql_v1::model::OperationErrors;
27068 /// let x = OperationErrors::new().set_kind("example");
27069 /// ```
27070 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27071 self.kind = v.into();
27072 self
27073 }
27074
27075 /// Sets the value of [errors][crate::model::OperationErrors::errors].
27076 ///
27077 /// # Example
27078 /// ```ignore,no_run
27079 /// # use google_cloud_sql_v1::model::OperationErrors;
27080 /// use google_cloud_sql_v1::model::OperationError;
27081 /// let x = OperationErrors::new()
27082 /// .set_errors([
27083 /// OperationError::default()/* use setters */,
27084 /// OperationError::default()/* use (different) setters */,
27085 /// ]);
27086 /// ```
27087 pub fn set_errors<T, V>(mut self, v: T) -> Self
27088 where
27089 T: std::iter::IntoIterator<Item = V>,
27090 V: std::convert::Into<crate::model::OperationError>,
27091 {
27092 use std::iter::Iterator;
27093 self.errors = v.into_iter().map(|i| i.into()).collect();
27094 self
27095 }
27096}
27097
27098impl wkt::message::Message for OperationErrors {
27099 fn typename() -> &'static str {
27100 "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
27101 }
27102}
27103
27104/// Database instance local user password validation policy.
27105/// This message defines the password policy for local database users.
27106/// When enabled, it enforces constraints on password complexity, length,
27107/// and reuse. Keep this policy enabled to help prevent unauthorized access.
27108#[derive(Clone, Default, PartialEq)]
27109#[non_exhaustive]
27110pub struct PasswordValidationPolicy {
27111 /// Minimum number of characters allowed.
27112 pub min_length: std::option::Option<wkt::Int32Value>,
27113
27114 /// The complexity of the password.
27115 pub complexity: crate::model::password_validation_policy::Complexity,
27116
27117 /// Number of previous passwords that cannot be reused.
27118 pub reuse_interval: std::option::Option<wkt::Int32Value>,
27119
27120 /// Disallow username as a part of the password.
27121 pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
27122
27123 /// Minimum interval after which the password can be changed. This flag is only
27124 /// supported for PostgreSQL.
27125 pub password_change_interval: std::option::Option<wkt::Duration>,
27126
27127 /// Whether to enable the password policy or not. When enabled, passwords must
27128 /// meet complexity requirements. Keep this policy enabled to help prevent
27129 /// unauthorized access. Disabling this policy allows weak passwords.
27130 pub enable_password_policy: std::option::Option<wkt::BoolValue>,
27131
27132 /// This field is deprecated and will be removed in a future version of the
27133 /// API.
27134 #[deprecated]
27135 pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
27136
27137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27138}
27139
27140impl PasswordValidationPolicy {
27141 /// Creates a new default instance.
27142 pub fn new() -> Self {
27143 std::default::Default::default()
27144 }
27145
27146 /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
27147 ///
27148 /// # Example
27149 /// ```ignore,no_run
27150 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27151 /// use wkt::Int32Value;
27152 /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
27153 /// ```
27154 pub fn set_min_length<T>(mut self, v: T) -> Self
27155 where
27156 T: std::convert::Into<wkt::Int32Value>,
27157 {
27158 self.min_length = std::option::Option::Some(v.into());
27159 self
27160 }
27161
27162 /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
27163 ///
27164 /// # Example
27165 /// ```ignore,no_run
27166 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27167 /// use wkt::Int32Value;
27168 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
27169 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
27170 /// ```
27171 pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
27172 where
27173 T: std::convert::Into<wkt::Int32Value>,
27174 {
27175 self.min_length = v.map(|x| x.into());
27176 self
27177 }
27178
27179 /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
27180 ///
27181 /// # Example
27182 /// ```ignore,no_run
27183 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27184 /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
27185 /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
27186 /// ```
27187 pub fn set_complexity<
27188 T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
27189 >(
27190 mut self,
27191 v: T,
27192 ) -> Self {
27193 self.complexity = v.into();
27194 self
27195 }
27196
27197 /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
27198 ///
27199 /// # Example
27200 /// ```ignore,no_run
27201 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27202 /// use wkt::Int32Value;
27203 /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
27204 /// ```
27205 pub fn set_reuse_interval<T>(mut self, v: T) -> Self
27206 where
27207 T: std::convert::Into<wkt::Int32Value>,
27208 {
27209 self.reuse_interval = std::option::Option::Some(v.into());
27210 self
27211 }
27212
27213 /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
27214 ///
27215 /// # Example
27216 /// ```ignore,no_run
27217 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27218 /// use wkt::Int32Value;
27219 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
27220 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
27221 /// ```
27222 pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
27223 where
27224 T: std::convert::Into<wkt::Int32Value>,
27225 {
27226 self.reuse_interval = v.map(|x| x.into());
27227 self
27228 }
27229
27230 /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
27231 ///
27232 /// # Example
27233 /// ```ignore,no_run
27234 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27235 /// use wkt::BoolValue;
27236 /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
27237 /// ```
27238 pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
27239 where
27240 T: std::convert::Into<wkt::BoolValue>,
27241 {
27242 self.disallow_username_substring = std::option::Option::Some(v.into());
27243 self
27244 }
27245
27246 /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
27247 ///
27248 /// # Example
27249 /// ```ignore,no_run
27250 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27251 /// use wkt::BoolValue;
27252 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
27253 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
27254 /// ```
27255 pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
27256 where
27257 T: std::convert::Into<wkt::BoolValue>,
27258 {
27259 self.disallow_username_substring = v.map(|x| x.into());
27260 self
27261 }
27262
27263 /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
27264 ///
27265 /// # Example
27266 /// ```ignore,no_run
27267 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27268 /// use wkt::Duration;
27269 /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
27270 /// ```
27271 pub fn set_password_change_interval<T>(mut self, v: T) -> Self
27272 where
27273 T: std::convert::Into<wkt::Duration>,
27274 {
27275 self.password_change_interval = std::option::Option::Some(v.into());
27276 self
27277 }
27278
27279 /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
27280 ///
27281 /// # Example
27282 /// ```ignore,no_run
27283 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27284 /// use wkt::Duration;
27285 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
27286 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
27287 /// ```
27288 pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
27289 where
27290 T: std::convert::Into<wkt::Duration>,
27291 {
27292 self.password_change_interval = v.map(|x| x.into());
27293 self
27294 }
27295
27296 /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
27297 ///
27298 /// # Example
27299 /// ```ignore,no_run
27300 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27301 /// use wkt::BoolValue;
27302 /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
27303 /// ```
27304 pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
27305 where
27306 T: std::convert::Into<wkt::BoolValue>,
27307 {
27308 self.enable_password_policy = std::option::Option::Some(v.into());
27309 self
27310 }
27311
27312 /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
27313 ///
27314 /// # Example
27315 /// ```ignore,no_run
27316 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27317 /// use wkt::BoolValue;
27318 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
27319 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
27320 /// ```
27321 pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
27322 where
27323 T: std::convert::Into<wkt::BoolValue>,
27324 {
27325 self.enable_password_policy = v.map(|x| x.into());
27326 self
27327 }
27328
27329 /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
27330 ///
27331 /// # Example
27332 /// ```ignore,no_run
27333 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27334 /// use wkt::BoolValue;
27335 /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
27336 /// ```
27337 #[deprecated]
27338 pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
27339 where
27340 T: std::convert::Into<wkt::BoolValue>,
27341 {
27342 self.disallow_compromised_credentials = std::option::Option::Some(v.into());
27343 self
27344 }
27345
27346 /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
27347 ///
27348 /// # Example
27349 /// ```ignore,no_run
27350 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
27351 /// use wkt::BoolValue;
27352 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
27353 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
27354 /// ```
27355 #[deprecated]
27356 pub fn set_or_clear_disallow_compromised_credentials<T>(
27357 mut self,
27358 v: std::option::Option<T>,
27359 ) -> Self
27360 where
27361 T: std::convert::Into<wkt::BoolValue>,
27362 {
27363 self.disallow_compromised_credentials = v.map(|x| x.into());
27364 self
27365 }
27366}
27367
27368impl wkt::message::Message for PasswordValidationPolicy {
27369 fn typename() -> &'static str {
27370 "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
27371 }
27372}
27373
27374/// Defines additional types related to [PasswordValidationPolicy].
27375pub mod password_validation_policy {
27376 #[allow(unused_imports)]
27377 use super::*;
27378
27379 /// The complexity choices of the password.
27380 ///
27381 /// # Working with unknown values
27382 ///
27383 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27384 /// additional enum variants at any time. Adding new variants is not considered
27385 /// a breaking change. Applications should write their code in anticipation of:
27386 ///
27387 /// - New values appearing in future releases of the client library, **and**
27388 /// - New values received dynamically, without application changes.
27389 ///
27390 /// Please consult the [Working with enums] section in the user guide for some
27391 /// guidelines.
27392 ///
27393 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27394 #[derive(Clone, Debug, PartialEq)]
27395 #[non_exhaustive]
27396 pub enum Complexity {
27397 /// Complexity check is not specified.
27398 Unspecified,
27399 /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
27400 /// characters.
27401 Default,
27402 /// If set, the enum was initialized with an unknown value.
27403 ///
27404 /// Applications can examine the value using [Complexity::value] or
27405 /// [Complexity::name].
27406 UnknownValue(complexity::UnknownValue),
27407 }
27408
27409 #[doc(hidden)]
27410 pub mod complexity {
27411 #[allow(unused_imports)]
27412 use super::*;
27413 #[derive(Clone, Debug, PartialEq)]
27414 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27415 }
27416
27417 impl Complexity {
27418 /// Gets the enum value.
27419 ///
27420 /// Returns `None` if the enum contains an unknown value deserialized from
27421 /// the string representation of enums.
27422 pub fn value(&self) -> std::option::Option<i32> {
27423 match self {
27424 Self::Unspecified => std::option::Option::Some(0),
27425 Self::Default => std::option::Option::Some(1),
27426 Self::UnknownValue(u) => u.0.value(),
27427 }
27428 }
27429
27430 /// Gets the enum value as a string.
27431 ///
27432 /// Returns `None` if the enum contains an unknown value deserialized from
27433 /// the integer representation of enums.
27434 pub fn name(&self) -> std::option::Option<&str> {
27435 match self {
27436 Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
27437 Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
27438 Self::UnknownValue(u) => u.0.name(),
27439 }
27440 }
27441 }
27442
27443 impl std::default::Default for Complexity {
27444 fn default() -> Self {
27445 use std::convert::From;
27446 Self::from(0)
27447 }
27448 }
27449
27450 impl std::fmt::Display for Complexity {
27451 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27452 wkt::internal::display_enum(f, self.name(), self.value())
27453 }
27454 }
27455
27456 impl std::convert::From<i32> for Complexity {
27457 fn from(value: i32) -> Self {
27458 match value {
27459 0 => Self::Unspecified,
27460 1 => Self::Default,
27461 _ => Self::UnknownValue(complexity::UnknownValue(
27462 wkt::internal::UnknownEnumValue::Integer(value),
27463 )),
27464 }
27465 }
27466 }
27467
27468 impl std::convert::From<&str> for Complexity {
27469 fn from(value: &str) -> Self {
27470 use std::string::ToString;
27471 match value {
27472 "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
27473 "COMPLEXITY_DEFAULT" => Self::Default,
27474 _ => Self::UnknownValue(complexity::UnknownValue(
27475 wkt::internal::UnknownEnumValue::String(value.to_string()),
27476 )),
27477 }
27478 }
27479 }
27480
27481 impl serde::ser::Serialize for Complexity {
27482 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27483 where
27484 S: serde::Serializer,
27485 {
27486 match self {
27487 Self::Unspecified => serializer.serialize_i32(0),
27488 Self::Default => serializer.serialize_i32(1),
27489 Self::UnknownValue(u) => u.0.serialize(serializer),
27490 }
27491 }
27492 }
27493
27494 impl<'de> serde::de::Deserialize<'de> for Complexity {
27495 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27496 where
27497 D: serde::Deserializer<'de>,
27498 {
27499 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
27500 ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
27501 ))
27502 }
27503 }
27504}
27505
27506/// Data cache configurations.
27507#[derive(Clone, Default, PartialEq)]
27508#[non_exhaustive]
27509pub struct DataCacheConfig {
27510 /// Whether data cache is enabled for the instance.
27511 pub data_cache_enabled: bool,
27512
27513 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27514}
27515
27516impl DataCacheConfig {
27517 /// Creates a new default instance.
27518 pub fn new() -> Self {
27519 std::default::Default::default()
27520 }
27521
27522 /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
27523 ///
27524 /// # Example
27525 /// ```ignore,no_run
27526 /// # use google_cloud_sql_v1::model::DataCacheConfig;
27527 /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
27528 /// ```
27529 pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
27530 self.data_cache_enabled = v.into();
27531 self
27532 }
27533}
27534
27535impl wkt::message::Message for DataCacheConfig {
27536 fn typename() -> &'static str {
27537 "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
27538 }
27539}
27540
27541/// Config used to determine the final backup settings for the instance.
27542#[derive(Clone, Default, PartialEq)]
27543#[non_exhaustive]
27544pub struct FinalBackupConfig {
27545 /// Whether the final backup is enabled for the instance.
27546 pub enabled: std::option::Option<bool>,
27547
27548 /// The number of days to retain the final backup after the instance deletion.
27549 /// The final backup will be purged at (time_of_instance_deletion +
27550 /// retention_days).
27551 pub retention_days: std::option::Option<i32>,
27552
27553 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27554}
27555
27556impl FinalBackupConfig {
27557 /// Creates a new default instance.
27558 pub fn new() -> Self {
27559 std::default::Default::default()
27560 }
27561
27562 /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
27563 ///
27564 /// # Example
27565 /// ```ignore,no_run
27566 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
27567 /// let x = FinalBackupConfig::new().set_enabled(true);
27568 /// ```
27569 pub fn set_enabled<T>(mut self, v: T) -> Self
27570 where
27571 T: std::convert::Into<bool>,
27572 {
27573 self.enabled = std::option::Option::Some(v.into());
27574 self
27575 }
27576
27577 /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
27578 ///
27579 /// # Example
27580 /// ```ignore,no_run
27581 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
27582 /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
27583 /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
27584 /// ```
27585 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27586 where
27587 T: std::convert::Into<bool>,
27588 {
27589 self.enabled = v.map(|x| x.into());
27590 self
27591 }
27592
27593 /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
27594 ///
27595 /// # Example
27596 /// ```ignore,no_run
27597 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
27598 /// let x = FinalBackupConfig::new().set_retention_days(42);
27599 /// ```
27600 pub fn set_retention_days<T>(mut self, v: T) -> Self
27601 where
27602 T: std::convert::Into<i32>,
27603 {
27604 self.retention_days = std::option::Option::Some(v.into());
27605 self
27606 }
27607
27608 /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
27609 ///
27610 /// # Example
27611 /// ```ignore,no_run
27612 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
27613 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
27614 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
27615 /// ```
27616 pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
27617 where
27618 T: std::convert::Into<i32>,
27619 {
27620 self.retention_days = v.map(|x| x.into());
27621 self
27622 }
27623}
27624
27625impl wkt::message::Message for FinalBackupConfig {
27626 fn typename() -> &'static str {
27627 "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
27628 }
27629}
27630
27631/// Database instance settings.
27632#[derive(Clone, Default, PartialEq)]
27633#[non_exhaustive]
27634pub struct Settings {
27635 /// The version of instance settings. This is a required field for update
27636 /// method to make sure concurrent updates are handled properly. During update,
27637 /// use the most recent settingsVersion value for this instance and do not try
27638 /// to update this value.
27639 pub settings_version: std::option::Option<wkt::Int64Value>,
27640
27641 /// The App Engine app IDs that can access this instance.
27642 /// (Deprecated) Applied to First Generation instances only.
27643 #[deprecated]
27644 pub authorized_gae_applications: std::vec::Vec<std::string::String>,
27645
27646 /// The tier (or machine type) for this instance, for example
27647 /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
27648 pub tier: std::string::String,
27649
27650 /// This is always `sql#settings`.
27651 pub kind: std::string::String,
27652
27653 /// User-provided labels, represented as a dictionary where each label is a
27654 /// single key value pair.
27655 pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
27656
27657 /// Availability type. Potential values:
27658 ///
27659 /// * `ZONAL`: The instance serves data from only one zone. Outages in that
27660 /// zone affect data accessibility.
27661 /// * `REGIONAL`: The instance can serve data from more than one zone in a
27662 /// region (it is highly available)./
27663 ///
27664 /// For more information, see [Overview of the High Availability
27665 /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
27666 pub availability_type: crate::model::SqlAvailabilityType,
27667
27668 /// The pricing plan for this instance. This can be either `PER_USE` or
27669 /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
27670 pub pricing_plan: crate::model::SqlPricingPlan,
27671
27672 /// The type of replication this instance uses. This can be either
27673 /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
27674 /// applicable to First Generation instances.
27675 #[deprecated]
27676 pub replication_type: crate::model::SqlReplicationType,
27677
27678 /// The maximum size to which storage capacity can be automatically increased.
27679 /// The default value is 0, which specifies that there is no limit.
27680 pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
27681
27682 /// The activation policy specifies when the instance is activated; it is
27683 /// applicable only when the instance state is RUNNABLE. Valid values:
27684 ///
27685 /// * `ALWAYS`: The instance is on, and remains so even in the absence of
27686 /// connection requests.
27687 /// * `NEVER`: The instance is off; it is not activated, even if a
27688 /// connection request arrives.
27689 pub activation_policy: crate::model::settings::SqlActivationPolicy,
27690
27691 /// The settings for IP Management. This allows to enable or disable the
27692 /// instance IP and manage which external networks can connect to the instance.
27693 /// The IPv4 address cannot be disabled for Second Generation instances.
27694 pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
27695
27696 /// Configuration to increase storage size automatically. The default value is
27697 /// true.
27698 pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
27699
27700 /// The location preference settings. This allows the instance to be located as
27701 /// near as possible to either an App Engine app or Compute Engine zone for
27702 /// better performance. App Engine co-location was only applicable to First
27703 /// Generation instances.
27704 pub location_preference: std::option::Option<crate::model::LocationPreference>,
27705
27706 /// The database flags passed to the instance at startup.
27707 pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
27708
27709 /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
27710 /// First Generation instances.
27711 pub data_disk_type: crate::model::SqlDataDiskType,
27712
27713 /// The maintenance window for this instance. This specifies when the instance
27714 /// can be restarted for maintenance purposes.
27715 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
27716
27717 /// The daily backup configuration for the instance.
27718 pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
27719
27720 /// Configuration specific to read replica instances. Indicates whether
27721 /// replication is enabled or not. WARNING: Changing this restarts the
27722 /// instance.
27723 pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
27724
27725 /// Configuration specific to read replica instances. Indicates whether
27726 /// database flags for crash-safe replication are enabled. This property was
27727 /// only applicable to First Generation instances.
27728 #[deprecated]
27729 pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
27730
27731 /// The size of data disk, in GB. The data disk size minimum is 10GB.
27732 pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
27733
27734 /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
27735 pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
27736
27737 /// The name of server Instance collation.
27738 pub collation: std::string::String,
27739
27740 /// Deny maintenance periods
27741 pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
27742
27743 /// Insights configuration, for now relevant only for Postgres.
27744 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
27745
27746 /// The local user password validation policy of the instance.
27747 pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
27748
27749 /// SQL Server specific audit configuration.
27750 pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
27751
27752 /// Optional. The edition type of the Cloud SQL instance.
27753 pub edition: crate::model::settings::Edition,
27754
27755 /// Specifies if connections must use Cloud SQL connectors.
27756 /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
27757 /// can be connected without Cloud SQL
27758 /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
27759 /// Connectors).
27760 ///
27761 /// Note that using REQUIRED disables all existing authorized networks. If
27762 /// this field is not specified when creating a new instance, NOT_REQUIRED is
27763 /// used. If this field is not specified when patching or updating an existing
27764 /// instance, it is left unchanged in the instance.
27765 pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
27766
27767 /// Configuration to protect against accidental instance deletion.
27768 pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
27769
27770 /// Server timezone, relevant only for Cloud SQL for SQL Server.
27771 pub time_zone: std::string::String,
27772
27773 /// Specifies advanced machine configuration for the instances relevant only
27774 /// for SQL Server.
27775 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
27776
27777 /// Configuration for data cache.
27778 pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
27779
27780 /// Optional. Configuration value for recreation of replica after certain
27781 /// replication lag
27782 pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
27783
27784 /// Optional. When this parameter is set to true, Cloud SQL instances can
27785 /// connect to Vertex AI to pass requests for real-time predictions and
27786 /// insights to the AI. The default value is false. This applies only to Cloud
27787 /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
27788 pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
27789
27790 /// Optional. By default, Cloud SQL instances have schema extraction disabled
27791 /// for Dataplex. When this parameter is set to true, schema extraction for
27792 /// Dataplex on Cloud SQL instances is activated.
27793 pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
27794
27795 /// Optional. When this parameter is set to true, Cloud SQL retains backups of
27796 /// the instance even after the instance is deleted. The ON_DEMAND backup will
27797 /// be retained until customer deletes the backup or the project. The AUTOMATED
27798 /// backup will be retained based on the backups retention setting.
27799 pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
27800
27801 /// Optional. Provisioned number of I/O operations per second for the data
27802 /// disk. This field is only used for hyperdisk-balanced disk types.
27803 pub data_disk_provisioned_iops: std::option::Option<i64>,
27804
27805 /// Optional. Provisioned throughput measured in MiB per second for the data
27806 /// disk. This field is only used for hyperdisk-balanced disk types.
27807 pub data_disk_provisioned_throughput: std::option::Option<i64>,
27808
27809 /// Optional. The managed connection pooling configuration for the instance.
27810 pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
27811
27812 /// Optional. The final backup configuration for the instance.
27813 pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
27814
27815 /// Optional. The read pool auto-scale configuration for the instance.
27816 pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
27817
27818 /// Optional. Whether the replica is in accelerated mode. This feature is in
27819 /// private preview and requires allowlisting to take effect.
27820 pub accelerated_replica_mode: std::option::Option<wkt::BoolValue>,
27821
27822 /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
27823 /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
27824 /// versions. The MySQL version must be 8.0.35 or higher.
27825 pub auto_upgrade_enabled: std::option::Option<bool>,
27826
27827 /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
27828 pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
27829
27830 /// This parameter controls whether to allow using ExecuteSql API to connect to
27831 /// the instance. Not allowed by default.
27832 pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
27833
27834 /// Optional. Configuration for Performance Capture, provides diagnostic
27835 /// metrics during high load situations.
27836 pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
27837
27838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27839}
27840
27841impl Settings {
27842 /// Creates a new default instance.
27843 pub fn new() -> Self {
27844 std::default::Default::default()
27845 }
27846
27847 /// Sets the value of [settings_version][crate::model::Settings::settings_version].
27848 ///
27849 /// # Example
27850 /// ```ignore,no_run
27851 /// # use google_cloud_sql_v1::model::Settings;
27852 /// use wkt::Int64Value;
27853 /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
27854 /// ```
27855 pub fn set_settings_version<T>(mut self, v: T) -> Self
27856 where
27857 T: std::convert::Into<wkt::Int64Value>,
27858 {
27859 self.settings_version = std::option::Option::Some(v.into());
27860 self
27861 }
27862
27863 /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
27864 ///
27865 /// # Example
27866 /// ```ignore,no_run
27867 /// # use google_cloud_sql_v1::model::Settings;
27868 /// use wkt::Int64Value;
27869 /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
27870 /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
27871 /// ```
27872 pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
27873 where
27874 T: std::convert::Into<wkt::Int64Value>,
27875 {
27876 self.settings_version = v.map(|x| x.into());
27877 self
27878 }
27879
27880 /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
27881 ///
27882 /// # Example
27883 /// ```ignore,no_run
27884 /// # use google_cloud_sql_v1::model::Settings;
27885 /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
27886 /// ```
27887 #[deprecated]
27888 pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
27889 where
27890 T: std::iter::IntoIterator<Item = V>,
27891 V: std::convert::Into<std::string::String>,
27892 {
27893 use std::iter::Iterator;
27894 self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
27895 self
27896 }
27897
27898 /// Sets the value of [tier][crate::model::Settings::tier].
27899 ///
27900 /// # Example
27901 /// ```ignore,no_run
27902 /// # use google_cloud_sql_v1::model::Settings;
27903 /// let x = Settings::new().set_tier("example");
27904 /// ```
27905 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27906 self.tier = v.into();
27907 self
27908 }
27909
27910 /// Sets the value of [kind][crate::model::Settings::kind].
27911 ///
27912 /// # Example
27913 /// ```ignore,no_run
27914 /// # use google_cloud_sql_v1::model::Settings;
27915 /// let x = Settings::new().set_kind("example");
27916 /// ```
27917 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
27918 self.kind = v.into();
27919 self
27920 }
27921
27922 /// Sets the value of [user_labels][crate::model::Settings::user_labels].
27923 ///
27924 /// # Example
27925 /// ```ignore,no_run
27926 /// # use google_cloud_sql_v1::model::Settings;
27927 /// let x = Settings::new().set_user_labels([
27928 /// ("key0", "abc"),
27929 /// ("key1", "xyz"),
27930 /// ]);
27931 /// ```
27932 pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
27933 where
27934 T: std::iter::IntoIterator<Item = (K, V)>,
27935 K: std::convert::Into<std::string::String>,
27936 V: std::convert::Into<std::string::String>,
27937 {
27938 use std::iter::Iterator;
27939 self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
27940 self
27941 }
27942
27943 /// Sets the value of [availability_type][crate::model::Settings::availability_type].
27944 ///
27945 /// # Example
27946 /// ```ignore,no_run
27947 /// # use google_cloud_sql_v1::model::Settings;
27948 /// use google_cloud_sql_v1::model::SqlAvailabilityType;
27949 /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
27950 /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
27951 /// ```
27952 pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
27953 mut self,
27954 v: T,
27955 ) -> Self {
27956 self.availability_type = v.into();
27957 self
27958 }
27959
27960 /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
27961 ///
27962 /// # Example
27963 /// ```ignore,no_run
27964 /// # use google_cloud_sql_v1::model::Settings;
27965 /// use google_cloud_sql_v1::model::SqlPricingPlan;
27966 /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
27967 /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
27968 /// ```
27969 pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
27970 mut self,
27971 v: T,
27972 ) -> Self {
27973 self.pricing_plan = v.into();
27974 self
27975 }
27976
27977 /// Sets the value of [replication_type][crate::model::Settings::replication_type].
27978 ///
27979 /// # Example
27980 /// ```ignore,no_run
27981 /// # use google_cloud_sql_v1::model::Settings;
27982 /// use google_cloud_sql_v1::model::SqlReplicationType;
27983 /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
27984 /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
27985 /// ```
27986 #[deprecated]
27987 pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
27988 mut self,
27989 v: T,
27990 ) -> Self {
27991 self.replication_type = v.into();
27992 self
27993 }
27994
27995 /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
27996 ///
27997 /// # Example
27998 /// ```ignore,no_run
27999 /// # use google_cloud_sql_v1::model::Settings;
28000 /// use wkt::Int64Value;
28001 /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
28002 /// ```
28003 pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
28004 where
28005 T: std::convert::Into<wkt::Int64Value>,
28006 {
28007 self.storage_auto_resize_limit = std::option::Option::Some(v.into());
28008 self
28009 }
28010
28011 /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
28012 ///
28013 /// # Example
28014 /// ```ignore,no_run
28015 /// # use google_cloud_sql_v1::model::Settings;
28016 /// use wkt::Int64Value;
28017 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
28018 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
28019 /// ```
28020 pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
28021 where
28022 T: std::convert::Into<wkt::Int64Value>,
28023 {
28024 self.storage_auto_resize_limit = v.map(|x| x.into());
28025 self
28026 }
28027
28028 /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
28029 ///
28030 /// # Example
28031 /// ```ignore,no_run
28032 /// # use google_cloud_sql_v1::model::Settings;
28033 /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
28034 /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
28035 /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
28036 /// ```
28037 pub fn set_activation_policy<
28038 T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
28039 >(
28040 mut self,
28041 v: T,
28042 ) -> Self {
28043 self.activation_policy = v.into();
28044 self
28045 }
28046
28047 /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
28048 ///
28049 /// # Example
28050 /// ```ignore,no_run
28051 /// # use google_cloud_sql_v1::model::Settings;
28052 /// use google_cloud_sql_v1::model::IpConfiguration;
28053 /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
28054 /// ```
28055 pub fn set_ip_configuration<T>(mut self, v: T) -> Self
28056 where
28057 T: std::convert::Into<crate::model::IpConfiguration>,
28058 {
28059 self.ip_configuration = std::option::Option::Some(v.into());
28060 self
28061 }
28062
28063 /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
28064 ///
28065 /// # Example
28066 /// ```ignore,no_run
28067 /// # use google_cloud_sql_v1::model::Settings;
28068 /// use google_cloud_sql_v1::model::IpConfiguration;
28069 /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
28070 /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
28071 /// ```
28072 pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
28073 where
28074 T: std::convert::Into<crate::model::IpConfiguration>,
28075 {
28076 self.ip_configuration = v.map(|x| x.into());
28077 self
28078 }
28079
28080 /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
28081 ///
28082 /// # Example
28083 /// ```ignore,no_run
28084 /// # use google_cloud_sql_v1::model::Settings;
28085 /// use wkt::BoolValue;
28086 /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
28087 /// ```
28088 pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
28089 where
28090 T: std::convert::Into<wkt::BoolValue>,
28091 {
28092 self.storage_auto_resize = std::option::Option::Some(v.into());
28093 self
28094 }
28095
28096 /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
28097 ///
28098 /// # Example
28099 /// ```ignore,no_run
28100 /// # use google_cloud_sql_v1::model::Settings;
28101 /// use wkt::BoolValue;
28102 /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
28103 /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
28104 /// ```
28105 pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
28106 where
28107 T: std::convert::Into<wkt::BoolValue>,
28108 {
28109 self.storage_auto_resize = v.map(|x| x.into());
28110 self
28111 }
28112
28113 /// Sets the value of [location_preference][crate::model::Settings::location_preference].
28114 ///
28115 /// # Example
28116 /// ```ignore,no_run
28117 /// # use google_cloud_sql_v1::model::Settings;
28118 /// use google_cloud_sql_v1::model::LocationPreference;
28119 /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
28120 /// ```
28121 pub fn set_location_preference<T>(mut self, v: T) -> Self
28122 where
28123 T: std::convert::Into<crate::model::LocationPreference>,
28124 {
28125 self.location_preference = std::option::Option::Some(v.into());
28126 self
28127 }
28128
28129 /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
28130 ///
28131 /// # Example
28132 /// ```ignore,no_run
28133 /// # use google_cloud_sql_v1::model::Settings;
28134 /// use google_cloud_sql_v1::model::LocationPreference;
28135 /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
28136 /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
28137 /// ```
28138 pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
28139 where
28140 T: std::convert::Into<crate::model::LocationPreference>,
28141 {
28142 self.location_preference = v.map(|x| x.into());
28143 self
28144 }
28145
28146 /// Sets the value of [database_flags][crate::model::Settings::database_flags].
28147 ///
28148 /// # Example
28149 /// ```ignore,no_run
28150 /// # use google_cloud_sql_v1::model::Settings;
28151 /// use google_cloud_sql_v1::model::DatabaseFlags;
28152 /// let x = Settings::new()
28153 /// .set_database_flags([
28154 /// DatabaseFlags::default()/* use setters */,
28155 /// DatabaseFlags::default()/* use (different) setters */,
28156 /// ]);
28157 /// ```
28158 pub fn set_database_flags<T, V>(mut self, v: T) -> Self
28159 where
28160 T: std::iter::IntoIterator<Item = V>,
28161 V: std::convert::Into<crate::model::DatabaseFlags>,
28162 {
28163 use std::iter::Iterator;
28164 self.database_flags = v.into_iter().map(|i| i.into()).collect();
28165 self
28166 }
28167
28168 /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
28169 ///
28170 /// # Example
28171 /// ```ignore,no_run
28172 /// # use google_cloud_sql_v1::model::Settings;
28173 /// use google_cloud_sql_v1::model::SqlDataDiskType;
28174 /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
28175 /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
28176 /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
28177 /// ```
28178 pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
28179 mut self,
28180 v: T,
28181 ) -> Self {
28182 self.data_disk_type = v.into();
28183 self
28184 }
28185
28186 /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
28187 ///
28188 /// # Example
28189 /// ```ignore,no_run
28190 /// # use google_cloud_sql_v1::model::Settings;
28191 /// use google_cloud_sql_v1::model::MaintenanceWindow;
28192 /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
28193 /// ```
28194 pub fn set_maintenance_window<T>(mut self, v: T) -> Self
28195 where
28196 T: std::convert::Into<crate::model::MaintenanceWindow>,
28197 {
28198 self.maintenance_window = std::option::Option::Some(v.into());
28199 self
28200 }
28201
28202 /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
28203 ///
28204 /// # Example
28205 /// ```ignore,no_run
28206 /// # use google_cloud_sql_v1::model::Settings;
28207 /// use google_cloud_sql_v1::model::MaintenanceWindow;
28208 /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
28209 /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
28210 /// ```
28211 pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
28212 where
28213 T: std::convert::Into<crate::model::MaintenanceWindow>,
28214 {
28215 self.maintenance_window = v.map(|x| x.into());
28216 self
28217 }
28218
28219 /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
28220 ///
28221 /// # Example
28222 /// ```ignore,no_run
28223 /// # use google_cloud_sql_v1::model::Settings;
28224 /// use google_cloud_sql_v1::model::BackupConfiguration;
28225 /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
28226 /// ```
28227 pub fn set_backup_configuration<T>(mut self, v: T) -> Self
28228 where
28229 T: std::convert::Into<crate::model::BackupConfiguration>,
28230 {
28231 self.backup_configuration = std::option::Option::Some(v.into());
28232 self
28233 }
28234
28235 /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
28236 ///
28237 /// # Example
28238 /// ```ignore,no_run
28239 /// # use google_cloud_sql_v1::model::Settings;
28240 /// use google_cloud_sql_v1::model::BackupConfiguration;
28241 /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
28242 /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
28243 /// ```
28244 pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
28245 where
28246 T: std::convert::Into<crate::model::BackupConfiguration>,
28247 {
28248 self.backup_configuration = v.map(|x| x.into());
28249 self
28250 }
28251
28252 /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
28253 ///
28254 /// # Example
28255 /// ```ignore,no_run
28256 /// # use google_cloud_sql_v1::model::Settings;
28257 /// use wkt::BoolValue;
28258 /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
28259 /// ```
28260 pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
28261 where
28262 T: std::convert::Into<wkt::BoolValue>,
28263 {
28264 self.database_replication_enabled = std::option::Option::Some(v.into());
28265 self
28266 }
28267
28268 /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
28269 ///
28270 /// # Example
28271 /// ```ignore,no_run
28272 /// # use google_cloud_sql_v1::model::Settings;
28273 /// use wkt::BoolValue;
28274 /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
28275 /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
28276 /// ```
28277 pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28278 where
28279 T: std::convert::Into<wkt::BoolValue>,
28280 {
28281 self.database_replication_enabled = v.map(|x| x.into());
28282 self
28283 }
28284
28285 /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
28286 ///
28287 /// # Example
28288 /// ```ignore,no_run
28289 /// # use google_cloud_sql_v1::model::Settings;
28290 /// use wkt::BoolValue;
28291 /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
28292 /// ```
28293 #[deprecated]
28294 pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
28295 where
28296 T: std::convert::Into<wkt::BoolValue>,
28297 {
28298 self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
28299 self
28300 }
28301
28302 /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
28303 ///
28304 /// # Example
28305 /// ```ignore,no_run
28306 /// # use google_cloud_sql_v1::model::Settings;
28307 /// use wkt::BoolValue;
28308 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
28309 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
28310 /// ```
28311 #[deprecated]
28312 pub fn set_or_clear_crash_safe_replication_enabled<T>(
28313 mut self,
28314 v: std::option::Option<T>,
28315 ) -> Self
28316 where
28317 T: std::convert::Into<wkt::BoolValue>,
28318 {
28319 self.crash_safe_replication_enabled = v.map(|x| x.into());
28320 self
28321 }
28322
28323 /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
28324 ///
28325 /// # Example
28326 /// ```ignore,no_run
28327 /// # use google_cloud_sql_v1::model::Settings;
28328 /// use wkt::Int64Value;
28329 /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
28330 /// ```
28331 pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
28332 where
28333 T: std::convert::Into<wkt::Int64Value>,
28334 {
28335 self.data_disk_size_gb = std::option::Option::Some(v.into());
28336 self
28337 }
28338
28339 /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
28340 ///
28341 /// # Example
28342 /// ```ignore,no_run
28343 /// # use google_cloud_sql_v1::model::Settings;
28344 /// use wkt::Int64Value;
28345 /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
28346 /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
28347 /// ```
28348 pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
28349 where
28350 T: std::convert::Into<wkt::Int64Value>,
28351 {
28352 self.data_disk_size_gb = v.map(|x| x.into());
28353 self
28354 }
28355
28356 /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
28357 ///
28358 /// # Example
28359 /// ```ignore,no_run
28360 /// # use google_cloud_sql_v1::model::Settings;
28361 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28362 /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
28363 /// ```
28364 pub fn set_active_directory_config<T>(mut self, v: T) -> Self
28365 where
28366 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
28367 {
28368 self.active_directory_config = std::option::Option::Some(v.into());
28369 self
28370 }
28371
28372 /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
28373 ///
28374 /// # Example
28375 /// ```ignore,no_run
28376 /// # use google_cloud_sql_v1::model::Settings;
28377 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28378 /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
28379 /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
28380 /// ```
28381 pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
28382 where
28383 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
28384 {
28385 self.active_directory_config = v.map(|x| x.into());
28386 self
28387 }
28388
28389 /// Sets the value of [collation][crate::model::Settings::collation].
28390 ///
28391 /// # Example
28392 /// ```ignore,no_run
28393 /// # use google_cloud_sql_v1::model::Settings;
28394 /// let x = Settings::new().set_collation("example");
28395 /// ```
28396 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28397 self.collation = v.into();
28398 self
28399 }
28400
28401 /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
28402 ///
28403 /// # Example
28404 /// ```ignore,no_run
28405 /// # use google_cloud_sql_v1::model::Settings;
28406 /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
28407 /// let x = Settings::new()
28408 /// .set_deny_maintenance_periods([
28409 /// DenyMaintenancePeriod::default()/* use setters */,
28410 /// DenyMaintenancePeriod::default()/* use (different) setters */,
28411 /// ]);
28412 /// ```
28413 pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
28414 where
28415 T: std::iter::IntoIterator<Item = V>,
28416 V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
28417 {
28418 use std::iter::Iterator;
28419 self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
28420 self
28421 }
28422
28423 /// Sets the value of [insights_config][crate::model::Settings::insights_config].
28424 ///
28425 /// # Example
28426 /// ```ignore,no_run
28427 /// # use google_cloud_sql_v1::model::Settings;
28428 /// use google_cloud_sql_v1::model::InsightsConfig;
28429 /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
28430 /// ```
28431 pub fn set_insights_config<T>(mut self, v: T) -> Self
28432 where
28433 T: std::convert::Into<crate::model::InsightsConfig>,
28434 {
28435 self.insights_config = std::option::Option::Some(v.into());
28436 self
28437 }
28438
28439 /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
28440 ///
28441 /// # Example
28442 /// ```ignore,no_run
28443 /// # use google_cloud_sql_v1::model::Settings;
28444 /// use google_cloud_sql_v1::model::InsightsConfig;
28445 /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
28446 /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
28447 /// ```
28448 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
28449 where
28450 T: std::convert::Into<crate::model::InsightsConfig>,
28451 {
28452 self.insights_config = v.map(|x| x.into());
28453 self
28454 }
28455
28456 /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
28457 ///
28458 /// # Example
28459 /// ```ignore,no_run
28460 /// # use google_cloud_sql_v1::model::Settings;
28461 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
28462 /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
28463 /// ```
28464 pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
28465 where
28466 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
28467 {
28468 self.password_validation_policy = std::option::Option::Some(v.into());
28469 self
28470 }
28471
28472 /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
28473 ///
28474 /// # Example
28475 /// ```ignore,no_run
28476 /// # use google_cloud_sql_v1::model::Settings;
28477 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
28478 /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
28479 /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
28480 /// ```
28481 pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
28482 where
28483 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
28484 {
28485 self.password_validation_policy = v.map(|x| x.into());
28486 self
28487 }
28488
28489 /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
28490 ///
28491 /// # Example
28492 /// ```ignore,no_run
28493 /// # use google_cloud_sql_v1::model::Settings;
28494 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
28495 /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
28496 /// ```
28497 pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
28498 where
28499 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
28500 {
28501 self.sql_server_audit_config = std::option::Option::Some(v.into());
28502 self
28503 }
28504
28505 /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
28506 ///
28507 /// # Example
28508 /// ```ignore,no_run
28509 /// # use google_cloud_sql_v1::model::Settings;
28510 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
28511 /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
28512 /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
28513 /// ```
28514 pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
28515 where
28516 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
28517 {
28518 self.sql_server_audit_config = v.map(|x| x.into());
28519 self
28520 }
28521
28522 /// Sets the value of [edition][crate::model::Settings::edition].
28523 ///
28524 /// # Example
28525 /// ```ignore,no_run
28526 /// # use google_cloud_sql_v1::model::Settings;
28527 /// use google_cloud_sql_v1::model::settings::Edition;
28528 /// let x0 = Settings::new().set_edition(Edition::Enterprise);
28529 /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
28530 /// let x2 = Settings::new().set_edition(Edition::Developer);
28531 /// ```
28532 pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
28533 mut self,
28534 v: T,
28535 ) -> Self {
28536 self.edition = v.into();
28537 self
28538 }
28539
28540 /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
28541 ///
28542 /// # Example
28543 /// ```ignore,no_run
28544 /// # use google_cloud_sql_v1::model::Settings;
28545 /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
28546 /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
28547 /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
28548 /// ```
28549 pub fn set_connector_enforcement<
28550 T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
28551 >(
28552 mut self,
28553 v: T,
28554 ) -> Self {
28555 self.connector_enforcement = v.into();
28556 self
28557 }
28558
28559 /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
28560 ///
28561 /// # Example
28562 /// ```ignore,no_run
28563 /// # use google_cloud_sql_v1::model::Settings;
28564 /// use wkt::BoolValue;
28565 /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
28566 /// ```
28567 pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
28568 where
28569 T: std::convert::Into<wkt::BoolValue>,
28570 {
28571 self.deletion_protection_enabled = std::option::Option::Some(v.into());
28572 self
28573 }
28574
28575 /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
28576 ///
28577 /// # Example
28578 /// ```ignore,no_run
28579 /// # use google_cloud_sql_v1::model::Settings;
28580 /// use wkt::BoolValue;
28581 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
28582 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
28583 /// ```
28584 pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28585 where
28586 T: std::convert::Into<wkt::BoolValue>,
28587 {
28588 self.deletion_protection_enabled = v.map(|x| x.into());
28589 self
28590 }
28591
28592 /// Sets the value of [time_zone][crate::model::Settings::time_zone].
28593 ///
28594 /// # Example
28595 /// ```ignore,no_run
28596 /// # use google_cloud_sql_v1::model::Settings;
28597 /// let x = Settings::new().set_time_zone("example");
28598 /// ```
28599 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28600 self.time_zone = v.into();
28601 self
28602 }
28603
28604 /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
28605 ///
28606 /// # Example
28607 /// ```ignore,no_run
28608 /// # use google_cloud_sql_v1::model::Settings;
28609 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
28610 /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
28611 /// ```
28612 pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
28613 where
28614 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
28615 {
28616 self.advanced_machine_features = std::option::Option::Some(v.into());
28617 self
28618 }
28619
28620 /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
28621 ///
28622 /// # Example
28623 /// ```ignore,no_run
28624 /// # use google_cloud_sql_v1::model::Settings;
28625 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
28626 /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
28627 /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
28628 /// ```
28629 pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
28630 where
28631 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
28632 {
28633 self.advanced_machine_features = v.map(|x| x.into());
28634 self
28635 }
28636
28637 /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
28638 ///
28639 /// # Example
28640 /// ```ignore,no_run
28641 /// # use google_cloud_sql_v1::model::Settings;
28642 /// use google_cloud_sql_v1::model::DataCacheConfig;
28643 /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
28644 /// ```
28645 pub fn set_data_cache_config<T>(mut self, v: T) -> Self
28646 where
28647 T: std::convert::Into<crate::model::DataCacheConfig>,
28648 {
28649 self.data_cache_config = std::option::Option::Some(v.into());
28650 self
28651 }
28652
28653 /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
28654 ///
28655 /// # Example
28656 /// ```ignore,no_run
28657 /// # use google_cloud_sql_v1::model::Settings;
28658 /// use google_cloud_sql_v1::model::DataCacheConfig;
28659 /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
28660 /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
28661 /// ```
28662 pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
28663 where
28664 T: std::convert::Into<crate::model::DataCacheConfig>,
28665 {
28666 self.data_cache_config = v.map(|x| x.into());
28667 self
28668 }
28669
28670 /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
28671 ///
28672 /// # Example
28673 /// ```ignore,no_run
28674 /// # use google_cloud_sql_v1::model::Settings;
28675 /// use wkt::Int32Value;
28676 /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
28677 /// ```
28678 pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
28679 where
28680 T: std::convert::Into<wkt::Int32Value>,
28681 {
28682 self.replication_lag_max_seconds = std::option::Option::Some(v.into());
28683 self
28684 }
28685
28686 /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
28687 ///
28688 /// # Example
28689 /// ```ignore,no_run
28690 /// # use google_cloud_sql_v1::model::Settings;
28691 /// use wkt::Int32Value;
28692 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
28693 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
28694 /// ```
28695 pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28696 where
28697 T: std::convert::Into<wkt::Int32Value>,
28698 {
28699 self.replication_lag_max_seconds = v.map(|x| x.into());
28700 self
28701 }
28702
28703 /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
28704 ///
28705 /// # Example
28706 /// ```ignore,no_run
28707 /// # use google_cloud_sql_v1::model::Settings;
28708 /// use wkt::BoolValue;
28709 /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
28710 /// ```
28711 pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
28712 where
28713 T: std::convert::Into<wkt::BoolValue>,
28714 {
28715 self.enable_google_ml_integration = std::option::Option::Some(v.into());
28716 self
28717 }
28718
28719 /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
28720 ///
28721 /// # Example
28722 /// ```ignore,no_run
28723 /// # use google_cloud_sql_v1::model::Settings;
28724 /// use wkt::BoolValue;
28725 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
28726 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
28727 /// ```
28728 pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
28729 where
28730 T: std::convert::Into<wkt::BoolValue>,
28731 {
28732 self.enable_google_ml_integration = v.map(|x| x.into());
28733 self
28734 }
28735
28736 /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
28737 ///
28738 /// # Example
28739 /// ```ignore,no_run
28740 /// # use google_cloud_sql_v1::model::Settings;
28741 /// use wkt::BoolValue;
28742 /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
28743 /// ```
28744 pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
28745 where
28746 T: std::convert::Into<wkt::BoolValue>,
28747 {
28748 self.enable_dataplex_integration = std::option::Option::Some(v.into());
28749 self
28750 }
28751
28752 /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
28753 ///
28754 /// # Example
28755 /// ```ignore,no_run
28756 /// # use google_cloud_sql_v1::model::Settings;
28757 /// use wkt::BoolValue;
28758 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
28759 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
28760 /// ```
28761 pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
28762 where
28763 T: std::convert::Into<wkt::BoolValue>,
28764 {
28765 self.enable_dataplex_integration = v.map(|x| x.into());
28766 self
28767 }
28768
28769 /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
28770 ///
28771 /// # Example
28772 /// ```ignore,no_run
28773 /// # use google_cloud_sql_v1::model::Settings;
28774 /// use wkt::BoolValue;
28775 /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
28776 /// ```
28777 pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
28778 where
28779 T: std::convert::Into<wkt::BoolValue>,
28780 {
28781 self.retain_backups_on_delete = std::option::Option::Some(v.into());
28782 self
28783 }
28784
28785 /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
28786 ///
28787 /// # Example
28788 /// ```ignore,no_run
28789 /// # use google_cloud_sql_v1::model::Settings;
28790 /// use wkt::BoolValue;
28791 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
28792 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
28793 /// ```
28794 pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
28795 where
28796 T: std::convert::Into<wkt::BoolValue>,
28797 {
28798 self.retain_backups_on_delete = v.map(|x| x.into());
28799 self
28800 }
28801
28802 /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
28803 ///
28804 /// # Example
28805 /// ```ignore,no_run
28806 /// # use google_cloud_sql_v1::model::Settings;
28807 /// let x = Settings::new().set_data_disk_provisioned_iops(42);
28808 /// ```
28809 pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
28810 where
28811 T: std::convert::Into<i64>,
28812 {
28813 self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
28814 self
28815 }
28816
28817 /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
28818 ///
28819 /// # Example
28820 /// ```ignore,no_run
28821 /// # use google_cloud_sql_v1::model::Settings;
28822 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
28823 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
28824 /// ```
28825 pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
28826 where
28827 T: std::convert::Into<i64>,
28828 {
28829 self.data_disk_provisioned_iops = v.map(|x| x.into());
28830 self
28831 }
28832
28833 /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
28834 ///
28835 /// # Example
28836 /// ```ignore,no_run
28837 /// # use google_cloud_sql_v1::model::Settings;
28838 /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
28839 /// ```
28840 pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
28841 where
28842 T: std::convert::Into<i64>,
28843 {
28844 self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
28845 self
28846 }
28847
28848 /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
28849 ///
28850 /// # Example
28851 /// ```ignore,no_run
28852 /// # use google_cloud_sql_v1::model::Settings;
28853 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
28854 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
28855 /// ```
28856 pub fn set_or_clear_data_disk_provisioned_throughput<T>(
28857 mut self,
28858 v: std::option::Option<T>,
28859 ) -> Self
28860 where
28861 T: std::convert::Into<i64>,
28862 {
28863 self.data_disk_provisioned_throughput = v.map(|x| x.into());
28864 self
28865 }
28866
28867 /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
28868 ///
28869 /// # Example
28870 /// ```ignore,no_run
28871 /// # use google_cloud_sql_v1::model::Settings;
28872 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
28873 /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
28874 /// ```
28875 pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
28876 where
28877 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
28878 {
28879 self.connection_pool_config = std::option::Option::Some(v.into());
28880 self
28881 }
28882
28883 /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
28884 ///
28885 /// # Example
28886 /// ```ignore,no_run
28887 /// # use google_cloud_sql_v1::model::Settings;
28888 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
28889 /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
28890 /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
28891 /// ```
28892 pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
28893 where
28894 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
28895 {
28896 self.connection_pool_config = v.map(|x| x.into());
28897 self
28898 }
28899
28900 /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
28901 ///
28902 /// # Example
28903 /// ```ignore,no_run
28904 /// # use google_cloud_sql_v1::model::Settings;
28905 /// use google_cloud_sql_v1::model::FinalBackupConfig;
28906 /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
28907 /// ```
28908 pub fn set_final_backup_config<T>(mut self, v: T) -> Self
28909 where
28910 T: std::convert::Into<crate::model::FinalBackupConfig>,
28911 {
28912 self.final_backup_config = std::option::Option::Some(v.into());
28913 self
28914 }
28915
28916 /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
28917 ///
28918 /// # Example
28919 /// ```ignore,no_run
28920 /// # use google_cloud_sql_v1::model::Settings;
28921 /// use google_cloud_sql_v1::model::FinalBackupConfig;
28922 /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
28923 /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
28924 /// ```
28925 pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
28926 where
28927 T: std::convert::Into<crate::model::FinalBackupConfig>,
28928 {
28929 self.final_backup_config = v.map(|x| x.into());
28930 self
28931 }
28932
28933 /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
28934 ///
28935 /// # Example
28936 /// ```ignore,no_run
28937 /// # use google_cloud_sql_v1::model::Settings;
28938 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28939 /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
28940 /// ```
28941 pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
28942 where
28943 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
28944 {
28945 self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
28946 self
28947 }
28948
28949 /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
28950 ///
28951 /// # Example
28952 /// ```ignore,no_run
28953 /// # use google_cloud_sql_v1::model::Settings;
28954 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28955 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
28956 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
28957 /// ```
28958 pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
28959 where
28960 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
28961 {
28962 self.read_pool_auto_scale_config = v.map(|x| x.into());
28963 self
28964 }
28965
28966 /// Sets the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
28967 ///
28968 /// # Example
28969 /// ```ignore,no_run
28970 /// # use google_cloud_sql_v1::model::Settings;
28971 /// use wkt::BoolValue;
28972 /// let x = Settings::new().set_accelerated_replica_mode(BoolValue::default()/* use setters */);
28973 /// ```
28974 pub fn set_accelerated_replica_mode<T>(mut self, v: T) -> Self
28975 where
28976 T: std::convert::Into<wkt::BoolValue>,
28977 {
28978 self.accelerated_replica_mode = std::option::Option::Some(v.into());
28979 self
28980 }
28981
28982 /// Sets or clears the value of [accelerated_replica_mode][crate::model::Settings::accelerated_replica_mode].
28983 ///
28984 /// # Example
28985 /// ```ignore,no_run
28986 /// # use google_cloud_sql_v1::model::Settings;
28987 /// use wkt::BoolValue;
28988 /// let x = Settings::new().set_or_clear_accelerated_replica_mode(Some(BoolValue::default()/* use setters */));
28989 /// let x = Settings::new().set_or_clear_accelerated_replica_mode(None::<BoolValue>);
28990 /// ```
28991 pub fn set_or_clear_accelerated_replica_mode<T>(mut self, v: std::option::Option<T>) -> Self
28992 where
28993 T: std::convert::Into<wkt::BoolValue>,
28994 {
28995 self.accelerated_replica_mode = v.map(|x| x.into());
28996 self
28997 }
28998
28999 /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
29000 ///
29001 /// # Example
29002 /// ```ignore,no_run
29003 /// # use google_cloud_sql_v1::model::Settings;
29004 /// let x = Settings::new().set_auto_upgrade_enabled(true);
29005 /// ```
29006 pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
29007 where
29008 T: std::convert::Into<bool>,
29009 {
29010 self.auto_upgrade_enabled = std::option::Option::Some(v.into());
29011 self
29012 }
29013
29014 /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
29015 ///
29016 /// # Example
29017 /// ```ignore,no_run
29018 /// # use google_cloud_sql_v1::model::Settings;
29019 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
29020 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
29021 /// ```
29022 pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
29023 where
29024 T: std::convert::Into<bool>,
29025 {
29026 self.auto_upgrade_enabled = v.map(|x| x.into());
29027 self
29028 }
29029
29030 /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
29031 ///
29032 /// # Example
29033 /// ```ignore,no_run
29034 /// # use google_cloud_sql_v1::model::Settings;
29035 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29036 /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
29037 /// ```
29038 pub fn set_entraid_config<T>(mut self, v: T) -> Self
29039 where
29040 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
29041 {
29042 self.entraid_config = std::option::Option::Some(v.into());
29043 self
29044 }
29045
29046 /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
29047 ///
29048 /// # Example
29049 /// ```ignore,no_run
29050 /// # use google_cloud_sql_v1::model::Settings;
29051 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29052 /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
29053 /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
29054 /// ```
29055 pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
29056 where
29057 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
29058 {
29059 self.entraid_config = v.map(|x| x.into());
29060 self
29061 }
29062
29063 /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
29064 ///
29065 /// # Example
29066 /// ```ignore,no_run
29067 /// # use google_cloud_sql_v1::model::Settings;
29068 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
29069 /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
29070 /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
29071 /// ```
29072 pub fn set_data_api_access<T>(mut self, v: T) -> Self
29073 where
29074 T: std::convert::Into<crate::model::settings::DataApiAccess>,
29075 {
29076 self.data_api_access = std::option::Option::Some(v.into());
29077 self
29078 }
29079
29080 /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
29081 ///
29082 /// # Example
29083 /// ```ignore,no_run
29084 /// # use google_cloud_sql_v1::model::Settings;
29085 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
29086 /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
29087 /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
29088 /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
29089 /// ```
29090 pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
29091 where
29092 T: std::convert::Into<crate::model::settings::DataApiAccess>,
29093 {
29094 self.data_api_access = v.map(|x| x.into());
29095 self
29096 }
29097
29098 /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
29099 ///
29100 /// # Example
29101 /// ```ignore,no_run
29102 /// # use google_cloud_sql_v1::model::Settings;
29103 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29104 /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
29105 /// ```
29106 pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
29107 where
29108 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
29109 {
29110 self.performance_capture_config = std::option::Option::Some(v.into());
29111 self
29112 }
29113
29114 /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
29115 ///
29116 /// # Example
29117 /// ```ignore,no_run
29118 /// # use google_cloud_sql_v1::model::Settings;
29119 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29120 /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
29121 /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
29122 /// ```
29123 pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
29124 where
29125 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
29126 {
29127 self.performance_capture_config = v.map(|x| x.into());
29128 self
29129 }
29130}
29131
29132impl wkt::message::Message for Settings {
29133 fn typename() -> &'static str {
29134 "type.googleapis.com/google.cloud.sql.v1.Settings"
29135 }
29136}
29137
29138/// Defines additional types related to [Settings].
29139pub mod settings {
29140 #[allow(unused_imports)]
29141 use super::*;
29142
29143 /// Specifies when the instance is activated.
29144 ///
29145 /// # Working with unknown values
29146 ///
29147 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29148 /// additional enum variants at any time. Adding new variants is not considered
29149 /// a breaking change. Applications should write their code in anticipation of:
29150 ///
29151 /// - New values appearing in future releases of the client library, **and**
29152 /// - New values received dynamically, without application changes.
29153 ///
29154 /// Please consult the [Working with enums] section in the user guide for some
29155 /// guidelines.
29156 ///
29157 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29158 #[derive(Clone, Debug, PartialEq)]
29159 #[non_exhaustive]
29160 pub enum SqlActivationPolicy {
29161 /// Unknown activation plan.
29162 Unspecified,
29163 /// The instance is always up and running.
29164 Always,
29165 /// The instance never starts.
29166 Never,
29167 /// The instance starts upon receiving requests.
29168 #[deprecated]
29169 OnDemand,
29170 /// If set, the enum was initialized with an unknown value.
29171 ///
29172 /// Applications can examine the value using [SqlActivationPolicy::value] or
29173 /// [SqlActivationPolicy::name].
29174 UnknownValue(sql_activation_policy::UnknownValue),
29175 }
29176
29177 #[doc(hidden)]
29178 pub mod sql_activation_policy {
29179 #[allow(unused_imports)]
29180 use super::*;
29181 #[derive(Clone, Debug, PartialEq)]
29182 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29183 }
29184
29185 impl SqlActivationPolicy {
29186 /// Gets the enum value.
29187 ///
29188 /// Returns `None` if the enum contains an unknown value deserialized from
29189 /// the string representation of enums.
29190 pub fn value(&self) -> std::option::Option<i32> {
29191 match self {
29192 Self::Unspecified => std::option::Option::Some(0),
29193 Self::Always => std::option::Option::Some(1),
29194 Self::Never => std::option::Option::Some(2),
29195 Self::OnDemand => std::option::Option::Some(3),
29196 Self::UnknownValue(u) => u.0.value(),
29197 }
29198 }
29199
29200 /// Gets the enum value as a string.
29201 ///
29202 /// Returns `None` if the enum contains an unknown value deserialized from
29203 /// the integer representation of enums.
29204 pub fn name(&self) -> std::option::Option<&str> {
29205 match self {
29206 Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
29207 Self::Always => std::option::Option::Some("ALWAYS"),
29208 Self::Never => std::option::Option::Some("NEVER"),
29209 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
29210 Self::UnknownValue(u) => u.0.name(),
29211 }
29212 }
29213 }
29214
29215 impl std::default::Default for SqlActivationPolicy {
29216 fn default() -> Self {
29217 use std::convert::From;
29218 Self::from(0)
29219 }
29220 }
29221
29222 impl std::fmt::Display for SqlActivationPolicy {
29223 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29224 wkt::internal::display_enum(f, self.name(), self.value())
29225 }
29226 }
29227
29228 impl std::convert::From<i32> for SqlActivationPolicy {
29229 fn from(value: i32) -> Self {
29230 match value {
29231 0 => Self::Unspecified,
29232 1 => Self::Always,
29233 2 => Self::Never,
29234 3 => Self::OnDemand,
29235 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
29236 wkt::internal::UnknownEnumValue::Integer(value),
29237 )),
29238 }
29239 }
29240 }
29241
29242 impl std::convert::From<&str> for SqlActivationPolicy {
29243 fn from(value: &str) -> Self {
29244 use std::string::ToString;
29245 match value {
29246 "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
29247 "ALWAYS" => Self::Always,
29248 "NEVER" => Self::Never,
29249 "ON_DEMAND" => Self::OnDemand,
29250 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
29251 wkt::internal::UnknownEnumValue::String(value.to_string()),
29252 )),
29253 }
29254 }
29255 }
29256
29257 impl serde::ser::Serialize for SqlActivationPolicy {
29258 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29259 where
29260 S: serde::Serializer,
29261 {
29262 match self {
29263 Self::Unspecified => serializer.serialize_i32(0),
29264 Self::Always => serializer.serialize_i32(1),
29265 Self::Never => serializer.serialize_i32(2),
29266 Self::OnDemand => serializer.serialize_i32(3),
29267 Self::UnknownValue(u) => u.0.serialize(serializer),
29268 }
29269 }
29270 }
29271
29272 impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
29273 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29274 where
29275 D: serde::Deserializer<'de>,
29276 {
29277 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
29278 ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
29279 ))
29280 }
29281 }
29282
29283 /// The list of Cloud SQL editions available to users.
29284 ///
29285 /// # Working with unknown values
29286 ///
29287 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29288 /// additional enum variants at any time. Adding new variants is not considered
29289 /// a breaking change. Applications should write their code in anticipation of:
29290 ///
29291 /// - New values appearing in future releases of the client library, **and**
29292 /// - New values received dynamically, without application changes.
29293 ///
29294 /// Please consult the [Working with enums] section in the user guide for some
29295 /// guidelines.
29296 ///
29297 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29298 #[derive(Clone, Debug, PartialEq)]
29299 #[non_exhaustive]
29300 pub enum Edition {
29301 /// The instance did not specify the edition.
29302 Unspecified,
29303 /// The instance is an enterprise edition.
29304 Enterprise,
29305 /// The instance is an Enterprise Plus edition.
29306 EnterprisePlus,
29307 /// This instance is a Cloud SQL developer edition instance.
29308 Developer,
29309 /// If set, the enum was initialized with an unknown value.
29310 ///
29311 /// Applications can examine the value using [Edition::value] or
29312 /// [Edition::name].
29313 UnknownValue(edition::UnknownValue),
29314 }
29315
29316 #[doc(hidden)]
29317 pub mod edition {
29318 #[allow(unused_imports)]
29319 use super::*;
29320 #[derive(Clone, Debug, PartialEq)]
29321 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29322 }
29323
29324 impl Edition {
29325 /// Gets the enum value.
29326 ///
29327 /// Returns `None` if the enum contains an unknown value deserialized from
29328 /// the string representation of enums.
29329 pub fn value(&self) -> std::option::Option<i32> {
29330 match self {
29331 Self::Unspecified => std::option::Option::Some(0),
29332 Self::Enterprise => std::option::Option::Some(2),
29333 Self::EnterprisePlus => std::option::Option::Some(3),
29334 Self::Developer => std::option::Option::Some(5),
29335 Self::UnknownValue(u) => u.0.value(),
29336 }
29337 }
29338
29339 /// Gets the enum value as a string.
29340 ///
29341 /// Returns `None` if the enum contains an unknown value deserialized from
29342 /// the integer representation of enums.
29343 pub fn name(&self) -> std::option::Option<&str> {
29344 match self {
29345 Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
29346 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
29347 Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
29348 Self::Developer => std::option::Option::Some("DEVELOPER"),
29349 Self::UnknownValue(u) => u.0.name(),
29350 }
29351 }
29352 }
29353
29354 impl std::default::Default for Edition {
29355 fn default() -> Self {
29356 use std::convert::From;
29357 Self::from(0)
29358 }
29359 }
29360
29361 impl std::fmt::Display for Edition {
29362 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29363 wkt::internal::display_enum(f, self.name(), self.value())
29364 }
29365 }
29366
29367 impl std::convert::From<i32> for Edition {
29368 fn from(value: i32) -> Self {
29369 match value {
29370 0 => Self::Unspecified,
29371 2 => Self::Enterprise,
29372 3 => Self::EnterprisePlus,
29373 5 => Self::Developer,
29374 _ => Self::UnknownValue(edition::UnknownValue(
29375 wkt::internal::UnknownEnumValue::Integer(value),
29376 )),
29377 }
29378 }
29379 }
29380
29381 impl std::convert::From<&str> for Edition {
29382 fn from(value: &str) -> Self {
29383 use std::string::ToString;
29384 match value {
29385 "EDITION_UNSPECIFIED" => Self::Unspecified,
29386 "ENTERPRISE" => Self::Enterprise,
29387 "ENTERPRISE_PLUS" => Self::EnterprisePlus,
29388 "DEVELOPER" => Self::Developer,
29389 _ => Self::UnknownValue(edition::UnknownValue(
29390 wkt::internal::UnknownEnumValue::String(value.to_string()),
29391 )),
29392 }
29393 }
29394 }
29395
29396 impl serde::ser::Serialize for Edition {
29397 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29398 where
29399 S: serde::Serializer,
29400 {
29401 match self {
29402 Self::Unspecified => serializer.serialize_i32(0),
29403 Self::Enterprise => serializer.serialize_i32(2),
29404 Self::EnterprisePlus => serializer.serialize_i32(3),
29405 Self::Developer => serializer.serialize_i32(5),
29406 Self::UnknownValue(u) => u.0.serialize(serializer),
29407 }
29408 }
29409 }
29410
29411 impl<'de> serde::de::Deserialize<'de> for Edition {
29412 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29413 where
29414 D: serde::Deserializer<'de>,
29415 {
29416 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
29417 ".google.cloud.sql.v1.Settings.Edition",
29418 ))
29419 }
29420 }
29421
29422 /// The options for enforcing Cloud SQL connectors in the instance.
29423 ///
29424 /// # Working with unknown values
29425 ///
29426 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29427 /// additional enum variants at any time. Adding new variants is not considered
29428 /// a breaking change. Applications should write their code in anticipation of:
29429 ///
29430 /// - New values appearing in future releases of the client library, **and**
29431 /// - New values received dynamically, without application changes.
29432 ///
29433 /// Please consult the [Working with enums] section in the user guide for some
29434 /// guidelines.
29435 ///
29436 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29437 #[derive(Clone, Debug, PartialEq)]
29438 #[non_exhaustive]
29439 pub enum ConnectorEnforcement {
29440 /// The requirement for Cloud SQL connectors is unknown.
29441 Unspecified,
29442 /// Do not require Cloud SQL connectors.
29443 NotRequired,
29444 /// Require all connections to use Cloud SQL connectors, including the
29445 /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
29446 /// Note: This disables all existing authorized networks.
29447 Required,
29448 /// If set, the enum was initialized with an unknown value.
29449 ///
29450 /// Applications can examine the value using [ConnectorEnforcement::value] or
29451 /// [ConnectorEnforcement::name].
29452 UnknownValue(connector_enforcement::UnknownValue),
29453 }
29454
29455 #[doc(hidden)]
29456 pub mod connector_enforcement {
29457 #[allow(unused_imports)]
29458 use super::*;
29459 #[derive(Clone, Debug, PartialEq)]
29460 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29461 }
29462
29463 impl ConnectorEnforcement {
29464 /// Gets the enum value.
29465 ///
29466 /// Returns `None` if the enum contains an unknown value deserialized from
29467 /// the string representation of enums.
29468 pub fn value(&self) -> std::option::Option<i32> {
29469 match self {
29470 Self::Unspecified => std::option::Option::Some(0),
29471 Self::NotRequired => std::option::Option::Some(1),
29472 Self::Required => std::option::Option::Some(2),
29473 Self::UnknownValue(u) => u.0.value(),
29474 }
29475 }
29476
29477 /// Gets the enum value as a string.
29478 ///
29479 /// Returns `None` if the enum contains an unknown value deserialized from
29480 /// the integer representation of enums.
29481 pub fn name(&self) -> std::option::Option<&str> {
29482 match self {
29483 Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
29484 Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
29485 Self::Required => std::option::Option::Some("REQUIRED"),
29486 Self::UnknownValue(u) => u.0.name(),
29487 }
29488 }
29489 }
29490
29491 impl std::default::Default for ConnectorEnforcement {
29492 fn default() -> Self {
29493 use std::convert::From;
29494 Self::from(0)
29495 }
29496 }
29497
29498 impl std::fmt::Display for ConnectorEnforcement {
29499 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29500 wkt::internal::display_enum(f, self.name(), self.value())
29501 }
29502 }
29503
29504 impl std::convert::From<i32> for ConnectorEnforcement {
29505 fn from(value: i32) -> Self {
29506 match value {
29507 0 => Self::Unspecified,
29508 1 => Self::NotRequired,
29509 2 => Self::Required,
29510 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
29511 wkt::internal::UnknownEnumValue::Integer(value),
29512 )),
29513 }
29514 }
29515 }
29516
29517 impl std::convert::From<&str> for ConnectorEnforcement {
29518 fn from(value: &str) -> Self {
29519 use std::string::ToString;
29520 match value {
29521 "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
29522 "NOT_REQUIRED" => Self::NotRequired,
29523 "REQUIRED" => Self::Required,
29524 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
29525 wkt::internal::UnknownEnumValue::String(value.to_string()),
29526 )),
29527 }
29528 }
29529 }
29530
29531 impl serde::ser::Serialize for ConnectorEnforcement {
29532 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29533 where
29534 S: serde::Serializer,
29535 {
29536 match self {
29537 Self::Unspecified => serializer.serialize_i32(0),
29538 Self::NotRequired => serializer.serialize_i32(1),
29539 Self::Required => serializer.serialize_i32(2),
29540 Self::UnknownValue(u) => u.0.serialize(serializer),
29541 }
29542 }
29543 }
29544
29545 impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
29546 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29547 where
29548 D: serde::Deserializer<'de>,
29549 {
29550 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
29551 ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
29552 ))
29553 }
29554 }
29555
29556 /// ExecuteSql API's access to the instance.
29557 ///
29558 /// # Working with unknown values
29559 ///
29560 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29561 /// additional enum variants at any time. Adding new variants is not considered
29562 /// a breaking change. Applications should write their code in anticipation of:
29563 ///
29564 /// - New values appearing in future releases of the client library, **and**
29565 /// - New values received dynamically, without application changes.
29566 ///
29567 /// Please consult the [Working with enums] section in the user guide for some
29568 /// guidelines.
29569 ///
29570 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29571 #[derive(Clone, Debug, PartialEq)]
29572 #[non_exhaustive]
29573 pub enum DataApiAccess {
29574 /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
29575 Unspecified,
29576 /// Disallow using ExecuteSql API to connect to the instance.
29577 DisallowDataApi,
29578 /// Allow using ExecuteSql API to connect to the instance. For private IP
29579 /// instances, this allows authorized users to access the instance from
29580 /// the public internet using ExecuteSql API.
29581 AllowDataApi,
29582 /// If set, the enum was initialized with an unknown value.
29583 ///
29584 /// Applications can examine the value using [DataApiAccess::value] or
29585 /// [DataApiAccess::name].
29586 UnknownValue(data_api_access::UnknownValue),
29587 }
29588
29589 #[doc(hidden)]
29590 pub mod data_api_access {
29591 #[allow(unused_imports)]
29592 use super::*;
29593 #[derive(Clone, Debug, PartialEq)]
29594 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29595 }
29596
29597 impl DataApiAccess {
29598 /// Gets the enum value.
29599 ///
29600 /// Returns `None` if the enum contains an unknown value deserialized from
29601 /// the string representation of enums.
29602 pub fn value(&self) -> std::option::Option<i32> {
29603 match self {
29604 Self::Unspecified => std::option::Option::Some(0),
29605 Self::DisallowDataApi => std::option::Option::Some(1),
29606 Self::AllowDataApi => std::option::Option::Some(2),
29607 Self::UnknownValue(u) => u.0.value(),
29608 }
29609 }
29610
29611 /// Gets the enum value as a string.
29612 ///
29613 /// Returns `None` if the enum contains an unknown value deserialized from
29614 /// the integer representation of enums.
29615 pub fn name(&self) -> std::option::Option<&str> {
29616 match self {
29617 Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
29618 Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
29619 Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
29620 Self::UnknownValue(u) => u.0.name(),
29621 }
29622 }
29623 }
29624
29625 impl std::default::Default for DataApiAccess {
29626 fn default() -> Self {
29627 use std::convert::From;
29628 Self::from(0)
29629 }
29630 }
29631
29632 impl std::fmt::Display for DataApiAccess {
29633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29634 wkt::internal::display_enum(f, self.name(), self.value())
29635 }
29636 }
29637
29638 impl std::convert::From<i32> for DataApiAccess {
29639 fn from(value: i32) -> Self {
29640 match value {
29641 0 => Self::Unspecified,
29642 1 => Self::DisallowDataApi,
29643 2 => Self::AllowDataApi,
29644 _ => Self::UnknownValue(data_api_access::UnknownValue(
29645 wkt::internal::UnknownEnumValue::Integer(value),
29646 )),
29647 }
29648 }
29649 }
29650
29651 impl std::convert::From<&str> for DataApiAccess {
29652 fn from(value: &str) -> Self {
29653 use std::string::ToString;
29654 match value {
29655 "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
29656 "DISALLOW_DATA_API" => Self::DisallowDataApi,
29657 "ALLOW_DATA_API" => Self::AllowDataApi,
29658 _ => Self::UnknownValue(data_api_access::UnknownValue(
29659 wkt::internal::UnknownEnumValue::String(value.to_string()),
29660 )),
29661 }
29662 }
29663 }
29664
29665 impl serde::ser::Serialize for DataApiAccess {
29666 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29667 where
29668 S: serde::Serializer,
29669 {
29670 match self {
29671 Self::Unspecified => serializer.serialize_i32(0),
29672 Self::DisallowDataApi => serializer.serialize_i32(1),
29673 Self::AllowDataApi => serializer.serialize_i32(2),
29674 Self::UnknownValue(u) => u.0.serialize(serializer),
29675 }
29676 }
29677 }
29678
29679 impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
29680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29681 where
29682 D: serde::Deserializer<'de>,
29683 {
29684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
29685 ".google.cloud.sql.v1.Settings.DataApiAccess",
29686 ))
29687 }
29688 }
29689}
29690
29691/// Performance capture configuration.
29692#[derive(Clone, Default, PartialEq)]
29693#[non_exhaustive]
29694pub struct PerformanceCaptureConfig {
29695 /// Optional. Enables or disables the performance capture feature.
29696 pub enabled: std::option::Option<bool>,
29697
29698 /// Optional. Specifies the interval in seconds between consecutive probes that
29699 /// check if any trigger condition thresholds have been reached.
29700 pub probing_interval_seconds: std::option::Option<i32>,
29701
29702 /// Optional. Specifies the minimum number of consecutive probe threshold that
29703 /// triggers performance capture.
29704 pub probe_threshold: std::option::Option<i32>,
29705
29706 /// Optional. Specifies the minimum number of MySQL `Threads_running` to
29707 /// trigger the performance capture on the primary instance.
29708 pub running_threads_threshold: std::option::Option<i32>,
29709
29710 /// Optional. Specifies the minimum number of seconds replica must be lagging
29711 /// behind primary instance to trigger the performance capture on replica.
29712 pub seconds_behind_source_threshold: std::option::Option<i32>,
29713
29714 /// Optional. Specifies the amount of time in seconds that a transaction needs
29715 /// to have been open before the watcher starts recording it.
29716 pub transaction_duration_threshold: std::option::Option<i32>,
29717
29718 /// Optional. Specifies the minimum percentage of CPU utilization to trigger
29719 /// the performance capture. Valid integers range from `10` to `99`. Enter `0`
29720 /// to disable the check.
29721 pub cpu_utilization_threshold_percent: std::option::Option<i32>,
29722
29723 /// Optional. Specifies the minimum percentage of memory usage to trigger the
29724 /// performance capture.
29725 /// Valid integers range from `10` to `99`. Enter `0` to disable the check.
29726 pub memory_usage_threshold_percent: std::option::Option<i32>,
29727
29728 /// Optional. Specifies the minimum allowed number of transactions in lock wait
29729 /// state to trigger the performance capture. Valid integers range from `10` to
29730 /// `10000`. Enter `0` to disable the check.
29731 pub transaction_lock_wait_threshold_count: std::option::Option<i32>,
29732
29733 /// Optional. Specifies the minimum allowed number of semaphore waits to
29734 /// trigger the performance capture. Valid integers range from `10` to `10000`.
29735 /// Enter `0` to disable the check.
29736 pub semaphore_wait_threshold_count: std::option::Option<i32>,
29737
29738 /// Optional. Specifies the minimum number of undo log entries in the history
29739 /// list length to trigger the performance capture. Valid integers range from
29740 /// `10000` to `10000000`. Enter `0` to disable the check.
29741 pub history_list_length_threshold_count: std::option::Option<i32>,
29742
29743 /// Optional. Specifies the amount of time in seconds that a transaction needs
29744 /// to have been open before the watcher starts terminating it. Valid integers
29745 /// range from `60` to `604800` (7 days). Enter `0` to disable. If enabled
29746 /// (i.e., > 0), this value must be greater than or equal to
29747 /// `transaction_duration_threshold`. Configurations where
29748 /// `0 < transaction_kill_threshold_seconds < transaction_duration_threshold`
29749 /// will be rejected.
29750 pub transaction_kill_threshold_seconds: std::option::Option<i32>,
29751
29752 /// Optional. Specifies a customer-defined list of users to exclude from
29753 /// transaction termination. Entries can be in the format 'user@host' or just
29754 /// 'user'. A standalone 'user' implies 'user@%', excluding the user from any
29755 /// host. Wildcard '%' is allowed in the host part of the 'user@host' format.
29756 /// Example: `["app_user", "db_admin@10.1.2.3", "report_user@%"]`
29757 pub transaction_kill_excluded_user_hosts: std::vec::Vec<std::string::String>,
29758
29759 /// Optional. Determines which transactions are allowed to be terminated when
29760 /// they exceed `transaction_kill_threshold_seconds`. This allows protecting
29761 /// write-heavy transactions from auto-termination if desired. Defaults to
29762 /// `READ_ONLY_TRANSACTIONS` if unspecified.
29763 pub transaction_kill_type:
29764 std::option::Option<crate::model::performance_capture_config::TransactionKillType>,
29765
29766 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29767}
29768
29769impl PerformanceCaptureConfig {
29770 /// Creates a new default instance.
29771 pub fn new() -> Self {
29772 std::default::Default::default()
29773 }
29774
29775 /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
29776 ///
29777 /// # Example
29778 /// ```ignore,no_run
29779 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29780 /// let x = PerformanceCaptureConfig::new().set_enabled(true);
29781 /// ```
29782 pub fn set_enabled<T>(mut self, v: T) -> Self
29783 where
29784 T: std::convert::Into<bool>,
29785 {
29786 self.enabled = std::option::Option::Some(v.into());
29787 self
29788 }
29789
29790 /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
29791 ///
29792 /// # Example
29793 /// ```ignore,no_run
29794 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29795 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
29796 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
29797 /// ```
29798 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
29799 where
29800 T: std::convert::Into<bool>,
29801 {
29802 self.enabled = v.map(|x| x.into());
29803 self
29804 }
29805
29806 /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
29807 ///
29808 /// # Example
29809 /// ```ignore,no_run
29810 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29811 /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
29812 /// ```
29813 pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
29814 where
29815 T: std::convert::Into<i32>,
29816 {
29817 self.probing_interval_seconds = std::option::Option::Some(v.into());
29818 self
29819 }
29820
29821 /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
29822 ///
29823 /// # Example
29824 /// ```ignore,no_run
29825 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29826 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
29827 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
29828 /// ```
29829 pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
29830 where
29831 T: std::convert::Into<i32>,
29832 {
29833 self.probing_interval_seconds = v.map(|x| x.into());
29834 self
29835 }
29836
29837 /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
29838 ///
29839 /// # Example
29840 /// ```ignore,no_run
29841 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29842 /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
29843 /// ```
29844 pub fn set_probe_threshold<T>(mut self, v: T) -> Self
29845 where
29846 T: std::convert::Into<i32>,
29847 {
29848 self.probe_threshold = std::option::Option::Some(v.into());
29849 self
29850 }
29851
29852 /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
29853 ///
29854 /// # Example
29855 /// ```ignore,no_run
29856 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29857 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
29858 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
29859 /// ```
29860 pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
29861 where
29862 T: std::convert::Into<i32>,
29863 {
29864 self.probe_threshold = v.map(|x| x.into());
29865 self
29866 }
29867
29868 /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
29869 ///
29870 /// # Example
29871 /// ```ignore,no_run
29872 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29873 /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
29874 /// ```
29875 pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
29876 where
29877 T: std::convert::Into<i32>,
29878 {
29879 self.running_threads_threshold = std::option::Option::Some(v.into());
29880 self
29881 }
29882
29883 /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
29884 ///
29885 /// # Example
29886 /// ```ignore,no_run
29887 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29888 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
29889 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
29890 /// ```
29891 pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
29892 where
29893 T: std::convert::Into<i32>,
29894 {
29895 self.running_threads_threshold = v.map(|x| x.into());
29896 self
29897 }
29898
29899 /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
29900 ///
29901 /// # Example
29902 /// ```ignore,no_run
29903 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29904 /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
29905 /// ```
29906 pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
29907 where
29908 T: std::convert::Into<i32>,
29909 {
29910 self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
29911 self
29912 }
29913
29914 /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
29915 ///
29916 /// # Example
29917 /// ```ignore,no_run
29918 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29919 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
29920 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
29921 /// ```
29922 pub fn set_or_clear_seconds_behind_source_threshold<T>(
29923 mut self,
29924 v: std::option::Option<T>,
29925 ) -> Self
29926 where
29927 T: std::convert::Into<i32>,
29928 {
29929 self.seconds_behind_source_threshold = v.map(|x| x.into());
29930 self
29931 }
29932
29933 /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
29934 ///
29935 /// # Example
29936 /// ```ignore,no_run
29937 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29938 /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
29939 /// ```
29940 pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
29941 where
29942 T: std::convert::Into<i32>,
29943 {
29944 self.transaction_duration_threshold = std::option::Option::Some(v.into());
29945 self
29946 }
29947
29948 /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
29949 ///
29950 /// # Example
29951 /// ```ignore,no_run
29952 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29953 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
29954 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
29955 /// ```
29956 pub fn set_or_clear_transaction_duration_threshold<T>(
29957 mut self,
29958 v: std::option::Option<T>,
29959 ) -> Self
29960 where
29961 T: std::convert::Into<i32>,
29962 {
29963 self.transaction_duration_threshold = v.map(|x| x.into());
29964 self
29965 }
29966
29967 /// Sets the value of [cpu_utilization_threshold_percent][crate::model::PerformanceCaptureConfig::cpu_utilization_threshold_percent].
29968 ///
29969 /// # Example
29970 /// ```ignore,no_run
29971 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29972 /// let x = PerformanceCaptureConfig::new().set_cpu_utilization_threshold_percent(42);
29973 /// ```
29974 pub fn set_cpu_utilization_threshold_percent<T>(mut self, v: T) -> Self
29975 where
29976 T: std::convert::Into<i32>,
29977 {
29978 self.cpu_utilization_threshold_percent = std::option::Option::Some(v.into());
29979 self
29980 }
29981
29982 /// Sets or clears the value of [cpu_utilization_threshold_percent][crate::model::PerformanceCaptureConfig::cpu_utilization_threshold_percent].
29983 ///
29984 /// # Example
29985 /// ```ignore,no_run
29986 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
29987 /// let x = PerformanceCaptureConfig::new().set_or_clear_cpu_utilization_threshold_percent(Some(42));
29988 /// let x = PerformanceCaptureConfig::new().set_or_clear_cpu_utilization_threshold_percent(None::<i32>);
29989 /// ```
29990 pub fn set_or_clear_cpu_utilization_threshold_percent<T>(
29991 mut self,
29992 v: std::option::Option<T>,
29993 ) -> Self
29994 where
29995 T: std::convert::Into<i32>,
29996 {
29997 self.cpu_utilization_threshold_percent = v.map(|x| x.into());
29998 self
29999 }
30000
30001 /// Sets the value of [memory_usage_threshold_percent][crate::model::PerformanceCaptureConfig::memory_usage_threshold_percent].
30002 ///
30003 /// # Example
30004 /// ```ignore,no_run
30005 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30006 /// let x = PerformanceCaptureConfig::new().set_memory_usage_threshold_percent(42);
30007 /// ```
30008 pub fn set_memory_usage_threshold_percent<T>(mut self, v: T) -> Self
30009 where
30010 T: std::convert::Into<i32>,
30011 {
30012 self.memory_usage_threshold_percent = std::option::Option::Some(v.into());
30013 self
30014 }
30015
30016 /// Sets or clears the value of [memory_usage_threshold_percent][crate::model::PerformanceCaptureConfig::memory_usage_threshold_percent].
30017 ///
30018 /// # Example
30019 /// ```ignore,no_run
30020 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30021 /// let x = PerformanceCaptureConfig::new().set_or_clear_memory_usage_threshold_percent(Some(42));
30022 /// let x = PerformanceCaptureConfig::new().set_or_clear_memory_usage_threshold_percent(None::<i32>);
30023 /// ```
30024 pub fn set_or_clear_memory_usage_threshold_percent<T>(
30025 mut self,
30026 v: std::option::Option<T>,
30027 ) -> Self
30028 where
30029 T: std::convert::Into<i32>,
30030 {
30031 self.memory_usage_threshold_percent = v.map(|x| x.into());
30032 self
30033 }
30034
30035 /// Sets the value of [transaction_lock_wait_threshold_count][crate::model::PerformanceCaptureConfig::transaction_lock_wait_threshold_count].
30036 ///
30037 /// # Example
30038 /// ```ignore,no_run
30039 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30040 /// let x = PerformanceCaptureConfig::new().set_transaction_lock_wait_threshold_count(42);
30041 /// ```
30042 pub fn set_transaction_lock_wait_threshold_count<T>(mut self, v: T) -> Self
30043 where
30044 T: std::convert::Into<i32>,
30045 {
30046 self.transaction_lock_wait_threshold_count = std::option::Option::Some(v.into());
30047 self
30048 }
30049
30050 /// Sets or clears the value of [transaction_lock_wait_threshold_count][crate::model::PerformanceCaptureConfig::transaction_lock_wait_threshold_count].
30051 ///
30052 /// # Example
30053 /// ```ignore,no_run
30054 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30055 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_lock_wait_threshold_count(Some(42));
30056 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_lock_wait_threshold_count(None::<i32>);
30057 /// ```
30058 pub fn set_or_clear_transaction_lock_wait_threshold_count<T>(
30059 mut self,
30060 v: std::option::Option<T>,
30061 ) -> Self
30062 where
30063 T: std::convert::Into<i32>,
30064 {
30065 self.transaction_lock_wait_threshold_count = v.map(|x| x.into());
30066 self
30067 }
30068
30069 /// Sets the value of [semaphore_wait_threshold_count][crate::model::PerformanceCaptureConfig::semaphore_wait_threshold_count].
30070 ///
30071 /// # Example
30072 /// ```ignore,no_run
30073 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30074 /// let x = PerformanceCaptureConfig::new().set_semaphore_wait_threshold_count(42);
30075 /// ```
30076 pub fn set_semaphore_wait_threshold_count<T>(mut self, v: T) -> Self
30077 where
30078 T: std::convert::Into<i32>,
30079 {
30080 self.semaphore_wait_threshold_count = std::option::Option::Some(v.into());
30081 self
30082 }
30083
30084 /// Sets or clears the value of [semaphore_wait_threshold_count][crate::model::PerformanceCaptureConfig::semaphore_wait_threshold_count].
30085 ///
30086 /// # Example
30087 /// ```ignore,no_run
30088 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30089 /// let x = PerformanceCaptureConfig::new().set_or_clear_semaphore_wait_threshold_count(Some(42));
30090 /// let x = PerformanceCaptureConfig::new().set_or_clear_semaphore_wait_threshold_count(None::<i32>);
30091 /// ```
30092 pub fn set_or_clear_semaphore_wait_threshold_count<T>(
30093 mut self,
30094 v: std::option::Option<T>,
30095 ) -> Self
30096 where
30097 T: std::convert::Into<i32>,
30098 {
30099 self.semaphore_wait_threshold_count = v.map(|x| x.into());
30100 self
30101 }
30102
30103 /// Sets the value of [history_list_length_threshold_count][crate::model::PerformanceCaptureConfig::history_list_length_threshold_count].
30104 ///
30105 /// # Example
30106 /// ```ignore,no_run
30107 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30108 /// let x = PerformanceCaptureConfig::new().set_history_list_length_threshold_count(42);
30109 /// ```
30110 pub fn set_history_list_length_threshold_count<T>(mut self, v: T) -> Self
30111 where
30112 T: std::convert::Into<i32>,
30113 {
30114 self.history_list_length_threshold_count = std::option::Option::Some(v.into());
30115 self
30116 }
30117
30118 /// Sets or clears the value of [history_list_length_threshold_count][crate::model::PerformanceCaptureConfig::history_list_length_threshold_count].
30119 ///
30120 /// # Example
30121 /// ```ignore,no_run
30122 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30123 /// let x = PerformanceCaptureConfig::new().set_or_clear_history_list_length_threshold_count(Some(42));
30124 /// let x = PerformanceCaptureConfig::new().set_or_clear_history_list_length_threshold_count(None::<i32>);
30125 /// ```
30126 pub fn set_or_clear_history_list_length_threshold_count<T>(
30127 mut self,
30128 v: std::option::Option<T>,
30129 ) -> Self
30130 where
30131 T: std::convert::Into<i32>,
30132 {
30133 self.history_list_length_threshold_count = v.map(|x| x.into());
30134 self
30135 }
30136
30137 /// Sets the value of [transaction_kill_threshold_seconds][crate::model::PerformanceCaptureConfig::transaction_kill_threshold_seconds].
30138 ///
30139 /// # Example
30140 /// ```ignore,no_run
30141 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30142 /// let x = PerformanceCaptureConfig::new().set_transaction_kill_threshold_seconds(42);
30143 /// ```
30144 pub fn set_transaction_kill_threshold_seconds<T>(mut self, v: T) -> Self
30145 where
30146 T: std::convert::Into<i32>,
30147 {
30148 self.transaction_kill_threshold_seconds = std::option::Option::Some(v.into());
30149 self
30150 }
30151
30152 /// Sets or clears the value of [transaction_kill_threshold_seconds][crate::model::PerformanceCaptureConfig::transaction_kill_threshold_seconds].
30153 ///
30154 /// # Example
30155 /// ```ignore,no_run
30156 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30157 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_threshold_seconds(Some(42));
30158 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_threshold_seconds(None::<i32>);
30159 /// ```
30160 pub fn set_or_clear_transaction_kill_threshold_seconds<T>(
30161 mut self,
30162 v: std::option::Option<T>,
30163 ) -> Self
30164 where
30165 T: std::convert::Into<i32>,
30166 {
30167 self.transaction_kill_threshold_seconds = v.map(|x| x.into());
30168 self
30169 }
30170
30171 /// Sets the value of [transaction_kill_excluded_user_hosts][crate::model::PerformanceCaptureConfig::transaction_kill_excluded_user_hosts].
30172 ///
30173 /// # Example
30174 /// ```ignore,no_run
30175 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30176 /// let x = PerformanceCaptureConfig::new().set_transaction_kill_excluded_user_hosts(["a", "b", "c"]);
30177 /// ```
30178 pub fn set_transaction_kill_excluded_user_hosts<T, V>(mut self, v: T) -> Self
30179 where
30180 T: std::iter::IntoIterator<Item = V>,
30181 V: std::convert::Into<std::string::String>,
30182 {
30183 use std::iter::Iterator;
30184 self.transaction_kill_excluded_user_hosts = v.into_iter().map(|i| i.into()).collect();
30185 self
30186 }
30187
30188 /// Sets the value of [transaction_kill_type][crate::model::PerformanceCaptureConfig::transaction_kill_type].
30189 ///
30190 /// # Example
30191 /// ```ignore,no_run
30192 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30193 /// use google_cloud_sql_v1::model::performance_capture_config::TransactionKillType;
30194 /// let x0 = PerformanceCaptureConfig::new().set_transaction_kill_type(TransactionKillType::ReadOnlyTransactions);
30195 /// let x1 = PerformanceCaptureConfig::new().set_transaction_kill_type(TransactionKillType::AllTransactions);
30196 /// ```
30197 pub fn set_transaction_kill_type<T>(mut self, v: T) -> Self
30198 where
30199 T: std::convert::Into<crate::model::performance_capture_config::TransactionKillType>,
30200 {
30201 self.transaction_kill_type = std::option::Option::Some(v.into());
30202 self
30203 }
30204
30205 /// Sets or clears the value of [transaction_kill_type][crate::model::PerformanceCaptureConfig::transaction_kill_type].
30206 ///
30207 /// # Example
30208 /// ```ignore,no_run
30209 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
30210 /// use google_cloud_sql_v1::model::performance_capture_config::TransactionKillType;
30211 /// let x0 = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(Some(TransactionKillType::ReadOnlyTransactions));
30212 /// let x1 = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(Some(TransactionKillType::AllTransactions));
30213 /// let x_none = PerformanceCaptureConfig::new().set_or_clear_transaction_kill_type(None::<TransactionKillType>);
30214 /// ```
30215 pub fn set_or_clear_transaction_kill_type<T>(mut self, v: std::option::Option<T>) -> Self
30216 where
30217 T: std::convert::Into<crate::model::performance_capture_config::TransactionKillType>,
30218 {
30219 self.transaction_kill_type = v.map(|x| x.into());
30220 self
30221 }
30222}
30223
30224impl wkt::message::Message for PerformanceCaptureConfig {
30225 fn typename() -> &'static str {
30226 "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
30227 }
30228}
30229
30230/// Defines additional types related to [PerformanceCaptureConfig].
30231pub mod performance_capture_config {
30232 #[allow(unused_imports)]
30233 use super::*;
30234
30235 /// Defines the categories of long-running transactions eligible for automatic
30236 /// termination by the Performance Capture.
30237 ///
30238 /// # Working with unknown values
30239 ///
30240 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
30241 /// additional enum variants at any time. Adding new variants is not considered
30242 /// a breaking change. Applications should write their code in anticipation of:
30243 ///
30244 /// - New values appearing in future releases of the client library, **and**
30245 /// - New values received dynamically, without application changes.
30246 ///
30247 /// Please consult the [Working with enums] section in the user guide for some
30248 /// guidelines.
30249 ///
30250 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
30251 #[derive(Clone, Debug, PartialEq)]
30252 #[non_exhaustive]
30253 pub enum TransactionKillType {
30254 /// Unspecified.
30255 Unspecified,
30256 /// Only read-only transactions are eligible for termination.
30257 ReadOnlyTransactions,
30258 /// All transactions are eligible for termination, including those with write
30259 /// operations (such as INSERT, UPDATE, DELETE, or DDL).
30260 AllTransactions,
30261 /// If set, the enum was initialized with an unknown value.
30262 ///
30263 /// Applications can examine the value using [TransactionKillType::value] or
30264 /// [TransactionKillType::name].
30265 UnknownValue(transaction_kill_type::UnknownValue),
30266 }
30267
30268 #[doc(hidden)]
30269 pub mod transaction_kill_type {
30270 #[allow(unused_imports)]
30271 use super::*;
30272 #[derive(Clone, Debug, PartialEq)]
30273 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
30274 }
30275
30276 impl TransactionKillType {
30277 /// Gets the enum value.
30278 ///
30279 /// Returns `None` if the enum contains an unknown value deserialized from
30280 /// the string representation of enums.
30281 pub fn value(&self) -> std::option::Option<i32> {
30282 match self {
30283 Self::Unspecified => std::option::Option::Some(0),
30284 Self::ReadOnlyTransactions => std::option::Option::Some(1),
30285 Self::AllTransactions => std::option::Option::Some(2),
30286 Self::UnknownValue(u) => u.0.value(),
30287 }
30288 }
30289
30290 /// Gets the enum value as a string.
30291 ///
30292 /// Returns `None` if the enum contains an unknown value deserialized from
30293 /// the integer representation of enums.
30294 pub fn name(&self) -> std::option::Option<&str> {
30295 match self {
30296 Self::Unspecified => std::option::Option::Some("TRANSACTION_KILL_TYPE_UNSPECIFIED"),
30297 Self::ReadOnlyTransactions => std::option::Option::Some("READ_ONLY_TRANSACTIONS"),
30298 Self::AllTransactions => std::option::Option::Some("ALL_TRANSACTIONS"),
30299 Self::UnknownValue(u) => u.0.name(),
30300 }
30301 }
30302 }
30303
30304 impl std::default::Default for TransactionKillType {
30305 fn default() -> Self {
30306 use std::convert::From;
30307 Self::from(0)
30308 }
30309 }
30310
30311 impl std::fmt::Display for TransactionKillType {
30312 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
30313 wkt::internal::display_enum(f, self.name(), self.value())
30314 }
30315 }
30316
30317 impl std::convert::From<i32> for TransactionKillType {
30318 fn from(value: i32) -> Self {
30319 match value {
30320 0 => Self::Unspecified,
30321 1 => Self::ReadOnlyTransactions,
30322 2 => Self::AllTransactions,
30323 _ => Self::UnknownValue(transaction_kill_type::UnknownValue(
30324 wkt::internal::UnknownEnumValue::Integer(value),
30325 )),
30326 }
30327 }
30328 }
30329
30330 impl std::convert::From<&str> for TransactionKillType {
30331 fn from(value: &str) -> Self {
30332 use std::string::ToString;
30333 match value {
30334 "TRANSACTION_KILL_TYPE_UNSPECIFIED" => Self::Unspecified,
30335 "READ_ONLY_TRANSACTIONS" => Self::ReadOnlyTransactions,
30336 "ALL_TRANSACTIONS" => Self::AllTransactions,
30337 _ => Self::UnknownValue(transaction_kill_type::UnknownValue(
30338 wkt::internal::UnknownEnumValue::String(value.to_string()),
30339 )),
30340 }
30341 }
30342 }
30343
30344 impl serde::ser::Serialize for TransactionKillType {
30345 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
30346 where
30347 S: serde::Serializer,
30348 {
30349 match self {
30350 Self::Unspecified => serializer.serialize_i32(0),
30351 Self::ReadOnlyTransactions => serializer.serialize_i32(1),
30352 Self::AllTransactions => serializer.serialize_i32(2),
30353 Self::UnknownValue(u) => u.0.serialize(serializer),
30354 }
30355 }
30356 }
30357
30358 impl<'de> serde::de::Deserialize<'de> for TransactionKillType {
30359 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30360 where
30361 D: serde::Deserializer<'de>,
30362 {
30363 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransactionKillType>::new(
30364 ".google.cloud.sql.v1.PerformanceCaptureConfig.TransactionKillType",
30365 ))
30366 }
30367 }
30368}
30369
30370/// Connection pool flags for Cloud SQL instances managed connection pool
30371/// configuration.
30372#[derive(Clone, Default, PartialEq)]
30373#[non_exhaustive]
30374pub struct ConnectionPoolFlags {
30375 /// Required. The name of the flag.
30376 pub name: std::string::String,
30377
30378 /// Required. The value of the flag. Boolean flags are set to `on` for true
30379 /// and `off` for false. This field must be omitted if the flag
30380 /// doesn't take a value.
30381 pub value: std::string::String,
30382
30383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30384}
30385
30386impl ConnectionPoolFlags {
30387 /// Creates a new default instance.
30388 pub fn new() -> Self {
30389 std::default::Default::default()
30390 }
30391
30392 /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
30393 ///
30394 /// # Example
30395 /// ```ignore,no_run
30396 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
30397 /// let x = ConnectionPoolFlags::new().set_name("example");
30398 /// ```
30399 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30400 self.name = v.into();
30401 self
30402 }
30403
30404 /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
30405 ///
30406 /// # Example
30407 /// ```ignore,no_run
30408 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
30409 /// let x = ConnectionPoolFlags::new().set_value("example");
30410 /// ```
30411 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30412 self.value = v.into();
30413 self
30414 }
30415}
30416
30417impl wkt::message::Message for ConnectionPoolFlags {
30418 fn typename() -> &'static str {
30419 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
30420 }
30421}
30422
30423/// The managed connection pooling configuration.
30424#[derive(Clone, Default, PartialEq)]
30425#[non_exhaustive]
30426pub struct ConnectionPoolConfig {
30427 /// Whether managed connection pooling is enabled.
30428 pub connection_pooling_enabled: std::option::Option<bool>,
30429
30430 /// Optional. List of connection pool configuration flags.
30431 pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
30432
30433 /// Output only. Number of connection poolers.
30434 pub pooler_count: std::option::Option<i32>,
30435
30436 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30437}
30438
30439impl ConnectionPoolConfig {
30440 /// Creates a new default instance.
30441 pub fn new() -> Self {
30442 std::default::Default::default()
30443 }
30444
30445 /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
30446 ///
30447 /// # Example
30448 /// ```ignore,no_run
30449 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
30450 /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
30451 /// ```
30452 pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
30453 where
30454 T: std::convert::Into<bool>,
30455 {
30456 self.connection_pooling_enabled = std::option::Option::Some(v.into());
30457 self
30458 }
30459
30460 /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
30461 ///
30462 /// # Example
30463 /// ```ignore,no_run
30464 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
30465 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
30466 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
30467 /// ```
30468 pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
30469 where
30470 T: std::convert::Into<bool>,
30471 {
30472 self.connection_pooling_enabled = v.map(|x| x.into());
30473 self
30474 }
30475
30476 /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
30477 ///
30478 /// # Example
30479 /// ```ignore,no_run
30480 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
30481 /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
30482 /// let x = ConnectionPoolConfig::new()
30483 /// .set_flags([
30484 /// ConnectionPoolFlags::default()/* use setters */,
30485 /// ConnectionPoolFlags::default()/* use (different) setters */,
30486 /// ]);
30487 /// ```
30488 pub fn set_flags<T, V>(mut self, v: T) -> Self
30489 where
30490 T: std::iter::IntoIterator<Item = V>,
30491 V: std::convert::Into<crate::model::ConnectionPoolFlags>,
30492 {
30493 use std::iter::Iterator;
30494 self.flags = v.into_iter().map(|i| i.into()).collect();
30495 self
30496 }
30497
30498 /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
30499 ///
30500 /// # Example
30501 /// ```ignore,no_run
30502 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
30503 /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
30504 /// ```
30505 pub fn set_pooler_count<T>(mut self, v: T) -> Self
30506 where
30507 T: std::convert::Into<i32>,
30508 {
30509 self.pooler_count = std::option::Option::Some(v.into());
30510 self
30511 }
30512
30513 /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
30514 ///
30515 /// # Example
30516 /// ```ignore,no_run
30517 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
30518 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
30519 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
30520 /// ```
30521 pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
30522 where
30523 T: std::convert::Into<i32>,
30524 {
30525 self.pooler_count = v.map(|x| x.into());
30526 self
30527 }
30528}
30529
30530impl wkt::message::Message for ConnectionPoolConfig {
30531 fn typename() -> &'static str {
30532 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
30533 }
30534}
30535
30536/// The read pool auto-scale configuration.
30537#[derive(Clone, Default, PartialEq)]
30538#[non_exhaustive]
30539pub struct ReadPoolAutoScaleConfig {
30540 /// Indicates whether read pool auto scaling is enabled.
30541 pub enabled: std::option::Option<bool>,
30542
30543 /// Minimum number of read pool nodes to be maintained.
30544 pub min_node_count: std::option::Option<i32>,
30545
30546 /// Maximum number of read pool nodes to be maintained.
30547 pub max_node_count: std::option::Option<i32>,
30548
30549 /// Optional. Target metrics for read pool auto scaling.
30550 pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
30551
30552 /// Indicates whether read pool auto scaling supports scale in operations
30553 /// (removing nodes).
30554 pub disable_scale_in: std::option::Option<bool>,
30555
30556 /// The cooldown period for scale-in operations.
30557 pub scale_in_cooldown_seconds: std::option::Option<i32>,
30558
30559 /// The cooldown period for scale-out operations.
30560 pub scale_out_cooldown_seconds: std::option::Option<i32>,
30561
30562 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30563}
30564
30565impl ReadPoolAutoScaleConfig {
30566 /// Creates a new default instance.
30567 pub fn new() -> Self {
30568 std::default::Default::default()
30569 }
30570
30571 /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
30572 ///
30573 /// # Example
30574 /// ```ignore,no_run
30575 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30576 /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
30577 /// ```
30578 pub fn set_enabled<T>(mut self, v: T) -> Self
30579 where
30580 T: std::convert::Into<bool>,
30581 {
30582 self.enabled = std::option::Option::Some(v.into());
30583 self
30584 }
30585
30586 /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
30587 ///
30588 /// # Example
30589 /// ```ignore,no_run
30590 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30591 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
30592 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
30593 /// ```
30594 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
30595 where
30596 T: std::convert::Into<bool>,
30597 {
30598 self.enabled = v.map(|x| x.into());
30599 self
30600 }
30601
30602 /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
30603 ///
30604 /// # Example
30605 /// ```ignore,no_run
30606 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30607 /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
30608 /// ```
30609 pub fn set_min_node_count<T>(mut self, v: T) -> Self
30610 where
30611 T: std::convert::Into<i32>,
30612 {
30613 self.min_node_count = std::option::Option::Some(v.into());
30614 self
30615 }
30616
30617 /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
30618 ///
30619 /// # Example
30620 /// ```ignore,no_run
30621 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30622 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
30623 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
30624 /// ```
30625 pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
30626 where
30627 T: std::convert::Into<i32>,
30628 {
30629 self.min_node_count = v.map(|x| x.into());
30630 self
30631 }
30632
30633 /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
30634 ///
30635 /// # Example
30636 /// ```ignore,no_run
30637 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30638 /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
30639 /// ```
30640 pub fn set_max_node_count<T>(mut self, v: T) -> Self
30641 where
30642 T: std::convert::Into<i32>,
30643 {
30644 self.max_node_count = std::option::Option::Some(v.into());
30645 self
30646 }
30647
30648 /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
30649 ///
30650 /// # Example
30651 /// ```ignore,no_run
30652 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30653 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
30654 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
30655 /// ```
30656 pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
30657 where
30658 T: std::convert::Into<i32>,
30659 {
30660 self.max_node_count = v.map(|x| x.into());
30661 self
30662 }
30663
30664 /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
30665 ///
30666 /// # Example
30667 /// ```ignore,no_run
30668 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30669 /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
30670 /// let x = ReadPoolAutoScaleConfig::new()
30671 /// .set_target_metrics([
30672 /// TargetMetric::default()/* use setters */,
30673 /// TargetMetric::default()/* use (different) setters */,
30674 /// ]);
30675 /// ```
30676 pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
30677 where
30678 T: std::iter::IntoIterator<Item = V>,
30679 V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
30680 {
30681 use std::iter::Iterator;
30682 self.target_metrics = v.into_iter().map(|i| i.into()).collect();
30683 self
30684 }
30685
30686 /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
30687 ///
30688 /// # Example
30689 /// ```ignore,no_run
30690 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30691 /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
30692 /// ```
30693 pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
30694 where
30695 T: std::convert::Into<bool>,
30696 {
30697 self.disable_scale_in = std::option::Option::Some(v.into());
30698 self
30699 }
30700
30701 /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
30702 ///
30703 /// # Example
30704 /// ```ignore,no_run
30705 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30706 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
30707 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
30708 /// ```
30709 pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
30710 where
30711 T: std::convert::Into<bool>,
30712 {
30713 self.disable_scale_in = v.map(|x| x.into());
30714 self
30715 }
30716
30717 /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
30718 ///
30719 /// # Example
30720 /// ```ignore,no_run
30721 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30722 /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
30723 /// ```
30724 pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
30725 where
30726 T: std::convert::Into<i32>,
30727 {
30728 self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
30729 self
30730 }
30731
30732 /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
30733 ///
30734 /// # Example
30735 /// ```ignore,no_run
30736 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30737 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
30738 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
30739 /// ```
30740 pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
30741 where
30742 T: std::convert::Into<i32>,
30743 {
30744 self.scale_in_cooldown_seconds = v.map(|x| x.into());
30745 self
30746 }
30747
30748 /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
30749 ///
30750 /// # Example
30751 /// ```ignore,no_run
30752 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30753 /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
30754 /// ```
30755 pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
30756 where
30757 T: std::convert::Into<i32>,
30758 {
30759 self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
30760 self
30761 }
30762
30763 /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
30764 ///
30765 /// # Example
30766 /// ```ignore,no_run
30767 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
30768 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
30769 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
30770 /// ```
30771 pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
30772 where
30773 T: std::convert::Into<i32>,
30774 {
30775 self.scale_out_cooldown_seconds = v.map(|x| x.into());
30776 self
30777 }
30778}
30779
30780impl wkt::message::Message for ReadPoolAutoScaleConfig {
30781 fn typename() -> &'static str {
30782 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
30783 }
30784}
30785
30786/// Defines additional types related to [ReadPoolAutoScaleConfig].
30787pub mod read_pool_auto_scale_config {
30788 #[allow(unused_imports)]
30789 use super::*;
30790
30791 /// Target metric for read pool auto scaling.
30792 #[derive(Clone, Default, PartialEq)]
30793 #[non_exhaustive]
30794 pub struct TargetMetric {
30795 /// The metric name to be used for auto scaling.
30796 pub metric: std::option::Option<std::string::String>,
30797
30798 /// The target value for the metric.
30799 pub target_value: std::option::Option<f32>,
30800
30801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30802 }
30803
30804 impl TargetMetric {
30805 /// Creates a new default instance.
30806 pub fn new() -> Self {
30807 std::default::Default::default()
30808 }
30809
30810 /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
30811 ///
30812 /// # Example
30813 /// ```ignore,no_run
30814 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
30815 /// let x = TargetMetric::new().set_metric("example");
30816 /// ```
30817 pub fn set_metric<T>(mut self, v: T) -> Self
30818 where
30819 T: std::convert::Into<std::string::String>,
30820 {
30821 self.metric = std::option::Option::Some(v.into());
30822 self
30823 }
30824
30825 /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
30826 ///
30827 /// # Example
30828 /// ```ignore,no_run
30829 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
30830 /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
30831 /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
30832 /// ```
30833 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
30834 where
30835 T: std::convert::Into<std::string::String>,
30836 {
30837 self.metric = v.map(|x| x.into());
30838 self
30839 }
30840
30841 /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
30842 ///
30843 /// # Example
30844 /// ```ignore,no_run
30845 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
30846 /// let x = TargetMetric::new().set_target_value(42.0);
30847 /// ```
30848 pub fn set_target_value<T>(mut self, v: T) -> Self
30849 where
30850 T: std::convert::Into<f32>,
30851 {
30852 self.target_value = std::option::Option::Some(v.into());
30853 self
30854 }
30855
30856 /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
30857 ///
30858 /// # Example
30859 /// ```ignore,no_run
30860 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
30861 /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
30862 /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
30863 /// ```
30864 pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
30865 where
30866 T: std::convert::Into<f32>,
30867 {
30868 self.target_value = v.map(|x| x.into());
30869 self
30870 }
30871 }
30872
30873 impl wkt::message::Message for TargetMetric {
30874 fn typename() -> &'static str {
30875 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
30876 }
30877 }
30878}
30879
30880/// Specifies options for controlling advanced machine features.
30881#[derive(Clone, Default, PartialEq)]
30882#[non_exhaustive]
30883pub struct AdvancedMachineFeatures {
30884 /// The number of threads per physical core.
30885 pub threads_per_core: i32,
30886
30887 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30888}
30889
30890impl AdvancedMachineFeatures {
30891 /// Creates a new default instance.
30892 pub fn new() -> Self {
30893 std::default::Default::default()
30894 }
30895
30896 /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
30897 ///
30898 /// # Example
30899 /// ```ignore,no_run
30900 /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
30901 /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
30902 /// ```
30903 pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
30904 self.threads_per_core = v.into();
30905 self
30906 }
30907}
30908
30909impl wkt::message::Message for AdvancedMachineFeatures {
30910 fn typename() -> &'static str {
30911 "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
30912 }
30913}
30914
30915/// SslCerts Resource
30916#[derive(Clone, Default, PartialEq)]
30917#[non_exhaustive]
30918pub struct SslCert {
30919 /// This is always `sql#sslCert`.
30920 pub kind: std::string::String,
30921
30922 /// Serial number, as extracted from the certificate.
30923 pub cert_serial_number: std::string::String,
30924
30925 /// PEM representation.
30926 pub cert: std::string::String,
30927
30928 /// The time when the certificate was created in [RFC
30929 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
30930 /// `2012-11-15T16:19:00.094Z`
30931 pub create_time: std::option::Option<wkt::Timestamp>,
30932
30933 /// User supplied name. Constrained to [a-zA-Z.-_ ]+.
30934 pub common_name: std::string::String,
30935
30936 /// The time when the certificate expires in [RFC
30937 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
30938 /// `2012-11-15T16:19:00.094Z`.
30939 pub expiration_time: std::option::Option<wkt::Timestamp>,
30940
30941 /// Sha1 Fingerprint.
30942 pub sha1_fingerprint: std::string::String,
30943
30944 /// Name of the database instance.
30945 pub instance: std::string::String,
30946
30947 /// The URI of this resource.
30948 pub self_link: std::string::String,
30949
30950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30951}
30952
30953impl SslCert {
30954 /// Creates a new default instance.
30955 pub fn new() -> Self {
30956 std::default::Default::default()
30957 }
30958
30959 /// Sets the value of [kind][crate::model::SslCert::kind].
30960 ///
30961 /// # Example
30962 /// ```ignore,no_run
30963 /// # use google_cloud_sql_v1::model::SslCert;
30964 /// let x = SslCert::new().set_kind("example");
30965 /// ```
30966 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30967 self.kind = v.into();
30968 self
30969 }
30970
30971 /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
30972 ///
30973 /// # Example
30974 /// ```ignore,no_run
30975 /// # use google_cloud_sql_v1::model::SslCert;
30976 /// let x = SslCert::new().set_cert_serial_number("example");
30977 /// ```
30978 pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
30979 mut self,
30980 v: T,
30981 ) -> Self {
30982 self.cert_serial_number = v.into();
30983 self
30984 }
30985
30986 /// Sets the value of [cert][crate::model::SslCert::cert].
30987 ///
30988 /// # Example
30989 /// ```ignore,no_run
30990 /// # use google_cloud_sql_v1::model::SslCert;
30991 /// let x = SslCert::new().set_cert("example");
30992 /// ```
30993 pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30994 self.cert = v.into();
30995 self
30996 }
30997
30998 /// Sets the value of [create_time][crate::model::SslCert::create_time].
30999 ///
31000 /// # Example
31001 /// ```ignore,no_run
31002 /// # use google_cloud_sql_v1::model::SslCert;
31003 /// use wkt::Timestamp;
31004 /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
31005 /// ```
31006 pub fn set_create_time<T>(mut self, v: T) -> Self
31007 where
31008 T: std::convert::Into<wkt::Timestamp>,
31009 {
31010 self.create_time = std::option::Option::Some(v.into());
31011 self
31012 }
31013
31014 /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
31015 ///
31016 /// # Example
31017 /// ```ignore,no_run
31018 /// # use google_cloud_sql_v1::model::SslCert;
31019 /// use wkt::Timestamp;
31020 /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
31021 /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
31022 /// ```
31023 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
31024 where
31025 T: std::convert::Into<wkt::Timestamp>,
31026 {
31027 self.create_time = v.map(|x| x.into());
31028 self
31029 }
31030
31031 /// Sets the value of [common_name][crate::model::SslCert::common_name].
31032 ///
31033 /// # Example
31034 /// ```ignore,no_run
31035 /// # use google_cloud_sql_v1::model::SslCert;
31036 /// let x = SslCert::new().set_common_name("example");
31037 /// ```
31038 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31039 self.common_name = v.into();
31040 self
31041 }
31042
31043 /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
31044 ///
31045 /// # Example
31046 /// ```ignore,no_run
31047 /// # use google_cloud_sql_v1::model::SslCert;
31048 /// use wkt::Timestamp;
31049 /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
31050 /// ```
31051 pub fn set_expiration_time<T>(mut self, v: T) -> Self
31052 where
31053 T: std::convert::Into<wkt::Timestamp>,
31054 {
31055 self.expiration_time = std::option::Option::Some(v.into());
31056 self
31057 }
31058
31059 /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
31060 ///
31061 /// # Example
31062 /// ```ignore,no_run
31063 /// # use google_cloud_sql_v1::model::SslCert;
31064 /// use wkt::Timestamp;
31065 /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
31066 /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
31067 /// ```
31068 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
31069 where
31070 T: std::convert::Into<wkt::Timestamp>,
31071 {
31072 self.expiration_time = v.map(|x| x.into());
31073 self
31074 }
31075
31076 /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
31077 ///
31078 /// # Example
31079 /// ```ignore,no_run
31080 /// # use google_cloud_sql_v1::model::SslCert;
31081 /// let x = SslCert::new().set_sha1_fingerprint("example");
31082 /// ```
31083 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
31084 mut self,
31085 v: T,
31086 ) -> Self {
31087 self.sha1_fingerprint = v.into();
31088 self
31089 }
31090
31091 /// Sets the value of [instance][crate::model::SslCert::instance].
31092 ///
31093 /// # Example
31094 /// ```ignore,no_run
31095 /// # use google_cloud_sql_v1::model::SslCert;
31096 /// let x = SslCert::new().set_instance("example");
31097 /// ```
31098 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31099 self.instance = v.into();
31100 self
31101 }
31102
31103 /// Sets the value of [self_link][crate::model::SslCert::self_link].
31104 ///
31105 /// # Example
31106 /// ```ignore,no_run
31107 /// # use google_cloud_sql_v1::model::SslCert;
31108 /// let x = SslCert::new().set_self_link("example");
31109 /// ```
31110 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31111 self.self_link = v.into();
31112 self
31113 }
31114}
31115
31116impl wkt::message::Message for SslCert {
31117 fn typename() -> &'static str {
31118 "type.googleapis.com/google.cloud.sql.v1.SslCert"
31119 }
31120}
31121
31122/// SslCertDetail.
31123#[derive(Clone, Default, PartialEq)]
31124#[non_exhaustive]
31125pub struct SslCertDetail {
31126 /// The public information about the cert.
31127 pub cert_info: std::option::Option<crate::model::SslCert>,
31128
31129 /// The private key for the client cert, in pem format. Keep private in order
31130 /// to protect your security.
31131 pub cert_private_key: std::string::String,
31132
31133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31134}
31135
31136impl SslCertDetail {
31137 /// Creates a new default instance.
31138 pub fn new() -> Self {
31139 std::default::Default::default()
31140 }
31141
31142 /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
31143 ///
31144 /// # Example
31145 /// ```ignore,no_run
31146 /// # use google_cloud_sql_v1::model::SslCertDetail;
31147 /// use google_cloud_sql_v1::model::SslCert;
31148 /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
31149 /// ```
31150 pub fn set_cert_info<T>(mut self, v: T) -> Self
31151 where
31152 T: std::convert::Into<crate::model::SslCert>,
31153 {
31154 self.cert_info = std::option::Option::Some(v.into());
31155 self
31156 }
31157
31158 /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
31159 ///
31160 /// # Example
31161 /// ```ignore,no_run
31162 /// # use google_cloud_sql_v1::model::SslCertDetail;
31163 /// use google_cloud_sql_v1::model::SslCert;
31164 /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
31165 /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
31166 /// ```
31167 pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
31168 where
31169 T: std::convert::Into<crate::model::SslCert>,
31170 {
31171 self.cert_info = v.map(|x| x.into());
31172 self
31173 }
31174
31175 /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
31176 ///
31177 /// # Example
31178 /// ```ignore,no_run
31179 /// # use google_cloud_sql_v1::model::SslCertDetail;
31180 /// let x = SslCertDetail::new().set_cert_private_key("example");
31181 /// ```
31182 pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
31183 mut self,
31184 v: T,
31185 ) -> Self {
31186 self.cert_private_key = v.into();
31187 self
31188 }
31189}
31190
31191impl wkt::message::Message for SslCertDetail {
31192 fn typename() -> &'static str {
31193 "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
31194 }
31195}
31196
31197/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
31198#[derive(Clone, Default, PartialEq)]
31199#[non_exhaustive]
31200pub struct SqlActiveDirectoryConfig {
31201 /// This is always sql#activeDirectoryConfig.
31202 pub kind: std::string::String,
31203
31204 /// The name of the domain (e.g., mydomain.com).
31205 pub domain: std::string::String,
31206
31207 /// Optional. The mode of the Active Directory configuration.
31208 pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
31209
31210 /// Optional. Domain controller IPv4 addresses used to bootstrap Active
31211 /// Directory.
31212 pub dns_servers: std::vec::Vec<std::string::String>,
31213
31214 /// Optional. The secret manager key storing the administrator credential.
31215 /// (e.g., projects/{project}/secrets/{secret}).
31216 pub admin_credential_secret_name: std::string::String,
31217
31218 /// Optional. The organizational unit distinguished name. This is the full
31219 /// hierarchical path to the organizational unit.
31220 pub organizational_unit: std::string::String,
31221
31222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31223}
31224
31225impl SqlActiveDirectoryConfig {
31226 /// Creates a new default instance.
31227 pub fn new() -> Self {
31228 std::default::Default::default()
31229 }
31230
31231 /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
31232 ///
31233 /// # Example
31234 /// ```ignore,no_run
31235 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
31236 /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
31237 /// ```
31238 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31239 self.kind = v.into();
31240 self
31241 }
31242
31243 /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
31244 ///
31245 /// # Example
31246 /// ```ignore,no_run
31247 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
31248 /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
31249 /// ```
31250 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31251 self.domain = v.into();
31252 self
31253 }
31254
31255 /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
31256 ///
31257 /// # Example
31258 /// ```ignore,no_run
31259 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
31260 /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
31261 /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
31262 /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
31263 /// ```
31264 pub fn set_mode<
31265 T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
31266 >(
31267 mut self,
31268 v: T,
31269 ) -> Self {
31270 self.mode = v.into();
31271 self
31272 }
31273
31274 /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
31275 ///
31276 /// # Example
31277 /// ```ignore,no_run
31278 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
31279 /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
31280 /// ```
31281 pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
31282 where
31283 T: std::iter::IntoIterator<Item = V>,
31284 V: std::convert::Into<std::string::String>,
31285 {
31286 use std::iter::Iterator;
31287 self.dns_servers = v.into_iter().map(|i| i.into()).collect();
31288 self
31289 }
31290
31291 /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
31292 ///
31293 /// # Example
31294 /// ```ignore,no_run
31295 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
31296 /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
31297 /// ```
31298 pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
31299 mut self,
31300 v: T,
31301 ) -> Self {
31302 self.admin_credential_secret_name = v.into();
31303 self
31304 }
31305
31306 /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
31307 ///
31308 /// # Example
31309 /// ```ignore,no_run
31310 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
31311 /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
31312 /// ```
31313 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
31314 mut self,
31315 v: T,
31316 ) -> Self {
31317 self.organizational_unit = v.into();
31318 self
31319 }
31320}
31321
31322impl wkt::message::Message for SqlActiveDirectoryConfig {
31323 fn typename() -> &'static str {
31324 "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
31325 }
31326}
31327
31328/// Defines additional types related to [SqlActiveDirectoryConfig].
31329pub mod sql_active_directory_config {
31330 #[allow(unused_imports)]
31331 use super::*;
31332
31333 /// The modes of Active Directory configuration.
31334 ///
31335 /// # Working with unknown values
31336 ///
31337 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31338 /// additional enum variants at any time. Adding new variants is not considered
31339 /// a breaking change. Applications should write their code in anticipation of:
31340 ///
31341 /// - New values appearing in future releases of the client library, **and**
31342 /// - New values received dynamically, without application changes.
31343 ///
31344 /// Please consult the [Working with enums] section in the user guide for some
31345 /// guidelines.
31346 ///
31347 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31348 #[derive(Clone, Debug, PartialEq)]
31349 #[non_exhaustive]
31350 pub enum ActiveDirectoryMode {
31351 /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
31352 /// not specified to maintain backward compatibility.
31353 Unspecified,
31354 /// Managed Active Directory mode.
31355 ManagedActiveDirectory,
31356 /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
31357 #[deprecated]
31358 SelfManagedActiveDirectory,
31359 /// Customer-managed Active Directory mode.
31360 CustomerManagedActiveDirectory,
31361 /// If set, the enum was initialized with an unknown value.
31362 ///
31363 /// Applications can examine the value using [ActiveDirectoryMode::value] or
31364 /// [ActiveDirectoryMode::name].
31365 UnknownValue(active_directory_mode::UnknownValue),
31366 }
31367
31368 #[doc(hidden)]
31369 pub mod active_directory_mode {
31370 #[allow(unused_imports)]
31371 use super::*;
31372 #[derive(Clone, Debug, PartialEq)]
31373 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31374 }
31375
31376 impl ActiveDirectoryMode {
31377 /// Gets the enum value.
31378 ///
31379 /// Returns `None` if the enum contains an unknown value deserialized from
31380 /// the string representation of enums.
31381 pub fn value(&self) -> std::option::Option<i32> {
31382 match self {
31383 Self::Unspecified => std::option::Option::Some(0),
31384 Self::ManagedActiveDirectory => std::option::Option::Some(1),
31385 Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
31386 Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
31387 Self::UnknownValue(u) => u.0.value(),
31388 }
31389 }
31390
31391 /// Gets the enum value as a string.
31392 ///
31393 /// Returns `None` if the enum contains an unknown value deserialized from
31394 /// the integer representation of enums.
31395 pub fn name(&self) -> std::option::Option<&str> {
31396 match self {
31397 Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
31398 Self::ManagedActiveDirectory => {
31399 std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
31400 }
31401 Self::SelfManagedActiveDirectory => {
31402 std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
31403 }
31404 Self::CustomerManagedActiveDirectory => {
31405 std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
31406 }
31407 Self::UnknownValue(u) => u.0.name(),
31408 }
31409 }
31410 }
31411
31412 impl std::default::Default for ActiveDirectoryMode {
31413 fn default() -> Self {
31414 use std::convert::From;
31415 Self::from(0)
31416 }
31417 }
31418
31419 impl std::fmt::Display for ActiveDirectoryMode {
31420 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31421 wkt::internal::display_enum(f, self.name(), self.value())
31422 }
31423 }
31424
31425 impl std::convert::From<i32> for ActiveDirectoryMode {
31426 fn from(value: i32) -> Self {
31427 match value {
31428 0 => Self::Unspecified,
31429 1 => Self::ManagedActiveDirectory,
31430 2 => Self::SelfManagedActiveDirectory,
31431 3 => Self::CustomerManagedActiveDirectory,
31432 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
31433 wkt::internal::UnknownEnumValue::Integer(value),
31434 )),
31435 }
31436 }
31437 }
31438
31439 impl std::convert::From<&str> for ActiveDirectoryMode {
31440 fn from(value: &str) -> Self {
31441 use std::string::ToString;
31442 match value {
31443 "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
31444 "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
31445 "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
31446 "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
31447 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
31448 wkt::internal::UnknownEnumValue::String(value.to_string()),
31449 )),
31450 }
31451 }
31452 }
31453
31454 impl serde::ser::Serialize for ActiveDirectoryMode {
31455 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31456 where
31457 S: serde::Serializer,
31458 {
31459 match self {
31460 Self::Unspecified => serializer.serialize_i32(0),
31461 Self::ManagedActiveDirectory => serializer.serialize_i32(1),
31462 Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
31463 Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
31464 Self::UnknownValue(u) => u.0.serialize(serializer),
31465 }
31466 }
31467 }
31468
31469 impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
31470 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31471 where
31472 D: serde::Deserializer<'de>,
31473 {
31474 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
31475 ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
31476 ))
31477 }
31478 }
31479}
31480
31481/// SQL Server specific audit configuration.
31482#[derive(Clone, Default, PartialEq)]
31483#[non_exhaustive]
31484pub struct SqlServerAuditConfig {
31485 /// This is always sql#sqlServerAuditConfig
31486 pub kind: std::string::String,
31487
31488 /// The name of the destination bucket (e.g., gs://mybucket).
31489 pub bucket: std::string::String,
31490
31491 /// How long to keep generated audit files.
31492 pub retention_interval: std::option::Option<wkt::Duration>,
31493
31494 /// How often to upload generated audit files.
31495 pub upload_interval: std::option::Option<wkt::Duration>,
31496
31497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31498}
31499
31500impl SqlServerAuditConfig {
31501 /// Creates a new default instance.
31502 pub fn new() -> Self {
31503 std::default::Default::default()
31504 }
31505
31506 /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
31507 ///
31508 /// # Example
31509 /// ```ignore,no_run
31510 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
31511 /// let x = SqlServerAuditConfig::new().set_kind("example");
31512 /// ```
31513 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31514 self.kind = v.into();
31515 self
31516 }
31517
31518 /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
31519 ///
31520 /// # Example
31521 /// ```ignore,no_run
31522 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
31523 /// let x = SqlServerAuditConfig::new().set_bucket("example");
31524 /// ```
31525 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31526 self.bucket = v.into();
31527 self
31528 }
31529
31530 /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
31531 ///
31532 /// # Example
31533 /// ```ignore,no_run
31534 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
31535 /// use wkt::Duration;
31536 /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
31537 /// ```
31538 pub fn set_retention_interval<T>(mut self, v: T) -> Self
31539 where
31540 T: std::convert::Into<wkt::Duration>,
31541 {
31542 self.retention_interval = std::option::Option::Some(v.into());
31543 self
31544 }
31545
31546 /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
31547 ///
31548 /// # Example
31549 /// ```ignore,no_run
31550 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
31551 /// use wkt::Duration;
31552 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
31553 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
31554 /// ```
31555 pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
31556 where
31557 T: std::convert::Into<wkt::Duration>,
31558 {
31559 self.retention_interval = v.map(|x| x.into());
31560 self
31561 }
31562
31563 /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
31564 ///
31565 /// # Example
31566 /// ```ignore,no_run
31567 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
31568 /// use wkt::Duration;
31569 /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
31570 /// ```
31571 pub fn set_upload_interval<T>(mut self, v: T) -> Self
31572 where
31573 T: std::convert::Into<wkt::Duration>,
31574 {
31575 self.upload_interval = std::option::Option::Some(v.into());
31576 self
31577 }
31578
31579 /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
31580 ///
31581 /// # Example
31582 /// ```ignore,no_run
31583 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
31584 /// use wkt::Duration;
31585 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
31586 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
31587 /// ```
31588 pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
31589 where
31590 T: std::convert::Into<wkt::Duration>,
31591 {
31592 self.upload_interval = v.map(|x| x.into());
31593 self
31594 }
31595}
31596
31597impl wkt::message::Message for SqlServerAuditConfig {
31598 fn typename() -> &'static str {
31599 "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
31600 }
31601}
31602
31603/// SQL Server Entra ID configuration.
31604#[derive(Clone, Default, PartialEq)]
31605#[non_exhaustive]
31606pub struct SqlServerEntraIdConfig {
31607 /// Output only. This is always sql#sqlServerEntraIdConfig
31608 pub kind: std::string::String,
31609
31610 /// Optional. The tenant ID for the Entra ID configuration.
31611 pub tenant_id: std::string::String,
31612
31613 /// Optional. The application ID for the Entra ID configuration.
31614 pub application_id: std::string::String,
31615
31616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31617}
31618
31619impl SqlServerEntraIdConfig {
31620 /// Creates a new default instance.
31621 pub fn new() -> Self {
31622 std::default::Default::default()
31623 }
31624
31625 /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
31626 ///
31627 /// # Example
31628 /// ```ignore,no_run
31629 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
31630 /// let x = SqlServerEntraIdConfig::new().set_kind("example");
31631 /// ```
31632 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31633 self.kind = v.into();
31634 self
31635 }
31636
31637 /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
31638 ///
31639 /// # Example
31640 /// ```ignore,no_run
31641 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
31642 /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
31643 /// ```
31644 pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31645 self.tenant_id = v.into();
31646 self
31647 }
31648
31649 /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
31650 ///
31651 /// # Example
31652 /// ```ignore,no_run
31653 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
31654 /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
31655 /// ```
31656 pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31657 self.application_id = v.into();
31658 self
31659 }
31660}
31661
31662impl wkt::message::Message for SqlServerEntraIdConfig {
31663 fn typename() -> &'static str {
31664 "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
31665 }
31666}
31667
31668/// Acquire SSRS lease context.
31669#[derive(Clone, Default, PartialEq)]
31670#[non_exhaustive]
31671pub struct AcquireSsrsLeaseContext {
31672 /// The username to be used as the setup login to connect to the database
31673 /// server for SSRS setup.
31674 pub setup_login: std::option::Option<std::string::String>,
31675
31676 /// The username to be used as the service login to connect to the report
31677 /// database for SSRS setup.
31678 pub service_login: std::option::Option<std::string::String>,
31679
31680 /// The report database to be used for SSRS setup.
31681 pub report_database: std::option::Option<std::string::String>,
31682
31683 /// Lease duration needed for SSRS setup.
31684 pub duration: std::option::Option<wkt::Duration>,
31685
31686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31687}
31688
31689impl AcquireSsrsLeaseContext {
31690 /// Creates a new default instance.
31691 pub fn new() -> Self {
31692 std::default::Default::default()
31693 }
31694
31695 /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
31696 ///
31697 /// # Example
31698 /// ```ignore,no_run
31699 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31700 /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
31701 /// ```
31702 pub fn set_setup_login<T>(mut self, v: T) -> Self
31703 where
31704 T: std::convert::Into<std::string::String>,
31705 {
31706 self.setup_login = std::option::Option::Some(v.into());
31707 self
31708 }
31709
31710 /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
31711 ///
31712 /// # Example
31713 /// ```ignore,no_run
31714 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31715 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
31716 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
31717 /// ```
31718 pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
31719 where
31720 T: std::convert::Into<std::string::String>,
31721 {
31722 self.setup_login = v.map(|x| x.into());
31723 self
31724 }
31725
31726 /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
31727 ///
31728 /// # Example
31729 /// ```ignore,no_run
31730 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31731 /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
31732 /// ```
31733 pub fn set_service_login<T>(mut self, v: T) -> Self
31734 where
31735 T: std::convert::Into<std::string::String>,
31736 {
31737 self.service_login = std::option::Option::Some(v.into());
31738 self
31739 }
31740
31741 /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
31742 ///
31743 /// # Example
31744 /// ```ignore,no_run
31745 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31746 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
31747 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
31748 /// ```
31749 pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
31750 where
31751 T: std::convert::Into<std::string::String>,
31752 {
31753 self.service_login = v.map(|x| x.into());
31754 self
31755 }
31756
31757 /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
31758 ///
31759 /// # Example
31760 /// ```ignore,no_run
31761 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31762 /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
31763 /// ```
31764 pub fn set_report_database<T>(mut self, v: T) -> Self
31765 where
31766 T: std::convert::Into<std::string::String>,
31767 {
31768 self.report_database = std::option::Option::Some(v.into());
31769 self
31770 }
31771
31772 /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
31773 ///
31774 /// # Example
31775 /// ```ignore,no_run
31776 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31777 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
31778 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
31779 /// ```
31780 pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
31781 where
31782 T: std::convert::Into<std::string::String>,
31783 {
31784 self.report_database = v.map(|x| x.into());
31785 self
31786 }
31787
31788 /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
31789 ///
31790 /// # Example
31791 /// ```ignore,no_run
31792 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31793 /// use wkt::Duration;
31794 /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
31795 /// ```
31796 pub fn set_duration<T>(mut self, v: T) -> Self
31797 where
31798 T: std::convert::Into<wkt::Duration>,
31799 {
31800 self.duration = std::option::Option::Some(v.into());
31801 self
31802 }
31803
31804 /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
31805 ///
31806 /// # Example
31807 /// ```ignore,no_run
31808 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
31809 /// use wkt::Duration;
31810 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
31811 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
31812 /// ```
31813 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
31814 where
31815 T: std::convert::Into<wkt::Duration>,
31816 {
31817 self.duration = v.map(|x| x.into());
31818 self
31819 }
31820}
31821
31822impl wkt::message::Message for AcquireSsrsLeaseContext {
31823 fn typename() -> &'static str {
31824 "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
31825 }
31826}
31827
31828/// DNS metadata.
31829#[derive(Clone, Default, PartialEq)]
31830#[non_exhaustive]
31831pub struct DnsNameMapping {
31832 /// Output only. The DNS name.
31833 pub name: std::string::String,
31834
31835 /// Output only. The connection type of the DNS name.
31836 pub connection_type: crate::model::dns_name_mapping::ConnectionType,
31837
31838 /// Output only. The scope that the DNS name applies to.
31839 pub dns_scope: crate::model::dns_name_mapping::DnsScope,
31840
31841 /// Output only. The manager for this DNS record.
31842 pub record_manager: crate::model::dns_name_mapping::RecordManager,
31843
31844 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31845}
31846
31847impl DnsNameMapping {
31848 /// Creates a new default instance.
31849 pub fn new() -> Self {
31850 std::default::Default::default()
31851 }
31852
31853 /// Sets the value of [name][crate::model::DnsNameMapping::name].
31854 ///
31855 /// # Example
31856 /// ```ignore,no_run
31857 /// # use google_cloud_sql_v1::model::DnsNameMapping;
31858 /// let x = DnsNameMapping::new().set_name("example");
31859 /// ```
31860 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31861 self.name = v.into();
31862 self
31863 }
31864
31865 /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
31866 ///
31867 /// # Example
31868 /// ```ignore,no_run
31869 /// # use google_cloud_sql_v1::model::DnsNameMapping;
31870 /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
31871 /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
31872 /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
31873 /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
31874 /// ```
31875 pub fn set_connection_type<
31876 T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
31877 >(
31878 mut self,
31879 v: T,
31880 ) -> Self {
31881 self.connection_type = v.into();
31882 self
31883 }
31884
31885 /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
31886 ///
31887 /// # Example
31888 /// ```ignore,no_run
31889 /// # use google_cloud_sql_v1::model::DnsNameMapping;
31890 /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
31891 /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
31892 /// let x1 = DnsNameMapping::new().set_dns_scope(DnsScope::Cluster);
31893 /// ```
31894 pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
31895 mut self,
31896 v: T,
31897 ) -> Self {
31898 self.dns_scope = v.into();
31899 self
31900 }
31901
31902 /// Sets the value of [record_manager][crate::model::DnsNameMapping::record_manager].
31903 ///
31904 /// # Example
31905 /// ```ignore,no_run
31906 /// # use google_cloud_sql_v1::model::DnsNameMapping;
31907 /// use google_cloud_sql_v1::model::dns_name_mapping::RecordManager;
31908 /// let x0 = DnsNameMapping::new().set_record_manager(RecordManager::Customer);
31909 /// let x1 = DnsNameMapping::new().set_record_manager(RecordManager::CloudSqlAutomation);
31910 /// ```
31911 pub fn set_record_manager<
31912 T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
31913 >(
31914 mut self,
31915 v: T,
31916 ) -> Self {
31917 self.record_manager = v.into();
31918 self
31919 }
31920}
31921
31922impl wkt::message::Message for DnsNameMapping {
31923 fn typename() -> &'static str {
31924 "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
31925 }
31926}
31927
31928/// Defines additional types related to [DnsNameMapping].
31929pub mod dns_name_mapping {
31930 #[allow(unused_imports)]
31931 use super::*;
31932
31933 /// The connection type of the DNS name.
31934 /// This enum is not frozen, and new values may be added in the future.
31935 ///
31936 /// # Working with unknown values
31937 ///
31938 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31939 /// additional enum variants at any time. Adding new variants is not considered
31940 /// a breaking change. Applications should write their code in anticipation of:
31941 ///
31942 /// - New values appearing in future releases of the client library, **and**
31943 /// - New values received dynamically, without application changes.
31944 ///
31945 /// Please consult the [Working with enums] section in the user guide for some
31946 /// guidelines.
31947 ///
31948 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31949 #[derive(Clone, Debug, PartialEq)]
31950 #[non_exhaustive]
31951 pub enum ConnectionType {
31952 /// Unknown connection type.
31953 Unspecified,
31954 /// Public IP.
31955 Public,
31956 /// Private services access (private IP).
31957 PrivateServicesAccess,
31958 /// Private Service Connect.
31959 PrivateServiceConnect,
31960 /// If set, the enum was initialized with an unknown value.
31961 ///
31962 /// Applications can examine the value using [ConnectionType::value] or
31963 /// [ConnectionType::name].
31964 UnknownValue(connection_type::UnknownValue),
31965 }
31966
31967 #[doc(hidden)]
31968 pub mod connection_type {
31969 #[allow(unused_imports)]
31970 use super::*;
31971 #[derive(Clone, Debug, PartialEq)]
31972 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31973 }
31974
31975 impl ConnectionType {
31976 /// Gets the enum value.
31977 ///
31978 /// Returns `None` if the enum contains an unknown value deserialized from
31979 /// the string representation of enums.
31980 pub fn value(&self) -> std::option::Option<i32> {
31981 match self {
31982 Self::Unspecified => std::option::Option::Some(0),
31983 Self::Public => std::option::Option::Some(1),
31984 Self::PrivateServicesAccess => std::option::Option::Some(2),
31985 Self::PrivateServiceConnect => std::option::Option::Some(3),
31986 Self::UnknownValue(u) => u.0.value(),
31987 }
31988 }
31989
31990 /// Gets the enum value as a string.
31991 ///
31992 /// Returns `None` if the enum contains an unknown value deserialized from
31993 /// the integer representation of enums.
31994 pub fn name(&self) -> std::option::Option<&str> {
31995 match self {
31996 Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
31997 Self::Public => std::option::Option::Some("PUBLIC"),
31998 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
31999 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
32000 Self::UnknownValue(u) => u.0.name(),
32001 }
32002 }
32003 }
32004
32005 impl std::default::Default for ConnectionType {
32006 fn default() -> Self {
32007 use std::convert::From;
32008 Self::from(0)
32009 }
32010 }
32011
32012 impl std::fmt::Display for ConnectionType {
32013 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32014 wkt::internal::display_enum(f, self.name(), self.value())
32015 }
32016 }
32017
32018 impl std::convert::From<i32> for ConnectionType {
32019 fn from(value: i32) -> Self {
32020 match value {
32021 0 => Self::Unspecified,
32022 1 => Self::Public,
32023 2 => Self::PrivateServicesAccess,
32024 3 => Self::PrivateServiceConnect,
32025 _ => Self::UnknownValue(connection_type::UnknownValue(
32026 wkt::internal::UnknownEnumValue::Integer(value),
32027 )),
32028 }
32029 }
32030 }
32031
32032 impl std::convert::From<&str> for ConnectionType {
32033 fn from(value: &str) -> Self {
32034 use std::string::ToString;
32035 match value {
32036 "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
32037 "PUBLIC" => Self::Public,
32038 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
32039 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
32040 _ => Self::UnknownValue(connection_type::UnknownValue(
32041 wkt::internal::UnknownEnumValue::String(value.to_string()),
32042 )),
32043 }
32044 }
32045 }
32046
32047 impl serde::ser::Serialize for ConnectionType {
32048 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32049 where
32050 S: serde::Serializer,
32051 {
32052 match self {
32053 Self::Unspecified => serializer.serialize_i32(0),
32054 Self::Public => serializer.serialize_i32(1),
32055 Self::PrivateServicesAccess => serializer.serialize_i32(2),
32056 Self::PrivateServiceConnect => serializer.serialize_i32(3),
32057 Self::UnknownValue(u) => u.0.serialize(serializer),
32058 }
32059 }
32060 }
32061
32062 impl<'de> serde::de::Deserialize<'de> for ConnectionType {
32063 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32064 where
32065 D: serde::Deserializer<'de>,
32066 {
32067 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
32068 ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
32069 ))
32070 }
32071 }
32072
32073 /// The scope that the DNS name applies to.
32074 ///
32075 /// # Working with unknown values
32076 ///
32077 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32078 /// additional enum variants at any time. Adding new variants is not considered
32079 /// a breaking change. Applications should write their code in anticipation of:
32080 ///
32081 /// - New values appearing in future releases of the client library, **and**
32082 /// - New values received dynamically, without application changes.
32083 ///
32084 /// Please consult the [Working with enums] section in the user guide for some
32085 /// guidelines.
32086 ///
32087 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32088 #[derive(Clone, Debug, PartialEq)]
32089 #[non_exhaustive]
32090 pub enum DnsScope {
32091 /// DNS scope not set. This value should not be used.
32092 Unspecified,
32093 /// Indicates an instance-level DNS name.
32094 Instance,
32095 /// Indicates a cluster-level DNS name.
32096 Cluster,
32097 /// If set, the enum was initialized with an unknown value.
32098 ///
32099 /// Applications can examine the value using [DnsScope::value] or
32100 /// [DnsScope::name].
32101 UnknownValue(dns_scope::UnknownValue),
32102 }
32103
32104 #[doc(hidden)]
32105 pub mod dns_scope {
32106 #[allow(unused_imports)]
32107 use super::*;
32108 #[derive(Clone, Debug, PartialEq)]
32109 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32110 }
32111
32112 impl DnsScope {
32113 /// Gets the enum value.
32114 ///
32115 /// Returns `None` if the enum contains an unknown value deserialized from
32116 /// the string representation of enums.
32117 pub fn value(&self) -> std::option::Option<i32> {
32118 match self {
32119 Self::Unspecified => std::option::Option::Some(0),
32120 Self::Instance => std::option::Option::Some(1),
32121 Self::Cluster => std::option::Option::Some(2),
32122 Self::UnknownValue(u) => u.0.value(),
32123 }
32124 }
32125
32126 /// Gets the enum value as a string.
32127 ///
32128 /// Returns `None` if the enum contains an unknown value deserialized from
32129 /// the integer representation of enums.
32130 pub fn name(&self) -> std::option::Option<&str> {
32131 match self {
32132 Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
32133 Self::Instance => std::option::Option::Some("INSTANCE"),
32134 Self::Cluster => std::option::Option::Some("CLUSTER"),
32135 Self::UnknownValue(u) => u.0.name(),
32136 }
32137 }
32138 }
32139
32140 impl std::default::Default for DnsScope {
32141 fn default() -> Self {
32142 use std::convert::From;
32143 Self::from(0)
32144 }
32145 }
32146
32147 impl std::fmt::Display for DnsScope {
32148 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32149 wkt::internal::display_enum(f, self.name(), self.value())
32150 }
32151 }
32152
32153 impl std::convert::From<i32> for DnsScope {
32154 fn from(value: i32) -> Self {
32155 match value {
32156 0 => Self::Unspecified,
32157 1 => Self::Instance,
32158 2 => Self::Cluster,
32159 _ => Self::UnknownValue(dns_scope::UnknownValue(
32160 wkt::internal::UnknownEnumValue::Integer(value),
32161 )),
32162 }
32163 }
32164 }
32165
32166 impl std::convert::From<&str> for DnsScope {
32167 fn from(value: &str) -> Self {
32168 use std::string::ToString;
32169 match value {
32170 "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
32171 "INSTANCE" => Self::Instance,
32172 "CLUSTER" => Self::Cluster,
32173 _ => Self::UnknownValue(dns_scope::UnknownValue(
32174 wkt::internal::UnknownEnumValue::String(value.to_string()),
32175 )),
32176 }
32177 }
32178 }
32179
32180 impl serde::ser::Serialize for DnsScope {
32181 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32182 where
32183 S: serde::Serializer,
32184 {
32185 match self {
32186 Self::Unspecified => serializer.serialize_i32(0),
32187 Self::Instance => serializer.serialize_i32(1),
32188 Self::Cluster => serializer.serialize_i32(2),
32189 Self::UnknownValue(u) => u.0.serialize(serializer),
32190 }
32191 }
32192 }
32193
32194 impl<'de> serde::de::Deserialize<'de> for DnsScope {
32195 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32196 where
32197 D: serde::Deserializer<'de>,
32198 {
32199 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
32200 ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
32201 ))
32202 }
32203 }
32204
32205 /// The system responsible for managing the DNS record.
32206 ///
32207 /// # Working with unknown values
32208 ///
32209 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32210 /// additional enum variants at any time. Adding new variants is not considered
32211 /// a breaking change. Applications should write their code in anticipation of:
32212 ///
32213 /// - New values appearing in future releases of the client library, **and**
32214 /// - New values received dynamically, without application changes.
32215 ///
32216 /// Please consult the [Working with enums] section in the user guide for some
32217 /// guidelines.
32218 ///
32219 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32220 #[derive(Clone, Debug, PartialEq)]
32221 #[non_exhaustive]
32222 pub enum RecordManager {
32223 /// Record manager not set. This value should not be used.
32224 Unspecified,
32225 /// The record may be managed by the customer. It is not automatically
32226 /// managed by Cloud SQL automation.
32227 Customer,
32228 /// The record is managed by Cloud SQL, which will create, update,
32229 /// and delete the DNS records for the zone automatically when
32230 /// the Cloud SQL database instance is created or updated.
32231 CloudSqlAutomation,
32232 /// If set, the enum was initialized with an unknown value.
32233 ///
32234 /// Applications can examine the value using [RecordManager::value] or
32235 /// [RecordManager::name].
32236 UnknownValue(record_manager::UnknownValue),
32237 }
32238
32239 #[doc(hidden)]
32240 pub mod record_manager {
32241 #[allow(unused_imports)]
32242 use super::*;
32243 #[derive(Clone, Debug, PartialEq)]
32244 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32245 }
32246
32247 impl RecordManager {
32248 /// Gets the enum value.
32249 ///
32250 /// Returns `None` if the enum contains an unknown value deserialized from
32251 /// the string representation of enums.
32252 pub fn value(&self) -> std::option::Option<i32> {
32253 match self {
32254 Self::Unspecified => std::option::Option::Some(0),
32255 Self::Customer => std::option::Option::Some(1),
32256 Self::CloudSqlAutomation => std::option::Option::Some(2),
32257 Self::UnknownValue(u) => u.0.value(),
32258 }
32259 }
32260
32261 /// Gets the enum value as a string.
32262 ///
32263 /// Returns `None` if the enum contains an unknown value deserialized from
32264 /// the integer representation of enums.
32265 pub fn name(&self) -> std::option::Option<&str> {
32266 match self {
32267 Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
32268 Self::Customer => std::option::Option::Some("CUSTOMER"),
32269 Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
32270 Self::UnknownValue(u) => u.0.name(),
32271 }
32272 }
32273 }
32274
32275 impl std::default::Default for RecordManager {
32276 fn default() -> Self {
32277 use std::convert::From;
32278 Self::from(0)
32279 }
32280 }
32281
32282 impl std::fmt::Display for RecordManager {
32283 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32284 wkt::internal::display_enum(f, self.name(), self.value())
32285 }
32286 }
32287
32288 impl std::convert::From<i32> for RecordManager {
32289 fn from(value: i32) -> Self {
32290 match value {
32291 0 => Self::Unspecified,
32292 1 => Self::Customer,
32293 2 => Self::CloudSqlAutomation,
32294 _ => Self::UnknownValue(record_manager::UnknownValue(
32295 wkt::internal::UnknownEnumValue::Integer(value),
32296 )),
32297 }
32298 }
32299 }
32300
32301 impl std::convert::From<&str> for RecordManager {
32302 fn from(value: &str) -> Self {
32303 use std::string::ToString;
32304 match value {
32305 "RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
32306 "CUSTOMER" => Self::Customer,
32307 "CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
32308 _ => Self::UnknownValue(record_manager::UnknownValue(
32309 wkt::internal::UnknownEnumValue::String(value.to_string()),
32310 )),
32311 }
32312 }
32313 }
32314
32315 impl serde::ser::Serialize for RecordManager {
32316 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32317 where
32318 S: serde::Serializer,
32319 {
32320 match self {
32321 Self::Unspecified => serializer.serialize_i32(0),
32322 Self::Customer => serializer.serialize_i32(1),
32323 Self::CloudSqlAutomation => serializer.serialize_i32(2),
32324 Self::UnknownValue(u) => u.0.serialize(serializer),
32325 }
32326 }
32327 }
32328
32329 impl<'de> serde::de::Deserialize<'de> for RecordManager {
32330 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32331 where
32332 D: serde::Deserializer<'de>,
32333 {
32334 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
32335 ".google.cloud.sql.v1.DnsNameMapping.RecordManager",
32336 ))
32337 }
32338 }
32339}
32340
32341#[allow(missing_docs)]
32342#[derive(Clone, Default, PartialEq)]
32343#[non_exhaustive]
32344pub struct SqlSslCertsDeleteRequest {
32345 /// Cloud SQL instance ID. This does not include the project ID.
32346 pub instance: std::string::String,
32347
32348 /// Project ID of the project that contains the instance.
32349 pub project: std::string::String,
32350
32351 /// Sha1 FingerPrint.
32352 pub sha1_fingerprint: std::string::String,
32353
32354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32355}
32356
32357impl SqlSslCertsDeleteRequest {
32358 /// Creates a new default instance.
32359 pub fn new() -> Self {
32360 std::default::Default::default()
32361 }
32362
32363 /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
32364 ///
32365 /// # Example
32366 /// ```ignore,no_run
32367 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
32368 /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
32369 /// ```
32370 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32371 self.instance = v.into();
32372 self
32373 }
32374
32375 /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
32376 ///
32377 /// # Example
32378 /// ```ignore,no_run
32379 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
32380 /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
32381 /// ```
32382 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32383 self.project = v.into();
32384 self
32385 }
32386
32387 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
32388 ///
32389 /// # Example
32390 /// ```ignore,no_run
32391 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
32392 /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
32393 /// ```
32394 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
32395 mut self,
32396 v: T,
32397 ) -> Self {
32398 self.sha1_fingerprint = v.into();
32399 self
32400 }
32401}
32402
32403impl wkt::message::Message for SqlSslCertsDeleteRequest {
32404 fn typename() -> &'static str {
32405 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
32406 }
32407}
32408
32409#[allow(missing_docs)]
32410#[derive(Clone, Default, PartialEq)]
32411#[non_exhaustive]
32412pub struct SqlSslCertsGetRequest {
32413 /// Cloud SQL instance ID. This does not include the project ID.
32414 pub instance: std::string::String,
32415
32416 /// Project ID of the project that contains the instance.
32417 pub project: std::string::String,
32418
32419 /// Sha1 FingerPrint.
32420 pub sha1_fingerprint: std::string::String,
32421
32422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32423}
32424
32425impl SqlSslCertsGetRequest {
32426 /// Creates a new default instance.
32427 pub fn new() -> Self {
32428 std::default::Default::default()
32429 }
32430
32431 /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
32432 ///
32433 /// # Example
32434 /// ```ignore,no_run
32435 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
32436 /// let x = SqlSslCertsGetRequest::new().set_instance("example");
32437 /// ```
32438 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32439 self.instance = v.into();
32440 self
32441 }
32442
32443 /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
32444 ///
32445 /// # Example
32446 /// ```ignore,no_run
32447 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
32448 /// let x = SqlSslCertsGetRequest::new().set_project("example");
32449 /// ```
32450 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32451 self.project = v.into();
32452 self
32453 }
32454
32455 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
32456 ///
32457 /// # Example
32458 /// ```ignore,no_run
32459 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
32460 /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
32461 /// ```
32462 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
32463 mut self,
32464 v: T,
32465 ) -> Self {
32466 self.sha1_fingerprint = v.into();
32467 self
32468 }
32469}
32470
32471impl wkt::message::Message for SqlSslCertsGetRequest {
32472 fn typename() -> &'static str {
32473 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
32474 }
32475}
32476
32477#[allow(missing_docs)]
32478#[derive(Clone, Default, PartialEq)]
32479#[non_exhaustive]
32480pub struct SqlSslCertsInsertRequest {
32481 /// Cloud SQL instance ID. This does not include the project ID.
32482 pub instance: std::string::String,
32483
32484 /// Project ID of the project that contains the instance.
32485 pub project: std::string::String,
32486
32487 #[allow(missing_docs)]
32488 pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
32489
32490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32491}
32492
32493impl SqlSslCertsInsertRequest {
32494 /// Creates a new default instance.
32495 pub fn new() -> Self {
32496 std::default::Default::default()
32497 }
32498
32499 /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
32500 ///
32501 /// # Example
32502 /// ```ignore,no_run
32503 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
32504 /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
32505 /// ```
32506 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32507 self.instance = v.into();
32508 self
32509 }
32510
32511 /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
32512 ///
32513 /// # Example
32514 /// ```ignore,no_run
32515 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
32516 /// let x = SqlSslCertsInsertRequest::new().set_project("example");
32517 /// ```
32518 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32519 self.project = v.into();
32520 self
32521 }
32522
32523 /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
32524 ///
32525 /// # Example
32526 /// ```ignore,no_run
32527 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
32528 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
32529 /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
32530 /// ```
32531 pub fn set_body<T>(mut self, v: T) -> Self
32532 where
32533 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
32534 {
32535 self.body = std::option::Option::Some(v.into());
32536 self
32537 }
32538
32539 /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
32540 ///
32541 /// # Example
32542 /// ```ignore,no_run
32543 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
32544 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
32545 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
32546 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
32547 /// ```
32548 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
32549 where
32550 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
32551 {
32552 self.body = v.map(|x| x.into());
32553 self
32554 }
32555}
32556
32557impl wkt::message::Message for SqlSslCertsInsertRequest {
32558 fn typename() -> &'static str {
32559 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
32560 }
32561}
32562
32563#[allow(missing_docs)]
32564#[derive(Clone, Default, PartialEq)]
32565#[non_exhaustive]
32566pub struct SqlSslCertsListRequest {
32567 /// Cloud SQL instance ID. This does not include the project ID.
32568 pub instance: std::string::String,
32569
32570 /// Project ID of the project that contains the instance.
32571 pub project: std::string::String,
32572
32573 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32574}
32575
32576impl SqlSslCertsListRequest {
32577 /// Creates a new default instance.
32578 pub fn new() -> Self {
32579 std::default::Default::default()
32580 }
32581
32582 /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
32583 ///
32584 /// # Example
32585 /// ```ignore,no_run
32586 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
32587 /// let x = SqlSslCertsListRequest::new().set_instance("example");
32588 /// ```
32589 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32590 self.instance = v.into();
32591 self
32592 }
32593
32594 /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
32595 ///
32596 /// # Example
32597 /// ```ignore,no_run
32598 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
32599 /// let x = SqlSslCertsListRequest::new().set_project("example");
32600 /// ```
32601 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32602 self.project = v.into();
32603 self
32604 }
32605}
32606
32607impl wkt::message::Message for SqlSslCertsListRequest {
32608 fn typename() -> &'static str {
32609 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
32610 }
32611}
32612
32613/// SslCerts insert request.
32614#[derive(Clone, Default, PartialEq)]
32615#[non_exhaustive]
32616pub struct SslCertsInsertRequest {
32617 /// User supplied name. Must be a distinct name from the other certificates
32618 /// for this instance.
32619 pub common_name: std::string::String,
32620
32621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32622}
32623
32624impl SslCertsInsertRequest {
32625 /// Creates a new default instance.
32626 pub fn new() -> Self {
32627 std::default::Default::default()
32628 }
32629
32630 /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
32631 ///
32632 /// # Example
32633 /// ```ignore,no_run
32634 /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
32635 /// let x = SslCertsInsertRequest::new().set_common_name("example");
32636 /// ```
32637 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32638 self.common_name = v.into();
32639 self
32640 }
32641}
32642
32643impl wkt::message::Message for SslCertsInsertRequest {
32644 fn typename() -> &'static str {
32645 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
32646 }
32647}
32648
32649/// SslCert insert response.
32650#[derive(Clone, Default, PartialEq)]
32651#[non_exhaustive]
32652pub struct SslCertsInsertResponse {
32653 /// This is always `sql#sslCertsInsert`.
32654 pub kind: std::string::String,
32655
32656 /// The operation to track the ssl certs insert request.
32657 pub operation: std::option::Option<crate::model::Operation>,
32658
32659 /// The server Certificate Authority's certificate. If this is missing you can
32660 /// force a new one to be generated by calling resetSslConfig method on
32661 /// instances resource.
32662 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
32663
32664 /// The new client certificate and private key.
32665 pub client_cert: std::option::Option<crate::model::SslCertDetail>,
32666
32667 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32668}
32669
32670impl SslCertsInsertResponse {
32671 /// Creates a new default instance.
32672 pub fn new() -> Self {
32673 std::default::Default::default()
32674 }
32675
32676 /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
32677 ///
32678 /// # Example
32679 /// ```ignore,no_run
32680 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
32681 /// let x = SslCertsInsertResponse::new().set_kind("example");
32682 /// ```
32683 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32684 self.kind = v.into();
32685 self
32686 }
32687
32688 /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
32689 ///
32690 /// # Example
32691 /// ```ignore,no_run
32692 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
32693 /// use google_cloud_sql_v1::model::Operation;
32694 /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
32695 /// ```
32696 pub fn set_operation<T>(mut self, v: T) -> Self
32697 where
32698 T: std::convert::Into<crate::model::Operation>,
32699 {
32700 self.operation = std::option::Option::Some(v.into());
32701 self
32702 }
32703
32704 /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
32705 ///
32706 /// # Example
32707 /// ```ignore,no_run
32708 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
32709 /// use google_cloud_sql_v1::model::Operation;
32710 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
32711 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
32712 /// ```
32713 pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
32714 where
32715 T: std::convert::Into<crate::model::Operation>,
32716 {
32717 self.operation = v.map(|x| x.into());
32718 self
32719 }
32720
32721 /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
32722 ///
32723 /// # Example
32724 /// ```ignore,no_run
32725 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
32726 /// use google_cloud_sql_v1::model::SslCert;
32727 /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
32728 /// ```
32729 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
32730 where
32731 T: std::convert::Into<crate::model::SslCert>,
32732 {
32733 self.server_ca_cert = std::option::Option::Some(v.into());
32734 self
32735 }
32736
32737 /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
32738 ///
32739 /// # Example
32740 /// ```ignore,no_run
32741 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
32742 /// use google_cloud_sql_v1::model::SslCert;
32743 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
32744 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
32745 /// ```
32746 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
32747 where
32748 T: std::convert::Into<crate::model::SslCert>,
32749 {
32750 self.server_ca_cert = v.map(|x| x.into());
32751 self
32752 }
32753
32754 /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
32755 ///
32756 /// # Example
32757 /// ```ignore,no_run
32758 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
32759 /// use google_cloud_sql_v1::model::SslCertDetail;
32760 /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
32761 /// ```
32762 pub fn set_client_cert<T>(mut self, v: T) -> Self
32763 where
32764 T: std::convert::Into<crate::model::SslCertDetail>,
32765 {
32766 self.client_cert = std::option::Option::Some(v.into());
32767 self
32768 }
32769
32770 /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
32771 ///
32772 /// # Example
32773 /// ```ignore,no_run
32774 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
32775 /// use google_cloud_sql_v1::model::SslCertDetail;
32776 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
32777 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
32778 /// ```
32779 pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
32780 where
32781 T: std::convert::Into<crate::model::SslCertDetail>,
32782 {
32783 self.client_cert = v.map(|x| x.into());
32784 self
32785 }
32786}
32787
32788impl wkt::message::Message for SslCertsInsertResponse {
32789 fn typename() -> &'static str {
32790 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
32791 }
32792}
32793
32794/// SslCerts list response.
32795#[derive(Clone, Default, PartialEq)]
32796#[non_exhaustive]
32797pub struct SslCertsListResponse {
32798 /// This is always `sql#sslCertsList`.
32799 pub kind: std::string::String,
32800
32801 /// List of client certificates for the instance.
32802 pub items: std::vec::Vec<crate::model::SslCert>,
32803
32804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32805}
32806
32807impl SslCertsListResponse {
32808 /// Creates a new default instance.
32809 pub fn new() -> Self {
32810 std::default::Default::default()
32811 }
32812
32813 /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
32814 ///
32815 /// # Example
32816 /// ```ignore,no_run
32817 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
32818 /// let x = SslCertsListResponse::new().set_kind("example");
32819 /// ```
32820 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32821 self.kind = v.into();
32822 self
32823 }
32824
32825 /// Sets the value of [items][crate::model::SslCertsListResponse::items].
32826 ///
32827 /// # Example
32828 /// ```ignore,no_run
32829 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
32830 /// use google_cloud_sql_v1::model::SslCert;
32831 /// let x = SslCertsListResponse::new()
32832 /// .set_items([
32833 /// SslCert::default()/* use setters */,
32834 /// SslCert::default()/* use (different) setters */,
32835 /// ]);
32836 /// ```
32837 pub fn set_items<T, V>(mut self, v: T) -> Self
32838 where
32839 T: std::iter::IntoIterator<Item = V>,
32840 V: std::convert::Into<crate::model::SslCert>,
32841 {
32842 use std::iter::Iterator;
32843 self.items = v.into_iter().map(|i| i.into()).collect();
32844 self
32845 }
32846}
32847
32848impl wkt::message::Message for SslCertsListResponse {
32849 fn typename() -> &'static str {
32850 "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
32851 }
32852}
32853
32854/// Tiers list request.
32855#[derive(Clone, Default, PartialEq)]
32856#[non_exhaustive]
32857pub struct SqlTiersListRequest {
32858 /// Project ID of the project for which to list tiers.
32859 pub project: std::string::String,
32860
32861 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32862}
32863
32864impl SqlTiersListRequest {
32865 /// Creates a new default instance.
32866 pub fn new() -> Self {
32867 std::default::Default::default()
32868 }
32869
32870 /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
32871 ///
32872 /// # Example
32873 /// ```ignore,no_run
32874 /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
32875 /// let x = SqlTiersListRequest::new().set_project("example");
32876 /// ```
32877 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32878 self.project = v.into();
32879 self
32880 }
32881}
32882
32883impl wkt::message::Message for SqlTiersListRequest {
32884 fn typename() -> &'static str {
32885 "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
32886 }
32887}
32888
32889/// Tiers list response.
32890#[derive(Clone, Default, PartialEq)]
32891#[non_exhaustive]
32892pub struct TiersListResponse {
32893 /// This is always `sql#tiersList`.
32894 pub kind: std::string::String,
32895
32896 /// List of tiers.
32897 pub items: std::vec::Vec<crate::model::Tier>,
32898
32899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32900}
32901
32902impl TiersListResponse {
32903 /// Creates a new default instance.
32904 pub fn new() -> Self {
32905 std::default::Default::default()
32906 }
32907
32908 /// Sets the value of [kind][crate::model::TiersListResponse::kind].
32909 ///
32910 /// # Example
32911 /// ```ignore,no_run
32912 /// # use google_cloud_sql_v1::model::TiersListResponse;
32913 /// let x = TiersListResponse::new().set_kind("example");
32914 /// ```
32915 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32916 self.kind = v.into();
32917 self
32918 }
32919
32920 /// Sets the value of [items][crate::model::TiersListResponse::items].
32921 ///
32922 /// # Example
32923 /// ```ignore,no_run
32924 /// # use google_cloud_sql_v1::model::TiersListResponse;
32925 /// use google_cloud_sql_v1::model::Tier;
32926 /// let x = TiersListResponse::new()
32927 /// .set_items([
32928 /// Tier::default()/* use setters */,
32929 /// Tier::default()/* use (different) setters */,
32930 /// ]);
32931 /// ```
32932 pub fn set_items<T, V>(mut self, v: T) -> Self
32933 where
32934 T: std::iter::IntoIterator<Item = V>,
32935 V: std::convert::Into<crate::model::Tier>,
32936 {
32937 use std::iter::Iterator;
32938 self.items = v.into_iter().map(|i| i.into()).collect();
32939 self
32940 }
32941}
32942
32943impl wkt::message::Message for TiersListResponse {
32944 fn typename() -> &'static str {
32945 "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
32946 }
32947}
32948
32949/// A Google Cloud SQL service tier resource.
32950#[derive(Clone, Default, PartialEq)]
32951#[non_exhaustive]
32952pub struct Tier {
32953 /// An identifier for the machine type, for example, `db-custom-1-3840`. For
32954 /// related information, see [Pricing](/sql/pricing).
32955 pub tier: std::string::String,
32956
32957 /// The maximum RAM usage of this tier in bytes.
32958 pub ram: i64,
32959
32960 /// This is always `sql#tier`.
32961 pub kind: std::string::String,
32962
32963 /// The maximum disk size of this tier in bytes.
32964 pub disk_quota: i64,
32965
32966 /// The applicable regions for this tier.
32967 pub region: std::vec::Vec<std::string::String>,
32968
32969 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32970}
32971
32972impl Tier {
32973 /// Creates a new default instance.
32974 pub fn new() -> Self {
32975 std::default::Default::default()
32976 }
32977
32978 /// Sets the value of [tier][crate::model::Tier::tier].
32979 ///
32980 /// # Example
32981 /// ```ignore,no_run
32982 /// # use google_cloud_sql_v1::model::Tier;
32983 /// let x = Tier::new().set_tier("example");
32984 /// ```
32985 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32986 self.tier = v.into();
32987 self
32988 }
32989
32990 /// Sets the value of [ram][crate::model::Tier::ram].
32991 ///
32992 /// # Example
32993 /// ```ignore,no_run
32994 /// # use google_cloud_sql_v1::model::Tier;
32995 /// let x = Tier::new().set_ram(42);
32996 /// ```
32997 pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
32998 self.ram = v.into();
32999 self
33000 }
33001
33002 /// Sets the value of [kind][crate::model::Tier::kind].
33003 ///
33004 /// # Example
33005 /// ```ignore,no_run
33006 /// # use google_cloud_sql_v1::model::Tier;
33007 /// let x = Tier::new().set_kind("example");
33008 /// ```
33009 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33010 self.kind = v.into();
33011 self
33012 }
33013
33014 /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
33015 ///
33016 /// # Example
33017 /// ```ignore,no_run
33018 /// # use google_cloud_sql_v1::model::Tier;
33019 /// let x = Tier::new().set_disk_quota(42);
33020 /// ```
33021 pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
33022 self.disk_quota = v.into();
33023 self
33024 }
33025
33026 /// Sets the value of [region][crate::model::Tier::region].
33027 ///
33028 /// # Example
33029 /// ```ignore,no_run
33030 /// # use google_cloud_sql_v1::model::Tier;
33031 /// let x = Tier::new().set_region(["a", "b", "c"]);
33032 /// ```
33033 pub fn set_region<T, V>(mut self, v: T) -> Self
33034 where
33035 T: std::iter::IntoIterator<Item = V>,
33036 V: std::convert::Into<std::string::String>,
33037 {
33038 use std::iter::Iterator;
33039 self.region = v.into_iter().map(|i| i.into()).collect();
33040 self
33041 }
33042}
33043
33044impl wkt::message::Message for Tier {
33045 fn typename() -> &'static str {
33046 "type.googleapis.com/google.cloud.sql.v1.Tier"
33047 }
33048}
33049
33050#[allow(missing_docs)]
33051#[derive(Clone, Default, PartialEq)]
33052#[non_exhaustive]
33053pub struct SqlUsersDeleteRequest {
33054 /// Host of the user in the instance.
33055 pub host: std::string::String,
33056
33057 /// Database instance ID. This does not include the project ID.
33058 pub instance: std::string::String,
33059
33060 /// Name of the user in the instance.
33061 pub name: std::string::String,
33062
33063 /// Project ID of the project that contains the instance.
33064 pub project: std::string::String,
33065
33066 /// Optional. Region of the Cloud SQL instance.
33067 pub location: std::string::String,
33068
33069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33070}
33071
33072impl SqlUsersDeleteRequest {
33073 /// Creates a new default instance.
33074 pub fn new() -> Self {
33075 std::default::Default::default()
33076 }
33077
33078 /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
33079 ///
33080 /// # Example
33081 /// ```ignore,no_run
33082 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
33083 /// let x = SqlUsersDeleteRequest::new().set_host("example");
33084 /// ```
33085 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33086 self.host = v.into();
33087 self
33088 }
33089
33090 /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
33091 ///
33092 /// # Example
33093 /// ```ignore,no_run
33094 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
33095 /// let x = SqlUsersDeleteRequest::new().set_instance("example");
33096 /// ```
33097 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33098 self.instance = v.into();
33099 self
33100 }
33101
33102 /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
33103 ///
33104 /// # Example
33105 /// ```ignore,no_run
33106 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
33107 /// let x = SqlUsersDeleteRequest::new().set_name("example");
33108 /// ```
33109 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33110 self.name = v.into();
33111 self
33112 }
33113
33114 /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
33115 ///
33116 /// # Example
33117 /// ```ignore,no_run
33118 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
33119 /// let x = SqlUsersDeleteRequest::new().set_project("example");
33120 /// ```
33121 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33122 self.project = v.into();
33123 self
33124 }
33125
33126 /// Sets the value of [location][crate::model::SqlUsersDeleteRequest::location].
33127 ///
33128 /// # Example
33129 /// ```ignore,no_run
33130 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
33131 /// let x = SqlUsersDeleteRequest::new().set_location("example");
33132 /// ```
33133 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33134 self.location = v.into();
33135 self
33136 }
33137}
33138
33139impl wkt::message::Message for SqlUsersDeleteRequest {
33140 fn typename() -> &'static str {
33141 "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
33142 }
33143}
33144
33145/// Request message for Users Get RPC
33146#[derive(Clone, Default, PartialEq)]
33147#[non_exhaustive]
33148pub struct SqlUsersGetRequest {
33149 /// Database instance ID. This does not include the project ID.
33150 pub instance: std::string::String,
33151
33152 /// User of the instance.
33153 pub name: std::string::String,
33154
33155 /// Project ID of the project that contains the instance.
33156 pub project: std::string::String,
33157
33158 /// Host of a user of the instance.
33159 pub host: std::string::String,
33160
33161 /// Optional. Region of the Cloud SQL instance.
33162 pub location: std::string::String,
33163
33164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33165}
33166
33167impl SqlUsersGetRequest {
33168 /// Creates a new default instance.
33169 pub fn new() -> Self {
33170 std::default::Default::default()
33171 }
33172
33173 /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
33174 ///
33175 /// # Example
33176 /// ```ignore,no_run
33177 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
33178 /// let x = SqlUsersGetRequest::new().set_instance("example");
33179 /// ```
33180 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33181 self.instance = v.into();
33182 self
33183 }
33184
33185 /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
33186 ///
33187 /// # Example
33188 /// ```ignore,no_run
33189 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
33190 /// let x = SqlUsersGetRequest::new().set_name("example");
33191 /// ```
33192 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33193 self.name = v.into();
33194 self
33195 }
33196
33197 /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
33198 ///
33199 /// # Example
33200 /// ```ignore,no_run
33201 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
33202 /// let x = SqlUsersGetRequest::new().set_project("example");
33203 /// ```
33204 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33205 self.project = v.into();
33206 self
33207 }
33208
33209 /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
33210 ///
33211 /// # Example
33212 /// ```ignore,no_run
33213 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
33214 /// let x = SqlUsersGetRequest::new().set_host("example");
33215 /// ```
33216 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33217 self.host = v.into();
33218 self
33219 }
33220
33221 /// Sets the value of [location][crate::model::SqlUsersGetRequest::location].
33222 ///
33223 /// # Example
33224 /// ```ignore,no_run
33225 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
33226 /// let x = SqlUsersGetRequest::new().set_location("example");
33227 /// ```
33228 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33229 self.location = v.into();
33230 self
33231 }
33232}
33233
33234impl wkt::message::Message for SqlUsersGetRequest {
33235 fn typename() -> &'static str {
33236 "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
33237 }
33238}
33239
33240#[allow(missing_docs)]
33241#[derive(Clone, Default, PartialEq)]
33242#[non_exhaustive]
33243pub struct SqlUsersInsertRequest {
33244 /// Database instance ID. This does not include the project ID.
33245 pub instance: std::string::String,
33246
33247 /// Project ID of the project that contains the instance.
33248 pub project: std::string::String,
33249
33250 #[allow(missing_docs)]
33251 pub body: std::option::Option<crate::model::User>,
33252
33253 /// Optional. Region of the Cloud SQL instance.
33254 pub location: std::string::String,
33255
33256 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33257}
33258
33259impl SqlUsersInsertRequest {
33260 /// Creates a new default instance.
33261 pub fn new() -> Self {
33262 std::default::Default::default()
33263 }
33264
33265 /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
33266 ///
33267 /// # Example
33268 /// ```ignore,no_run
33269 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
33270 /// let x = SqlUsersInsertRequest::new().set_instance("example");
33271 /// ```
33272 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33273 self.instance = v.into();
33274 self
33275 }
33276
33277 /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
33278 ///
33279 /// # Example
33280 /// ```ignore,no_run
33281 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
33282 /// let x = SqlUsersInsertRequest::new().set_project("example");
33283 /// ```
33284 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33285 self.project = v.into();
33286 self
33287 }
33288
33289 /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
33290 ///
33291 /// # Example
33292 /// ```ignore,no_run
33293 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
33294 /// use google_cloud_sql_v1::model::User;
33295 /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
33296 /// ```
33297 pub fn set_body<T>(mut self, v: T) -> Self
33298 where
33299 T: std::convert::Into<crate::model::User>,
33300 {
33301 self.body = std::option::Option::Some(v.into());
33302 self
33303 }
33304
33305 /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
33306 ///
33307 /// # Example
33308 /// ```ignore,no_run
33309 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
33310 /// use google_cloud_sql_v1::model::User;
33311 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
33312 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
33313 /// ```
33314 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
33315 where
33316 T: std::convert::Into<crate::model::User>,
33317 {
33318 self.body = v.map(|x| x.into());
33319 self
33320 }
33321
33322 /// Sets the value of [location][crate::model::SqlUsersInsertRequest::location].
33323 ///
33324 /// # Example
33325 /// ```ignore,no_run
33326 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
33327 /// let x = SqlUsersInsertRequest::new().set_location("example");
33328 /// ```
33329 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33330 self.location = v.into();
33331 self
33332 }
33333}
33334
33335impl wkt::message::Message for SqlUsersInsertRequest {
33336 fn typename() -> &'static str {
33337 "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
33338 }
33339}
33340
33341#[allow(missing_docs)]
33342#[derive(Clone, Default, PartialEq)]
33343#[non_exhaustive]
33344pub struct SqlUsersListRequest {
33345 /// Database instance ID. This does not include the project ID.
33346 pub instance: std::string::String,
33347
33348 /// Project ID of the project that contains the instance.
33349 pub project: std::string::String,
33350
33351 /// Optional. Region of the Cloud SQL instance.
33352 pub location: std::string::String,
33353
33354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33355}
33356
33357impl SqlUsersListRequest {
33358 /// Creates a new default instance.
33359 pub fn new() -> Self {
33360 std::default::Default::default()
33361 }
33362
33363 /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
33364 ///
33365 /// # Example
33366 /// ```ignore,no_run
33367 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
33368 /// let x = SqlUsersListRequest::new().set_instance("example");
33369 /// ```
33370 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33371 self.instance = v.into();
33372 self
33373 }
33374
33375 /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
33376 ///
33377 /// # Example
33378 /// ```ignore,no_run
33379 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
33380 /// let x = SqlUsersListRequest::new().set_project("example");
33381 /// ```
33382 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33383 self.project = v.into();
33384 self
33385 }
33386
33387 /// Sets the value of [location][crate::model::SqlUsersListRequest::location].
33388 ///
33389 /// # Example
33390 /// ```ignore,no_run
33391 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
33392 /// let x = SqlUsersListRequest::new().set_location("example");
33393 /// ```
33394 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33395 self.location = v.into();
33396 self
33397 }
33398}
33399
33400impl wkt::message::Message for SqlUsersListRequest {
33401 fn typename() -> &'static str {
33402 "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
33403 }
33404}
33405
33406#[allow(missing_docs)]
33407#[derive(Clone, Default, PartialEq)]
33408#[non_exhaustive]
33409pub struct SqlUsersUpdateRequest {
33410 /// Optional. Host of the user in the instance.
33411 pub host: std::string::String,
33412
33413 /// Database instance ID. This does not include the project ID.
33414 pub instance: std::string::String,
33415
33416 /// Name of the user in the instance.
33417 pub name: std::string::String,
33418
33419 /// Project ID of the project that contains the instance.
33420 pub project: std::string::String,
33421
33422 /// Optional. List of database roles to grant to the user. body.database_roles
33423 /// will be ignored for update request.
33424 pub database_roles: std::vec::Vec<std::string::String>,
33425
33426 /// Optional. Specifies whether to revoke existing roles that are not present
33427 /// in the `database_roles` field. If `false` or unset, the database roles
33428 /// specified in `database_roles` are added to the user's existing roles.
33429 pub revoke_existing_roles: std::option::Option<bool>,
33430
33431 /// Optional. The server roles to grant to the SQL Server login. Existing
33432 /// server roles will not be revoked if revoke_existing_roles is false.
33433 /// body.server_roles will be ignored for update request.
33434 pub server_roles: std::vec::Vec<std::string::String>,
33435
33436 /// Optional. Specifies whether to revoke existing roles that are not present
33437 /// in the `server_roles` field. If `false` or unset, the server roles
33438 /// specified in `server_roles` are added to the user's existing server roles.
33439 pub revoke_existing_server_roles: std::option::Option<bool>,
33440
33441 #[allow(missing_docs)]
33442 pub body: std::option::Option<crate::model::User>,
33443
33444 /// Optional. Region of the Cloud SQL instance.
33445 pub location: std::string::String,
33446
33447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33448}
33449
33450impl SqlUsersUpdateRequest {
33451 /// Creates a new default instance.
33452 pub fn new() -> Self {
33453 std::default::Default::default()
33454 }
33455
33456 /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
33457 ///
33458 /// # Example
33459 /// ```ignore,no_run
33460 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33461 /// let x = SqlUsersUpdateRequest::new().set_host("example");
33462 /// ```
33463 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33464 self.host = v.into();
33465 self
33466 }
33467
33468 /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
33469 ///
33470 /// # Example
33471 /// ```ignore,no_run
33472 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33473 /// let x = SqlUsersUpdateRequest::new().set_instance("example");
33474 /// ```
33475 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33476 self.instance = v.into();
33477 self
33478 }
33479
33480 /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
33481 ///
33482 /// # Example
33483 /// ```ignore,no_run
33484 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33485 /// let x = SqlUsersUpdateRequest::new().set_name("example");
33486 /// ```
33487 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33488 self.name = v.into();
33489 self
33490 }
33491
33492 /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
33493 ///
33494 /// # Example
33495 /// ```ignore,no_run
33496 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33497 /// let x = SqlUsersUpdateRequest::new().set_project("example");
33498 /// ```
33499 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33500 self.project = v.into();
33501 self
33502 }
33503
33504 /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
33505 ///
33506 /// # Example
33507 /// ```ignore,no_run
33508 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33509 /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
33510 /// ```
33511 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
33512 where
33513 T: std::iter::IntoIterator<Item = V>,
33514 V: std::convert::Into<std::string::String>,
33515 {
33516 use std::iter::Iterator;
33517 self.database_roles = v.into_iter().map(|i| i.into()).collect();
33518 self
33519 }
33520
33521 /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
33522 ///
33523 /// # Example
33524 /// ```ignore,no_run
33525 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33526 /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_roles(true);
33527 /// ```
33528 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
33529 where
33530 T: std::convert::Into<bool>,
33531 {
33532 self.revoke_existing_roles = std::option::Option::Some(v.into());
33533 self
33534 }
33535
33536 /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
33537 ///
33538 /// # Example
33539 /// ```ignore,no_run
33540 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33541 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(Some(false));
33542 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(None::<bool>);
33543 /// ```
33544 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
33545 where
33546 T: std::convert::Into<bool>,
33547 {
33548 self.revoke_existing_roles = v.map(|x| x.into());
33549 self
33550 }
33551
33552 /// Sets the value of [server_roles][crate::model::SqlUsersUpdateRequest::server_roles].
33553 ///
33554 /// # Example
33555 /// ```ignore,no_run
33556 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33557 /// let x = SqlUsersUpdateRequest::new().set_server_roles(["a", "b", "c"]);
33558 /// ```
33559 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
33560 where
33561 T: std::iter::IntoIterator<Item = V>,
33562 V: std::convert::Into<std::string::String>,
33563 {
33564 use std::iter::Iterator;
33565 self.server_roles = v.into_iter().map(|i| i.into()).collect();
33566 self
33567 }
33568
33569 /// Sets the value of [revoke_existing_server_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_server_roles].
33570 ///
33571 /// # Example
33572 /// ```ignore,no_run
33573 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33574 /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_server_roles(true);
33575 /// ```
33576 pub fn set_revoke_existing_server_roles<T>(mut self, v: T) -> Self
33577 where
33578 T: std::convert::Into<bool>,
33579 {
33580 self.revoke_existing_server_roles = std::option::Option::Some(v.into());
33581 self
33582 }
33583
33584 /// Sets or clears the value of [revoke_existing_server_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_server_roles].
33585 ///
33586 /// # Example
33587 /// ```ignore,no_run
33588 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33589 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_server_roles(Some(false));
33590 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_server_roles(None::<bool>);
33591 /// ```
33592 pub fn set_or_clear_revoke_existing_server_roles<T>(mut self, v: std::option::Option<T>) -> Self
33593 where
33594 T: std::convert::Into<bool>,
33595 {
33596 self.revoke_existing_server_roles = v.map(|x| x.into());
33597 self
33598 }
33599
33600 /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
33601 ///
33602 /// # Example
33603 /// ```ignore,no_run
33604 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33605 /// use google_cloud_sql_v1::model::User;
33606 /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
33607 /// ```
33608 pub fn set_body<T>(mut self, v: T) -> Self
33609 where
33610 T: std::convert::Into<crate::model::User>,
33611 {
33612 self.body = std::option::Option::Some(v.into());
33613 self
33614 }
33615
33616 /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
33617 ///
33618 /// # Example
33619 /// ```ignore,no_run
33620 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33621 /// use google_cloud_sql_v1::model::User;
33622 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
33623 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
33624 /// ```
33625 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
33626 where
33627 T: std::convert::Into<crate::model::User>,
33628 {
33629 self.body = v.map(|x| x.into());
33630 self
33631 }
33632
33633 /// Sets the value of [location][crate::model::SqlUsersUpdateRequest::location].
33634 ///
33635 /// # Example
33636 /// ```ignore,no_run
33637 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
33638 /// let x = SqlUsersUpdateRequest::new().set_location("example");
33639 /// ```
33640 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33641 self.location = v.into();
33642 self
33643 }
33644}
33645
33646impl wkt::message::Message for SqlUsersUpdateRequest {
33647 fn typename() -> &'static str {
33648 "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
33649 }
33650}
33651
33652/// User level password validation policy.
33653#[derive(Clone, Default, PartialEq)]
33654#[non_exhaustive]
33655pub struct UserPasswordValidationPolicy {
33656 /// Number of failed login attempts allowed before user get locked.
33657 pub allowed_failed_attempts: i32,
33658
33659 /// Expiration duration after password is updated.
33660 pub password_expiration_duration: std::option::Option<wkt::Duration>,
33661
33662 /// If true, failed login attempts check will be enabled.
33663 pub enable_failed_attempts_check: bool,
33664
33665 /// Output only. Read-only password status.
33666 pub status: std::option::Option<crate::model::PasswordStatus>,
33667
33668 /// If true, the user must specify the current password before changing the
33669 /// password. This flag is supported only for MySQL.
33670 pub enable_password_verification: bool,
33671
33672 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33673}
33674
33675impl UserPasswordValidationPolicy {
33676 /// Creates a new default instance.
33677 pub fn new() -> Self {
33678 std::default::Default::default()
33679 }
33680
33681 /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
33682 ///
33683 /// # Example
33684 /// ```ignore,no_run
33685 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33686 /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
33687 /// ```
33688 pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
33689 self.allowed_failed_attempts = v.into();
33690 self
33691 }
33692
33693 /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
33694 ///
33695 /// # Example
33696 /// ```ignore,no_run
33697 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33698 /// use wkt::Duration;
33699 /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
33700 /// ```
33701 pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
33702 where
33703 T: std::convert::Into<wkt::Duration>,
33704 {
33705 self.password_expiration_duration = std::option::Option::Some(v.into());
33706 self
33707 }
33708
33709 /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
33710 ///
33711 /// # Example
33712 /// ```ignore,no_run
33713 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33714 /// use wkt::Duration;
33715 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
33716 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
33717 /// ```
33718 pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
33719 where
33720 T: std::convert::Into<wkt::Duration>,
33721 {
33722 self.password_expiration_duration = v.map(|x| x.into());
33723 self
33724 }
33725
33726 /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
33727 ///
33728 /// # Example
33729 /// ```ignore,no_run
33730 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33731 /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
33732 /// ```
33733 pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33734 self.enable_failed_attempts_check = v.into();
33735 self
33736 }
33737
33738 /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
33739 ///
33740 /// # Example
33741 /// ```ignore,no_run
33742 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33743 /// use google_cloud_sql_v1::model::PasswordStatus;
33744 /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
33745 /// ```
33746 pub fn set_status<T>(mut self, v: T) -> Self
33747 where
33748 T: std::convert::Into<crate::model::PasswordStatus>,
33749 {
33750 self.status = std::option::Option::Some(v.into());
33751 self
33752 }
33753
33754 /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
33755 ///
33756 /// # Example
33757 /// ```ignore,no_run
33758 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33759 /// use google_cloud_sql_v1::model::PasswordStatus;
33760 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
33761 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
33762 /// ```
33763 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
33764 where
33765 T: std::convert::Into<crate::model::PasswordStatus>,
33766 {
33767 self.status = v.map(|x| x.into());
33768 self
33769 }
33770
33771 /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
33772 ///
33773 /// # Example
33774 /// ```ignore,no_run
33775 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
33776 /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
33777 /// ```
33778 pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33779 self.enable_password_verification = v.into();
33780 self
33781 }
33782}
33783
33784impl wkt::message::Message for UserPasswordValidationPolicy {
33785 fn typename() -> &'static str {
33786 "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
33787 }
33788}
33789
33790/// Read-only password status.
33791#[derive(Clone, Default, PartialEq)]
33792#[non_exhaustive]
33793pub struct PasswordStatus {
33794 /// If true, user does not have login privileges.
33795 pub locked: bool,
33796
33797 /// The expiration time of the current password.
33798 pub password_expiration_time: std::option::Option<wkt::Timestamp>,
33799
33800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33801}
33802
33803impl PasswordStatus {
33804 /// Creates a new default instance.
33805 pub fn new() -> Self {
33806 std::default::Default::default()
33807 }
33808
33809 /// Sets the value of [locked][crate::model::PasswordStatus::locked].
33810 ///
33811 /// # Example
33812 /// ```ignore,no_run
33813 /// # use google_cloud_sql_v1::model::PasswordStatus;
33814 /// let x = PasswordStatus::new().set_locked(true);
33815 /// ```
33816 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
33817 self.locked = v.into();
33818 self
33819 }
33820
33821 /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
33822 ///
33823 /// # Example
33824 /// ```ignore,no_run
33825 /// # use google_cloud_sql_v1::model::PasswordStatus;
33826 /// use wkt::Timestamp;
33827 /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
33828 /// ```
33829 pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
33830 where
33831 T: std::convert::Into<wkt::Timestamp>,
33832 {
33833 self.password_expiration_time = std::option::Option::Some(v.into());
33834 self
33835 }
33836
33837 /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
33838 ///
33839 /// # Example
33840 /// ```ignore,no_run
33841 /// # use google_cloud_sql_v1::model::PasswordStatus;
33842 /// use wkt::Timestamp;
33843 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
33844 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
33845 /// ```
33846 pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
33847 where
33848 T: std::convert::Into<wkt::Timestamp>,
33849 {
33850 self.password_expiration_time = v.map(|x| x.into());
33851 self
33852 }
33853}
33854
33855impl wkt::message::Message for PasswordStatus {
33856 fn typename() -> &'static str {
33857 "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
33858 }
33859}
33860
33861/// A Cloud SQL user resource.
33862#[derive(Clone, Default, PartialEq)]
33863#[non_exhaustive]
33864pub struct User {
33865 /// This is always `sql#user`.
33866 pub kind: std::string::String,
33867
33868 /// The password for the user.
33869 pub password: std::string::String,
33870
33871 /// This field is deprecated and will be removed from a future version of the
33872 /// API.
33873 pub etag: std::string::String,
33874
33875 /// The name of the user in the Cloud SQL instance. Can be omitted for
33876 /// `update` because it is already specified in the URL.
33877 pub name: std::string::String,
33878
33879 /// Optional. The host from which the user can connect. For `insert`
33880 /// operations, host defaults to an empty string. For `update`
33881 /// operations, host is specified as part of the request URL. The host name
33882 /// cannot be updated after insertion. For a MySQL instance, it's required;
33883 /// for a PostgreSQL or SQL Server instance, it's optional.
33884 pub host: std::string::String,
33885
33886 /// The name of the Cloud SQL instance. This does not include the project ID.
33887 /// Can be omitted for `update` because it is already specified on the
33888 /// URL.
33889 pub instance: std::string::String,
33890
33891 /// The project ID of the project containing the Cloud SQL database. The Google
33892 /// apps domain is prefixed if applicable. Can be omitted for `update` because
33893 /// it is already specified on the URL.
33894 pub project: std::string::String,
33895
33896 /// The user type. It determines the method to authenticate the user during
33897 /// login. The default is the database's built-in user type.
33898 pub r#type: crate::model::user::SqlUserType,
33899
33900 /// Optional. The full email for an IAM user. For normal database users, this
33901 /// will not be filled. Only applicable to MySQL database users.
33902 pub iam_email: std::string::String,
33903
33904 /// User level password validation policy.
33905 pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
33906
33907 /// Dual password status for the user.
33908 pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
33909
33910 /// Indicates if a group is active or inactive for IAM database authentication.
33911 pub iam_status: std::option::Option<crate::model::user::IamStatus>,
33912
33913 /// Optional. Role memberships of the user
33914 pub database_roles: std::vec::Vec<std::string::String>,
33915
33916 /// Optional. The server roles for the SQL Server login.
33917 pub server_roles: std::vec::Vec<std::string::String>,
33918
33919 /// User details for specific database type
33920 pub user_details: std::option::Option<crate::model::user::UserDetails>,
33921
33922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
33923}
33924
33925impl User {
33926 /// Creates a new default instance.
33927 pub fn new() -> Self {
33928 std::default::Default::default()
33929 }
33930
33931 /// Sets the value of [kind][crate::model::User::kind].
33932 ///
33933 /// # Example
33934 /// ```ignore,no_run
33935 /// # use google_cloud_sql_v1::model::User;
33936 /// let x = User::new().set_kind("example");
33937 /// ```
33938 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33939 self.kind = v.into();
33940 self
33941 }
33942
33943 /// Sets the value of [password][crate::model::User::password].
33944 ///
33945 /// # Example
33946 /// ```ignore,no_run
33947 /// # use google_cloud_sql_v1::model::User;
33948 /// let x = User::new().set_password("example");
33949 /// ```
33950 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33951 self.password = v.into();
33952 self
33953 }
33954
33955 /// Sets the value of [etag][crate::model::User::etag].
33956 ///
33957 /// # Example
33958 /// ```ignore,no_run
33959 /// # use google_cloud_sql_v1::model::User;
33960 /// let x = User::new().set_etag("example");
33961 /// ```
33962 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33963 self.etag = v.into();
33964 self
33965 }
33966
33967 /// Sets the value of [name][crate::model::User::name].
33968 ///
33969 /// # Example
33970 /// ```ignore,no_run
33971 /// # use google_cloud_sql_v1::model::User;
33972 /// let x = User::new().set_name("example");
33973 /// ```
33974 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33975 self.name = v.into();
33976 self
33977 }
33978
33979 /// Sets the value of [host][crate::model::User::host].
33980 ///
33981 /// # Example
33982 /// ```ignore,no_run
33983 /// # use google_cloud_sql_v1::model::User;
33984 /// let x = User::new().set_host("example");
33985 /// ```
33986 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33987 self.host = v.into();
33988 self
33989 }
33990
33991 /// Sets the value of [instance][crate::model::User::instance].
33992 ///
33993 /// # Example
33994 /// ```ignore,no_run
33995 /// # use google_cloud_sql_v1::model::User;
33996 /// let x = User::new().set_instance("example");
33997 /// ```
33998 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
33999 self.instance = v.into();
34000 self
34001 }
34002
34003 /// Sets the value of [project][crate::model::User::project].
34004 ///
34005 /// # Example
34006 /// ```ignore,no_run
34007 /// # use google_cloud_sql_v1::model::User;
34008 /// let x = User::new().set_project("example");
34009 /// ```
34010 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34011 self.project = v.into();
34012 self
34013 }
34014
34015 /// Sets the value of [r#type][crate::model::User::type].
34016 ///
34017 /// # Example
34018 /// ```ignore,no_run
34019 /// # use google_cloud_sql_v1::model::User;
34020 /// use google_cloud_sql_v1::model::user::SqlUserType;
34021 /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
34022 /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
34023 /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
34024 /// ```
34025 pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
34026 mut self,
34027 v: T,
34028 ) -> Self {
34029 self.r#type = v.into();
34030 self
34031 }
34032
34033 /// Sets the value of [iam_email][crate::model::User::iam_email].
34034 ///
34035 /// # Example
34036 /// ```ignore,no_run
34037 /// # use google_cloud_sql_v1::model::User;
34038 /// let x = User::new().set_iam_email("example");
34039 /// ```
34040 pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34041 self.iam_email = v.into();
34042 self
34043 }
34044
34045 /// Sets the value of [password_policy][crate::model::User::password_policy].
34046 ///
34047 /// # Example
34048 /// ```ignore,no_run
34049 /// # use google_cloud_sql_v1::model::User;
34050 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
34051 /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
34052 /// ```
34053 pub fn set_password_policy<T>(mut self, v: T) -> Self
34054 where
34055 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
34056 {
34057 self.password_policy = std::option::Option::Some(v.into());
34058 self
34059 }
34060
34061 /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
34062 ///
34063 /// # Example
34064 /// ```ignore,no_run
34065 /// # use google_cloud_sql_v1::model::User;
34066 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
34067 /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
34068 /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
34069 /// ```
34070 pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
34071 where
34072 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
34073 {
34074 self.password_policy = v.map(|x| x.into());
34075 self
34076 }
34077
34078 /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
34079 ///
34080 /// # Example
34081 /// ```ignore,no_run
34082 /// # use google_cloud_sql_v1::model::User;
34083 /// use google_cloud_sql_v1::model::user::DualPasswordType;
34084 /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
34085 /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
34086 /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
34087 /// ```
34088 pub fn set_dual_password_type<T>(mut self, v: T) -> Self
34089 where
34090 T: std::convert::Into<crate::model::user::DualPasswordType>,
34091 {
34092 self.dual_password_type = std::option::Option::Some(v.into());
34093 self
34094 }
34095
34096 /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
34097 ///
34098 /// # Example
34099 /// ```ignore,no_run
34100 /// # use google_cloud_sql_v1::model::User;
34101 /// use google_cloud_sql_v1::model::user::DualPasswordType;
34102 /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
34103 /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
34104 /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
34105 /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
34106 /// ```
34107 pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
34108 where
34109 T: std::convert::Into<crate::model::user::DualPasswordType>,
34110 {
34111 self.dual_password_type = v.map(|x| x.into());
34112 self
34113 }
34114
34115 /// Sets the value of [iam_status][crate::model::User::iam_status].
34116 ///
34117 /// # Example
34118 /// ```ignore,no_run
34119 /// # use google_cloud_sql_v1::model::User;
34120 /// use google_cloud_sql_v1::model::user::IamStatus;
34121 /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
34122 /// let x1 = User::new().set_iam_status(IamStatus::Active);
34123 /// ```
34124 pub fn set_iam_status<T>(mut self, v: T) -> Self
34125 where
34126 T: std::convert::Into<crate::model::user::IamStatus>,
34127 {
34128 self.iam_status = std::option::Option::Some(v.into());
34129 self
34130 }
34131
34132 /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
34133 ///
34134 /// # Example
34135 /// ```ignore,no_run
34136 /// # use google_cloud_sql_v1::model::User;
34137 /// use google_cloud_sql_v1::model::user::IamStatus;
34138 /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
34139 /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
34140 /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
34141 /// ```
34142 pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
34143 where
34144 T: std::convert::Into<crate::model::user::IamStatus>,
34145 {
34146 self.iam_status = v.map(|x| x.into());
34147 self
34148 }
34149
34150 /// Sets the value of [database_roles][crate::model::User::database_roles].
34151 ///
34152 /// # Example
34153 /// ```ignore,no_run
34154 /// # use google_cloud_sql_v1::model::User;
34155 /// let x = User::new().set_database_roles(["a", "b", "c"]);
34156 /// ```
34157 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
34158 where
34159 T: std::iter::IntoIterator<Item = V>,
34160 V: std::convert::Into<std::string::String>,
34161 {
34162 use std::iter::Iterator;
34163 self.database_roles = v.into_iter().map(|i| i.into()).collect();
34164 self
34165 }
34166
34167 /// Sets the value of [server_roles][crate::model::User::server_roles].
34168 ///
34169 /// # Example
34170 /// ```ignore,no_run
34171 /// # use google_cloud_sql_v1::model::User;
34172 /// let x = User::new().set_server_roles(["a", "b", "c"]);
34173 /// ```
34174 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
34175 where
34176 T: std::iter::IntoIterator<Item = V>,
34177 V: std::convert::Into<std::string::String>,
34178 {
34179 use std::iter::Iterator;
34180 self.server_roles = v.into_iter().map(|i| i.into()).collect();
34181 self
34182 }
34183
34184 /// Sets the value of [user_details][crate::model::User::user_details].
34185 ///
34186 /// Note that all the setters affecting `user_details` are mutually
34187 /// exclusive.
34188 ///
34189 /// # Example
34190 /// ```ignore,no_run
34191 /// # use google_cloud_sql_v1::model::User;
34192 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
34193 /// let x = User::new().set_user_details(Some(
34194 /// google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
34195 /// ```
34196 pub fn set_user_details<
34197 T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
34198 >(
34199 mut self,
34200 v: T,
34201 ) -> Self {
34202 self.user_details = v.into();
34203 self
34204 }
34205
34206 /// The value of [user_details][crate::model::User::user_details]
34207 /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
34208 /// holds a different branch.
34209 pub fn sqlserver_user_details(
34210 &self,
34211 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
34212 #[allow(unreachable_patterns)]
34213 self.user_details.as_ref().and_then(|v| match v {
34214 crate::model::user::UserDetails::SqlserverUserDetails(v) => {
34215 std::option::Option::Some(v)
34216 }
34217 _ => std::option::Option::None,
34218 })
34219 }
34220
34221 /// Sets the value of [user_details][crate::model::User::user_details]
34222 /// to hold a `SqlserverUserDetails`.
34223 ///
34224 /// Note that all the setters affecting `user_details` are
34225 /// mutually exclusive.
34226 ///
34227 /// # Example
34228 /// ```ignore,no_run
34229 /// # use google_cloud_sql_v1::model::User;
34230 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
34231 /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
34232 /// assert!(x.sqlserver_user_details().is_some());
34233 /// ```
34234 pub fn set_sqlserver_user_details<
34235 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
34236 >(
34237 mut self,
34238 v: T,
34239 ) -> Self {
34240 self.user_details = std::option::Option::Some(
34241 crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
34242 );
34243 self
34244 }
34245}
34246
34247impl wkt::message::Message for User {
34248 fn typename() -> &'static str {
34249 "type.googleapis.com/google.cloud.sql.v1.User"
34250 }
34251}
34252
34253/// Defines additional types related to [User].
34254pub mod user {
34255 #[allow(unused_imports)]
34256 use super::*;
34257
34258 /// The user type.
34259 ///
34260 /// # Working with unknown values
34261 ///
34262 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34263 /// additional enum variants at any time. Adding new variants is not considered
34264 /// a breaking change. Applications should write their code in anticipation of:
34265 ///
34266 /// - New values appearing in future releases of the client library, **and**
34267 /// - New values received dynamically, without application changes.
34268 ///
34269 /// Please consult the [Working with enums] section in the user guide for some
34270 /// guidelines.
34271 ///
34272 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34273 #[derive(Clone, Debug, PartialEq)]
34274 #[non_exhaustive]
34275 pub enum SqlUserType {
34276 /// The database's built-in user type.
34277 BuiltIn,
34278 /// Cloud IAM user.
34279 CloudIamUser,
34280 /// Cloud IAM service account.
34281 CloudIamServiceAccount,
34282 /// Cloud IAM group. Not used for login.
34283 CloudIamGroup,
34284 /// Read-only. Login for a user that belongs to the Cloud IAM group.
34285 CloudIamGroupUser,
34286 /// Read-only. Login for a service account that belongs to the
34287 /// Cloud IAM group.
34288 CloudIamGroupServiceAccount,
34289 /// Cloud IAM workforce identity user managed via workforce identity
34290 /// federation.
34291 CloudIamWorkforceIdentity,
34292 /// Microsoft Entra ID user.
34293 EntraidUser,
34294 /// If set, the enum was initialized with an unknown value.
34295 ///
34296 /// Applications can examine the value using [SqlUserType::value] or
34297 /// [SqlUserType::name].
34298 UnknownValue(sql_user_type::UnknownValue),
34299 }
34300
34301 #[doc(hidden)]
34302 pub mod sql_user_type {
34303 #[allow(unused_imports)]
34304 use super::*;
34305 #[derive(Clone, Debug, PartialEq)]
34306 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34307 }
34308
34309 impl SqlUserType {
34310 /// Gets the enum value.
34311 ///
34312 /// Returns `None` if the enum contains an unknown value deserialized from
34313 /// the string representation of enums.
34314 pub fn value(&self) -> std::option::Option<i32> {
34315 match self {
34316 Self::BuiltIn => std::option::Option::Some(0),
34317 Self::CloudIamUser => std::option::Option::Some(1),
34318 Self::CloudIamServiceAccount => std::option::Option::Some(2),
34319 Self::CloudIamGroup => std::option::Option::Some(3),
34320 Self::CloudIamGroupUser => std::option::Option::Some(4),
34321 Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
34322 Self::CloudIamWorkforceIdentity => std::option::Option::Some(6),
34323 Self::EntraidUser => std::option::Option::Some(7),
34324 Self::UnknownValue(u) => u.0.value(),
34325 }
34326 }
34327
34328 /// Gets the enum value as a string.
34329 ///
34330 /// Returns `None` if the enum contains an unknown value deserialized from
34331 /// the integer representation of enums.
34332 pub fn name(&self) -> std::option::Option<&str> {
34333 match self {
34334 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
34335 Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
34336 Self::CloudIamServiceAccount => {
34337 std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
34338 }
34339 Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
34340 Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
34341 Self::CloudIamGroupServiceAccount => {
34342 std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
34343 }
34344 Self::CloudIamWorkforceIdentity => {
34345 std::option::Option::Some("CLOUD_IAM_WORKFORCE_IDENTITY")
34346 }
34347 Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
34348 Self::UnknownValue(u) => u.0.name(),
34349 }
34350 }
34351 }
34352
34353 impl std::default::Default for SqlUserType {
34354 fn default() -> Self {
34355 use std::convert::From;
34356 Self::from(0)
34357 }
34358 }
34359
34360 impl std::fmt::Display for SqlUserType {
34361 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34362 wkt::internal::display_enum(f, self.name(), self.value())
34363 }
34364 }
34365
34366 impl std::convert::From<i32> for SqlUserType {
34367 fn from(value: i32) -> Self {
34368 match value {
34369 0 => Self::BuiltIn,
34370 1 => Self::CloudIamUser,
34371 2 => Self::CloudIamServiceAccount,
34372 3 => Self::CloudIamGroup,
34373 4 => Self::CloudIamGroupUser,
34374 5 => Self::CloudIamGroupServiceAccount,
34375 6 => Self::CloudIamWorkforceIdentity,
34376 7 => Self::EntraidUser,
34377 _ => Self::UnknownValue(sql_user_type::UnknownValue(
34378 wkt::internal::UnknownEnumValue::Integer(value),
34379 )),
34380 }
34381 }
34382 }
34383
34384 impl std::convert::From<&str> for SqlUserType {
34385 fn from(value: &str) -> Self {
34386 use std::string::ToString;
34387 match value {
34388 "BUILT_IN" => Self::BuiltIn,
34389 "CLOUD_IAM_USER" => Self::CloudIamUser,
34390 "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
34391 "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
34392 "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
34393 "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
34394 "CLOUD_IAM_WORKFORCE_IDENTITY" => Self::CloudIamWorkforceIdentity,
34395 "ENTRAID_USER" => Self::EntraidUser,
34396 _ => Self::UnknownValue(sql_user_type::UnknownValue(
34397 wkt::internal::UnknownEnumValue::String(value.to_string()),
34398 )),
34399 }
34400 }
34401 }
34402
34403 impl serde::ser::Serialize for SqlUserType {
34404 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34405 where
34406 S: serde::Serializer,
34407 {
34408 match self {
34409 Self::BuiltIn => serializer.serialize_i32(0),
34410 Self::CloudIamUser => serializer.serialize_i32(1),
34411 Self::CloudIamServiceAccount => serializer.serialize_i32(2),
34412 Self::CloudIamGroup => serializer.serialize_i32(3),
34413 Self::CloudIamGroupUser => serializer.serialize_i32(4),
34414 Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
34415 Self::CloudIamWorkforceIdentity => serializer.serialize_i32(6),
34416 Self::EntraidUser => serializer.serialize_i32(7),
34417 Self::UnknownValue(u) => u.0.serialize(serializer),
34418 }
34419 }
34420 }
34421
34422 impl<'de> serde::de::Deserialize<'de> for SqlUserType {
34423 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34424 where
34425 D: serde::Deserializer<'de>,
34426 {
34427 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
34428 ".google.cloud.sql.v1.User.SqlUserType",
34429 ))
34430 }
34431 }
34432
34433 /// The type of retained password.
34434 ///
34435 /// # Working with unknown values
34436 ///
34437 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34438 /// additional enum variants at any time. Adding new variants is not considered
34439 /// a breaking change. Applications should write their code in anticipation of:
34440 ///
34441 /// - New values appearing in future releases of the client library, **and**
34442 /// - New values received dynamically, without application changes.
34443 ///
34444 /// Please consult the [Working with enums] section in the user guide for some
34445 /// guidelines.
34446 ///
34447 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34448 #[derive(Clone, Debug, PartialEq)]
34449 #[non_exhaustive]
34450 pub enum DualPasswordType {
34451 /// The default value.
34452 Unspecified,
34453 /// Do not update the user's dual password status.
34454 NoModifyDualPassword,
34455 /// No dual password usable for connecting using this user.
34456 NoDualPassword,
34457 /// Dual password usable for connecting using this user.
34458 DualPassword,
34459 /// If set, the enum was initialized with an unknown value.
34460 ///
34461 /// Applications can examine the value using [DualPasswordType::value] or
34462 /// [DualPasswordType::name].
34463 UnknownValue(dual_password_type::UnknownValue),
34464 }
34465
34466 #[doc(hidden)]
34467 pub mod dual_password_type {
34468 #[allow(unused_imports)]
34469 use super::*;
34470 #[derive(Clone, Debug, PartialEq)]
34471 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34472 }
34473
34474 impl DualPasswordType {
34475 /// Gets the enum value.
34476 ///
34477 /// Returns `None` if the enum contains an unknown value deserialized from
34478 /// the string representation of enums.
34479 pub fn value(&self) -> std::option::Option<i32> {
34480 match self {
34481 Self::Unspecified => std::option::Option::Some(0),
34482 Self::NoModifyDualPassword => std::option::Option::Some(1),
34483 Self::NoDualPassword => std::option::Option::Some(2),
34484 Self::DualPassword => std::option::Option::Some(3),
34485 Self::UnknownValue(u) => u.0.value(),
34486 }
34487 }
34488
34489 /// Gets the enum value as a string.
34490 ///
34491 /// Returns `None` if the enum contains an unknown value deserialized from
34492 /// the integer representation of enums.
34493 pub fn name(&self) -> std::option::Option<&str> {
34494 match self {
34495 Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
34496 Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
34497 Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
34498 Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
34499 Self::UnknownValue(u) => u.0.name(),
34500 }
34501 }
34502 }
34503
34504 impl std::default::Default for DualPasswordType {
34505 fn default() -> Self {
34506 use std::convert::From;
34507 Self::from(0)
34508 }
34509 }
34510
34511 impl std::fmt::Display for DualPasswordType {
34512 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34513 wkt::internal::display_enum(f, self.name(), self.value())
34514 }
34515 }
34516
34517 impl std::convert::From<i32> for DualPasswordType {
34518 fn from(value: i32) -> Self {
34519 match value {
34520 0 => Self::Unspecified,
34521 1 => Self::NoModifyDualPassword,
34522 2 => Self::NoDualPassword,
34523 3 => Self::DualPassword,
34524 _ => Self::UnknownValue(dual_password_type::UnknownValue(
34525 wkt::internal::UnknownEnumValue::Integer(value),
34526 )),
34527 }
34528 }
34529 }
34530
34531 impl std::convert::From<&str> for DualPasswordType {
34532 fn from(value: &str) -> Self {
34533 use std::string::ToString;
34534 match value {
34535 "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
34536 "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
34537 "NO_DUAL_PASSWORD" => Self::NoDualPassword,
34538 "DUAL_PASSWORD" => Self::DualPassword,
34539 _ => Self::UnknownValue(dual_password_type::UnknownValue(
34540 wkt::internal::UnknownEnumValue::String(value.to_string()),
34541 )),
34542 }
34543 }
34544 }
34545
34546 impl serde::ser::Serialize for DualPasswordType {
34547 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34548 where
34549 S: serde::Serializer,
34550 {
34551 match self {
34552 Self::Unspecified => serializer.serialize_i32(0),
34553 Self::NoModifyDualPassword => serializer.serialize_i32(1),
34554 Self::NoDualPassword => serializer.serialize_i32(2),
34555 Self::DualPassword => serializer.serialize_i32(3),
34556 Self::UnknownValue(u) => u.0.serialize(serializer),
34557 }
34558 }
34559 }
34560
34561 impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
34562 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34563 where
34564 D: serde::Deserializer<'de>,
34565 {
34566 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
34567 ".google.cloud.sql.v1.User.DualPasswordType",
34568 ))
34569 }
34570 }
34571
34572 /// Indicates if a group is available for IAM database authentication.
34573 ///
34574 /// # Working with unknown values
34575 ///
34576 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34577 /// additional enum variants at any time. Adding new variants is not considered
34578 /// a breaking change. Applications should write their code in anticipation of:
34579 ///
34580 /// - New values appearing in future releases of the client library, **and**
34581 /// - New values received dynamically, without application changes.
34582 ///
34583 /// Please consult the [Working with enums] section in the user guide for some
34584 /// guidelines.
34585 ///
34586 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34587 #[derive(Clone, Debug, PartialEq)]
34588 #[non_exhaustive]
34589 pub enum IamStatus {
34590 /// The default value for users that are not of type CLOUD_IAM_GROUP.
34591 /// Only CLOUD_IAM_GROUP users will be inactive or active.
34592 /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
34593 /// display whether they are active or inactive as that is not applicable to
34594 /// them.
34595 Unspecified,
34596 /// INACTIVE indicates a group is not available for IAM database
34597 /// authentication.
34598 Inactive,
34599 /// ACTIVE indicates a group is available for IAM database authentication.
34600 Active,
34601 /// If set, the enum was initialized with an unknown value.
34602 ///
34603 /// Applications can examine the value using [IamStatus::value] or
34604 /// [IamStatus::name].
34605 UnknownValue(iam_status::UnknownValue),
34606 }
34607
34608 #[doc(hidden)]
34609 pub mod iam_status {
34610 #[allow(unused_imports)]
34611 use super::*;
34612 #[derive(Clone, Debug, PartialEq)]
34613 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34614 }
34615
34616 impl IamStatus {
34617 /// Gets the enum value.
34618 ///
34619 /// Returns `None` if the enum contains an unknown value deserialized from
34620 /// the string representation of enums.
34621 pub fn value(&self) -> std::option::Option<i32> {
34622 match self {
34623 Self::Unspecified => std::option::Option::Some(0),
34624 Self::Inactive => std::option::Option::Some(1),
34625 Self::Active => std::option::Option::Some(2),
34626 Self::UnknownValue(u) => u.0.value(),
34627 }
34628 }
34629
34630 /// Gets the enum value as a string.
34631 ///
34632 /// Returns `None` if the enum contains an unknown value deserialized from
34633 /// the integer representation of enums.
34634 pub fn name(&self) -> std::option::Option<&str> {
34635 match self {
34636 Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
34637 Self::Inactive => std::option::Option::Some("INACTIVE"),
34638 Self::Active => std::option::Option::Some("ACTIVE"),
34639 Self::UnknownValue(u) => u.0.name(),
34640 }
34641 }
34642 }
34643
34644 impl std::default::Default for IamStatus {
34645 fn default() -> Self {
34646 use std::convert::From;
34647 Self::from(0)
34648 }
34649 }
34650
34651 impl std::fmt::Display for IamStatus {
34652 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34653 wkt::internal::display_enum(f, self.name(), self.value())
34654 }
34655 }
34656
34657 impl std::convert::From<i32> for IamStatus {
34658 fn from(value: i32) -> Self {
34659 match value {
34660 0 => Self::Unspecified,
34661 1 => Self::Inactive,
34662 2 => Self::Active,
34663 _ => Self::UnknownValue(iam_status::UnknownValue(
34664 wkt::internal::UnknownEnumValue::Integer(value),
34665 )),
34666 }
34667 }
34668 }
34669
34670 impl std::convert::From<&str> for IamStatus {
34671 fn from(value: &str) -> Self {
34672 use std::string::ToString;
34673 match value {
34674 "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
34675 "INACTIVE" => Self::Inactive,
34676 "ACTIVE" => Self::Active,
34677 _ => Self::UnknownValue(iam_status::UnknownValue(
34678 wkt::internal::UnknownEnumValue::String(value.to_string()),
34679 )),
34680 }
34681 }
34682 }
34683
34684 impl serde::ser::Serialize for IamStatus {
34685 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34686 where
34687 S: serde::Serializer,
34688 {
34689 match self {
34690 Self::Unspecified => serializer.serialize_i32(0),
34691 Self::Inactive => serializer.serialize_i32(1),
34692 Self::Active => serializer.serialize_i32(2),
34693 Self::UnknownValue(u) => u.0.serialize(serializer),
34694 }
34695 }
34696 }
34697
34698 impl<'de> serde::de::Deserialize<'de> for IamStatus {
34699 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34700 where
34701 D: serde::Deserializer<'de>,
34702 {
34703 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
34704 ".google.cloud.sql.v1.User.IamStatus",
34705 ))
34706 }
34707 }
34708
34709 /// User details for specific database type
34710 #[derive(Clone, Debug, PartialEq)]
34711 #[non_exhaustive]
34712 pub enum UserDetails {
34713 #[allow(missing_docs)]
34714 SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
34715 }
34716}
34717
34718/// Represents a Sql Server user on the Cloud SQL instance.
34719#[derive(Clone, Default, PartialEq)]
34720#[non_exhaustive]
34721pub struct SqlServerUserDetails {
34722 /// If the user has been disabled
34723 pub disabled: bool,
34724
34725 /// The server roles for this user
34726 pub server_roles: std::vec::Vec<std::string::String>,
34727
34728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34729}
34730
34731impl SqlServerUserDetails {
34732 /// Creates a new default instance.
34733 pub fn new() -> Self {
34734 std::default::Default::default()
34735 }
34736
34737 /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
34738 ///
34739 /// # Example
34740 /// ```ignore,no_run
34741 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
34742 /// let x = SqlServerUserDetails::new().set_disabled(true);
34743 /// ```
34744 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
34745 self.disabled = v.into();
34746 self
34747 }
34748
34749 /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
34750 ///
34751 /// # Example
34752 /// ```ignore,no_run
34753 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
34754 /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
34755 /// ```
34756 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
34757 where
34758 T: std::iter::IntoIterator<Item = V>,
34759 V: std::convert::Into<std::string::String>,
34760 {
34761 use std::iter::Iterator;
34762 self.server_roles = v.into_iter().map(|i| i.into()).collect();
34763 self
34764 }
34765}
34766
34767impl wkt::message::Message for SqlServerUserDetails {
34768 fn typename() -> &'static str {
34769 "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
34770 }
34771}
34772
34773/// User list response.
34774#[derive(Clone, Default, PartialEq)]
34775#[non_exhaustive]
34776pub struct UsersListResponse {
34777 /// This is always `sql#usersList`.
34778 pub kind: std::string::String,
34779
34780 /// List of user resources in the instance.
34781 pub items: std::vec::Vec<crate::model::User>,
34782
34783 /// Unused.
34784 #[deprecated]
34785 pub next_page_token: std::string::String,
34786
34787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
34788}
34789
34790impl UsersListResponse {
34791 /// Creates a new default instance.
34792 pub fn new() -> Self {
34793 std::default::Default::default()
34794 }
34795
34796 /// Sets the value of [kind][crate::model::UsersListResponse::kind].
34797 ///
34798 /// # Example
34799 /// ```ignore,no_run
34800 /// # use google_cloud_sql_v1::model::UsersListResponse;
34801 /// let x = UsersListResponse::new().set_kind("example");
34802 /// ```
34803 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34804 self.kind = v.into();
34805 self
34806 }
34807
34808 /// Sets the value of [items][crate::model::UsersListResponse::items].
34809 ///
34810 /// # Example
34811 /// ```ignore,no_run
34812 /// # use google_cloud_sql_v1::model::UsersListResponse;
34813 /// use google_cloud_sql_v1::model::User;
34814 /// let x = UsersListResponse::new()
34815 /// .set_items([
34816 /// User::default()/* use setters */,
34817 /// User::default()/* use (different) setters */,
34818 /// ]);
34819 /// ```
34820 pub fn set_items<T, V>(mut self, v: T) -> Self
34821 where
34822 T: std::iter::IntoIterator<Item = V>,
34823 V: std::convert::Into<crate::model::User>,
34824 {
34825 use std::iter::Iterator;
34826 self.items = v.into_iter().map(|i| i.into()).collect();
34827 self
34828 }
34829
34830 /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
34831 ///
34832 /// # Example
34833 /// ```ignore,no_run
34834 /// # use google_cloud_sql_v1::model::UsersListResponse;
34835 /// let x = UsersListResponse::new().set_next_page_token("example");
34836 /// ```
34837 #[deprecated]
34838 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
34839 self.next_page_token = v.into();
34840 self
34841 }
34842}
34843
34844impl wkt::message::Message for UsersListResponse {
34845 fn typename() -> &'static str {
34846 "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
34847 }
34848}
34849
34850/// The status of a backup run.
34851///
34852/// # Working with unknown values
34853///
34854/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34855/// additional enum variants at any time. Adding new variants is not considered
34856/// a breaking change. Applications should write their code in anticipation of:
34857///
34858/// - New values appearing in future releases of the client library, **and**
34859/// - New values received dynamically, without application changes.
34860///
34861/// Please consult the [Working with enums] section in the user guide for some
34862/// guidelines.
34863///
34864/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34865#[derive(Clone, Debug, PartialEq)]
34866#[non_exhaustive]
34867pub enum SqlBackupRunStatus {
34868 /// The status of the run is unknown.
34869 Unspecified,
34870 /// The backup operation was enqueued.
34871 Enqueued,
34872 /// The backup is overdue across a given backup window. Indicates a
34873 /// problem. Example: Long-running operation in progress during
34874 /// the whole window.
34875 Overdue,
34876 /// The backup is in progress.
34877 Running,
34878 /// The backup failed.
34879 Failed,
34880 /// The backup was successful.
34881 Successful,
34882 /// The backup was skipped (without problems) for a given backup
34883 /// window. Example: Instance was idle.
34884 Skipped,
34885 /// The backup is about to be deleted.
34886 DeletionPending,
34887 /// The backup deletion failed.
34888 DeletionFailed,
34889 /// The backup has been deleted.
34890 Deleted,
34891 /// If set, the enum was initialized with an unknown value.
34892 ///
34893 /// Applications can examine the value using [SqlBackupRunStatus::value] or
34894 /// [SqlBackupRunStatus::name].
34895 UnknownValue(sql_backup_run_status::UnknownValue),
34896}
34897
34898#[doc(hidden)]
34899pub mod sql_backup_run_status {
34900 #[allow(unused_imports)]
34901 use super::*;
34902 #[derive(Clone, Debug, PartialEq)]
34903 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34904}
34905
34906impl SqlBackupRunStatus {
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::Enqueued => std::option::Option::Some(1),
34915 Self::Overdue => std::option::Option::Some(2),
34916 Self::Running => std::option::Option::Some(3),
34917 Self::Failed => std::option::Option::Some(4),
34918 Self::Successful => std::option::Option::Some(5),
34919 Self::Skipped => std::option::Option::Some(6),
34920 Self::DeletionPending => std::option::Option::Some(7),
34921 Self::DeletionFailed => std::option::Option::Some(8),
34922 Self::Deleted => std::option::Option::Some(9),
34923 Self::UnknownValue(u) => u.0.value(),
34924 }
34925 }
34926
34927 /// Gets the enum value as a string.
34928 ///
34929 /// Returns `None` if the enum contains an unknown value deserialized from
34930 /// the integer representation of enums.
34931 pub fn name(&self) -> std::option::Option<&str> {
34932 match self {
34933 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
34934 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
34935 Self::Overdue => std::option::Option::Some("OVERDUE"),
34936 Self::Running => std::option::Option::Some("RUNNING"),
34937 Self::Failed => std::option::Option::Some("FAILED"),
34938 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
34939 Self::Skipped => std::option::Option::Some("SKIPPED"),
34940 Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
34941 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
34942 Self::Deleted => std::option::Option::Some("DELETED"),
34943 Self::UnknownValue(u) => u.0.name(),
34944 }
34945 }
34946}
34947
34948impl std::default::Default for SqlBackupRunStatus {
34949 fn default() -> Self {
34950 use std::convert::From;
34951 Self::from(0)
34952 }
34953}
34954
34955impl std::fmt::Display for SqlBackupRunStatus {
34956 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34957 wkt::internal::display_enum(f, self.name(), self.value())
34958 }
34959}
34960
34961impl std::convert::From<i32> for SqlBackupRunStatus {
34962 fn from(value: i32) -> Self {
34963 match value {
34964 0 => Self::Unspecified,
34965 1 => Self::Enqueued,
34966 2 => Self::Overdue,
34967 3 => Self::Running,
34968 4 => Self::Failed,
34969 5 => Self::Successful,
34970 6 => Self::Skipped,
34971 7 => Self::DeletionPending,
34972 8 => Self::DeletionFailed,
34973 9 => Self::Deleted,
34974 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
34975 wkt::internal::UnknownEnumValue::Integer(value),
34976 )),
34977 }
34978 }
34979}
34980
34981impl std::convert::From<&str> for SqlBackupRunStatus {
34982 fn from(value: &str) -> Self {
34983 use std::string::ToString;
34984 match value {
34985 "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
34986 "ENQUEUED" => Self::Enqueued,
34987 "OVERDUE" => Self::Overdue,
34988 "RUNNING" => Self::Running,
34989 "FAILED" => Self::Failed,
34990 "SUCCESSFUL" => Self::Successful,
34991 "SKIPPED" => Self::Skipped,
34992 "DELETION_PENDING" => Self::DeletionPending,
34993 "DELETION_FAILED" => Self::DeletionFailed,
34994 "DELETED" => Self::Deleted,
34995 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
34996 wkt::internal::UnknownEnumValue::String(value.to_string()),
34997 )),
34998 }
34999 }
35000}
35001
35002impl serde::ser::Serialize for SqlBackupRunStatus {
35003 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35004 where
35005 S: serde::Serializer,
35006 {
35007 match self {
35008 Self::Unspecified => serializer.serialize_i32(0),
35009 Self::Enqueued => serializer.serialize_i32(1),
35010 Self::Overdue => serializer.serialize_i32(2),
35011 Self::Running => serializer.serialize_i32(3),
35012 Self::Failed => serializer.serialize_i32(4),
35013 Self::Successful => serializer.serialize_i32(5),
35014 Self::Skipped => serializer.serialize_i32(6),
35015 Self::DeletionPending => serializer.serialize_i32(7),
35016 Self::DeletionFailed => serializer.serialize_i32(8),
35017 Self::Deleted => serializer.serialize_i32(9),
35018 Self::UnknownValue(u) => u.0.serialize(serializer),
35019 }
35020 }
35021}
35022
35023impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
35024 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35025 where
35026 D: serde::Deserializer<'de>,
35027 {
35028 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
35029 ".google.cloud.sql.v1.SqlBackupRunStatus",
35030 ))
35031 }
35032}
35033
35034/// Defines the supported backup kinds.
35035///
35036/// # Working with unknown values
35037///
35038/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35039/// additional enum variants at any time. Adding new variants is not considered
35040/// a breaking change. Applications should write their code in anticipation of:
35041///
35042/// - New values appearing in future releases of the client library, **and**
35043/// - New values received dynamically, without application changes.
35044///
35045/// Please consult the [Working with enums] section in the user guide for some
35046/// guidelines.
35047///
35048/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35049#[derive(Clone, Debug, PartialEq)]
35050#[non_exhaustive]
35051pub enum SqlBackupKind {
35052 /// This is an unknown BackupKind.
35053 Unspecified,
35054 /// Snapshot-based backups.
35055 Snapshot,
35056 /// Physical backups.
35057 Physical,
35058 /// If set, the enum was initialized with an unknown value.
35059 ///
35060 /// Applications can examine the value using [SqlBackupKind::value] or
35061 /// [SqlBackupKind::name].
35062 UnknownValue(sql_backup_kind::UnknownValue),
35063}
35064
35065#[doc(hidden)]
35066pub mod sql_backup_kind {
35067 #[allow(unused_imports)]
35068 use super::*;
35069 #[derive(Clone, Debug, PartialEq)]
35070 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35071}
35072
35073impl SqlBackupKind {
35074 /// Gets the enum value.
35075 ///
35076 /// Returns `None` if the enum contains an unknown value deserialized from
35077 /// the string representation of enums.
35078 pub fn value(&self) -> std::option::Option<i32> {
35079 match self {
35080 Self::Unspecified => std::option::Option::Some(0),
35081 Self::Snapshot => std::option::Option::Some(1),
35082 Self::Physical => std::option::Option::Some(2),
35083 Self::UnknownValue(u) => u.0.value(),
35084 }
35085 }
35086
35087 /// Gets the enum value as a string.
35088 ///
35089 /// Returns `None` if the enum contains an unknown value deserialized from
35090 /// the integer representation of enums.
35091 pub fn name(&self) -> std::option::Option<&str> {
35092 match self {
35093 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
35094 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
35095 Self::Physical => std::option::Option::Some("PHYSICAL"),
35096 Self::UnknownValue(u) => u.0.name(),
35097 }
35098 }
35099}
35100
35101impl std::default::Default for SqlBackupKind {
35102 fn default() -> Self {
35103 use std::convert::From;
35104 Self::from(0)
35105 }
35106}
35107
35108impl std::fmt::Display for SqlBackupKind {
35109 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35110 wkt::internal::display_enum(f, self.name(), self.value())
35111 }
35112}
35113
35114impl std::convert::From<i32> for SqlBackupKind {
35115 fn from(value: i32) -> Self {
35116 match value {
35117 0 => Self::Unspecified,
35118 1 => Self::Snapshot,
35119 2 => Self::Physical,
35120 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
35121 wkt::internal::UnknownEnumValue::Integer(value),
35122 )),
35123 }
35124 }
35125}
35126
35127impl std::convert::From<&str> for SqlBackupKind {
35128 fn from(value: &str) -> Self {
35129 use std::string::ToString;
35130 match value {
35131 "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
35132 "SNAPSHOT" => Self::Snapshot,
35133 "PHYSICAL" => Self::Physical,
35134 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
35135 wkt::internal::UnknownEnumValue::String(value.to_string()),
35136 )),
35137 }
35138 }
35139}
35140
35141impl serde::ser::Serialize for SqlBackupKind {
35142 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35143 where
35144 S: serde::Serializer,
35145 {
35146 match self {
35147 Self::Unspecified => serializer.serialize_i32(0),
35148 Self::Snapshot => serializer.serialize_i32(1),
35149 Self::Physical => serializer.serialize_i32(2),
35150 Self::UnknownValue(u) => u.0.serialize(serializer),
35151 }
35152 }
35153}
35154
35155impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
35156 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35157 where
35158 D: serde::Deserializer<'de>,
35159 {
35160 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
35161 ".google.cloud.sql.v1.SqlBackupKind",
35162 ))
35163 }
35164}
35165
35166/// Type of backup (i.e. automated, on demand, etc).
35167///
35168/// # Working with unknown values
35169///
35170/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35171/// additional enum variants at any time. Adding new variants is not considered
35172/// a breaking change. Applications should write their code in anticipation of:
35173///
35174/// - New values appearing in future releases of the client library, **and**
35175/// - New values received dynamically, without application changes.
35176///
35177/// Please consult the [Working with enums] section in the user guide for some
35178/// guidelines.
35179///
35180/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35181#[derive(Clone, Debug, PartialEq)]
35182#[non_exhaustive]
35183pub enum SqlBackupRunType {
35184 /// This is an unknown BackupRun type.
35185 Unspecified,
35186 /// The backup schedule automatically triggers a backup.
35187 Automated,
35188 /// The user manually triggers a backup.
35189 OnDemand,
35190 /// If set, the enum was initialized with an unknown value.
35191 ///
35192 /// Applications can examine the value using [SqlBackupRunType::value] or
35193 /// [SqlBackupRunType::name].
35194 UnknownValue(sql_backup_run_type::UnknownValue),
35195}
35196
35197#[doc(hidden)]
35198pub mod sql_backup_run_type {
35199 #[allow(unused_imports)]
35200 use super::*;
35201 #[derive(Clone, Debug, PartialEq)]
35202 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35203}
35204
35205impl SqlBackupRunType {
35206 /// Gets the enum value.
35207 ///
35208 /// Returns `None` if the enum contains an unknown value deserialized from
35209 /// the string representation of enums.
35210 pub fn value(&self) -> std::option::Option<i32> {
35211 match self {
35212 Self::Unspecified => std::option::Option::Some(0),
35213 Self::Automated => std::option::Option::Some(1),
35214 Self::OnDemand => std::option::Option::Some(2),
35215 Self::UnknownValue(u) => u.0.value(),
35216 }
35217 }
35218
35219 /// Gets the enum value as a string.
35220 ///
35221 /// Returns `None` if the enum contains an unknown value deserialized from
35222 /// the integer representation of enums.
35223 pub fn name(&self) -> std::option::Option<&str> {
35224 match self {
35225 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
35226 Self::Automated => std::option::Option::Some("AUTOMATED"),
35227 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
35228 Self::UnknownValue(u) => u.0.name(),
35229 }
35230 }
35231}
35232
35233impl std::default::Default for SqlBackupRunType {
35234 fn default() -> Self {
35235 use std::convert::From;
35236 Self::from(0)
35237 }
35238}
35239
35240impl std::fmt::Display for SqlBackupRunType {
35241 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35242 wkt::internal::display_enum(f, self.name(), self.value())
35243 }
35244}
35245
35246impl std::convert::From<i32> for SqlBackupRunType {
35247 fn from(value: i32) -> Self {
35248 match value {
35249 0 => Self::Unspecified,
35250 1 => Self::Automated,
35251 2 => Self::OnDemand,
35252 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
35253 wkt::internal::UnknownEnumValue::Integer(value),
35254 )),
35255 }
35256 }
35257}
35258
35259impl std::convert::From<&str> for SqlBackupRunType {
35260 fn from(value: &str) -> Self {
35261 use std::string::ToString;
35262 match value {
35263 "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
35264 "AUTOMATED" => Self::Automated,
35265 "ON_DEMAND" => Self::OnDemand,
35266 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
35267 wkt::internal::UnknownEnumValue::String(value.to_string()),
35268 )),
35269 }
35270 }
35271}
35272
35273impl serde::ser::Serialize for SqlBackupRunType {
35274 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35275 where
35276 S: serde::Serializer,
35277 {
35278 match self {
35279 Self::Unspecified => serializer.serialize_i32(0),
35280 Self::Automated => serializer.serialize_i32(1),
35281 Self::OnDemand => serializer.serialize_i32(2),
35282 Self::UnknownValue(u) => u.0.serialize(serializer),
35283 }
35284 }
35285}
35286
35287impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
35288 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35289 where
35290 D: serde::Deserializer<'de>,
35291 {
35292 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
35293 ".google.cloud.sql.v1.SqlBackupRunType",
35294 ))
35295 }
35296}
35297
35298/// Enum for [SqlFlagType].
35299///
35300/// # Working with unknown values
35301///
35302/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35303/// additional enum variants at any time. Adding new variants is not considered
35304/// a breaking change. Applications should write their code in anticipation of:
35305///
35306/// - New values appearing in future releases of the client library, **and**
35307/// - New values received dynamically, without application changes.
35308///
35309/// Please consult the [Working with enums] section in the user guide for some
35310/// guidelines.
35311///
35312/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35313#[derive(Clone, Debug, PartialEq)]
35314#[non_exhaustive]
35315pub enum SqlFlagType {
35316 /// This is an unknown flag type.
35317 Unspecified,
35318 /// Boolean type flag.
35319 Boolean,
35320 /// String type flag.
35321 String,
35322 /// Integer type flag.
35323 Integer,
35324 /// Flag type used for a server startup option.
35325 None,
35326 /// Type introduced specially for MySQL TimeZone offset. Accept a string value
35327 /// with the format [-12:59, 13:00].
35328 MysqlTimezoneOffset,
35329 /// Float type flag.
35330 Float,
35331 /// Comma-separated list of the strings in a SqlFlagType enum.
35332 RepeatedString,
35333 /// If set, the enum was initialized with an unknown value.
35334 ///
35335 /// Applications can examine the value using [SqlFlagType::value] or
35336 /// [SqlFlagType::name].
35337 UnknownValue(sql_flag_type::UnknownValue),
35338}
35339
35340#[doc(hidden)]
35341pub mod sql_flag_type {
35342 #[allow(unused_imports)]
35343 use super::*;
35344 #[derive(Clone, Debug, PartialEq)]
35345 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35346}
35347
35348impl SqlFlagType {
35349 /// Gets the enum value.
35350 ///
35351 /// Returns `None` if the enum contains an unknown value deserialized from
35352 /// the string representation of enums.
35353 pub fn value(&self) -> std::option::Option<i32> {
35354 match self {
35355 Self::Unspecified => std::option::Option::Some(0),
35356 Self::Boolean => std::option::Option::Some(1),
35357 Self::String => std::option::Option::Some(2),
35358 Self::Integer => std::option::Option::Some(3),
35359 Self::None => std::option::Option::Some(4),
35360 Self::MysqlTimezoneOffset => std::option::Option::Some(5),
35361 Self::Float => std::option::Option::Some(6),
35362 Self::RepeatedString => std::option::Option::Some(7),
35363 Self::UnknownValue(u) => u.0.value(),
35364 }
35365 }
35366
35367 /// Gets the enum value as a string.
35368 ///
35369 /// Returns `None` if the enum contains an unknown value deserialized from
35370 /// the integer representation of enums.
35371 pub fn name(&self) -> std::option::Option<&str> {
35372 match self {
35373 Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
35374 Self::Boolean => std::option::Option::Some("BOOLEAN"),
35375 Self::String => std::option::Option::Some("STRING"),
35376 Self::Integer => std::option::Option::Some("INTEGER"),
35377 Self::None => std::option::Option::Some("NONE"),
35378 Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
35379 Self::Float => std::option::Option::Some("FLOAT"),
35380 Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
35381 Self::UnknownValue(u) => u.0.name(),
35382 }
35383 }
35384}
35385
35386impl std::default::Default for SqlFlagType {
35387 fn default() -> Self {
35388 use std::convert::From;
35389 Self::from(0)
35390 }
35391}
35392
35393impl std::fmt::Display for SqlFlagType {
35394 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35395 wkt::internal::display_enum(f, self.name(), self.value())
35396 }
35397}
35398
35399impl std::convert::From<i32> for SqlFlagType {
35400 fn from(value: i32) -> Self {
35401 match value {
35402 0 => Self::Unspecified,
35403 1 => Self::Boolean,
35404 2 => Self::String,
35405 3 => Self::Integer,
35406 4 => Self::None,
35407 5 => Self::MysqlTimezoneOffset,
35408 6 => Self::Float,
35409 7 => Self::RepeatedString,
35410 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
35411 wkt::internal::UnknownEnumValue::Integer(value),
35412 )),
35413 }
35414 }
35415}
35416
35417impl std::convert::From<&str> for SqlFlagType {
35418 fn from(value: &str) -> Self {
35419 use std::string::ToString;
35420 match value {
35421 "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
35422 "BOOLEAN" => Self::Boolean,
35423 "STRING" => Self::String,
35424 "INTEGER" => Self::Integer,
35425 "NONE" => Self::None,
35426 "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
35427 "FLOAT" => Self::Float,
35428 "REPEATED_STRING" => Self::RepeatedString,
35429 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
35430 wkt::internal::UnknownEnumValue::String(value.to_string()),
35431 )),
35432 }
35433 }
35434}
35435
35436impl serde::ser::Serialize for SqlFlagType {
35437 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35438 where
35439 S: serde::Serializer,
35440 {
35441 match self {
35442 Self::Unspecified => serializer.serialize_i32(0),
35443 Self::Boolean => serializer.serialize_i32(1),
35444 Self::String => serializer.serialize_i32(2),
35445 Self::Integer => serializer.serialize_i32(3),
35446 Self::None => serializer.serialize_i32(4),
35447 Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
35448 Self::Float => serializer.serialize_i32(6),
35449 Self::RepeatedString => serializer.serialize_i32(7),
35450 Self::UnknownValue(u) => u.0.serialize(serializer),
35451 }
35452 }
35453}
35454
35455impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
35456 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35457 where
35458 D: serde::Deserializer<'de>,
35459 {
35460 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
35461 ".google.cloud.sql.v1.SqlFlagType",
35462 ))
35463 }
35464}
35465
35466/// Scopes of a flag describe where the flag is used.
35467///
35468/// # Working with unknown values
35469///
35470/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35471/// additional enum variants at any time. Adding new variants is not considered
35472/// a breaking change. Applications should write their code in anticipation of:
35473///
35474/// - New values appearing in future releases of the client library, **and**
35475/// - New values received dynamically, without application changes.
35476///
35477/// Please consult the [Working with enums] section in the user guide for some
35478/// guidelines.
35479///
35480/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35481#[derive(Clone, Debug, PartialEq)]
35482#[non_exhaustive]
35483pub enum SqlFlagScope {
35484 /// Assume database flags if unspecified
35485 Unspecified,
35486 /// database flags
35487 Database,
35488 /// connection pool configuration flags
35489 ConnectionPool,
35490 /// If set, the enum was initialized with an unknown value.
35491 ///
35492 /// Applications can examine the value using [SqlFlagScope::value] or
35493 /// [SqlFlagScope::name].
35494 UnknownValue(sql_flag_scope::UnknownValue),
35495}
35496
35497#[doc(hidden)]
35498pub mod sql_flag_scope {
35499 #[allow(unused_imports)]
35500 use super::*;
35501 #[derive(Clone, Debug, PartialEq)]
35502 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35503}
35504
35505impl SqlFlagScope {
35506 /// Gets the enum value.
35507 ///
35508 /// Returns `None` if the enum contains an unknown value deserialized from
35509 /// the string representation of enums.
35510 pub fn value(&self) -> std::option::Option<i32> {
35511 match self {
35512 Self::Unspecified => std::option::Option::Some(0),
35513 Self::Database => std::option::Option::Some(1),
35514 Self::ConnectionPool => std::option::Option::Some(2),
35515 Self::UnknownValue(u) => u.0.value(),
35516 }
35517 }
35518
35519 /// Gets the enum value as a string.
35520 ///
35521 /// Returns `None` if the enum contains an unknown value deserialized from
35522 /// the integer representation of enums.
35523 pub fn name(&self) -> std::option::Option<&str> {
35524 match self {
35525 Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
35526 Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
35527 Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
35528 Self::UnknownValue(u) => u.0.name(),
35529 }
35530 }
35531}
35532
35533impl std::default::Default for SqlFlagScope {
35534 fn default() -> Self {
35535 use std::convert::From;
35536 Self::from(0)
35537 }
35538}
35539
35540impl std::fmt::Display for SqlFlagScope {
35541 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35542 wkt::internal::display_enum(f, self.name(), self.value())
35543 }
35544}
35545
35546impl std::convert::From<i32> for SqlFlagScope {
35547 fn from(value: i32) -> Self {
35548 match value {
35549 0 => Self::Unspecified,
35550 1 => Self::Database,
35551 2 => Self::ConnectionPool,
35552 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
35553 wkt::internal::UnknownEnumValue::Integer(value),
35554 )),
35555 }
35556 }
35557}
35558
35559impl std::convert::From<&str> for SqlFlagScope {
35560 fn from(value: &str) -> Self {
35561 use std::string::ToString;
35562 match value {
35563 "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
35564 "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
35565 "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
35566 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
35567 wkt::internal::UnknownEnumValue::String(value.to_string()),
35568 )),
35569 }
35570 }
35571}
35572
35573impl serde::ser::Serialize for SqlFlagScope {
35574 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35575 where
35576 S: serde::Serializer,
35577 {
35578 match self {
35579 Self::Unspecified => serializer.serialize_i32(0),
35580 Self::Database => serializer.serialize_i32(1),
35581 Self::ConnectionPool => serializer.serialize_i32(2),
35582 Self::UnknownValue(u) => u.0.serialize(serializer),
35583 }
35584 }
35585}
35586
35587impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
35588 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35589 where
35590 D: serde::Deserializer<'de>,
35591 {
35592 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
35593 ".google.cloud.sql.v1.SqlFlagScope",
35594 ))
35595 }
35596}
35597
35598/// External Sync parallel level.
35599///
35600/// # Working with unknown values
35601///
35602/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35603/// additional enum variants at any time. Adding new variants is not considered
35604/// a breaking change. Applications should write their code in anticipation of:
35605///
35606/// - New values appearing in future releases of the client library, **and**
35607/// - New values received dynamically, without application changes.
35608///
35609/// Please consult the [Working with enums] section in the user guide for some
35610/// guidelines.
35611///
35612/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35613#[derive(Clone, Debug, PartialEq)]
35614#[non_exhaustive]
35615pub enum ExternalSyncParallelLevel {
35616 /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
35617 Unspecified,
35618 /// Minimal parallel level.
35619 Min,
35620 /// Optimal parallel level.
35621 Optimal,
35622 /// Maximum parallel level.
35623 Max,
35624 /// If set, the enum was initialized with an unknown value.
35625 ///
35626 /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
35627 /// [ExternalSyncParallelLevel::name].
35628 UnknownValue(external_sync_parallel_level::UnknownValue),
35629}
35630
35631#[doc(hidden)]
35632pub mod external_sync_parallel_level {
35633 #[allow(unused_imports)]
35634 use super::*;
35635 #[derive(Clone, Debug, PartialEq)]
35636 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35637}
35638
35639impl ExternalSyncParallelLevel {
35640 /// Gets the enum value.
35641 ///
35642 /// Returns `None` if the enum contains an unknown value deserialized from
35643 /// the string representation of enums.
35644 pub fn value(&self) -> std::option::Option<i32> {
35645 match self {
35646 Self::Unspecified => std::option::Option::Some(0),
35647 Self::Min => std::option::Option::Some(1),
35648 Self::Optimal => std::option::Option::Some(2),
35649 Self::Max => std::option::Option::Some(3),
35650 Self::UnknownValue(u) => u.0.value(),
35651 }
35652 }
35653
35654 /// Gets the enum value as a string.
35655 ///
35656 /// Returns `None` if the enum contains an unknown value deserialized from
35657 /// the integer representation of enums.
35658 pub fn name(&self) -> std::option::Option<&str> {
35659 match self {
35660 Self::Unspecified => {
35661 std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
35662 }
35663 Self::Min => std::option::Option::Some("MIN"),
35664 Self::Optimal => std::option::Option::Some("OPTIMAL"),
35665 Self::Max => std::option::Option::Some("MAX"),
35666 Self::UnknownValue(u) => u.0.name(),
35667 }
35668 }
35669}
35670
35671impl std::default::Default for ExternalSyncParallelLevel {
35672 fn default() -> Self {
35673 use std::convert::From;
35674 Self::from(0)
35675 }
35676}
35677
35678impl std::fmt::Display for ExternalSyncParallelLevel {
35679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35680 wkt::internal::display_enum(f, self.name(), self.value())
35681 }
35682}
35683
35684impl std::convert::From<i32> for ExternalSyncParallelLevel {
35685 fn from(value: i32) -> Self {
35686 match value {
35687 0 => Self::Unspecified,
35688 1 => Self::Min,
35689 2 => Self::Optimal,
35690 3 => Self::Max,
35691 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
35692 wkt::internal::UnknownEnumValue::Integer(value),
35693 )),
35694 }
35695 }
35696}
35697
35698impl std::convert::From<&str> for ExternalSyncParallelLevel {
35699 fn from(value: &str) -> Self {
35700 use std::string::ToString;
35701 match value {
35702 "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
35703 "MIN" => Self::Min,
35704 "OPTIMAL" => Self::Optimal,
35705 "MAX" => Self::Max,
35706 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
35707 wkt::internal::UnknownEnumValue::String(value.to_string()),
35708 )),
35709 }
35710 }
35711}
35712
35713impl serde::ser::Serialize for ExternalSyncParallelLevel {
35714 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35715 where
35716 S: serde::Serializer,
35717 {
35718 match self {
35719 Self::Unspecified => serializer.serialize_i32(0),
35720 Self::Min => serializer.serialize_i32(1),
35721 Self::Optimal => serializer.serialize_i32(2),
35722 Self::Max => serializer.serialize_i32(3),
35723 Self::UnknownValue(u) => u.0.serialize(serializer),
35724 }
35725 }
35726}
35727
35728impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
35729 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35730 where
35731 D: serde::Deserializer<'de>,
35732 {
35733 deserializer.deserialize_any(
35734 wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
35735 ".google.cloud.sql.v1.ExternalSyncParallelLevel",
35736 ),
35737 )
35738 }
35739}
35740
35741/// Enum for [SqlInstanceType].
35742///
35743/// # Working with unknown values
35744///
35745/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35746/// additional enum variants at any time. Adding new variants is not considered
35747/// a breaking change. Applications should write their code in anticipation of:
35748///
35749/// - New values appearing in future releases of the client library, **and**
35750/// - New values received dynamically, without application changes.
35751///
35752/// Please consult the [Working with enums] section in the user guide for some
35753/// guidelines.
35754///
35755/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35756#[derive(Clone, Debug, PartialEq)]
35757#[non_exhaustive]
35758pub enum SqlInstanceType {
35759 /// This is an unknown Cloud SQL instance type.
35760 Unspecified,
35761 /// A regular Cloud SQL instance that is not replicating from a primary
35762 /// instance.
35763 CloudSqlInstance,
35764 /// An instance running on the customer's premises that is not managed by
35765 /// Cloud SQL.
35766 OnPremisesInstance,
35767 /// A Cloud SQL instance acting as a read-replica.
35768 ReadReplicaInstance,
35769 /// A Cloud SQL read pool.
35770 ReadPoolInstance,
35771 /// If set, the enum was initialized with an unknown value.
35772 ///
35773 /// Applications can examine the value using [SqlInstanceType::value] or
35774 /// [SqlInstanceType::name].
35775 UnknownValue(sql_instance_type::UnknownValue),
35776}
35777
35778#[doc(hidden)]
35779pub mod sql_instance_type {
35780 #[allow(unused_imports)]
35781 use super::*;
35782 #[derive(Clone, Debug, PartialEq)]
35783 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35784}
35785
35786impl SqlInstanceType {
35787 /// Gets the enum value.
35788 ///
35789 /// Returns `None` if the enum contains an unknown value deserialized from
35790 /// the string representation of enums.
35791 pub fn value(&self) -> std::option::Option<i32> {
35792 match self {
35793 Self::Unspecified => std::option::Option::Some(0),
35794 Self::CloudSqlInstance => std::option::Option::Some(1),
35795 Self::OnPremisesInstance => std::option::Option::Some(2),
35796 Self::ReadReplicaInstance => std::option::Option::Some(3),
35797 Self::ReadPoolInstance => std::option::Option::Some(5),
35798 Self::UnknownValue(u) => u.0.value(),
35799 }
35800 }
35801
35802 /// Gets the enum value as a string.
35803 ///
35804 /// Returns `None` if the enum contains an unknown value deserialized from
35805 /// the integer representation of enums.
35806 pub fn name(&self) -> std::option::Option<&str> {
35807 match self {
35808 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
35809 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
35810 Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
35811 Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
35812 Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
35813 Self::UnknownValue(u) => u.0.name(),
35814 }
35815 }
35816}
35817
35818impl std::default::Default for SqlInstanceType {
35819 fn default() -> Self {
35820 use std::convert::From;
35821 Self::from(0)
35822 }
35823}
35824
35825impl std::fmt::Display for SqlInstanceType {
35826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35827 wkt::internal::display_enum(f, self.name(), self.value())
35828 }
35829}
35830
35831impl std::convert::From<i32> for SqlInstanceType {
35832 fn from(value: i32) -> Self {
35833 match value {
35834 0 => Self::Unspecified,
35835 1 => Self::CloudSqlInstance,
35836 2 => Self::OnPremisesInstance,
35837 3 => Self::ReadReplicaInstance,
35838 5 => Self::ReadPoolInstance,
35839 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
35840 wkt::internal::UnknownEnumValue::Integer(value),
35841 )),
35842 }
35843 }
35844}
35845
35846impl std::convert::From<&str> for SqlInstanceType {
35847 fn from(value: &str) -> Self {
35848 use std::string::ToString;
35849 match value {
35850 "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
35851 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
35852 "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
35853 "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
35854 "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
35855 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
35856 wkt::internal::UnknownEnumValue::String(value.to_string()),
35857 )),
35858 }
35859 }
35860}
35861
35862impl serde::ser::Serialize for SqlInstanceType {
35863 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35864 where
35865 S: serde::Serializer,
35866 {
35867 match self {
35868 Self::Unspecified => serializer.serialize_i32(0),
35869 Self::CloudSqlInstance => serializer.serialize_i32(1),
35870 Self::OnPremisesInstance => serializer.serialize_i32(2),
35871 Self::ReadReplicaInstance => serializer.serialize_i32(3),
35872 Self::ReadPoolInstance => serializer.serialize_i32(5),
35873 Self::UnknownValue(u) => u.0.serialize(serializer),
35874 }
35875 }
35876}
35877
35878impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
35879 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35880 where
35881 D: serde::Deserializer<'de>,
35882 {
35883 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
35884 ".google.cloud.sql.v1.SqlInstanceType",
35885 ))
35886 }
35887}
35888
35889/// The suspension reason of the database instance if the state is SUSPENDED.
35890///
35891/// # Working with unknown values
35892///
35893/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35894/// additional enum variants at any time. Adding new variants is not considered
35895/// a breaking change. Applications should write their code in anticipation of:
35896///
35897/// - New values appearing in future releases of the client library, **and**
35898/// - New values received dynamically, without application changes.
35899///
35900/// Please consult the [Working with enums] section in the user guide for some
35901/// guidelines.
35902///
35903/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35904#[derive(Clone, Debug, PartialEq)]
35905#[non_exhaustive]
35906pub enum SqlSuspensionReason {
35907 /// This is an unknown suspension reason.
35908 Unspecified,
35909 /// The instance is suspended due to billing issues (for example:, account
35910 /// issue)
35911 BillingIssue,
35912 /// The instance is suspended due to illegal content (for example:, child
35913 /// pornography, copyrighted material, etc.).
35914 LegalIssue,
35915 /// The instance is causing operational issues (for example:, causing the
35916 /// database to crash).
35917 OperationalIssue,
35918 /// The KMS key used by the instance is either revoked or denied access to
35919 KmsKeyIssue,
35920 /// The project is suspended due to abuse detected by Ares.
35921 ProjectAbuse,
35922 /// If set, the enum was initialized with an unknown value.
35923 ///
35924 /// Applications can examine the value using [SqlSuspensionReason::value] or
35925 /// [SqlSuspensionReason::name].
35926 UnknownValue(sql_suspension_reason::UnknownValue),
35927}
35928
35929#[doc(hidden)]
35930pub mod sql_suspension_reason {
35931 #[allow(unused_imports)]
35932 use super::*;
35933 #[derive(Clone, Debug, PartialEq)]
35934 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35935}
35936
35937impl SqlSuspensionReason {
35938 /// Gets the enum value.
35939 ///
35940 /// Returns `None` if the enum contains an unknown value deserialized from
35941 /// the string representation of enums.
35942 pub fn value(&self) -> std::option::Option<i32> {
35943 match self {
35944 Self::Unspecified => std::option::Option::Some(0),
35945 Self::BillingIssue => std::option::Option::Some(2),
35946 Self::LegalIssue => std::option::Option::Some(3),
35947 Self::OperationalIssue => std::option::Option::Some(4),
35948 Self::KmsKeyIssue => std::option::Option::Some(5),
35949 Self::ProjectAbuse => std::option::Option::Some(8),
35950 Self::UnknownValue(u) => u.0.value(),
35951 }
35952 }
35953
35954 /// Gets the enum value as a string.
35955 ///
35956 /// Returns `None` if the enum contains an unknown value deserialized from
35957 /// the integer representation of enums.
35958 pub fn name(&self) -> std::option::Option<&str> {
35959 match self {
35960 Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
35961 Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
35962 Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
35963 Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
35964 Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
35965 Self::ProjectAbuse => std::option::Option::Some("PROJECT_ABUSE"),
35966 Self::UnknownValue(u) => u.0.name(),
35967 }
35968 }
35969}
35970
35971impl std::default::Default for SqlSuspensionReason {
35972 fn default() -> Self {
35973 use std::convert::From;
35974 Self::from(0)
35975 }
35976}
35977
35978impl std::fmt::Display for SqlSuspensionReason {
35979 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35980 wkt::internal::display_enum(f, self.name(), self.value())
35981 }
35982}
35983
35984impl std::convert::From<i32> for SqlSuspensionReason {
35985 fn from(value: i32) -> Self {
35986 match value {
35987 0 => Self::Unspecified,
35988 2 => Self::BillingIssue,
35989 3 => Self::LegalIssue,
35990 4 => Self::OperationalIssue,
35991 5 => Self::KmsKeyIssue,
35992 8 => Self::ProjectAbuse,
35993 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
35994 wkt::internal::UnknownEnumValue::Integer(value),
35995 )),
35996 }
35997 }
35998}
35999
36000impl std::convert::From<&str> for SqlSuspensionReason {
36001 fn from(value: &str) -> Self {
36002 use std::string::ToString;
36003 match value {
36004 "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
36005 "BILLING_ISSUE" => Self::BillingIssue,
36006 "LEGAL_ISSUE" => Self::LegalIssue,
36007 "OPERATIONAL_ISSUE" => Self::OperationalIssue,
36008 "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
36009 "PROJECT_ABUSE" => Self::ProjectAbuse,
36010 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
36011 wkt::internal::UnknownEnumValue::String(value.to_string()),
36012 )),
36013 }
36014 }
36015}
36016
36017impl serde::ser::Serialize for SqlSuspensionReason {
36018 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36019 where
36020 S: serde::Serializer,
36021 {
36022 match self {
36023 Self::Unspecified => serializer.serialize_i32(0),
36024 Self::BillingIssue => serializer.serialize_i32(2),
36025 Self::LegalIssue => serializer.serialize_i32(3),
36026 Self::OperationalIssue => serializer.serialize_i32(4),
36027 Self::KmsKeyIssue => serializer.serialize_i32(5),
36028 Self::ProjectAbuse => serializer.serialize_i32(8),
36029 Self::UnknownValue(u) => u.0.serialize(serializer),
36030 }
36031 }
36032}
36033
36034impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
36035 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36036 where
36037 D: serde::Deserializer<'de>,
36038 {
36039 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
36040 ".google.cloud.sql.v1.SqlSuspensionReason",
36041 ))
36042 }
36043}
36044
36045/// Enum for [SqlFileType].
36046///
36047/// # Working with unknown values
36048///
36049/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36050/// additional enum variants at any time. Adding new variants is not considered
36051/// a breaking change. Applications should write their code in anticipation of:
36052///
36053/// - New values appearing in future releases of the client library, **and**
36054/// - New values received dynamically, without application changes.
36055///
36056/// Please consult the [Working with enums] section in the user guide for some
36057/// guidelines.
36058///
36059/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36060#[derive(Clone, Debug, PartialEq)]
36061#[non_exhaustive]
36062pub enum SqlFileType {
36063 /// Unknown file type.
36064 Unspecified,
36065 /// File containing SQL statements.
36066 Sql,
36067 /// File in CSV format.
36068 Csv,
36069 #[allow(missing_docs)]
36070 Bak,
36071 /// TDE certificate.
36072 Tde,
36073 /// If set, the enum was initialized with an unknown value.
36074 ///
36075 /// Applications can examine the value using [SqlFileType::value] or
36076 /// [SqlFileType::name].
36077 UnknownValue(sql_file_type::UnknownValue),
36078}
36079
36080#[doc(hidden)]
36081pub mod sql_file_type {
36082 #[allow(unused_imports)]
36083 use super::*;
36084 #[derive(Clone, Debug, PartialEq)]
36085 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36086}
36087
36088impl SqlFileType {
36089 /// Gets the enum value.
36090 ///
36091 /// Returns `None` if the enum contains an unknown value deserialized from
36092 /// the string representation of enums.
36093 pub fn value(&self) -> std::option::Option<i32> {
36094 match self {
36095 Self::Unspecified => std::option::Option::Some(0),
36096 Self::Sql => std::option::Option::Some(1),
36097 Self::Csv => std::option::Option::Some(2),
36098 Self::Bak => std::option::Option::Some(4),
36099 Self::Tde => std::option::Option::Some(8),
36100 Self::UnknownValue(u) => u.0.value(),
36101 }
36102 }
36103
36104 /// Gets the enum value as a string.
36105 ///
36106 /// Returns `None` if the enum contains an unknown value deserialized from
36107 /// the integer representation of enums.
36108 pub fn name(&self) -> std::option::Option<&str> {
36109 match self {
36110 Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
36111 Self::Sql => std::option::Option::Some("SQL"),
36112 Self::Csv => std::option::Option::Some("CSV"),
36113 Self::Bak => std::option::Option::Some("BAK"),
36114 Self::Tde => std::option::Option::Some("TDE"),
36115 Self::UnknownValue(u) => u.0.name(),
36116 }
36117 }
36118}
36119
36120impl std::default::Default for SqlFileType {
36121 fn default() -> Self {
36122 use std::convert::From;
36123 Self::from(0)
36124 }
36125}
36126
36127impl std::fmt::Display for SqlFileType {
36128 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36129 wkt::internal::display_enum(f, self.name(), self.value())
36130 }
36131}
36132
36133impl std::convert::From<i32> for SqlFileType {
36134 fn from(value: i32) -> Self {
36135 match value {
36136 0 => Self::Unspecified,
36137 1 => Self::Sql,
36138 2 => Self::Csv,
36139 4 => Self::Bak,
36140 8 => Self::Tde,
36141 _ => Self::UnknownValue(sql_file_type::UnknownValue(
36142 wkt::internal::UnknownEnumValue::Integer(value),
36143 )),
36144 }
36145 }
36146}
36147
36148impl std::convert::From<&str> for SqlFileType {
36149 fn from(value: &str) -> Self {
36150 use std::string::ToString;
36151 match value {
36152 "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
36153 "SQL" => Self::Sql,
36154 "CSV" => Self::Csv,
36155 "BAK" => Self::Bak,
36156 "TDE" => Self::Tde,
36157 _ => Self::UnknownValue(sql_file_type::UnknownValue(
36158 wkt::internal::UnknownEnumValue::String(value.to_string()),
36159 )),
36160 }
36161 }
36162}
36163
36164impl serde::ser::Serialize for SqlFileType {
36165 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36166 where
36167 S: serde::Serializer,
36168 {
36169 match self {
36170 Self::Unspecified => serializer.serialize_i32(0),
36171 Self::Sql => serializer.serialize_i32(1),
36172 Self::Csv => serializer.serialize_i32(2),
36173 Self::Bak => serializer.serialize_i32(4),
36174 Self::Tde => serializer.serialize_i32(8),
36175 Self::UnknownValue(u) => u.0.serialize(serializer),
36176 }
36177 }
36178}
36179
36180impl<'de> serde::de::Deserialize<'de> for SqlFileType {
36181 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36182 where
36183 D: serde::Deserializer<'de>,
36184 {
36185 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
36186 ".google.cloud.sql.v1.SqlFileType",
36187 ))
36188 }
36189}
36190
36191/// Enum for [BakType].
36192///
36193/// # Working with unknown values
36194///
36195/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36196/// additional enum variants at any time. Adding new variants is not considered
36197/// a breaking change. Applications should write their code in anticipation of:
36198///
36199/// - New values appearing in future releases of the client library, **and**
36200/// - New values received dynamically, without application changes.
36201///
36202/// Please consult the [Working with enums] section in the user guide for some
36203/// guidelines.
36204///
36205/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36206#[derive(Clone, Debug, PartialEq)]
36207#[non_exhaustive]
36208pub enum BakType {
36209 /// Default type.
36210 Unspecified,
36211 /// Full backup.
36212 Full,
36213 /// Differential backup.
36214 Diff,
36215 /// Transaction Log backup
36216 Tlog,
36217 /// If set, the enum was initialized with an unknown value.
36218 ///
36219 /// Applications can examine the value using [BakType::value] or
36220 /// [BakType::name].
36221 UnknownValue(bak_type::UnknownValue),
36222}
36223
36224#[doc(hidden)]
36225pub mod bak_type {
36226 #[allow(unused_imports)]
36227 use super::*;
36228 #[derive(Clone, Debug, PartialEq)]
36229 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36230}
36231
36232impl BakType {
36233 /// Gets the enum value.
36234 ///
36235 /// Returns `None` if the enum contains an unknown value deserialized from
36236 /// the string representation of enums.
36237 pub fn value(&self) -> std::option::Option<i32> {
36238 match self {
36239 Self::Unspecified => std::option::Option::Some(0),
36240 Self::Full => std::option::Option::Some(1),
36241 Self::Diff => std::option::Option::Some(2),
36242 Self::Tlog => std::option::Option::Some(3),
36243 Self::UnknownValue(u) => u.0.value(),
36244 }
36245 }
36246
36247 /// Gets the enum value as a string.
36248 ///
36249 /// Returns `None` if the enum contains an unknown value deserialized from
36250 /// the integer representation of enums.
36251 pub fn name(&self) -> std::option::Option<&str> {
36252 match self {
36253 Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
36254 Self::Full => std::option::Option::Some("FULL"),
36255 Self::Diff => std::option::Option::Some("DIFF"),
36256 Self::Tlog => std::option::Option::Some("TLOG"),
36257 Self::UnknownValue(u) => u.0.name(),
36258 }
36259 }
36260}
36261
36262impl std::default::Default for BakType {
36263 fn default() -> Self {
36264 use std::convert::From;
36265 Self::from(0)
36266 }
36267}
36268
36269impl std::fmt::Display for BakType {
36270 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36271 wkt::internal::display_enum(f, self.name(), self.value())
36272 }
36273}
36274
36275impl std::convert::From<i32> for BakType {
36276 fn from(value: i32) -> Self {
36277 match value {
36278 0 => Self::Unspecified,
36279 1 => Self::Full,
36280 2 => Self::Diff,
36281 3 => Self::Tlog,
36282 _ => Self::UnknownValue(bak_type::UnknownValue(
36283 wkt::internal::UnknownEnumValue::Integer(value),
36284 )),
36285 }
36286 }
36287}
36288
36289impl std::convert::From<&str> for BakType {
36290 fn from(value: &str) -> Self {
36291 use std::string::ToString;
36292 match value {
36293 "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
36294 "FULL" => Self::Full,
36295 "DIFF" => Self::Diff,
36296 "TLOG" => Self::Tlog,
36297 _ => Self::UnknownValue(bak_type::UnknownValue(
36298 wkt::internal::UnknownEnumValue::String(value.to_string()),
36299 )),
36300 }
36301 }
36302}
36303
36304impl serde::ser::Serialize for BakType {
36305 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36306 where
36307 S: serde::Serializer,
36308 {
36309 match self {
36310 Self::Unspecified => serializer.serialize_i32(0),
36311 Self::Full => serializer.serialize_i32(1),
36312 Self::Diff => serializer.serialize_i32(2),
36313 Self::Tlog => serializer.serialize_i32(3),
36314 Self::UnknownValue(u) => u.0.serialize(serializer),
36315 }
36316 }
36317}
36318
36319impl<'de> serde::de::Deserialize<'de> for BakType {
36320 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36321 where
36322 D: serde::Deserializer<'de>,
36323 {
36324 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
36325 ".google.cloud.sql.v1.BakType",
36326 ))
36327 }
36328}
36329
36330/// The type of maintenance to be performed on the instance.
36331///
36332/// # Working with unknown values
36333///
36334/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36335/// additional enum variants at any time. Adding new variants is not considered
36336/// a breaking change. Applications should write their code in anticipation of:
36337///
36338/// - New values appearing in future releases of the client library, **and**
36339/// - New values received dynamically, without application changes.
36340///
36341/// Please consult the [Working with enums] section in the user guide for some
36342/// guidelines.
36343///
36344/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36345#[derive(Clone, Debug, PartialEq)]
36346#[non_exhaustive]
36347pub enum SqlMaintenanceType {
36348 /// Maintenance type is unspecified.
36349 Unspecified,
36350 /// Indicates that a standalone instance is undergoing maintenance. The
36351 /// instance can be either a primary instance or a replica.
36352 InstanceMaintenance,
36353 /// Indicates that the primary instance and all of its replicas, including
36354 /// cascading replicas, are undergoing maintenance. Maintenance is performed on
36355 /// groups of replicas first, followed by the primary instance.
36356 ReplicaIncludedMaintenance,
36357 /// Indicates that the standalone instance is undergoing maintenance, initiated
36358 /// by self-service. The instance can be either a primary instance or a
36359 /// replica.
36360 InstanceSelfServiceMaintenance,
36361 /// Indicates that the primary instance and all of its replicas are undergoing
36362 /// maintenance, initiated by self-service. Maintenance is performed on groups
36363 /// of replicas first, followed by the primary instance.
36364 ReplicaIncludedSelfServiceMaintenance,
36365 /// If set, the enum was initialized with an unknown value.
36366 ///
36367 /// Applications can examine the value using [SqlMaintenanceType::value] or
36368 /// [SqlMaintenanceType::name].
36369 UnknownValue(sql_maintenance_type::UnknownValue),
36370}
36371
36372#[doc(hidden)]
36373pub mod sql_maintenance_type {
36374 #[allow(unused_imports)]
36375 use super::*;
36376 #[derive(Clone, Debug, PartialEq)]
36377 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36378}
36379
36380impl SqlMaintenanceType {
36381 /// Gets the enum value.
36382 ///
36383 /// Returns `None` if the enum contains an unknown value deserialized from
36384 /// the string representation of enums.
36385 pub fn value(&self) -> std::option::Option<i32> {
36386 match self {
36387 Self::Unspecified => std::option::Option::Some(0),
36388 Self::InstanceMaintenance => std::option::Option::Some(1),
36389 Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
36390 Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
36391 Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
36392 Self::UnknownValue(u) => u.0.value(),
36393 }
36394 }
36395
36396 /// Gets the enum value as a string.
36397 ///
36398 /// Returns `None` if the enum contains an unknown value deserialized from
36399 /// the integer representation of enums.
36400 pub fn name(&self) -> std::option::Option<&str> {
36401 match self {
36402 Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
36403 Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
36404 Self::ReplicaIncludedMaintenance => {
36405 std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
36406 }
36407 Self::InstanceSelfServiceMaintenance => {
36408 std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
36409 }
36410 Self::ReplicaIncludedSelfServiceMaintenance => {
36411 std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
36412 }
36413 Self::UnknownValue(u) => u.0.name(),
36414 }
36415 }
36416}
36417
36418impl std::default::Default for SqlMaintenanceType {
36419 fn default() -> Self {
36420 use std::convert::From;
36421 Self::from(0)
36422 }
36423}
36424
36425impl std::fmt::Display for SqlMaintenanceType {
36426 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36427 wkt::internal::display_enum(f, self.name(), self.value())
36428 }
36429}
36430
36431impl std::convert::From<i32> for SqlMaintenanceType {
36432 fn from(value: i32) -> Self {
36433 match value {
36434 0 => Self::Unspecified,
36435 1 => Self::InstanceMaintenance,
36436 2 => Self::ReplicaIncludedMaintenance,
36437 3 => Self::InstanceSelfServiceMaintenance,
36438 4 => Self::ReplicaIncludedSelfServiceMaintenance,
36439 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
36440 wkt::internal::UnknownEnumValue::Integer(value),
36441 )),
36442 }
36443 }
36444}
36445
36446impl std::convert::From<&str> for SqlMaintenanceType {
36447 fn from(value: &str) -> Self {
36448 use std::string::ToString;
36449 match value {
36450 "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
36451 "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
36452 "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
36453 "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
36454 "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
36455 Self::ReplicaIncludedSelfServiceMaintenance
36456 }
36457 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
36458 wkt::internal::UnknownEnumValue::String(value.to_string()),
36459 )),
36460 }
36461 }
36462}
36463
36464impl serde::ser::Serialize for SqlMaintenanceType {
36465 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36466 where
36467 S: serde::Serializer,
36468 {
36469 match self {
36470 Self::Unspecified => serializer.serialize_i32(0),
36471 Self::InstanceMaintenance => serializer.serialize_i32(1),
36472 Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
36473 Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
36474 Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
36475 Self::UnknownValue(u) => u.0.serialize(serializer),
36476 }
36477 }
36478}
36479
36480impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
36481 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36482 where
36483 D: serde::Deserializer<'de>,
36484 {
36485 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
36486 ".google.cloud.sql.v1.SqlMaintenanceType",
36487 ))
36488 }
36489}
36490
36491/// Enum for [SqlBackendType].
36492///
36493/// # Working with unknown values
36494///
36495/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36496/// additional enum variants at any time. Adding new variants is not considered
36497/// a breaking change. Applications should write their code in anticipation of:
36498///
36499/// - New values appearing in future releases of the client library, **and**
36500/// - New values received dynamically, without application changes.
36501///
36502/// Please consult the [Working with enums] section in the user guide for some
36503/// guidelines.
36504///
36505/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36506#[derive(Clone, Debug, PartialEq)]
36507#[non_exhaustive]
36508pub enum SqlBackendType {
36509 /// This is an unknown backend type for instance.
36510 Unspecified,
36511 /// V1 speckle instance.
36512 #[deprecated]
36513 FirstGen,
36514 /// V2 speckle instance.
36515 SecondGen,
36516 /// On premises instance.
36517 External,
36518 /// If set, the enum was initialized with an unknown value.
36519 ///
36520 /// Applications can examine the value using [SqlBackendType::value] or
36521 /// [SqlBackendType::name].
36522 UnknownValue(sql_backend_type::UnknownValue),
36523}
36524
36525#[doc(hidden)]
36526pub mod sql_backend_type {
36527 #[allow(unused_imports)]
36528 use super::*;
36529 #[derive(Clone, Debug, PartialEq)]
36530 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36531}
36532
36533impl SqlBackendType {
36534 /// Gets the enum value.
36535 ///
36536 /// Returns `None` if the enum contains an unknown value deserialized from
36537 /// the string representation of enums.
36538 pub fn value(&self) -> std::option::Option<i32> {
36539 match self {
36540 Self::Unspecified => std::option::Option::Some(0),
36541 Self::FirstGen => std::option::Option::Some(1),
36542 Self::SecondGen => std::option::Option::Some(2),
36543 Self::External => std::option::Option::Some(3),
36544 Self::UnknownValue(u) => u.0.value(),
36545 }
36546 }
36547
36548 /// Gets the enum value as a string.
36549 ///
36550 /// Returns `None` if the enum contains an unknown value deserialized from
36551 /// the integer representation of enums.
36552 pub fn name(&self) -> std::option::Option<&str> {
36553 match self {
36554 Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
36555 Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
36556 Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
36557 Self::External => std::option::Option::Some("EXTERNAL"),
36558 Self::UnknownValue(u) => u.0.name(),
36559 }
36560 }
36561}
36562
36563impl std::default::Default for SqlBackendType {
36564 fn default() -> Self {
36565 use std::convert::From;
36566 Self::from(0)
36567 }
36568}
36569
36570impl std::fmt::Display for SqlBackendType {
36571 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36572 wkt::internal::display_enum(f, self.name(), self.value())
36573 }
36574}
36575
36576impl std::convert::From<i32> for SqlBackendType {
36577 fn from(value: i32) -> Self {
36578 match value {
36579 0 => Self::Unspecified,
36580 1 => Self::FirstGen,
36581 2 => Self::SecondGen,
36582 3 => Self::External,
36583 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
36584 wkt::internal::UnknownEnumValue::Integer(value),
36585 )),
36586 }
36587 }
36588}
36589
36590impl std::convert::From<&str> for SqlBackendType {
36591 fn from(value: &str) -> Self {
36592 use std::string::ToString;
36593 match value {
36594 "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
36595 "FIRST_GEN" => Self::FirstGen,
36596 "SECOND_GEN" => Self::SecondGen,
36597 "EXTERNAL" => Self::External,
36598 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
36599 wkt::internal::UnknownEnumValue::String(value.to_string()),
36600 )),
36601 }
36602 }
36603}
36604
36605impl serde::ser::Serialize for SqlBackendType {
36606 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36607 where
36608 S: serde::Serializer,
36609 {
36610 match self {
36611 Self::Unspecified => serializer.serialize_i32(0),
36612 Self::FirstGen => serializer.serialize_i32(1),
36613 Self::SecondGen => serializer.serialize_i32(2),
36614 Self::External => serializer.serialize_i32(3),
36615 Self::UnknownValue(u) => u.0.serialize(serializer),
36616 }
36617 }
36618}
36619
36620impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
36621 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36622 where
36623 D: serde::Deserializer<'de>,
36624 {
36625 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
36626 ".google.cloud.sql.v1.SqlBackendType",
36627 ))
36628 }
36629}
36630
36631/// Enum for [SqlIpAddressType].
36632///
36633/// # Working with unknown values
36634///
36635/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36636/// additional enum variants at any time. Adding new variants is not considered
36637/// a breaking change. Applications should write their code in anticipation of:
36638///
36639/// - New values appearing in future releases of the client library, **and**
36640/// - New values received dynamically, without application changes.
36641///
36642/// Please consult the [Working with enums] section in the user guide for some
36643/// guidelines.
36644///
36645/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36646#[derive(Clone, Debug, PartialEq)]
36647#[non_exhaustive]
36648pub enum SqlIpAddressType {
36649 /// This is an unknown IP address type.
36650 Unspecified,
36651 /// IP address the customer is supposed to connect to. Usually this is the
36652 /// load balancer's IP address
36653 Primary,
36654 /// Source IP address of the connection a read replica establishes to its
36655 /// external primary instance. This IP address can be allowlisted by the
36656 /// customer in case it has a firewall that filters incoming connection to its
36657 /// on premises primary instance.
36658 Outgoing,
36659 /// Private IP used when using private IPs and network peering.
36660 Private,
36661 /// V1 IP of a migrated instance. We want the user to
36662 /// decommission this IP as soon as the migration is complete.
36663 /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
36664 Migrated1StGen,
36665 /// If set, the enum was initialized with an unknown value.
36666 ///
36667 /// Applications can examine the value using [SqlIpAddressType::value] or
36668 /// [SqlIpAddressType::name].
36669 UnknownValue(sql_ip_address_type::UnknownValue),
36670}
36671
36672#[doc(hidden)]
36673pub mod sql_ip_address_type {
36674 #[allow(unused_imports)]
36675 use super::*;
36676 #[derive(Clone, Debug, PartialEq)]
36677 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36678}
36679
36680impl SqlIpAddressType {
36681 /// Gets the enum value.
36682 ///
36683 /// Returns `None` if the enum contains an unknown value deserialized from
36684 /// the string representation of enums.
36685 pub fn value(&self) -> std::option::Option<i32> {
36686 match self {
36687 Self::Unspecified => std::option::Option::Some(0),
36688 Self::Primary => std::option::Option::Some(1),
36689 Self::Outgoing => std::option::Option::Some(2),
36690 Self::Private => std::option::Option::Some(3),
36691 Self::Migrated1StGen => std::option::Option::Some(4),
36692 Self::UnknownValue(u) => u.0.value(),
36693 }
36694 }
36695
36696 /// Gets the enum value as a string.
36697 ///
36698 /// Returns `None` if the enum contains an unknown value deserialized from
36699 /// the integer representation of enums.
36700 pub fn name(&self) -> std::option::Option<&str> {
36701 match self {
36702 Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
36703 Self::Primary => std::option::Option::Some("PRIMARY"),
36704 Self::Outgoing => std::option::Option::Some("OUTGOING"),
36705 Self::Private => std::option::Option::Some("PRIVATE"),
36706 Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
36707 Self::UnknownValue(u) => u.0.name(),
36708 }
36709 }
36710}
36711
36712impl std::default::Default for SqlIpAddressType {
36713 fn default() -> Self {
36714 use std::convert::From;
36715 Self::from(0)
36716 }
36717}
36718
36719impl std::fmt::Display for SqlIpAddressType {
36720 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
36721 wkt::internal::display_enum(f, self.name(), self.value())
36722 }
36723}
36724
36725impl std::convert::From<i32> for SqlIpAddressType {
36726 fn from(value: i32) -> Self {
36727 match value {
36728 0 => Self::Unspecified,
36729 1 => Self::Primary,
36730 2 => Self::Outgoing,
36731 3 => Self::Private,
36732 4 => Self::Migrated1StGen,
36733 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
36734 wkt::internal::UnknownEnumValue::Integer(value),
36735 )),
36736 }
36737 }
36738}
36739
36740impl std::convert::From<&str> for SqlIpAddressType {
36741 fn from(value: &str) -> Self {
36742 use std::string::ToString;
36743 match value {
36744 "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
36745 "PRIMARY" => Self::Primary,
36746 "OUTGOING" => Self::Outgoing,
36747 "PRIVATE" => Self::Private,
36748 "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
36749 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
36750 wkt::internal::UnknownEnumValue::String(value.to_string()),
36751 )),
36752 }
36753 }
36754}
36755
36756impl serde::ser::Serialize for SqlIpAddressType {
36757 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
36758 where
36759 S: serde::Serializer,
36760 {
36761 match self {
36762 Self::Unspecified => serializer.serialize_i32(0),
36763 Self::Primary => serializer.serialize_i32(1),
36764 Self::Outgoing => serializer.serialize_i32(2),
36765 Self::Private => serializer.serialize_i32(3),
36766 Self::Migrated1StGen => serializer.serialize_i32(4),
36767 Self::UnknownValue(u) => u.0.serialize(serializer),
36768 }
36769 }
36770}
36771
36772impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
36773 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
36774 where
36775 D: serde::Deserializer<'de>,
36776 {
36777 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
36778 ".google.cloud.sql.v1.SqlIpAddressType",
36779 ))
36780 }
36781}
36782
36783/// The database engine type and version.
36784///
36785/// # Working with unknown values
36786///
36787/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
36788/// additional enum variants at any time. Adding new variants is not considered
36789/// a breaking change. Applications should write their code in anticipation of:
36790///
36791/// - New values appearing in future releases of the client library, **and**
36792/// - New values received dynamically, without application changes.
36793///
36794/// Please consult the [Working with enums] section in the user guide for some
36795/// guidelines.
36796///
36797/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
36798#[derive(Clone, Debug, PartialEq)]
36799#[non_exhaustive]
36800pub enum SqlDatabaseVersion {
36801 /// This is an unknown database version.
36802 Unspecified,
36803 /// The database version is MySQL 5.1.
36804 #[deprecated]
36805 Mysql51,
36806 /// The database version is MySQL 5.5.
36807 #[deprecated]
36808 Mysql55,
36809 /// The database version is MySQL 5.6.
36810 Mysql56,
36811 /// The database version is MySQL 5.7.
36812 Mysql57,
36813 /// The database version is MySQL 8.
36814 Mysql80,
36815 /// The database major version is MySQL 8.0 and the minor version is 18.
36816 Mysql8018,
36817 /// The database major version is MySQL 8.0 and the minor version is 26.
36818 Mysql8026,
36819 /// The database major version is MySQL 8.0 and the minor version is 27.
36820 Mysql8027,
36821 /// The database major version is MySQL 8.0 and the minor version is 28.
36822 Mysql8028,
36823 /// The database major version is MySQL 8.0 and the minor version is 29.
36824 #[deprecated]
36825 Mysql8029,
36826 /// The database major version is MySQL 8.0 and the minor version is 30.
36827 Mysql8030,
36828 /// The database major version is MySQL 8.0 and the minor version is 31.
36829 Mysql8031,
36830 /// The database major version is MySQL 8.0 and the minor version is 32.
36831 Mysql8032,
36832 /// The database major version is MySQL 8.0 and the minor version is 33.
36833 Mysql8033,
36834 /// The database major version is MySQL 8.0 and the minor version is 34.
36835 Mysql8034,
36836 /// The database major version is MySQL 8.0 and the minor version is 35.
36837 Mysql8035,
36838 /// The database major version is MySQL 8.0 and the minor version is 36.
36839 Mysql8036,
36840 /// The database major version is MySQL 8.0 and the minor version is 37.
36841 Mysql8037,
36842 /// The database major version is MySQL 8.0 and the minor version is 39.
36843 Mysql8039,
36844 /// The database major version is MySQL 8.0 and the minor version is 40.
36845 Mysql8040,
36846 /// The database major version is MySQL 8.0 and the minor version is 41.
36847 Mysql8041,
36848 /// The database major version is MySQL 8.0 and the minor version is 42.
36849 Mysql8042,
36850 /// The database major version is MySQL 8.0 and the minor version is 43.
36851 Mysql8043,
36852 /// The database major version is MySQL 8.0 and the minor version is 44.
36853 Mysql8044,
36854 /// The database major version is MySQL 8.0 and the minor version is 45.
36855 Mysql8045,
36856 /// The database major version is MySQL 8.0 and the minor version is 46.
36857 Mysql8046,
36858 /// The database version is MySQL 8.4.
36859 Mysql84,
36860 /// The database version is MySQL 9.7.
36861 Mysql97,
36862 /// The database version is SQL Server 2017 Standard.
36863 Sqlserver2017Standard,
36864 /// The database version is SQL Server 2017 Enterprise.
36865 Sqlserver2017Enterprise,
36866 /// The database version is SQL Server 2017 Express.
36867 Sqlserver2017Express,
36868 /// The database version is SQL Server 2017 Web.
36869 Sqlserver2017Web,
36870 /// The database version is PostgreSQL 9.6.
36871 Postgres96,
36872 /// The database version is PostgreSQL 10.
36873 Postgres10,
36874 /// The database version is PostgreSQL 11.
36875 Postgres11,
36876 /// The database version is PostgreSQL 12.
36877 Postgres12,
36878 /// The database version is PostgreSQL 13.
36879 Postgres13,
36880 /// The database version is PostgreSQL 14.
36881 Postgres14,
36882 /// The database version is PostgreSQL 15.
36883 Postgres15,
36884 /// The database version is PostgreSQL 16.
36885 Postgres16,
36886 /// The database version is PostgreSQL 17.
36887 Postgres17,
36888 /// The database version is PostgreSQL 18.
36889 Postgres18,
36890 /// The database version is PostgreSQL 19.
36891 Postgres19,
36892 /// The database version is PostgreSQL 20.
36893 Postgres20,
36894 /// The database version is SQL Server 2019 Standard.
36895 Sqlserver2019Standard,
36896 /// The database version is SQL Server 2019 Enterprise.
36897 Sqlserver2019Enterprise,
36898 /// The database version is SQL Server 2019 Express.
36899 Sqlserver2019Express,
36900 /// The database version is SQL Server 2019 Web.
36901 Sqlserver2019Web,
36902 /// The database version is SQL Server 2022 Standard.
36903 Sqlserver2022Standard,
36904 /// The database version is SQL Server 2022 Enterprise.
36905 Sqlserver2022Enterprise,
36906 /// The database version is SQL Server 2022 Express.
36907 Sqlserver2022Express,
36908 /// The database version is SQL Server 2022 Web.
36909 Sqlserver2022Web,
36910 /// The database version is SQL Server 2025 Standard.
36911 Sqlserver2025Standard,
36912 /// The database version is SQL Server 2025 Enterprise.
36913 Sqlserver2025Enterprise,
36914 /// The database version is SQL Server 2025 Express.
36915 Sqlserver2025Express,
36916 /// If set, the enum was initialized with an unknown value.
36917 ///
36918 /// Applications can examine the value using [SqlDatabaseVersion::value] or
36919 /// [SqlDatabaseVersion::name].
36920 UnknownValue(sql_database_version::UnknownValue),
36921}
36922
36923#[doc(hidden)]
36924pub mod sql_database_version {
36925 #[allow(unused_imports)]
36926 use super::*;
36927 #[derive(Clone, Debug, PartialEq)]
36928 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
36929}
36930
36931impl SqlDatabaseVersion {
36932 /// Gets the enum value.
36933 ///
36934 /// Returns `None` if the enum contains an unknown value deserialized from
36935 /// the string representation of enums.
36936 pub fn value(&self) -> std::option::Option<i32> {
36937 match self {
36938 Self::Unspecified => std::option::Option::Some(0),
36939 Self::Mysql51 => std::option::Option::Some(2),
36940 Self::Mysql55 => std::option::Option::Some(3),
36941 Self::Mysql56 => std::option::Option::Some(5),
36942 Self::Mysql57 => std::option::Option::Some(6),
36943 Self::Mysql80 => std::option::Option::Some(20),
36944 Self::Mysql8018 => std::option::Option::Some(41),
36945 Self::Mysql8026 => std::option::Option::Some(85),
36946 Self::Mysql8027 => std::option::Option::Some(111),
36947 Self::Mysql8028 => std::option::Option::Some(132),
36948 Self::Mysql8029 => std::option::Option::Some(148),
36949 Self::Mysql8030 => std::option::Option::Some(174),
36950 Self::Mysql8031 => std::option::Option::Some(197),
36951 Self::Mysql8032 => std::option::Option::Some(213),
36952 Self::Mysql8033 => std::option::Option::Some(238),
36953 Self::Mysql8034 => std::option::Option::Some(239),
36954 Self::Mysql8035 => std::option::Option::Some(240),
36955 Self::Mysql8036 => std::option::Option::Some(241),
36956 Self::Mysql8037 => std::option::Option::Some(355),
36957 Self::Mysql8039 => std::option::Option::Some(357),
36958 Self::Mysql8040 => std::option::Option::Some(358),
36959 Self::Mysql8041 => std::option::Option::Some(488),
36960 Self::Mysql8042 => std::option::Option::Some(489),
36961 Self::Mysql8043 => std::option::Option::Some(553),
36962 Self::Mysql8044 => std::option::Option::Some(554),
36963 Self::Mysql8045 => std::option::Option::Some(555),
36964 Self::Mysql8046 => std::option::Option::Some(556),
36965 Self::Mysql84 => std::option::Option::Some(398),
36966 Self::Mysql97 => std::option::Option::Some(654),
36967 Self::Sqlserver2017Standard => std::option::Option::Some(11),
36968 Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
36969 Self::Sqlserver2017Express => std::option::Option::Some(15),
36970 Self::Sqlserver2017Web => std::option::Option::Some(16),
36971 Self::Postgres96 => std::option::Option::Some(9),
36972 Self::Postgres10 => std::option::Option::Some(18),
36973 Self::Postgres11 => std::option::Option::Some(10),
36974 Self::Postgres12 => std::option::Option::Some(19),
36975 Self::Postgres13 => std::option::Option::Some(23),
36976 Self::Postgres14 => std::option::Option::Some(110),
36977 Self::Postgres15 => std::option::Option::Some(172),
36978 Self::Postgres16 => std::option::Option::Some(272),
36979 Self::Postgres17 => std::option::Option::Some(408),
36980 Self::Postgres18 => std::option::Option::Some(557),
36981 Self::Postgres19 => std::option::Option::Some(684),
36982 Self::Postgres20 => std::option::Option::Some(781),
36983 Self::Sqlserver2019Standard => std::option::Option::Some(26),
36984 Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
36985 Self::Sqlserver2019Express => std::option::Option::Some(28),
36986 Self::Sqlserver2019Web => std::option::Option::Some(29),
36987 Self::Sqlserver2022Standard => std::option::Option::Some(199),
36988 Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
36989 Self::Sqlserver2022Express => std::option::Option::Some(201),
36990 Self::Sqlserver2022Web => std::option::Option::Some(202),
36991 Self::Sqlserver2025Standard => std::option::Option::Some(549),
36992 Self::Sqlserver2025Enterprise => std::option::Option::Some(550),
36993 Self::Sqlserver2025Express => std::option::Option::Some(551),
36994 Self::UnknownValue(u) => u.0.value(),
36995 }
36996 }
36997
36998 /// Gets the enum value as a string.
36999 ///
37000 /// Returns `None` if the enum contains an unknown value deserialized from
37001 /// the integer representation of enums.
37002 pub fn name(&self) -> std::option::Option<&str> {
37003 match self {
37004 Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
37005 Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
37006 Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
37007 Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
37008 Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
37009 Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
37010 Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
37011 Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
37012 Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
37013 Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
37014 Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
37015 Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
37016 Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
37017 Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
37018 Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
37019 Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
37020 Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
37021 Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
37022 Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
37023 Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
37024 Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
37025 Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
37026 Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
37027 Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
37028 Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
37029 Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
37030 Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
37031 Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
37032 Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
37033 Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
37034 Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
37035 Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
37036 Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
37037 Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
37038 Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
37039 Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
37040 Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
37041 Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
37042 Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
37043 Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
37044 Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
37045 Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
37046 Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
37047 Self::Postgres19 => std::option::Option::Some("POSTGRES_19"),
37048 Self::Postgres20 => std::option::Option::Some("POSTGRES_20"),
37049 Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
37050 Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
37051 Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
37052 Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
37053 Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
37054 Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
37055 Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
37056 Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
37057 Self::Sqlserver2025Standard => std::option::Option::Some("SQLSERVER_2025_STANDARD"),
37058 Self::Sqlserver2025Enterprise => std::option::Option::Some("SQLSERVER_2025_ENTERPRISE"),
37059 Self::Sqlserver2025Express => std::option::Option::Some("SQLSERVER_2025_EXPRESS"),
37060 Self::UnknownValue(u) => u.0.name(),
37061 }
37062 }
37063}
37064
37065impl std::default::Default for SqlDatabaseVersion {
37066 fn default() -> Self {
37067 use std::convert::From;
37068 Self::from(0)
37069 }
37070}
37071
37072impl std::fmt::Display for SqlDatabaseVersion {
37073 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37074 wkt::internal::display_enum(f, self.name(), self.value())
37075 }
37076}
37077
37078impl std::convert::From<i32> for SqlDatabaseVersion {
37079 fn from(value: i32) -> Self {
37080 match value {
37081 0 => Self::Unspecified,
37082 2 => Self::Mysql51,
37083 3 => Self::Mysql55,
37084 5 => Self::Mysql56,
37085 6 => Self::Mysql57,
37086 9 => Self::Postgres96,
37087 10 => Self::Postgres11,
37088 11 => Self::Sqlserver2017Standard,
37089 14 => Self::Sqlserver2017Enterprise,
37090 15 => Self::Sqlserver2017Express,
37091 16 => Self::Sqlserver2017Web,
37092 18 => Self::Postgres10,
37093 19 => Self::Postgres12,
37094 20 => Self::Mysql80,
37095 23 => Self::Postgres13,
37096 26 => Self::Sqlserver2019Standard,
37097 27 => Self::Sqlserver2019Enterprise,
37098 28 => Self::Sqlserver2019Express,
37099 29 => Self::Sqlserver2019Web,
37100 41 => Self::Mysql8018,
37101 85 => Self::Mysql8026,
37102 110 => Self::Postgres14,
37103 111 => Self::Mysql8027,
37104 132 => Self::Mysql8028,
37105 148 => Self::Mysql8029,
37106 172 => Self::Postgres15,
37107 174 => Self::Mysql8030,
37108 197 => Self::Mysql8031,
37109 199 => Self::Sqlserver2022Standard,
37110 200 => Self::Sqlserver2022Enterprise,
37111 201 => Self::Sqlserver2022Express,
37112 202 => Self::Sqlserver2022Web,
37113 213 => Self::Mysql8032,
37114 238 => Self::Mysql8033,
37115 239 => Self::Mysql8034,
37116 240 => Self::Mysql8035,
37117 241 => Self::Mysql8036,
37118 272 => Self::Postgres16,
37119 355 => Self::Mysql8037,
37120 357 => Self::Mysql8039,
37121 358 => Self::Mysql8040,
37122 398 => Self::Mysql84,
37123 408 => Self::Postgres17,
37124 488 => Self::Mysql8041,
37125 489 => Self::Mysql8042,
37126 549 => Self::Sqlserver2025Standard,
37127 550 => Self::Sqlserver2025Enterprise,
37128 551 => Self::Sqlserver2025Express,
37129 553 => Self::Mysql8043,
37130 554 => Self::Mysql8044,
37131 555 => Self::Mysql8045,
37132 556 => Self::Mysql8046,
37133 557 => Self::Postgres18,
37134 654 => Self::Mysql97,
37135 684 => Self::Postgres19,
37136 781 => Self::Postgres20,
37137 _ => Self::UnknownValue(sql_database_version::UnknownValue(
37138 wkt::internal::UnknownEnumValue::Integer(value),
37139 )),
37140 }
37141 }
37142}
37143
37144impl std::convert::From<&str> for SqlDatabaseVersion {
37145 fn from(value: &str) -> Self {
37146 use std::string::ToString;
37147 match value {
37148 "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
37149 "MYSQL_5_1" => Self::Mysql51,
37150 "MYSQL_5_5" => Self::Mysql55,
37151 "MYSQL_5_6" => Self::Mysql56,
37152 "MYSQL_5_7" => Self::Mysql57,
37153 "MYSQL_8_0" => Self::Mysql80,
37154 "MYSQL_8_0_18" => Self::Mysql8018,
37155 "MYSQL_8_0_26" => Self::Mysql8026,
37156 "MYSQL_8_0_27" => Self::Mysql8027,
37157 "MYSQL_8_0_28" => Self::Mysql8028,
37158 "MYSQL_8_0_29" => Self::Mysql8029,
37159 "MYSQL_8_0_30" => Self::Mysql8030,
37160 "MYSQL_8_0_31" => Self::Mysql8031,
37161 "MYSQL_8_0_32" => Self::Mysql8032,
37162 "MYSQL_8_0_33" => Self::Mysql8033,
37163 "MYSQL_8_0_34" => Self::Mysql8034,
37164 "MYSQL_8_0_35" => Self::Mysql8035,
37165 "MYSQL_8_0_36" => Self::Mysql8036,
37166 "MYSQL_8_0_37" => Self::Mysql8037,
37167 "MYSQL_8_0_39" => Self::Mysql8039,
37168 "MYSQL_8_0_40" => Self::Mysql8040,
37169 "MYSQL_8_0_41" => Self::Mysql8041,
37170 "MYSQL_8_0_42" => Self::Mysql8042,
37171 "MYSQL_8_0_43" => Self::Mysql8043,
37172 "MYSQL_8_0_44" => Self::Mysql8044,
37173 "MYSQL_8_0_45" => Self::Mysql8045,
37174 "MYSQL_8_0_46" => Self::Mysql8046,
37175 "MYSQL_8_4" => Self::Mysql84,
37176 "MYSQL_9_7" => Self::Mysql97,
37177 "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
37178 "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
37179 "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
37180 "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
37181 "POSTGRES_9_6" => Self::Postgres96,
37182 "POSTGRES_10" => Self::Postgres10,
37183 "POSTGRES_11" => Self::Postgres11,
37184 "POSTGRES_12" => Self::Postgres12,
37185 "POSTGRES_13" => Self::Postgres13,
37186 "POSTGRES_14" => Self::Postgres14,
37187 "POSTGRES_15" => Self::Postgres15,
37188 "POSTGRES_16" => Self::Postgres16,
37189 "POSTGRES_17" => Self::Postgres17,
37190 "POSTGRES_18" => Self::Postgres18,
37191 "POSTGRES_19" => Self::Postgres19,
37192 "POSTGRES_20" => Self::Postgres20,
37193 "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
37194 "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
37195 "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
37196 "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
37197 "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
37198 "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
37199 "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
37200 "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
37201 "SQLSERVER_2025_STANDARD" => Self::Sqlserver2025Standard,
37202 "SQLSERVER_2025_ENTERPRISE" => Self::Sqlserver2025Enterprise,
37203 "SQLSERVER_2025_EXPRESS" => Self::Sqlserver2025Express,
37204 _ => Self::UnknownValue(sql_database_version::UnknownValue(
37205 wkt::internal::UnknownEnumValue::String(value.to_string()),
37206 )),
37207 }
37208 }
37209}
37210
37211impl serde::ser::Serialize for SqlDatabaseVersion {
37212 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37213 where
37214 S: serde::Serializer,
37215 {
37216 match self {
37217 Self::Unspecified => serializer.serialize_i32(0),
37218 Self::Mysql51 => serializer.serialize_i32(2),
37219 Self::Mysql55 => serializer.serialize_i32(3),
37220 Self::Mysql56 => serializer.serialize_i32(5),
37221 Self::Mysql57 => serializer.serialize_i32(6),
37222 Self::Mysql80 => serializer.serialize_i32(20),
37223 Self::Mysql8018 => serializer.serialize_i32(41),
37224 Self::Mysql8026 => serializer.serialize_i32(85),
37225 Self::Mysql8027 => serializer.serialize_i32(111),
37226 Self::Mysql8028 => serializer.serialize_i32(132),
37227 Self::Mysql8029 => serializer.serialize_i32(148),
37228 Self::Mysql8030 => serializer.serialize_i32(174),
37229 Self::Mysql8031 => serializer.serialize_i32(197),
37230 Self::Mysql8032 => serializer.serialize_i32(213),
37231 Self::Mysql8033 => serializer.serialize_i32(238),
37232 Self::Mysql8034 => serializer.serialize_i32(239),
37233 Self::Mysql8035 => serializer.serialize_i32(240),
37234 Self::Mysql8036 => serializer.serialize_i32(241),
37235 Self::Mysql8037 => serializer.serialize_i32(355),
37236 Self::Mysql8039 => serializer.serialize_i32(357),
37237 Self::Mysql8040 => serializer.serialize_i32(358),
37238 Self::Mysql8041 => serializer.serialize_i32(488),
37239 Self::Mysql8042 => serializer.serialize_i32(489),
37240 Self::Mysql8043 => serializer.serialize_i32(553),
37241 Self::Mysql8044 => serializer.serialize_i32(554),
37242 Self::Mysql8045 => serializer.serialize_i32(555),
37243 Self::Mysql8046 => serializer.serialize_i32(556),
37244 Self::Mysql84 => serializer.serialize_i32(398),
37245 Self::Mysql97 => serializer.serialize_i32(654),
37246 Self::Sqlserver2017Standard => serializer.serialize_i32(11),
37247 Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
37248 Self::Sqlserver2017Express => serializer.serialize_i32(15),
37249 Self::Sqlserver2017Web => serializer.serialize_i32(16),
37250 Self::Postgres96 => serializer.serialize_i32(9),
37251 Self::Postgres10 => serializer.serialize_i32(18),
37252 Self::Postgres11 => serializer.serialize_i32(10),
37253 Self::Postgres12 => serializer.serialize_i32(19),
37254 Self::Postgres13 => serializer.serialize_i32(23),
37255 Self::Postgres14 => serializer.serialize_i32(110),
37256 Self::Postgres15 => serializer.serialize_i32(172),
37257 Self::Postgres16 => serializer.serialize_i32(272),
37258 Self::Postgres17 => serializer.serialize_i32(408),
37259 Self::Postgres18 => serializer.serialize_i32(557),
37260 Self::Postgres19 => serializer.serialize_i32(684),
37261 Self::Postgres20 => serializer.serialize_i32(781),
37262 Self::Sqlserver2019Standard => serializer.serialize_i32(26),
37263 Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
37264 Self::Sqlserver2019Express => serializer.serialize_i32(28),
37265 Self::Sqlserver2019Web => serializer.serialize_i32(29),
37266 Self::Sqlserver2022Standard => serializer.serialize_i32(199),
37267 Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
37268 Self::Sqlserver2022Express => serializer.serialize_i32(201),
37269 Self::Sqlserver2022Web => serializer.serialize_i32(202),
37270 Self::Sqlserver2025Standard => serializer.serialize_i32(549),
37271 Self::Sqlserver2025Enterprise => serializer.serialize_i32(550),
37272 Self::Sqlserver2025Express => serializer.serialize_i32(551),
37273 Self::UnknownValue(u) => u.0.serialize(serializer),
37274 }
37275 }
37276}
37277
37278impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
37279 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37280 where
37281 D: serde::Deserializer<'de>,
37282 {
37283 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
37284 ".google.cloud.sql.v1.SqlDatabaseVersion",
37285 ))
37286 }
37287}
37288
37289/// The pricing plan for this instance.
37290///
37291/// # Working with unknown values
37292///
37293/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37294/// additional enum variants at any time. Adding new variants is not considered
37295/// a breaking change. Applications should write their code in anticipation of:
37296///
37297/// - New values appearing in future releases of the client library, **and**
37298/// - New values received dynamically, without application changes.
37299///
37300/// Please consult the [Working with enums] section in the user guide for some
37301/// guidelines.
37302///
37303/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37304#[derive(Clone, Debug, PartialEq)]
37305#[non_exhaustive]
37306pub enum SqlPricingPlan {
37307 /// This is an unknown pricing plan for this instance.
37308 Unspecified,
37309 /// The instance is billed at a monthly flat rate.
37310 Package,
37311 /// The instance is billed per usage.
37312 PerUse,
37313 /// If set, the enum was initialized with an unknown value.
37314 ///
37315 /// Applications can examine the value using [SqlPricingPlan::value] or
37316 /// [SqlPricingPlan::name].
37317 UnknownValue(sql_pricing_plan::UnknownValue),
37318}
37319
37320#[doc(hidden)]
37321pub mod sql_pricing_plan {
37322 #[allow(unused_imports)]
37323 use super::*;
37324 #[derive(Clone, Debug, PartialEq)]
37325 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37326}
37327
37328impl SqlPricingPlan {
37329 /// Gets the enum value.
37330 ///
37331 /// Returns `None` if the enum contains an unknown value deserialized from
37332 /// the string representation of enums.
37333 pub fn value(&self) -> std::option::Option<i32> {
37334 match self {
37335 Self::Unspecified => std::option::Option::Some(0),
37336 Self::Package => std::option::Option::Some(1),
37337 Self::PerUse => std::option::Option::Some(2),
37338 Self::UnknownValue(u) => u.0.value(),
37339 }
37340 }
37341
37342 /// Gets the enum value as a string.
37343 ///
37344 /// Returns `None` if the enum contains an unknown value deserialized from
37345 /// the integer representation of enums.
37346 pub fn name(&self) -> std::option::Option<&str> {
37347 match self {
37348 Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
37349 Self::Package => std::option::Option::Some("PACKAGE"),
37350 Self::PerUse => std::option::Option::Some("PER_USE"),
37351 Self::UnknownValue(u) => u.0.name(),
37352 }
37353 }
37354}
37355
37356impl std::default::Default for SqlPricingPlan {
37357 fn default() -> Self {
37358 use std::convert::From;
37359 Self::from(0)
37360 }
37361}
37362
37363impl std::fmt::Display for SqlPricingPlan {
37364 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37365 wkt::internal::display_enum(f, self.name(), self.value())
37366 }
37367}
37368
37369impl std::convert::From<i32> for SqlPricingPlan {
37370 fn from(value: i32) -> Self {
37371 match value {
37372 0 => Self::Unspecified,
37373 1 => Self::Package,
37374 2 => Self::PerUse,
37375 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
37376 wkt::internal::UnknownEnumValue::Integer(value),
37377 )),
37378 }
37379 }
37380}
37381
37382impl std::convert::From<&str> for SqlPricingPlan {
37383 fn from(value: &str) -> Self {
37384 use std::string::ToString;
37385 match value {
37386 "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
37387 "PACKAGE" => Self::Package,
37388 "PER_USE" => Self::PerUse,
37389 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
37390 wkt::internal::UnknownEnumValue::String(value.to_string()),
37391 )),
37392 }
37393 }
37394}
37395
37396impl serde::ser::Serialize for SqlPricingPlan {
37397 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37398 where
37399 S: serde::Serializer,
37400 {
37401 match self {
37402 Self::Unspecified => serializer.serialize_i32(0),
37403 Self::Package => serializer.serialize_i32(1),
37404 Self::PerUse => serializer.serialize_i32(2),
37405 Self::UnknownValue(u) => u.0.serialize(serializer),
37406 }
37407 }
37408}
37409
37410impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
37411 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37412 where
37413 D: serde::Deserializer<'de>,
37414 {
37415 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
37416 ".google.cloud.sql.v1.SqlPricingPlan",
37417 ))
37418 }
37419}
37420
37421/// Enum for [SqlReplicationType].
37422///
37423/// # Working with unknown values
37424///
37425/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37426/// additional enum variants at any time. Adding new variants is not considered
37427/// a breaking change. Applications should write their code in anticipation of:
37428///
37429/// - New values appearing in future releases of the client library, **and**
37430/// - New values received dynamically, without application changes.
37431///
37432/// Please consult the [Working with enums] section in the user guide for some
37433/// guidelines.
37434///
37435/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37436#[derive(Clone, Debug, PartialEq)]
37437#[non_exhaustive]
37438pub enum SqlReplicationType {
37439 /// This is an unknown replication type for a Cloud SQL instance.
37440 Unspecified,
37441 /// The synchronous replication mode for First Generation instances. It is the
37442 /// default value.
37443 Synchronous,
37444 /// The asynchronous replication mode for First Generation instances. It
37445 /// provides a slight performance gain, but if an outage occurs while this
37446 /// option is set to asynchronous, you can lose up to a few seconds of updates
37447 /// to your data.
37448 Asynchronous,
37449 /// If set, the enum was initialized with an unknown value.
37450 ///
37451 /// Applications can examine the value using [SqlReplicationType::value] or
37452 /// [SqlReplicationType::name].
37453 UnknownValue(sql_replication_type::UnknownValue),
37454}
37455
37456#[doc(hidden)]
37457pub mod sql_replication_type {
37458 #[allow(unused_imports)]
37459 use super::*;
37460 #[derive(Clone, Debug, PartialEq)]
37461 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37462}
37463
37464impl SqlReplicationType {
37465 /// Gets the enum value.
37466 ///
37467 /// Returns `None` if the enum contains an unknown value deserialized from
37468 /// the string representation of enums.
37469 pub fn value(&self) -> std::option::Option<i32> {
37470 match self {
37471 Self::Unspecified => std::option::Option::Some(0),
37472 Self::Synchronous => std::option::Option::Some(1),
37473 Self::Asynchronous => std::option::Option::Some(2),
37474 Self::UnknownValue(u) => u.0.value(),
37475 }
37476 }
37477
37478 /// Gets the enum value as a string.
37479 ///
37480 /// Returns `None` if the enum contains an unknown value deserialized from
37481 /// the integer representation of enums.
37482 pub fn name(&self) -> std::option::Option<&str> {
37483 match self {
37484 Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
37485 Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
37486 Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
37487 Self::UnknownValue(u) => u.0.name(),
37488 }
37489 }
37490}
37491
37492impl std::default::Default for SqlReplicationType {
37493 fn default() -> Self {
37494 use std::convert::From;
37495 Self::from(0)
37496 }
37497}
37498
37499impl std::fmt::Display for SqlReplicationType {
37500 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37501 wkt::internal::display_enum(f, self.name(), self.value())
37502 }
37503}
37504
37505impl std::convert::From<i32> for SqlReplicationType {
37506 fn from(value: i32) -> Self {
37507 match value {
37508 0 => Self::Unspecified,
37509 1 => Self::Synchronous,
37510 2 => Self::Asynchronous,
37511 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
37512 wkt::internal::UnknownEnumValue::Integer(value),
37513 )),
37514 }
37515 }
37516}
37517
37518impl std::convert::From<&str> for SqlReplicationType {
37519 fn from(value: &str) -> Self {
37520 use std::string::ToString;
37521 match value {
37522 "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
37523 "SYNCHRONOUS" => Self::Synchronous,
37524 "ASYNCHRONOUS" => Self::Asynchronous,
37525 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
37526 wkt::internal::UnknownEnumValue::String(value.to_string()),
37527 )),
37528 }
37529 }
37530}
37531
37532impl serde::ser::Serialize for SqlReplicationType {
37533 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37534 where
37535 S: serde::Serializer,
37536 {
37537 match self {
37538 Self::Unspecified => serializer.serialize_i32(0),
37539 Self::Synchronous => serializer.serialize_i32(1),
37540 Self::Asynchronous => serializer.serialize_i32(2),
37541 Self::UnknownValue(u) => u.0.serialize(serializer),
37542 }
37543 }
37544}
37545
37546impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
37547 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37548 where
37549 D: serde::Deserializer<'de>,
37550 {
37551 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
37552 ".google.cloud.sql.v1.SqlReplicationType",
37553 ))
37554 }
37555}
37556
37557/// The type of disk that is used for a v2 instance to use.
37558///
37559/// # Working with unknown values
37560///
37561/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37562/// additional enum variants at any time. Adding new variants is not considered
37563/// a breaking change. Applications should write their code in anticipation of:
37564///
37565/// - New values appearing in future releases of the client library, **and**
37566/// - New values received dynamically, without application changes.
37567///
37568/// Please consult the [Working with enums] section in the user guide for some
37569/// guidelines.
37570///
37571/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37572#[derive(Clone, Debug, PartialEq)]
37573#[non_exhaustive]
37574pub enum SqlDataDiskType {
37575 /// This is an unknown data disk type.
37576 Unspecified,
37577 /// An SSD data disk.
37578 PdSsd,
37579 /// An HDD data disk.
37580 PdHdd,
37581 /// This field is deprecated and will be removed from a future version of the
37582 /// API.
37583 #[deprecated]
37584 ObsoleteLocalSsd,
37585 /// A Hyperdisk Balanced data disk.
37586 HyperdiskBalanced,
37587 /// If set, the enum was initialized with an unknown value.
37588 ///
37589 /// Applications can examine the value using [SqlDataDiskType::value] or
37590 /// [SqlDataDiskType::name].
37591 UnknownValue(sql_data_disk_type::UnknownValue),
37592}
37593
37594#[doc(hidden)]
37595pub mod sql_data_disk_type {
37596 #[allow(unused_imports)]
37597 use super::*;
37598 #[derive(Clone, Debug, PartialEq)]
37599 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37600}
37601
37602impl SqlDataDiskType {
37603 /// Gets the enum value.
37604 ///
37605 /// Returns `None` if the enum contains an unknown value deserialized from
37606 /// the string representation of enums.
37607 pub fn value(&self) -> std::option::Option<i32> {
37608 match self {
37609 Self::Unspecified => std::option::Option::Some(0),
37610 Self::PdSsd => std::option::Option::Some(1),
37611 Self::PdHdd => std::option::Option::Some(2),
37612 Self::ObsoleteLocalSsd => std::option::Option::Some(3),
37613 Self::HyperdiskBalanced => std::option::Option::Some(4),
37614 Self::UnknownValue(u) => u.0.value(),
37615 }
37616 }
37617
37618 /// Gets the enum value as a string.
37619 ///
37620 /// Returns `None` if the enum contains an unknown value deserialized from
37621 /// the integer representation of enums.
37622 pub fn name(&self) -> std::option::Option<&str> {
37623 match self {
37624 Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
37625 Self::PdSsd => std::option::Option::Some("PD_SSD"),
37626 Self::PdHdd => std::option::Option::Some("PD_HDD"),
37627 Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
37628 Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
37629 Self::UnknownValue(u) => u.0.name(),
37630 }
37631 }
37632}
37633
37634impl std::default::Default for SqlDataDiskType {
37635 fn default() -> Self {
37636 use std::convert::From;
37637 Self::from(0)
37638 }
37639}
37640
37641impl std::fmt::Display for SqlDataDiskType {
37642 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37643 wkt::internal::display_enum(f, self.name(), self.value())
37644 }
37645}
37646
37647impl std::convert::From<i32> for SqlDataDiskType {
37648 fn from(value: i32) -> Self {
37649 match value {
37650 0 => Self::Unspecified,
37651 1 => Self::PdSsd,
37652 2 => Self::PdHdd,
37653 3 => Self::ObsoleteLocalSsd,
37654 4 => Self::HyperdiskBalanced,
37655 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
37656 wkt::internal::UnknownEnumValue::Integer(value),
37657 )),
37658 }
37659 }
37660}
37661
37662impl std::convert::From<&str> for SqlDataDiskType {
37663 fn from(value: &str) -> Self {
37664 use std::string::ToString;
37665 match value {
37666 "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
37667 "PD_SSD" => Self::PdSsd,
37668 "PD_HDD" => Self::PdHdd,
37669 "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
37670 "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
37671 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
37672 wkt::internal::UnknownEnumValue::String(value.to_string()),
37673 )),
37674 }
37675 }
37676}
37677
37678impl serde::ser::Serialize for SqlDataDiskType {
37679 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37680 where
37681 S: serde::Serializer,
37682 {
37683 match self {
37684 Self::Unspecified => serializer.serialize_i32(0),
37685 Self::PdSsd => serializer.serialize_i32(1),
37686 Self::PdHdd => serializer.serialize_i32(2),
37687 Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
37688 Self::HyperdiskBalanced => serializer.serialize_i32(4),
37689 Self::UnknownValue(u) => u.0.serialize(serializer),
37690 }
37691 }
37692}
37693
37694impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
37695 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37696 where
37697 D: serde::Deserializer<'de>,
37698 {
37699 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
37700 ".google.cloud.sql.v1.SqlDataDiskType",
37701 ))
37702 }
37703}
37704
37705/// The availability type of the given Cloud SQL instance.
37706///
37707/// # Working with unknown values
37708///
37709/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37710/// additional enum variants at any time. Adding new variants is not considered
37711/// a breaking change. Applications should write their code in anticipation of:
37712///
37713/// - New values appearing in future releases of the client library, **and**
37714/// - New values received dynamically, without application changes.
37715///
37716/// Please consult the [Working with enums] section in the user guide for some
37717/// guidelines.
37718///
37719/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37720#[derive(Clone, Debug, PartialEq)]
37721#[non_exhaustive]
37722pub enum SqlAvailabilityType {
37723 /// This is an unknown Availability type.
37724 Unspecified,
37725 /// Zonal available instance.
37726 Zonal,
37727 /// Regional available instance.
37728 Regional,
37729 /// If set, the enum was initialized with an unknown value.
37730 ///
37731 /// Applications can examine the value using [SqlAvailabilityType::value] or
37732 /// [SqlAvailabilityType::name].
37733 UnknownValue(sql_availability_type::UnknownValue),
37734}
37735
37736#[doc(hidden)]
37737pub mod sql_availability_type {
37738 #[allow(unused_imports)]
37739 use super::*;
37740 #[derive(Clone, Debug, PartialEq)]
37741 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37742}
37743
37744impl SqlAvailabilityType {
37745 /// Gets the enum value.
37746 ///
37747 /// Returns `None` if the enum contains an unknown value deserialized from
37748 /// the string representation of enums.
37749 pub fn value(&self) -> std::option::Option<i32> {
37750 match self {
37751 Self::Unspecified => std::option::Option::Some(0),
37752 Self::Zonal => std::option::Option::Some(1),
37753 Self::Regional => std::option::Option::Some(2),
37754 Self::UnknownValue(u) => u.0.value(),
37755 }
37756 }
37757
37758 /// Gets the enum value as a string.
37759 ///
37760 /// Returns `None` if the enum contains an unknown value deserialized from
37761 /// the integer representation of enums.
37762 pub fn name(&self) -> std::option::Option<&str> {
37763 match self {
37764 Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
37765 Self::Zonal => std::option::Option::Some("ZONAL"),
37766 Self::Regional => std::option::Option::Some("REGIONAL"),
37767 Self::UnknownValue(u) => u.0.name(),
37768 }
37769 }
37770}
37771
37772impl std::default::Default for SqlAvailabilityType {
37773 fn default() -> Self {
37774 use std::convert::From;
37775 Self::from(0)
37776 }
37777}
37778
37779impl std::fmt::Display for SqlAvailabilityType {
37780 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37781 wkt::internal::display_enum(f, self.name(), self.value())
37782 }
37783}
37784
37785impl std::convert::From<i32> for SqlAvailabilityType {
37786 fn from(value: i32) -> Self {
37787 match value {
37788 0 => Self::Unspecified,
37789 1 => Self::Zonal,
37790 2 => Self::Regional,
37791 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
37792 wkt::internal::UnknownEnumValue::Integer(value),
37793 )),
37794 }
37795 }
37796}
37797
37798impl std::convert::From<&str> for SqlAvailabilityType {
37799 fn from(value: &str) -> Self {
37800 use std::string::ToString;
37801 match value {
37802 "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
37803 "ZONAL" => Self::Zonal,
37804 "REGIONAL" => Self::Regional,
37805 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
37806 wkt::internal::UnknownEnumValue::String(value.to_string()),
37807 )),
37808 }
37809 }
37810}
37811
37812impl serde::ser::Serialize for SqlAvailabilityType {
37813 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37814 where
37815 S: serde::Serializer,
37816 {
37817 match self {
37818 Self::Unspecified => serializer.serialize_i32(0),
37819 Self::Zonal => serializer.serialize_i32(1),
37820 Self::Regional => serializer.serialize_i32(2),
37821 Self::UnknownValue(u) => u.0.serialize(serializer),
37822 }
37823 }
37824}
37825
37826impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
37827 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37828 where
37829 D: serde::Deserializer<'de>,
37830 {
37831 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
37832 ".google.cloud.sql.v1.SqlAvailabilityType",
37833 ))
37834 }
37835}
37836
37837/// Enum for [SqlUpdateTrack].
37838///
37839/// # Working with unknown values
37840///
37841/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37842/// additional enum variants at any time. Adding new variants is not considered
37843/// a breaking change. Applications should write their code in anticipation of:
37844///
37845/// - New values appearing in future releases of the client library, **and**
37846/// - New values received dynamically, without application changes.
37847///
37848/// Please consult the [Working with enums] section in the user guide for some
37849/// guidelines.
37850///
37851/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37852#[derive(Clone, Debug, PartialEq)]
37853#[non_exhaustive]
37854pub enum SqlUpdateTrack {
37855 /// This is an unknown maintenance timing preference.
37856 Unspecified,
37857 /// For an instance with a scheduled maintenance window, this maintenance
37858 /// timing indicates that the maintenance update is scheduled 7 to 14 days
37859 /// after the notification is sent out. Also referred to as `Week 1` (Console)
37860 /// and `preview` (gcloud CLI).
37861 Canary,
37862 /// For an instance with a scheduled maintenance window, this maintenance
37863 /// timing indicates that the maintenance update is scheduled 15 to 21 days
37864 /// after the notification is sent out. Also referred to as `Week 2` (Console)
37865 /// and `production` (gcloud CLI).
37866 Stable,
37867 /// For instance with a scheduled maintenance window, this maintenance
37868 /// timing indicates that the maintenance update is scheduled 35 to 42 days
37869 /// after the notification is sent out.
37870 Week5,
37871 /// If set, the enum was initialized with an unknown value.
37872 ///
37873 /// Applications can examine the value using [SqlUpdateTrack::value] or
37874 /// [SqlUpdateTrack::name].
37875 UnknownValue(sql_update_track::UnknownValue),
37876}
37877
37878#[doc(hidden)]
37879pub mod sql_update_track {
37880 #[allow(unused_imports)]
37881 use super::*;
37882 #[derive(Clone, Debug, PartialEq)]
37883 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
37884}
37885
37886impl SqlUpdateTrack {
37887 /// Gets the enum value.
37888 ///
37889 /// Returns `None` if the enum contains an unknown value deserialized from
37890 /// the string representation of enums.
37891 pub fn value(&self) -> std::option::Option<i32> {
37892 match self {
37893 Self::Unspecified => std::option::Option::Some(0),
37894 Self::Canary => std::option::Option::Some(1),
37895 Self::Stable => std::option::Option::Some(2),
37896 Self::Week5 => std::option::Option::Some(3),
37897 Self::UnknownValue(u) => u.0.value(),
37898 }
37899 }
37900
37901 /// Gets the enum value as a string.
37902 ///
37903 /// Returns `None` if the enum contains an unknown value deserialized from
37904 /// the integer representation of enums.
37905 pub fn name(&self) -> std::option::Option<&str> {
37906 match self {
37907 Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
37908 Self::Canary => std::option::Option::Some("canary"),
37909 Self::Stable => std::option::Option::Some("stable"),
37910 Self::Week5 => std::option::Option::Some("week5"),
37911 Self::UnknownValue(u) => u.0.name(),
37912 }
37913 }
37914}
37915
37916impl std::default::Default for SqlUpdateTrack {
37917 fn default() -> Self {
37918 use std::convert::From;
37919 Self::from(0)
37920 }
37921}
37922
37923impl std::fmt::Display for SqlUpdateTrack {
37924 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
37925 wkt::internal::display_enum(f, self.name(), self.value())
37926 }
37927}
37928
37929impl std::convert::From<i32> for SqlUpdateTrack {
37930 fn from(value: i32) -> Self {
37931 match value {
37932 0 => Self::Unspecified,
37933 1 => Self::Canary,
37934 2 => Self::Stable,
37935 3 => Self::Week5,
37936 _ => Self::UnknownValue(sql_update_track::UnknownValue(
37937 wkt::internal::UnknownEnumValue::Integer(value),
37938 )),
37939 }
37940 }
37941}
37942
37943impl std::convert::From<&str> for SqlUpdateTrack {
37944 fn from(value: &str) -> Self {
37945 use std::string::ToString;
37946 match value {
37947 "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
37948 "canary" => Self::Canary,
37949 "stable" => Self::Stable,
37950 "week5" => Self::Week5,
37951 _ => Self::UnknownValue(sql_update_track::UnknownValue(
37952 wkt::internal::UnknownEnumValue::String(value.to_string()),
37953 )),
37954 }
37955 }
37956}
37957
37958impl serde::ser::Serialize for SqlUpdateTrack {
37959 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
37960 where
37961 S: serde::Serializer,
37962 {
37963 match self {
37964 Self::Unspecified => serializer.serialize_i32(0),
37965 Self::Canary => serializer.serialize_i32(1),
37966 Self::Stable => serializer.serialize_i32(2),
37967 Self::Week5 => serializer.serialize_i32(3),
37968 Self::UnknownValue(u) => u.0.serialize(serializer),
37969 }
37970 }
37971}
37972
37973impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
37974 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
37975 where
37976 D: serde::Deserializer<'de>,
37977 {
37978 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
37979 ".google.cloud.sql.v1.SqlUpdateTrack",
37980 ))
37981 }
37982}
37983
37984/// The status of automated DNS provisioning.
37985///
37986/// # Working with unknown values
37987///
37988/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
37989/// additional enum variants at any time. Adding new variants is not considered
37990/// a breaking change. Applications should write their code in anticipation of:
37991///
37992/// - New values appearing in future releases of the client library, **and**
37993/// - New values received dynamically, without application changes.
37994///
37995/// Please consult the [Working with enums] section in the user guide for some
37996/// guidelines.
37997///
37998/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
37999#[derive(Clone, Debug, PartialEq)]
38000#[non_exhaustive]
38001pub enum AutoDnsStatus {
38002 /// Unspecified status. This means status is missing from dependency service.
38003 Unspecified,
38004 /// DNS provisioning is OK.
38005 AutoDnsOk,
38006 /// DNS provisioning failed.
38007 AutoDnsFailed,
38008 /// DNS provisioning status is not recognized by Cloud SQL.
38009 AutoDnsUnknown,
38010 /// If set, the enum was initialized with an unknown value.
38011 ///
38012 /// Applications can examine the value using [AutoDnsStatus::value] or
38013 /// [AutoDnsStatus::name].
38014 UnknownValue(auto_dns_status::UnknownValue),
38015}
38016
38017#[doc(hidden)]
38018pub mod auto_dns_status {
38019 #[allow(unused_imports)]
38020 use super::*;
38021 #[derive(Clone, Debug, PartialEq)]
38022 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
38023}
38024
38025impl AutoDnsStatus {
38026 /// Gets the enum value.
38027 ///
38028 /// Returns `None` if the enum contains an unknown value deserialized from
38029 /// the string representation of enums.
38030 pub fn value(&self) -> std::option::Option<i32> {
38031 match self {
38032 Self::Unspecified => std::option::Option::Some(0),
38033 Self::AutoDnsOk => std::option::Option::Some(1),
38034 Self::AutoDnsFailed => std::option::Option::Some(2),
38035 Self::AutoDnsUnknown => std::option::Option::Some(3),
38036 Self::UnknownValue(u) => u.0.value(),
38037 }
38038 }
38039
38040 /// Gets the enum value as a string.
38041 ///
38042 /// Returns `None` if the enum contains an unknown value deserialized from
38043 /// the integer representation of enums.
38044 pub fn name(&self) -> std::option::Option<&str> {
38045 match self {
38046 Self::Unspecified => std::option::Option::Some("AUTO_DNS_STATUS_UNSPECIFIED"),
38047 Self::AutoDnsOk => std::option::Option::Some("AUTO_DNS_OK"),
38048 Self::AutoDnsFailed => std::option::Option::Some("AUTO_DNS_FAILED"),
38049 Self::AutoDnsUnknown => std::option::Option::Some("AUTO_DNS_UNKNOWN"),
38050 Self::UnknownValue(u) => u.0.name(),
38051 }
38052 }
38053}
38054
38055impl std::default::Default for AutoDnsStatus {
38056 fn default() -> Self {
38057 use std::convert::From;
38058 Self::from(0)
38059 }
38060}
38061
38062impl std::fmt::Display for AutoDnsStatus {
38063 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
38064 wkt::internal::display_enum(f, self.name(), self.value())
38065 }
38066}
38067
38068impl std::convert::From<i32> for AutoDnsStatus {
38069 fn from(value: i32) -> Self {
38070 match value {
38071 0 => Self::Unspecified,
38072 1 => Self::AutoDnsOk,
38073 2 => Self::AutoDnsFailed,
38074 3 => Self::AutoDnsUnknown,
38075 _ => Self::UnknownValue(auto_dns_status::UnknownValue(
38076 wkt::internal::UnknownEnumValue::Integer(value),
38077 )),
38078 }
38079 }
38080}
38081
38082impl std::convert::From<&str> for AutoDnsStatus {
38083 fn from(value: &str) -> Self {
38084 use std::string::ToString;
38085 match value {
38086 "AUTO_DNS_STATUS_UNSPECIFIED" => Self::Unspecified,
38087 "AUTO_DNS_OK" => Self::AutoDnsOk,
38088 "AUTO_DNS_FAILED" => Self::AutoDnsFailed,
38089 "AUTO_DNS_UNKNOWN" => Self::AutoDnsUnknown,
38090 _ => Self::UnknownValue(auto_dns_status::UnknownValue(
38091 wkt::internal::UnknownEnumValue::String(value.to_string()),
38092 )),
38093 }
38094 }
38095}
38096
38097impl serde::ser::Serialize for AutoDnsStatus {
38098 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
38099 where
38100 S: serde::Serializer,
38101 {
38102 match self {
38103 Self::Unspecified => serializer.serialize_i32(0),
38104 Self::AutoDnsOk => serializer.serialize_i32(1),
38105 Self::AutoDnsFailed => serializer.serialize_i32(2),
38106 Self::AutoDnsUnknown => serializer.serialize_i32(3),
38107 Self::UnknownValue(u) => u.0.serialize(serializer),
38108 }
38109 }
38110}
38111
38112impl<'de> serde::de::Deserialize<'de> for AutoDnsStatus {
38113 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
38114 where
38115 D: serde::Deserializer<'de>,
38116 {
38117 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AutoDnsStatus>::new(
38118 ".google.cloud.sql.v1.AutoDnsStatus",
38119 ))
38120 }
38121}