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::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_rpc;
25extern crate google_cloud_type;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// Backup runs delete request.
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct SqlBackupRunsDeleteRequest {
41 /// The ID of the backup run to delete. To find a backup run ID, use the
42 /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
43 /// method.
44 pub id: i64,
45
46 /// Cloud SQL instance ID. This does not include the project ID.
47 pub instance: std::string::String,
48
49 /// Project ID of the project that contains the instance.
50 pub project: std::string::String,
51
52 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
53}
54
55impl SqlBackupRunsDeleteRequest {
56 pub fn new() -> Self {
57 std::default::Default::default()
58 }
59
60 /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
61 ///
62 /// # Example
63 /// ```ignore,no_run
64 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
65 /// let x = SqlBackupRunsDeleteRequest::new().set_id(42);
66 /// ```
67 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
68 self.id = v.into();
69 self
70 }
71
72 /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
73 ///
74 /// # Example
75 /// ```ignore,no_run
76 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
77 /// let x = SqlBackupRunsDeleteRequest::new().set_instance("example");
78 /// ```
79 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
80 self.instance = v.into();
81 self
82 }
83
84 /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
85 ///
86 /// # Example
87 /// ```ignore,no_run
88 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
89 /// let x = SqlBackupRunsDeleteRequest::new().set_project("example");
90 /// ```
91 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
92 self.project = v.into();
93 self
94 }
95}
96
97impl wkt::message::Message for SqlBackupRunsDeleteRequest {
98 fn typename() -> &'static str {
99 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
100 }
101}
102
103/// Backup runs get request.
104#[derive(Clone, Default, PartialEq)]
105#[non_exhaustive]
106pub struct SqlBackupRunsGetRequest {
107 /// The ID of this backup run.
108 pub id: i64,
109
110 /// Cloud SQL instance ID. This does not include the project ID.
111 pub instance: std::string::String,
112
113 /// Project ID of the project that contains the instance.
114 pub project: std::string::String,
115
116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
117}
118
119impl SqlBackupRunsGetRequest {
120 pub fn new() -> Self {
121 std::default::Default::default()
122 }
123
124 /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
125 ///
126 /// # Example
127 /// ```ignore,no_run
128 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
129 /// let x = SqlBackupRunsGetRequest::new().set_id(42);
130 /// ```
131 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
132 self.id = v.into();
133 self
134 }
135
136 /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
137 ///
138 /// # Example
139 /// ```ignore,no_run
140 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
141 /// let x = SqlBackupRunsGetRequest::new().set_instance("example");
142 /// ```
143 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
144 self.instance = v.into();
145 self
146 }
147
148 /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
149 ///
150 /// # Example
151 /// ```ignore,no_run
152 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
153 /// let x = SqlBackupRunsGetRequest::new().set_project("example");
154 /// ```
155 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
156 self.project = v.into();
157 self
158 }
159}
160
161impl wkt::message::Message for SqlBackupRunsGetRequest {
162 fn typename() -> &'static str {
163 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
164 }
165}
166
167/// Backup runs insert request.
168#[derive(Clone, Default, PartialEq)]
169#[non_exhaustive]
170pub struct SqlBackupRunsInsertRequest {
171 /// Cloud SQL instance ID. This does not include the project ID.
172 pub instance: std::string::String,
173
174 /// Project ID of the project that contains the instance.
175 pub project: std::string::String,
176
177 pub body: std::option::Option<crate::model::BackupRun>,
178
179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
180}
181
182impl SqlBackupRunsInsertRequest {
183 pub fn new() -> Self {
184 std::default::Default::default()
185 }
186
187 /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
188 ///
189 /// # Example
190 /// ```ignore,no_run
191 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
192 /// let x = SqlBackupRunsInsertRequest::new().set_instance("example");
193 /// ```
194 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
195 self.instance = v.into();
196 self
197 }
198
199 /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
200 ///
201 /// # Example
202 /// ```ignore,no_run
203 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
204 /// let x = SqlBackupRunsInsertRequest::new().set_project("example");
205 /// ```
206 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
207 self.project = v.into();
208 self
209 }
210
211 /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
212 ///
213 /// # Example
214 /// ```ignore,no_run
215 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
216 /// use google_cloud_sql_v1::model::BackupRun;
217 /// let x = SqlBackupRunsInsertRequest::new().set_body(BackupRun::default()/* use setters */);
218 /// ```
219 pub fn set_body<T>(mut self, v: T) -> Self
220 where
221 T: std::convert::Into<crate::model::BackupRun>,
222 {
223 self.body = std::option::Option::Some(v.into());
224 self
225 }
226
227 /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
228 ///
229 /// # Example
230 /// ```ignore,no_run
231 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
232 /// use google_cloud_sql_v1::model::BackupRun;
233 /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(Some(BackupRun::default()/* use setters */));
234 /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(None::<BackupRun>);
235 /// ```
236 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
237 where
238 T: std::convert::Into<crate::model::BackupRun>,
239 {
240 self.body = v.map(|x| x.into());
241 self
242 }
243}
244
245impl wkt::message::Message for SqlBackupRunsInsertRequest {
246 fn typename() -> &'static str {
247 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
248 }
249}
250
251/// Backup runs list request.
252#[derive(Clone, Default, PartialEq)]
253#[non_exhaustive]
254pub struct SqlBackupRunsListRequest {
255 /// Cloud SQL instance ID, or "-" for all instances. This does not include
256 /// the project ID.
257 pub instance: std::string::String,
258
259 /// Maximum number of backup runs per response.
260 pub max_results: i32,
261
262 /// A previously-returned page token representing part of the larger set of
263 /// results to view.
264 pub page_token: std::string::String,
265
266 /// Project ID of the project that contains the instance.
267 pub project: std::string::String,
268
269 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
270}
271
272impl SqlBackupRunsListRequest {
273 pub fn new() -> Self {
274 std::default::Default::default()
275 }
276
277 /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
278 ///
279 /// # Example
280 /// ```ignore,no_run
281 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
282 /// let x = SqlBackupRunsListRequest::new().set_instance("example");
283 /// ```
284 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
285 self.instance = v.into();
286 self
287 }
288
289 /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
290 ///
291 /// # Example
292 /// ```ignore,no_run
293 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
294 /// let x = SqlBackupRunsListRequest::new().set_max_results(42);
295 /// ```
296 pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
297 self.max_results = v.into();
298 self
299 }
300
301 /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
302 ///
303 /// # Example
304 /// ```ignore,no_run
305 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
306 /// let x = SqlBackupRunsListRequest::new().set_page_token("example");
307 /// ```
308 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
309 self.page_token = v.into();
310 self
311 }
312
313 /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
314 ///
315 /// # Example
316 /// ```ignore,no_run
317 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
318 /// let x = SqlBackupRunsListRequest::new().set_project("example");
319 /// ```
320 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
321 self.project = v.into();
322 self
323 }
324}
325
326impl wkt::message::Message for SqlBackupRunsListRequest {
327 fn typename() -> &'static str {
328 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
329 }
330}
331
332/// A BackupRun resource.
333#[derive(Clone, Default, PartialEq)]
334#[non_exhaustive]
335pub struct BackupRun {
336 /// This is always `sql#backupRun`.
337 pub kind: std::string::String,
338
339 /// The status of this run.
340 pub status: crate::model::SqlBackupRunStatus,
341
342 /// The time the run was enqueued in UTC timezone in
343 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
344 /// `2012-11-15T16:19:00.094Z`.
345 pub enqueued_time: std::option::Option<wkt::Timestamp>,
346
347 /// The identifier for this backup run. Unique only for a specific Cloud SQL
348 /// instance.
349 pub id: i64,
350
351 /// The time the backup operation actually started in UTC timezone in
352 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
353 /// `2012-11-15T16:19:00.094Z`.
354 pub start_time: std::option::Option<wkt::Timestamp>,
355
356 /// The time the backup operation completed in UTC timezone in
357 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
358 /// `2012-11-15T16:19:00.094Z`.
359 pub end_time: std::option::Option<wkt::Timestamp>,
360
361 /// Information about why the backup operation failed. This is only present if
362 /// the run has the FAILED status.
363 pub error: std::option::Option<crate::model::OperationError>,
364
365 /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
366 /// This field defaults to "ON_DEMAND" and is ignored, when specified for
367 /// insert requests.
368 pub r#type: crate::model::SqlBackupRunType,
369
370 /// The description of this run, only applicable to on-demand backups.
371 pub description: std::string::String,
372
373 /// The start time of the backup window during which this the backup was
374 /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
375 /// example `2012-11-15T16:19:00.094Z`.
376 pub window_start_time: std::option::Option<wkt::Timestamp>,
377
378 /// Name of the database instance.
379 pub instance: std::string::String,
380
381 /// The URI of this resource.
382 pub self_link: std::string::String,
383
384 /// Location of the backups.
385 pub location: std::string::String,
386
387 /// Output only. The instance database version at the time this backup was
388 /// made.
389 pub database_version: crate::model::SqlDatabaseVersion,
390
391 /// Encryption configuration specific to a backup.
392 pub disk_encryption_configuration:
393 std::option::Option<crate::model::DiskEncryptionConfiguration>,
394
395 /// Encryption status specific to a backup.
396 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
397
398 /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
399 pub backup_kind: crate::model::SqlBackupKind,
400
401 /// Backup time zone to prevent restores to an instance with
402 /// a different time zone. Now relevant only for SQL Server.
403 pub time_zone: std::string::String,
404
405 /// Output only. The maximum chargeable bytes for the backup.
406 pub max_chargeable_bytes: std::option::Option<i64>,
407
408 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
409}
410
411impl BackupRun {
412 pub fn new() -> Self {
413 std::default::Default::default()
414 }
415
416 /// Sets the value of [kind][crate::model::BackupRun::kind].
417 ///
418 /// # Example
419 /// ```ignore,no_run
420 /// # use google_cloud_sql_v1::model::BackupRun;
421 /// let x = BackupRun::new().set_kind("example");
422 /// ```
423 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
424 self.kind = v.into();
425 self
426 }
427
428 /// Sets the value of [status][crate::model::BackupRun::status].
429 ///
430 /// # Example
431 /// ```ignore,no_run
432 /// # use google_cloud_sql_v1::model::BackupRun;
433 /// use google_cloud_sql_v1::model::SqlBackupRunStatus;
434 /// let x0 = BackupRun::new().set_status(SqlBackupRunStatus::Enqueued);
435 /// let x1 = BackupRun::new().set_status(SqlBackupRunStatus::Overdue);
436 /// let x2 = BackupRun::new().set_status(SqlBackupRunStatus::Running);
437 /// ```
438 pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
439 mut self,
440 v: T,
441 ) -> Self {
442 self.status = v.into();
443 self
444 }
445
446 /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
447 ///
448 /// # Example
449 /// ```ignore,no_run
450 /// # use google_cloud_sql_v1::model::BackupRun;
451 /// use wkt::Timestamp;
452 /// let x = BackupRun::new().set_enqueued_time(Timestamp::default()/* use setters */);
453 /// ```
454 pub fn set_enqueued_time<T>(mut self, v: T) -> Self
455 where
456 T: std::convert::Into<wkt::Timestamp>,
457 {
458 self.enqueued_time = std::option::Option::Some(v.into());
459 self
460 }
461
462 /// Sets or clears the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
463 ///
464 /// # Example
465 /// ```ignore,no_run
466 /// # use google_cloud_sql_v1::model::BackupRun;
467 /// use wkt::Timestamp;
468 /// let x = BackupRun::new().set_or_clear_enqueued_time(Some(Timestamp::default()/* use setters */));
469 /// let x = BackupRun::new().set_or_clear_enqueued_time(None::<Timestamp>);
470 /// ```
471 pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
472 where
473 T: std::convert::Into<wkt::Timestamp>,
474 {
475 self.enqueued_time = v.map(|x| x.into());
476 self
477 }
478
479 /// Sets the value of [id][crate::model::BackupRun::id].
480 ///
481 /// # Example
482 /// ```ignore,no_run
483 /// # use google_cloud_sql_v1::model::BackupRun;
484 /// let x = BackupRun::new().set_id(42);
485 /// ```
486 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
487 self.id = v.into();
488 self
489 }
490
491 /// Sets the value of [start_time][crate::model::BackupRun::start_time].
492 ///
493 /// # Example
494 /// ```ignore,no_run
495 /// # use google_cloud_sql_v1::model::BackupRun;
496 /// use wkt::Timestamp;
497 /// let x = BackupRun::new().set_start_time(Timestamp::default()/* use setters */);
498 /// ```
499 pub fn set_start_time<T>(mut self, v: T) -> Self
500 where
501 T: std::convert::Into<wkt::Timestamp>,
502 {
503 self.start_time = std::option::Option::Some(v.into());
504 self
505 }
506
507 /// Sets or clears the value of [start_time][crate::model::BackupRun::start_time].
508 ///
509 /// # Example
510 /// ```ignore,no_run
511 /// # use google_cloud_sql_v1::model::BackupRun;
512 /// use wkt::Timestamp;
513 /// let x = BackupRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
514 /// let x = BackupRun::new().set_or_clear_start_time(None::<Timestamp>);
515 /// ```
516 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
517 where
518 T: std::convert::Into<wkt::Timestamp>,
519 {
520 self.start_time = v.map(|x| x.into());
521 self
522 }
523
524 /// Sets the value of [end_time][crate::model::BackupRun::end_time].
525 ///
526 /// # Example
527 /// ```ignore,no_run
528 /// # use google_cloud_sql_v1::model::BackupRun;
529 /// use wkt::Timestamp;
530 /// let x = BackupRun::new().set_end_time(Timestamp::default()/* use setters */);
531 /// ```
532 pub fn set_end_time<T>(mut self, v: T) -> Self
533 where
534 T: std::convert::Into<wkt::Timestamp>,
535 {
536 self.end_time = std::option::Option::Some(v.into());
537 self
538 }
539
540 /// Sets or clears the value of [end_time][crate::model::BackupRun::end_time].
541 ///
542 /// # Example
543 /// ```ignore,no_run
544 /// # use google_cloud_sql_v1::model::BackupRun;
545 /// use wkt::Timestamp;
546 /// let x = BackupRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
547 /// let x = BackupRun::new().set_or_clear_end_time(None::<Timestamp>);
548 /// ```
549 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
550 where
551 T: std::convert::Into<wkt::Timestamp>,
552 {
553 self.end_time = v.map(|x| x.into());
554 self
555 }
556
557 /// Sets the value of [error][crate::model::BackupRun::error].
558 ///
559 /// # Example
560 /// ```ignore,no_run
561 /// # use google_cloud_sql_v1::model::BackupRun;
562 /// use google_cloud_sql_v1::model::OperationError;
563 /// let x = BackupRun::new().set_error(OperationError::default()/* use setters */);
564 /// ```
565 pub fn set_error<T>(mut self, v: T) -> Self
566 where
567 T: std::convert::Into<crate::model::OperationError>,
568 {
569 self.error = std::option::Option::Some(v.into());
570 self
571 }
572
573 /// Sets or clears the value of [error][crate::model::BackupRun::error].
574 ///
575 /// # Example
576 /// ```ignore,no_run
577 /// # use google_cloud_sql_v1::model::BackupRun;
578 /// use google_cloud_sql_v1::model::OperationError;
579 /// let x = BackupRun::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
580 /// let x = BackupRun::new().set_or_clear_error(None::<OperationError>);
581 /// ```
582 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
583 where
584 T: std::convert::Into<crate::model::OperationError>,
585 {
586 self.error = v.map(|x| x.into());
587 self
588 }
589
590 /// Sets the value of [r#type][crate::model::BackupRun::type].
591 ///
592 /// # Example
593 /// ```ignore,no_run
594 /// # use google_cloud_sql_v1::model::BackupRun;
595 /// use google_cloud_sql_v1::model::SqlBackupRunType;
596 /// let x0 = BackupRun::new().set_type(SqlBackupRunType::Automated);
597 /// let x1 = BackupRun::new().set_type(SqlBackupRunType::OnDemand);
598 /// ```
599 pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
600 self.r#type = v.into();
601 self
602 }
603
604 /// Sets the value of [description][crate::model::BackupRun::description].
605 ///
606 /// # Example
607 /// ```ignore,no_run
608 /// # use google_cloud_sql_v1::model::BackupRun;
609 /// let x = BackupRun::new().set_description("example");
610 /// ```
611 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
612 self.description = v.into();
613 self
614 }
615
616 /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
617 ///
618 /// # Example
619 /// ```ignore,no_run
620 /// # use google_cloud_sql_v1::model::BackupRun;
621 /// use wkt::Timestamp;
622 /// let x = BackupRun::new().set_window_start_time(Timestamp::default()/* use setters */);
623 /// ```
624 pub fn set_window_start_time<T>(mut self, v: T) -> Self
625 where
626 T: std::convert::Into<wkt::Timestamp>,
627 {
628 self.window_start_time = std::option::Option::Some(v.into());
629 self
630 }
631
632 /// Sets or clears the value of [window_start_time][crate::model::BackupRun::window_start_time].
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_sql_v1::model::BackupRun;
637 /// use wkt::Timestamp;
638 /// let x = BackupRun::new().set_or_clear_window_start_time(Some(Timestamp::default()/* use setters */));
639 /// let x = BackupRun::new().set_or_clear_window_start_time(None::<Timestamp>);
640 /// ```
641 pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
642 where
643 T: std::convert::Into<wkt::Timestamp>,
644 {
645 self.window_start_time = v.map(|x| x.into());
646 self
647 }
648
649 /// Sets the value of [instance][crate::model::BackupRun::instance].
650 ///
651 /// # Example
652 /// ```ignore,no_run
653 /// # use google_cloud_sql_v1::model::BackupRun;
654 /// let x = BackupRun::new().set_instance("example");
655 /// ```
656 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
657 self.instance = v.into();
658 self
659 }
660
661 /// Sets the value of [self_link][crate::model::BackupRun::self_link].
662 ///
663 /// # Example
664 /// ```ignore,no_run
665 /// # use google_cloud_sql_v1::model::BackupRun;
666 /// let x = BackupRun::new().set_self_link("example");
667 /// ```
668 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
669 self.self_link = v.into();
670 self
671 }
672
673 /// Sets the value of [location][crate::model::BackupRun::location].
674 ///
675 /// # Example
676 /// ```ignore,no_run
677 /// # use google_cloud_sql_v1::model::BackupRun;
678 /// let x = BackupRun::new().set_location("example");
679 /// ```
680 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
681 self.location = v.into();
682 self
683 }
684
685 /// Sets the value of [database_version][crate::model::BackupRun::database_version].
686 ///
687 /// # Example
688 /// ```ignore,no_run
689 /// # use google_cloud_sql_v1::model::BackupRun;
690 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
691 /// let x0 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql56);
692 /// let x1 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql57);
693 /// let x2 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql80);
694 /// ```
695 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
696 mut self,
697 v: T,
698 ) -> Self {
699 self.database_version = v.into();
700 self
701 }
702
703 /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
704 ///
705 /// # Example
706 /// ```ignore,no_run
707 /// # use google_cloud_sql_v1::model::BackupRun;
708 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
709 /// let x = BackupRun::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
710 /// ```
711 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
712 where
713 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
714 {
715 self.disk_encryption_configuration = std::option::Option::Some(v.into());
716 self
717 }
718
719 /// Sets or clears the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
720 ///
721 /// # Example
722 /// ```ignore,no_run
723 /// # use google_cloud_sql_v1::model::BackupRun;
724 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
725 /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
726 /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
727 /// ```
728 pub fn set_or_clear_disk_encryption_configuration<T>(
729 mut self,
730 v: std::option::Option<T>,
731 ) -> Self
732 where
733 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
734 {
735 self.disk_encryption_configuration = v.map(|x| x.into());
736 self
737 }
738
739 /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
740 ///
741 /// # Example
742 /// ```ignore,no_run
743 /// # use google_cloud_sql_v1::model::BackupRun;
744 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
745 /// let x = BackupRun::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
746 /// ```
747 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
748 where
749 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
750 {
751 self.disk_encryption_status = std::option::Option::Some(v.into());
752 self
753 }
754
755 /// Sets or clears the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
756 ///
757 /// # Example
758 /// ```ignore,no_run
759 /// # use google_cloud_sql_v1::model::BackupRun;
760 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
761 /// let x = BackupRun::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
762 /// let x = BackupRun::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
763 /// ```
764 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
765 where
766 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
767 {
768 self.disk_encryption_status = v.map(|x| x.into());
769 self
770 }
771
772 /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
773 ///
774 /// # Example
775 /// ```ignore,no_run
776 /// # use google_cloud_sql_v1::model::BackupRun;
777 /// use google_cloud_sql_v1::model::SqlBackupKind;
778 /// let x0 = BackupRun::new().set_backup_kind(SqlBackupKind::Snapshot);
779 /// let x1 = BackupRun::new().set_backup_kind(SqlBackupKind::Physical);
780 /// ```
781 pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
782 mut self,
783 v: T,
784 ) -> Self {
785 self.backup_kind = v.into();
786 self
787 }
788
789 /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
790 ///
791 /// # Example
792 /// ```ignore,no_run
793 /// # use google_cloud_sql_v1::model::BackupRun;
794 /// let x = BackupRun::new().set_time_zone("example");
795 /// ```
796 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
797 self.time_zone = v.into();
798 self
799 }
800
801 /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
802 ///
803 /// # Example
804 /// ```ignore,no_run
805 /// # use google_cloud_sql_v1::model::BackupRun;
806 /// let x = BackupRun::new().set_max_chargeable_bytes(42);
807 /// ```
808 pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
809 where
810 T: std::convert::Into<i64>,
811 {
812 self.max_chargeable_bytes = std::option::Option::Some(v.into());
813 self
814 }
815
816 /// Sets or clears the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
817 ///
818 /// # Example
819 /// ```ignore,no_run
820 /// # use google_cloud_sql_v1::model::BackupRun;
821 /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(Some(42));
822 /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(None::<i32>);
823 /// ```
824 pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
825 where
826 T: std::convert::Into<i64>,
827 {
828 self.max_chargeable_bytes = v.map(|x| x.into());
829 self
830 }
831}
832
833impl wkt::message::Message for BackupRun {
834 fn typename() -> &'static str {
835 "type.googleapis.com/google.cloud.sql.v1.BackupRun"
836 }
837}
838
839/// Backup run list results.
840#[derive(Clone, Default, PartialEq)]
841#[non_exhaustive]
842pub struct BackupRunsListResponse {
843 /// This is always `sql#backupRunsList`.
844 pub kind: std::string::String,
845
846 /// A list of backup runs in reverse chronological order of the enqueued time.
847 pub items: std::vec::Vec<crate::model::BackupRun>,
848
849 /// The continuation token, used to page through large result sets. Provide
850 /// this value in a subsequent request to return the next page of results.
851 pub next_page_token: std::string::String,
852
853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
854}
855
856impl BackupRunsListResponse {
857 pub fn new() -> Self {
858 std::default::Default::default()
859 }
860
861 /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
862 ///
863 /// # Example
864 /// ```ignore,no_run
865 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
866 /// let x = BackupRunsListResponse::new().set_kind("example");
867 /// ```
868 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
869 self.kind = v.into();
870 self
871 }
872
873 /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
874 ///
875 /// # Example
876 /// ```ignore,no_run
877 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
878 /// use google_cloud_sql_v1::model::BackupRun;
879 /// let x = BackupRunsListResponse::new()
880 /// .set_items([
881 /// BackupRun::default()/* use setters */,
882 /// BackupRun::default()/* use (different) setters */,
883 /// ]);
884 /// ```
885 pub fn set_items<T, V>(mut self, v: T) -> Self
886 where
887 T: std::iter::IntoIterator<Item = V>,
888 V: std::convert::Into<crate::model::BackupRun>,
889 {
890 use std::iter::Iterator;
891 self.items = v.into_iter().map(|i| i.into()).collect();
892 self
893 }
894
895 /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
896 ///
897 /// # Example
898 /// ```ignore,no_run
899 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
900 /// let x = BackupRunsListResponse::new().set_next_page_token("example");
901 /// ```
902 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
903 self.next_page_token = v.into();
904 self
905 }
906}
907
908impl wkt::message::Message for BackupRunsListResponse {
909 fn typename() -> &'static str {
910 "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
911 }
912}
913
914#[doc(hidden)]
915impl google_cloud_gax::paginator::internal::PageableResponse for BackupRunsListResponse {
916 type PageItem = crate::model::BackupRun;
917
918 fn items(self) -> std::vec::Vec<Self::PageItem> {
919 self.items
920 }
921
922 fn next_page_token(&self) -> std::string::String {
923 use std::clone::Clone;
924 self.next_page_token.clone()
925 }
926}
927
928/// The request payload to create the backup
929#[derive(Clone, Default, PartialEq)]
930#[non_exhaustive]
931pub struct CreateBackupRequest {
932 /// Required. The parent resource where this backup is created.
933 /// Format: projects/{project}
934 pub parent: std::string::String,
935
936 /// Required. The Backup to create.
937 pub backup: std::option::Option<crate::model::Backup>,
938
939 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
940}
941
942impl CreateBackupRequest {
943 pub fn new() -> Self {
944 std::default::Default::default()
945 }
946
947 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
948 ///
949 /// # Example
950 /// ```ignore,no_run
951 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
952 /// let x = CreateBackupRequest::new().set_parent("example");
953 /// ```
954 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
955 self.parent = v.into();
956 self
957 }
958
959 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
960 ///
961 /// # Example
962 /// ```ignore,no_run
963 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
964 /// use google_cloud_sql_v1::model::Backup;
965 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
966 /// ```
967 pub fn set_backup<T>(mut self, v: T) -> Self
968 where
969 T: std::convert::Into<crate::model::Backup>,
970 {
971 self.backup = std::option::Option::Some(v.into());
972 self
973 }
974
975 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
976 ///
977 /// # Example
978 /// ```ignore,no_run
979 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
980 /// use google_cloud_sql_v1::model::Backup;
981 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
982 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
983 /// ```
984 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
985 where
986 T: std::convert::Into<crate::model::Backup>,
987 {
988 self.backup = v.map(|x| x.into());
989 self
990 }
991}
992
993impl wkt::message::Message for CreateBackupRequest {
994 fn typename() -> &'static str {
995 "type.googleapis.com/google.cloud.sql.v1.CreateBackupRequest"
996 }
997}
998
999/// The request payload to get the backup.
1000#[derive(Clone, Default, PartialEq)]
1001#[non_exhaustive]
1002pub struct GetBackupRequest {
1003 /// Required. The name of the backup to retrieve.
1004 /// Format: projects/{project}/backups/{backup}
1005 pub name: std::string::String,
1006
1007 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1008}
1009
1010impl GetBackupRequest {
1011 pub fn new() -> Self {
1012 std::default::Default::default()
1013 }
1014
1015 /// Sets the value of [name][crate::model::GetBackupRequest::name].
1016 ///
1017 /// # Example
1018 /// ```ignore,no_run
1019 /// # use google_cloud_sql_v1::model::GetBackupRequest;
1020 /// let x = GetBackupRequest::new().set_name("example");
1021 /// ```
1022 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1023 self.name = v.into();
1024 self
1025 }
1026}
1027
1028impl wkt::message::Message for GetBackupRequest {
1029 fn typename() -> &'static str {
1030 "type.googleapis.com/google.cloud.sql.v1.GetBackupRequest"
1031 }
1032}
1033
1034/// The request payload to list the backups.
1035#[derive(Clone, Default, PartialEq)]
1036#[non_exhaustive]
1037pub struct ListBackupsRequest {
1038 /// Required. The parent that owns this collection of backups.
1039 /// Format: projects/{project}
1040 pub parent: std::string::String,
1041
1042 /// The maximum number of backups to return per response. The service might
1043 /// return fewer backups than this value. If a value for this parameter isn't
1044 /// specified, then, at most, 500 backups are returned. The maximum value is
1045 /// 2,000. Any values that you set, which are greater than 2,000, are changed
1046 /// to 2,000.
1047 pub page_size: i32,
1048
1049 /// A page token, received from a previous `ListBackups` call.
1050 /// Provide this to retrieve the subsequent page.
1051 ///
1052 /// When paginating, all other parameters provided to `ListBackups` must match
1053 /// the call that provided the page token.
1054 pub page_token: std::string::String,
1055
1056 /// Multiple filter queries are separated by spaces. For example,
1057 /// 'instance:abc AND type:FINAL, 'location:us',
1058 /// 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
1059 /// type, instance, backupInterval.startTime (creation time), or location.
1060 pub filter: std::string::String,
1061
1062 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1063}
1064
1065impl ListBackupsRequest {
1066 pub fn new() -> Self {
1067 std::default::Default::default()
1068 }
1069
1070 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1071 ///
1072 /// # Example
1073 /// ```ignore,no_run
1074 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1075 /// let x = ListBackupsRequest::new().set_parent("example");
1076 /// ```
1077 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1078 self.parent = v.into();
1079 self
1080 }
1081
1082 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1083 ///
1084 /// # Example
1085 /// ```ignore,no_run
1086 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1087 /// let x = ListBackupsRequest::new().set_page_size(42);
1088 /// ```
1089 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1090 self.page_size = v.into();
1091 self
1092 }
1093
1094 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1095 ///
1096 /// # Example
1097 /// ```ignore,no_run
1098 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1099 /// let x = ListBackupsRequest::new().set_page_token("example");
1100 /// ```
1101 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1102 self.page_token = v.into();
1103 self
1104 }
1105
1106 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1107 ///
1108 /// # Example
1109 /// ```ignore,no_run
1110 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1111 /// let x = ListBackupsRequest::new().set_filter("example");
1112 /// ```
1113 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1114 self.filter = v.into();
1115 self
1116 }
1117}
1118
1119impl wkt::message::Message for ListBackupsRequest {
1120 fn typename() -> &'static str {
1121 "type.googleapis.com/google.cloud.sql.v1.ListBackupsRequest"
1122 }
1123}
1124
1125/// The response payload containing a list of the backups.
1126#[derive(Clone, Default, PartialEq)]
1127#[non_exhaustive]
1128pub struct ListBackupsResponse {
1129 /// A list of backups.
1130 pub backups: std::vec::Vec<crate::model::Backup>,
1131
1132 /// A token, which can be sent as `page_token` to retrieve the next page.
1133 /// If this field is omitted, then there aren't subsequent pages.
1134 pub next_page_token: std::string::String,
1135
1136 /// If a region isn't unavailable or if an unknown error occurs, then a warning
1137 /// message is returned.
1138 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
1139
1140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1141}
1142
1143impl ListBackupsResponse {
1144 pub fn new() -> Self {
1145 std::default::Default::default()
1146 }
1147
1148 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1149 ///
1150 /// # Example
1151 /// ```ignore,no_run
1152 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1153 /// use google_cloud_sql_v1::model::Backup;
1154 /// let x = ListBackupsResponse::new()
1155 /// .set_backups([
1156 /// Backup::default()/* use setters */,
1157 /// Backup::default()/* use (different) setters */,
1158 /// ]);
1159 /// ```
1160 pub fn set_backups<T, V>(mut self, v: T) -> Self
1161 where
1162 T: std::iter::IntoIterator<Item = V>,
1163 V: std::convert::Into<crate::model::Backup>,
1164 {
1165 use std::iter::Iterator;
1166 self.backups = v.into_iter().map(|i| i.into()).collect();
1167 self
1168 }
1169
1170 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1171 ///
1172 /// # Example
1173 /// ```ignore,no_run
1174 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1175 /// let x = ListBackupsResponse::new().set_next_page_token("example");
1176 /// ```
1177 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1178 self.next_page_token = v.into();
1179 self
1180 }
1181
1182 /// Sets the value of [warnings][crate::model::ListBackupsResponse::warnings].
1183 ///
1184 /// # Example
1185 /// ```ignore,no_run
1186 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1187 /// use google_cloud_sql_v1::model::ApiWarning;
1188 /// let x = ListBackupsResponse::new()
1189 /// .set_warnings([
1190 /// ApiWarning::default()/* use setters */,
1191 /// ApiWarning::default()/* use (different) setters */,
1192 /// ]);
1193 /// ```
1194 pub fn set_warnings<T, V>(mut self, v: T) -> Self
1195 where
1196 T: std::iter::IntoIterator<Item = V>,
1197 V: std::convert::Into<crate::model::ApiWarning>,
1198 {
1199 use std::iter::Iterator;
1200 self.warnings = v.into_iter().map(|i| i.into()).collect();
1201 self
1202 }
1203}
1204
1205impl wkt::message::Message for ListBackupsResponse {
1206 fn typename() -> &'static str {
1207 "type.googleapis.com/google.cloud.sql.v1.ListBackupsResponse"
1208 }
1209}
1210
1211#[doc(hidden)]
1212impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1213 type PageItem = crate::model::Backup;
1214
1215 fn items(self) -> std::vec::Vec<Self::PageItem> {
1216 self.backups
1217 }
1218
1219 fn next_page_token(&self) -> std::string::String {
1220 use std::clone::Clone;
1221 self.next_page_token.clone()
1222 }
1223}
1224
1225/// The request payload to update the backup.
1226#[derive(Clone, Default, PartialEq)]
1227#[non_exhaustive]
1228pub struct UpdateBackupRequest {
1229 /// Required. The backup to update.
1230 /// The backup’s `name` field is used to identify the backup to update.
1231 /// Format: projects/{project}/backups/{backup}
1232 pub backup: std::option::Option<crate::model::Backup>,
1233
1234 /// The list of fields that you can update. You can update only the description
1235 /// and retention period of the final backup.
1236 pub update_mask: std::option::Option<wkt::FieldMask>,
1237
1238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1239}
1240
1241impl UpdateBackupRequest {
1242 pub fn new() -> Self {
1243 std::default::Default::default()
1244 }
1245
1246 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1247 ///
1248 /// # Example
1249 /// ```ignore,no_run
1250 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1251 /// use google_cloud_sql_v1::model::Backup;
1252 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1253 /// ```
1254 pub fn set_backup<T>(mut self, v: T) -> Self
1255 where
1256 T: std::convert::Into<crate::model::Backup>,
1257 {
1258 self.backup = std::option::Option::Some(v.into());
1259 self
1260 }
1261
1262 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
1263 ///
1264 /// # Example
1265 /// ```ignore,no_run
1266 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1267 /// use google_cloud_sql_v1::model::Backup;
1268 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
1269 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
1270 /// ```
1271 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1272 where
1273 T: std::convert::Into<crate::model::Backup>,
1274 {
1275 self.backup = v.map(|x| x.into());
1276 self
1277 }
1278
1279 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1280 ///
1281 /// # Example
1282 /// ```ignore,no_run
1283 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1284 /// use wkt::FieldMask;
1285 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1286 /// ```
1287 pub fn set_update_mask<T>(mut self, v: T) -> Self
1288 where
1289 T: std::convert::Into<wkt::FieldMask>,
1290 {
1291 self.update_mask = std::option::Option::Some(v.into());
1292 self
1293 }
1294
1295 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1296 ///
1297 /// # Example
1298 /// ```ignore,no_run
1299 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1300 /// use wkt::FieldMask;
1301 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1302 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1303 /// ```
1304 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1305 where
1306 T: std::convert::Into<wkt::FieldMask>,
1307 {
1308 self.update_mask = v.map(|x| x.into());
1309 self
1310 }
1311}
1312
1313impl wkt::message::Message for UpdateBackupRequest {
1314 fn typename() -> &'static str {
1315 "type.googleapis.com/google.cloud.sql.v1.UpdateBackupRequest"
1316 }
1317}
1318
1319/// The request payload to delete the backup.
1320#[derive(Clone, Default, PartialEq)]
1321#[non_exhaustive]
1322pub struct DeleteBackupRequest {
1323 /// Required. The name of the backup to delete.
1324 /// Format: projects/{project}/backups/{backup}
1325 pub name: std::string::String,
1326
1327 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1328}
1329
1330impl DeleteBackupRequest {
1331 pub fn new() -> Self {
1332 std::default::Default::default()
1333 }
1334
1335 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1336 ///
1337 /// # Example
1338 /// ```ignore,no_run
1339 /// # use google_cloud_sql_v1::model::DeleteBackupRequest;
1340 /// let x = DeleteBackupRequest::new().set_name("example");
1341 /// ```
1342 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1343 self.name = v.into();
1344 self
1345 }
1346}
1347
1348impl wkt::message::Message for DeleteBackupRequest {
1349 fn typename() -> &'static str {
1350 "type.googleapis.com/google.cloud.sql.v1.DeleteBackupRequest"
1351 }
1352}
1353
1354/// A backup resource.
1355#[derive(Clone, Default, PartialEq)]
1356#[non_exhaustive]
1357pub struct Backup {
1358 /// Output only. The resource name of the backup.
1359 /// Format: projects/{project}/backups/{backup}.
1360 pub name: std::string::String,
1361
1362 /// Output only. This is always `sql#backup`.
1363 pub kind: std::string::String,
1364
1365 /// Output only. The URI of this resource.
1366 pub self_link: std::string::String,
1367
1368 /// Output only. The type of this backup. The type can be "AUTOMATED",
1369 /// "ON_DEMAND" or “FINAL”.
1370 pub r#type: crate::model::backup::SqlBackupType,
1371
1372 /// The description of this backup.
1373 pub description: std::string::String,
1374
1375 /// The name of the source database instance.
1376 pub instance: std::string::String,
1377
1378 /// The storage location of the backups. The location can be multi-regional.
1379 pub location: std::string::String,
1380
1381 /// Output only. This output contains the following values:
1382 /// start_time: All database writes up to this time are available.
1383 /// end_time: Any database writes after this time aren't available.
1384 pub backup_interval: std::option::Option<google_cloud_type::model::Interval>,
1385
1386 /// Output only. The status of this backup.
1387 pub state: crate::model::backup::SqlBackupState,
1388
1389 /// Output only. Information about why the backup operation fails (for example,
1390 /// when the backup state fails).
1391 pub error: std::option::Option<crate::model::OperationError>,
1392
1393 /// Output only. This output contains the encryption configuration for a backup
1394 /// and the resource name of the KMS key for disk encryption.
1395 pub kms_key: std::string::String,
1396
1397 /// Output only. This output contains the encryption status for a backup and
1398 /// the version of the KMS key that's used to encrypt the Cloud SQL instance.
1399 pub kms_key_version: std::string::String,
1400
1401 /// Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
1402 pub backup_kind: crate::model::SqlBackupKind,
1403
1404 /// Output only. This output contains a backup time zone. If a Cloud SQL for
1405 /// SQL Server instance has a different time zone from the backup's time zone,
1406 /// then the restore to the instance doesn't happen.
1407 pub time_zone: std::string::String,
1408
1409 /// Output only. The database version of the instance of at the time this
1410 /// backup was made.
1411 pub database_version: crate::model::SqlDatabaseVersion,
1412
1413 /// Output only. The maximum chargeable bytes for the backup.
1414 pub max_chargeable_bytes: std::option::Option<i64>,
1415
1416 /// Optional. Output only. Timestamp in UTC of when the instance associated
1417 /// with this backup is deleted.
1418 pub instance_deletion_time: std::option::Option<wkt::Timestamp>,
1419
1420 /// Optional. Output only. The instance setting of the source instance that's
1421 /// associated with this backup.
1422 pub instance_settings: std::option::Option<crate::model::DatabaseInstance>,
1423
1424 /// Output only. The mapping to backup run resource used for IAM validations.
1425 pub backup_run: std::string::String,
1426
1427 /// Output only. This status indicates whether the backup satisfies PZS.
1428 ///
1429 /// The status is reserved for future use.
1430 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
1431
1432 /// Output only. This status indicates whether the backup satisfies PZI.
1433 ///
1434 /// The status is reserved for future use.
1435 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
1436
1437 pub expiration: std::option::Option<crate::model::backup::Expiration>,
1438
1439 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1440}
1441
1442impl Backup {
1443 pub fn new() -> Self {
1444 std::default::Default::default()
1445 }
1446
1447 /// Sets the value of [name][crate::model::Backup::name].
1448 ///
1449 /// # Example
1450 /// ```ignore,no_run
1451 /// # use google_cloud_sql_v1::model::Backup;
1452 /// let x = Backup::new().set_name("example");
1453 /// ```
1454 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1455 self.name = v.into();
1456 self
1457 }
1458
1459 /// Sets the value of [kind][crate::model::Backup::kind].
1460 ///
1461 /// # Example
1462 /// ```ignore,no_run
1463 /// # use google_cloud_sql_v1::model::Backup;
1464 /// let x = Backup::new().set_kind("example");
1465 /// ```
1466 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1467 self.kind = v.into();
1468 self
1469 }
1470
1471 /// Sets the value of [self_link][crate::model::Backup::self_link].
1472 ///
1473 /// # Example
1474 /// ```ignore,no_run
1475 /// # use google_cloud_sql_v1::model::Backup;
1476 /// let x = Backup::new().set_self_link("example");
1477 /// ```
1478 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1479 self.self_link = v.into();
1480 self
1481 }
1482
1483 /// Sets the value of [r#type][crate::model::Backup::type].
1484 ///
1485 /// # Example
1486 /// ```ignore,no_run
1487 /// # use google_cloud_sql_v1::model::Backup;
1488 /// use google_cloud_sql_v1::model::backup::SqlBackupType;
1489 /// let x0 = Backup::new().set_type(SqlBackupType::Automated);
1490 /// let x1 = Backup::new().set_type(SqlBackupType::OnDemand);
1491 /// let x2 = Backup::new().set_type(SqlBackupType::Final);
1492 /// ```
1493 pub fn set_type<T: std::convert::Into<crate::model::backup::SqlBackupType>>(
1494 mut self,
1495 v: T,
1496 ) -> Self {
1497 self.r#type = v.into();
1498 self
1499 }
1500
1501 /// Sets the value of [description][crate::model::Backup::description].
1502 ///
1503 /// # Example
1504 /// ```ignore,no_run
1505 /// # use google_cloud_sql_v1::model::Backup;
1506 /// let x = Backup::new().set_description("example");
1507 /// ```
1508 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1509 self.description = v.into();
1510 self
1511 }
1512
1513 /// Sets the value of [instance][crate::model::Backup::instance].
1514 ///
1515 /// # Example
1516 /// ```ignore,no_run
1517 /// # use google_cloud_sql_v1::model::Backup;
1518 /// let x = Backup::new().set_instance("example");
1519 /// ```
1520 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1521 self.instance = v.into();
1522 self
1523 }
1524
1525 /// Sets the value of [location][crate::model::Backup::location].
1526 ///
1527 /// # Example
1528 /// ```ignore,no_run
1529 /// # use google_cloud_sql_v1::model::Backup;
1530 /// let x = Backup::new().set_location("example");
1531 /// ```
1532 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1533 self.location = v.into();
1534 self
1535 }
1536
1537 /// Sets the value of [backup_interval][crate::model::Backup::backup_interval].
1538 ///
1539 /// # Example
1540 /// ```ignore,no_run
1541 /// # use google_cloud_sql_v1::model::Backup;
1542 /// use google_cloud_type::model::Interval;
1543 /// let x = Backup::new().set_backup_interval(Interval::default()/* use setters */);
1544 /// ```
1545 pub fn set_backup_interval<T>(mut self, v: T) -> Self
1546 where
1547 T: std::convert::Into<google_cloud_type::model::Interval>,
1548 {
1549 self.backup_interval = std::option::Option::Some(v.into());
1550 self
1551 }
1552
1553 /// Sets or clears the value of [backup_interval][crate::model::Backup::backup_interval].
1554 ///
1555 /// # Example
1556 /// ```ignore,no_run
1557 /// # use google_cloud_sql_v1::model::Backup;
1558 /// use google_cloud_type::model::Interval;
1559 /// let x = Backup::new().set_or_clear_backup_interval(Some(Interval::default()/* use setters */));
1560 /// let x = Backup::new().set_or_clear_backup_interval(None::<Interval>);
1561 /// ```
1562 pub fn set_or_clear_backup_interval<T>(mut self, v: std::option::Option<T>) -> Self
1563 where
1564 T: std::convert::Into<google_cloud_type::model::Interval>,
1565 {
1566 self.backup_interval = v.map(|x| x.into());
1567 self
1568 }
1569
1570 /// Sets the value of [state][crate::model::Backup::state].
1571 ///
1572 /// # Example
1573 /// ```ignore,no_run
1574 /// # use google_cloud_sql_v1::model::Backup;
1575 /// use google_cloud_sql_v1::model::backup::SqlBackupState;
1576 /// let x0 = Backup::new().set_state(SqlBackupState::Enqueued);
1577 /// let x1 = Backup::new().set_state(SqlBackupState::Running);
1578 /// let x2 = Backup::new().set_state(SqlBackupState::Failed);
1579 /// ```
1580 pub fn set_state<T: std::convert::Into<crate::model::backup::SqlBackupState>>(
1581 mut self,
1582 v: T,
1583 ) -> Self {
1584 self.state = v.into();
1585 self
1586 }
1587
1588 /// Sets the value of [error][crate::model::Backup::error].
1589 ///
1590 /// # Example
1591 /// ```ignore,no_run
1592 /// # use google_cloud_sql_v1::model::Backup;
1593 /// use google_cloud_sql_v1::model::OperationError;
1594 /// let x = Backup::new().set_error(OperationError::default()/* use setters */);
1595 /// ```
1596 pub fn set_error<T>(mut self, v: T) -> Self
1597 where
1598 T: std::convert::Into<crate::model::OperationError>,
1599 {
1600 self.error = std::option::Option::Some(v.into());
1601 self
1602 }
1603
1604 /// Sets or clears the value of [error][crate::model::Backup::error].
1605 ///
1606 /// # Example
1607 /// ```ignore,no_run
1608 /// # use google_cloud_sql_v1::model::Backup;
1609 /// use google_cloud_sql_v1::model::OperationError;
1610 /// let x = Backup::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
1611 /// let x = Backup::new().set_or_clear_error(None::<OperationError>);
1612 /// ```
1613 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1614 where
1615 T: std::convert::Into<crate::model::OperationError>,
1616 {
1617 self.error = v.map(|x| x.into());
1618 self
1619 }
1620
1621 /// Sets the value of [kms_key][crate::model::Backup::kms_key].
1622 ///
1623 /// # Example
1624 /// ```ignore,no_run
1625 /// # use google_cloud_sql_v1::model::Backup;
1626 /// let x = Backup::new().set_kms_key("example");
1627 /// ```
1628 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.kms_key = v.into();
1630 self
1631 }
1632
1633 /// Sets the value of [kms_key_version][crate::model::Backup::kms_key_version].
1634 ///
1635 /// # Example
1636 /// ```ignore,no_run
1637 /// # use google_cloud_sql_v1::model::Backup;
1638 /// let x = Backup::new().set_kms_key_version("example");
1639 /// ```
1640 pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.kms_key_version = v.into();
1642 self
1643 }
1644
1645 /// Sets the value of [backup_kind][crate::model::Backup::backup_kind].
1646 ///
1647 /// # Example
1648 /// ```ignore,no_run
1649 /// # use google_cloud_sql_v1::model::Backup;
1650 /// use google_cloud_sql_v1::model::SqlBackupKind;
1651 /// let x0 = Backup::new().set_backup_kind(SqlBackupKind::Snapshot);
1652 /// let x1 = Backup::new().set_backup_kind(SqlBackupKind::Physical);
1653 /// ```
1654 pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
1655 mut self,
1656 v: T,
1657 ) -> Self {
1658 self.backup_kind = v.into();
1659 self
1660 }
1661
1662 /// Sets the value of [time_zone][crate::model::Backup::time_zone].
1663 ///
1664 /// # Example
1665 /// ```ignore,no_run
1666 /// # use google_cloud_sql_v1::model::Backup;
1667 /// let x = Backup::new().set_time_zone("example");
1668 /// ```
1669 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1670 self.time_zone = v.into();
1671 self
1672 }
1673
1674 /// Sets the value of [database_version][crate::model::Backup::database_version].
1675 ///
1676 /// # Example
1677 /// ```ignore,no_run
1678 /// # use google_cloud_sql_v1::model::Backup;
1679 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
1680 /// let x0 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql56);
1681 /// let x1 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql57);
1682 /// let x2 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql80);
1683 /// ```
1684 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
1685 mut self,
1686 v: T,
1687 ) -> Self {
1688 self.database_version = v.into();
1689 self
1690 }
1691
1692 /// Sets the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1693 ///
1694 /// # Example
1695 /// ```ignore,no_run
1696 /// # use google_cloud_sql_v1::model::Backup;
1697 /// let x = Backup::new().set_max_chargeable_bytes(42);
1698 /// ```
1699 pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
1700 where
1701 T: std::convert::Into<i64>,
1702 {
1703 self.max_chargeable_bytes = std::option::Option::Some(v.into());
1704 self
1705 }
1706
1707 /// Sets or clears the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1708 ///
1709 /// # Example
1710 /// ```ignore,no_run
1711 /// # use google_cloud_sql_v1::model::Backup;
1712 /// let x = Backup::new().set_or_clear_max_chargeable_bytes(Some(42));
1713 /// let x = Backup::new().set_or_clear_max_chargeable_bytes(None::<i32>);
1714 /// ```
1715 pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
1716 where
1717 T: std::convert::Into<i64>,
1718 {
1719 self.max_chargeable_bytes = v.map(|x| x.into());
1720 self
1721 }
1722
1723 /// Sets the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1724 ///
1725 /// # Example
1726 /// ```ignore,no_run
1727 /// # use google_cloud_sql_v1::model::Backup;
1728 /// use wkt::Timestamp;
1729 /// let x = Backup::new().set_instance_deletion_time(Timestamp::default()/* use setters */);
1730 /// ```
1731 pub fn set_instance_deletion_time<T>(mut self, v: T) -> Self
1732 where
1733 T: std::convert::Into<wkt::Timestamp>,
1734 {
1735 self.instance_deletion_time = std::option::Option::Some(v.into());
1736 self
1737 }
1738
1739 /// Sets or clears the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1740 ///
1741 /// # Example
1742 /// ```ignore,no_run
1743 /// # use google_cloud_sql_v1::model::Backup;
1744 /// use wkt::Timestamp;
1745 /// let x = Backup::new().set_or_clear_instance_deletion_time(Some(Timestamp::default()/* use setters */));
1746 /// let x = Backup::new().set_or_clear_instance_deletion_time(None::<Timestamp>);
1747 /// ```
1748 pub fn set_or_clear_instance_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
1749 where
1750 T: std::convert::Into<wkt::Timestamp>,
1751 {
1752 self.instance_deletion_time = v.map(|x| x.into());
1753 self
1754 }
1755
1756 /// Sets the value of [instance_settings][crate::model::Backup::instance_settings].
1757 ///
1758 /// # Example
1759 /// ```ignore,no_run
1760 /// # use google_cloud_sql_v1::model::Backup;
1761 /// use google_cloud_sql_v1::model::DatabaseInstance;
1762 /// let x = Backup::new().set_instance_settings(DatabaseInstance::default()/* use setters */);
1763 /// ```
1764 pub fn set_instance_settings<T>(mut self, v: T) -> Self
1765 where
1766 T: std::convert::Into<crate::model::DatabaseInstance>,
1767 {
1768 self.instance_settings = std::option::Option::Some(v.into());
1769 self
1770 }
1771
1772 /// Sets or clears the value of [instance_settings][crate::model::Backup::instance_settings].
1773 ///
1774 /// # Example
1775 /// ```ignore,no_run
1776 /// # use google_cloud_sql_v1::model::Backup;
1777 /// use google_cloud_sql_v1::model::DatabaseInstance;
1778 /// let x = Backup::new().set_or_clear_instance_settings(Some(DatabaseInstance::default()/* use setters */));
1779 /// let x = Backup::new().set_or_clear_instance_settings(None::<DatabaseInstance>);
1780 /// ```
1781 pub fn set_or_clear_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
1782 where
1783 T: std::convert::Into<crate::model::DatabaseInstance>,
1784 {
1785 self.instance_settings = v.map(|x| x.into());
1786 self
1787 }
1788
1789 /// Sets the value of [backup_run][crate::model::Backup::backup_run].
1790 ///
1791 /// # Example
1792 /// ```ignore,no_run
1793 /// # use google_cloud_sql_v1::model::Backup;
1794 /// let x = Backup::new().set_backup_run("example");
1795 /// ```
1796 pub fn set_backup_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1797 self.backup_run = v.into();
1798 self
1799 }
1800
1801 /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1802 ///
1803 /// # Example
1804 /// ```ignore,no_run
1805 /// # use google_cloud_sql_v1::model::Backup;
1806 /// use wkt::BoolValue;
1807 /// let x = Backup::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
1808 /// ```
1809 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
1810 where
1811 T: std::convert::Into<wkt::BoolValue>,
1812 {
1813 self.satisfies_pzs = std::option::Option::Some(v.into());
1814 self
1815 }
1816
1817 /// Sets or clears the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1818 ///
1819 /// # Example
1820 /// ```ignore,no_run
1821 /// # use google_cloud_sql_v1::model::Backup;
1822 /// use wkt::BoolValue;
1823 /// let x = Backup::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
1824 /// let x = Backup::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
1825 /// ```
1826 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
1827 where
1828 T: std::convert::Into<wkt::BoolValue>,
1829 {
1830 self.satisfies_pzs = v.map(|x| x.into());
1831 self
1832 }
1833
1834 /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1835 ///
1836 /// # Example
1837 /// ```ignore,no_run
1838 /// # use google_cloud_sql_v1::model::Backup;
1839 /// use wkt::BoolValue;
1840 /// let x = Backup::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
1841 /// ```
1842 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
1843 where
1844 T: std::convert::Into<wkt::BoolValue>,
1845 {
1846 self.satisfies_pzi = std::option::Option::Some(v.into());
1847 self
1848 }
1849
1850 /// Sets or clears the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1851 ///
1852 /// # Example
1853 /// ```ignore,no_run
1854 /// # use google_cloud_sql_v1::model::Backup;
1855 /// use wkt::BoolValue;
1856 /// let x = Backup::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
1857 /// let x = Backup::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
1858 /// ```
1859 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
1860 where
1861 T: std::convert::Into<wkt::BoolValue>,
1862 {
1863 self.satisfies_pzi = v.map(|x| x.into());
1864 self
1865 }
1866
1867 /// Sets the value of [expiration][crate::model::Backup::expiration].
1868 ///
1869 /// Note that all the setters affecting `expiration` are mutually
1870 /// exclusive.
1871 ///
1872 /// # Example
1873 /// ```ignore,no_run
1874 /// # use google_cloud_sql_v1::model::Backup;
1875 /// use google_cloud_sql_v1::model::backup::Expiration;
1876 /// let x = Backup::new().set_expiration(Some(Expiration::TtlDays(42)));
1877 /// ```
1878 pub fn set_expiration<
1879 T: std::convert::Into<std::option::Option<crate::model::backup::Expiration>>,
1880 >(
1881 mut self,
1882 v: T,
1883 ) -> Self {
1884 self.expiration = v.into();
1885 self
1886 }
1887
1888 /// The value of [expiration][crate::model::Backup::expiration]
1889 /// if it holds a `TtlDays`, `None` if the field is not set or
1890 /// holds a different branch.
1891 pub fn ttl_days(&self) -> std::option::Option<&i64> {
1892 #[allow(unreachable_patterns)]
1893 self.expiration.as_ref().and_then(|v| match v {
1894 crate::model::backup::Expiration::TtlDays(v) => std::option::Option::Some(v),
1895 _ => std::option::Option::None,
1896 })
1897 }
1898
1899 /// Sets the value of [expiration][crate::model::Backup::expiration]
1900 /// to hold a `TtlDays`.
1901 ///
1902 /// Note that all the setters affecting `expiration` are
1903 /// mutually exclusive.
1904 ///
1905 /// # Example
1906 /// ```ignore,no_run
1907 /// # use google_cloud_sql_v1::model::Backup;
1908 /// let x = Backup::new().set_ttl_days(42);
1909 /// assert!(x.ttl_days().is_some());
1910 /// assert!(x.expiry_time().is_none());
1911 /// ```
1912 pub fn set_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1913 self.expiration =
1914 std::option::Option::Some(crate::model::backup::Expiration::TtlDays(v.into()));
1915 self
1916 }
1917
1918 /// The value of [expiration][crate::model::Backup::expiration]
1919 /// if it holds a `ExpiryTime`, `None` if the field is not set or
1920 /// holds a different branch.
1921 pub fn expiry_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1922 #[allow(unreachable_patterns)]
1923 self.expiration.as_ref().and_then(|v| match v {
1924 crate::model::backup::Expiration::ExpiryTime(v) => std::option::Option::Some(v),
1925 _ => std::option::Option::None,
1926 })
1927 }
1928
1929 /// Sets the value of [expiration][crate::model::Backup::expiration]
1930 /// to hold a `ExpiryTime`.
1931 ///
1932 /// Note that all the setters affecting `expiration` are
1933 /// mutually exclusive.
1934 ///
1935 /// # Example
1936 /// ```ignore,no_run
1937 /// # use google_cloud_sql_v1::model::Backup;
1938 /// use wkt::Timestamp;
1939 /// let x = Backup::new().set_expiry_time(Timestamp::default()/* use setters */);
1940 /// assert!(x.expiry_time().is_some());
1941 /// assert!(x.ttl_days().is_none());
1942 /// ```
1943 pub fn set_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1944 mut self,
1945 v: T,
1946 ) -> Self {
1947 self.expiration =
1948 std::option::Option::Some(crate::model::backup::Expiration::ExpiryTime(v.into()));
1949 self
1950 }
1951}
1952
1953impl wkt::message::Message for Backup {
1954 fn typename() -> &'static str {
1955 "type.googleapis.com/google.cloud.sql.v1.Backup"
1956 }
1957}
1958
1959/// Defines additional types related to [Backup].
1960pub mod backup {
1961 #[allow(unused_imports)]
1962 use super::*;
1963
1964 /// The backup type.
1965 ///
1966 /// # Working with unknown values
1967 ///
1968 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1969 /// additional enum variants at any time. Adding new variants is not considered
1970 /// a breaking change. Applications should write their code in anticipation of:
1971 ///
1972 /// - New values appearing in future releases of the client library, **and**
1973 /// - New values received dynamically, without application changes.
1974 ///
1975 /// Please consult the [Working with enums] section in the user guide for some
1976 /// guidelines.
1977 ///
1978 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1979 #[derive(Clone, Debug, PartialEq)]
1980 #[non_exhaustive]
1981 pub enum SqlBackupType {
1982 /// This is an unknown backup type.
1983 Unspecified,
1984 /// The backup schedule triggers a backup automatically.
1985 Automated,
1986 /// The user triggers a backup manually.
1987 OnDemand,
1988 /// The backup created when instance is deleted.
1989 Final,
1990 /// If set, the enum was initialized with an unknown value.
1991 ///
1992 /// Applications can examine the value using [SqlBackupType::value] or
1993 /// [SqlBackupType::name].
1994 UnknownValue(sql_backup_type::UnknownValue),
1995 }
1996
1997 #[doc(hidden)]
1998 pub mod sql_backup_type {
1999 #[allow(unused_imports)]
2000 use super::*;
2001 #[derive(Clone, Debug, PartialEq)]
2002 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2003 }
2004
2005 impl SqlBackupType {
2006 /// Gets the enum value.
2007 ///
2008 /// Returns `None` if the enum contains an unknown value deserialized from
2009 /// the string representation of enums.
2010 pub fn value(&self) -> std::option::Option<i32> {
2011 match self {
2012 Self::Unspecified => std::option::Option::Some(0),
2013 Self::Automated => std::option::Option::Some(1),
2014 Self::OnDemand => std::option::Option::Some(2),
2015 Self::Final => std::option::Option::Some(3),
2016 Self::UnknownValue(u) => u.0.value(),
2017 }
2018 }
2019
2020 /// Gets the enum value as a string.
2021 ///
2022 /// Returns `None` if the enum contains an unknown value deserialized from
2023 /// the integer representation of enums.
2024 pub fn name(&self) -> std::option::Option<&str> {
2025 match self {
2026 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_TYPE_UNSPECIFIED"),
2027 Self::Automated => std::option::Option::Some("AUTOMATED"),
2028 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
2029 Self::Final => std::option::Option::Some("FINAL"),
2030 Self::UnknownValue(u) => u.0.name(),
2031 }
2032 }
2033 }
2034
2035 impl std::default::Default for SqlBackupType {
2036 fn default() -> Self {
2037 use std::convert::From;
2038 Self::from(0)
2039 }
2040 }
2041
2042 impl std::fmt::Display for SqlBackupType {
2043 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2044 wkt::internal::display_enum(f, self.name(), self.value())
2045 }
2046 }
2047
2048 impl std::convert::From<i32> for SqlBackupType {
2049 fn from(value: i32) -> Self {
2050 match value {
2051 0 => Self::Unspecified,
2052 1 => Self::Automated,
2053 2 => Self::OnDemand,
2054 3 => Self::Final,
2055 _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2056 wkt::internal::UnknownEnumValue::Integer(value),
2057 )),
2058 }
2059 }
2060 }
2061
2062 impl std::convert::From<&str> for SqlBackupType {
2063 fn from(value: &str) -> Self {
2064 use std::string::ToString;
2065 match value {
2066 "SQL_BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
2067 "AUTOMATED" => Self::Automated,
2068 "ON_DEMAND" => Self::OnDemand,
2069 "FINAL" => Self::Final,
2070 _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2071 wkt::internal::UnknownEnumValue::String(value.to_string()),
2072 )),
2073 }
2074 }
2075 }
2076
2077 impl serde::ser::Serialize for SqlBackupType {
2078 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2079 where
2080 S: serde::Serializer,
2081 {
2082 match self {
2083 Self::Unspecified => serializer.serialize_i32(0),
2084 Self::Automated => serializer.serialize_i32(1),
2085 Self::OnDemand => serializer.serialize_i32(2),
2086 Self::Final => serializer.serialize_i32(3),
2087 Self::UnknownValue(u) => u.0.serialize(serializer),
2088 }
2089 }
2090 }
2091
2092 impl<'de> serde::de::Deserialize<'de> for SqlBackupType {
2093 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2094 where
2095 D: serde::Deserializer<'de>,
2096 {
2097 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupType>::new(
2098 ".google.cloud.sql.v1.Backup.SqlBackupType",
2099 ))
2100 }
2101 }
2102
2103 /// The backup's state
2104 ///
2105 /// # Working with unknown values
2106 ///
2107 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2108 /// additional enum variants at any time. Adding new variants is not considered
2109 /// a breaking change. Applications should write their code in anticipation of:
2110 ///
2111 /// - New values appearing in future releases of the client library, **and**
2112 /// - New values received dynamically, without application changes.
2113 ///
2114 /// Please consult the [Working with enums] section in the user guide for some
2115 /// guidelines.
2116 ///
2117 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2118 #[derive(Clone, Debug, PartialEq)]
2119 #[non_exhaustive]
2120 pub enum SqlBackupState {
2121 /// The state of the backup is unknown.
2122 Unspecified,
2123 /// The backup that's added to a queue.
2124 Enqueued,
2125 /// The backup is in progress.
2126 Running,
2127 /// The backup failed.
2128 Failed,
2129 /// The backup is successful.
2130 Successful,
2131 /// The backup is being deleted.
2132 Deleting,
2133 /// Deletion of the backup failed.
2134 DeletionFailed,
2135 /// If set, the enum was initialized with an unknown value.
2136 ///
2137 /// Applications can examine the value using [SqlBackupState::value] or
2138 /// [SqlBackupState::name].
2139 UnknownValue(sql_backup_state::UnknownValue),
2140 }
2141
2142 #[doc(hidden)]
2143 pub mod sql_backup_state {
2144 #[allow(unused_imports)]
2145 use super::*;
2146 #[derive(Clone, Debug, PartialEq)]
2147 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2148 }
2149
2150 impl SqlBackupState {
2151 /// Gets the enum value.
2152 ///
2153 /// Returns `None` if the enum contains an unknown value deserialized from
2154 /// the string representation of enums.
2155 pub fn value(&self) -> std::option::Option<i32> {
2156 match self {
2157 Self::Unspecified => std::option::Option::Some(0),
2158 Self::Enqueued => std::option::Option::Some(1),
2159 Self::Running => std::option::Option::Some(2),
2160 Self::Failed => std::option::Option::Some(3),
2161 Self::Successful => std::option::Option::Some(4),
2162 Self::Deleting => std::option::Option::Some(5),
2163 Self::DeletionFailed => std::option::Option::Some(6),
2164 Self::UnknownValue(u) => u.0.value(),
2165 }
2166 }
2167
2168 /// Gets the enum value as a string.
2169 ///
2170 /// Returns `None` if the enum contains an unknown value deserialized from
2171 /// the integer representation of enums.
2172 pub fn name(&self) -> std::option::Option<&str> {
2173 match self {
2174 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_STATE_UNSPECIFIED"),
2175 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
2176 Self::Running => std::option::Option::Some("RUNNING"),
2177 Self::Failed => std::option::Option::Some("FAILED"),
2178 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
2179 Self::Deleting => std::option::Option::Some("DELETING"),
2180 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
2181 Self::UnknownValue(u) => u.0.name(),
2182 }
2183 }
2184 }
2185
2186 impl std::default::Default for SqlBackupState {
2187 fn default() -> Self {
2188 use std::convert::From;
2189 Self::from(0)
2190 }
2191 }
2192
2193 impl std::fmt::Display for SqlBackupState {
2194 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2195 wkt::internal::display_enum(f, self.name(), self.value())
2196 }
2197 }
2198
2199 impl std::convert::From<i32> for SqlBackupState {
2200 fn from(value: i32) -> Self {
2201 match value {
2202 0 => Self::Unspecified,
2203 1 => Self::Enqueued,
2204 2 => Self::Running,
2205 3 => Self::Failed,
2206 4 => Self::Successful,
2207 5 => Self::Deleting,
2208 6 => Self::DeletionFailed,
2209 _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2210 wkt::internal::UnknownEnumValue::Integer(value),
2211 )),
2212 }
2213 }
2214 }
2215
2216 impl std::convert::From<&str> for SqlBackupState {
2217 fn from(value: &str) -> Self {
2218 use std::string::ToString;
2219 match value {
2220 "SQL_BACKUP_STATE_UNSPECIFIED" => Self::Unspecified,
2221 "ENQUEUED" => Self::Enqueued,
2222 "RUNNING" => Self::Running,
2223 "FAILED" => Self::Failed,
2224 "SUCCESSFUL" => Self::Successful,
2225 "DELETING" => Self::Deleting,
2226 "DELETION_FAILED" => Self::DeletionFailed,
2227 _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2228 wkt::internal::UnknownEnumValue::String(value.to_string()),
2229 )),
2230 }
2231 }
2232 }
2233
2234 impl serde::ser::Serialize for SqlBackupState {
2235 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2236 where
2237 S: serde::Serializer,
2238 {
2239 match self {
2240 Self::Unspecified => serializer.serialize_i32(0),
2241 Self::Enqueued => serializer.serialize_i32(1),
2242 Self::Running => serializer.serialize_i32(2),
2243 Self::Failed => serializer.serialize_i32(3),
2244 Self::Successful => serializer.serialize_i32(4),
2245 Self::Deleting => serializer.serialize_i32(5),
2246 Self::DeletionFailed => serializer.serialize_i32(6),
2247 Self::UnknownValue(u) => u.0.serialize(serializer),
2248 }
2249 }
2250 }
2251
2252 impl<'de> serde::de::Deserialize<'de> for SqlBackupState {
2253 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2254 where
2255 D: serde::Deserializer<'de>,
2256 {
2257 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupState>::new(
2258 ".google.cloud.sql.v1.Backup.SqlBackupState",
2259 ))
2260 }
2261 }
2262
2263 #[derive(Clone, Debug, PartialEq)]
2264 #[non_exhaustive]
2265 pub enum Expiration {
2266 /// Input only. The time-to-live (TTL) interval for this resource (in days).
2267 /// For example: ttlDays:7, means 7 days from the current time. The
2268 /// expiration time can't exceed 365 days from the time that the backup is
2269 /// created.
2270 TtlDays(i64),
2271 /// Backup expiration time.
2272 /// A UTC timestamp of when this backup expired.
2273 ExpiryTime(std::boxed::Box<wkt::Timestamp>),
2274 }
2275}
2276
2277/// Connect settings retrieval request.
2278#[derive(Clone, Default, PartialEq)]
2279#[non_exhaustive]
2280pub struct GetConnectSettingsRequest {
2281 /// Cloud SQL instance ID. This does not include the project ID.
2282 pub instance: std::string::String,
2283
2284 /// Project ID of the project that contains the instance.
2285 pub project: std::string::String,
2286
2287 /// Optional. Optional snapshot read timestamp to trade freshness for
2288 /// performance.
2289 pub read_time: std::option::Option<wkt::Timestamp>,
2290
2291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2292}
2293
2294impl GetConnectSettingsRequest {
2295 pub fn new() -> Self {
2296 std::default::Default::default()
2297 }
2298
2299 /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
2300 ///
2301 /// # Example
2302 /// ```ignore,no_run
2303 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2304 /// let x = GetConnectSettingsRequest::new().set_instance("example");
2305 /// ```
2306 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2307 self.instance = v.into();
2308 self
2309 }
2310
2311 /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
2312 ///
2313 /// # Example
2314 /// ```ignore,no_run
2315 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2316 /// let x = GetConnectSettingsRequest::new().set_project("example");
2317 /// ```
2318 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2319 self.project = v.into();
2320 self
2321 }
2322
2323 /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2324 ///
2325 /// # Example
2326 /// ```ignore,no_run
2327 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2328 /// use wkt::Timestamp;
2329 /// let x = GetConnectSettingsRequest::new().set_read_time(Timestamp::default()/* use setters */);
2330 /// ```
2331 pub fn set_read_time<T>(mut self, v: T) -> Self
2332 where
2333 T: std::convert::Into<wkt::Timestamp>,
2334 {
2335 self.read_time = std::option::Option::Some(v.into());
2336 self
2337 }
2338
2339 /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2340 ///
2341 /// # Example
2342 /// ```ignore,no_run
2343 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2344 /// use wkt::Timestamp;
2345 /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
2346 /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(None::<Timestamp>);
2347 /// ```
2348 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
2349 where
2350 T: std::convert::Into<wkt::Timestamp>,
2351 {
2352 self.read_time = v.map(|x| x.into());
2353 self
2354 }
2355}
2356
2357impl wkt::message::Message for GetConnectSettingsRequest {
2358 fn typename() -> &'static str {
2359 "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
2360 }
2361}
2362
2363/// Connect settings retrieval response.
2364#[derive(Clone, Default, PartialEq)]
2365#[non_exhaustive]
2366pub struct ConnectSettings {
2367 /// This is always `sql#connectSettings`.
2368 pub kind: std::string::String,
2369
2370 /// SSL configuration.
2371 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
2372
2373 /// The assigned IP addresses for the instance.
2374 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2375
2376 /// The cloud region for the instance. For example, `us-central1`,
2377 /// `europe-west1`. The region cannot be changed after instance creation.
2378 pub region: std::string::String,
2379
2380 /// The database engine type and version. The `databaseVersion`
2381 /// field cannot be changed after instance creation.
2382 /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
2383 /// or `MYSQL_5_6`.
2384 /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
2385 /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
2386 /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
2387 /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
2388 /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
2389 /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
2390 /// `SQLSERVER_2019_WEB`.
2391 pub database_version: crate::model::SqlDatabaseVersion,
2392
2393 /// `SECOND_GEN`: Cloud SQL database instance.
2394 /// `EXTERNAL`: A database server that is not managed by Google.
2395 /// This property is read-only; use the `tier` property in the `settings`
2396 /// object to determine the database type.
2397 pub backend_type: crate::model::SqlBackendType,
2398
2399 /// Whether PSC connectivity is enabled for this instance.
2400 pub psc_enabled: bool,
2401
2402 /// The dns name of the instance.
2403 pub dns_name: std::string::String,
2404
2405 /// Specify what type of CA is used for the server certificate.
2406 pub server_ca_mode: crate::model::connect_settings::CaMode,
2407
2408 /// Custom subject alternative names for the server certificate.
2409 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
2410
2411 /// Output only. The list of DNS names used by this instance.
2412 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2413
2414 /// The number of read pool nodes in a read pool.
2415 pub node_count: std::option::Option<i32>,
2416
2417 /// Output only. Entries containing information about each read pool node of
2418 /// the read pool.
2419 pub nodes: std::vec::Vec<crate::model::connect_settings::ConnectPoolNodeConfig>,
2420
2421 /// Optional. Output only. mdx_protocol_support controls how the client uses
2422 /// metadata exchange when connecting to the instance. The values in the list
2423 /// representing parts of the MDX protocol that are supported by this instance.
2424 /// When the list is empty, the instance does not support MDX, so the client
2425 /// must not send an MDX request. The default is empty.
2426 pub mdx_protocol_support: std::vec::Vec<crate::model::connect_settings::MdxProtocolSupport>,
2427
2428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2429}
2430
2431impl ConnectSettings {
2432 pub fn new() -> Self {
2433 std::default::Default::default()
2434 }
2435
2436 /// Sets the value of [kind][crate::model::ConnectSettings::kind].
2437 ///
2438 /// # Example
2439 /// ```ignore,no_run
2440 /// # use google_cloud_sql_v1::model::ConnectSettings;
2441 /// let x = ConnectSettings::new().set_kind("example");
2442 /// ```
2443 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2444 self.kind = v.into();
2445 self
2446 }
2447
2448 /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2449 ///
2450 /// # Example
2451 /// ```ignore,no_run
2452 /// # use google_cloud_sql_v1::model::ConnectSettings;
2453 /// use google_cloud_sql_v1::model::SslCert;
2454 /// let x = ConnectSettings::new().set_server_ca_cert(SslCert::default()/* use setters */);
2455 /// ```
2456 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
2457 where
2458 T: std::convert::Into<crate::model::SslCert>,
2459 {
2460 self.server_ca_cert = std::option::Option::Some(v.into());
2461 self
2462 }
2463
2464 /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2465 ///
2466 /// # Example
2467 /// ```ignore,no_run
2468 /// # use google_cloud_sql_v1::model::ConnectSettings;
2469 /// use google_cloud_sql_v1::model::SslCert;
2470 /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
2471 /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(None::<SslCert>);
2472 /// ```
2473 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
2474 where
2475 T: std::convert::Into<crate::model::SslCert>,
2476 {
2477 self.server_ca_cert = v.map(|x| x.into());
2478 self
2479 }
2480
2481 /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
2482 ///
2483 /// # Example
2484 /// ```ignore,no_run
2485 /// # use google_cloud_sql_v1::model::ConnectSettings;
2486 /// use google_cloud_sql_v1::model::IpMapping;
2487 /// let x = ConnectSettings::new()
2488 /// .set_ip_addresses([
2489 /// IpMapping::default()/* use setters */,
2490 /// IpMapping::default()/* use (different) setters */,
2491 /// ]);
2492 /// ```
2493 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2494 where
2495 T: std::iter::IntoIterator<Item = V>,
2496 V: std::convert::Into<crate::model::IpMapping>,
2497 {
2498 use std::iter::Iterator;
2499 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2500 self
2501 }
2502
2503 /// Sets the value of [region][crate::model::ConnectSettings::region].
2504 ///
2505 /// # Example
2506 /// ```ignore,no_run
2507 /// # use google_cloud_sql_v1::model::ConnectSettings;
2508 /// let x = ConnectSettings::new().set_region("example");
2509 /// ```
2510 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2511 self.region = v.into();
2512 self
2513 }
2514
2515 /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
2516 ///
2517 /// # Example
2518 /// ```ignore,no_run
2519 /// # use google_cloud_sql_v1::model::ConnectSettings;
2520 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
2521 /// let x0 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
2522 /// let x1 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
2523 /// let x2 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql80);
2524 /// ```
2525 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
2526 mut self,
2527 v: T,
2528 ) -> Self {
2529 self.database_version = v.into();
2530 self
2531 }
2532
2533 /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
2534 ///
2535 /// # Example
2536 /// ```ignore,no_run
2537 /// # use google_cloud_sql_v1::model::ConnectSettings;
2538 /// use google_cloud_sql_v1::model::SqlBackendType;
2539 /// let x0 = ConnectSettings::new().set_backend_type(SqlBackendType::SecondGen);
2540 /// let x1 = ConnectSettings::new().set_backend_type(SqlBackendType::External);
2541 /// ```
2542 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
2543 mut self,
2544 v: T,
2545 ) -> Self {
2546 self.backend_type = v.into();
2547 self
2548 }
2549
2550 /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
2551 ///
2552 /// # Example
2553 /// ```ignore,no_run
2554 /// # use google_cloud_sql_v1::model::ConnectSettings;
2555 /// let x = ConnectSettings::new().set_psc_enabled(true);
2556 /// ```
2557 pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2558 self.psc_enabled = v.into();
2559 self
2560 }
2561
2562 /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
2563 ///
2564 /// # Example
2565 /// ```ignore,no_run
2566 /// # use google_cloud_sql_v1::model::ConnectSettings;
2567 /// let x = ConnectSettings::new().set_dns_name("example");
2568 /// ```
2569 pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2570 self.dns_name = v.into();
2571 self
2572 }
2573
2574 /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
2575 ///
2576 /// # Example
2577 /// ```ignore,no_run
2578 /// # use google_cloud_sql_v1::model::ConnectSettings;
2579 /// use google_cloud_sql_v1::model::connect_settings::CaMode;
2580 /// let x0 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
2581 /// let x1 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
2582 /// let x2 = ConnectSettings::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
2583 /// ```
2584 pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
2585 mut self,
2586 v: T,
2587 ) -> Self {
2588 self.server_ca_mode = v.into();
2589 self
2590 }
2591
2592 /// Sets the value of [custom_subject_alternative_names][crate::model::ConnectSettings::custom_subject_alternative_names].
2593 ///
2594 /// # Example
2595 /// ```ignore,no_run
2596 /// # use google_cloud_sql_v1::model::ConnectSettings;
2597 /// let x = ConnectSettings::new().set_custom_subject_alternative_names(["a", "b", "c"]);
2598 /// ```
2599 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
2600 where
2601 T: std::iter::IntoIterator<Item = V>,
2602 V: std::convert::Into<std::string::String>,
2603 {
2604 use std::iter::Iterator;
2605 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
2606 self
2607 }
2608
2609 /// Sets the value of [dns_names][crate::model::ConnectSettings::dns_names].
2610 ///
2611 /// # Example
2612 /// ```ignore,no_run
2613 /// # use google_cloud_sql_v1::model::ConnectSettings;
2614 /// use google_cloud_sql_v1::model::DnsNameMapping;
2615 /// let x = ConnectSettings::new()
2616 /// .set_dns_names([
2617 /// DnsNameMapping::default()/* use setters */,
2618 /// DnsNameMapping::default()/* use (different) setters */,
2619 /// ]);
2620 /// ```
2621 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2622 where
2623 T: std::iter::IntoIterator<Item = V>,
2624 V: std::convert::Into<crate::model::DnsNameMapping>,
2625 {
2626 use std::iter::Iterator;
2627 self.dns_names = v.into_iter().map(|i| i.into()).collect();
2628 self
2629 }
2630
2631 /// Sets the value of [node_count][crate::model::ConnectSettings::node_count].
2632 ///
2633 /// # Example
2634 /// ```ignore,no_run
2635 /// # use google_cloud_sql_v1::model::ConnectSettings;
2636 /// let x = ConnectSettings::new().set_node_count(42);
2637 /// ```
2638 pub fn set_node_count<T>(mut self, v: T) -> Self
2639 where
2640 T: std::convert::Into<i32>,
2641 {
2642 self.node_count = std::option::Option::Some(v.into());
2643 self
2644 }
2645
2646 /// Sets or clears the value of [node_count][crate::model::ConnectSettings::node_count].
2647 ///
2648 /// # Example
2649 /// ```ignore,no_run
2650 /// # use google_cloud_sql_v1::model::ConnectSettings;
2651 /// let x = ConnectSettings::new().set_or_clear_node_count(Some(42));
2652 /// let x = ConnectSettings::new().set_or_clear_node_count(None::<i32>);
2653 /// ```
2654 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
2655 where
2656 T: std::convert::Into<i32>,
2657 {
2658 self.node_count = v.map(|x| x.into());
2659 self
2660 }
2661
2662 /// Sets the value of [nodes][crate::model::ConnectSettings::nodes].
2663 ///
2664 /// # Example
2665 /// ```ignore,no_run
2666 /// # use google_cloud_sql_v1::model::ConnectSettings;
2667 /// use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2668 /// let x = ConnectSettings::new()
2669 /// .set_nodes([
2670 /// ConnectPoolNodeConfig::default()/* use setters */,
2671 /// ConnectPoolNodeConfig::default()/* use (different) setters */,
2672 /// ]);
2673 /// ```
2674 pub fn set_nodes<T, V>(mut self, v: T) -> Self
2675 where
2676 T: std::iter::IntoIterator<Item = V>,
2677 V: std::convert::Into<crate::model::connect_settings::ConnectPoolNodeConfig>,
2678 {
2679 use std::iter::Iterator;
2680 self.nodes = v.into_iter().map(|i| i.into()).collect();
2681 self
2682 }
2683
2684 /// Sets the value of [mdx_protocol_support][crate::model::ConnectSettings::mdx_protocol_support].
2685 ///
2686 /// # Example
2687 /// ```ignore,no_run
2688 /// # use google_cloud_sql_v1::model::ConnectSettings;
2689 /// use google_cloud_sql_v1::model::connect_settings::MdxProtocolSupport;
2690 /// let x = ConnectSettings::new().set_mdx_protocol_support([
2691 /// MdxProtocolSupport::ClientProtocolType,
2692 /// ]);
2693 /// ```
2694 pub fn set_mdx_protocol_support<T, V>(mut self, v: T) -> Self
2695 where
2696 T: std::iter::IntoIterator<Item = V>,
2697 V: std::convert::Into<crate::model::connect_settings::MdxProtocolSupport>,
2698 {
2699 use std::iter::Iterator;
2700 self.mdx_protocol_support = v.into_iter().map(|i| i.into()).collect();
2701 self
2702 }
2703}
2704
2705impl wkt::message::Message for ConnectSettings {
2706 fn typename() -> &'static str {
2707 "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
2708 }
2709}
2710
2711/// Defines additional types related to [ConnectSettings].
2712pub mod connect_settings {
2713 #[allow(unused_imports)]
2714 use super::*;
2715
2716 /// Details of a single read pool node of a read pool.
2717 #[derive(Clone, Default, PartialEq)]
2718 #[non_exhaustive]
2719 pub struct ConnectPoolNodeConfig {
2720 /// Output only. The name of the read pool node. Doesn't include the project
2721 /// ID.
2722 pub name: std::option::Option<std::string::String>,
2723
2724 /// Output only. Mappings containing IP addresses that can be used to connect
2725 /// to the read pool node.
2726 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2727
2728 /// Output only. The DNS name of the read pool node.
2729 pub dns_name: std::option::Option<std::string::String>,
2730
2731 /// Output only. The list of DNS names used by this read pool node.
2732 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2733
2734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2735 }
2736
2737 impl ConnectPoolNodeConfig {
2738 pub fn new() -> Self {
2739 std::default::Default::default()
2740 }
2741
2742 /// Sets the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2743 ///
2744 /// # Example
2745 /// ```ignore,no_run
2746 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2747 /// let x = ConnectPoolNodeConfig::new().set_name("example");
2748 /// ```
2749 pub fn set_name<T>(mut self, v: T) -> Self
2750 where
2751 T: std::convert::Into<std::string::String>,
2752 {
2753 self.name = std::option::Option::Some(v.into());
2754 self
2755 }
2756
2757 /// Sets or clears the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2758 ///
2759 /// # Example
2760 /// ```ignore,no_run
2761 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2762 /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(Some("example"));
2763 /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(None::<String>);
2764 /// ```
2765 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
2766 where
2767 T: std::convert::Into<std::string::String>,
2768 {
2769 self.name = v.map(|x| x.into());
2770 self
2771 }
2772
2773 /// Sets the value of [ip_addresses][crate::model::connect_settings::ConnectPoolNodeConfig::ip_addresses].
2774 ///
2775 /// # Example
2776 /// ```ignore,no_run
2777 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2778 /// use google_cloud_sql_v1::model::IpMapping;
2779 /// let x = ConnectPoolNodeConfig::new()
2780 /// .set_ip_addresses([
2781 /// IpMapping::default()/* use setters */,
2782 /// IpMapping::default()/* use (different) setters */,
2783 /// ]);
2784 /// ```
2785 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2786 where
2787 T: std::iter::IntoIterator<Item = V>,
2788 V: std::convert::Into<crate::model::IpMapping>,
2789 {
2790 use std::iter::Iterator;
2791 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2792 self
2793 }
2794
2795 /// Sets the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2796 ///
2797 /// # Example
2798 /// ```ignore,no_run
2799 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2800 /// let x = ConnectPoolNodeConfig::new().set_dns_name("example");
2801 /// ```
2802 pub fn set_dns_name<T>(mut self, v: T) -> Self
2803 where
2804 T: std::convert::Into<std::string::String>,
2805 {
2806 self.dns_name = std::option::Option::Some(v.into());
2807 self
2808 }
2809
2810 /// Sets or clears the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2811 ///
2812 /// # Example
2813 /// ```ignore,no_run
2814 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2815 /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
2816 /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
2817 /// ```
2818 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
2819 where
2820 T: std::convert::Into<std::string::String>,
2821 {
2822 self.dns_name = v.map(|x| x.into());
2823 self
2824 }
2825
2826 /// Sets the value of [dns_names][crate::model::connect_settings::ConnectPoolNodeConfig::dns_names].
2827 ///
2828 /// # Example
2829 /// ```ignore,no_run
2830 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2831 /// use google_cloud_sql_v1::model::DnsNameMapping;
2832 /// let x = ConnectPoolNodeConfig::new()
2833 /// .set_dns_names([
2834 /// DnsNameMapping::default()/* use setters */,
2835 /// DnsNameMapping::default()/* use (different) setters */,
2836 /// ]);
2837 /// ```
2838 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2839 where
2840 T: std::iter::IntoIterator<Item = V>,
2841 V: std::convert::Into<crate::model::DnsNameMapping>,
2842 {
2843 use std::iter::Iterator;
2844 self.dns_names = v.into_iter().map(|i| i.into()).collect();
2845 self
2846 }
2847 }
2848
2849 impl wkt::message::Message for ConnectPoolNodeConfig {
2850 fn typename() -> &'static str {
2851 "type.googleapis.com/google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig"
2852 }
2853 }
2854
2855 /// Various Certificate Authority (CA) modes for certificate signing.
2856 ///
2857 /// # Working with unknown values
2858 ///
2859 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2860 /// additional enum variants at any time. Adding new variants is not considered
2861 /// a breaking change. Applications should write their code in anticipation of:
2862 ///
2863 /// - New values appearing in future releases of the client library, **and**
2864 /// - New values received dynamically, without application changes.
2865 ///
2866 /// Please consult the [Working with enums] section in the user guide for some
2867 /// guidelines.
2868 ///
2869 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2870 #[derive(Clone, Debug, PartialEq)]
2871 #[non_exhaustive]
2872 pub enum CaMode {
2873 /// CA mode is unknown.
2874 Unspecified,
2875 /// Google-managed self-signed internal CA.
2876 GoogleManagedInternalCa,
2877 /// Google-managed regional CA part of root CA hierarchy hosted on Google
2878 /// Cloud's Certificate Authority Service (CAS).
2879 GoogleManagedCasCa,
2880 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
2881 /// Service (CAS).
2882 CustomerManagedCasCa,
2883 /// If set, the enum was initialized with an unknown value.
2884 ///
2885 /// Applications can examine the value using [CaMode::value] or
2886 /// [CaMode::name].
2887 UnknownValue(ca_mode::UnknownValue),
2888 }
2889
2890 #[doc(hidden)]
2891 pub mod ca_mode {
2892 #[allow(unused_imports)]
2893 use super::*;
2894 #[derive(Clone, Debug, PartialEq)]
2895 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2896 }
2897
2898 impl CaMode {
2899 /// Gets the enum value.
2900 ///
2901 /// Returns `None` if the enum contains an unknown value deserialized from
2902 /// the string representation of enums.
2903 pub fn value(&self) -> std::option::Option<i32> {
2904 match self {
2905 Self::Unspecified => std::option::Option::Some(0),
2906 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
2907 Self::GoogleManagedCasCa => std::option::Option::Some(2),
2908 Self::CustomerManagedCasCa => std::option::Option::Some(3),
2909 Self::UnknownValue(u) => u.0.value(),
2910 }
2911 }
2912
2913 /// Gets the enum value as a string.
2914 ///
2915 /// Returns `None` if the enum contains an unknown value deserialized from
2916 /// the integer representation of enums.
2917 pub fn name(&self) -> std::option::Option<&str> {
2918 match self {
2919 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
2920 Self::GoogleManagedInternalCa => {
2921 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
2922 }
2923 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
2924 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
2925 Self::UnknownValue(u) => u.0.name(),
2926 }
2927 }
2928 }
2929
2930 impl std::default::Default for CaMode {
2931 fn default() -> Self {
2932 use std::convert::From;
2933 Self::from(0)
2934 }
2935 }
2936
2937 impl std::fmt::Display for CaMode {
2938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2939 wkt::internal::display_enum(f, self.name(), self.value())
2940 }
2941 }
2942
2943 impl std::convert::From<i32> for CaMode {
2944 fn from(value: i32) -> Self {
2945 match value {
2946 0 => Self::Unspecified,
2947 1 => Self::GoogleManagedInternalCa,
2948 2 => Self::GoogleManagedCasCa,
2949 3 => Self::CustomerManagedCasCa,
2950 _ => Self::UnknownValue(ca_mode::UnknownValue(
2951 wkt::internal::UnknownEnumValue::Integer(value),
2952 )),
2953 }
2954 }
2955 }
2956
2957 impl std::convert::From<&str> for CaMode {
2958 fn from(value: &str) -> Self {
2959 use std::string::ToString;
2960 match value {
2961 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
2962 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
2963 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
2964 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
2965 _ => Self::UnknownValue(ca_mode::UnknownValue(
2966 wkt::internal::UnknownEnumValue::String(value.to_string()),
2967 )),
2968 }
2969 }
2970 }
2971
2972 impl serde::ser::Serialize for CaMode {
2973 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2974 where
2975 S: serde::Serializer,
2976 {
2977 match self {
2978 Self::Unspecified => serializer.serialize_i32(0),
2979 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
2980 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
2981 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
2982 Self::UnknownValue(u) => u.0.serialize(serializer),
2983 }
2984 }
2985 }
2986
2987 impl<'de> serde::de::Deserialize<'de> for CaMode {
2988 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2989 where
2990 D: serde::Deserializer<'de>,
2991 {
2992 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
2993 ".google.cloud.sql.v1.ConnectSettings.CaMode",
2994 ))
2995 }
2996 }
2997
2998 /// MdxProtocolSupport describes parts of the MDX protocol supported by this
2999 /// instance.
3000 ///
3001 /// # Working with unknown values
3002 ///
3003 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3004 /// additional enum variants at any time. Adding new variants is not considered
3005 /// a breaking change. Applications should write their code in anticipation of:
3006 ///
3007 /// - New values appearing in future releases of the client library, **and**
3008 /// - New values received dynamically, without application changes.
3009 ///
3010 /// Please consult the [Working with enums] section in the user guide for some
3011 /// guidelines.
3012 ///
3013 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3014 #[derive(Clone, Debug, PartialEq)]
3015 #[non_exhaustive]
3016 pub enum MdxProtocolSupport {
3017 /// Not specified.
3018 Unspecified,
3019 /// Client should send the client protocol type in the MDX request.
3020 ClientProtocolType,
3021 /// If set, the enum was initialized with an unknown value.
3022 ///
3023 /// Applications can examine the value using [MdxProtocolSupport::value] or
3024 /// [MdxProtocolSupport::name].
3025 UnknownValue(mdx_protocol_support::UnknownValue),
3026 }
3027
3028 #[doc(hidden)]
3029 pub mod mdx_protocol_support {
3030 #[allow(unused_imports)]
3031 use super::*;
3032 #[derive(Clone, Debug, PartialEq)]
3033 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3034 }
3035
3036 impl MdxProtocolSupport {
3037 /// Gets the enum value.
3038 ///
3039 /// Returns `None` if the enum contains an unknown value deserialized from
3040 /// the string representation of enums.
3041 pub fn value(&self) -> std::option::Option<i32> {
3042 match self {
3043 Self::Unspecified => std::option::Option::Some(0),
3044 Self::ClientProtocolType => std::option::Option::Some(1),
3045 Self::UnknownValue(u) => u.0.value(),
3046 }
3047 }
3048
3049 /// Gets the enum value as a string.
3050 ///
3051 /// Returns `None` if the enum contains an unknown value deserialized from
3052 /// the integer representation of enums.
3053 pub fn name(&self) -> std::option::Option<&str> {
3054 match self {
3055 Self::Unspecified => std::option::Option::Some("MDX_PROTOCOL_SUPPORT_UNSPECIFIED"),
3056 Self::ClientProtocolType => std::option::Option::Some("CLIENT_PROTOCOL_TYPE"),
3057 Self::UnknownValue(u) => u.0.name(),
3058 }
3059 }
3060 }
3061
3062 impl std::default::Default for MdxProtocolSupport {
3063 fn default() -> Self {
3064 use std::convert::From;
3065 Self::from(0)
3066 }
3067 }
3068
3069 impl std::fmt::Display for MdxProtocolSupport {
3070 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3071 wkt::internal::display_enum(f, self.name(), self.value())
3072 }
3073 }
3074
3075 impl std::convert::From<i32> for MdxProtocolSupport {
3076 fn from(value: i32) -> Self {
3077 match value {
3078 0 => Self::Unspecified,
3079 1 => Self::ClientProtocolType,
3080 _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3081 wkt::internal::UnknownEnumValue::Integer(value),
3082 )),
3083 }
3084 }
3085 }
3086
3087 impl std::convert::From<&str> for MdxProtocolSupport {
3088 fn from(value: &str) -> Self {
3089 use std::string::ToString;
3090 match value {
3091 "MDX_PROTOCOL_SUPPORT_UNSPECIFIED" => Self::Unspecified,
3092 "CLIENT_PROTOCOL_TYPE" => Self::ClientProtocolType,
3093 _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3094 wkt::internal::UnknownEnumValue::String(value.to_string()),
3095 )),
3096 }
3097 }
3098 }
3099
3100 impl serde::ser::Serialize for MdxProtocolSupport {
3101 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3102 where
3103 S: serde::Serializer,
3104 {
3105 match self {
3106 Self::Unspecified => serializer.serialize_i32(0),
3107 Self::ClientProtocolType => serializer.serialize_i32(1),
3108 Self::UnknownValue(u) => u.0.serialize(serializer),
3109 }
3110 }
3111 }
3112
3113 impl<'de> serde::de::Deserialize<'de> for MdxProtocolSupport {
3114 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3115 where
3116 D: serde::Deserializer<'de>,
3117 {
3118 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MdxProtocolSupport>::new(
3119 ".google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport",
3120 ))
3121 }
3122 }
3123}
3124
3125/// Ephemeral certificate creation request.
3126#[derive(Clone, Default, PartialEq)]
3127#[non_exhaustive]
3128pub struct GenerateEphemeralCertRequest {
3129 /// Cloud SQL instance ID. This does not include the project ID.
3130 pub instance: std::string::String,
3131
3132 /// Project ID of the project that contains the instance.
3133 pub project: std::string::String,
3134
3135 /// PEM encoded public key to include in the signed certificate.
3136 pub public_key: std::string::String,
3137
3138 /// Optional. Access token to include in the signed certificate.
3139 pub access_token: std::string::String,
3140
3141 /// Optional. Optional snapshot read timestamp to trade freshness for
3142 /// performance.
3143 pub read_time: std::option::Option<wkt::Timestamp>,
3144
3145 /// Optional. If set, it will contain the cert valid duration.
3146 pub valid_duration: std::option::Option<wkt::Duration>,
3147
3148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3149}
3150
3151impl GenerateEphemeralCertRequest {
3152 pub fn new() -> Self {
3153 std::default::Default::default()
3154 }
3155
3156 /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
3157 ///
3158 /// # Example
3159 /// ```ignore,no_run
3160 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3161 /// let x = GenerateEphemeralCertRequest::new().set_instance("example");
3162 /// ```
3163 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3164 self.instance = v.into();
3165 self
3166 }
3167
3168 /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
3169 ///
3170 /// # Example
3171 /// ```ignore,no_run
3172 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3173 /// let x = GenerateEphemeralCertRequest::new().set_project("example");
3174 /// ```
3175 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3176 self.project = v.into();
3177 self
3178 }
3179
3180 /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
3181 ///
3182 /// # Example
3183 /// ```ignore,no_run
3184 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3185 /// let x = GenerateEphemeralCertRequest::new().set_public_key("example");
3186 /// ```
3187 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3188 self.public_key = v.into();
3189 self
3190 }
3191
3192 /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
3193 ///
3194 /// # Example
3195 /// ```ignore,no_run
3196 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3197 /// let x = GenerateEphemeralCertRequest::new().set_access_token("example");
3198 /// ```
3199 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3200 self.access_token = v.into();
3201 self
3202 }
3203
3204 /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3205 ///
3206 /// # Example
3207 /// ```ignore,no_run
3208 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3209 /// use wkt::Timestamp;
3210 /// let x = GenerateEphemeralCertRequest::new().set_read_time(Timestamp::default()/* use setters */);
3211 /// ```
3212 pub fn set_read_time<T>(mut self, v: T) -> Self
3213 where
3214 T: std::convert::Into<wkt::Timestamp>,
3215 {
3216 self.read_time = std::option::Option::Some(v.into());
3217 self
3218 }
3219
3220 /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3221 ///
3222 /// # Example
3223 /// ```ignore,no_run
3224 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3225 /// use wkt::Timestamp;
3226 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
3227 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(None::<Timestamp>);
3228 /// ```
3229 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
3230 where
3231 T: std::convert::Into<wkt::Timestamp>,
3232 {
3233 self.read_time = v.map(|x| x.into());
3234 self
3235 }
3236
3237 /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3238 ///
3239 /// # Example
3240 /// ```ignore,no_run
3241 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3242 /// use wkt::Duration;
3243 /// let x = GenerateEphemeralCertRequest::new().set_valid_duration(Duration::default()/* use setters */);
3244 /// ```
3245 pub fn set_valid_duration<T>(mut self, v: T) -> Self
3246 where
3247 T: std::convert::Into<wkt::Duration>,
3248 {
3249 self.valid_duration = std::option::Option::Some(v.into());
3250 self
3251 }
3252
3253 /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3254 ///
3255 /// # Example
3256 /// ```ignore,no_run
3257 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3258 /// use wkt::Duration;
3259 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(Some(Duration::default()/* use setters */));
3260 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(None::<Duration>);
3261 /// ```
3262 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
3263 where
3264 T: std::convert::Into<wkt::Duration>,
3265 {
3266 self.valid_duration = v.map(|x| x.into());
3267 self
3268 }
3269}
3270
3271impl wkt::message::Message for GenerateEphemeralCertRequest {
3272 fn typename() -> &'static str {
3273 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
3274 }
3275}
3276
3277/// Ephemeral certificate creation request.
3278#[derive(Clone, Default, PartialEq)]
3279#[non_exhaustive]
3280pub struct GenerateEphemeralCertResponse {
3281 /// Generated cert
3282 pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
3283
3284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3285}
3286
3287impl GenerateEphemeralCertResponse {
3288 pub fn new() -> Self {
3289 std::default::Default::default()
3290 }
3291
3292 /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3293 ///
3294 /// # Example
3295 /// ```ignore,no_run
3296 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3297 /// use google_cloud_sql_v1::model::SslCert;
3298 /// let x = GenerateEphemeralCertResponse::new().set_ephemeral_cert(SslCert::default()/* use setters */);
3299 /// ```
3300 pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
3301 where
3302 T: std::convert::Into<crate::model::SslCert>,
3303 {
3304 self.ephemeral_cert = std::option::Option::Some(v.into());
3305 self
3306 }
3307
3308 /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3309 ///
3310 /// # Example
3311 /// ```ignore,no_run
3312 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3313 /// use google_cloud_sql_v1::model::SslCert;
3314 /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(Some(SslCert::default()/* use setters */));
3315 /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(None::<SslCert>);
3316 /// ```
3317 pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
3318 where
3319 T: std::convert::Into<crate::model::SslCert>,
3320 {
3321 self.ephemeral_cert = v.map(|x| x.into());
3322 self
3323 }
3324}
3325
3326impl wkt::message::Message for GenerateEphemeralCertResponse {
3327 fn typename() -> &'static str {
3328 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
3329 }
3330}
3331
3332/// Database delete request.
3333#[derive(Clone, Default, PartialEq)]
3334#[non_exhaustive]
3335pub struct SqlDatabasesDeleteRequest {
3336 /// Name of the database to be deleted in the instance.
3337 pub database: std::string::String,
3338
3339 /// Database instance ID. This does not include the project ID.
3340 pub instance: std::string::String,
3341
3342 /// Project ID of the project that contains the instance.
3343 pub project: std::string::String,
3344
3345 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3346}
3347
3348impl SqlDatabasesDeleteRequest {
3349 pub fn new() -> Self {
3350 std::default::Default::default()
3351 }
3352
3353 /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
3354 ///
3355 /// # Example
3356 /// ```ignore,no_run
3357 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3358 /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
3359 /// ```
3360 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3361 self.database = v.into();
3362 self
3363 }
3364
3365 /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
3366 ///
3367 /// # Example
3368 /// ```ignore,no_run
3369 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3370 /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
3371 /// ```
3372 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3373 self.instance = v.into();
3374 self
3375 }
3376
3377 /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
3378 ///
3379 /// # Example
3380 /// ```ignore,no_run
3381 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3382 /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
3383 /// ```
3384 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3385 self.project = v.into();
3386 self
3387 }
3388}
3389
3390impl wkt::message::Message for SqlDatabasesDeleteRequest {
3391 fn typename() -> &'static str {
3392 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
3393 }
3394}
3395
3396/// Database get request.
3397#[derive(Clone, Default, PartialEq)]
3398#[non_exhaustive]
3399pub struct SqlDatabasesGetRequest {
3400 /// Name of the database in the instance.
3401 pub database: std::string::String,
3402
3403 /// Database instance ID. This does not include the project ID.
3404 pub instance: std::string::String,
3405
3406 /// Project ID of the project that contains the instance.
3407 pub project: std::string::String,
3408
3409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3410}
3411
3412impl SqlDatabasesGetRequest {
3413 pub fn new() -> Self {
3414 std::default::Default::default()
3415 }
3416
3417 /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
3418 ///
3419 /// # Example
3420 /// ```ignore,no_run
3421 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3422 /// let x = SqlDatabasesGetRequest::new().set_database("example");
3423 /// ```
3424 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3425 self.database = v.into();
3426 self
3427 }
3428
3429 /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
3430 ///
3431 /// # Example
3432 /// ```ignore,no_run
3433 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3434 /// let x = SqlDatabasesGetRequest::new().set_instance("example");
3435 /// ```
3436 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3437 self.instance = v.into();
3438 self
3439 }
3440
3441 /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
3442 ///
3443 /// # Example
3444 /// ```ignore,no_run
3445 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3446 /// let x = SqlDatabasesGetRequest::new().set_project("example");
3447 /// ```
3448 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3449 self.project = v.into();
3450 self
3451 }
3452}
3453
3454impl wkt::message::Message for SqlDatabasesGetRequest {
3455 fn typename() -> &'static str {
3456 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
3457 }
3458}
3459
3460/// Database insert request.
3461#[derive(Clone, Default, PartialEq)]
3462#[non_exhaustive]
3463pub struct SqlDatabasesInsertRequest {
3464 /// Database instance ID. This does not include the project ID.
3465 pub instance: std::string::String,
3466
3467 /// Project ID of the project that contains the instance.
3468 pub project: std::string::String,
3469
3470 pub body: std::option::Option<crate::model::Database>,
3471
3472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3473}
3474
3475impl SqlDatabasesInsertRequest {
3476 pub fn new() -> Self {
3477 std::default::Default::default()
3478 }
3479
3480 /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
3481 ///
3482 /// # Example
3483 /// ```ignore,no_run
3484 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3485 /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
3486 /// ```
3487 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3488 self.instance = v.into();
3489 self
3490 }
3491
3492 /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
3493 ///
3494 /// # Example
3495 /// ```ignore,no_run
3496 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3497 /// let x = SqlDatabasesInsertRequest::new().set_project("example");
3498 /// ```
3499 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3500 self.project = v.into();
3501 self
3502 }
3503
3504 /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3505 ///
3506 /// # Example
3507 /// ```ignore,no_run
3508 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3509 /// use google_cloud_sql_v1::model::Database;
3510 /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
3511 /// ```
3512 pub fn set_body<T>(mut self, v: T) -> Self
3513 where
3514 T: std::convert::Into<crate::model::Database>,
3515 {
3516 self.body = std::option::Option::Some(v.into());
3517 self
3518 }
3519
3520 /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3521 ///
3522 /// # Example
3523 /// ```ignore,no_run
3524 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3525 /// use google_cloud_sql_v1::model::Database;
3526 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3527 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
3528 /// ```
3529 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3530 where
3531 T: std::convert::Into<crate::model::Database>,
3532 {
3533 self.body = v.map(|x| x.into());
3534 self
3535 }
3536}
3537
3538impl wkt::message::Message for SqlDatabasesInsertRequest {
3539 fn typename() -> &'static str {
3540 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
3541 }
3542}
3543
3544/// Database list request.
3545#[derive(Clone, Default, PartialEq)]
3546#[non_exhaustive]
3547pub struct SqlDatabasesListRequest {
3548 /// Cloud SQL instance ID. This does not include the project ID.
3549 pub instance: std::string::String,
3550
3551 /// Project ID of the project that contains the instance.
3552 pub project: std::string::String,
3553
3554 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3555}
3556
3557impl SqlDatabasesListRequest {
3558 pub fn new() -> Self {
3559 std::default::Default::default()
3560 }
3561
3562 /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
3563 ///
3564 /// # Example
3565 /// ```ignore,no_run
3566 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3567 /// let x = SqlDatabasesListRequest::new().set_instance("example");
3568 /// ```
3569 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3570 self.instance = v.into();
3571 self
3572 }
3573
3574 /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
3575 ///
3576 /// # Example
3577 /// ```ignore,no_run
3578 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3579 /// let x = SqlDatabasesListRequest::new().set_project("example");
3580 /// ```
3581 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3582 self.project = v.into();
3583 self
3584 }
3585}
3586
3587impl wkt::message::Message for SqlDatabasesListRequest {
3588 fn typename() -> &'static str {
3589 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
3590 }
3591}
3592
3593/// Database update request.
3594#[derive(Clone, Default, PartialEq)]
3595#[non_exhaustive]
3596pub struct SqlDatabasesUpdateRequest {
3597 /// Name of the database to be updated in the instance.
3598 pub database: std::string::String,
3599
3600 /// Database instance ID. This does not include the project ID.
3601 pub instance: std::string::String,
3602
3603 /// Project ID of the project that contains the instance.
3604 pub project: std::string::String,
3605
3606 pub body: std::option::Option<crate::model::Database>,
3607
3608 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3609}
3610
3611impl SqlDatabasesUpdateRequest {
3612 pub fn new() -> Self {
3613 std::default::Default::default()
3614 }
3615
3616 /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
3617 ///
3618 /// # Example
3619 /// ```ignore,no_run
3620 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3621 /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
3622 /// ```
3623 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3624 self.database = v.into();
3625 self
3626 }
3627
3628 /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
3629 ///
3630 /// # Example
3631 /// ```ignore,no_run
3632 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3633 /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
3634 /// ```
3635 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3636 self.instance = v.into();
3637 self
3638 }
3639
3640 /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
3641 ///
3642 /// # Example
3643 /// ```ignore,no_run
3644 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3645 /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
3646 /// ```
3647 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3648 self.project = v.into();
3649 self
3650 }
3651
3652 /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3653 ///
3654 /// # Example
3655 /// ```ignore,no_run
3656 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3657 /// use google_cloud_sql_v1::model::Database;
3658 /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
3659 /// ```
3660 pub fn set_body<T>(mut self, v: T) -> Self
3661 where
3662 T: std::convert::Into<crate::model::Database>,
3663 {
3664 self.body = std::option::Option::Some(v.into());
3665 self
3666 }
3667
3668 /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3669 ///
3670 /// # Example
3671 /// ```ignore,no_run
3672 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3673 /// use google_cloud_sql_v1::model::Database;
3674 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3675 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
3676 /// ```
3677 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3678 where
3679 T: std::convert::Into<crate::model::Database>,
3680 {
3681 self.body = v.map(|x| x.into());
3682 self
3683 }
3684}
3685
3686impl wkt::message::Message for SqlDatabasesUpdateRequest {
3687 fn typename() -> &'static str {
3688 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
3689 }
3690}
3691
3692/// Database list response.
3693#[derive(Clone, Default, PartialEq)]
3694#[non_exhaustive]
3695pub struct DatabasesListResponse {
3696 /// This is always `sql#databasesList`.
3697 pub kind: std::string::String,
3698
3699 /// List of database resources in the instance.
3700 pub items: std::vec::Vec<crate::model::Database>,
3701
3702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3703}
3704
3705impl DatabasesListResponse {
3706 pub fn new() -> Self {
3707 std::default::Default::default()
3708 }
3709
3710 /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
3711 ///
3712 /// # Example
3713 /// ```ignore,no_run
3714 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3715 /// let x = DatabasesListResponse::new().set_kind("example");
3716 /// ```
3717 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3718 self.kind = v.into();
3719 self
3720 }
3721
3722 /// Sets the value of [items][crate::model::DatabasesListResponse::items].
3723 ///
3724 /// # Example
3725 /// ```ignore,no_run
3726 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3727 /// use google_cloud_sql_v1::model::Database;
3728 /// let x = DatabasesListResponse::new()
3729 /// .set_items([
3730 /// Database::default()/* use setters */,
3731 /// Database::default()/* use (different) setters */,
3732 /// ]);
3733 /// ```
3734 pub fn set_items<T, V>(mut self, v: T) -> Self
3735 where
3736 T: std::iter::IntoIterator<Item = V>,
3737 V: std::convert::Into<crate::model::Database>,
3738 {
3739 use std::iter::Iterator;
3740 self.items = v.into_iter().map(|i| i.into()).collect();
3741 self
3742 }
3743}
3744
3745impl wkt::message::Message for DatabasesListResponse {
3746 fn typename() -> &'static str {
3747 "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
3748 }
3749}
3750
3751/// Flags list request.
3752#[derive(Clone, Default, PartialEq)]
3753#[non_exhaustive]
3754pub struct SqlFlagsListRequest {
3755 /// Database type and version you want to retrieve flags for. By default, this
3756 /// method returns flags for all database types and versions.
3757 pub database_version: std::string::String,
3758
3759 /// Optional. Specify the scope of flags to be returned by SqlFlagsListService.
3760 /// Return list of database flags if unspecified.
3761 pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
3762
3763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3764}
3765
3766impl SqlFlagsListRequest {
3767 pub fn new() -> Self {
3768 std::default::Default::default()
3769 }
3770
3771 /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
3772 ///
3773 /// # Example
3774 /// ```ignore,no_run
3775 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3776 /// let x = SqlFlagsListRequest::new().set_database_version("example");
3777 /// ```
3778 pub fn set_database_version<T: std::convert::Into<std::string::String>>(
3779 mut self,
3780 v: T,
3781 ) -> Self {
3782 self.database_version = v.into();
3783 self
3784 }
3785
3786 /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3787 ///
3788 /// # Example
3789 /// ```ignore,no_run
3790 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3791 /// use google_cloud_sql_v1::model::SqlFlagScope;
3792 /// let x0 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::Database);
3793 /// let x1 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::ConnectionPool);
3794 /// ```
3795 pub fn set_flag_scope<T>(mut self, v: T) -> Self
3796 where
3797 T: std::convert::Into<crate::model::SqlFlagScope>,
3798 {
3799 self.flag_scope = std::option::Option::Some(v.into());
3800 self
3801 }
3802
3803 /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3804 ///
3805 /// # Example
3806 /// ```ignore,no_run
3807 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3808 /// use google_cloud_sql_v1::model::SqlFlagScope;
3809 /// let x0 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::Database));
3810 /// let x1 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::ConnectionPool));
3811 /// let x_none = SqlFlagsListRequest::new().set_or_clear_flag_scope(None::<SqlFlagScope>);
3812 /// ```
3813 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
3814 where
3815 T: std::convert::Into<crate::model::SqlFlagScope>,
3816 {
3817 self.flag_scope = v.map(|x| x.into());
3818 self
3819 }
3820}
3821
3822impl wkt::message::Message for SqlFlagsListRequest {
3823 fn typename() -> &'static str {
3824 "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
3825 }
3826}
3827
3828/// Flags list response.
3829#[derive(Clone, Default, PartialEq)]
3830#[non_exhaustive]
3831pub struct FlagsListResponse {
3832 /// This is always `sql#flagsList`.
3833 pub kind: std::string::String,
3834
3835 /// List of flags.
3836 pub items: std::vec::Vec<crate::model::Flag>,
3837
3838 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3839}
3840
3841impl FlagsListResponse {
3842 pub fn new() -> Self {
3843 std::default::Default::default()
3844 }
3845
3846 /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
3847 ///
3848 /// # Example
3849 /// ```ignore,no_run
3850 /// # use google_cloud_sql_v1::model::FlagsListResponse;
3851 /// let x = FlagsListResponse::new().set_kind("example");
3852 /// ```
3853 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3854 self.kind = v.into();
3855 self
3856 }
3857
3858 /// Sets the value of [items][crate::model::FlagsListResponse::items].
3859 ///
3860 /// # Example
3861 /// ```ignore,no_run
3862 /// # use google_cloud_sql_v1::model::FlagsListResponse;
3863 /// use google_cloud_sql_v1::model::Flag;
3864 /// let x = FlagsListResponse::new()
3865 /// .set_items([
3866 /// Flag::default()/* use setters */,
3867 /// Flag::default()/* use (different) setters */,
3868 /// ]);
3869 /// ```
3870 pub fn set_items<T, V>(mut self, v: T) -> Self
3871 where
3872 T: std::iter::IntoIterator<Item = V>,
3873 V: std::convert::Into<crate::model::Flag>,
3874 {
3875 use std::iter::Iterator;
3876 self.items = v.into_iter().map(|i| i.into()).collect();
3877 self
3878 }
3879}
3880
3881impl wkt::message::Message for FlagsListResponse {
3882 fn typename() -> &'static str {
3883 "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
3884 }
3885}
3886
3887/// A flag resource.
3888#[derive(Clone, Default, PartialEq)]
3889#[non_exhaustive]
3890pub struct Flag {
3891 /// This is the name of the flag. Flag names always use underscores, not
3892 /// hyphens, for example: `max_allowed_packet`
3893 pub name: std::string::String,
3894
3895 /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
3896 /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
3897 /// value, such as `skip_grant_tables`.
3898 pub r#type: crate::model::SqlFlagType,
3899
3900 /// The database version this flag applies to. Can be
3901 /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
3902 /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
3903 /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
3904 /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
3905 /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
3906 /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
3907 /// `SQLSERVER_2019_WEB`.
3908 /// See [the complete
3909 /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
3910 pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
3911
3912 /// For `STRING` flags, a list of strings that the value can be set to.
3913 pub allowed_string_values: std::vec::Vec<std::string::String>,
3914
3915 /// For `INTEGER` flags, the minimum allowed value.
3916 pub min_value: std::option::Option<wkt::Int64Value>,
3917
3918 /// For `INTEGER` flags, the maximum allowed value.
3919 pub max_value: std::option::Option<wkt::Int64Value>,
3920
3921 /// Indicates whether changing this flag will trigger a database restart. Only
3922 /// applicable to Second Generation instances.
3923 pub requires_restart: std::option::Option<wkt::BoolValue>,
3924
3925 /// This is always `sql#flag`.
3926 pub kind: std::string::String,
3927
3928 /// Whether or not the flag is considered in beta.
3929 pub in_beta: std::option::Option<wkt::BoolValue>,
3930
3931 /// Use this field if only certain integers are accepted. Can be combined
3932 /// with min_value and max_value to add additional values.
3933 pub allowed_int_values: std::vec::Vec<i64>,
3934
3935 /// Scope of flag.
3936 pub flag_scope: crate::model::SqlFlagScope,
3937
3938 /// Recommended flag value for UI display.
3939 pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
3940
3941 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3942}
3943
3944impl Flag {
3945 pub fn new() -> Self {
3946 std::default::Default::default()
3947 }
3948
3949 /// Sets the value of [name][crate::model::Flag::name].
3950 ///
3951 /// # Example
3952 /// ```ignore,no_run
3953 /// # use google_cloud_sql_v1::model::Flag;
3954 /// let x = Flag::new().set_name("example");
3955 /// ```
3956 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3957 self.name = v.into();
3958 self
3959 }
3960
3961 /// Sets the value of [r#type][crate::model::Flag::type].
3962 ///
3963 /// # Example
3964 /// ```ignore,no_run
3965 /// # use google_cloud_sql_v1::model::Flag;
3966 /// use google_cloud_sql_v1::model::SqlFlagType;
3967 /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
3968 /// let x1 = Flag::new().set_type(SqlFlagType::String);
3969 /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
3970 /// ```
3971 pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
3972 self.r#type = v.into();
3973 self
3974 }
3975
3976 /// Sets the value of [applies_to][crate::model::Flag::applies_to].
3977 ///
3978 /// # Example
3979 /// ```ignore,no_run
3980 /// # use google_cloud_sql_v1::model::Flag;
3981 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
3982 /// let x = Flag::new().set_applies_to([
3983 /// SqlDatabaseVersion::Mysql56,
3984 /// SqlDatabaseVersion::Mysql57,
3985 /// SqlDatabaseVersion::Mysql80,
3986 /// ]);
3987 /// ```
3988 pub fn set_applies_to<T, V>(mut self, v: T) -> Self
3989 where
3990 T: std::iter::IntoIterator<Item = V>,
3991 V: std::convert::Into<crate::model::SqlDatabaseVersion>,
3992 {
3993 use std::iter::Iterator;
3994 self.applies_to = v.into_iter().map(|i| i.into()).collect();
3995 self
3996 }
3997
3998 /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
3999 ///
4000 /// # Example
4001 /// ```ignore,no_run
4002 /// # use google_cloud_sql_v1::model::Flag;
4003 /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
4004 /// ```
4005 pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
4006 where
4007 T: std::iter::IntoIterator<Item = V>,
4008 V: std::convert::Into<std::string::String>,
4009 {
4010 use std::iter::Iterator;
4011 self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
4012 self
4013 }
4014
4015 /// Sets the value of [min_value][crate::model::Flag::min_value].
4016 ///
4017 /// # Example
4018 /// ```ignore,no_run
4019 /// # use google_cloud_sql_v1::model::Flag;
4020 /// use wkt::Int64Value;
4021 /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
4022 /// ```
4023 pub fn set_min_value<T>(mut self, v: T) -> Self
4024 where
4025 T: std::convert::Into<wkt::Int64Value>,
4026 {
4027 self.min_value = std::option::Option::Some(v.into());
4028 self
4029 }
4030
4031 /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
4032 ///
4033 /// # Example
4034 /// ```ignore,no_run
4035 /// # use google_cloud_sql_v1::model::Flag;
4036 /// use wkt::Int64Value;
4037 /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
4038 /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
4039 /// ```
4040 pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
4041 where
4042 T: std::convert::Into<wkt::Int64Value>,
4043 {
4044 self.min_value = v.map(|x| x.into());
4045 self
4046 }
4047
4048 /// Sets the value of [max_value][crate::model::Flag::max_value].
4049 ///
4050 /// # Example
4051 /// ```ignore,no_run
4052 /// # use google_cloud_sql_v1::model::Flag;
4053 /// use wkt::Int64Value;
4054 /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
4055 /// ```
4056 pub fn set_max_value<T>(mut self, v: T) -> Self
4057 where
4058 T: std::convert::Into<wkt::Int64Value>,
4059 {
4060 self.max_value = std::option::Option::Some(v.into());
4061 self
4062 }
4063
4064 /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
4065 ///
4066 /// # Example
4067 /// ```ignore,no_run
4068 /// # use google_cloud_sql_v1::model::Flag;
4069 /// use wkt::Int64Value;
4070 /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
4071 /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
4072 /// ```
4073 pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
4074 where
4075 T: std::convert::Into<wkt::Int64Value>,
4076 {
4077 self.max_value = v.map(|x| x.into());
4078 self
4079 }
4080
4081 /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
4082 ///
4083 /// # Example
4084 /// ```ignore,no_run
4085 /// # use google_cloud_sql_v1::model::Flag;
4086 /// use wkt::BoolValue;
4087 /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
4088 /// ```
4089 pub fn set_requires_restart<T>(mut self, v: T) -> Self
4090 where
4091 T: std::convert::Into<wkt::BoolValue>,
4092 {
4093 self.requires_restart = std::option::Option::Some(v.into());
4094 self
4095 }
4096
4097 /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
4098 ///
4099 /// # Example
4100 /// ```ignore,no_run
4101 /// # use google_cloud_sql_v1::model::Flag;
4102 /// use wkt::BoolValue;
4103 /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
4104 /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
4105 /// ```
4106 pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
4107 where
4108 T: std::convert::Into<wkt::BoolValue>,
4109 {
4110 self.requires_restart = v.map(|x| x.into());
4111 self
4112 }
4113
4114 /// Sets the value of [kind][crate::model::Flag::kind].
4115 ///
4116 /// # Example
4117 /// ```ignore,no_run
4118 /// # use google_cloud_sql_v1::model::Flag;
4119 /// let x = Flag::new().set_kind("example");
4120 /// ```
4121 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4122 self.kind = v.into();
4123 self
4124 }
4125
4126 /// Sets the value of [in_beta][crate::model::Flag::in_beta].
4127 ///
4128 /// # Example
4129 /// ```ignore,no_run
4130 /// # use google_cloud_sql_v1::model::Flag;
4131 /// use wkt::BoolValue;
4132 /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
4133 /// ```
4134 pub fn set_in_beta<T>(mut self, v: T) -> Self
4135 where
4136 T: std::convert::Into<wkt::BoolValue>,
4137 {
4138 self.in_beta = std::option::Option::Some(v.into());
4139 self
4140 }
4141
4142 /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
4143 ///
4144 /// # Example
4145 /// ```ignore,no_run
4146 /// # use google_cloud_sql_v1::model::Flag;
4147 /// use wkt::BoolValue;
4148 /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
4149 /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
4150 /// ```
4151 pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
4152 where
4153 T: std::convert::Into<wkt::BoolValue>,
4154 {
4155 self.in_beta = v.map(|x| x.into());
4156 self
4157 }
4158
4159 /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
4160 ///
4161 /// # Example
4162 /// ```ignore,no_run
4163 /// # use google_cloud_sql_v1::model::Flag;
4164 /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
4165 /// ```
4166 pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
4167 where
4168 T: std::iter::IntoIterator<Item = V>,
4169 V: std::convert::Into<i64>,
4170 {
4171 use std::iter::Iterator;
4172 self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
4173 self
4174 }
4175
4176 /// Sets the value of [flag_scope][crate::model::Flag::flag_scope].
4177 ///
4178 /// # Example
4179 /// ```ignore,no_run
4180 /// # use google_cloud_sql_v1::model::Flag;
4181 /// use google_cloud_sql_v1::model::SqlFlagScope;
4182 /// let x0 = Flag::new().set_flag_scope(SqlFlagScope::Database);
4183 /// let x1 = Flag::new().set_flag_scope(SqlFlagScope::ConnectionPool);
4184 /// ```
4185 pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
4186 mut self,
4187 v: T,
4188 ) -> Self {
4189 self.flag_scope = v.into();
4190 self
4191 }
4192
4193 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value].
4194 ///
4195 /// Note that all the setters affecting `recommended_value` are mutually
4196 /// exclusive.
4197 ///
4198 /// # Example
4199 /// ```ignore,no_run
4200 /// # use google_cloud_sql_v1::model::Flag;
4201 /// use google_cloud_sql_v1::model::flag::RecommendedValue;
4202 /// let x = Flag::new().set_recommended_value(Some(RecommendedValue::RecommendedStringValue("example".to_string())));
4203 /// ```
4204 pub fn set_recommended_value<
4205 T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
4206 >(
4207 mut self,
4208 v: T,
4209 ) -> Self {
4210 self.recommended_value = v.into();
4211 self
4212 }
4213
4214 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4215 /// if it holds a `RecommendedStringValue`, `None` if the field is not set or
4216 /// holds a different branch.
4217 pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
4218 #[allow(unreachable_patterns)]
4219 self.recommended_value.as_ref().and_then(|v| match v {
4220 crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
4221 std::option::Option::Some(v)
4222 }
4223 _ => std::option::Option::None,
4224 })
4225 }
4226
4227 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4228 /// to hold a `RecommendedStringValue`.
4229 ///
4230 /// Note that all the setters affecting `recommended_value` are
4231 /// mutually exclusive.
4232 ///
4233 /// # Example
4234 /// ```ignore,no_run
4235 /// # use google_cloud_sql_v1::model::Flag;
4236 /// let x = Flag::new().set_recommended_string_value("example");
4237 /// assert!(x.recommended_string_value().is_some());
4238 /// assert!(x.recommended_int_value().is_none());
4239 /// ```
4240 pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
4241 mut self,
4242 v: T,
4243 ) -> Self {
4244 self.recommended_value = std::option::Option::Some(
4245 crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
4246 );
4247 self
4248 }
4249
4250 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4251 /// if it holds a `RecommendedIntValue`, `None` if the field is not set or
4252 /// holds a different branch.
4253 pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
4254 #[allow(unreachable_patterns)]
4255 self.recommended_value.as_ref().and_then(|v| match v {
4256 crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
4257 std::option::Option::Some(v)
4258 }
4259 _ => std::option::Option::None,
4260 })
4261 }
4262
4263 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4264 /// to hold a `RecommendedIntValue`.
4265 ///
4266 /// Note that all the setters affecting `recommended_value` are
4267 /// mutually exclusive.
4268 ///
4269 /// # Example
4270 /// ```ignore,no_run
4271 /// # use google_cloud_sql_v1::model::Flag;
4272 /// use wkt::Int64Value;
4273 /// let x = Flag::new().set_recommended_int_value(Int64Value::default()/* use setters */);
4274 /// assert!(x.recommended_int_value().is_some());
4275 /// assert!(x.recommended_string_value().is_none());
4276 /// ```
4277 pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
4278 mut self,
4279 v: T,
4280 ) -> Self {
4281 self.recommended_value = std::option::Option::Some(
4282 crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
4283 );
4284 self
4285 }
4286}
4287
4288impl wkt::message::Message for Flag {
4289 fn typename() -> &'static str {
4290 "type.googleapis.com/google.cloud.sql.v1.Flag"
4291 }
4292}
4293
4294/// Defines additional types related to [Flag].
4295pub mod flag {
4296 #[allow(unused_imports)]
4297 use super::*;
4298
4299 /// Recommended flag value for UI display.
4300 #[derive(Clone, Debug, PartialEq)]
4301 #[non_exhaustive]
4302 pub enum RecommendedValue {
4303 /// Recommended string value in string format for UI display.
4304 RecommendedStringValue(std::string::String),
4305 /// Recommended int value in integer format for UI display.
4306 RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
4307 }
4308}
4309
4310/// Instance add server CA request.
4311#[derive(Clone, Default, PartialEq)]
4312#[non_exhaustive]
4313pub struct SqlInstancesAddServerCaRequest {
4314 /// Cloud SQL instance ID. This does not include the project ID.
4315 pub instance: std::string::String,
4316
4317 /// Project ID of the project that contains the instance.
4318 pub project: std::string::String,
4319
4320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4321}
4322
4323impl SqlInstancesAddServerCaRequest {
4324 pub fn new() -> Self {
4325 std::default::Default::default()
4326 }
4327
4328 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
4329 ///
4330 /// # Example
4331 /// ```ignore,no_run
4332 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4333 /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
4334 /// ```
4335 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4336 self.instance = v.into();
4337 self
4338 }
4339
4340 /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
4341 ///
4342 /// # Example
4343 /// ```ignore,no_run
4344 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4345 /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
4346 /// ```
4347 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4348 self.project = v.into();
4349 self
4350 }
4351}
4352
4353impl wkt::message::Message for SqlInstancesAddServerCaRequest {
4354 fn typename() -> &'static str {
4355 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
4356 }
4357}
4358
4359/// Instance add server certificate request.
4360#[derive(Clone, Default, PartialEq)]
4361#[non_exhaustive]
4362pub struct SqlInstancesAddServerCertificateRequest {
4363 /// Cloud SQL instance ID. This does not include the project ID.
4364 pub instance: std::string::String,
4365
4366 /// Project ID of the project that contains the instance.
4367 pub project: std::string::String,
4368
4369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4370}
4371
4372impl SqlInstancesAddServerCertificateRequest {
4373 pub fn new() -> Self {
4374 std::default::Default::default()
4375 }
4376
4377 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
4378 ///
4379 /// # Example
4380 /// ```ignore,no_run
4381 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4382 /// let x = SqlInstancesAddServerCertificateRequest::new().set_instance("example");
4383 /// ```
4384 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4385 self.instance = v.into();
4386 self
4387 }
4388
4389 /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
4390 ///
4391 /// # Example
4392 /// ```ignore,no_run
4393 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4394 /// let x = SqlInstancesAddServerCertificateRequest::new().set_project("example");
4395 /// ```
4396 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4397 self.project = v.into();
4398 self
4399 }
4400}
4401
4402impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
4403 fn typename() -> &'static str {
4404 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
4405 }
4406}
4407
4408/// Instance add Entra ID certificate request.
4409#[derive(Clone, Default, PartialEq)]
4410#[non_exhaustive]
4411pub struct SqlInstancesAddEntraIdCertificateRequest {
4412 /// Required. Cloud SQL instance ID. This does not include the project ID.
4413 pub instance: std::string::String,
4414
4415 /// Required. Project ID of the project that contains the instance.
4416 pub project: std::string::String,
4417
4418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4419}
4420
4421impl SqlInstancesAddEntraIdCertificateRequest {
4422 pub fn new() -> Self {
4423 std::default::Default::default()
4424 }
4425
4426 /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
4427 ///
4428 /// # Example
4429 /// ```ignore,no_run
4430 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4431 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_instance("example");
4432 /// ```
4433 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4434 self.instance = v.into();
4435 self
4436 }
4437
4438 /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
4439 ///
4440 /// # Example
4441 /// ```ignore,no_run
4442 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4443 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_project("example");
4444 /// ```
4445 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4446 self.project = v.into();
4447 self
4448 }
4449}
4450
4451impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
4452 fn typename() -> &'static str {
4453 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
4454 }
4455}
4456
4457/// Instance clone request.
4458#[derive(Clone, Default, PartialEq)]
4459#[non_exhaustive]
4460pub struct SqlInstancesCloneRequest {
4461 /// Required. The ID of the Cloud SQL instance to be cloned (source). This does
4462 /// not include the project ID.
4463 pub instance: std::string::String,
4464
4465 /// Required. Project ID of the source as well as the clone Cloud SQL instance.
4466 pub project: std::string::String,
4467
4468 pub body: std::option::Option<crate::model::InstancesCloneRequest>,
4469
4470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4471}
4472
4473impl SqlInstancesCloneRequest {
4474 pub fn new() -> Self {
4475 std::default::Default::default()
4476 }
4477
4478 /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
4479 ///
4480 /// # Example
4481 /// ```ignore,no_run
4482 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4483 /// let x = SqlInstancesCloneRequest::new().set_instance("example");
4484 /// ```
4485 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4486 self.instance = v.into();
4487 self
4488 }
4489
4490 /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
4491 ///
4492 /// # Example
4493 /// ```ignore,no_run
4494 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4495 /// let x = SqlInstancesCloneRequest::new().set_project("example");
4496 /// ```
4497 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4498 self.project = v.into();
4499 self
4500 }
4501
4502 /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
4503 ///
4504 /// # Example
4505 /// ```ignore,no_run
4506 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4507 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4508 /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
4509 /// ```
4510 pub fn set_body<T>(mut self, v: T) -> Self
4511 where
4512 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4513 {
4514 self.body = std::option::Option::Some(v.into());
4515 self
4516 }
4517
4518 /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
4519 ///
4520 /// # Example
4521 /// ```ignore,no_run
4522 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4523 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4524 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
4525 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
4526 /// ```
4527 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4528 where
4529 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4530 {
4531 self.body = v.map(|x| x.into());
4532 self
4533 }
4534}
4535
4536impl wkt::message::Message for SqlInstancesCloneRequest {
4537 fn typename() -> &'static str {
4538 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
4539 }
4540}
4541
4542/// Instance delete request.
4543#[derive(Clone, Default, PartialEq)]
4544#[non_exhaustive]
4545pub struct SqlInstancesDeleteRequest {
4546 /// Cloud SQL instance ID. This does not include the project ID.
4547 pub instance: std::string::String,
4548
4549 /// Project ID of the project that contains the instance to be deleted.
4550 pub project: std::string::String,
4551
4552 /// Flag to opt-in for final backup. By default, it is turned off.
4553 pub enable_final_backup: std::option::Option<bool>,
4554
4555 /// Optional. The description of the final backup.
4556 pub final_backup_description: std::string::String,
4557
4558 pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4559
4560 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4561}
4562
4563impl SqlInstancesDeleteRequest {
4564 pub fn new() -> Self {
4565 std::default::Default::default()
4566 }
4567
4568 /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
4569 ///
4570 /// # Example
4571 /// ```ignore,no_run
4572 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4573 /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
4574 /// ```
4575 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4576 self.instance = v.into();
4577 self
4578 }
4579
4580 /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
4581 ///
4582 /// # Example
4583 /// ```ignore,no_run
4584 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4585 /// let x = SqlInstancesDeleteRequest::new().set_project("example");
4586 /// ```
4587 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4588 self.project = v.into();
4589 self
4590 }
4591
4592 /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4593 ///
4594 /// # Example
4595 /// ```ignore,no_run
4596 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4597 /// let x = SqlInstancesDeleteRequest::new().set_enable_final_backup(true);
4598 /// ```
4599 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
4600 where
4601 T: std::convert::Into<bool>,
4602 {
4603 self.enable_final_backup = std::option::Option::Some(v.into());
4604 self
4605 }
4606
4607 /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4608 ///
4609 /// # Example
4610 /// ```ignore,no_run
4611 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4612 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(Some(false));
4613 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(None::<bool>);
4614 /// ```
4615 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
4616 where
4617 T: std::convert::Into<bool>,
4618 {
4619 self.enable_final_backup = v.map(|x| x.into());
4620 self
4621 }
4622
4623 /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
4624 ///
4625 /// # Example
4626 /// ```ignore,no_run
4627 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4628 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_description("example");
4629 /// ```
4630 pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
4631 mut self,
4632 v: T,
4633 ) -> Self {
4634 self.final_backup_description = v.into();
4635 self
4636 }
4637
4638 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
4639 ///
4640 /// Note that all the setters affecting `expiration` are mutually
4641 /// exclusive.
4642 ///
4643 /// # Example
4644 /// ```ignore,no_run
4645 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4646 /// use google_cloud_sql_v1::model::sql_instances_delete_request::Expiration;
4647 /// let x = SqlInstancesDeleteRequest::new().set_expiration(Some(Expiration::FinalBackupTtlDays(42)));
4648 /// ```
4649 pub fn set_expiration<
4650 T: std::convert::Into<
4651 std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4652 >,
4653 >(
4654 mut self,
4655 v: T,
4656 ) -> Self {
4657 self.expiration = v.into();
4658 self
4659 }
4660
4661 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4662 /// if it holds a `FinalBackupTtlDays`, `None` if the field is not set or
4663 /// holds a different branch.
4664 pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
4665 #[allow(unreachable_patterns)]
4666 self.expiration.as_ref().and_then(|v| match v {
4667 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
4668 std::option::Option::Some(v)
4669 }
4670 _ => std::option::Option::None,
4671 })
4672 }
4673
4674 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4675 /// to hold a `FinalBackupTtlDays`.
4676 ///
4677 /// Note that all the setters affecting `expiration` are
4678 /// mutually exclusive.
4679 ///
4680 /// # Example
4681 /// ```ignore,no_run
4682 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4683 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_ttl_days(42);
4684 /// assert!(x.final_backup_ttl_days().is_some());
4685 /// assert!(x.final_backup_expiry_time().is_none());
4686 /// ```
4687 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4688 self.expiration = std::option::Option::Some(
4689 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
4690 );
4691 self
4692 }
4693
4694 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4695 /// if it holds a `FinalBackupExpiryTime`, `None` if the field is not set or
4696 /// holds a different branch.
4697 pub fn final_backup_expiry_time(
4698 &self,
4699 ) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4700 #[allow(unreachable_patterns)]
4701 self.expiration.as_ref().and_then(|v| match v {
4702 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
4703 std::option::Option::Some(v)
4704 }
4705 _ => std::option::Option::None,
4706 })
4707 }
4708
4709 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4710 /// to hold a `FinalBackupExpiryTime`.
4711 ///
4712 /// Note that all the setters affecting `expiration` are
4713 /// mutually exclusive.
4714 ///
4715 /// # Example
4716 /// ```ignore,no_run
4717 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4718 /// use wkt::Timestamp;
4719 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_expiry_time(Timestamp::default()/* use setters */);
4720 /// assert!(x.final_backup_expiry_time().is_some());
4721 /// assert!(x.final_backup_ttl_days().is_none());
4722 /// ```
4723 pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4724 mut self,
4725 v: T,
4726 ) -> Self {
4727 self.expiration = std::option::Option::Some(
4728 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
4729 );
4730 self
4731 }
4732}
4733
4734impl wkt::message::Message for SqlInstancesDeleteRequest {
4735 fn typename() -> &'static str {
4736 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
4737 }
4738}
4739
4740/// Defines additional types related to [SqlInstancesDeleteRequest].
4741pub mod sql_instances_delete_request {
4742 #[allow(unused_imports)]
4743 use super::*;
4744
4745 #[derive(Clone, Debug, PartialEq)]
4746 #[non_exhaustive]
4747 pub enum Expiration {
4748 /// Optional. Retention period of the final backup.
4749 FinalBackupTtlDays(i64),
4750 /// Optional. Final Backup expiration time.
4751 /// Timestamp in UTC of when this resource is considered expired.
4752 FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
4753 }
4754}
4755
4756/// Instance demote master request.
4757#[derive(Clone, Default, PartialEq)]
4758#[non_exhaustive]
4759pub struct SqlInstancesDemoteMasterRequest {
4760 /// Cloud SQL instance name.
4761 pub instance: std::string::String,
4762
4763 /// ID of the project that contains the instance.
4764 pub project: std::string::String,
4765
4766 pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
4767
4768 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4769}
4770
4771impl SqlInstancesDemoteMasterRequest {
4772 pub fn new() -> Self {
4773 std::default::Default::default()
4774 }
4775
4776 /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
4777 ///
4778 /// # Example
4779 /// ```ignore,no_run
4780 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4781 /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
4782 /// ```
4783 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4784 self.instance = v.into();
4785 self
4786 }
4787
4788 /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
4789 ///
4790 /// # Example
4791 /// ```ignore,no_run
4792 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4793 /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
4794 /// ```
4795 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4796 self.project = v.into();
4797 self
4798 }
4799
4800 /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4801 ///
4802 /// # Example
4803 /// ```ignore,no_run
4804 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4805 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4806 /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
4807 /// ```
4808 pub fn set_body<T>(mut self, v: T) -> Self
4809 where
4810 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4811 {
4812 self.body = std::option::Option::Some(v.into());
4813 self
4814 }
4815
4816 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4817 ///
4818 /// # Example
4819 /// ```ignore,no_run
4820 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4821 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4822 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
4823 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
4824 /// ```
4825 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4826 where
4827 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4828 {
4829 self.body = v.map(|x| x.into());
4830 self
4831 }
4832}
4833
4834impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
4835 fn typename() -> &'static str {
4836 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
4837 }
4838}
4839
4840/// Instance demote request.
4841#[derive(Clone, Default, PartialEq)]
4842#[non_exhaustive]
4843pub struct SqlInstancesDemoteRequest {
4844 /// Required. Cloud SQL instance name.
4845 pub instance: std::string::String,
4846
4847 /// Required. ID of the project that contains the instance.
4848 pub project: std::string::String,
4849
4850 /// Required. The request body.
4851 pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
4852
4853 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4854}
4855
4856impl SqlInstancesDemoteRequest {
4857 pub fn new() -> Self {
4858 std::default::Default::default()
4859 }
4860
4861 /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
4862 ///
4863 /// # Example
4864 /// ```ignore,no_run
4865 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4866 /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
4867 /// ```
4868 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4869 self.instance = v.into();
4870 self
4871 }
4872
4873 /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
4874 ///
4875 /// # Example
4876 /// ```ignore,no_run
4877 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4878 /// let x = SqlInstancesDemoteRequest::new().set_project("example");
4879 /// ```
4880 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4881 self.project = v.into();
4882 self
4883 }
4884
4885 /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4886 ///
4887 /// # Example
4888 /// ```ignore,no_run
4889 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4890 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4891 /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
4892 /// ```
4893 pub fn set_body<T>(mut self, v: T) -> Self
4894 where
4895 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4896 {
4897 self.body = std::option::Option::Some(v.into());
4898 self
4899 }
4900
4901 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4902 ///
4903 /// # Example
4904 /// ```ignore,no_run
4905 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4906 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4907 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
4908 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
4909 /// ```
4910 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4911 where
4912 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4913 {
4914 self.body = v.map(|x| x.into());
4915 self
4916 }
4917}
4918
4919impl wkt::message::Message for SqlInstancesDemoteRequest {
4920 fn typename() -> &'static str {
4921 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
4922 }
4923}
4924
4925/// Instance export request.
4926#[derive(Clone, Default, PartialEq)]
4927#[non_exhaustive]
4928pub struct SqlInstancesExportRequest {
4929 /// Cloud SQL instance ID. This does not include the project ID.
4930 pub instance: std::string::String,
4931
4932 /// Project ID of the project that contains the instance to be exported.
4933 pub project: std::string::String,
4934
4935 pub body: std::option::Option<crate::model::InstancesExportRequest>,
4936
4937 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4938}
4939
4940impl SqlInstancesExportRequest {
4941 pub fn new() -> Self {
4942 std::default::Default::default()
4943 }
4944
4945 /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
4946 ///
4947 /// # Example
4948 /// ```ignore,no_run
4949 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4950 /// let x = SqlInstancesExportRequest::new().set_instance("example");
4951 /// ```
4952 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4953 self.instance = v.into();
4954 self
4955 }
4956
4957 /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
4958 ///
4959 /// # Example
4960 /// ```ignore,no_run
4961 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4962 /// let x = SqlInstancesExportRequest::new().set_project("example");
4963 /// ```
4964 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4965 self.project = v.into();
4966 self
4967 }
4968
4969 /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
4970 ///
4971 /// # Example
4972 /// ```ignore,no_run
4973 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4974 /// use google_cloud_sql_v1::model::InstancesExportRequest;
4975 /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
4976 /// ```
4977 pub fn set_body<T>(mut self, v: T) -> Self
4978 where
4979 T: std::convert::Into<crate::model::InstancesExportRequest>,
4980 {
4981 self.body = std::option::Option::Some(v.into());
4982 self
4983 }
4984
4985 /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
4986 ///
4987 /// # Example
4988 /// ```ignore,no_run
4989 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4990 /// use google_cloud_sql_v1::model::InstancesExportRequest;
4991 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
4992 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
4993 /// ```
4994 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4995 where
4996 T: std::convert::Into<crate::model::InstancesExportRequest>,
4997 {
4998 self.body = v.map(|x| x.into());
4999 self
5000 }
5001}
5002
5003impl wkt::message::Message for SqlInstancesExportRequest {
5004 fn typename() -> &'static str {
5005 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
5006 }
5007}
5008
5009/// Instance failover request.
5010#[derive(Clone, Default, PartialEq)]
5011#[non_exhaustive]
5012pub struct SqlInstancesFailoverRequest {
5013 /// Cloud SQL instance ID. This does not include the project ID.
5014 pub instance: std::string::String,
5015
5016 /// ID of the project that contains the read replica.
5017 pub project: std::string::String,
5018
5019 pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
5020
5021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5022}
5023
5024impl SqlInstancesFailoverRequest {
5025 pub fn new() -> Self {
5026 std::default::Default::default()
5027 }
5028
5029 /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
5030 ///
5031 /// # Example
5032 /// ```ignore,no_run
5033 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5034 /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
5035 /// ```
5036 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5037 self.instance = v.into();
5038 self
5039 }
5040
5041 /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
5042 ///
5043 /// # Example
5044 /// ```ignore,no_run
5045 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5046 /// let x = SqlInstancesFailoverRequest::new().set_project("example");
5047 /// ```
5048 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5049 self.project = v.into();
5050 self
5051 }
5052
5053 /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5054 ///
5055 /// # Example
5056 /// ```ignore,no_run
5057 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5058 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5059 /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
5060 /// ```
5061 pub fn set_body<T>(mut self, v: T) -> Self
5062 where
5063 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5064 {
5065 self.body = std::option::Option::Some(v.into());
5066 self
5067 }
5068
5069 /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5070 ///
5071 /// # Example
5072 /// ```ignore,no_run
5073 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5074 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5075 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
5076 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
5077 /// ```
5078 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5079 where
5080 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5081 {
5082 self.body = v.map(|x| x.into());
5083 self
5084 }
5085}
5086
5087impl wkt::message::Message for SqlInstancesFailoverRequest {
5088 fn typename() -> &'static str {
5089 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
5090 }
5091}
5092
5093/// Instance get request.
5094#[derive(Clone, Default, PartialEq)]
5095#[non_exhaustive]
5096pub struct SqlInstancesGetRequest {
5097 /// Required. Database instance ID. This does not include the project ID.
5098 pub instance: std::string::String,
5099
5100 /// Required. Project ID of the project that contains the instance.
5101 pub project: std::string::String,
5102
5103 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5104}
5105
5106impl SqlInstancesGetRequest {
5107 pub fn new() -> Self {
5108 std::default::Default::default()
5109 }
5110
5111 /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
5112 ///
5113 /// # Example
5114 /// ```ignore,no_run
5115 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5116 /// let x = SqlInstancesGetRequest::new().set_instance("example");
5117 /// ```
5118 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5119 self.instance = v.into();
5120 self
5121 }
5122
5123 /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
5124 ///
5125 /// # Example
5126 /// ```ignore,no_run
5127 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5128 /// let x = SqlInstancesGetRequest::new().set_project("example");
5129 /// ```
5130 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5131 self.project = v.into();
5132 self
5133 }
5134}
5135
5136impl wkt::message::Message for SqlInstancesGetRequest {
5137 fn typename() -> &'static str {
5138 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
5139 }
5140}
5141
5142/// Instance import request.
5143#[derive(Clone, Default, PartialEq)]
5144#[non_exhaustive]
5145pub struct SqlInstancesImportRequest {
5146 /// Cloud SQL instance ID. This does not include the project ID.
5147 pub instance: std::string::String,
5148
5149 /// Project ID of the project that contains the instance.
5150 pub project: std::string::String,
5151
5152 pub body: std::option::Option<crate::model::InstancesImportRequest>,
5153
5154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5155}
5156
5157impl SqlInstancesImportRequest {
5158 pub fn new() -> Self {
5159 std::default::Default::default()
5160 }
5161
5162 /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
5163 ///
5164 /// # Example
5165 /// ```ignore,no_run
5166 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5167 /// let x = SqlInstancesImportRequest::new().set_instance("example");
5168 /// ```
5169 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5170 self.instance = v.into();
5171 self
5172 }
5173
5174 /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
5175 ///
5176 /// # Example
5177 /// ```ignore,no_run
5178 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5179 /// let x = SqlInstancesImportRequest::new().set_project("example");
5180 /// ```
5181 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5182 self.project = v.into();
5183 self
5184 }
5185
5186 /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
5187 ///
5188 /// # Example
5189 /// ```ignore,no_run
5190 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5191 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5192 /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
5193 /// ```
5194 pub fn set_body<T>(mut self, v: T) -> Self
5195 where
5196 T: std::convert::Into<crate::model::InstancesImportRequest>,
5197 {
5198 self.body = std::option::Option::Some(v.into());
5199 self
5200 }
5201
5202 /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
5203 ///
5204 /// # Example
5205 /// ```ignore,no_run
5206 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5207 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5208 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
5209 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
5210 /// ```
5211 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5212 where
5213 T: std::convert::Into<crate::model::InstancesImportRequest>,
5214 {
5215 self.body = v.map(|x| x.into());
5216 self
5217 }
5218}
5219
5220impl wkt::message::Message for SqlInstancesImportRequest {
5221 fn typename() -> &'static str {
5222 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
5223 }
5224}
5225
5226/// Instance insert request.
5227#[derive(Clone, Default, PartialEq)]
5228#[non_exhaustive]
5229pub struct SqlInstancesInsertRequest {
5230 /// Project ID of the project to which the newly created Cloud SQL instances
5231 /// should belong.
5232 pub project: std::string::String,
5233
5234 pub body: std::option::Option<crate::model::DatabaseInstance>,
5235
5236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5237}
5238
5239impl SqlInstancesInsertRequest {
5240 pub fn new() -> Self {
5241 std::default::Default::default()
5242 }
5243
5244 /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
5245 ///
5246 /// # Example
5247 /// ```ignore,no_run
5248 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5249 /// let x = SqlInstancesInsertRequest::new().set_project("example");
5250 /// ```
5251 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5252 self.project = v.into();
5253 self
5254 }
5255
5256 /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
5257 ///
5258 /// # Example
5259 /// ```ignore,no_run
5260 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5261 /// use google_cloud_sql_v1::model::DatabaseInstance;
5262 /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5263 /// ```
5264 pub fn set_body<T>(mut self, v: T) -> Self
5265 where
5266 T: std::convert::Into<crate::model::DatabaseInstance>,
5267 {
5268 self.body = std::option::Option::Some(v.into());
5269 self
5270 }
5271
5272 /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
5273 ///
5274 /// # Example
5275 /// ```ignore,no_run
5276 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5277 /// use google_cloud_sql_v1::model::DatabaseInstance;
5278 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5279 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5280 /// ```
5281 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5282 where
5283 T: std::convert::Into<crate::model::DatabaseInstance>,
5284 {
5285 self.body = v.map(|x| x.into());
5286 self
5287 }
5288}
5289
5290impl wkt::message::Message for SqlInstancesInsertRequest {
5291 fn typename() -> &'static str {
5292 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
5293 }
5294}
5295
5296/// Instance list request.
5297#[derive(Clone, Default, PartialEq)]
5298#[non_exhaustive]
5299pub struct SqlInstancesListRequest {
5300 /// A filter expression that filters resources listed in the response.
5301 /// The expression is in the form of field:value. For example,
5302 /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
5303 /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
5304 ///
5305 /// Multiple filter queries are space-separated. For example.
5306 /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
5307 /// expression is an AND expression. However, you can include AND and OR
5308 /// expressions explicitly.
5309 pub filter: std::string::String,
5310
5311 /// The maximum number of instances to return. The service may return fewer
5312 /// than this value.
5313 /// If unspecified, at most 500 instances are returned.
5314 /// The maximum value is 1000; values above 1000 are coerced to 1000.
5315 pub max_results: u32,
5316
5317 /// A previously-returned page token representing part of the larger set of
5318 /// results to view.
5319 pub page_token: std::string::String,
5320
5321 /// Project ID of the project for which to list Cloud SQL instances.
5322 pub project: std::string::String,
5323
5324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5325}
5326
5327impl SqlInstancesListRequest {
5328 pub fn new() -> Self {
5329 std::default::Default::default()
5330 }
5331
5332 /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
5333 ///
5334 /// # Example
5335 /// ```ignore,no_run
5336 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5337 /// let x = SqlInstancesListRequest::new().set_filter("example");
5338 /// ```
5339 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5340 self.filter = v.into();
5341 self
5342 }
5343
5344 /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
5345 ///
5346 /// # Example
5347 /// ```ignore,no_run
5348 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5349 /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
5350 /// ```
5351 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
5352 self.max_results = v.into();
5353 self
5354 }
5355
5356 /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
5357 ///
5358 /// # Example
5359 /// ```ignore,no_run
5360 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5361 /// let x = SqlInstancesListRequest::new().set_page_token("example");
5362 /// ```
5363 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5364 self.page_token = v.into();
5365 self
5366 }
5367
5368 /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
5369 ///
5370 /// # Example
5371 /// ```ignore,no_run
5372 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5373 /// let x = SqlInstancesListRequest::new().set_project("example");
5374 /// ```
5375 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5376 self.project = v.into();
5377 self
5378 }
5379}
5380
5381impl wkt::message::Message for SqlInstancesListRequest {
5382 fn typename() -> &'static str {
5383 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
5384 }
5385}
5386
5387/// Instance list server CAs request.
5388#[derive(Clone, Default, PartialEq)]
5389#[non_exhaustive]
5390pub struct SqlInstancesListServerCasRequest {
5391 /// Cloud SQL instance ID. This does not include the project ID.
5392 pub instance: std::string::String,
5393
5394 /// Project ID of the project that contains the instance.
5395 pub project: std::string::String,
5396
5397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5398}
5399
5400impl SqlInstancesListServerCasRequest {
5401 pub fn new() -> Self {
5402 std::default::Default::default()
5403 }
5404
5405 /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
5406 ///
5407 /// # Example
5408 /// ```ignore,no_run
5409 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5410 /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
5411 /// ```
5412 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5413 self.instance = v.into();
5414 self
5415 }
5416
5417 /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
5418 ///
5419 /// # Example
5420 /// ```ignore,no_run
5421 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5422 /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
5423 /// ```
5424 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5425 self.project = v.into();
5426 self
5427 }
5428}
5429
5430impl wkt::message::Message for SqlInstancesListServerCasRequest {
5431 fn typename() -> &'static str {
5432 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
5433 }
5434}
5435
5436/// Instance list server certificates request.
5437#[derive(Clone, Default, PartialEq)]
5438#[non_exhaustive]
5439pub struct SqlInstancesListServerCertificatesRequest {
5440 /// Required. Cloud SQL instance ID. This does not include the project ID.
5441 pub instance: std::string::String,
5442
5443 /// Required. Project ID of the project that contains the instance.
5444 pub project: std::string::String,
5445
5446 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5447}
5448
5449impl SqlInstancesListServerCertificatesRequest {
5450 pub fn new() -> Self {
5451 std::default::Default::default()
5452 }
5453
5454 /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
5455 ///
5456 /// # Example
5457 /// ```ignore,no_run
5458 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5459 /// let x = SqlInstancesListServerCertificatesRequest::new().set_instance("example");
5460 /// ```
5461 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5462 self.instance = v.into();
5463 self
5464 }
5465
5466 /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
5467 ///
5468 /// # Example
5469 /// ```ignore,no_run
5470 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5471 /// let x = SqlInstancesListServerCertificatesRequest::new().set_project("example");
5472 /// ```
5473 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5474 self.project = v.into();
5475 self
5476 }
5477}
5478
5479impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
5480 fn typename() -> &'static str {
5481 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
5482 }
5483}
5484
5485/// Instance list Entra ID certificates request.
5486#[derive(Clone, Default, PartialEq)]
5487#[non_exhaustive]
5488pub struct SqlInstancesListEntraIdCertificatesRequest {
5489 /// Required. Cloud SQL instance ID. This does not include the project ID.
5490 pub instance: std::string::String,
5491
5492 /// Required. Project ID of the project that contains the instance.
5493 pub project: std::string::String,
5494
5495 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5496}
5497
5498impl SqlInstancesListEntraIdCertificatesRequest {
5499 pub fn new() -> Self {
5500 std::default::Default::default()
5501 }
5502
5503 /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
5504 ///
5505 /// # Example
5506 /// ```ignore,no_run
5507 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5508 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_instance("example");
5509 /// ```
5510 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5511 self.instance = v.into();
5512 self
5513 }
5514
5515 /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
5516 ///
5517 /// # Example
5518 /// ```ignore,no_run
5519 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5520 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_project("example");
5521 /// ```
5522 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5523 self.project = v.into();
5524 self
5525 }
5526}
5527
5528impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
5529 fn typename() -> &'static str {
5530 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
5531 }
5532}
5533
5534/// Instance patch request.
5535#[derive(Clone, Default, PartialEq)]
5536#[non_exhaustive]
5537pub struct SqlInstancesPatchRequest {
5538 /// Cloud SQL instance ID. This does not include the project ID.
5539 pub instance: std::string::String,
5540
5541 /// Project ID of the project that contains the instance.
5542 pub project: std::string::String,
5543
5544 pub body: std::option::Option<crate::model::DatabaseInstance>,
5545
5546 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5547}
5548
5549impl SqlInstancesPatchRequest {
5550 pub fn new() -> Self {
5551 std::default::Default::default()
5552 }
5553
5554 /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
5555 ///
5556 /// # Example
5557 /// ```ignore,no_run
5558 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5559 /// let x = SqlInstancesPatchRequest::new().set_instance("example");
5560 /// ```
5561 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5562 self.instance = v.into();
5563 self
5564 }
5565
5566 /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
5567 ///
5568 /// # Example
5569 /// ```ignore,no_run
5570 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5571 /// let x = SqlInstancesPatchRequest::new().set_project("example");
5572 /// ```
5573 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5574 self.project = v.into();
5575 self
5576 }
5577
5578 /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
5579 ///
5580 /// # Example
5581 /// ```ignore,no_run
5582 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5583 /// use google_cloud_sql_v1::model::DatabaseInstance;
5584 /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5585 /// ```
5586 pub fn set_body<T>(mut self, v: T) -> Self
5587 where
5588 T: std::convert::Into<crate::model::DatabaseInstance>,
5589 {
5590 self.body = std::option::Option::Some(v.into());
5591 self
5592 }
5593
5594 /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
5595 ///
5596 /// # Example
5597 /// ```ignore,no_run
5598 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5599 /// use google_cloud_sql_v1::model::DatabaseInstance;
5600 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5601 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5602 /// ```
5603 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5604 where
5605 T: std::convert::Into<crate::model::DatabaseInstance>,
5606 {
5607 self.body = v.map(|x| x.into());
5608 self
5609 }
5610}
5611
5612impl wkt::message::Message for SqlInstancesPatchRequest {
5613 fn typename() -> &'static str {
5614 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
5615 }
5616}
5617
5618/// Instance promote replica request.
5619#[derive(Clone, Default, PartialEq)]
5620#[non_exhaustive]
5621pub struct SqlInstancesPromoteReplicaRequest {
5622 /// Cloud SQL read replica instance name.
5623 pub instance: std::string::String,
5624
5625 /// ID of the project that contains the read replica.
5626 pub project: std::string::String,
5627
5628 /// Set to true to invoke a replica failover to the DR
5629 /// replica. As part of replica failover, the promote operation attempts
5630 /// to add the original primary instance as a replica of the promoted
5631 /// DR replica when the original primary instance comes back online.
5632 /// If set to false or not specified, then the original primary
5633 /// instance becomes an independent Cloud SQL primary instance.
5634 pub failover: bool,
5635
5636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5637}
5638
5639impl SqlInstancesPromoteReplicaRequest {
5640 pub fn new() -> Self {
5641 std::default::Default::default()
5642 }
5643
5644 /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
5645 ///
5646 /// # Example
5647 /// ```ignore,no_run
5648 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5649 /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
5650 /// ```
5651 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5652 self.instance = v.into();
5653 self
5654 }
5655
5656 /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
5657 ///
5658 /// # Example
5659 /// ```ignore,no_run
5660 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5661 /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
5662 /// ```
5663 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5664 self.project = v.into();
5665 self
5666 }
5667
5668 /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
5669 ///
5670 /// # Example
5671 /// ```ignore,no_run
5672 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5673 /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
5674 /// ```
5675 pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5676 self.failover = v.into();
5677 self
5678 }
5679}
5680
5681impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
5682 fn typename() -> &'static str {
5683 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
5684 }
5685}
5686
5687/// Instance switchover request.
5688#[derive(Clone, Default, PartialEq)]
5689#[non_exhaustive]
5690pub struct SqlInstancesSwitchoverRequest {
5691 /// Cloud SQL read replica instance name.
5692 pub instance: std::string::String,
5693
5694 /// ID of the project that contains the replica.
5695 pub project: std::string::String,
5696
5697 /// Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
5698 /// timeout, which is a sum of all database operations. Default value is 10
5699 /// minutes and can be modified to a maximum value of 24 hours.
5700 pub db_timeout: std::option::Option<wkt::Duration>,
5701
5702 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5703}
5704
5705impl SqlInstancesSwitchoverRequest {
5706 pub fn new() -> Self {
5707 std::default::Default::default()
5708 }
5709
5710 /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
5711 ///
5712 /// # Example
5713 /// ```ignore,no_run
5714 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5715 /// let x = SqlInstancesSwitchoverRequest::new().set_instance("example");
5716 /// ```
5717 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5718 self.instance = v.into();
5719 self
5720 }
5721
5722 /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
5723 ///
5724 /// # Example
5725 /// ```ignore,no_run
5726 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5727 /// let x = SqlInstancesSwitchoverRequest::new().set_project("example");
5728 /// ```
5729 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5730 self.project = v.into();
5731 self
5732 }
5733
5734 /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5735 ///
5736 /// # Example
5737 /// ```ignore,no_run
5738 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5739 /// use wkt::Duration;
5740 /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
5741 /// ```
5742 pub fn set_db_timeout<T>(mut self, v: T) -> Self
5743 where
5744 T: std::convert::Into<wkt::Duration>,
5745 {
5746 self.db_timeout = std::option::Option::Some(v.into());
5747 self
5748 }
5749
5750 /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5751 ///
5752 /// # Example
5753 /// ```ignore,no_run
5754 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5755 /// use wkt::Duration;
5756 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
5757 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
5758 /// ```
5759 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5760 where
5761 T: std::convert::Into<wkt::Duration>,
5762 {
5763 self.db_timeout = v.map(|x| x.into());
5764 self
5765 }
5766}
5767
5768impl wkt::message::Message for SqlInstancesSwitchoverRequest {
5769 fn typename() -> &'static str {
5770 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
5771 }
5772}
5773
5774/// Instance reset SSL config request.
5775#[derive(Clone, Default, PartialEq)]
5776#[non_exhaustive]
5777pub struct SqlInstancesResetSslConfigRequest {
5778 /// Cloud SQL instance ID. This does not include the project ID.
5779 pub instance: std::string::String,
5780
5781 /// Project ID of the project that contains the instance.
5782 pub project: std::string::String,
5783
5784 /// Optional. Reset SSL mode to use.
5785 pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
5786
5787 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5788}
5789
5790impl SqlInstancesResetSslConfigRequest {
5791 pub fn new() -> Self {
5792 std::default::Default::default()
5793 }
5794
5795 /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
5796 ///
5797 /// # Example
5798 /// ```ignore,no_run
5799 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5800 /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
5801 /// ```
5802 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5803 self.instance = v.into();
5804 self
5805 }
5806
5807 /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
5808 ///
5809 /// # Example
5810 /// ```ignore,no_run
5811 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5812 /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
5813 /// ```
5814 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5815 self.project = v.into();
5816 self
5817 }
5818
5819 /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
5820 ///
5821 /// # Example
5822 /// ```ignore,no_run
5823 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5824 /// use google_cloud_sql_v1::model::sql_instances_reset_ssl_config_request::ResetSslMode;
5825 /// let x0 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::All);
5826 /// let x1 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::SyncFromPrimary);
5827 /// ```
5828 pub fn set_mode<
5829 T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
5830 >(
5831 mut self,
5832 v: T,
5833 ) -> Self {
5834 self.mode = v.into();
5835 self
5836 }
5837}
5838
5839impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
5840 fn typename() -> &'static str {
5841 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
5842 }
5843}
5844
5845/// Defines additional types related to [SqlInstancesResetSslConfigRequest].
5846pub mod sql_instances_reset_ssl_config_request {
5847 #[allow(unused_imports)]
5848 use super::*;
5849
5850 /// Reset SSL mode to selectively refresh the SSL materials.
5851 ///
5852 /// # Working with unknown values
5853 ///
5854 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5855 /// additional enum variants at any time. Adding new variants is not considered
5856 /// a breaking change. Applications should write their code in anticipation of:
5857 ///
5858 /// - New values appearing in future releases of the client library, **and**
5859 /// - New values received dynamically, without application changes.
5860 ///
5861 /// Please consult the [Working with enums] section in the user guide for some
5862 /// guidelines.
5863 ///
5864 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5865 #[derive(Clone, Debug, PartialEq)]
5866 #[non_exhaustive]
5867 pub enum ResetSslMode {
5868 /// Reset SSL mode is not specified.
5869 Unspecified,
5870 /// Refresh all TLS configs. This is the default behaviour.
5871 All,
5872 /// Refreshes the replication-related TLS configuration settings provided by
5873 /// the primary instance.
5874 /// Not applicable to on-premises replication instances.
5875 SyncFromPrimary,
5876 /// If set, the enum was initialized with an unknown value.
5877 ///
5878 /// Applications can examine the value using [ResetSslMode::value] or
5879 /// [ResetSslMode::name].
5880 UnknownValue(reset_ssl_mode::UnknownValue),
5881 }
5882
5883 #[doc(hidden)]
5884 pub mod reset_ssl_mode {
5885 #[allow(unused_imports)]
5886 use super::*;
5887 #[derive(Clone, Debug, PartialEq)]
5888 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5889 }
5890
5891 impl ResetSslMode {
5892 /// Gets the enum value.
5893 ///
5894 /// Returns `None` if the enum contains an unknown value deserialized from
5895 /// the string representation of enums.
5896 pub fn value(&self) -> std::option::Option<i32> {
5897 match self {
5898 Self::Unspecified => std::option::Option::Some(0),
5899 Self::All => std::option::Option::Some(1),
5900 Self::SyncFromPrimary => std::option::Option::Some(2),
5901 Self::UnknownValue(u) => u.0.value(),
5902 }
5903 }
5904
5905 /// Gets the enum value as a string.
5906 ///
5907 /// Returns `None` if the enum contains an unknown value deserialized from
5908 /// the integer representation of enums.
5909 pub fn name(&self) -> std::option::Option<&str> {
5910 match self {
5911 Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
5912 Self::All => std::option::Option::Some("ALL"),
5913 Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
5914 Self::UnknownValue(u) => u.0.name(),
5915 }
5916 }
5917 }
5918
5919 impl std::default::Default for ResetSslMode {
5920 fn default() -> Self {
5921 use std::convert::From;
5922 Self::from(0)
5923 }
5924 }
5925
5926 impl std::fmt::Display for ResetSslMode {
5927 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5928 wkt::internal::display_enum(f, self.name(), self.value())
5929 }
5930 }
5931
5932 impl std::convert::From<i32> for ResetSslMode {
5933 fn from(value: i32) -> Self {
5934 match value {
5935 0 => Self::Unspecified,
5936 1 => Self::All,
5937 2 => Self::SyncFromPrimary,
5938 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
5939 wkt::internal::UnknownEnumValue::Integer(value),
5940 )),
5941 }
5942 }
5943 }
5944
5945 impl std::convert::From<&str> for ResetSslMode {
5946 fn from(value: &str) -> Self {
5947 use std::string::ToString;
5948 match value {
5949 "RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
5950 "ALL" => Self::All,
5951 "SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
5952 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
5953 wkt::internal::UnknownEnumValue::String(value.to_string()),
5954 )),
5955 }
5956 }
5957 }
5958
5959 impl serde::ser::Serialize for ResetSslMode {
5960 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5961 where
5962 S: serde::Serializer,
5963 {
5964 match self {
5965 Self::Unspecified => serializer.serialize_i32(0),
5966 Self::All => serializer.serialize_i32(1),
5967 Self::SyncFromPrimary => serializer.serialize_i32(2),
5968 Self::UnknownValue(u) => u.0.serialize(serializer),
5969 }
5970 }
5971 }
5972
5973 impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
5974 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5975 where
5976 D: serde::Deserializer<'de>,
5977 {
5978 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
5979 ".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
5980 ))
5981 }
5982 }
5983}
5984
5985/// Instance restart request.
5986#[derive(Clone, Default, PartialEq)]
5987#[non_exhaustive]
5988pub struct SqlInstancesRestartRequest {
5989 /// Cloud SQL instance ID. This does not include the project ID.
5990 pub instance: std::string::String,
5991
5992 /// Project ID of the project that contains the instance to be restarted.
5993 pub project: std::string::String,
5994
5995 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5996}
5997
5998impl SqlInstancesRestartRequest {
5999 pub fn new() -> Self {
6000 std::default::Default::default()
6001 }
6002
6003 /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
6004 ///
6005 /// # Example
6006 /// ```ignore,no_run
6007 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6008 /// let x = SqlInstancesRestartRequest::new().set_instance("example");
6009 /// ```
6010 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6011 self.instance = v.into();
6012 self
6013 }
6014
6015 /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
6016 ///
6017 /// # Example
6018 /// ```ignore,no_run
6019 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6020 /// let x = SqlInstancesRestartRequest::new().set_project("example");
6021 /// ```
6022 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6023 self.project = v.into();
6024 self
6025 }
6026}
6027
6028impl wkt::message::Message for SqlInstancesRestartRequest {
6029 fn typename() -> &'static str {
6030 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
6031 }
6032}
6033
6034/// Instance restore backup request.
6035#[derive(Clone, Default, PartialEq)]
6036#[non_exhaustive]
6037pub struct SqlInstancesRestoreBackupRequest {
6038 /// Cloud SQL instance ID. This does not include the project ID.
6039 pub instance: std::string::String,
6040
6041 /// Project ID of the project that contains the instance.
6042 pub project: std::string::String,
6043
6044 pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
6045
6046 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6047}
6048
6049impl SqlInstancesRestoreBackupRequest {
6050 pub fn new() -> Self {
6051 std::default::Default::default()
6052 }
6053
6054 /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
6055 ///
6056 /// # Example
6057 /// ```ignore,no_run
6058 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6059 /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
6060 /// ```
6061 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6062 self.instance = v.into();
6063 self
6064 }
6065
6066 /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
6067 ///
6068 /// # Example
6069 /// ```ignore,no_run
6070 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6071 /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
6072 /// ```
6073 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6074 self.project = v.into();
6075 self
6076 }
6077
6078 /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6079 ///
6080 /// # Example
6081 /// ```ignore,no_run
6082 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6083 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6084 /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
6085 /// ```
6086 pub fn set_body<T>(mut self, v: T) -> Self
6087 where
6088 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6089 {
6090 self.body = std::option::Option::Some(v.into());
6091 self
6092 }
6093
6094 /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6095 ///
6096 /// # Example
6097 /// ```ignore,no_run
6098 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6099 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6100 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
6101 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
6102 /// ```
6103 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6104 where
6105 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6106 {
6107 self.body = v.map(|x| x.into());
6108 self
6109 }
6110}
6111
6112impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
6113 fn typename() -> &'static str {
6114 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
6115 }
6116}
6117
6118/// Instance rotate server CA request.
6119#[derive(Clone, Default, PartialEq)]
6120#[non_exhaustive]
6121pub struct SqlInstancesRotateServerCaRequest {
6122 /// Cloud SQL instance ID. This does not include the project ID.
6123 pub instance: std::string::String,
6124
6125 /// Project ID of the project that contains the instance.
6126 pub project: std::string::String,
6127
6128 pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
6129
6130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6131}
6132
6133impl SqlInstancesRotateServerCaRequest {
6134 pub fn new() -> Self {
6135 std::default::Default::default()
6136 }
6137
6138 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
6139 ///
6140 /// # Example
6141 /// ```ignore,no_run
6142 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6143 /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
6144 /// ```
6145 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6146 self.instance = v.into();
6147 self
6148 }
6149
6150 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
6151 ///
6152 /// # Example
6153 /// ```ignore,no_run
6154 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6155 /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
6156 /// ```
6157 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6158 self.project = v.into();
6159 self
6160 }
6161
6162 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6163 ///
6164 /// # Example
6165 /// ```ignore,no_run
6166 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6167 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6168 /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
6169 /// ```
6170 pub fn set_body<T>(mut self, v: T) -> Self
6171 where
6172 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6173 {
6174 self.body = std::option::Option::Some(v.into());
6175 self
6176 }
6177
6178 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6179 ///
6180 /// # Example
6181 /// ```ignore,no_run
6182 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6183 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6184 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
6185 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
6186 /// ```
6187 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6188 where
6189 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6190 {
6191 self.body = v.map(|x| x.into());
6192 self
6193 }
6194}
6195
6196impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
6197 fn typename() -> &'static str {
6198 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
6199 }
6200}
6201
6202/// Instance rotate server certificate request.
6203#[derive(Clone, Default, PartialEq)]
6204#[non_exhaustive]
6205pub struct SqlInstancesRotateServerCertificateRequest {
6206 /// Required. Cloud SQL instance ID. This does not include the project ID.
6207 pub instance: std::string::String,
6208
6209 /// Required. Project ID of the project that contains the instance.
6210 pub project: std::string::String,
6211
6212 /// Optional. Rotate server certificate request body.
6213 pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
6214
6215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6216}
6217
6218impl SqlInstancesRotateServerCertificateRequest {
6219 pub fn new() -> Self {
6220 std::default::Default::default()
6221 }
6222
6223 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
6224 ///
6225 /// # Example
6226 /// ```ignore,no_run
6227 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6228 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_instance("example");
6229 /// ```
6230 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6231 self.instance = v.into();
6232 self
6233 }
6234
6235 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
6236 ///
6237 /// # Example
6238 /// ```ignore,no_run
6239 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6240 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_project("example");
6241 /// ```
6242 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6243 self.project = v.into();
6244 self
6245 }
6246
6247 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6248 ///
6249 /// # Example
6250 /// ```ignore,no_run
6251 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6252 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6253 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_body(InstancesRotateServerCertificateRequest::default()/* use setters */);
6254 /// ```
6255 pub fn set_body<T>(mut self, v: T) -> Self
6256 where
6257 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6258 {
6259 self.body = std::option::Option::Some(v.into());
6260 self
6261 }
6262
6263 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6264 ///
6265 /// # Example
6266 /// ```ignore,no_run
6267 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6268 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6269 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(Some(InstancesRotateServerCertificateRequest::default()/* use setters */));
6270 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(None::<InstancesRotateServerCertificateRequest>);
6271 /// ```
6272 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6273 where
6274 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6275 {
6276 self.body = v.map(|x| x.into());
6277 self
6278 }
6279}
6280
6281impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
6282 fn typename() -> &'static str {
6283 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
6284 }
6285}
6286
6287/// Instance rotate server certificate request.
6288#[derive(Clone, Default, PartialEq)]
6289#[non_exhaustive]
6290pub struct SqlInstancesRotateEntraIdCertificateRequest {
6291 /// Required. Cloud SQL instance ID. This does not include the project ID.
6292 pub instance: std::string::String,
6293
6294 /// Required. Project ID of the project that contains the instance.
6295 pub project: std::string::String,
6296
6297 /// Optional. Rotate Entra ID certificate request body.
6298 pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
6299
6300 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6301}
6302
6303impl SqlInstancesRotateEntraIdCertificateRequest {
6304 pub fn new() -> Self {
6305 std::default::Default::default()
6306 }
6307
6308 /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
6309 ///
6310 /// # Example
6311 /// ```ignore,no_run
6312 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6313 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_instance("example");
6314 /// ```
6315 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6316 self.instance = v.into();
6317 self
6318 }
6319
6320 /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
6321 ///
6322 /// # Example
6323 /// ```ignore,no_run
6324 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6325 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_project("example");
6326 /// ```
6327 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6328 self.project = v.into();
6329 self
6330 }
6331
6332 /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6333 ///
6334 /// # Example
6335 /// ```ignore,no_run
6336 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6337 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6338 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_body(InstancesRotateEntraIdCertificateRequest::default()/* use setters */);
6339 /// ```
6340 pub fn set_body<T>(mut self, v: T) -> Self
6341 where
6342 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6343 {
6344 self.body = std::option::Option::Some(v.into());
6345 self
6346 }
6347
6348 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6349 ///
6350 /// # Example
6351 /// ```ignore,no_run
6352 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6353 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6354 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(Some(InstancesRotateEntraIdCertificateRequest::default()/* use setters */));
6355 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(None::<InstancesRotateEntraIdCertificateRequest>);
6356 /// ```
6357 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6358 where
6359 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6360 {
6361 self.body = v.map(|x| x.into());
6362 self
6363 }
6364}
6365
6366impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
6367 fn typename() -> &'static str {
6368 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
6369 }
6370}
6371
6372/// Instance start replica request.
6373#[derive(Clone, Default, PartialEq)]
6374#[non_exhaustive]
6375pub struct SqlInstancesStartReplicaRequest {
6376 /// Cloud SQL read replica instance name.
6377 pub instance: std::string::String,
6378
6379 /// ID of the project that contains the read replica.
6380 pub project: std::string::String,
6381
6382 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6383}
6384
6385impl SqlInstancesStartReplicaRequest {
6386 pub fn new() -> Self {
6387 std::default::Default::default()
6388 }
6389
6390 /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
6391 ///
6392 /// # Example
6393 /// ```ignore,no_run
6394 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6395 /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
6396 /// ```
6397 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6398 self.instance = v.into();
6399 self
6400 }
6401
6402 /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
6403 ///
6404 /// # Example
6405 /// ```ignore,no_run
6406 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6407 /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
6408 /// ```
6409 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6410 self.project = v.into();
6411 self
6412 }
6413}
6414
6415impl wkt::message::Message for SqlInstancesStartReplicaRequest {
6416 fn typename() -> &'static str {
6417 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
6418 }
6419}
6420
6421/// Instance stop replica request.
6422#[derive(Clone, Default, PartialEq)]
6423#[non_exhaustive]
6424pub struct SqlInstancesStopReplicaRequest {
6425 /// Cloud SQL read replica instance name.
6426 pub instance: std::string::String,
6427
6428 /// ID of the project that contains the read replica.
6429 pub project: std::string::String,
6430
6431 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6432}
6433
6434impl SqlInstancesStopReplicaRequest {
6435 pub fn new() -> Self {
6436 std::default::Default::default()
6437 }
6438
6439 /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
6440 ///
6441 /// # Example
6442 /// ```ignore,no_run
6443 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6444 /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
6445 /// ```
6446 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6447 self.instance = v.into();
6448 self
6449 }
6450
6451 /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
6452 ///
6453 /// # Example
6454 /// ```ignore,no_run
6455 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6456 /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
6457 /// ```
6458 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6459 self.project = v.into();
6460 self
6461 }
6462}
6463
6464impl wkt::message::Message for SqlInstancesStopReplicaRequest {
6465 fn typename() -> &'static str {
6466 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
6467 }
6468}
6469
6470/// Instance truncate log request.
6471#[derive(Clone, Default, PartialEq)]
6472#[non_exhaustive]
6473pub struct SqlInstancesTruncateLogRequest {
6474 /// Cloud SQL instance ID. This does not include the project ID.
6475 pub instance: std::string::String,
6476
6477 /// Project ID of the Cloud SQL project.
6478 pub project: std::string::String,
6479
6480 pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
6481
6482 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6483}
6484
6485impl SqlInstancesTruncateLogRequest {
6486 pub fn new() -> Self {
6487 std::default::Default::default()
6488 }
6489
6490 /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
6491 ///
6492 /// # Example
6493 /// ```ignore,no_run
6494 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6495 /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
6496 /// ```
6497 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6498 self.instance = v.into();
6499 self
6500 }
6501
6502 /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
6503 ///
6504 /// # Example
6505 /// ```ignore,no_run
6506 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6507 /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
6508 /// ```
6509 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6510 self.project = v.into();
6511 self
6512 }
6513
6514 /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6515 ///
6516 /// # Example
6517 /// ```ignore,no_run
6518 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6519 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6520 /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
6521 /// ```
6522 pub fn set_body<T>(mut self, v: T) -> Self
6523 where
6524 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6525 {
6526 self.body = std::option::Option::Some(v.into());
6527 self
6528 }
6529
6530 /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6531 ///
6532 /// # Example
6533 /// ```ignore,no_run
6534 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6535 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6536 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
6537 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
6538 /// ```
6539 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6540 where
6541 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6542 {
6543 self.body = v.map(|x| x.into());
6544 self
6545 }
6546}
6547
6548impl wkt::message::Message for SqlInstancesTruncateLogRequest {
6549 fn typename() -> &'static str {
6550 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
6551 }
6552}
6553
6554/// Instance perform disk shrink request.
6555#[derive(Clone, Default, PartialEq)]
6556#[non_exhaustive]
6557pub struct SqlInstancesPerformDiskShrinkRequest {
6558 /// Cloud SQL instance ID. This does not include the project ID.
6559 pub instance: std::string::String,
6560
6561 /// Project ID of the project that contains the instance.
6562 pub project: std::string::String,
6563
6564 /// Perform disk shrink context.
6565 pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
6566
6567 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6568}
6569
6570impl SqlInstancesPerformDiskShrinkRequest {
6571 pub fn new() -> Self {
6572 std::default::Default::default()
6573 }
6574
6575 /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
6576 ///
6577 /// # Example
6578 /// ```ignore,no_run
6579 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6580 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
6581 /// ```
6582 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6583 self.instance = v.into();
6584 self
6585 }
6586
6587 /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
6588 ///
6589 /// # Example
6590 /// ```ignore,no_run
6591 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6592 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
6593 /// ```
6594 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6595 self.project = v.into();
6596 self
6597 }
6598
6599 /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6600 ///
6601 /// # Example
6602 /// ```ignore,no_run
6603 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6604 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6605 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
6606 /// ```
6607 pub fn set_body<T>(mut self, v: T) -> Self
6608 where
6609 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6610 {
6611 self.body = std::option::Option::Some(v.into());
6612 self
6613 }
6614
6615 /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6616 ///
6617 /// # Example
6618 /// ```ignore,no_run
6619 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6620 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6621 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
6622 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
6623 /// ```
6624 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6625 where
6626 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6627 {
6628 self.body = v.map(|x| x.into());
6629 self
6630 }
6631}
6632
6633impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
6634 fn typename() -> &'static str {
6635 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
6636 }
6637}
6638
6639/// Instance update request.
6640#[derive(Clone, Default, PartialEq)]
6641#[non_exhaustive]
6642pub struct SqlInstancesUpdateRequest {
6643 /// Cloud SQL instance ID. This does not include the project ID.
6644 pub instance: std::string::String,
6645
6646 /// Project ID of the project that contains the instance.
6647 pub project: std::string::String,
6648
6649 pub body: std::option::Option<crate::model::DatabaseInstance>,
6650
6651 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6652}
6653
6654impl SqlInstancesUpdateRequest {
6655 pub fn new() -> Self {
6656 std::default::Default::default()
6657 }
6658
6659 /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
6660 ///
6661 /// # Example
6662 /// ```ignore,no_run
6663 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6664 /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
6665 /// ```
6666 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6667 self.instance = v.into();
6668 self
6669 }
6670
6671 /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
6672 ///
6673 /// # Example
6674 /// ```ignore,no_run
6675 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6676 /// let x = SqlInstancesUpdateRequest::new().set_project("example");
6677 /// ```
6678 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6679 self.project = v.into();
6680 self
6681 }
6682
6683 /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6684 ///
6685 /// # Example
6686 /// ```ignore,no_run
6687 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6688 /// use google_cloud_sql_v1::model::DatabaseInstance;
6689 /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
6690 /// ```
6691 pub fn set_body<T>(mut self, v: T) -> Self
6692 where
6693 T: std::convert::Into<crate::model::DatabaseInstance>,
6694 {
6695 self.body = std::option::Option::Some(v.into());
6696 self
6697 }
6698
6699 /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6700 ///
6701 /// # Example
6702 /// ```ignore,no_run
6703 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6704 /// use google_cloud_sql_v1::model::DatabaseInstance;
6705 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
6706 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
6707 /// ```
6708 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6709 where
6710 T: std::convert::Into<crate::model::DatabaseInstance>,
6711 {
6712 self.body = v.map(|x| x.into());
6713 self
6714 }
6715}
6716
6717impl wkt::message::Message for SqlInstancesUpdateRequest {
6718 fn typename() -> &'static str {
6719 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
6720 }
6721}
6722
6723/// Instance reschedule maintenance request.
6724#[derive(Clone, Default, PartialEq)]
6725#[non_exhaustive]
6726pub struct SqlInstancesRescheduleMaintenanceRequest {
6727 /// Cloud SQL instance ID. This does not include the project ID.
6728 pub instance: std::string::String,
6729
6730 /// ID of the project that contains the instance.
6731 pub project: std::string::String,
6732
6733 pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6734
6735 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6736}
6737
6738impl SqlInstancesRescheduleMaintenanceRequest {
6739 pub fn new() -> Self {
6740 std::default::Default::default()
6741 }
6742
6743 /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
6744 ///
6745 /// # Example
6746 /// ```ignore,no_run
6747 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6748 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
6749 /// ```
6750 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6751 self.instance = v.into();
6752 self
6753 }
6754
6755 /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
6756 ///
6757 /// # Example
6758 /// ```ignore,no_run
6759 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6760 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
6761 /// ```
6762 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6763 self.project = v.into();
6764 self
6765 }
6766
6767 /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6768 ///
6769 /// # Example
6770 /// ```ignore,no_run
6771 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6772 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6773 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
6774 /// ```
6775 pub fn set_body<T>(mut self, v: T) -> Self
6776 where
6777 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6778 {
6779 self.body = std::option::Option::Some(v.into());
6780 self
6781 }
6782
6783 /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6784 ///
6785 /// # Example
6786 /// ```ignore,no_run
6787 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6788 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6789 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
6790 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
6791 /// ```
6792 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6793 where
6794 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6795 {
6796 self.body = v.map(|x| x.into());
6797 self
6798 }
6799}
6800
6801impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
6802 fn typename() -> &'static str {
6803 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
6804 }
6805}
6806
6807/// Instance reencrypt request.
6808#[derive(Clone, Default, PartialEq)]
6809#[non_exhaustive]
6810pub struct SqlInstancesReencryptRequest {
6811 /// Cloud SQL instance ID. This does not include the project ID.
6812 pub instance: std::string::String,
6813
6814 /// ID of the project that contains the instance.
6815 pub project: std::string::String,
6816
6817 /// Reencrypt body that users request
6818 pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
6819
6820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6821}
6822
6823impl SqlInstancesReencryptRequest {
6824 pub fn new() -> Self {
6825 std::default::Default::default()
6826 }
6827
6828 /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
6829 ///
6830 /// # Example
6831 /// ```ignore,no_run
6832 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6833 /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
6834 /// ```
6835 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6836 self.instance = v.into();
6837 self
6838 }
6839
6840 /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
6841 ///
6842 /// # Example
6843 /// ```ignore,no_run
6844 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6845 /// let x = SqlInstancesReencryptRequest::new().set_project("example");
6846 /// ```
6847 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6848 self.project = v.into();
6849 self
6850 }
6851
6852 /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6853 ///
6854 /// # Example
6855 /// ```ignore,no_run
6856 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6857 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6858 /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
6859 /// ```
6860 pub fn set_body<T>(mut self, v: T) -> Self
6861 where
6862 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6863 {
6864 self.body = std::option::Option::Some(v.into());
6865 self
6866 }
6867
6868 /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6869 ///
6870 /// # Example
6871 /// ```ignore,no_run
6872 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6873 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6874 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
6875 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
6876 /// ```
6877 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6878 where
6879 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6880 {
6881 self.body = v.map(|x| x.into());
6882 self
6883 }
6884}
6885
6886impl wkt::message::Message for SqlInstancesReencryptRequest {
6887 fn typename() -> &'static str {
6888 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
6889 }
6890}
6891
6892/// Database Instance reencrypt request.
6893#[derive(Clone, Default, PartialEq)]
6894#[non_exhaustive]
6895pub struct InstancesReencryptRequest {
6896 /// Configuration specific to backup re-encryption
6897 pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
6898
6899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6900}
6901
6902impl InstancesReencryptRequest {
6903 pub fn new() -> Self {
6904 std::default::Default::default()
6905 }
6906
6907 /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6908 ///
6909 /// # Example
6910 /// ```ignore,no_run
6911 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6912 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
6913 /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
6914 /// ```
6915 pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
6916 where
6917 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
6918 {
6919 self.backup_reencryption_config = std::option::Option::Some(v.into());
6920 self
6921 }
6922
6923 /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6924 ///
6925 /// # Example
6926 /// ```ignore,no_run
6927 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6928 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
6929 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
6930 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
6931 /// ```
6932 pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6933 where
6934 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
6935 {
6936 self.backup_reencryption_config = v.map(|x| x.into());
6937 self
6938 }
6939}
6940
6941impl wkt::message::Message for InstancesReencryptRequest {
6942 fn typename() -> &'static str {
6943 "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
6944 }
6945}
6946
6947/// Backup Reencryption Config
6948#[derive(Clone, Default, PartialEq)]
6949#[non_exhaustive]
6950pub struct BackupReencryptionConfig {
6951 /// Backup re-encryption limit
6952 pub backup_limit: std::option::Option<i32>,
6953
6954 /// Type of backups users want to re-encrypt.
6955 pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
6956
6957 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6958}
6959
6960impl BackupReencryptionConfig {
6961 pub fn new() -> Self {
6962 std::default::Default::default()
6963 }
6964
6965 /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
6966 ///
6967 /// # Example
6968 /// ```ignore,no_run
6969 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
6970 /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
6971 /// ```
6972 pub fn set_backup_limit<T>(mut self, v: T) -> Self
6973 where
6974 T: std::convert::Into<i32>,
6975 {
6976 self.backup_limit = std::option::Option::Some(v.into());
6977 self
6978 }
6979
6980 /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
6981 ///
6982 /// # Example
6983 /// ```ignore,no_run
6984 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
6985 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
6986 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
6987 /// ```
6988 pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
6989 where
6990 T: std::convert::Into<i32>,
6991 {
6992 self.backup_limit = v.map(|x| x.into());
6993 self
6994 }
6995
6996 /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
6997 ///
6998 /// # Example
6999 /// ```ignore,no_run
7000 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7001 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7002 /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
7003 /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
7004 /// ```
7005 pub fn set_backup_type<T>(mut self, v: T) -> Self
7006 where
7007 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7008 {
7009 self.backup_type = std::option::Option::Some(v.into());
7010 self
7011 }
7012
7013 /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7014 ///
7015 /// # Example
7016 /// ```ignore,no_run
7017 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7018 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7019 /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
7020 /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
7021 /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
7022 /// ```
7023 pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
7024 where
7025 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7026 {
7027 self.backup_type = v.map(|x| x.into());
7028 self
7029 }
7030}
7031
7032impl wkt::message::Message for BackupReencryptionConfig {
7033 fn typename() -> &'static str {
7034 "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
7035 }
7036}
7037
7038/// Defines additional types related to [BackupReencryptionConfig].
7039pub mod backup_reencryption_config {
7040 #[allow(unused_imports)]
7041 use super::*;
7042
7043 /// Backup type for re-encryption
7044 ///
7045 /// # Working with unknown values
7046 ///
7047 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7048 /// additional enum variants at any time. Adding new variants is not considered
7049 /// a breaking change. Applications should write their code in anticipation of:
7050 ///
7051 /// - New values appearing in future releases of the client library, **and**
7052 /// - New values received dynamically, without application changes.
7053 ///
7054 /// Please consult the [Working with enums] section in the user guide for some
7055 /// guidelines.
7056 ///
7057 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7058 #[derive(Clone, Debug, PartialEq)]
7059 #[non_exhaustive]
7060 pub enum BackupType {
7061 /// Unknown backup type, will be defaulted to AUTOMATIC backup type
7062 Unspecified,
7063 /// Reencrypt automatic backups
7064 Automated,
7065 /// Reencrypt on-demand backups
7066 OnDemand,
7067 /// If set, the enum was initialized with an unknown value.
7068 ///
7069 /// Applications can examine the value using [BackupType::value] or
7070 /// [BackupType::name].
7071 UnknownValue(backup_type::UnknownValue),
7072 }
7073
7074 #[doc(hidden)]
7075 pub mod backup_type {
7076 #[allow(unused_imports)]
7077 use super::*;
7078 #[derive(Clone, Debug, PartialEq)]
7079 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7080 }
7081
7082 impl BackupType {
7083 /// Gets the enum value.
7084 ///
7085 /// Returns `None` if the enum contains an unknown value deserialized from
7086 /// the string representation of enums.
7087 pub fn value(&self) -> std::option::Option<i32> {
7088 match self {
7089 Self::Unspecified => std::option::Option::Some(0),
7090 Self::Automated => std::option::Option::Some(1),
7091 Self::OnDemand => std::option::Option::Some(2),
7092 Self::UnknownValue(u) => u.0.value(),
7093 }
7094 }
7095
7096 /// Gets the enum value as a string.
7097 ///
7098 /// Returns `None` if the enum contains an unknown value deserialized from
7099 /// the integer representation of enums.
7100 pub fn name(&self) -> std::option::Option<&str> {
7101 match self {
7102 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
7103 Self::Automated => std::option::Option::Some("AUTOMATED"),
7104 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
7105 Self::UnknownValue(u) => u.0.name(),
7106 }
7107 }
7108 }
7109
7110 impl std::default::Default for BackupType {
7111 fn default() -> Self {
7112 use std::convert::From;
7113 Self::from(0)
7114 }
7115 }
7116
7117 impl std::fmt::Display for BackupType {
7118 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7119 wkt::internal::display_enum(f, self.name(), self.value())
7120 }
7121 }
7122
7123 impl std::convert::From<i32> for BackupType {
7124 fn from(value: i32) -> Self {
7125 match value {
7126 0 => Self::Unspecified,
7127 1 => Self::Automated,
7128 2 => Self::OnDemand,
7129 _ => Self::UnknownValue(backup_type::UnknownValue(
7130 wkt::internal::UnknownEnumValue::Integer(value),
7131 )),
7132 }
7133 }
7134 }
7135
7136 impl std::convert::From<&str> for BackupType {
7137 fn from(value: &str) -> Self {
7138 use std::string::ToString;
7139 match value {
7140 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
7141 "AUTOMATED" => Self::Automated,
7142 "ON_DEMAND" => Self::OnDemand,
7143 _ => Self::UnknownValue(backup_type::UnknownValue(
7144 wkt::internal::UnknownEnumValue::String(value.to_string()),
7145 )),
7146 }
7147 }
7148 }
7149
7150 impl serde::ser::Serialize for BackupType {
7151 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7152 where
7153 S: serde::Serializer,
7154 {
7155 match self {
7156 Self::Unspecified => serializer.serialize_i32(0),
7157 Self::Automated => serializer.serialize_i32(1),
7158 Self::OnDemand => serializer.serialize_i32(2),
7159 Self::UnknownValue(u) => u.0.serialize(serializer),
7160 }
7161 }
7162 }
7163
7164 impl<'de> serde::de::Deserialize<'de> for BackupType {
7165 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7166 where
7167 D: serde::Deserializer<'de>,
7168 {
7169 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
7170 ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
7171 ))
7172 }
7173 }
7174}
7175
7176/// The selected object that Cloud SQL migrates.
7177#[derive(Clone, Default, PartialEq)]
7178#[non_exhaustive]
7179pub struct ExternalSyncSelectedObject {
7180 /// The name of the database that Cloud SQL migrates.
7181 pub database: std::string::String,
7182
7183 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7184}
7185
7186impl ExternalSyncSelectedObject {
7187 pub fn new() -> Self {
7188 std::default::Default::default()
7189 }
7190
7191 /// Sets the value of [database][crate::model::ExternalSyncSelectedObject::database].
7192 ///
7193 /// # Example
7194 /// ```ignore,no_run
7195 /// # use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7196 /// let x = ExternalSyncSelectedObject::new().set_database("example");
7197 /// ```
7198 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7199 self.database = v.into();
7200 self
7201 }
7202}
7203
7204impl wkt::message::Message for ExternalSyncSelectedObject {
7205 fn typename() -> &'static str {
7206 "type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
7207 }
7208}
7209
7210/// Instance get disk shrink config request.
7211#[derive(Clone, Default, PartialEq)]
7212#[non_exhaustive]
7213pub struct SqlInstancesGetDiskShrinkConfigRequest {
7214 /// Cloud SQL instance ID. This does not include the project ID.
7215 pub instance: std::string::String,
7216
7217 /// Project ID of the project that contains the instance.
7218 pub project: std::string::String,
7219
7220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7221}
7222
7223impl SqlInstancesGetDiskShrinkConfigRequest {
7224 pub fn new() -> Self {
7225 std::default::Default::default()
7226 }
7227
7228 /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
7229 ///
7230 /// # Example
7231 /// ```ignore,no_run
7232 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7233 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
7234 /// ```
7235 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7236 self.instance = v.into();
7237 self
7238 }
7239
7240 /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
7241 ///
7242 /// # Example
7243 /// ```ignore,no_run
7244 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7245 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
7246 /// ```
7247 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7248 self.project = v.into();
7249 self
7250 }
7251}
7252
7253impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
7254 fn typename() -> &'static str {
7255 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
7256 }
7257}
7258
7259/// Instance verify external sync settings request.
7260#[derive(Clone, Default, PartialEq)]
7261#[non_exhaustive]
7262pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
7263 /// Cloud SQL instance ID. This does not include the project ID.
7264 pub instance: std::string::String,
7265
7266 /// Project ID of the project that contains the instance.
7267 pub project: std::string::String,
7268
7269 /// Flag to enable verifying connection only
7270 pub verify_connection_only: bool,
7271
7272 /// External sync mode
7273 pub sync_mode:
7274 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7275
7276 /// Optional. Flag to verify settings required by replication setup only
7277 pub verify_replication_only: bool,
7278
7279 /// Optional. MigrationType configures the migration to use physical files or
7280 /// logical dump files. If not set, then the logical dump file configuration is
7281 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7282 pub migration_type:
7283 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7284
7285 /// Optional. Parallel level for initial data sync. Only applicable for
7286 /// PostgreSQL.
7287 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7288
7289 /// Optional. Migrate only the specified objects from the source instance. If
7290 /// this field is empty, then migrate all objects.
7291 pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
7292
7293 pub sync_config: std::option::Option<
7294 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7295 >,
7296
7297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7298}
7299
7300impl SqlInstancesVerifyExternalSyncSettingsRequest {
7301 pub fn new() -> Self {
7302 std::default::Default::default()
7303 }
7304
7305 /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
7306 ///
7307 /// # Example
7308 /// ```ignore,no_run
7309 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7310 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
7311 /// ```
7312 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7313 self.instance = v.into();
7314 self
7315 }
7316
7317 /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
7318 ///
7319 /// # Example
7320 /// ```ignore,no_run
7321 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7322 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
7323 /// ```
7324 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7325 self.project = v.into();
7326 self
7327 }
7328
7329 /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
7330 ///
7331 /// # Example
7332 /// ```ignore,no_run
7333 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7334 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
7335 /// ```
7336 pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7337 self.verify_connection_only = v.into();
7338 self
7339 }
7340
7341 /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
7342 ///
7343 /// # Example
7344 /// ```ignore,no_run
7345 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7346 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7347 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
7348 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7349 /// ```
7350 pub fn set_sync_mode<
7351 T: std::convert::Into<
7352 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7353 >,
7354 >(
7355 mut self,
7356 v: T,
7357 ) -> Self {
7358 self.sync_mode = v.into();
7359 self
7360 }
7361
7362 /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
7363 ///
7364 /// # Example
7365 /// ```ignore,no_run
7366 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7367 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
7368 /// ```
7369 pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7370 self.verify_replication_only = v.into();
7371 self
7372 }
7373
7374 /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
7375 ///
7376 /// # Example
7377 /// ```ignore,no_run
7378 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7379 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7380 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
7381 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
7382 /// ```
7383 pub fn set_migration_type<
7384 T: std::convert::Into<
7385 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7386 >,
7387 >(
7388 mut self,
7389 v: T,
7390 ) -> Self {
7391 self.migration_type = v.into();
7392 self
7393 }
7394
7395 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
7396 ///
7397 /// # Example
7398 /// ```ignore,no_run
7399 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7400 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7401 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7402 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7403 /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7404 /// ```
7405 pub fn set_sync_parallel_level<
7406 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7407 >(
7408 mut self,
7409 v: T,
7410 ) -> Self {
7411 self.sync_parallel_level = v.into();
7412 self
7413 }
7414
7415 /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
7416 ///
7417 /// # Example
7418 /// ```ignore,no_run
7419 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7420 /// use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7421 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new()
7422 /// .set_selected_objects([
7423 /// ExternalSyncSelectedObject::default()/* use setters */,
7424 /// ExternalSyncSelectedObject::default()/* use (different) setters */,
7425 /// ]);
7426 /// ```
7427 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
7428 where
7429 T: std::iter::IntoIterator<Item = V>,
7430 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
7431 {
7432 use std::iter::Iterator;
7433 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
7434 self
7435 }
7436
7437 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
7438 ///
7439 /// Note that all the setters affecting `sync_config` are mutually
7440 /// exclusive.
7441 ///
7442 /// # Example
7443 /// ```ignore,no_run
7444 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7445 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7446 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
7447 /// google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7448 /// ```
7449 pub fn set_sync_config<
7450 T: std::convert::Into<
7451 std::option::Option<
7452 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7453 >,
7454 >,
7455 >(
7456 mut self,
7457 v: T,
7458 ) -> Self {
7459 self.sync_config = v.into();
7460 self
7461 }
7462
7463 /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7464 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7465 /// holds a different branch.
7466 pub fn mysql_sync_config(
7467 &self,
7468 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7469 #[allow(unreachable_patterns)]
7470 self.sync_config.as_ref().and_then(|v| match v {
7471 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7472 _ => std::option::Option::None,
7473 })
7474 }
7475
7476 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7477 /// to hold a `MysqlSyncConfig`.
7478 ///
7479 /// Note that all the setters affecting `sync_config` are
7480 /// mutually exclusive.
7481 ///
7482 /// # Example
7483 /// ```ignore,no_run
7484 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7485 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7486 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7487 /// assert!(x.mysql_sync_config().is_some());
7488 /// ```
7489 pub fn set_mysql_sync_config<
7490 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7491 >(
7492 mut self,
7493 v: T,
7494 ) -> Self {
7495 self.sync_config = std::option::Option::Some(
7496 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
7497 v.into()
7498 )
7499 );
7500 self
7501 }
7502}
7503
7504impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
7505 fn typename() -> &'static str {
7506 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
7507 }
7508}
7509
7510/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
7511pub mod sql_instances_verify_external_sync_settings_request {
7512 #[allow(unused_imports)]
7513 use super::*;
7514
7515 ///
7516 /// # Working with unknown values
7517 ///
7518 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7519 /// additional enum variants at any time. Adding new variants is not considered
7520 /// a breaking change. Applications should write their code in anticipation of:
7521 ///
7522 /// - New values appearing in future releases of the client library, **and**
7523 /// - New values received dynamically, without application changes.
7524 ///
7525 /// Please consult the [Working with enums] section in the user guide for some
7526 /// guidelines.
7527 ///
7528 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7529 #[derive(Clone, Debug, PartialEq)]
7530 #[non_exhaustive]
7531 pub enum ExternalSyncMode {
7532 /// Unknown external sync mode, will be defaulted to ONLINE mode
7533 Unspecified,
7534 /// Online external sync will set up replication after initial data external
7535 /// sync
7536 Online,
7537 /// Offline external sync only dumps and loads a one-time snapshot of
7538 /// the primary instance's data
7539 Offline,
7540 /// If set, the enum was initialized with an unknown value.
7541 ///
7542 /// Applications can examine the value using [ExternalSyncMode::value] or
7543 /// [ExternalSyncMode::name].
7544 UnknownValue(external_sync_mode::UnknownValue),
7545 }
7546
7547 #[doc(hidden)]
7548 pub mod external_sync_mode {
7549 #[allow(unused_imports)]
7550 use super::*;
7551 #[derive(Clone, Debug, PartialEq)]
7552 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7553 }
7554
7555 impl ExternalSyncMode {
7556 /// Gets the enum value.
7557 ///
7558 /// Returns `None` if the enum contains an unknown value deserialized from
7559 /// the string representation of enums.
7560 pub fn value(&self) -> std::option::Option<i32> {
7561 match self {
7562 Self::Unspecified => std::option::Option::Some(0),
7563 Self::Online => std::option::Option::Some(1),
7564 Self::Offline => std::option::Option::Some(2),
7565 Self::UnknownValue(u) => u.0.value(),
7566 }
7567 }
7568
7569 /// Gets the enum value as a string.
7570 ///
7571 /// Returns `None` if the enum contains an unknown value deserialized from
7572 /// the integer representation of enums.
7573 pub fn name(&self) -> std::option::Option<&str> {
7574 match self {
7575 Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
7576 Self::Online => std::option::Option::Some("ONLINE"),
7577 Self::Offline => std::option::Option::Some("OFFLINE"),
7578 Self::UnknownValue(u) => u.0.name(),
7579 }
7580 }
7581 }
7582
7583 impl std::default::Default for ExternalSyncMode {
7584 fn default() -> Self {
7585 use std::convert::From;
7586 Self::from(0)
7587 }
7588 }
7589
7590 impl std::fmt::Display for ExternalSyncMode {
7591 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7592 wkt::internal::display_enum(f, self.name(), self.value())
7593 }
7594 }
7595
7596 impl std::convert::From<i32> for ExternalSyncMode {
7597 fn from(value: i32) -> Self {
7598 match value {
7599 0 => Self::Unspecified,
7600 1 => Self::Online,
7601 2 => Self::Offline,
7602 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7603 wkt::internal::UnknownEnumValue::Integer(value),
7604 )),
7605 }
7606 }
7607 }
7608
7609 impl std::convert::From<&str> for ExternalSyncMode {
7610 fn from(value: &str) -> Self {
7611 use std::string::ToString;
7612 match value {
7613 "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
7614 "ONLINE" => Self::Online,
7615 "OFFLINE" => Self::Offline,
7616 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7617 wkt::internal::UnknownEnumValue::String(value.to_string()),
7618 )),
7619 }
7620 }
7621 }
7622
7623 impl serde::ser::Serialize for ExternalSyncMode {
7624 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7625 where
7626 S: serde::Serializer,
7627 {
7628 match self {
7629 Self::Unspecified => serializer.serialize_i32(0),
7630 Self::Online => serializer.serialize_i32(1),
7631 Self::Offline => serializer.serialize_i32(2),
7632 Self::UnknownValue(u) => u.0.serialize(serializer),
7633 }
7634 }
7635 }
7636
7637 impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
7638 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7639 where
7640 D: serde::Deserializer<'de>,
7641 {
7642 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
7643 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
7644 }
7645 }
7646
7647 /// MigrationType determines whether the migration is a physical file-based
7648 /// migration or a logical dump file-based migration.
7649 ///
7650 /// # Working with unknown values
7651 ///
7652 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7653 /// additional enum variants at any time. Adding new variants is not considered
7654 /// a breaking change. Applications should write their code in anticipation of:
7655 ///
7656 /// - New values appearing in future releases of the client library, **and**
7657 /// - New values received dynamically, without application changes.
7658 ///
7659 /// Please consult the [Working with enums] section in the user guide for some
7660 /// guidelines.
7661 ///
7662 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7663 #[derive(Clone, Debug, PartialEq)]
7664 #[non_exhaustive]
7665 pub enum MigrationType {
7666 /// Default value is a logical dump file-based migration
7667 Unspecified,
7668 /// Logical dump file-based migration
7669 Logical,
7670 /// Physical file-based migration
7671 Physical,
7672 /// If set, the enum was initialized with an unknown value.
7673 ///
7674 /// Applications can examine the value using [MigrationType::value] or
7675 /// [MigrationType::name].
7676 UnknownValue(migration_type::UnknownValue),
7677 }
7678
7679 #[doc(hidden)]
7680 pub mod migration_type {
7681 #[allow(unused_imports)]
7682 use super::*;
7683 #[derive(Clone, Debug, PartialEq)]
7684 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7685 }
7686
7687 impl MigrationType {
7688 /// Gets the enum value.
7689 ///
7690 /// Returns `None` if the enum contains an unknown value deserialized from
7691 /// the string representation of enums.
7692 pub fn value(&self) -> std::option::Option<i32> {
7693 match self {
7694 Self::Unspecified => std::option::Option::Some(0),
7695 Self::Logical => std::option::Option::Some(1),
7696 Self::Physical => std::option::Option::Some(2),
7697 Self::UnknownValue(u) => u.0.value(),
7698 }
7699 }
7700
7701 /// Gets the enum value as a string.
7702 ///
7703 /// Returns `None` if the enum contains an unknown value deserialized from
7704 /// the integer representation of enums.
7705 pub fn name(&self) -> std::option::Option<&str> {
7706 match self {
7707 Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
7708 Self::Logical => std::option::Option::Some("LOGICAL"),
7709 Self::Physical => std::option::Option::Some("PHYSICAL"),
7710 Self::UnknownValue(u) => u.0.name(),
7711 }
7712 }
7713 }
7714
7715 impl std::default::Default for MigrationType {
7716 fn default() -> Self {
7717 use std::convert::From;
7718 Self::from(0)
7719 }
7720 }
7721
7722 impl std::fmt::Display for MigrationType {
7723 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7724 wkt::internal::display_enum(f, self.name(), self.value())
7725 }
7726 }
7727
7728 impl std::convert::From<i32> for MigrationType {
7729 fn from(value: i32) -> Self {
7730 match value {
7731 0 => Self::Unspecified,
7732 1 => Self::Logical,
7733 2 => Self::Physical,
7734 _ => Self::UnknownValue(migration_type::UnknownValue(
7735 wkt::internal::UnknownEnumValue::Integer(value),
7736 )),
7737 }
7738 }
7739 }
7740
7741 impl std::convert::From<&str> for MigrationType {
7742 fn from(value: &str) -> Self {
7743 use std::string::ToString;
7744 match value {
7745 "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
7746 "LOGICAL" => Self::Logical,
7747 "PHYSICAL" => Self::Physical,
7748 _ => Self::UnknownValue(migration_type::UnknownValue(
7749 wkt::internal::UnknownEnumValue::String(value.to_string()),
7750 )),
7751 }
7752 }
7753 }
7754
7755 impl serde::ser::Serialize for MigrationType {
7756 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7757 where
7758 S: serde::Serializer,
7759 {
7760 match self {
7761 Self::Unspecified => serializer.serialize_i32(0),
7762 Self::Logical => serializer.serialize_i32(1),
7763 Self::Physical => serializer.serialize_i32(2),
7764 Self::UnknownValue(u) => u.0.serialize(serializer),
7765 }
7766 }
7767 }
7768
7769 impl<'de> serde::de::Deserialize<'de> for MigrationType {
7770 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7771 where
7772 D: serde::Deserializer<'de>,
7773 {
7774 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
7775 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
7776 ))
7777 }
7778 }
7779
7780 #[derive(Clone, Debug, PartialEq)]
7781 #[non_exhaustive]
7782 pub enum SyncConfig {
7783 /// Optional. MySQL-specific settings for start external sync.
7784 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
7785 }
7786}
7787
7788/// Instance start external sync request.
7789#[derive(Clone, Default, PartialEq)]
7790#[non_exhaustive]
7791pub struct SqlInstancesStartExternalSyncRequest {
7792 /// Cloud SQL instance ID. This does not include the project ID.
7793 pub instance: std::string::String,
7794
7795 /// ID of the project that contains the instance.
7796 pub project: std::string::String,
7797
7798 /// External sync mode.
7799 pub sync_mode:
7800 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7801
7802 /// Whether to skip the verification step (VESS).
7803 pub skip_verification: bool,
7804
7805 /// Optional. Parallel level for initial data sync. Currently only applicable
7806 /// for MySQL.
7807 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7808
7809 /// Optional. MigrationType configures the migration to use physical files or
7810 /// logical dump files. If not set, then the logical dump file configuration is
7811 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7812 pub migration_type:
7813 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7814
7815 /// Optional. MySQL only. True if end-user has confirmed that this SES call
7816 /// will wipe replica databases overlapping with the proposed selected_objects.
7817 /// If this field is not set and there are both overlapping and additional
7818 /// databases proposed, an error will be returned.
7819 pub replica_overwrite_enabled: bool,
7820
7821 pub sync_config:
7822 std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
7823
7824 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7825}
7826
7827impl SqlInstancesStartExternalSyncRequest {
7828 pub fn new() -> Self {
7829 std::default::Default::default()
7830 }
7831
7832 /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
7833 ///
7834 /// # Example
7835 /// ```ignore,no_run
7836 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7837 /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
7838 /// ```
7839 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7840 self.instance = v.into();
7841 self
7842 }
7843
7844 /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
7845 ///
7846 /// # Example
7847 /// ```ignore,no_run
7848 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7849 /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
7850 /// ```
7851 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7852 self.project = v.into();
7853 self
7854 }
7855
7856 /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
7857 ///
7858 /// # Example
7859 /// ```ignore,no_run
7860 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7861 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7862 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
7863 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7864 /// ```
7865 pub fn set_sync_mode<
7866 T: std::convert::Into<
7867 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7868 >,
7869 >(
7870 mut self,
7871 v: T,
7872 ) -> Self {
7873 self.sync_mode = v.into();
7874 self
7875 }
7876
7877 /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
7878 ///
7879 /// # Example
7880 /// ```ignore,no_run
7881 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7882 /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
7883 /// ```
7884 pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7885 self.skip_verification = v.into();
7886 self
7887 }
7888
7889 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
7890 ///
7891 /// # Example
7892 /// ```ignore,no_run
7893 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7894 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7895 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7896 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7897 /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7898 /// ```
7899 pub fn set_sync_parallel_level<
7900 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7901 >(
7902 mut self,
7903 v: T,
7904 ) -> Self {
7905 self.sync_parallel_level = v.into();
7906 self
7907 }
7908
7909 /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
7910 ///
7911 /// # Example
7912 /// ```ignore,no_run
7913 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7914 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7915 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
7916 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
7917 /// ```
7918 pub fn set_migration_type<
7919 T: std::convert::Into<
7920 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7921 >,
7922 >(
7923 mut self,
7924 v: T,
7925 ) -> Self {
7926 self.migration_type = v.into();
7927 self
7928 }
7929
7930 /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
7931 ///
7932 /// # Example
7933 /// ```ignore,no_run
7934 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7935 /// let x = SqlInstancesStartExternalSyncRequest::new().set_replica_overwrite_enabled(true);
7936 /// ```
7937 pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7938 self.replica_overwrite_enabled = v.into();
7939 self
7940 }
7941
7942 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
7943 ///
7944 /// Note that all the setters affecting `sync_config` are mutually
7945 /// exclusive.
7946 ///
7947 /// # Example
7948 /// ```ignore,no_run
7949 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7950 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7951 /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
7952 /// google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7953 /// ```
7954 pub fn set_sync_config<
7955 T: std::convert::Into<
7956 std::option::Option<
7957 crate::model::sql_instances_start_external_sync_request::SyncConfig,
7958 >,
7959 >,
7960 >(
7961 mut self,
7962 v: T,
7963 ) -> Self {
7964 self.sync_config = v.into();
7965 self
7966 }
7967
7968 /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
7969 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7970 /// holds a different branch.
7971 pub fn mysql_sync_config(
7972 &self,
7973 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7974 #[allow(unreachable_patterns)]
7975 self.sync_config.as_ref().and_then(|v| match v {
7976 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7977 _ => std::option::Option::None,
7978 })
7979 }
7980
7981 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
7982 /// to hold a `MysqlSyncConfig`.
7983 ///
7984 /// Note that all the setters affecting `sync_config` are
7985 /// mutually exclusive.
7986 ///
7987 /// # Example
7988 /// ```ignore,no_run
7989 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7990 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7991 /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7992 /// assert!(x.mysql_sync_config().is_some());
7993 /// ```
7994 pub fn set_mysql_sync_config<
7995 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7996 >(
7997 mut self,
7998 v: T,
7999 ) -> Self {
8000 self.sync_config = std::option::Option::Some(
8001 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
8002 v.into(),
8003 ),
8004 );
8005 self
8006 }
8007}
8008
8009impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
8010 fn typename() -> &'static str {
8011 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
8012 }
8013}
8014
8015/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
8016pub mod sql_instances_start_external_sync_request {
8017 #[allow(unused_imports)]
8018 use super::*;
8019
8020 #[derive(Clone, Debug, PartialEq)]
8021 #[non_exhaustive]
8022 pub enum SyncConfig {
8023 /// MySQL-specific settings for start external sync.
8024 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8025 }
8026}
8027
8028/// Instance reset replica size request.
8029#[derive(Clone, Default, PartialEq)]
8030#[non_exhaustive]
8031pub struct SqlInstancesResetReplicaSizeRequest {
8032 /// Cloud SQL read replica instance name.
8033 pub instance: std::string::String,
8034
8035 /// ID of the project that contains the read replica.
8036 pub project: std::string::String,
8037
8038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8039}
8040
8041impl SqlInstancesResetReplicaSizeRequest {
8042 pub fn new() -> Self {
8043 std::default::Default::default()
8044 }
8045
8046 /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
8047 ///
8048 /// # Example
8049 /// ```ignore,no_run
8050 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8051 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
8052 /// ```
8053 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8054 self.instance = v.into();
8055 self
8056 }
8057
8058 /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
8059 ///
8060 /// # Example
8061 /// ```ignore,no_run
8062 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8063 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
8064 /// ```
8065 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8066 self.project = v.into();
8067 self
8068 }
8069}
8070
8071impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
8072 fn typename() -> &'static str {
8073 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
8074 }
8075}
8076
8077/// Instance create ephemeral certificate request.
8078#[derive(Clone, Default, PartialEq)]
8079#[non_exhaustive]
8080pub struct SqlInstancesCreateEphemeralCertRequest {
8081 /// Cloud SQL instance ID. This does not include the project ID.
8082 pub instance: std::string::String,
8083
8084 /// Project ID of the Cloud SQL project.
8085 pub project: std::string::String,
8086
8087 pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
8088
8089 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8090}
8091
8092impl SqlInstancesCreateEphemeralCertRequest {
8093 pub fn new() -> Self {
8094 std::default::Default::default()
8095 }
8096
8097 /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
8098 ///
8099 /// # Example
8100 /// ```ignore,no_run
8101 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8102 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
8103 /// ```
8104 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8105 self.instance = v.into();
8106 self
8107 }
8108
8109 /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
8110 ///
8111 /// # Example
8112 /// ```ignore,no_run
8113 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8114 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
8115 /// ```
8116 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8117 self.project = v.into();
8118 self
8119 }
8120
8121 /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8122 ///
8123 /// # Example
8124 /// ```ignore,no_run
8125 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8126 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8127 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
8128 /// ```
8129 pub fn set_body<T>(mut self, v: T) -> Self
8130 where
8131 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8132 {
8133 self.body = std::option::Option::Some(v.into());
8134 self
8135 }
8136
8137 /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8138 ///
8139 /// # Example
8140 /// ```ignore,no_run
8141 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8142 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8143 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
8144 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
8145 /// ```
8146 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8147 where
8148 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8149 {
8150 self.body = v.map(|x| x.into());
8151 self
8152 }
8153}
8154
8155impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
8156 fn typename() -> &'static str {
8157 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
8158 }
8159}
8160
8161/// Database instance clone request.
8162#[derive(Clone, Default, PartialEq)]
8163#[non_exhaustive]
8164pub struct InstancesCloneRequest {
8165 /// Required. Contains details about the clone operation.
8166 pub clone_context: std::option::Option<crate::model::CloneContext>,
8167
8168 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8169}
8170
8171impl InstancesCloneRequest {
8172 pub fn new() -> Self {
8173 std::default::Default::default()
8174 }
8175
8176 /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8177 ///
8178 /// # Example
8179 /// ```ignore,no_run
8180 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8181 /// use google_cloud_sql_v1::model::CloneContext;
8182 /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
8183 /// ```
8184 pub fn set_clone_context<T>(mut self, v: T) -> Self
8185 where
8186 T: std::convert::Into<crate::model::CloneContext>,
8187 {
8188 self.clone_context = std::option::Option::Some(v.into());
8189 self
8190 }
8191
8192 /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8193 ///
8194 /// # Example
8195 /// ```ignore,no_run
8196 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8197 /// use google_cloud_sql_v1::model::CloneContext;
8198 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
8199 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
8200 /// ```
8201 pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
8202 where
8203 T: std::convert::Into<crate::model::CloneContext>,
8204 {
8205 self.clone_context = v.map(|x| x.into());
8206 self
8207 }
8208}
8209
8210impl wkt::message::Message for InstancesCloneRequest {
8211 fn typename() -> &'static str {
8212 "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
8213 }
8214}
8215
8216/// Database demote primary instance request.
8217#[derive(Clone, Default, PartialEq)]
8218#[non_exhaustive]
8219pub struct InstancesDemoteMasterRequest {
8220 /// Contains details about the demoteMaster operation.
8221 pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
8222
8223 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8224}
8225
8226impl InstancesDemoteMasterRequest {
8227 pub fn new() -> Self {
8228 std::default::Default::default()
8229 }
8230
8231 /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8232 ///
8233 /// # Example
8234 /// ```ignore,no_run
8235 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8236 /// use google_cloud_sql_v1::model::DemoteMasterContext;
8237 /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
8238 /// ```
8239 pub fn set_demote_master_context<T>(mut self, v: T) -> Self
8240 where
8241 T: std::convert::Into<crate::model::DemoteMasterContext>,
8242 {
8243 self.demote_master_context = std::option::Option::Some(v.into());
8244 self
8245 }
8246
8247 /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8248 ///
8249 /// # Example
8250 /// ```ignore,no_run
8251 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8252 /// use google_cloud_sql_v1::model::DemoteMasterContext;
8253 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
8254 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
8255 /// ```
8256 pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
8257 where
8258 T: std::convert::Into<crate::model::DemoteMasterContext>,
8259 {
8260 self.demote_master_context = v.map(|x| x.into());
8261 self
8262 }
8263}
8264
8265impl wkt::message::Message for InstancesDemoteMasterRequest {
8266 fn typename() -> &'static str {
8267 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
8268 }
8269}
8270
8271/// This request is used to demote an existing standalone instance to be a
8272/// Cloud SQL read replica for an external database server.
8273#[derive(Clone, Default, PartialEq)]
8274#[non_exhaustive]
8275pub struct InstancesDemoteRequest {
8276 /// Required. Contains details about the demote operation.
8277 pub demote_context: std::option::Option<crate::model::DemoteContext>,
8278
8279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8280}
8281
8282impl InstancesDemoteRequest {
8283 pub fn new() -> Self {
8284 std::default::Default::default()
8285 }
8286
8287 /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8288 ///
8289 /// # Example
8290 /// ```ignore,no_run
8291 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8292 /// use google_cloud_sql_v1::model::DemoteContext;
8293 /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
8294 /// ```
8295 pub fn set_demote_context<T>(mut self, v: T) -> Self
8296 where
8297 T: std::convert::Into<crate::model::DemoteContext>,
8298 {
8299 self.demote_context = std::option::Option::Some(v.into());
8300 self
8301 }
8302
8303 /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8304 ///
8305 /// # Example
8306 /// ```ignore,no_run
8307 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8308 /// use google_cloud_sql_v1::model::DemoteContext;
8309 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
8310 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
8311 /// ```
8312 pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
8313 where
8314 T: std::convert::Into<crate::model::DemoteContext>,
8315 {
8316 self.demote_context = v.map(|x| x.into());
8317 self
8318 }
8319}
8320
8321impl wkt::message::Message for InstancesDemoteRequest {
8322 fn typename() -> &'static str {
8323 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
8324 }
8325}
8326
8327/// Database instance export request.
8328#[derive(Clone, Default, PartialEq)]
8329#[non_exhaustive]
8330pub struct InstancesExportRequest {
8331 /// Contains details about the export operation.
8332 pub export_context: std::option::Option<crate::model::ExportContext>,
8333
8334 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8335}
8336
8337impl InstancesExportRequest {
8338 pub fn new() -> Self {
8339 std::default::Default::default()
8340 }
8341
8342 /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
8343 ///
8344 /// # Example
8345 /// ```ignore,no_run
8346 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8347 /// use google_cloud_sql_v1::model::ExportContext;
8348 /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
8349 /// ```
8350 pub fn set_export_context<T>(mut self, v: T) -> Self
8351 where
8352 T: std::convert::Into<crate::model::ExportContext>,
8353 {
8354 self.export_context = std::option::Option::Some(v.into());
8355 self
8356 }
8357
8358 /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
8359 ///
8360 /// # Example
8361 /// ```ignore,no_run
8362 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8363 /// use google_cloud_sql_v1::model::ExportContext;
8364 /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
8365 /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
8366 /// ```
8367 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
8368 where
8369 T: std::convert::Into<crate::model::ExportContext>,
8370 {
8371 self.export_context = v.map(|x| x.into());
8372 self
8373 }
8374}
8375
8376impl wkt::message::Message for InstancesExportRequest {
8377 fn typename() -> &'static str {
8378 "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
8379 }
8380}
8381
8382/// Instance failover request.
8383#[derive(Clone, Default, PartialEq)]
8384#[non_exhaustive]
8385pub struct InstancesFailoverRequest {
8386 /// Failover Context.
8387 pub failover_context: std::option::Option<crate::model::FailoverContext>,
8388
8389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8390}
8391
8392impl InstancesFailoverRequest {
8393 pub fn new() -> Self {
8394 std::default::Default::default()
8395 }
8396
8397 /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8398 ///
8399 /// # Example
8400 /// ```ignore,no_run
8401 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8402 /// use google_cloud_sql_v1::model::FailoverContext;
8403 /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
8404 /// ```
8405 pub fn set_failover_context<T>(mut self, v: T) -> Self
8406 where
8407 T: std::convert::Into<crate::model::FailoverContext>,
8408 {
8409 self.failover_context = std::option::Option::Some(v.into());
8410 self
8411 }
8412
8413 /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8414 ///
8415 /// # Example
8416 /// ```ignore,no_run
8417 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8418 /// use google_cloud_sql_v1::model::FailoverContext;
8419 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
8420 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
8421 /// ```
8422 pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
8423 where
8424 T: std::convert::Into<crate::model::FailoverContext>,
8425 {
8426 self.failover_context = v.map(|x| x.into());
8427 self
8428 }
8429}
8430
8431impl wkt::message::Message for InstancesFailoverRequest {
8432 fn typename() -> &'static str {
8433 "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
8434 }
8435}
8436
8437/// SslCerts create ephemeral certificate request.
8438#[derive(Clone, Default, PartialEq)]
8439#[non_exhaustive]
8440pub struct SslCertsCreateEphemeralRequest {
8441 /// PEM encoded public key to include in the signed certificate.
8442 pub public_key: std::string::String,
8443
8444 /// Access token to include in the signed certificate.
8445 pub access_token: std::string::String,
8446
8447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8448}
8449
8450impl SslCertsCreateEphemeralRequest {
8451 pub fn new() -> Self {
8452 std::default::Default::default()
8453 }
8454
8455 /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
8456 ///
8457 /// # Example
8458 /// ```ignore,no_run
8459 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8460 /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
8461 /// ```
8462 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8463 self.public_key = v.into();
8464 self
8465 }
8466
8467 /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
8468 ///
8469 /// # Example
8470 /// ```ignore,no_run
8471 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8472 /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
8473 /// ```
8474 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8475 self.access_token = v.into();
8476 self
8477 }
8478}
8479
8480impl wkt::message::Message for SslCertsCreateEphemeralRequest {
8481 fn typename() -> &'static str {
8482 "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
8483 }
8484}
8485
8486/// Database instance import request.
8487#[derive(Clone, Default, PartialEq)]
8488#[non_exhaustive]
8489pub struct InstancesImportRequest {
8490 /// Contains details about the import operation.
8491 pub import_context: std::option::Option<crate::model::ImportContext>,
8492
8493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8494}
8495
8496impl InstancesImportRequest {
8497 pub fn new() -> Self {
8498 std::default::Default::default()
8499 }
8500
8501 /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
8502 ///
8503 /// # Example
8504 /// ```ignore,no_run
8505 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8506 /// use google_cloud_sql_v1::model::ImportContext;
8507 /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
8508 /// ```
8509 pub fn set_import_context<T>(mut self, v: T) -> Self
8510 where
8511 T: std::convert::Into<crate::model::ImportContext>,
8512 {
8513 self.import_context = std::option::Option::Some(v.into());
8514 self
8515 }
8516
8517 /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
8518 ///
8519 /// # Example
8520 /// ```ignore,no_run
8521 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8522 /// use google_cloud_sql_v1::model::ImportContext;
8523 /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
8524 /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
8525 /// ```
8526 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
8527 where
8528 T: std::convert::Into<crate::model::ImportContext>,
8529 {
8530 self.import_context = v.map(|x| x.into());
8531 self
8532 }
8533}
8534
8535impl wkt::message::Message for InstancesImportRequest {
8536 fn typename() -> &'static str {
8537 "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
8538 }
8539}
8540
8541/// Request for Pre-checks for MVU
8542#[derive(Clone, Default, PartialEq)]
8543#[non_exhaustive]
8544pub struct InstancesPreCheckMajorVersionUpgradeRequest {
8545 /// Required. Contains details about the pre-check major version upgrade
8546 /// operation.
8547 pub pre_check_major_version_upgrade_context:
8548 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
8549
8550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8551}
8552
8553impl InstancesPreCheckMajorVersionUpgradeRequest {
8554 pub fn new() -> Self {
8555 std::default::Default::default()
8556 }
8557
8558 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8559 ///
8560 /// # Example
8561 /// ```ignore,no_run
8562 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8563 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8564 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
8565 /// ```
8566 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
8567 where
8568 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8569 {
8570 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
8571 self
8572 }
8573
8574 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8575 ///
8576 /// # Example
8577 /// ```ignore,no_run
8578 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8579 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8580 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
8581 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
8582 /// ```
8583 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
8584 mut self,
8585 v: std::option::Option<T>,
8586 ) -> Self
8587 where
8588 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8589 {
8590 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
8591 self
8592 }
8593}
8594
8595impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
8596 fn typename() -> &'static str {
8597 "type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
8598 }
8599}
8600
8601/// Database instances list response.
8602#[derive(Clone, Default, PartialEq)]
8603#[non_exhaustive]
8604pub struct InstancesListResponse {
8605 /// This is always `sql#instancesList`.
8606 pub kind: std::string::String,
8607
8608 /// List of warnings that occurred while handling the request.
8609 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
8610
8611 /// List of database instance resources.
8612 pub items: std::vec::Vec<crate::model::DatabaseInstance>,
8613
8614 /// The continuation token, used to page through large result sets. Provide
8615 /// this value in a subsequent request to return the next page of results.
8616 pub next_page_token: std::string::String,
8617
8618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8619}
8620
8621impl InstancesListResponse {
8622 pub fn new() -> Self {
8623 std::default::Default::default()
8624 }
8625
8626 /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
8627 ///
8628 /// # Example
8629 /// ```ignore,no_run
8630 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8631 /// let x = InstancesListResponse::new().set_kind("example");
8632 /// ```
8633 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8634 self.kind = v.into();
8635 self
8636 }
8637
8638 /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
8639 ///
8640 /// # Example
8641 /// ```ignore,no_run
8642 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8643 /// use google_cloud_sql_v1::model::ApiWarning;
8644 /// let x = InstancesListResponse::new()
8645 /// .set_warnings([
8646 /// ApiWarning::default()/* use setters */,
8647 /// ApiWarning::default()/* use (different) setters */,
8648 /// ]);
8649 /// ```
8650 pub fn set_warnings<T, V>(mut self, v: T) -> Self
8651 where
8652 T: std::iter::IntoIterator<Item = V>,
8653 V: std::convert::Into<crate::model::ApiWarning>,
8654 {
8655 use std::iter::Iterator;
8656 self.warnings = v.into_iter().map(|i| i.into()).collect();
8657 self
8658 }
8659
8660 /// Sets the value of [items][crate::model::InstancesListResponse::items].
8661 ///
8662 /// # Example
8663 /// ```ignore,no_run
8664 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8665 /// use google_cloud_sql_v1::model::DatabaseInstance;
8666 /// let x = InstancesListResponse::new()
8667 /// .set_items([
8668 /// DatabaseInstance::default()/* use setters */,
8669 /// DatabaseInstance::default()/* use (different) setters */,
8670 /// ]);
8671 /// ```
8672 pub fn set_items<T, V>(mut self, v: T) -> Self
8673 where
8674 T: std::iter::IntoIterator<Item = V>,
8675 V: std::convert::Into<crate::model::DatabaseInstance>,
8676 {
8677 use std::iter::Iterator;
8678 self.items = v.into_iter().map(|i| i.into()).collect();
8679 self
8680 }
8681
8682 /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
8683 ///
8684 /// # Example
8685 /// ```ignore,no_run
8686 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8687 /// let x = InstancesListResponse::new().set_next_page_token("example");
8688 /// ```
8689 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8690 self.next_page_token = v.into();
8691 self
8692 }
8693}
8694
8695impl wkt::message::Message for InstancesListResponse {
8696 fn typename() -> &'static str {
8697 "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
8698 }
8699}
8700
8701#[doc(hidden)]
8702impl google_cloud_gax::paginator::internal::PageableResponse for InstancesListResponse {
8703 type PageItem = crate::model::DatabaseInstance;
8704
8705 fn items(self) -> std::vec::Vec<Self::PageItem> {
8706 self.items
8707 }
8708
8709 fn next_page_token(&self) -> std::string::String {
8710 use std::clone::Clone;
8711 self.next_page_token.clone()
8712 }
8713}
8714
8715/// Instances ListServerCas response.
8716#[derive(Clone, Default, PartialEq)]
8717#[non_exhaustive]
8718pub struct InstancesListServerCasResponse {
8719 /// List of server CA certificates for the instance.
8720 pub certs: std::vec::Vec<crate::model::SslCert>,
8721
8722 pub active_version: std::string::String,
8723
8724 /// This is always `sql#instancesListServerCas`.
8725 pub kind: std::string::String,
8726
8727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8728}
8729
8730impl InstancesListServerCasResponse {
8731 pub fn new() -> Self {
8732 std::default::Default::default()
8733 }
8734
8735 /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
8736 ///
8737 /// # Example
8738 /// ```ignore,no_run
8739 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8740 /// use google_cloud_sql_v1::model::SslCert;
8741 /// let x = InstancesListServerCasResponse::new()
8742 /// .set_certs([
8743 /// SslCert::default()/* use setters */,
8744 /// SslCert::default()/* use (different) setters */,
8745 /// ]);
8746 /// ```
8747 pub fn set_certs<T, V>(mut self, v: T) -> Self
8748 where
8749 T: std::iter::IntoIterator<Item = V>,
8750 V: std::convert::Into<crate::model::SslCert>,
8751 {
8752 use std::iter::Iterator;
8753 self.certs = v.into_iter().map(|i| i.into()).collect();
8754 self
8755 }
8756
8757 /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
8758 ///
8759 /// # Example
8760 /// ```ignore,no_run
8761 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8762 /// let x = InstancesListServerCasResponse::new().set_active_version("example");
8763 /// ```
8764 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8765 self.active_version = v.into();
8766 self
8767 }
8768
8769 /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
8770 ///
8771 /// # Example
8772 /// ```ignore,no_run
8773 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8774 /// let x = InstancesListServerCasResponse::new().set_kind("example");
8775 /// ```
8776 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8777 self.kind = v.into();
8778 self
8779 }
8780}
8781
8782impl wkt::message::Message for InstancesListServerCasResponse {
8783 fn typename() -> &'static str {
8784 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
8785 }
8786}
8787
8788/// Instances ListServerCertificates response.
8789#[derive(Clone, Default, PartialEq)]
8790#[non_exhaustive]
8791pub struct InstancesListServerCertificatesResponse {
8792 /// List of server CA certificates for the instance.
8793 pub ca_certs: std::vec::Vec<crate::model::SslCert>,
8794
8795 /// List of server certificates for the instance, signed by the corresponding
8796 /// CA from the `ca_certs` list.
8797 pub server_certs: std::vec::Vec<crate::model::SslCert>,
8798
8799 /// The `sha1_fingerprint` of the active certificate from `server_certs`.
8800 pub active_version: std::string::String,
8801
8802 /// This is always `sql#instancesListServerCertificates`.
8803 pub kind: std::string::String,
8804
8805 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8806}
8807
8808impl InstancesListServerCertificatesResponse {
8809 pub fn new() -> Self {
8810 std::default::Default::default()
8811 }
8812
8813 /// Sets the value of [ca_certs][crate::model::InstancesListServerCertificatesResponse::ca_certs].
8814 ///
8815 /// # Example
8816 /// ```ignore,no_run
8817 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8818 /// use google_cloud_sql_v1::model::SslCert;
8819 /// let x = InstancesListServerCertificatesResponse::new()
8820 /// .set_ca_certs([
8821 /// SslCert::default()/* use setters */,
8822 /// SslCert::default()/* use (different) setters */,
8823 /// ]);
8824 /// ```
8825 pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
8826 where
8827 T: std::iter::IntoIterator<Item = V>,
8828 V: std::convert::Into<crate::model::SslCert>,
8829 {
8830 use std::iter::Iterator;
8831 self.ca_certs = v.into_iter().map(|i| i.into()).collect();
8832 self
8833 }
8834
8835 /// Sets the value of [server_certs][crate::model::InstancesListServerCertificatesResponse::server_certs].
8836 ///
8837 /// # Example
8838 /// ```ignore,no_run
8839 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8840 /// use google_cloud_sql_v1::model::SslCert;
8841 /// let x = InstancesListServerCertificatesResponse::new()
8842 /// .set_server_certs([
8843 /// SslCert::default()/* use setters */,
8844 /// SslCert::default()/* use (different) setters */,
8845 /// ]);
8846 /// ```
8847 pub fn set_server_certs<T, V>(mut self, v: T) -> Self
8848 where
8849 T: std::iter::IntoIterator<Item = V>,
8850 V: std::convert::Into<crate::model::SslCert>,
8851 {
8852 use std::iter::Iterator;
8853 self.server_certs = v.into_iter().map(|i| i.into()).collect();
8854 self
8855 }
8856
8857 /// Sets the value of [active_version][crate::model::InstancesListServerCertificatesResponse::active_version].
8858 ///
8859 /// # Example
8860 /// ```ignore,no_run
8861 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8862 /// let x = InstancesListServerCertificatesResponse::new().set_active_version("example");
8863 /// ```
8864 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8865 self.active_version = v.into();
8866 self
8867 }
8868
8869 /// Sets the value of [kind][crate::model::InstancesListServerCertificatesResponse::kind].
8870 ///
8871 /// # Example
8872 /// ```ignore,no_run
8873 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8874 /// let x = InstancesListServerCertificatesResponse::new().set_kind("example");
8875 /// ```
8876 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8877 self.kind = v.into();
8878 self
8879 }
8880}
8881
8882impl wkt::message::Message for InstancesListServerCertificatesResponse {
8883 fn typename() -> &'static str {
8884 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
8885 }
8886}
8887
8888/// Instances ListEntraIdCertificates response.
8889#[derive(Clone, Default, PartialEq)]
8890#[non_exhaustive]
8891pub struct InstancesListEntraIdCertificatesResponse {
8892 /// List of Entra ID certificates for the instance.
8893 pub certs: std::vec::Vec<crate::model::SslCert>,
8894
8895 /// The `sha1_fingerprint` of the active certificate from `certs`.
8896 pub active_version: std::string::String,
8897
8898 /// This is always `sql#instancesListEntraIdCertificates`.
8899 pub kind: std::string::String,
8900
8901 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8902}
8903
8904impl InstancesListEntraIdCertificatesResponse {
8905 pub fn new() -> Self {
8906 std::default::Default::default()
8907 }
8908
8909 /// Sets the value of [certs][crate::model::InstancesListEntraIdCertificatesResponse::certs].
8910 ///
8911 /// # Example
8912 /// ```ignore,no_run
8913 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8914 /// use google_cloud_sql_v1::model::SslCert;
8915 /// let x = InstancesListEntraIdCertificatesResponse::new()
8916 /// .set_certs([
8917 /// SslCert::default()/* use setters */,
8918 /// SslCert::default()/* use (different) setters */,
8919 /// ]);
8920 /// ```
8921 pub fn set_certs<T, V>(mut self, v: T) -> Self
8922 where
8923 T: std::iter::IntoIterator<Item = V>,
8924 V: std::convert::Into<crate::model::SslCert>,
8925 {
8926 use std::iter::Iterator;
8927 self.certs = v.into_iter().map(|i| i.into()).collect();
8928 self
8929 }
8930
8931 /// Sets the value of [active_version][crate::model::InstancesListEntraIdCertificatesResponse::active_version].
8932 ///
8933 /// # Example
8934 /// ```ignore,no_run
8935 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8936 /// let x = InstancesListEntraIdCertificatesResponse::new().set_active_version("example");
8937 /// ```
8938 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8939 self.active_version = v.into();
8940 self
8941 }
8942
8943 /// Sets the value of [kind][crate::model::InstancesListEntraIdCertificatesResponse::kind].
8944 ///
8945 /// # Example
8946 /// ```ignore,no_run
8947 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8948 /// let x = InstancesListEntraIdCertificatesResponse::new().set_kind("example");
8949 /// ```
8950 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8951 self.kind = v.into();
8952 self
8953 }
8954}
8955
8956impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
8957 fn typename() -> &'static str {
8958 "type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
8959 }
8960}
8961
8962/// Database instance restore backup request.
8963#[derive(Clone, Default, PartialEq)]
8964#[non_exhaustive]
8965pub struct InstancesRestoreBackupRequest {
8966 /// Parameters required to perform the restore backup operation.
8967 pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
8968
8969 /// The name of the backup that's used to restore a Cloud SQL instance:
8970 /// Format: projects/{project-id}/backups/{backup-uid}. Only one of
8971 /// restore_backup_context, backup, backupdr_backup can be passed to the input.
8972 pub backup: std::string::String,
8973
8974 /// The name of the backup that's used to restore a Cloud SQL instance:
8975 /// Format:
8976 /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
8977 /// Only one of restore_backup_context, backup, backupdr_backup can be
8978 /// passed to the input.
8979 pub backupdr_backup: std::string::String,
8980
8981 /// Optional. By using this parameter, Cloud SQL overrides any instance
8982 /// settings stored in the backup you are restoring from. You can't change the
8983 /// instance's major database version and you can only increase the disk size.
8984 /// You can use this field to restore new instances only. This field is not
8985 /// applicable for restore to existing instances.
8986 pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
8987
8988 /// Optional. This field has the same purpose as restore_instance_settings,
8989 /// changes any instance settings stored in the backup you are restoring from.
8990 /// With the difference that these fields are cleared in the settings.
8991 pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
8992
8993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8994}
8995
8996impl InstancesRestoreBackupRequest {
8997 pub fn new() -> Self {
8998 std::default::Default::default()
8999 }
9000
9001 /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9002 ///
9003 /// # Example
9004 /// ```ignore,no_run
9005 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9006 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9007 /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
9008 /// ```
9009 pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
9010 where
9011 T: std::convert::Into<crate::model::RestoreBackupContext>,
9012 {
9013 self.restore_backup_context = std::option::Option::Some(v.into());
9014 self
9015 }
9016
9017 /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9018 ///
9019 /// # Example
9020 /// ```ignore,no_run
9021 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9022 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9023 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
9024 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
9025 /// ```
9026 pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
9027 where
9028 T: std::convert::Into<crate::model::RestoreBackupContext>,
9029 {
9030 self.restore_backup_context = v.map(|x| x.into());
9031 self
9032 }
9033
9034 /// Sets the value of [backup][crate::model::InstancesRestoreBackupRequest::backup].
9035 ///
9036 /// # Example
9037 /// ```ignore,no_run
9038 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9039 /// let x = InstancesRestoreBackupRequest::new().set_backup("example");
9040 /// ```
9041 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9042 self.backup = v.into();
9043 self
9044 }
9045
9046 /// Sets the value of [backupdr_backup][crate::model::InstancesRestoreBackupRequest::backupdr_backup].
9047 ///
9048 /// # Example
9049 /// ```ignore,no_run
9050 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9051 /// let x = InstancesRestoreBackupRequest::new().set_backupdr_backup("example");
9052 /// ```
9053 pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9054 self.backupdr_backup = v.into();
9055 self
9056 }
9057
9058 /// Sets the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9059 ///
9060 /// # Example
9061 /// ```ignore,no_run
9062 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9063 /// use google_cloud_sql_v1::model::DatabaseInstance;
9064 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_settings(DatabaseInstance::default()/* use setters */);
9065 /// ```
9066 pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
9067 where
9068 T: std::convert::Into<crate::model::DatabaseInstance>,
9069 {
9070 self.restore_instance_settings = std::option::Option::Some(v.into());
9071 self
9072 }
9073
9074 /// Sets or clears the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9075 ///
9076 /// # Example
9077 /// ```ignore,no_run
9078 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9079 /// use google_cloud_sql_v1::model::DatabaseInstance;
9080 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(Some(DatabaseInstance::default()/* use setters */));
9081 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(None::<DatabaseInstance>);
9082 /// ```
9083 pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
9084 where
9085 T: std::convert::Into<crate::model::DatabaseInstance>,
9086 {
9087 self.restore_instance_settings = v.map(|x| x.into());
9088 self
9089 }
9090
9091 /// Sets the value of [restore_instance_clear_overrides_field_names][crate::model::InstancesRestoreBackupRequest::restore_instance_clear_overrides_field_names].
9092 ///
9093 /// # Example
9094 /// ```ignore,no_run
9095 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9096 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_clear_overrides_field_names(["a", "b", "c"]);
9097 /// ```
9098 pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
9099 where
9100 T: std::iter::IntoIterator<Item = V>,
9101 V: std::convert::Into<std::string::String>,
9102 {
9103 use std::iter::Iterator;
9104 self.restore_instance_clear_overrides_field_names =
9105 v.into_iter().map(|i| i.into()).collect();
9106 self
9107 }
9108}
9109
9110impl wkt::message::Message for InstancesRestoreBackupRequest {
9111 fn typename() -> &'static str {
9112 "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
9113 }
9114}
9115
9116/// Rotate server CA request.
9117#[derive(Clone, Default, PartialEq)]
9118#[non_exhaustive]
9119pub struct InstancesRotateServerCaRequest {
9120 /// Contains details about the rotate server CA operation.
9121 pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
9122
9123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9124}
9125
9126impl InstancesRotateServerCaRequest {
9127 pub fn new() -> Self {
9128 std::default::Default::default()
9129 }
9130
9131 /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9132 ///
9133 /// # Example
9134 /// ```ignore,no_run
9135 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9136 /// use google_cloud_sql_v1::model::RotateServerCaContext;
9137 /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
9138 /// ```
9139 pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
9140 where
9141 T: std::convert::Into<crate::model::RotateServerCaContext>,
9142 {
9143 self.rotate_server_ca_context = std::option::Option::Some(v.into());
9144 self
9145 }
9146
9147 /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9148 ///
9149 /// # Example
9150 /// ```ignore,no_run
9151 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9152 /// use google_cloud_sql_v1::model::RotateServerCaContext;
9153 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
9154 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
9155 /// ```
9156 pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
9157 where
9158 T: std::convert::Into<crate::model::RotateServerCaContext>,
9159 {
9160 self.rotate_server_ca_context = v.map(|x| x.into());
9161 self
9162 }
9163}
9164
9165impl wkt::message::Message for InstancesRotateServerCaRequest {
9166 fn typename() -> &'static str {
9167 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
9168 }
9169}
9170
9171/// Rotate server certificate request.
9172#[derive(Clone, Default, PartialEq)]
9173#[non_exhaustive]
9174pub struct InstancesRotateServerCertificateRequest {
9175 /// Optional. Contains details about the rotate server certificate operation.
9176 pub rotate_server_certificate_context:
9177 std::option::Option<crate::model::RotateServerCertificateContext>,
9178
9179 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9180}
9181
9182impl InstancesRotateServerCertificateRequest {
9183 pub fn new() -> Self {
9184 std::default::Default::default()
9185 }
9186
9187 /// Sets the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9188 ///
9189 /// # Example
9190 /// ```ignore,no_run
9191 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9192 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9193 /// let x = InstancesRotateServerCertificateRequest::new().set_rotate_server_certificate_context(RotateServerCertificateContext::default()/* use setters */);
9194 /// ```
9195 pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
9196 where
9197 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9198 {
9199 self.rotate_server_certificate_context = std::option::Option::Some(v.into());
9200 self
9201 }
9202
9203 /// Sets or clears the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9204 ///
9205 /// # Example
9206 /// ```ignore,no_run
9207 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9208 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9209 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(Some(RotateServerCertificateContext::default()/* use setters */));
9210 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(None::<RotateServerCertificateContext>);
9211 /// ```
9212 pub fn set_or_clear_rotate_server_certificate_context<T>(
9213 mut self,
9214 v: std::option::Option<T>,
9215 ) -> Self
9216 where
9217 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9218 {
9219 self.rotate_server_certificate_context = v.map(|x| x.into());
9220 self
9221 }
9222}
9223
9224impl wkt::message::Message for InstancesRotateServerCertificateRequest {
9225 fn typename() -> &'static str {
9226 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
9227 }
9228}
9229
9230/// Rotate Entra ID certificate request.
9231#[derive(Clone, Default, PartialEq)]
9232#[non_exhaustive]
9233pub struct InstancesRotateEntraIdCertificateRequest {
9234 /// Optional. Contains details about the rotate server certificate operation.
9235 pub rotate_entra_id_certificate_context:
9236 std::option::Option<crate::model::RotateEntraIdCertificateContext>,
9237
9238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9239}
9240
9241impl InstancesRotateEntraIdCertificateRequest {
9242 pub fn new() -> Self {
9243 std::default::Default::default()
9244 }
9245
9246 /// Sets the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9247 ///
9248 /// # Example
9249 /// ```ignore,no_run
9250 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9251 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9252 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_rotate_entra_id_certificate_context(RotateEntraIdCertificateContext::default()/* use setters */);
9253 /// ```
9254 pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
9255 where
9256 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9257 {
9258 self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
9259 self
9260 }
9261
9262 /// Sets or clears the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9263 ///
9264 /// # Example
9265 /// ```ignore,no_run
9266 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9267 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9268 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(Some(RotateEntraIdCertificateContext::default()/* use setters */));
9269 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(None::<RotateEntraIdCertificateContext>);
9270 /// ```
9271 pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
9272 mut self,
9273 v: std::option::Option<T>,
9274 ) -> Self
9275 where
9276 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9277 {
9278 self.rotate_entra_id_certificate_context = v.map(|x| x.into());
9279 self
9280 }
9281}
9282
9283impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
9284 fn typename() -> &'static str {
9285 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
9286 }
9287}
9288
9289/// Instance truncate log request.
9290#[derive(Clone, Default, PartialEq)]
9291#[non_exhaustive]
9292pub struct InstancesTruncateLogRequest {
9293 /// Contains details about the truncate log operation.
9294 pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
9295
9296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9297}
9298
9299impl InstancesTruncateLogRequest {
9300 pub fn new() -> Self {
9301 std::default::Default::default()
9302 }
9303
9304 /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9305 ///
9306 /// # Example
9307 /// ```ignore,no_run
9308 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9309 /// use google_cloud_sql_v1::model::TruncateLogContext;
9310 /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
9311 /// ```
9312 pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
9313 where
9314 T: std::convert::Into<crate::model::TruncateLogContext>,
9315 {
9316 self.truncate_log_context = std::option::Option::Some(v.into());
9317 self
9318 }
9319
9320 /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9321 ///
9322 /// # Example
9323 /// ```ignore,no_run
9324 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9325 /// use google_cloud_sql_v1::model::TruncateLogContext;
9326 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
9327 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
9328 /// ```
9329 pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
9330 where
9331 T: std::convert::Into<crate::model::TruncateLogContext>,
9332 {
9333 self.truncate_log_context = v.map(|x| x.into());
9334 self
9335 }
9336}
9337
9338impl wkt::message::Message for InstancesTruncateLogRequest {
9339 fn typename() -> &'static str {
9340 "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
9341 }
9342}
9343
9344/// Request to acquire a lease for SSRS.
9345#[derive(Clone, Default, PartialEq)]
9346#[non_exhaustive]
9347pub struct InstancesAcquireSsrsLeaseRequest {
9348 /// Contains details about the acquire SSRS lease operation.
9349 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
9350
9351 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9352}
9353
9354impl InstancesAcquireSsrsLeaseRequest {
9355 pub fn new() -> Self {
9356 std::default::Default::default()
9357 }
9358
9359 /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9360 ///
9361 /// # Example
9362 /// ```ignore,no_run
9363 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9364 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9365 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
9366 /// ```
9367 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
9368 where
9369 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9370 {
9371 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
9372 self
9373 }
9374
9375 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9376 ///
9377 /// # Example
9378 /// ```ignore,no_run
9379 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9380 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9381 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
9382 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
9383 /// ```
9384 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
9385 where
9386 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9387 {
9388 self.acquire_ssrs_lease_context = v.map(|x| x.into());
9389 self
9390 }
9391}
9392
9393impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
9394 fn typename() -> &'static str {
9395 "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
9396 }
9397}
9398
9399/// Request for Pre-checks for MVU
9400#[derive(Clone, Default, PartialEq)]
9401#[non_exhaustive]
9402pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
9403 /// Required. Cloud SQL instance ID. This does not include the project ID.
9404 pub instance: std::string::String,
9405
9406 /// Required. Project ID of the project that contains the instance.
9407 pub project: std::string::String,
9408
9409 /// Required. The context for request to perform the pre-check major version
9410 /// upgrade operation.
9411 pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9412
9413 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9414}
9415
9416impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
9417 pub fn new() -> Self {
9418 std::default::Default::default()
9419 }
9420
9421 /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
9422 ///
9423 /// # Example
9424 /// ```ignore,no_run
9425 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9426 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_instance("example");
9427 /// ```
9428 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9429 self.instance = v.into();
9430 self
9431 }
9432
9433 /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
9434 ///
9435 /// # Example
9436 /// ```ignore,no_run
9437 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9438 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_project("example");
9439 /// ```
9440 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9441 self.project = v.into();
9442 self
9443 }
9444
9445 /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9446 ///
9447 /// # Example
9448 /// ```ignore,no_run
9449 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9450 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9451 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_body(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */);
9452 /// ```
9453 pub fn set_body<T>(mut self, v: T) -> Self
9454 where
9455 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9456 {
9457 self.body = std::option::Option::Some(v.into());
9458 self
9459 }
9460
9461 /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9462 ///
9463 /// # Example
9464 /// ```ignore,no_run
9465 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9466 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9467 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(Some(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */));
9468 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(None::<InstancesPreCheckMajorVersionUpgradeRequest>);
9469 /// ```
9470 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9471 where
9472 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9473 {
9474 self.body = v.map(|x| x.into());
9475 self
9476 }
9477}
9478
9479impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
9480 fn typename() -> &'static str {
9481 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
9482 }
9483}
9484
9485/// Instance verify external sync settings response.
9486#[derive(Clone, Default, PartialEq)]
9487#[non_exhaustive]
9488pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
9489 /// This is always `sql#migrationSettingErrorList`.
9490 pub kind: std::string::String,
9491
9492 /// List of migration violations.
9493 pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9494
9495 /// List of migration warnings.
9496 pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9497
9498 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9499}
9500
9501impl SqlInstancesVerifyExternalSyncSettingsResponse {
9502 pub fn new() -> Self {
9503 std::default::Default::default()
9504 }
9505
9506 /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
9507 ///
9508 /// # Example
9509 /// ```ignore,no_run
9510 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9511 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::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 [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
9519 ///
9520 /// # Example
9521 /// ```ignore,no_run
9522 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9523 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9524 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9525 /// .set_errors([
9526 /// SqlExternalSyncSettingError::default()/* use setters */,
9527 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
9528 /// ]);
9529 /// ```
9530 pub fn set_errors<T, V>(mut self, v: T) -> Self
9531 where
9532 T: std::iter::IntoIterator<Item = V>,
9533 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9534 {
9535 use std::iter::Iterator;
9536 self.errors = v.into_iter().map(|i| i.into()).collect();
9537 self
9538 }
9539
9540 /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
9541 ///
9542 /// # Example
9543 /// ```ignore,no_run
9544 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9545 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9546 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9547 /// .set_warnings([
9548 /// SqlExternalSyncSettingError::default()/* use setters */,
9549 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
9550 /// ]);
9551 /// ```
9552 pub fn set_warnings<T, V>(mut self, v: T) -> Self
9553 where
9554 T: std::iter::IntoIterator<Item = V>,
9555 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9556 {
9557 use std::iter::Iterator;
9558 self.warnings = v.into_iter().map(|i| i.into()).collect();
9559 self
9560 }
9561}
9562
9563impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
9564 fn typename() -> &'static str {
9565 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
9566 }
9567}
9568
9569/// Instance get disk shrink config response.
9570#[derive(Clone, Default, PartialEq)]
9571#[non_exhaustive]
9572pub struct SqlInstancesGetDiskShrinkConfigResponse {
9573 /// This is always `sql#getDiskShrinkConfig`.
9574 pub kind: std::string::String,
9575
9576 /// The minimum size to which a disk can be shrunk in GigaBytes.
9577 pub minimal_target_size_gb: i64,
9578
9579 /// Additional message to customers.
9580 pub message: std::string::String,
9581
9582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9583}
9584
9585impl SqlInstancesGetDiskShrinkConfigResponse {
9586 pub fn new() -> Self {
9587 std::default::Default::default()
9588 }
9589
9590 /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
9591 ///
9592 /// # Example
9593 /// ```ignore,no_run
9594 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9595 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
9596 /// ```
9597 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9598 self.kind = v.into();
9599 self
9600 }
9601
9602 /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
9603 ///
9604 /// # Example
9605 /// ```ignore,no_run
9606 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9607 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
9608 /// ```
9609 pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9610 self.minimal_target_size_gb = v.into();
9611 self
9612 }
9613
9614 /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
9615 ///
9616 /// # Example
9617 /// ```ignore,no_run
9618 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9619 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
9620 /// ```
9621 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9622 self.message = v.into();
9623 self
9624 }
9625}
9626
9627impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
9628 fn typename() -> &'static str {
9629 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
9630 }
9631}
9632
9633/// Instance get latest recovery time request.
9634#[derive(Clone, Default, PartialEq)]
9635#[non_exhaustive]
9636pub struct SqlInstancesGetLatestRecoveryTimeRequest {
9637 /// Cloud SQL instance ID. This does not include the project ID.
9638 pub instance: std::string::String,
9639
9640 /// Project ID of the project that contains the instance.
9641 pub project: std::string::String,
9642
9643 /// The timestamp used to identify the time when the source instance is
9644 /// deleted. If this instance is deleted, then you must set the timestamp.
9645 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9646
9647 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9648}
9649
9650impl SqlInstancesGetLatestRecoveryTimeRequest {
9651 pub fn new() -> Self {
9652 std::default::Default::default()
9653 }
9654
9655 /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
9656 ///
9657 /// # Example
9658 /// ```ignore,no_run
9659 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9660 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
9661 /// ```
9662 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9663 self.instance = v.into();
9664 self
9665 }
9666
9667 /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
9668 ///
9669 /// # Example
9670 /// ```ignore,no_run
9671 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9672 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
9673 /// ```
9674 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9675 self.project = v.into();
9676 self
9677 }
9678
9679 /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9680 ///
9681 /// # Example
9682 /// ```ignore,no_run
9683 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9684 /// use wkt::Timestamp;
9685 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
9686 /// ```
9687 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
9688 where
9689 T: std::convert::Into<wkt::Timestamp>,
9690 {
9691 self.source_instance_deletion_time = std::option::Option::Some(v.into());
9692 self
9693 }
9694
9695 /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9696 ///
9697 /// # Example
9698 /// ```ignore,no_run
9699 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9700 /// use wkt::Timestamp;
9701 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
9702 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
9703 /// ```
9704 pub fn set_or_clear_source_instance_deletion_time<T>(
9705 mut self,
9706 v: std::option::Option<T>,
9707 ) -> Self
9708 where
9709 T: std::convert::Into<wkt::Timestamp>,
9710 {
9711 self.source_instance_deletion_time = v.map(|x| x.into());
9712 self
9713 }
9714}
9715
9716impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
9717 fn typename() -> &'static str {
9718 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
9719 }
9720}
9721
9722/// Instance get latest recovery time response.
9723#[derive(Clone, Default, PartialEq)]
9724#[non_exhaustive]
9725pub struct SqlInstancesGetLatestRecoveryTimeResponse {
9726 /// This is always `sql#getLatestRecoveryTime`.
9727 pub kind: std::string::String,
9728
9729 /// Timestamp, identifies the latest recovery time of the source instance.
9730 pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
9731
9732 /// Timestamp, identifies the earliest recovery time of the source instance.
9733 pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
9734
9735 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9736}
9737
9738impl SqlInstancesGetLatestRecoveryTimeResponse {
9739 pub fn new() -> Self {
9740 std::default::Default::default()
9741 }
9742
9743 /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
9744 ///
9745 /// # Example
9746 /// ```ignore,no_run
9747 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9748 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
9749 /// ```
9750 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9751 self.kind = v.into();
9752 self
9753 }
9754
9755 /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9756 ///
9757 /// # Example
9758 /// ```ignore,no_run
9759 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9760 /// use wkt::Timestamp;
9761 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
9762 /// ```
9763 pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
9764 where
9765 T: std::convert::Into<wkt::Timestamp>,
9766 {
9767 self.latest_recovery_time = std::option::Option::Some(v.into());
9768 self
9769 }
9770
9771 /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9772 ///
9773 /// # Example
9774 /// ```ignore,no_run
9775 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9776 /// use wkt::Timestamp;
9777 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
9778 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
9779 /// ```
9780 pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9781 where
9782 T: std::convert::Into<wkt::Timestamp>,
9783 {
9784 self.latest_recovery_time = v.map(|x| x.into());
9785 self
9786 }
9787
9788 /// Sets the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9789 ///
9790 /// # Example
9791 /// ```ignore,no_run
9792 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9793 /// use wkt::Timestamp;
9794 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_earliest_recovery_time(Timestamp::default()/* use setters */);
9795 /// ```
9796 pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
9797 where
9798 T: std::convert::Into<wkt::Timestamp>,
9799 {
9800 self.earliest_recovery_time = std::option::Option::Some(v.into());
9801 self
9802 }
9803
9804 /// Sets or clears the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9805 ///
9806 /// # Example
9807 /// ```ignore,no_run
9808 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9809 /// use wkt::Timestamp;
9810 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(Some(Timestamp::default()/* use setters */));
9811 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(None::<Timestamp>);
9812 /// ```
9813 pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9814 where
9815 T: std::convert::Into<wkt::Timestamp>,
9816 {
9817 self.earliest_recovery_time = v.map(|x| x.into());
9818 self
9819 }
9820}
9821
9822impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
9823 fn typename() -> &'static str {
9824 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
9825 }
9826}
9827
9828/// Database instance clone context.
9829#[derive(Clone, Default, PartialEq)]
9830#[non_exhaustive]
9831pub struct CloneContext {
9832 /// This is always `sql#cloneContext`.
9833 pub kind: std::string::String,
9834
9835 /// Reserved for future use.
9836 pub pitr_timestamp_ms: i64,
9837
9838 /// Required. Name of the Cloud SQL instance to be created as a clone.
9839 pub destination_instance_name: std::string::String,
9840
9841 /// Binary log coordinates, if specified, identify the position up to which the
9842 /// source instance is cloned. If not specified, the source instance is
9843 /// cloned up to the most recent binary log coordinates.
9844 pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
9845
9846 /// Timestamp, if specified, identifies the time to which the source instance
9847 /// is cloned.
9848 pub point_in_time: std::option::Option<wkt::Timestamp>,
9849
9850 /// The name of the allocated ip range for the private ip Cloud SQL instance.
9851 /// For example: "google-managed-services-default". If set, the cloned instance
9852 /// ip will be created in the allocated range. The range name must comply with
9853 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
9854 /// must be 1-63 characters long and match the regular expression
9855 /// [a-z]([-a-z0-9]*[a-z0-9])?.
9856 /// Reserved for future use.
9857 pub allocated_ip_range: std::string::String,
9858
9859 /// (SQL Server only) Clone only the specified databases from the source
9860 /// instance. Clone all databases if empty.
9861 pub database_names: std::vec::Vec<std::string::String>,
9862
9863 /// Optional. Copy clone and point-in-time recovery clone of an instance to the
9864 /// specified zone. If no zone is specified, clone to the same primary zone as
9865 /// the source instance. This field applies to all DB types.
9866 pub preferred_zone: std::option::Option<std::string::String>,
9867
9868 /// Optional. Copy clone and point-in-time recovery clone of a regional
9869 /// instance in the specified zones. If not specified, clone to the same
9870 /// secondary zone as the source instance. This value cannot be the same as the
9871 /// preferred_zone field. This field applies to all DB types.
9872 pub preferred_secondary_zone: std::option::Option<std::string::String>,
9873
9874 /// The timestamp used to identify the time when the source instance is
9875 /// deleted. If this instance is deleted, then you must set the timestamp.
9876 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9877
9878 /// Optional. The project ID of the destination project where the cloned
9879 /// instance will be created. To perform a cross-project clone, this field is
9880 /// required. If not specified, the clone is created in the same project
9881 /// as the source instance.
9882 pub destination_project: std::option::Option<std::string::String>,
9883
9884 /// Optional. The fully qualified URI of the VPC network to which the cloned
9885 /// instance will be connected via Private Services Access for private IP. For
9886 /// example:`projects/my-network-project/global/networks/my-network`. This
9887 /// field is only required for cross-project cloning.
9888 pub destination_network: std::option::Option<std::string::String>,
9889
9890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9891}
9892
9893impl CloneContext {
9894 pub fn new() -> Self {
9895 std::default::Default::default()
9896 }
9897
9898 /// Sets the value of [kind][crate::model::CloneContext::kind].
9899 ///
9900 /// # Example
9901 /// ```ignore,no_run
9902 /// # use google_cloud_sql_v1::model::CloneContext;
9903 /// let x = CloneContext::new().set_kind("example");
9904 /// ```
9905 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9906 self.kind = v.into();
9907 self
9908 }
9909
9910 /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
9911 ///
9912 /// # Example
9913 /// ```ignore,no_run
9914 /// # use google_cloud_sql_v1::model::CloneContext;
9915 /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
9916 /// ```
9917 pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9918 self.pitr_timestamp_ms = v.into();
9919 self
9920 }
9921
9922 /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
9923 ///
9924 /// # Example
9925 /// ```ignore,no_run
9926 /// # use google_cloud_sql_v1::model::CloneContext;
9927 /// let x = CloneContext::new().set_destination_instance_name("example");
9928 /// ```
9929 pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
9930 mut self,
9931 v: T,
9932 ) -> Self {
9933 self.destination_instance_name = v.into();
9934 self
9935 }
9936
9937 /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
9938 ///
9939 /// # Example
9940 /// ```ignore,no_run
9941 /// # use google_cloud_sql_v1::model::CloneContext;
9942 /// use google_cloud_sql_v1::model::BinLogCoordinates;
9943 /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
9944 /// ```
9945 pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
9946 where
9947 T: std::convert::Into<crate::model::BinLogCoordinates>,
9948 {
9949 self.bin_log_coordinates = std::option::Option::Some(v.into());
9950 self
9951 }
9952
9953 /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
9954 ///
9955 /// # Example
9956 /// ```ignore,no_run
9957 /// # use google_cloud_sql_v1::model::CloneContext;
9958 /// use google_cloud_sql_v1::model::BinLogCoordinates;
9959 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
9960 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
9961 /// ```
9962 pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
9963 where
9964 T: std::convert::Into<crate::model::BinLogCoordinates>,
9965 {
9966 self.bin_log_coordinates = v.map(|x| x.into());
9967 self
9968 }
9969
9970 /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
9971 ///
9972 /// # Example
9973 /// ```ignore,no_run
9974 /// # use google_cloud_sql_v1::model::CloneContext;
9975 /// use wkt::Timestamp;
9976 /// let x = CloneContext::new().set_point_in_time(Timestamp::default()/* use setters */);
9977 /// ```
9978 pub fn set_point_in_time<T>(mut self, v: T) -> Self
9979 where
9980 T: std::convert::Into<wkt::Timestamp>,
9981 {
9982 self.point_in_time = std::option::Option::Some(v.into());
9983 self
9984 }
9985
9986 /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
9987 ///
9988 /// # Example
9989 /// ```ignore,no_run
9990 /// # use google_cloud_sql_v1::model::CloneContext;
9991 /// use wkt::Timestamp;
9992 /// let x = CloneContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
9993 /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
9994 /// ```
9995 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
9996 where
9997 T: std::convert::Into<wkt::Timestamp>,
9998 {
9999 self.point_in_time = v.map(|x| x.into());
10000 self
10001 }
10002
10003 /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
10004 ///
10005 /// # Example
10006 /// ```ignore,no_run
10007 /// # use google_cloud_sql_v1::model::CloneContext;
10008 /// let x = CloneContext::new().set_allocated_ip_range("example");
10009 /// ```
10010 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10011 mut self,
10012 v: T,
10013 ) -> Self {
10014 self.allocated_ip_range = v.into();
10015 self
10016 }
10017
10018 /// Sets the value of [database_names][crate::model::CloneContext::database_names].
10019 ///
10020 /// # Example
10021 /// ```ignore,no_run
10022 /// # use google_cloud_sql_v1::model::CloneContext;
10023 /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
10024 /// ```
10025 pub fn set_database_names<T, V>(mut self, v: T) -> Self
10026 where
10027 T: std::iter::IntoIterator<Item = V>,
10028 V: std::convert::Into<std::string::String>,
10029 {
10030 use std::iter::Iterator;
10031 self.database_names = v.into_iter().map(|i| i.into()).collect();
10032 self
10033 }
10034
10035 /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10036 ///
10037 /// # Example
10038 /// ```ignore,no_run
10039 /// # use google_cloud_sql_v1::model::CloneContext;
10040 /// let x = CloneContext::new().set_preferred_zone("example");
10041 /// ```
10042 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10043 where
10044 T: std::convert::Into<std::string::String>,
10045 {
10046 self.preferred_zone = std::option::Option::Some(v.into());
10047 self
10048 }
10049
10050 /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10051 ///
10052 /// # Example
10053 /// ```ignore,no_run
10054 /// # use google_cloud_sql_v1::model::CloneContext;
10055 /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
10056 /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
10057 /// ```
10058 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10059 where
10060 T: std::convert::Into<std::string::String>,
10061 {
10062 self.preferred_zone = v.map(|x| x.into());
10063 self
10064 }
10065
10066 /// Sets the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10067 ///
10068 /// # Example
10069 /// ```ignore,no_run
10070 /// # use google_cloud_sql_v1::model::CloneContext;
10071 /// let x = CloneContext::new().set_preferred_secondary_zone("example");
10072 /// ```
10073 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10074 where
10075 T: std::convert::Into<std::string::String>,
10076 {
10077 self.preferred_secondary_zone = std::option::Option::Some(v.into());
10078 self
10079 }
10080
10081 /// Sets or clears the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10082 ///
10083 /// # Example
10084 /// ```ignore,no_run
10085 /// # use google_cloud_sql_v1::model::CloneContext;
10086 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10087 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10088 /// ```
10089 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10090 where
10091 T: std::convert::Into<std::string::String>,
10092 {
10093 self.preferred_secondary_zone = v.map(|x| x.into());
10094 self
10095 }
10096
10097 /// Sets the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10098 ///
10099 /// # Example
10100 /// ```ignore,no_run
10101 /// # use google_cloud_sql_v1::model::CloneContext;
10102 /// use wkt::Timestamp;
10103 /// let x = CloneContext::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
10104 /// ```
10105 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
10106 where
10107 T: std::convert::Into<wkt::Timestamp>,
10108 {
10109 self.source_instance_deletion_time = std::option::Option::Some(v.into());
10110 self
10111 }
10112
10113 /// Sets or clears the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10114 ///
10115 /// # Example
10116 /// ```ignore,no_run
10117 /// # use google_cloud_sql_v1::model::CloneContext;
10118 /// use wkt::Timestamp;
10119 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
10120 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
10121 /// ```
10122 pub fn set_or_clear_source_instance_deletion_time<T>(
10123 mut self,
10124 v: std::option::Option<T>,
10125 ) -> Self
10126 where
10127 T: std::convert::Into<wkt::Timestamp>,
10128 {
10129 self.source_instance_deletion_time = v.map(|x| x.into());
10130 self
10131 }
10132
10133 /// Sets the value of [destination_project][crate::model::CloneContext::destination_project].
10134 ///
10135 /// # Example
10136 /// ```ignore,no_run
10137 /// # use google_cloud_sql_v1::model::CloneContext;
10138 /// let x = CloneContext::new().set_destination_project("example");
10139 /// ```
10140 pub fn set_destination_project<T>(mut self, v: T) -> Self
10141 where
10142 T: std::convert::Into<std::string::String>,
10143 {
10144 self.destination_project = std::option::Option::Some(v.into());
10145 self
10146 }
10147
10148 /// Sets or clears the value of [destination_project][crate::model::CloneContext::destination_project].
10149 ///
10150 /// # Example
10151 /// ```ignore,no_run
10152 /// # use google_cloud_sql_v1::model::CloneContext;
10153 /// let x = CloneContext::new().set_or_clear_destination_project(Some("example"));
10154 /// let x = CloneContext::new().set_or_clear_destination_project(None::<String>);
10155 /// ```
10156 pub fn set_or_clear_destination_project<T>(mut self, v: std::option::Option<T>) -> Self
10157 where
10158 T: std::convert::Into<std::string::String>,
10159 {
10160 self.destination_project = v.map(|x| x.into());
10161 self
10162 }
10163
10164 /// Sets the value of [destination_network][crate::model::CloneContext::destination_network].
10165 ///
10166 /// # Example
10167 /// ```ignore,no_run
10168 /// # use google_cloud_sql_v1::model::CloneContext;
10169 /// let x = CloneContext::new().set_destination_network("example");
10170 /// ```
10171 pub fn set_destination_network<T>(mut self, v: T) -> Self
10172 where
10173 T: std::convert::Into<std::string::String>,
10174 {
10175 self.destination_network = std::option::Option::Some(v.into());
10176 self
10177 }
10178
10179 /// Sets or clears the value of [destination_network][crate::model::CloneContext::destination_network].
10180 ///
10181 /// # Example
10182 /// ```ignore,no_run
10183 /// # use google_cloud_sql_v1::model::CloneContext;
10184 /// let x = CloneContext::new().set_or_clear_destination_network(Some("example"));
10185 /// let x = CloneContext::new().set_or_clear_destination_network(None::<String>);
10186 /// ```
10187 pub fn set_or_clear_destination_network<T>(mut self, v: std::option::Option<T>) -> Self
10188 where
10189 T: std::convert::Into<std::string::String>,
10190 {
10191 self.destination_network = v.map(|x| x.into());
10192 self
10193 }
10194}
10195
10196impl wkt::message::Message for CloneContext {
10197 fn typename() -> &'static str {
10198 "type.googleapis.com/google.cloud.sql.v1.CloneContext"
10199 }
10200}
10201
10202/// The context to perform a point-in-time recovery of an instance managed by
10203/// Backup and Disaster Recovery (DR) Service.
10204#[derive(Clone, Default, PartialEq)]
10205#[non_exhaustive]
10206pub struct PointInTimeRestoreContext {
10207 /// The Backup and Disaster Recovery (DR) Service Datasource URI.
10208 /// Format:
10209 /// projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
10210 pub datasource: std::option::Option<std::string::String>,
10211
10212 /// Required. The date and time to which you want to restore the instance.
10213 pub point_in_time: std::option::Option<wkt::Timestamp>,
10214
10215 /// Target instance name.
10216 pub target_instance: std::option::Option<std::string::String>,
10217
10218 /// Optional. The resource link for the VPC network from which the Cloud SQL
10219 /// instance is accessible for private IP. For example,
10220 /// `/projects/myProject/global/networks/default`.
10221 pub private_network: std::option::Option<std::string::String>,
10222
10223 /// Optional. The name of the allocated IP range for the internal IP Cloud SQL
10224 /// instance. For example: "google-managed-services-default". If you set this,
10225 /// then Cloud SQL creates the IP address for the cloned instance in the
10226 /// allocated range. This range must comply with [RFC
10227 /// 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
10228 /// name must be 1-63 characters long and match the regular expression
10229 /// [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
10230 pub allocated_ip_range: std::option::Option<std::string::String>,
10231
10232 /// Optional. Point-in-time recovery of an instance to the specified zone. If
10233 /// no zone is specified, then clone to the same primary zone as the source
10234 /// instance.
10235 pub preferred_zone: std::option::Option<std::string::String>,
10236
10237 /// Optional. Point-in-time recovery of a regional instance in the specified
10238 /// zones. If not specified, clone to the same secondary zone as the source
10239 /// instance. This value cannot be the same as the preferred_zone field.
10240 pub preferred_secondary_zone: std::option::Option<std::string::String>,
10241
10242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10243}
10244
10245impl PointInTimeRestoreContext {
10246 pub fn new() -> Self {
10247 std::default::Default::default()
10248 }
10249
10250 /// Sets the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10251 ///
10252 /// # Example
10253 /// ```ignore,no_run
10254 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10255 /// let x = PointInTimeRestoreContext::new().set_datasource("example");
10256 /// ```
10257 pub fn set_datasource<T>(mut self, v: T) -> Self
10258 where
10259 T: std::convert::Into<std::string::String>,
10260 {
10261 self.datasource = std::option::Option::Some(v.into());
10262 self
10263 }
10264
10265 /// Sets or clears the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10266 ///
10267 /// # Example
10268 /// ```ignore,no_run
10269 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10270 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(Some("example"));
10271 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(None::<String>);
10272 /// ```
10273 pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
10274 where
10275 T: std::convert::Into<std::string::String>,
10276 {
10277 self.datasource = v.map(|x| x.into());
10278 self
10279 }
10280
10281 /// Sets the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10282 ///
10283 /// # Example
10284 /// ```ignore,no_run
10285 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10286 /// use wkt::Timestamp;
10287 /// let x = PointInTimeRestoreContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10288 /// ```
10289 pub fn set_point_in_time<T>(mut self, v: T) -> Self
10290 where
10291 T: std::convert::Into<wkt::Timestamp>,
10292 {
10293 self.point_in_time = std::option::Option::Some(v.into());
10294 self
10295 }
10296
10297 /// Sets or clears the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10298 ///
10299 /// # Example
10300 /// ```ignore,no_run
10301 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10302 /// use wkt::Timestamp;
10303 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10304 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10305 /// ```
10306 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10307 where
10308 T: std::convert::Into<wkt::Timestamp>,
10309 {
10310 self.point_in_time = v.map(|x| x.into());
10311 self
10312 }
10313
10314 /// Sets the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10315 ///
10316 /// # Example
10317 /// ```ignore,no_run
10318 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10319 /// let x = PointInTimeRestoreContext::new().set_target_instance("example");
10320 /// ```
10321 pub fn set_target_instance<T>(mut self, v: T) -> Self
10322 where
10323 T: std::convert::Into<std::string::String>,
10324 {
10325 self.target_instance = std::option::Option::Some(v.into());
10326 self
10327 }
10328
10329 /// Sets or clears the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10330 ///
10331 /// # Example
10332 /// ```ignore,no_run
10333 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10334 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(Some("example"));
10335 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(None::<String>);
10336 /// ```
10337 pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
10338 where
10339 T: std::convert::Into<std::string::String>,
10340 {
10341 self.target_instance = v.map(|x| x.into());
10342 self
10343 }
10344
10345 /// Sets the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10346 ///
10347 /// # Example
10348 /// ```ignore,no_run
10349 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10350 /// let x = PointInTimeRestoreContext::new().set_private_network("example");
10351 /// ```
10352 pub fn set_private_network<T>(mut self, v: T) -> Self
10353 where
10354 T: std::convert::Into<std::string::String>,
10355 {
10356 self.private_network = std::option::Option::Some(v.into());
10357 self
10358 }
10359
10360 /// Sets or clears the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10361 ///
10362 /// # Example
10363 /// ```ignore,no_run
10364 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10365 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(Some("example"));
10366 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(None::<String>);
10367 /// ```
10368 pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
10369 where
10370 T: std::convert::Into<std::string::String>,
10371 {
10372 self.private_network = v.map(|x| x.into());
10373 self
10374 }
10375
10376 /// Sets the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10377 ///
10378 /// # Example
10379 /// ```ignore,no_run
10380 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10381 /// let x = PointInTimeRestoreContext::new().set_allocated_ip_range("example");
10382 /// ```
10383 pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
10384 where
10385 T: std::convert::Into<std::string::String>,
10386 {
10387 self.allocated_ip_range = std::option::Option::Some(v.into());
10388 self
10389 }
10390
10391 /// Sets or clears the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10392 ///
10393 /// # Example
10394 /// ```ignore,no_run
10395 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10396 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(Some("example"));
10397 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(None::<String>);
10398 /// ```
10399 pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
10400 where
10401 T: std::convert::Into<std::string::String>,
10402 {
10403 self.allocated_ip_range = v.map(|x| x.into());
10404 self
10405 }
10406
10407 /// Sets the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10408 ///
10409 /// # Example
10410 /// ```ignore,no_run
10411 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10412 /// let x = PointInTimeRestoreContext::new().set_preferred_zone("example");
10413 /// ```
10414 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10415 where
10416 T: std::convert::Into<std::string::String>,
10417 {
10418 self.preferred_zone = std::option::Option::Some(v.into());
10419 self
10420 }
10421
10422 /// Sets or clears the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10423 ///
10424 /// # Example
10425 /// ```ignore,no_run
10426 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10427 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(Some("example"));
10428 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(None::<String>);
10429 /// ```
10430 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10431 where
10432 T: std::convert::Into<std::string::String>,
10433 {
10434 self.preferred_zone = v.map(|x| x.into());
10435 self
10436 }
10437
10438 /// Sets the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10439 ///
10440 /// # Example
10441 /// ```ignore,no_run
10442 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10443 /// let x = PointInTimeRestoreContext::new().set_preferred_secondary_zone("example");
10444 /// ```
10445 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10446 where
10447 T: std::convert::Into<std::string::String>,
10448 {
10449 self.preferred_secondary_zone = std::option::Option::Some(v.into());
10450 self
10451 }
10452
10453 /// Sets or clears the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10454 ///
10455 /// # Example
10456 /// ```ignore,no_run
10457 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10458 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10459 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10460 /// ```
10461 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10462 where
10463 T: std::convert::Into<std::string::String>,
10464 {
10465 self.preferred_secondary_zone = v.map(|x| x.into());
10466 self
10467 }
10468}
10469
10470impl wkt::message::Message for PointInTimeRestoreContext {
10471 fn typename() -> &'static str {
10472 "type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
10473 }
10474}
10475
10476/// Binary log coordinates.
10477#[derive(Clone, Default, PartialEq)]
10478#[non_exhaustive]
10479pub struct BinLogCoordinates {
10480 /// Name of the binary log file for a Cloud SQL instance.
10481 pub bin_log_file_name: std::string::String,
10482
10483 /// Position (offset) within the binary log file.
10484 pub bin_log_position: i64,
10485
10486 /// This is always `sql#binLogCoordinates`.
10487 pub kind: std::string::String,
10488
10489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10490}
10491
10492impl BinLogCoordinates {
10493 pub fn new() -> Self {
10494 std::default::Default::default()
10495 }
10496
10497 /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
10498 ///
10499 /// # Example
10500 /// ```ignore,no_run
10501 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10502 /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
10503 /// ```
10504 pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
10505 mut self,
10506 v: T,
10507 ) -> Self {
10508 self.bin_log_file_name = v.into();
10509 self
10510 }
10511
10512 /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
10513 ///
10514 /// # Example
10515 /// ```ignore,no_run
10516 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10517 /// let x = BinLogCoordinates::new().set_bin_log_position(42);
10518 /// ```
10519 pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10520 self.bin_log_position = v.into();
10521 self
10522 }
10523
10524 /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
10525 ///
10526 /// # Example
10527 /// ```ignore,no_run
10528 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10529 /// let x = BinLogCoordinates::new().set_kind("example");
10530 /// ```
10531 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10532 self.kind = v.into();
10533 self
10534 }
10535}
10536
10537impl wkt::message::Message for BinLogCoordinates {
10538 fn typename() -> &'static str {
10539 "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
10540 }
10541}
10542
10543/// A Cloud SQL instance resource.
10544#[derive(Clone, Default, PartialEq)]
10545#[non_exhaustive]
10546pub struct DatabaseInstance {
10547 /// This is always `sql#instance`.
10548 pub kind: std::string::String,
10549
10550 /// The current serving state of the Cloud SQL instance.
10551 pub state: crate::model::database_instance::SqlInstanceState,
10552
10553 /// The database engine type and version. The `databaseVersion` field cannot
10554 /// be changed after instance creation.
10555 pub database_version: crate::model::SqlDatabaseVersion,
10556
10557 /// The user settings.
10558 pub settings: std::option::Option<crate::model::Settings>,
10559
10560 /// This field is deprecated and will be removed from a future version of the
10561 /// API. Use the `settings.settingsVersion` field instead.
10562 pub etag: std::string::String,
10563
10564 /// The name and status of the failover replica.
10565 pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
10566
10567 /// The name of the instance which will act as primary in the replication
10568 /// setup.
10569 pub master_instance_name: std::string::String,
10570
10571 /// The replicas of the instance.
10572 pub replica_names: std::vec::Vec<std::string::String>,
10573
10574 /// The maximum disk size of the instance in bytes.
10575 #[deprecated]
10576 pub max_disk_size: std::option::Option<wkt::Int64Value>,
10577
10578 /// The current disk usage of the instance in bytes. This property has been
10579 /// deprecated. Use the
10580 /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
10581 /// Monitoring API instead. Please see [this
10582 /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
10583 /// for details.
10584 #[deprecated]
10585 pub current_disk_size: std::option::Option<wkt::Int64Value>,
10586
10587 /// The assigned IP addresses for the instance.
10588 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
10589
10590 /// SSL configuration.
10591 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
10592
10593 /// The instance type.
10594 pub instance_type: crate::model::SqlInstanceType,
10595
10596 /// The project ID of the project containing the Cloud SQL instance. The Google
10597 /// apps domain is prefixed if applicable.
10598 pub project: std::string::String,
10599
10600 /// The IPv6 address assigned to the instance.
10601 /// (Deprecated) This property was applicable only
10602 /// to First Generation instances.
10603 #[deprecated]
10604 pub ipv6_address: std::string::String,
10605
10606 /// The service account email address assigned to the instance.\This
10607 /// property is read-only.
10608 pub service_account_email_address: std::string::String,
10609
10610 /// Configuration specific to on-premises instances.
10611 pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
10612
10613 /// Configuration specific to failover replicas and read replicas.
10614 pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
10615
10616 /// The backend type.
10617 /// `SECOND_GEN`: Cloud SQL database instance.
10618 /// `EXTERNAL`: A database server that is not managed by Google.
10619 ///
10620 /// This property is read-only; use the `tier` property in the `settings`
10621 /// object to determine the database type.
10622 pub backend_type: crate::model::SqlBackendType,
10623
10624 /// The URI of this resource.
10625 pub self_link: std::string::String,
10626
10627 /// If the instance state is SUSPENDED, the reason for the suspension.
10628 pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
10629
10630 /// Connection name of the Cloud SQL instance used in connection strings.
10631 pub connection_name: std::string::String,
10632
10633 /// Name of the Cloud SQL instance. This does not include the project ID.
10634 pub name: std::string::String,
10635
10636 /// The geographical region of the Cloud SQL instance.
10637 ///
10638 /// It can be one of the
10639 /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
10640 /// where Cloud SQL operates:
10641 ///
10642 /// For example, `asia-east1`, `europe-west1`, and `us-central1`.
10643 /// The default value is `us-central1`.
10644 pub region: std::string::String,
10645
10646 /// The Compute Engine zone that the instance is currently serving from. This
10647 /// value could be different from the zone that was specified when the instance
10648 /// was created if the instance has failed over to its secondary zone. WARNING:
10649 /// Changing this might restart the instance.
10650 pub gce_zone: std::string::String,
10651
10652 /// The Compute Engine zone that the failover instance is currently serving
10653 /// from for a regional instance. This value could be different
10654 /// from the zone that was specified when the instance
10655 /// was created if the instance has failed over to its secondary/failover zone.
10656 pub secondary_gce_zone: std::string::String,
10657
10658 /// Disk encryption configuration specific to an instance.
10659 pub disk_encryption_configuration:
10660 std::option::Option<crate::model::DiskEncryptionConfiguration>,
10661
10662 /// Disk encryption status specific to an instance.
10663 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
10664
10665 /// Initial root password. Use only on creation. You must set root passwords
10666 /// before you can connect to PostgreSQL instances.
10667 pub root_password: std::string::String,
10668
10669 /// The start time of any upcoming scheduled maintenance for this instance.
10670 pub scheduled_maintenance:
10671 std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
10672
10673 /// This status indicates whether the instance satisfies PZS.
10674 ///
10675 /// The status is reserved for future use.
10676 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
10677
10678 /// Output only. Stores the current database version running on the instance
10679 /// including minor version such as `MYSQL_8_0_18`.
10680 pub database_installed_version: std::string::String,
10681
10682 /// This field represents the report generated by the proactive database
10683 /// wellness job for OutOfDisk issues.
10684 ///
10685 /// * Writers:
10686 /// * the proactive database wellness job for OOD.
10687 /// * Readers:
10688 /// * the proactive database wellness job
10689 pub out_of_disk_report:
10690 std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
10691
10692 /// Output only. The time when the instance was created in
10693 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
10694 /// `2012-11-15T16:19:00.094Z`.
10695 pub create_time: std::option::Option<wkt::Timestamp>,
10696
10697 /// Output only. List all maintenance versions applicable on the instance
10698 pub available_maintenance_versions: std::vec::Vec<std::string::String>,
10699
10700 /// The current software version on the instance.
10701 pub maintenance_version: std::string::String,
10702
10703 /// Output only. All database versions that are available for upgrade.
10704 pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
10705
10706 pub sql_network_architecture:
10707 std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
10708
10709 /// Output only. The link to service attachment of PSC instance.
10710 pub psc_service_attachment_link: std::option::Option<std::string::String>,
10711
10712 /// Output only. The dns name of the instance.
10713 pub dns_name: std::option::Option<std::string::String>,
10714
10715 /// Output only. DEPRECATED: please use write_endpoint instead.
10716 #[deprecated]
10717 pub primary_dns_name: std::option::Option<std::string::String>,
10718
10719 /// Output only. The dns name of the primary instance in a replication group.
10720 pub write_endpoint: std::option::Option<std::string::String>,
10721
10722 /// Optional. A primary instance and disaster recovery (DR) replica pair.
10723 /// A DR replica is a cross-region replica that you designate
10724 /// for failover in the event that the primary instance
10725 /// experiences regional failure.
10726 /// Applicable to MySQL and PostgreSQL.
10727 pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
10728
10729 /// Gemini instance configuration.
10730 pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
10731
10732 /// Output only. This status indicates whether the instance satisfies PZI.
10733 ///
10734 /// The status is reserved for future use.
10735 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
10736
10737 /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
10738 /// recovery log files from a data disk to Cloud Storage.
10739 pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
10740
10741 /// Input only. Determines whether an in-place major version upgrade of
10742 /// replicas happens when an in-place major version upgrade of a primary
10743 /// instance is initiated.
10744 pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
10745
10746 /// Optional. Input only. Immutable. Tag keys and tag values that are bound to
10747 /// this instance. You must represent each item in the map as:
10748 /// `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
10749 ///
10750 /// For example, a single resource can have the following tags:
10751 ///
10752 /// ```norust
10753 /// "123/environment": "production",
10754 /// "123/costCenter": "marketing",
10755 /// ```
10756 ///
10757 /// For more information on tag creation and management, see
10758 /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview>.
10759 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
10760
10761 /// The number of read pool nodes in a read pool.
10762 pub node_count: std::option::Option<i32>,
10763
10764 /// Output only. Entries containing information about each read pool node of
10765 /// the read pool.
10766 pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
10767
10768 /// Output only. The list of DNS names used by this instance.
10769 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
10770
10771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10772}
10773
10774impl DatabaseInstance {
10775 pub fn new() -> Self {
10776 std::default::Default::default()
10777 }
10778
10779 /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
10780 ///
10781 /// # Example
10782 /// ```ignore,no_run
10783 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10784 /// let x = DatabaseInstance::new().set_kind("example");
10785 /// ```
10786 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10787 self.kind = v.into();
10788 self
10789 }
10790
10791 /// Sets the value of [state][crate::model::DatabaseInstance::state].
10792 ///
10793 /// # Example
10794 /// ```ignore,no_run
10795 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10796 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
10797 /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
10798 /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
10799 /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
10800 /// ```
10801 pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
10802 mut self,
10803 v: T,
10804 ) -> Self {
10805 self.state = v.into();
10806 self
10807 }
10808
10809 /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
10810 ///
10811 /// # Example
10812 /// ```ignore,no_run
10813 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10814 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
10815 /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
10816 /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
10817 /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
10818 /// ```
10819 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
10820 mut self,
10821 v: T,
10822 ) -> Self {
10823 self.database_version = v.into();
10824 self
10825 }
10826
10827 /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
10828 ///
10829 /// # Example
10830 /// ```ignore,no_run
10831 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10832 /// use google_cloud_sql_v1::model::Settings;
10833 /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
10834 /// ```
10835 pub fn set_settings<T>(mut self, v: T) -> Self
10836 where
10837 T: std::convert::Into<crate::model::Settings>,
10838 {
10839 self.settings = std::option::Option::Some(v.into());
10840 self
10841 }
10842
10843 /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
10844 ///
10845 /// # Example
10846 /// ```ignore,no_run
10847 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10848 /// use google_cloud_sql_v1::model::Settings;
10849 /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
10850 /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
10851 /// ```
10852 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
10853 where
10854 T: std::convert::Into<crate::model::Settings>,
10855 {
10856 self.settings = v.map(|x| x.into());
10857 self
10858 }
10859
10860 /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
10861 ///
10862 /// # Example
10863 /// ```ignore,no_run
10864 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10865 /// let x = DatabaseInstance::new().set_etag("example");
10866 /// ```
10867 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10868 self.etag = v.into();
10869 self
10870 }
10871
10872 /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
10873 ///
10874 /// # Example
10875 /// ```ignore,no_run
10876 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10877 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
10878 /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
10879 /// ```
10880 pub fn set_failover_replica<T>(mut self, v: T) -> Self
10881 where
10882 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
10883 {
10884 self.failover_replica = std::option::Option::Some(v.into());
10885 self
10886 }
10887
10888 /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
10889 ///
10890 /// # Example
10891 /// ```ignore,no_run
10892 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10893 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
10894 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
10895 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
10896 /// ```
10897 pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
10898 where
10899 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
10900 {
10901 self.failover_replica = v.map(|x| x.into());
10902 self
10903 }
10904
10905 /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
10906 ///
10907 /// # Example
10908 /// ```ignore,no_run
10909 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10910 /// let x = DatabaseInstance::new().set_master_instance_name("example");
10911 /// ```
10912 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
10913 mut self,
10914 v: T,
10915 ) -> Self {
10916 self.master_instance_name = v.into();
10917 self
10918 }
10919
10920 /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
10921 ///
10922 /// # Example
10923 /// ```ignore,no_run
10924 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10925 /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
10926 /// ```
10927 pub fn set_replica_names<T, V>(mut self, v: T) -> Self
10928 where
10929 T: std::iter::IntoIterator<Item = V>,
10930 V: std::convert::Into<std::string::String>,
10931 {
10932 use std::iter::Iterator;
10933 self.replica_names = v.into_iter().map(|i| i.into()).collect();
10934 self
10935 }
10936
10937 /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
10938 ///
10939 /// # Example
10940 /// ```ignore,no_run
10941 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10942 /// use wkt::Int64Value;
10943 /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
10944 /// ```
10945 #[deprecated]
10946 pub fn set_max_disk_size<T>(mut self, v: T) -> Self
10947 where
10948 T: std::convert::Into<wkt::Int64Value>,
10949 {
10950 self.max_disk_size = std::option::Option::Some(v.into());
10951 self
10952 }
10953
10954 /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
10955 ///
10956 /// # Example
10957 /// ```ignore,no_run
10958 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10959 /// use wkt::Int64Value;
10960 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
10961 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
10962 /// ```
10963 #[deprecated]
10964 pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
10965 where
10966 T: std::convert::Into<wkt::Int64Value>,
10967 {
10968 self.max_disk_size = v.map(|x| x.into());
10969 self
10970 }
10971
10972 /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
10973 ///
10974 /// # Example
10975 /// ```ignore,no_run
10976 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10977 /// use wkt::Int64Value;
10978 /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
10979 /// ```
10980 #[deprecated]
10981 pub fn set_current_disk_size<T>(mut self, v: T) -> Self
10982 where
10983 T: std::convert::Into<wkt::Int64Value>,
10984 {
10985 self.current_disk_size = std::option::Option::Some(v.into());
10986 self
10987 }
10988
10989 /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
10990 ///
10991 /// # Example
10992 /// ```ignore,no_run
10993 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10994 /// use wkt::Int64Value;
10995 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
10996 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
10997 /// ```
10998 #[deprecated]
10999 pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11000 where
11001 T: std::convert::Into<wkt::Int64Value>,
11002 {
11003 self.current_disk_size = v.map(|x| x.into());
11004 self
11005 }
11006
11007 /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
11008 ///
11009 /// # Example
11010 /// ```ignore,no_run
11011 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11012 /// use google_cloud_sql_v1::model::IpMapping;
11013 /// let x = DatabaseInstance::new()
11014 /// .set_ip_addresses([
11015 /// IpMapping::default()/* use setters */,
11016 /// IpMapping::default()/* use (different) setters */,
11017 /// ]);
11018 /// ```
11019 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
11020 where
11021 T: std::iter::IntoIterator<Item = V>,
11022 V: std::convert::Into<crate::model::IpMapping>,
11023 {
11024 use std::iter::Iterator;
11025 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
11026 self
11027 }
11028
11029 /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11030 ///
11031 /// # Example
11032 /// ```ignore,no_run
11033 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11034 /// use google_cloud_sql_v1::model::SslCert;
11035 /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
11036 /// ```
11037 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
11038 where
11039 T: std::convert::Into<crate::model::SslCert>,
11040 {
11041 self.server_ca_cert = std::option::Option::Some(v.into());
11042 self
11043 }
11044
11045 /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11046 ///
11047 /// # Example
11048 /// ```ignore,no_run
11049 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11050 /// use google_cloud_sql_v1::model::SslCert;
11051 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
11052 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
11053 /// ```
11054 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
11055 where
11056 T: std::convert::Into<crate::model::SslCert>,
11057 {
11058 self.server_ca_cert = v.map(|x| x.into());
11059 self
11060 }
11061
11062 /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
11063 ///
11064 /// # Example
11065 /// ```ignore,no_run
11066 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11067 /// use google_cloud_sql_v1::model::SqlInstanceType;
11068 /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
11069 /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
11070 /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
11071 /// ```
11072 pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
11073 mut self,
11074 v: T,
11075 ) -> Self {
11076 self.instance_type = v.into();
11077 self
11078 }
11079
11080 /// Sets the value of [project][crate::model::DatabaseInstance::project].
11081 ///
11082 /// # Example
11083 /// ```ignore,no_run
11084 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11085 /// let x = DatabaseInstance::new().set_project("example");
11086 /// ```
11087 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11088 self.project = v.into();
11089 self
11090 }
11091
11092 /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
11093 ///
11094 /// # Example
11095 /// ```ignore,no_run
11096 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11097 /// let x = DatabaseInstance::new().set_ipv6_address("example");
11098 /// ```
11099 #[deprecated]
11100 pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11101 self.ipv6_address = v.into();
11102 self
11103 }
11104
11105 /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
11106 ///
11107 /// # Example
11108 /// ```ignore,no_run
11109 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11110 /// let x = DatabaseInstance::new().set_service_account_email_address("example");
11111 /// ```
11112 pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
11113 mut self,
11114 v: T,
11115 ) -> Self {
11116 self.service_account_email_address = v.into();
11117 self
11118 }
11119
11120 /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11121 ///
11122 /// # Example
11123 /// ```ignore,no_run
11124 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11125 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11126 /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
11127 /// ```
11128 pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
11129 where
11130 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11131 {
11132 self.on_premises_configuration = std::option::Option::Some(v.into());
11133 self
11134 }
11135
11136 /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11137 ///
11138 /// # Example
11139 /// ```ignore,no_run
11140 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11141 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11142 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
11143 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
11144 /// ```
11145 pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11146 where
11147 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11148 {
11149 self.on_premises_configuration = v.map(|x| x.into());
11150 self
11151 }
11152
11153 /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11154 ///
11155 /// # Example
11156 /// ```ignore,no_run
11157 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11158 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11159 /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
11160 /// ```
11161 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
11162 where
11163 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11164 {
11165 self.replica_configuration = std::option::Option::Some(v.into());
11166 self
11167 }
11168
11169 /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11170 ///
11171 /// # Example
11172 /// ```ignore,no_run
11173 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11174 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11175 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
11176 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
11177 /// ```
11178 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11179 where
11180 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11181 {
11182 self.replica_configuration = v.map(|x| x.into());
11183 self
11184 }
11185
11186 /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
11187 ///
11188 /// # Example
11189 /// ```ignore,no_run
11190 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11191 /// use google_cloud_sql_v1::model::SqlBackendType;
11192 /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
11193 /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
11194 /// ```
11195 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
11196 mut self,
11197 v: T,
11198 ) -> Self {
11199 self.backend_type = v.into();
11200 self
11201 }
11202
11203 /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
11204 ///
11205 /// # Example
11206 /// ```ignore,no_run
11207 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11208 /// let x = DatabaseInstance::new().set_self_link("example");
11209 /// ```
11210 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11211 self.self_link = v.into();
11212 self
11213 }
11214
11215 /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
11216 ///
11217 /// # Example
11218 /// ```ignore,no_run
11219 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11220 /// use google_cloud_sql_v1::model::SqlSuspensionReason;
11221 /// let x = DatabaseInstance::new().set_suspension_reason([
11222 /// SqlSuspensionReason::BillingIssue,
11223 /// SqlSuspensionReason::LegalIssue,
11224 /// SqlSuspensionReason::OperationalIssue,
11225 /// ]);
11226 /// ```
11227 pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
11228 where
11229 T: std::iter::IntoIterator<Item = V>,
11230 V: std::convert::Into<crate::model::SqlSuspensionReason>,
11231 {
11232 use std::iter::Iterator;
11233 self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
11234 self
11235 }
11236
11237 /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
11238 ///
11239 /// # Example
11240 /// ```ignore,no_run
11241 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11242 /// let x = DatabaseInstance::new().set_connection_name("example");
11243 /// ```
11244 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11245 self.connection_name = v.into();
11246 self
11247 }
11248
11249 /// Sets the value of [name][crate::model::DatabaseInstance::name].
11250 ///
11251 /// # Example
11252 /// ```ignore,no_run
11253 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11254 /// let x = DatabaseInstance::new().set_name("example");
11255 /// ```
11256 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11257 self.name = v.into();
11258 self
11259 }
11260
11261 /// Sets the value of [region][crate::model::DatabaseInstance::region].
11262 ///
11263 /// # Example
11264 /// ```ignore,no_run
11265 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11266 /// let x = DatabaseInstance::new().set_region("example");
11267 /// ```
11268 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11269 self.region = v.into();
11270 self
11271 }
11272
11273 /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
11274 ///
11275 /// # Example
11276 /// ```ignore,no_run
11277 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11278 /// let x = DatabaseInstance::new().set_gce_zone("example");
11279 /// ```
11280 pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11281 self.gce_zone = v.into();
11282 self
11283 }
11284
11285 /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
11286 ///
11287 /// # Example
11288 /// ```ignore,no_run
11289 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11290 /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
11291 /// ```
11292 pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
11293 mut self,
11294 v: T,
11295 ) -> Self {
11296 self.secondary_gce_zone = v.into();
11297 self
11298 }
11299
11300 /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11301 ///
11302 /// # Example
11303 /// ```ignore,no_run
11304 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11305 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11306 /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
11307 /// ```
11308 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
11309 where
11310 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11311 {
11312 self.disk_encryption_configuration = std::option::Option::Some(v.into());
11313 self
11314 }
11315
11316 /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11317 ///
11318 /// # Example
11319 /// ```ignore,no_run
11320 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11321 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11322 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
11323 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
11324 /// ```
11325 pub fn set_or_clear_disk_encryption_configuration<T>(
11326 mut self,
11327 v: std::option::Option<T>,
11328 ) -> Self
11329 where
11330 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11331 {
11332 self.disk_encryption_configuration = v.map(|x| x.into());
11333 self
11334 }
11335
11336 /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11337 ///
11338 /// # Example
11339 /// ```ignore,no_run
11340 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11341 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11342 /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
11343 /// ```
11344 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
11345 where
11346 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11347 {
11348 self.disk_encryption_status = std::option::Option::Some(v.into());
11349 self
11350 }
11351
11352 /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11353 ///
11354 /// # Example
11355 /// ```ignore,no_run
11356 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11357 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11358 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
11359 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
11360 /// ```
11361 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
11362 where
11363 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11364 {
11365 self.disk_encryption_status = v.map(|x| x.into());
11366 self
11367 }
11368
11369 /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
11370 ///
11371 /// # Example
11372 /// ```ignore,no_run
11373 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11374 /// let x = DatabaseInstance::new().set_root_password("example");
11375 /// ```
11376 pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11377 self.root_password = v.into();
11378 self
11379 }
11380
11381 /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11382 ///
11383 /// # Example
11384 /// ```ignore,no_run
11385 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11386 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11387 /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
11388 /// ```
11389 pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
11390 where
11391 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11392 {
11393 self.scheduled_maintenance = std::option::Option::Some(v.into());
11394 self
11395 }
11396
11397 /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11398 ///
11399 /// # Example
11400 /// ```ignore,no_run
11401 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11402 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11403 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
11404 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
11405 /// ```
11406 pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
11407 where
11408 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11409 {
11410 self.scheduled_maintenance = v.map(|x| x.into());
11411 self
11412 }
11413
11414 /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11415 ///
11416 /// # Example
11417 /// ```ignore,no_run
11418 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11419 /// use wkt::BoolValue;
11420 /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
11421 /// ```
11422 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11423 where
11424 T: std::convert::Into<wkt::BoolValue>,
11425 {
11426 self.satisfies_pzs = std::option::Option::Some(v.into());
11427 self
11428 }
11429
11430 /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11431 ///
11432 /// # Example
11433 /// ```ignore,no_run
11434 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11435 /// use wkt::BoolValue;
11436 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
11437 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
11438 /// ```
11439 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11440 where
11441 T: std::convert::Into<wkt::BoolValue>,
11442 {
11443 self.satisfies_pzs = v.map(|x| x.into());
11444 self
11445 }
11446
11447 /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
11448 ///
11449 /// # Example
11450 /// ```ignore,no_run
11451 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11452 /// let x = DatabaseInstance::new().set_database_installed_version("example");
11453 /// ```
11454 pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
11455 mut self,
11456 v: T,
11457 ) -> Self {
11458 self.database_installed_version = v.into();
11459 self
11460 }
11461
11462 /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11463 ///
11464 /// # Example
11465 /// ```ignore,no_run
11466 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11467 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11468 /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
11469 /// ```
11470 pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
11471 where
11472 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11473 {
11474 self.out_of_disk_report = std::option::Option::Some(v.into());
11475 self
11476 }
11477
11478 /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11479 ///
11480 /// # Example
11481 /// ```ignore,no_run
11482 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11483 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11484 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
11485 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
11486 /// ```
11487 pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
11488 where
11489 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11490 {
11491 self.out_of_disk_report = v.map(|x| x.into());
11492 self
11493 }
11494
11495 /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
11496 ///
11497 /// # Example
11498 /// ```ignore,no_run
11499 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11500 /// use wkt::Timestamp;
11501 /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
11502 /// ```
11503 pub fn set_create_time<T>(mut self, v: T) -> Self
11504 where
11505 T: std::convert::Into<wkt::Timestamp>,
11506 {
11507 self.create_time = std::option::Option::Some(v.into());
11508 self
11509 }
11510
11511 /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
11512 ///
11513 /// # Example
11514 /// ```ignore,no_run
11515 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11516 /// use wkt::Timestamp;
11517 /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11518 /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
11519 /// ```
11520 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11521 where
11522 T: std::convert::Into<wkt::Timestamp>,
11523 {
11524 self.create_time = v.map(|x| x.into());
11525 self
11526 }
11527
11528 /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
11529 ///
11530 /// # Example
11531 /// ```ignore,no_run
11532 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11533 /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
11534 /// ```
11535 pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
11536 where
11537 T: std::iter::IntoIterator<Item = V>,
11538 V: std::convert::Into<std::string::String>,
11539 {
11540 use std::iter::Iterator;
11541 self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
11542 self
11543 }
11544
11545 /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
11546 ///
11547 /// # Example
11548 /// ```ignore,no_run
11549 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11550 /// let x = DatabaseInstance::new().set_maintenance_version("example");
11551 /// ```
11552 pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
11553 mut self,
11554 v: T,
11555 ) -> Self {
11556 self.maintenance_version = v.into();
11557 self
11558 }
11559
11560 /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
11561 ///
11562 /// # Example
11563 /// ```ignore,no_run
11564 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11565 /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
11566 /// let x = DatabaseInstance::new()
11567 /// .set_upgradable_database_versions([
11568 /// AvailableDatabaseVersion::default()/* use setters */,
11569 /// AvailableDatabaseVersion::default()/* use (different) setters */,
11570 /// ]);
11571 /// ```
11572 pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
11573 where
11574 T: std::iter::IntoIterator<Item = V>,
11575 V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
11576 {
11577 use std::iter::Iterator;
11578 self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
11579 self
11580 }
11581
11582 /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11583 ///
11584 /// # Example
11585 /// ```ignore,no_run
11586 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11587 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11588 /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
11589 /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
11590 /// ```
11591 pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
11592 where
11593 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11594 {
11595 self.sql_network_architecture = std::option::Option::Some(v.into());
11596 self
11597 }
11598
11599 /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11600 ///
11601 /// # Example
11602 /// ```ignore,no_run
11603 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11604 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11605 /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
11606 /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
11607 /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
11608 /// ```
11609 pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
11610 where
11611 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11612 {
11613 self.sql_network_architecture = v.map(|x| x.into());
11614 self
11615 }
11616
11617 /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11618 ///
11619 /// # Example
11620 /// ```ignore,no_run
11621 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11622 /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
11623 /// ```
11624 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
11625 where
11626 T: std::convert::Into<std::string::String>,
11627 {
11628 self.psc_service_attachment_link = std::option::Option::Some(v.into());
11629 self
11630 }
11631
11632 /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11633 ///
11634 /// # Example
11635 /// ```ignore,no_run
11636 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11637 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
11638 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
11639 /// ```
11640 pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
11641 where
11642 T: std::convert::Into<std::string::String>,
11643 {
11644 self.psc_service_attachment_link = v.map(|x| x.into());
11645 self
11646 }
11647
11648 /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11649 ///
11650 /// # Example
11651 /// ```ignore,no_run
11652 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11653 /// let x = DatabaseInstance::new().set_dns_name("example");
11654 /// ```
11655 pub fn set_dns_name<T>(mut self, v: T) -> Self
11656 where
11657 T: std::convert::Into<std::string::String>,
11658 {
11659 self.dns_name = std::option::Option::Some(v.into());
11660 self
11661 }
11662
11663 /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11664 ///
11665 /// # Example
11666 /// ```ignore,no_run
11667 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11668 /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
11669 /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
11670 /// ```
11671 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11672 where
11673 T: std::convert::Into<std::string::String>,
11674 {
11675 self.dns_name = v.map(|x| x.into());
11676 self
11677 }
11678
11679 /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11680 ///
11681 /// # Example
11682 /// ```ignore,no_run
11683 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11684 /// let x = DatabaseInstance::new().set_primary_dns_name("example");
11685 /// ```
11686 #[deprecated]
11687 pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
11688 where
11689 T: std::convert::Into<std::string::String>,
11690 {
11691 self.primary_dns_name = std::option::Option::Some(v.into());
11692 self
11693 }
11694
11695 /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11696 ///
11697 /// # Example
11698 /// ```ignore,no_run
11699 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11700 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
11701 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
11702 /// ```
11703 #[deprecated]
11704 pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11705 where
11706 T: std::convert::Into<std::string::String>,
11707 {
11708 self.primary_dns_name = v.map(|x| x.into());
11709 self
11710 }
11711
11712 /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11713 ///
11714 /// # Example
11715 /// ```ignore,no_run
11716 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11717 /// let x = DatabaseInstance::new().set_write_endpoint("example");
11718 /// ```
11719 pub fn set_write_endpoint<T>(mut self, v: T) -> Self
11720 where
11721 T: std::convert::Into<std::string::String>,
11722 {
11723 self.write_endpoint = std::option::Option::Some(v.into());
11724 self
11725 }
11726
11727 /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11728 ///
11729 /// # Example
11730 /// ```ignore,no_run
11731 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11732 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
11733 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
11734 /// ```
11735 pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
11736 where
11737 T: std::convert::Into<std::string::String>,
11738 {
11739 self.write_endpoint = v.map(|x| x.into());
11740 self
11741 }
11742
11743 /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11744 ///
11745 /// # Example
11746 /// ```ignore,no_run
11747 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11748 /// use google_cloud_sql_v1::model::ReplicationCluster;
11749 /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
11750 /// ```
11751 pub fn set_replication_cluster<T>(mut self, v: T) -> Self
11752 where
11753 T: std::convert::Into<crate::model::ReplicationCluster>,
11754 {
11755 self.replication_cluster = std::option::Option::Some(v.into());
11756 self
11757 }
11758
11759 /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11760 ///
11761 /// # Example
11762 /// ```ignore,no_run
11763 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11764 /// use google_cloud_sql_v1::model::ReplicationCluster;
11765 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
11766 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
11767 /// ```
11768 pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
11769 where
11770 T: std::convert::Into<crate::model::ReplicationCluster>,
11771 {
11772 self.replication_cluster = v.map(|x| x.into());
11773 self
11774 }
11775
11776 /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11777 ///
11778 /// # Example
11779 /// ```ignore,no_run
11780 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11781 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11782 /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
11783 /// ```
11784 pub fn set_gemini_config<T>(mut self, v: T) -> Self
11785 where
11786 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11787 {
11788 self.gemini_config = std::option::Option::Some(v.into());
11789 self
11790 }
11791
11792 /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11793 ///
11794 /// # Example
11795 /// ```ignore,no_run
11796 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11797 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11798 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
11799 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
11800 /// ```
11801 pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
11802 where
11803 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11804 {
11805 self.gemini_config = v.map(|x| x.into());
11806 self
11807 }
11808
11809 /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11810 ///
11811 /// # Example
11812 /// ```ignore,no_run
11813 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11814 /// use wkt::BoolValue;
11815 /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
11816 /// ```
11817 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
11818 where
11819 T: std::convert::Into<wkt::BoolValue>,
11820 {
11821 self.satisfies_pzi = std::option::Option::Some(v.into());
11822 self
11823 }
11824
11825 /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11826 ///
11827 /// # Example
11828 /// ```ignore,no_run
11829 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11830 /// use wkt::BoolValue;
11831 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
11832 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
11833 /// ```
11834 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
11835 where
11836 T: std::convert::Into<wkt::BoolValue>,
11837 {
11838 self.satisfies_pzi = v.map(|x| x.into());
11839 self
11840 }
11841
11842 /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11843 ///
11844 /// # Example
11845 /// ```ignore,no_run
11846 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11847 /// use wkt::BoolValue;
11848 /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
11849 /// ```
11850 pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
11851 where
11852 T: std::convert::Into<wkt::BoolValue>,
11853 {
11854 self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
11855 self
11856 }
11857
11858 /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11859 ///
11860 /// # Example
11861 /// ```ignore,no_run
11862 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11863 /// use wkt::BoolValue;
11864 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
11865 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
11866 /// ```
11867 pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
11868 mut self,
11869 v: std::option::Option<T>,
11870 ) -> Self
11871 where
11872 T: std::convert::Into<wkt::BoolValue>,
11873 {
11874 self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
11875 self
11876 }
11877
11878 /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
11879 ///
11880 /// # Example
11881 /// ```ignore,no_run
11882 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11883 /// use wkt::BoolValue;
11884 /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
11885 /// ```
11886 pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
11887 where
11888 T: std::convert::Into<wkt::BoolValue>,
11889 {
11890 self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
11891 self
11892 }
11893
11894 /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
11895 ///
11896 /// # Example
11897 /// ```ignore,no_run
11898 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11899 /// use wkt::BoolValue;
11900 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
11901 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
11902 /// ```
11903 pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
11904 mut self,
11905 v: std::option::Option<T>,
11906 ) -> Self
11907 where
11908 T: std::convert::Into<wkt::BoolValue>,
11909 {
11910 self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
11911 self
11912 }
11913
11914 /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
11915 ///
11916 /// # Example
11917 /// ```ignore,no_run
11918 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11919 /// let x = DatabaseInstance::new().set_tags([
11920 /// ("key0", "abc"),
11921 /// ("key1", "xyz"),
11922 /// ]);
11923 /// ```
11924 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
11925 where
11926 T: std::iter::IntoIterator<Item = (K, V)>,
11927 K: std::convert::Into<std::string::String>,
11928 V: std::convert::Into<std::string::String>,
11929 {
11930 use std::iter::Iterator;
11931 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11932 self
11933 }
11934
11935 /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
11936 ///
11937 /// # Example
11938 /// ```ignore,no_run
11939 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11940 /// let x = DatabaseInstance::new().set_node_count(42);
11941 /// ```
11942 pub fn set_node_count<T>(mut self, v: T) -> Self
11943 where
11944 T: std::convert::Into<i32>,
11945 {
11946 self.node_count = std::option::Option::Some(v.into());
11947 self
11948 }
11949
11950 /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
11951 ///
11952 /// # Example
11953 /// ```ignore,no_run
11954 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11955 /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
11956 /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
11957 /// ```
11958 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
11959 where
11960 T: std::convert::Into<i32>,
11961 {
11962 self.node_count = v.map(|x| x.into());
11963 self
11964 }
11965
11966 /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
11967 ///
11968 /// # Example
11969 /// ```ignore,no_run
11970 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11971 /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
11972 /// let x = DatabaseInstance::new()
11973 /// .set_nodes([
11974 /// PoolNodeConfig::default()/* use setters */,
11975 /// PoolNodeConfig::default()/* use (different) setters */,
11976 /// ]);
11977 /// ```
11978 pub fn set_nodes<T, V>(mut self, v: T) -> Self
11979 where
11980 T: std::iter::IntoIterator<Item = V>,
11981 V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
11982 {
11983 use std::iter::Iterator;
11984 self.nodes = v.into_iter().map(|i| i.into()).collect();
11985 self
11986 }
11987
11988 /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
11989 ///
11990 /// # Example
11991 /// ```ignore,no_run
11992 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11993 /// use google_cloud_sql_v1::model::DnsNameMapping;
11994 /// let x = DatabaseInstance::new()
11995 /// .set_dns_names([
11996 /// DnsNameMapping::default()/* use setters */,
11997 /// DnsNameMapping::default()/* use (different) setters */,
11998 /// ]);
11999 /// ```
12000 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12001 where
12002 T: std::iter::IntoIterator<Item = V>,
12003 V: std::convert::Into<crate::model::DnsNameMapping>,
12004 {
12005 use std::iter::Iterator;
12006 self.dns_names = v.into_iter().map(|i| i.into()).collect();
12007 self
12008 }
12009}
12010
12011impl wkt::message::Message for DatabaseInstance {
12012 fn typename() -> &'static str {
12013 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
12014 }
12015}
12016
12017/// Defines additional types related to [DatabaseInstance].
12018pub mod database_instance {
12019 #[allow(unused_imports)]
12020 use super::*;
12021
12022 #[derive(Clone, Default, PartialEq)]
12023 #[non_exhaustive]
12024 pub struct SqlFailoverReplica {
12025 /// The name of the failover replica. If specified at instance creation, a
12026 /// failover replica is created for the instance. The name
12027 /// doesn't include the project ID.
12028 pub name: std::string::String,
12029
12030 /// The availability status of the failover replica. A false status indicates
12031 /// that the failover replica is out of sync. The primary instance can only
12032 /// failover to the failover replica when the status is true.
12033 pub available: std::option::Option<wkt::BoolValue>,
12034
12035 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12036 }
12037
12038 impl SqlFailoverReplica {
12039 pub fn new() -> Self {
12040 std::default::Default::default()
12041 }
12042
12043 /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
12044 ///
12045 /// # Example
12046 /// ```ignore,no_run
12047 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12048 /// let x = SqlFailoverReplica::new().set_name("example");
12049 /// ```
12050 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12051 self.name = v.into();
12052 self
12053 }
12054
12055 /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12056 ///
12057 /// # Example
12058 /// ```ignore,no_run
12059 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12060 /// use wkt::BoolValue;
12061 /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
12062 /// ```
12063 pub fn set_available<T>(mut self, v: T) -> Self
12064 where
12065 T: std::convert::Into<wkt::BoolValue>,
12066 {
12067 self.available = std::option::Option::Some(v.into());
12068 self
12069 }
12070
12071 /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12072 ///
12073 /// # Example
12074 /// ```ignore,no_run
12075 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12076 /// use wkt::BoolValue;
12077 /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
12078 /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
12079 /// ```
12080 pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
12081 where
12082 T: std::convert::Into<wkt::BoolValue>,
12083 {
12084 self.available = v.map(|x| x.into());
12085 self
12086 }
12087 }
12088
12089 impl wkt::message::Message for SqlFailoverReplica {
12090 fn typename() -> &'static str {
12091 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
12092 }
12093 }
12094
12095 /// Any scheduled maintenance for this instance.
12096 #[derive(Clone, Default, PartialEq)]
12097 #[non_exhaustive]
12098 pub struct SqlScheduledMaintenance {
12099 /// The start time of any upcoming scheduled maintenance for this instance.
12100 pub start_time: std::option::Option<wkt::Timestamp>,
12101
12102 #[deprecated]
12103 pub can_defer: bool,
12104
12105 /// If the scheduled maintenance can be rescheduled.
12106 pub can_reschedule: bool,
12107
12108 /// Maintenance cannot be rescheduled to start beyond this deadline.
12109 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
12110
12111 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12112 }
12113
12114 impl SqlScheduledMaintenance {
12115 pub fn new() -> Self {
12116 std::default::Default::default()
12117 }
12118
12119 /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12120 ///
12121 /// # Example
12122 /// ```ignore,no_run
12123 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12124 /// use wkt::Timestamp;
12125 /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
12126 /// ```
12127 pub fn set_start_time<T>(mut self, v: T) -> Self
12128 where
12129 T: std::convert::Into<wkt::Timestamp>,
12130 {
12131 self.start_time = std::option::Option::Some(v.into());
12132 self
12133 }
12134
12135 /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12136 ///
12137 /// # Example
12138 /// ```ignore,no_run
12139 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12140 /// use wkt::Timestamp;
12141 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12142 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
12143 /// ```
12144 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12145 where
12146 T: std::convert::Into<wkt::Timestamp>,
12147 {
12148 self.start_time = v.map(|x| x.into());
12149 self
12150 }
12151
12152 /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
12153 ///
12154 /// # Example
12155 /// ```ignore,no_run
12156 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12157 /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
12158 /// ```
12159 #[deprecated]
12160 pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12161 self.can_defer = v.into();
12162 self
12163 }
12164
12165 /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
12166 ///
12167 /// # Example
12168 /// ```ignore,no_run
12169 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12170 /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
12171 /// ```
12172 pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12173 self.can_reschedule = v.into();
12174 self
12175 }
12176
12177 /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12178 ///
12179 /// # Example
12180 /// ```ignore,no_run
12181 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12182 /// use wkt::Timestamp;
12183 /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
12184 /// ```
12185 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
12186 where
12187 T: std::convert::Into<wkt::Timestamp>,
12188 {
12189 self.schedule_deadline_time = std::option::Option::Some(v.into());
12190 self
12191 }
12192
12193 /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12194 ///
12195 /// # Example
12196 /// ```ignore,no_run
12197 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12198 /// use wkt::Timestamp;
12199 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
12200 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
12201 /// ```
12202 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
12203 where
12204 T: std::convert::Into<wkt::Timestamp>,
12205 {
12206 self.schedule_deadline_time = v.map(|x| x.into());
12207 self
12208 }
12209 }
12210
12211 impl wkt::message::Message for SqlScheduledMaintenance {
12212 fn typename() -> &'static str {
12213 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
12214 }
12215 }
12216
12217 /// This message wraps up the information written by out-of-disk detection job.
12218 #[derive(Clone, Default, PartialEq)]
12219 #[non_exhaustive]
12220 pub struct SqlOutOfDiskReport {
12221 /// This field represents the state generated by the proactive database
12222 /// wellness job for OutOfDisk issues.
12223 ///
12224 /// * Writers:
12225 /// * the proactive database wellness job for OOD.
12226 /// * Readers:
12227 /// * the proactive database wellness job
12228 pub sql_out_of_disk_state: std::option::Option<
12229 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12230 >,
12231
12232 /// The minimum recommended increase size in GigaBytes
12233 /// This field is consumed by the frontend
12234 ///
12235 /// * Writers:
12236 /// * the proactive database wellness job for OOD.
12237 /// * Readers:
12238 pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
12239
12240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12241 }
12242
12243 impl SqlOutOfDiskReport {
12244 pub fn new() -> Self {
12245 std::default::Default::default()
12246 }
12247
12248 /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12249 ///
12250 /// # Example
12251 /// ```ignore,no_run
12252 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12253 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12254 /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
12255 /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
12256 /// ```
12257 pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
12258 where
12259 T: std::convert::Into<
12260 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12261 >,
12262 {
12263 self.sql_out_of_disk_state = std::option::Option::Some(v.into());
12264 self
12265 }
12266
12267 /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12268 ///
12269 /// # Example
12270 /// ```ignore,no_run
12271 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12272 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12273 /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
12274 /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
12275 /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
12276 /// ```
12277 pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
12278 where
12279 T: std::convert::Into<
12280 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12281 >,
12282 {
12283 self.sql_out_of_disk_state = v.map(|x| x.into());
12284 self
12285 }
12286
12287 /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12288 ///
12289 /// # Example
12290 /// ```ignore,no_run
12291 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12292 /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
12293 /// ```
12294 pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
12295 where
12296 T: std::convert::Into<i32>,
12297 {
12298 self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
12299 self
12300 }
12301
12302 /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12303 ///
12304 /// # Example
12305 /// ```ignore,no_run
12306 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12307 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
12308 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
12309 /// ```
12310 pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
12311 mut self,
12312 v: std::option::Option<T>,
12313 ) -> Self
12314 where
12315 T: std::convert::Into<i32>,
12316 {
12317 self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
12318 self
12319 }
12320 }
12321
12322 impl wkt::message::Message for SqlOutOfDiskReport {
12323 fn typename() -> &'static str {
12324 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
12325 }
12326 }
12327
12328 /// Defines additional types related to [SqlOutOfDiskReport].
12329 pub mod sql_out_of_disk_report {
12330 #[allow(unused_imports)]
12331 use super::*;
12332
12333 /// This enum lists all possible states regarding out-of-disk issues.
12334 ///
12335 /// # Working with unknown values
12336 ///
12337 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12338 /// additional enum variants at any time. Adding new variants is not considered
12339 /// a breaking change. Applications should write their code in anticipation of:
12340 ///
12341 /// - New values appearing in future releases of the client library, **and**
12342 /// - New values received dynamically, without application changes.
12343 ///
12344 /// Please consult the [Working with enums] section in the user guide for some
12345 /// guidelines.
12346 ///
12347 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12348 #[derive(Clone, Debug, PartialEq)]
12349 #[non_exhaustive]
12350 pub enum SqlOutOfDiskState {
12351 /// Unspecified state
12352 Unspecified,
12353 /// The instance has plenty space on data disk
12354 Normal,
12355 /// Data disk is almost used up. It is shutdown to prevent data
12356 /// corruption.
12357 SoftShutdown,
12358 /// If set, the enum was initialized with an unknown value.
12359 ///
12360 /// Applications can examine the value using [SqlOutOfDiskState::value] or
12361 /// [SqlOutOfDiskState::name].
12362 UnknownValue(sql_out_of_disk_state::UnknownValue),
12363 }
12364
12365 #[doc(hidden)]
12366 pub mod sql_out_of_disk_state {
12367 #[allow(unused_imports)]
12368 use super::*;
12369 #[derive(Clone, Debug, PartialEq)]
12370 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12371 }
12372
12373 impl SqlOutOfDiskState {
12374 /// Gets the enum value.
12375 ///
12376 /// Returns `None` if the enum contains an unknown value deserialized from
12377 /// the string representation of enums.
12378 pub fn value(&self) -> std::option::Option<i32> {
12379 match self {
12380 Self::Unspecified => std::option::Option::Some(0),
12381 Self::Normal => std::option::Option::Some(1),
12382 Self::SoftShutdown => std::option::Option::Some(2),
12383 Self::UnknownValue(u) => u.0.value(),
12384 }
12385 }
12386
12387 /// Gets the enum value as a string.
12388 ///
12389 /// Returns `None` if the enum contains an unknown value deserialized from
12390 /// the integer representation of enums.
12391 pub fn name(&self) -> std::option::Option<&str> {
12392 match self {
12393 Self::Unspecified => {
12394 std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
12395 }
12396 Self::Normal => std::option::Option::Some("NORMAL"),
12397 Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
12398 Self::UnknownValue(u) => u.0.name(),
12399 }
12400 }
12401 }
12402
12403 impl std::default::Default for SqlOutOfDiskState {
12404 fn default() -> Self {
12405 use std::convert::From;
12406 Self::from(0)
12407 }
12408 }
12409
12410 impl std::fmt::Display for SqlOutOfDiskState {
12411 fn fmt(
12412 &self,
12413 f: &mut std::fmt::Formatter<'_>,
12414 ) -> std::result::Result<(), std::fmt::Error> {
12415 wkt::internal::display_enum(f, self.name(), self.value())
12416 }
12417 }
12418
12419 impl std::convert::From<i32> for SqlOutOfDiskState {
12420 fn from(value: i32) -> Self {
12421 match value {
12422 0 => Self::Unspecified,
12423 1 => Self::Normal,
12424 2 => Self::SoftShutdown,
12425 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12426 wkt::internal::UnknownEnumValue::Integer(value),
12427 )),
12428 }
12429 }
12430 }
12431
12432 impl std::convert::From<&str> for SqlOutOfDiskState {
12433 fn from(value: &str) -> Self {
12434 use std::string::ToString;
12435 match value {
12436 "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
12437 "NORMAL" => Self::Normal,
12438 "SOFT_SHUTDOWN" => Self::SoftShutdown,
12439 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12440 wkt::internal::UnknownEnumValue::String(value.to_string()),
12441 )),
12442 }
12443 }
12444 }
12445
12446 impl serde::ser::Serialize for SqlOutOfDiskState {
12447 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12448 where
12449 S: serde::Serializer,
12450 {
12451 match self {
12452 Self::Unspecified => serializer.serialize_i32(0),
12453 Self::Normal => serializer.serialize_i32(1),
12454 Self::SoftShutdown => serializer.serialize_i32(2),
12455 Self::UnknownValue(u) => u.0.serialize(serializer),
12456 }
12457 }
12458 }
12459
12460 impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
12461 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12462 where
12463 D: serde::Deserializer<'de>,
12464 {
12465 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
12466 ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
12467 ))
12468 }
12469 }
12470 }
12471
12472 /// Details of a single read pool node of a read pool.
12473 #[derive(Clone, Default, PartialEq)]
12474 #[non_exhaustive]
12475 pub struct PoolNodeConfig {
12476 /// Output only. The name of the read pool node, to be used for retrieving
12477 /// metrics and logs.
12478 pub name: std::option::Option<std::string::String>,
12479
12480 /// Output only. The zone of the read pool node.
12481 pub gce_zone: std::option::Option<std::string::String>,
12482
12483 /// Output only. Mappings containing IP addresses that can be used to connect
12484 /// to the read pool node.
12485 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
12486
12487 /// Output only. The DNS name of the read pool node.
12488 pub dns_name: std::option::Option<std::string::String>,
12489
12490 /// Output only. The current state of the read pool node.
12491 pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
12492
12493 /// Output only. The list of DNS names used by this read pool node.
12494 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
12495
12496 /// Output only. The Private Service Connect (PSC) service attachment of the
12497 /// read pool node.
12498 pub psc_service_attachment_link: std::option::Option<std::string::String>,
12499
12500 /// Output only. The list of settings for requested automatically-setup
12501 /// Private Service Connect (PSC) consumer endpoints that can be used to
12502 /// connect to this read pool node.
12503 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
12504
12505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12506 }
12507
12508 impl PoolNodeConfig {
12509 pub fn new() -> Self {
12510 std::default::Default::default()
12511 }
12512
12513 /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12514 ///
12515 /// # Example
12516 /// ```ignore,no_run
12517 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12518 /// let x = PoolNodeConfig::new().set_name("example");
12519 /// ```
12520 pub fn set_name<T>(mut self, v: T) -> Self
12521 where
12522 T: std::convert::Into<std::string::String>,
12523 {
12524 self.name = std::option::Option::Some(v.into());
12525 self
12526 }
12527
12528 /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12529 ///
12530 /// # Example
12531 /// ```ignore,no_run
12532 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12533 /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
12534 /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
12535 /// ```
12536 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
12537 where
12538 T: std::convert::Into<std::string::String>,
12539 {
12540 self.name = v.map(|x| x.into());
12541 self
12542 }
12543
12544 /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12545 ///
12546 /// # Example
12547 /// ```ignore,no_run
12548 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12549 /// let x = PoolNodeConfig::new().set_gce_zone("example");
12550 /// ```
12551 pub fn set_gce_zone<T>(mut self, v: T) -> Self
12552 where
12553 T: std::convert::Into<std::string::String>,
12554 {
12555 self.gce_zone = std::option::Option::Some(v.into());
12556 self
12557 }
12558
12559 /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12560 ///
12561 /// # Example
12562 /// ```ignore,no_run
12563 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12564 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
12565 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
12566 /// ```
12567 pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
12568 where
12569 T: std::convert::Into<std::string::String>,
12570 {
12571 self.gce_zone = v.map(|x| x.into());
12572 self
12573 }
12574
12575 /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
12576 ///
12577 /// # Example
12578 /// ```ignore,no_run
12579 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12580 /// use google_cloud_sql_v1::model::IpMapping;
12581 /// let x = PoolNodeConfig::new()
12582 /// .set_ip_addresses([
12583 /// IpMapping::default()/* use setters */,
12584 /// IpMapping::default()/* use (different) setters */,
12585 /// ]);
12586 /// ```
12587 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12588 where
12589 T: std::iter::IntoIterator<Item = V>,
12590 V: std::convert::Into<crate::model::IpMapping>,
12591 {
12592 use std::iter::Iterator;
12593 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
12594 self
12595 }
12596
12597 /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12598 ///
12599 /// # Example
12600 /// ```ignore,no_run
12601 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12602 /// let x = PoolNodeConfig::new().set_dns_name("example");
12603 /// ```
12604 pub fn set_dns_name<T>(mut self, v: T) -> Self
12605 where
12606 T: std::convert::Into<std::string::String>,
12607 {
12608 self.dns_name = std::option::Option::Some(v.into());
12609 self
12610 }
12611
12612 /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12613 ///
12614 /// # Example
12615 /// ```ignore,no_run
12616 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12617 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
12618 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
12619 /// ```
12620 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12621 where
12622 T: std::convert::Into<std::string::String>,
12623 {
12624 self.dns_name = v.map(|x| x.into());
12625 self
12626 }
12627
12628 /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12629 ///
12630 /// # Example
12631 /// ```ignore,no_run
12632 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12633 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12634 /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
12635 /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
12636 /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
12637 /// ```
12638 pub fn set_state<T>(mut self, v: T) -> Self
12639 where
12640 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12641 {
12642 self.state = std::option::Option::Some(v.into());
12643 self
12644 }
12645
12646 /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12647 ///
12648 /// # Example
12649 /// ```ignore,no_run
12650 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12651 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12652 /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
12653 /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
12654 /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
12655 /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
12656 /// ```
12657 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
12658 where
12659 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12660 {
12661 self.state = v.map(|x| x.into());
12662 self
12663 }
12664
12665 /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
12666 ///
12667 /// # Example
12668 /// ```ignore,no_run
12669 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12670 /// use google_cloud_sql_v1::model::DnsNameMapping;
12671 /// let x = PoolNodeConfig::new()
12672 /// .set_dns_names([
12673 /// DnsNameMapping::default()/* use setters */,
12674 /// DnsNameMapping::default()/* use (different) setters */,
12675 /// ]);
12676 /// ```
12677 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12678 where
12679 T: std::iter::IntoIterator<Item = V>,
12680 V: std::convert::Into<crate::model::DnsNameMapping>,
12681 {
12682 use std::iter::Iterator;
12683 self.dns_names = v.into_iter().map(|i| i.into()).collect();
12684 self
12685 }
12686
12687 /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12688 ///
12689 /// # Example
12690 /// ```ignore,no_run
12691 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12692 /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
12693 /// ```
12694 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
12695 where
12696 T: std::convert::Into<std::string::String>,
12697 {
12698 self.psc_service_attachment_link = std::option::Option::Some(v.into());
12699 self
12700 }
12701
12702 /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12703 ///
12704 /// # Example
12705 /// ```ignore,no_run
12706 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12707 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
12708 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
12709 /// ```
12710 pub fn set_or_clear_psc_service_attachment_link<T>(
12711 mut self,
12712 v: std::option::Option<T>,
12713 ) -> Self
12714 where
12715 T: std::convert::Into<std::string::String>,
12716 {
12717 self.psc_service_attachment_link = v.map(|x| x.into());
12718 self
12719 }
12720
12721 /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
12722 ///
12723 /// # Example
12724 /// ```ignore,no_run
12725 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12726 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
12727 /// let x = PoolNodeConfig::new()
12728 /// .set_psc_auto_connections([
12729 /// PscAutoConnectionConfig::default()/* use setters */,
12730 /// PscAutoConnectionConfig::default()/* use (different) setters */,
12731 /// ]);
12732 /// ```
12733 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
12734 where
12735 T: std::iter::IntoIterator<Item = V>,
12736 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
12737 {
12738 use std::iter::Iterator;
12739 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
12740 self
12741 }
12742 }
12743
12744 impl wkt::message::Message for PoolNodeConfig {
12745 fn typename() -> &'static str {
12746 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
12747 }
12748 }
12749
12750 /// The current serving state of the database instance.
12751 ///
12752 /// # Working with unknown values
12753 ///
12754 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12755 /// additional enum variants at any time. Adding new variants is not considered
12756 /// a breaking change. Applications should write their code in anticipation of:
12757 ///
12758 /// - New values appearing in future releases of the client library, **and**
12759 /// - New values received dynamically, without application changes.
12760 ///
12761 /// Please consult the [Working with enums] section in the user guide for some
12762 /// guidelines.
12763 ///
12764 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12765 #[derive(Clone, Debug, PartialEq)]
12766 #[non_exhaustive]
12767 pub enum SqlInstanceState {
12768 /// The state of the instance is unknown.
12769 Unspecified,
12770 /// The instance is running, or has been stopped by owner.
12771 Runnable,
12772 /// The instance is not available, for example due to problems with billing.
12773 Suspended,
12774 /// The instance is being deleted.
12775 PendingDelete,
12776 /// The instance is being created.
12777 PendingCreate,
12778 /// The instance is down for maintenance.
12779 Maintenance,
12780 /// The creation of the instance failed or a fatal error occurred during
12781 /// maintenance.
12782 Failed,
12783 /// Deprecated
12784 #[deprecated]
12785 OnlineMaintenance,
12786 /// (Applicable to read pool nodes only.) The read pool node needs to be
12787 /// repaired. The database might be unavailable.
12788 Repairing,
12789 /// If set, the enum was initialized with an unknown value.
12790 ///
12791 /// Applications can examine the value using [SqlInstanceState::value] or
12792 /// [SqlInstanceState::name].
12793 UnknownValue(sql_instance_state::UnknownValue),
12794 }
12795
12796 #[doc(hidden)]
12797 pub mod sql_instance_state {
12798 #[allow(unused_imports)]
12799 use super::*;
12800 #[derive(Clone, Debug, PartialEq)]
12801 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12802 }
12803
12804 impl SqlInstanceState {
12805 /// Gets the enum value.
12806 ///
12807 /// Returns `None` if the enum contains an unknown value deserialized from
12808 /// the string representation of enums.
12809 pub fn value(&self) -> std::option::Option<i32> {
12810 match self {
12811 Self::Unspecified => std::option::Option::Some(0),
12812 Self::Runnable => std::option::Option::Some(1),
12813 Self::Suspended => std::option::Option::Some(2),
12814 Self::PendingDelete => std::option::Option::Some(3),
12815 Self::PendingCreate => std::option::Option::Some(4),
12816 Self::Maintenance => std::option::Option::Some(5),
12817 Self::Failed => std::option::Option::Some(6),
12818 Self::OnlineMaintenance => std::option::Option::Some(7),
12819 Self::Repairing => std::option::Option::Some(8),
12820 Self::UnknownValue(u) => u.0.value(),
12821 }
12822 }
12823
12824 /// Gets the enum value as a string.
12825 ///
12826 /// Returns `None` if the enum contains an unknown value deserialized from
12827 /// the integer representation of enums.
12828 pub fn name(&self) -> std::option::Option<&str> {
12829 match self {
12830 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
12831 Self::Runnable => std::option::Option::Some("RUNNABLE"),
12832 Self::Suspended => std::option::Option::Some("SUSPENDED"),
12833 Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
12834 Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
12835 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
12836 Self::Failed => std::option::Option::Some("FAILED"),
12837 Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
12838 Self::Repairing => std::option::Option::Some("REPAIRING"),
12839 Self::UnknownValue(u) => u.0.name(),
12840 }
12841 }
12842 }
12843
12844 impl std::default::Default for SqlInstanceState {
12845 fn default() -> Self {
12846 use std::convert::From;
12847 Self::from(0)
12848 }
12849 }
12850
12851 impl std::fmt::Display for SqlInstanceState {
12852 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12853 wkt::internal::display_enum(f, self.name(), self.value())
12854 }
12855 }
12856
12857 impl std::convert::From<i32> for SqlInstanceState {
12858 fn from(value: i32) -> Self {
12859 match value {
12860 0 => Self::Unspecified,
12861 1 => Self::Runnable,
12862 2 => Self::Suspended,
12863 3 => Self::PendingDelete,
12864 4 => Self::PendingCreate,
12865 5 => Self::Maintenance,
12866 6 => Self::Failed,
12867 7 => Self::OnlineMaintenance,
12868 8 => Self::Repairing,
12869 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
12870 wkt::internal::UnknownEnumValue::Integer(value),
12871 )),
12872 }
12873 }
12874 }
12875
12876 impl std::convert::From<&str> for SqlInstanceState {
12877 fn from(value: &str) -> Self {
12878 use std::string::ToString;
12879 match value {
12880 "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
12881 "RUNNABLE" => Self::Runnable,
12882 "SUSPENDED" => Self::Suspended,
12883 "PENDING_DELETE" => Self::PendingDelete,
12884 "PENDING_CREATE" => Self::PendingCreate,
12885 "MAINTENANCE" => Self::Maintenance,
12886 "FAILED" => Self::Failed,
12887 "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
12888 "REPAIRING" => Self::Repairing,
12889 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
12890 wkt::internal::UnknownEnumValue::String(value.to_string()),
12891 )),
12892 }
12893 }
12894 }
12895
12896 impl serde::ser::Serialize for SqlInstanceState {
12897 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12898 where
12899 S: serde::Serializer,
12900 {
12901 match self {
12902 Self::Unspecified => serializer.serialize_i32(0),
12903 Self::Runnable => serializer.serialize_i32(1),
12904 Self::Suspended => serializer.serialize_i32(2),
12905 Self::PendingDelete => serializer.serialize_i32(3),
12906 Self::PendingCreate => serializer.serialize_i32(4),
12907 Self::Maintenance => serializer.serialize_i32(5),
12908 Self::Failed => serializer.serialize_i32(6),
12909 Self::OnlineMaintenance => serializer.serialize_i32(7),
12910 Self::Repairing => serializer.serialize_i32(8),
12911 Self::UnknownValue(u) => u.0.serialize(serializer),
12912 }
12913 }
12914 }
12915
12916 impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
12917 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12918 where
12919 D: serde::Deserializer<'de>,
12920 {
12921 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
12922 ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
12923 ))
12924 }
12925 }
12926
12927 /// The SQL network architecture for the instance.
12928 ///
12929 /// # Working with unknown values
12930 ///
12931 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12932 /// additional enum variants at any time. Adding new variants is not considered
12933 /// a breaking change. Applications should write their code in anticipation of:
12934 ///
12935 /// - New values appearing in future releases of the client library, **and**
12936 /// - New values received dynamically, without application changes.
12937 ///
12938 /// Please consult the [Working with enums] section in the user guide for some
12939 /// guidelines.
12940 ///
12941 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12942 #[derive(Clone, Debug, PartialEq)]
12943 #[non_exhaustive]
12944 pub enum SqlNetworkArchitecture {
12945 Unspecified,
12946 /// The instance uses the new network architecture.
12947 NewNetworkArchitecture,
12948 /// The instance uses the old network architecture.
12949 OldNetworkArchitecture,
12950 /// If set, the enum was initialized with an unknown value.
12951 ///
12952 /// Applications can examine the value using [SqlNetworkArchitecture::value] or
12953 /// [SqlNetworkArchitecture::name].
12954 UnknownValue(sql_network_architecture::UnknownValue),
12955 }
12956
12957 #[doc(hidden)]
12958 pub mod sql_network_architecture {
12959 #[allow(unused_imports)]
12960 use super::*;
12961 #[derive(Clone, Debug, PartialEq)]
12962 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12963 }
12964
12965 impl SqlNetworkArchitecture {
12966 /// Gets the enum value.
12967 ///
12968 /// Returns `None` if the enum contains an unknown value deserialized from
12969 /// the string representation of enums.
12970 pub fn value(&self) -> std::option::Option<i32> {
12971 match self {
12972 Self::Unspecified => std::option::Option::Some(0),
12973 Self::NewNetworkArchitecture => std::option::Option::Some(1),
12974 Self::OldNetworkArchitecture => std::option::Option::Some(2),
12975 Self::UnknownValue(u) => u.0.value(),
12976 }
12977 }
12978
12979 /// Gets the enum value as a string.
12980 ///
12981 /// Returns `None` if the enum contains an unknown value deserialized from
12982 /// the integer representation of enums.
12983 pub fn name(&self) -> std::option::Option<&str> {
12984 match self {
12985 Self::Unspecified => {
12986 std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
12987 }
12988 Self::NewNetworkArchitecture => {
12989 std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
12990 }
12991 Self::OldNetworkArchitecture => {
12992 std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
12993 }
12994 Self::UnknownValue(u) => u.0.name(),
12995 }
12996 }
12997 }
12998
12999 impl std::default::Default for SqlNetworkArchitecture {
13000 fn default() -> Self {
13001 use std::convert::From;
13002 Self::from(0)
13003 }
13004 }
13005
13006 impl std::fmt::Display for SqlNetworkArchitecture {
13007 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13008 wkt::internal::display_enum(f, self.name(), self.value())
13009 }
13010 }
13011
13012 impl std::convert::From<i32> for SqlNetworkArchitecture {
13013 fn from(value: i32) -> Self {
13014 match value {
13015 0 => Self::Unspecified,
13016 1 => Self::NewNetworkArchitecture,
13017 2 => Self::OldNetworkArchitecture,
13018 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13019 wkt::internal::UnknownEnumValue::Integer(value),
13020 )),
13021 }
13022 }
13023 }
13024
13025 impl std::convert::From<&str> for SqlNetworkArchitecture {
13026 fn from(value: &str) -> Self {
13027 use std::string::ToString;
13028 match value {
13029 "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
13030 "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
13031 "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
13032 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13033 wkt::internal::UnknownEnumValue::String(value.to_string()),
13034 )),
13035 }
13036 }
13037 }
13038
13039 impl serde::ser::Serialize for SqlNetworkArchitecture {
13040 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13041 where
13042 S: serde::Serializer,
13043 {
13044 match self {
13045 Self::Unspecified => serializer.serialize_i32(0),
13046 Self::NewNetworkArchitecture => serializer.serialize_i32(1),
13047 Self::OldNetworkArchitecture => serializer.serialize_i32(2),
13048 Self::UnknownValue(u) => u.0.serialize(serializer),
13049 }
13050 }
13051 }
13052
13053 impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
13054 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13055 where
13056 D: serde::Deserializer<'de>,
13057 {
13058 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
13059 ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
13060 ))
13061 }
13062 }
13063}
13064
13065/// Gemini instance configuration.
13066#[derive(Clone, Default, PartialEq)]
13067#[non_exhaustive]
13068pub struct GeminiInstanceConfig {
13069 /// Output only. Whether Gemini is enabled.
13070 pub entitled: std::option::Option<bool>,
13071
13072 /// Output only. Whether the vacuum management is enabled.
13073 pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
13074
13075 /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
13076 pub oom_session_cancel_enabled: std::option::Option<bool>,
13077
13078 /// Output only. Whether the active query is enabled.
13079 pub active_query_enabled: std::option::Option<bool>,
13080
13081 /// Output only. Whether the index advisor is enabled.
13082 pub index_advisor_enabled: std::option::Option<bool>,
13083
13084 /// Output only. Whether the flag recommender is enabled.
13085 pub flag_recommender_enabled: std::option::Option<bool>,
13086
13087 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13088}
13089
13090impl GeminiInstanceConfig {
13091 pub fn new() -> Self {
13092 std::default::Default::default()
13093 }
13094
13095 /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13096 ///
13097 /// # Example
13098 /// ```ignore,no_run
13099 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13100 /// let x = GeminiInstanceConfig::new().set_entitled(true);
13101 /// ```
13102 pub fn set_entitled<T>(mut self, v: T) -> Self
13103 where
13104 T: std::convert::Into<bool>,
13105 {
13106 self.entitled = std::option::Option::Some(v.into());
13107 self
13108 }
13109
13110 /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13111 ///
13112 /// # Example
13113 /// ```ignore,no_run
13114 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13115 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
13116 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
13117 /// ```
13118 pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
13119 where
13120 T: std::convert::Into<bool>,
13121 {
13122 self.entitled = v.map(|x| x.into());
13123 self
13124 }
13125
13126 /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13127 ///
13128 /// # Example
13129 /// ```ignore,no_run
13130 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13131 /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
13132 /// ```
13133 pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
13134 where
13135 T: std::convert::Into<bool>,
13136 {
13137 self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
13138 self
13139 }
13140
13141 /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13142 ///
13143 /// # Example
13144 /// ```ignore,no_run
13145 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13146 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
13147 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
13148 /// ```
13149 pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13150 where
13151 T: std::convert::Into<bool>,
13152 {
13153 self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
13154 self
13155 }
13156
13157 /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13158 ///
13159 /// # Example
13160 /// ```ignore,no_run
13161 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13162 /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
13163 /// ```
13164 pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
13165 where
13166 T: std::convert::Into<bool>,
13167 {
13168 self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
13169 self
13170 }
13171
13172 /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13173 ///
13174 /// # Example
13175 /// ```ignore,no_run
13176 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13177 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
13178 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
13179 /// ```
13180 pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13181 where
13182 T: std::convert::Into<bool>,
13183 {
13184 self.oom_session_cancel_enabled = v.map(|x| x.into());
13185 self
13186 }
13187
13188 /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13189 ///
13190 /// # Example
13191 /// ```ignore,no_run
13192 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13193 /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
13194 /// ```
13195 pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
13196 where
13197 T: std::convert::Into<bool>,
13198 {
13199 self.active_query_enabled = std::option::Option::Some(v.into());
13200 self
13201 }
13202
13203 /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13204 ///
13205 /// # Example
13206 /// ```ignore,no_run
13207 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13208 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
13209 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
13210 /// ```
13211 pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13212 where
13213 T: std::convert::Into<bool>,
13214 {
13215 self.active_query_enabled = v.map(|x| x.into());
13216 self
13217 }
13218
13219 /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13220 ///
13221 /// # Example
13222 /// ```ignore,no_run
13223 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13224 /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
13225 /// ```
13226 pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
13227 where
13228 T: std::convert::Into<bool>,
13229 {
13230 self.index_advisor_enabled = std::option::Option::Some(v.into());
13231 self
13232 }
13233
13234 /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13235 ///
13236 /// # Example
13237 /// ```ignore,no_run
13238 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13239 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
13240 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
13241 /// ```
13242 pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13243 where
13244 T: std::convert::Into<bool>,
13245 {
13246 self.index_advisor_enabled = v.map(|x| x.into());
13247 self
13248 }
13249
13250 /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13251 ///
13252 /// # Example
13253 /// ```ignore,no_run
13254 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13255 /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
13256 /// ```
13257 pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
13258 where
13259 T: std::convert::Into<bool>,
13260 {
13261 self.flag_recommender_enabled = std::option::Option::Some(v.into());
13262 self
13263 }
13264
13265 /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13266 ///
13267 /// # Example
13268 /// ```ignore,no_run
13269 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13270 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
13271 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
13272 /// ```
13273 pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13274 where
13275 T: std::convert::Into<bool>,
13276 {
13277 self.flag_recommender_enabled = v.map(|x| x.into());
13278 self
13279 }
13280}
13281
13282impl wkt::message::Message for GeminiInstanceConfig {
13283 fn typename() -> &'static str {
13284 "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
13285 }
13286}
13287
13288/// A primary instance and disaster recovery (DR) replica pair.
13289/// A DR replica is a cross-region replica that you designate for failover in
13290/// the event that the primary instance experiences regional failure.
13291/// Applicable to MySQL and PostgreSQL.
13292#[derive(Clone, Default, PartialEq)]
13293#[non_exhaustive]
13294pub struct ReplicationCluster {
13295 /// Output only. If set, this field indicates this instance has a private
13296 /// service access (PSA) DNS endpoint that is pointing to the primary instance
13297 /// of the cluster. If this instance is the primary, then the DNS endpoint
13298 /// points to this instance. After a switchover or replica failover operation,
13299 /// this DNS endpoint points to the promoted instance. This is a read-only
13300 /// field, returned to the user as information. This field can exist even if a
13301 /// standalone instance doesn't have a DR replica yet or the DR replica is
13302 /// deleted.
13303 pub psa_write_endpoint: std::string::String,
13304
13305 /// Optional. If the instance is a primary instance, then this field identifies
13306 /// the disaster recovery (DR) replica. A DR replica is an optional
13307 /// configuration for Enterprise Plus edition instances. If the instance is a
13308 /// read replica, then the field is not set. Set this field to a replica name
13309 /// to designate a DR replica for a primary instance. Remove the replica name
13310 /// to remove the DR replica designation.
13311 pub failover_dr_replica_name: std::string::String,
13312
13313 /// Output only. Read-only field that indicates whether the replica is a DR
13314 /// replica. This field is not set if the instance is a primary instance.
13315 pub dr_replica: bool,
13316
13317 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13318}
13319
13320impl ReplicationCluster {
13321 pub fn new() -> Self {
13322 std::default::Default::default()
13323 }
13324
13325 /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
13326 ///
13327 /// # Example
13328 /// ```ignore,no_run
13329 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13330 /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
13331 /// ```
13332 pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
13333 mut self,
13334 v: T,
13335 ) -> Self {
13336 self.psa_write_endpoint = v.into();
13337 self
13338 }
13339
13340 /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
13341 ///
13342 /// # Example
13343 /// ```ignore,no_run
13344 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13345 /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
13346 /// ```
13347 pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
13348 mut self,
13349 v: T,
13350 ) -> Self {
13351 self.failover_dr_replica_name = v.into();
13352 self
13353 }
13354
13355 /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
13356 ///
13357 /// # Example
13358 /// ```ignore,no_run
13359 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13360 /// let x = ReplicationCluster::new().set_dr_replica(true);
13361 /// ```
13362 pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13363 self.dr_replica = v.into();
13364 self
13365 }
13366}
13367
13368impl wkt::message::Message for ReplicationCluster {
13369 fn typename() -> &'static str {
13370 "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
13371 }
13372}
13373
13374/// An available database version. It can be a major or a minor version.
13375#[derive(Clone, Default, PartialEq)]
13376#[non_exhaustive]
13377pub struct AvailableDatabaseVersion {
13378 /// The version's major version name.
13379 pub major_version: std::option::Option<std::string::String>,
13380
13381 /// The database version name. For MySQL 8.0, this string provides the database
13382 /// major and minor version.
13383 pub name: std::option::Option<std::string::String>,
13384
13385 /// The database version's display name.
13386 pub display_name: std::option::Option<std::string::String>,
13387
13388 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13389}
13390
13391impl AvailableDatabaseVersion {
13392 pub fn new() -> Self {
13393 std::default::Default::default()
13394 }
13395
13396 /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13397 ///
13398 /// # Example
13399 /// ```ignore,no_run
13400 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13401 /// let x = AvailableDatabaseVersion::new().set_major_version("example");
13402 /// ```
13403 pub fn set_major_version<T>(mut self, v: T) -> Self
13404 where
13405 T: std::convert::Into<std::string::String>,
13406 {
13407 self.major_version = std::option::Option::Some(v.into());
13408 self
13409 }
13410
13411 /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13412 ///
13413 /// # Example
13414 /// ```ignore,no_run
13415 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13416 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
13417 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
13418 /// ```
13419 pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
13420 where
13421 T: std::convert::Into<std::string::String>,
13422 {
13423 self.major_version = v.map(|x| x.into());
13424 self
13425 }
13426
13427 /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
13428 ///
13429 /// # Example
13430 /// ```ignore,no_run
13431 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13432 /// let x = AvailableDatabaseVersion::new().set_name("example");
13433 /// ```
13434 pub fn set_name<T>(mut self, v: T) -> Self
13435 where
13436 T: std::convert::Into<std::string::String>,
13437 {
13438 self.name = std::option::Option::Some(v.into());
13439 self
13440 }
13441
13442 /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
13443 ///
13444 /// # Example
13445 /// ```ignore,no_run
13446 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13447 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
13448 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
13449 /// ```
13450 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13451 where
13452 T: std::convert::Into<std::string::String>,
13453 {
13454 self.name = v.map(|x| x.into());
13455 self
13456 }
13457
13458 /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13459 ///
13460 /// # Example
13461 /// ```ignore,no_run
13462 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13463 /// let x = AvailableDatabaseVersion::new().set_display_name("example");
13464 /// ```
13465 pub fn set_display_name<T>(mut self, v: T) -> Self
13466 where
13467 T: std::convert::Into<std::string::String>,
13468 {
13469 self.display_name = std::option::Option::Some(v.into());
13470 self
13471 }
13472
13473 /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13474 ///
13475 /// # Example
13476 /// ```ignore,no_run
13477 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13478 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
13479 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
13480 /// ```
13481 pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
13482 where
13483 T: std::convert::Into<std::string::String>,
13484 {
13485 self.display_name = v.map(|x| x.into());
13486 self
13487 }
13488}
13489
13490impl wkt::message::Message for AvailableDatabaseVersion {
13491 fn typename() -> &'static str {
13492 "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
13493 }
13494}
13495
13496/// Reschedule options for maintenance windows.
13497#[derive(Clone, Default, PartialEq)]
13498#[non_exhaustive]
13499pub struct SqlInstancesRescheduleMaintenanceRequestBody {
13500 /// Required. The type of the reschedule the user wants.
13501 pub reschedule: std::option::Option<
13502 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13503 >,
13504
13505 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13506}
13507
13508impl SqlInstancesRescheduleMaintenanceRequestBody {
13509 pub fn new() -> Self {
13510 std::default::Default::default()
13511 }
13512
13513 /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13514 ///
13515 /// # Example
13516 /// ```ignore,no_run
13517 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13518 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13519 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
13520 /// ```
13521 pub fn set_reschedule<T>(mut self, v: T) -> Self
13522 where
13523 T: std::convert::Into<
13524 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13525 >,
13526 {
13527 self.reschedule = std::option::Option::Some(v.into());
13528 self
13529 }
13530
13531 /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13532 ///
13533 /// # Example
13534 /// ```ignore,no_run
13535 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13536 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13537 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
13538 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
13539 /// ```
13540 pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
13541 where
13542 T: std::convert::Into<
13543 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13544 >,
13545 {
13546 self.reschedule = v.map(|x| x.into());
13547 self
13548 }
13549}
13550
13551impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
13552 fn typename() -> &'static str {
13553 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
13554 }
13555}
13556
13557/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
13558pub mod sql_instances_reschedule_maintenance_request_body {
13559 #[allow(unused_imports)]
13560 use super::*;
13561
13562 #[derive(Clone, Default, PartialEq)]
13563 #[non_exhaustive]
13564 pub struct Reschedule {
13565 /// Required. The type of the reschedule.
13566 pub reschedule_type:
13567 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13568
13569 /// Optional. Timestamp when the maintenance shall be rescheduled to if
13570 /// reschedule_type=SPECIFIC_TIME, in
13571 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
13572 /// `2012-11-15T16:19:00.094Z`.
13573 pub schedule_time: std::option::Option<wkt::Timestamp>,
13574
13575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13576 }
13577
13578 impl Reschedule {
13579 pub fn new() -> Self {
13580 std::default::Default::default()
13581 }
13582
13583 /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
13584 ///
13585 /// # Example
13586 /// ```ignore,no_run
13587 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13588 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
13589 /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
13590 /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
13591 /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
13592 /// ```
13593 pub fn set_reschedule_type<
13594 T: std::convert::Into<
13595 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13596 >,
13597 >(
13598 mut self,
13599 v: T,
13600 ) -> Self {
13601 self.reschedule_type = v.into();
13602 self
13603 }
13604
13605 /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13606 ///
13607 /// # Example
13608 /// ```ignore,no_run
13609 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13610 /// use wkt::Timestamp;
13611 /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
13612 /// ```
13613 pub fn set_schedule_time<T>(mut self, v: T) -> Self
13614 where
13615 T: std::convert::Into<wkt::Timestamp>,
13616 {
13617 self.schedule_time = std::option::Option::Some(v.into());
13618 self
13619 }
13620
13621 /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13622 ///
13623 /// # Example
13624 /// ```ignore,no_run
13625 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13626 /// use wkt::Timestamp;
13627 /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
13628 /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
13629 /// ```
13630 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
13631 where
13632 T: std::convert::Into<wkt::Timestamp>,
13633 {
13634 self.schedule_time = v.map(|x| x.into());
13635 self
13636 }
13637 }
13638
13639 impl wkt::message::Message for Reschedule {
13640 fn typename() -> &'static str {
13641 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
13642 }
13643 }
13644
13645 ///
13646 /// # Working with unknown values
13647 ///
13648 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13649 /// additional enum variants at any time. Adding new variants is not considered
13650 /// a breaking change. Applications should write their code in anticipation of:
13651 ///
13652 /// - New values appearing in future releases of the client library, **and**
13653 /// - New values received dynamically, without application changes.
13654 ///
13655 /// Please consult the [Working with enums] section in the user guide for some
13656 /// guidelines.
13657 ///
13658 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13659 #[derive(Clone, Debug, PartialEq)]
13660 #[non_exhaustive]
13661 pub enum RescheduleType {
13662 Unspecified,
13663 /// Reschedules maintenance to happen now (within 5 minutes).
13664 Immediate,
13665 /// Reschedules maintenance to occur within one week from the originally
13666 /// scheduled day and time.
13667 NextAvailableWindow,
13668 /// Reschedules maintenance to a specific time and day.
13669 SpecificTime,
13670 /// If set, the enum was initialized with an unknown value.
13671 ///
13672 /// Applications can examine the value using [RescheduleType::value] or
13673 /// [RescheduleType::name].
13674 UnknownValue(reschedule_type::UnknownValue),
13675 }
13676
13677 #[doc(hidden)]
13678 pub mod reschedule_type {
13679 #[allow(unused_imports)]
13680 use super::*;
13681 #[derive(Clone, Debug, PartialEq)]
13682 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13683 }
13684
13685 impl RescheduleType {
13686 /// Gets the enum value.
13687 ///
13688 /// Returns `None` if the enum contains an unknown value deserialized from
13689 /// the string representation of enums.
13690 pub fn value(&self) -> std::option::Option<i32> {
13691 match self {
13692 Self::Unspecified => std::option::Option::Some(0),
13693 Self::Immediate => std::option::Option::Some(1),
13694 Self::NextAvailableWindow => std::option::Option::Some(2),
13695 Self::SpecificTime => std::option::Option::Some(3),
13696 Self::UnknownValue(u) => u.0.value(),
13697 }
13698 }
13699
13700 /// Gets the enum value as a string.
13701 ///
13702 /// Returns `None` if the enum contains an unknown value deserialized from
13703 /// the integer representation of enums.
13704 pub fn name(&self) -> std::option::Option<&str> {
13705 match self {
13706 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
13707 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
13708 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
13709 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
13710 Self::UnknownValue(u) => u.0.name(),
13711 }
13712 }
13713 }
13714
13715 impl std::default::Default for RescheduleType {
13716 fn default() -> Self {
13717 use std::convert::From;
13718 Self::from(0)
13719 }
13720 }
13721
13722 impl std::fmt::Display for RescheduleType {
13723 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13724 wkt::internal::display_enum(f, self.name(), self.value())
13725 }
13726 }
13727
13728 impl std::convert::From<i32> for RescheduleType {
13729 fn from(value: i32) -> Self {
13730 match value {
13731 0 => Self::Unspecified,
13732 1 => Self::Immediate,
13733 2 => Self::NextAvailableWindow,
13734 3 => Self::SpecificTime,
13735 _ => Self::UnknownValue(reschedule_type::UnknownValue(
13736 wkt::internal::UnknownEnumValue::Integer(value),
13737 )),
13738 }
13739 }
13740 }
13741
13742 impl std::convert::From<&str> for RescheduleType {
13743 fn from(value: &str) -> Self {
13744 use std::string::ToString;
13745 match value {
13746 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
13747 "IMMEDIATE" => Self::Immediate,
13748 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
13749 "SPECIFIC_TIME" => Self::SpecificTime,
13750 _ => Self::UnknownValue(reschedule_type::UnknownValue(
13751 wkt::internal::UnknownEnumValue::String(value.to_string()),
13752 )),
13753 }
13754 }
13755 }
13756
13757 impl serde::ser::Serialize for RescheduleType {
13758 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13759 where
13760 S: serde::Serializer,
13761 {
13762 match self {
13763 Self::Unspecified => serializer.serialize_i32(0),
13764 Self::Immediate => serializer.serialize_i32(1),
13765 Self::NextAvailableWindow => serializer.serialize_i32(2),
13766 Self::SpecificTime => serializer.serialize_i32(3),
13767 Self::UnknownValue(u) => u.0.serialize(serializer),
13768 }
13769 }
13770 }
13771
13772 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
13773 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13774 where
13775 D: serde::Deserializer<'de>,
13776 {
13777 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
13778 ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
13779 ))
13780 }
13781 }
13782}
13783
13784/// Database instance demote primary instance context.
13785#[derive(Clone, Default, PartialEq)]
13786#[non_exhaustive]
13787pub struct DemoteMasterContext {
13788 /// This is always `sql#demoteMasterContext`.
13789 pub kind: std::string::String,
13790
13791 /// Verify the GTID consistency for demote operation. Default value:
13792 /// `True`. Setting this flag to `false` enables you to bypass the GTID
13793 /// consistency check between on-premises primary instance and Cloud SQL
13794 /// instance during the demotion operation but also exposes you to the risk of
13795 /// future replication failures. Change the value only if you know the reason
13796 /// for the GTID divergence and are confident that doing so will not cause any
13797 /// replication issues.
13798 pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
13799
13800 /// The name of the instance which will act as on-premises primary instance
13801 /// in the replication setup.
13802 pub master_instance_name: std::string::String,
13803
13804 /// Configuration specific to read-replicas replicating from the on-premises
13805 /// primary instance.
13806 pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
13807
13808 /// Flag to skip replication setup on the instance.
13809 pub skip_replication_setup: bool,
13810
13811 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13812}
13813
13814impl DemoteMasterContext {
13815 pub fn new() -> Self {
13816 std::default::Default::default()
13817 }
13818
13819 /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
13820 ///
13821 /// # Example
13822 /// ```ignore,no_run
13823 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13824 /// let x = DemoteMasterContext::new().set_kind("example");
13825 /// ```
13826 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13827 self.kind = v.into();
13828 self
13829 }
13830
13831 /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13832 ///
13833 /// # Example
13834 /// ```ignore,no_run
13835 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13836 /// use wkt::BoolValue;
13837 /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
13838 /// ```
13839 pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
13840 where
13841 T: std::convert::Into<wkt::BoolValue>,
13842 {
13843 self.verify_gtid_consistency = std::option::Option::Some(v.into());
13844 self
13845 }
13846
13847 /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13848 ///
13849 /// # Example
13850 /// ```ignore,no_run
13851 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13852 /// use wkt::BoolValue;
13853 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
13854 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
13855 /// ```
13856 pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
13857 where
13858 T: std::convert::Into<wkt::BoolValue>,
13859 {
13860 self.verify_gtid_consistency = v.map(|x| x.into());
13861 self
13862 }
13863
13864 /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
13865 ///
13866 /// # Example
13867 /// ```ignore,no_run
13868 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13869 /// let x = DemoteMasterContext::new().set_master_instance_name("example");
13870 /// ```
13871 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
13872 mut self,
13873 v: T,
13874 ) -> Self {
13875 self.master_instance_name = v.into();
13876 self
13877 }
13878
13879 /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
13880 ///
13881 /// # Example
13882 /// ```ignore,no_run
13883 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13884 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13885 /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
13886 /// ```
13887 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
13888 where
13889 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
13890 {
13891 self.replica_configuration = std::option::Option::Some(v.into());
13892 self
13893 }
13894
13895 /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
13896 ///
13897 /// # Example
13898 /// ```ignore,no_run
13899 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13900 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13901 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
13902 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
13903 /// ```
13904 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13905 where
13906 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
13907 {
13908 self.replica_configuration = v.map(|x| x.into());
13909 self
13910 }
13911
13912 /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
13913 ///
13914 /// # Example
13915 /// ```ignore,no_run
13916 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13917 /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
13918 /// ```
13919 pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13920 self.skip_replication_setup = v.into();
13921 self
13922 }
13923}
13924
13925impl wkt::message::Message for DemoteMasterContext {
13926 fn typename() -> &'static str {
13927 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
13928 }
13929}
13930
13931/// This context is used to demote an existing standalone instance to be
13932/// a Cloud SQL read replica for an external database server.
13933#[derive(Clone, Default, PartialEq)]
13934#[non_exhaustive]
13935pub struct DemoteContext {
13936 /// This is always `sql#demoteContext`.
13937 pub kind: std::string::String,
13938
13939 /// Required. The name of the instance which acts as the on-premises primary
13940 /// instance in the replication setup.
13941 pub source_representative_instance_name: std::string::String,
13942
13943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13944}
13945
13946impl DemoteContext {
13947 pub fn new() -> Self {
13948 std::default::Default::default()
13949 }
13950
13951 /// Sets the value of [kind][crate::model::DemoteContext::kind].
13952 ///
13953 /// # Example
13954 /// ```ignore,no_run
13955 /// # use google_cloud_sql_v1::model::DemoteContext;
13956 /// let x = DemoteContext::new().set_kind("example");
13957 /// ```
13958 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13959 self.kind = v.into();
13960 self
13961 }
13962
13963 /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
13964 ///
13965 /// # Example
13966 /// ```ignore,no_run
13967 /// # use google_cloud_sql_v1::model::DemoteContext;
13968 /// let x = DemoteContext::new().set_source_representative_instance_name("example");
13969 /// ```
13970 pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
13971 mut self,
13972 v: T,
13973 ) -> Self {
13974 self.source_representative_instance_name = v.into();
13975 self
13976 }
13977}
13978
13979impl wkt::message::Message for DemoteContext {
13980 fn typename() -> &'static str {
13981 "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
13982 }
13983}
13984
13985/// Database instance failover context.
13986#[derive(Clone, Default, PartialEq)]
13987#[non_exhaustive]
13988pub struct FailoverContext {
13989 /// The current settings version of this instance. Request will be rejected if
13990 /// this version doesn't match the current settings version.
13991 pub settings_version: i64,
13992
13993 /// This is always `sql#failoverContext`.
13994 pub kind: std::string::String,
13995
13996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13997}
13998
13999impl FailoverContext {
14000 pub fn new() -> Self {
14001 std::default::Default::default()
14002 }
14003
14004 /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
14005 ///
14006 /// # Example
14007 /// ```ignore,no_run
14008 /// # use google_cloud_sql_v1::model::FailoverContext;
14009 /// let x = FailoverContext::new().set_settings_version(42);
14010 /// ```
14011 pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14012 self.settings_version = v.into();
14013 self
14014 }
14015
14016 /// Sets the value of [kind][crate::model::FailoverContext::kind].
14017 ///
14018 /// # Example
14019 /// ```ignore,no_run
14020 /// # use google_cloud_sql_v1::model::FailoverContext;
14021 /// let x = FailoverContext::new().set_kind("example");
14022 /// ```
14023 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14024 self.kind = v.into();
14025 self
14026 }
14027}
14028
14029impl wkt::message::Message for FailoverContext {
14030 fn typename() -> &'static str {
14031 "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
14032 }
14033}
14034
14035/// Database instance restore from backup context.
14036/// Backup context contains source instance id and project id.
14037#[derive(Clone, Default, PartialEq)]
14038#[non_exhaustive]
14039pub struct RestoreBackupContext {
14040 /// This is always `sql#restoreBackupContext`.
14041 pub kind: std::string::String,
14042
14043 /// The ID of the backup run to restore from.
14044 pub backup_run_id: i64,
14045
14046 /// The ID of the instance that the backup was taken from.
14047 pub instance_id: std::string::String,
14048
14049 /// The full project ID of the source instance.
14050 pub project: std::string::String,
14051
14052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14053}
14054
14055impl RestoreBackupContext {
14056 pub fn new() -> Self {
14057 std::default::Default::default()
14058 }
14059
14060 /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
14061 ///
14062 /// # Example
14063 /// ```ignore,no_run
14064 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14065 /// let x = RestoreBackupContext::new().set_kind("example");
14066 /// ```
14067 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14068 self.kind = v.into();
14069 self
14070 }
14071
14072 /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
14073 ///
14074 /// # Example
14075 /// ```ignore,no_run
14076 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14077 /// let x = RestoreBackupContext::new().set_backup_run_id(42);
14078 /// ```
14079 pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14080 self.backup_run_id = v.into();
14081 self
14082 }
14083
14084 /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
14085 ///
14086 /// # Example
14087 /// ```ignore,no_run
14088 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14089 /// let x = RestoreBackupContext::new().set_instance_id("example");
14090 /// ```
14091 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14092 self.instance_id = v.into();
14093 self
14094 }
14095
14096 /// Sets the value of [project][crate::model::RestoreBackupContext::project].
14097 ///
14098 /// # Example
14099 /// ```ignore,no_run
14100 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14101 /// let x = RestoreBackupContext::new().set_project("example");
14102 /// ```
14103 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14104 self.project = v.into();
14105 self
14106 }
14107}
14108
14109impl wkt::message::Message for RestoreBackupContext {
14110 fn typename() -> &'static str {
14111 "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
14112 }
14113}
14114
14115/// Instance rotate server CA context.
14116#[derive(Clone, Default, PartialEq)]
14117#[non_exhaustive]
14118pub struct RotateServerCaContext {
14119 /// This is always `sql#rotateServerCaContext`.
14120 pub kind: std::string::String,
14121
14122 /// The fingerprint of the next version to be rotated to. If left unspecified,
14123 /// will be rotated to the most recently added server CA version.
14124 pub next_version: std::string::String,
14125
14126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14127}
14128
14129impl RotateServerCaContext {
14130 pub fn new() -> Self {
14131 std::default::Default::default()
14132 }
14133
14134 /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
14135 ///
14136 /// # Example
14137 /// ```ignore,no_run
14138 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14139 /// let x = RotateServerCaContext::new().set_kind("example");
14140 /// ```
14141 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14142 self.kind = v.into();
14143 self
14144 }
14145
14146 /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
14147 ///
14148 /// # Example
14149 /// ```ignore,no_run
14150 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14151 /// let x = RotateServerCaContext::new().set_next_version("example");
14152 /// ```
14153 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14154 self.next_version = v.into();
14155 self
14156 }
14157}
14158
14159impl wkt::message::Message for RotateServerCaContext {
14160 fn typename() -> &'static str {
14161 "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
14162 }
14163}
14164
14165/// Instance rotate server certificate context.
14166#[derive(Clone, Default, PartialEq)]
14167#[non_exhaustive]
14168pub struct RotateServerCertificateContext {
14169 /// Optional. This is always `sql#rotateServerCertificateContext`.
14170 pub kind: std::string::String,
14171
14172 /// The fingerprint of the next version to be rotated to. If left unspecified,
14173 /// will be rotated to the most recently added server certificate version.
14174 pub next_version: std::string::String,
14175
14176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14177}
14178
14179impl RotateServerCertificateContext {
14180 pub fn new() -> Self {
14181 std::default::Default::default()
14182 }
14183
14184 /// Sets the value of [kind][crate::model::RotateServerCertificateContext::kind].
14185 ///
14186 /// # Example
14187 /// ```ignore,no_run
14188 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14189 /// let x = RotateServerCertificateContext::new().set_kind("example");
14190 /// ```
14191 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14192 self.kind = v.into();
14193 self
14194 }
14195
14196 /// Sets the value of [next_version][crate::model::RotateServerCertificateContext::next_version].
14197 ///
14198 /// # Example
14199 /// ```ignore,no_run
14200 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14201 /// let x = RotateServerCertificateContext::new().set_next_version("example");
14202 /// ```
14203 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14204 self.next_version = v.into();
14205 self
14206 }
14207}
14208
14209impl wkt::message::Message for RotateServerCertificateContext {
14210 fn typename() -> &'static str {
14211 "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
14212 }
14213}
14214
14215/// Instance rotate Entra ID certificate context.
14216#[derive(Clone, Default, PartialEq)]
14217#[non_exhaustive]
14218pub struct RotateEntraIdCertificateContext {
14219 /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
14220 pub kind: std::string::String,
14221
14222 /// Optional. The fingerprint of the next version to be rotated to. If left
14223 /// unspecified, will be rotated to the most recently added server certificate
14224 /// version.
14225 pub next_version: std::string::String,
14226
14227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14228}
14229
14230impl RotateEntraIdCertificateContext {
14231 pub fn new() -> Self {
14232 std::default::Default::default()
14233 }
14234
14235 /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
14236 ///
14237 /// # Example
14238 /// ```ignore,no_run
14239 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14240 /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
14241 /// ```
14242 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14243 self.kind = v.into();
14244 self
14245 }
14246
14247 /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
14248 ///
14249 /// # Example
14250 /// ```ignore,no_run
14251 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14252 /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
14253 /// ```
14254 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14255 self.next_version = v.into();
14256 self
14257 }
14258}
14259
14260impl wkt::message::Message for RotateEntraIdCertificateContext {
14261 fn typename() -> &'static str {
14262 "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
14263 }
14264}
14265
14266/// Database Instance truncate log context.
14267#[derive(Clone, Default, PartialEq)]
14268#[non_exhaustive]
14269pub struct TruncateLogContext {
14270 /// This is always `sql#truncateLogContext`.
14271 pub kind: std::string::String,
14272
14273 /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
14274 /// `MYSQL_SLOW_TABLE`.
14275 pub log_type: std::string::String,
14276
14277 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14278}
14279
14280impl TruncateLogContext {
14281 pub fn new() -> Self {
14282 std::default::Default::default()
14283 }
14284
14285 /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
14286 ///
14287 /// # Example
14288 /// ```ignore,no_run
14289 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14290 /// let x = TruncateLogContext::new().set_kind("example");
14291 /// ```
14292 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14293 self.kind = v.into();
14294 self
14295 }
14296
14297 /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
14298 ///
14299 /// # Example
14300 /// ```ignore,no_run
14301 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14302 /// let x = TruncateLogContext::new().set_log_type("example");
14303 /// ```
14304 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14305 self.log_type = v.into();
14306 self
14307 }
14308}
14309
14310impl wkt::message::Message for TruncateLogContext {
14311 fn typename() -> &'static str {
14312 "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
14313 }
14314}
14315
14316/// External primary instance migration setting error/warning.
14317#[derive(Clone, Default, PartialEq)]
14318#[non_exhaustive]
14319pub struct SqlExternalSyncSettingError {
14320 /// Can be `sql#externalSyncSettingError` or
14321 /// `sql#externalSyncSettingWarning`.
14322 pub kind: std::string::String,
14323
14324 /// Identifies the specific error that occurred.
14325 pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14326
14327 /// Additional information about the error encountered.
14328 pub detail: std::string::String,
14329
14330 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14331}
14332
14333impl SqlExternalSyncSettingError {
14334 pub fn new() -> Self {
14335 std::default::Default::default()
14336 }
14337
14338 /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
14339 ///
14340 /// # Example
14341 /// ```ignore,no_run
14342 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14343 /// let x = SqlExternalSyncSettingError::new().set_kind("example");
14344 /// ```
14345 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14346 self.kind = v.into();
14347 self
14348 }
14349
14350 /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
14351 ///
14352 /// # Example
14353 /// ```ignore,no_run
14354 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14355 /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
14356 /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
14357 /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
14358 /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
14359 /// ```
14360 pub fn set_type<
14361 T: std::convert::Into<
14362 crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14363 >,
14364 >(
14365 mut self,
14366 v: T,
14367 ) -> Self {
14368 self.r#type = v.into();
14369 self
14370 }
14371
14372 /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
14373 ///
14374 /// # Example
14375 /// ```ignore,no_run
14376 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14377 /// let x = SqlExternalSyncSettingError::new().set_detail("example");
14378 /// ```
14379 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14380 self.detail = v.into();
14381 self
14382 }
14383}
14384
14385impl wkt::message::Message for SqlExternalSyncSettingError {
14386 fn typename() -> &'static str {
14387 "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
14388 }
14389}
14390
14391/// Defines additional types related to [SqlExternalSyncSettingError].
14392pub mod sql_external_sync_setting_error {
14393 #[allow(unused_imports)]
14394 use super::*;
14395
14396 ///
14397 /// # Working with unknown values
14398 ///
14399 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14400 /// additional enum variants at any time. Adding new variants is not considered
14401 /// a breaking change. Applications should write their code in anticipation of:
14402 ///
14403 /// - New values appearing in future releases of the client library, **and**
14404 /// - New values received dynamically, without application changes.
14405 ///
14406 /// Please consult the [Working with enums] section in the user guide for some
14407 /// guidelines.
14408 ///
14409 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14410 #[derive(Clone, Debug, PartialEq)]
14411 #[non_exhaustive]
14412 pub enum SqlExternalSyncSettingErrorType {
14413 Unspecified,
14414 ConnectionFailure,
14415 BinlogNotEnabled,
14416 IncompatibleDatabaseVersion,
14417 ReplicaAlreadySetup,
14418 /// The replication user is missing privileges that are required.
14419 InsufficientPrivilege,
14420 /// Unsupported migration type.
14421 UnsupportedMigrationType,
14422 /// No pglogical extension installed on databases, applicable for postgres.
14423 NoPglogicalInstalled,
14424 /// pglogical node already exists on databases, applicable for postgres.
14425 PglogicalNodeAlreadyExists,
14426 /// The value of parameter wal_level is not set to logical.
14427 InvalidWalLevel,
14428 /// The value of parameter shared_preload_libraries does not include
14429 /// pglogical.
14430 InvalidSharedPreloadLibrary,
14431 /// The value of parameter max_replication_slots is not sufficient.
14432 InsufficientMaxReplicationSlots,
14433 /// The value of parameter max_wal_senders is not sufficient.
14434 InsufficientMaxWalSenders,
14435 /// The value of parameter max_worker_processes is not sufficient.
14436 InsufficientMaxWorkerProcesses,
14437 /// Extensions installed are either not supported or having unsupported
14438 /// versions.
14439 UnsupportedExtensions,
14440 /// The value of parameter rds.logical_replication is not set to 1.
14441 InvalidRdsLogicalReplication,
14442 /// The primary instance logging setup doesn't allow EM sync.
14443 InvalidLoggingSetup,
14444 /// The primary instance database parameter setup doesn't allow EM sync.
14445 InvalidDbParam,
14446 /// The gtid_mode is not supported, applicable for MySQL.
14447 UnsupportedGtidMode,
14448 /// SQL Server Agent is not running.
14449 SqlserverAgentNotRunning,
14450 /// The table definition is not support due to missing primary key or replica
14451 /// identity, applicable for postgres. Note that this is a warning and won't
14452 /// block the migration.
14453 UnsupportedTableDefinition,
14454 /// The customer has a definer that will break EM setup.
14455 UnsupportedDefiner,
14456 /// SQL Server @@SERVERNAME does not match actual host name.
14457 SqlserverServernameMismatch,
14458 /// The primary instance has been setup and will fail the setup.
14459 PrimaryAlreadySetup,
14460 /// The primary instance has unsupported binary log format.
14461 UnsupportedBinlogFormat,
14462 /// The primary instance's binary log retention setting.
14463 BinlogRetentionSetting,
14464 /// The primary instance has tables with unsupported storage engine.
14465 UnsupportedStorageEngine,
14466 /// Source has tables with limited support
14467 /// eg: PostgreSQL tables without primary keys.
14468 LimitedSupportTables,
14469 /// The replica instance contains existing data.
14470 ExistingDataInReplica,
14471 /// The replication user is missing privileges that are optional.
14472 MissingOptionalPrivileges,
14473 /// Additional BACKUP_ADMIN privilege is granted to the replication user
14474 /// which may lock source MySQL 8 instance for DDLs during initial sync.
14475 RiskyBackupAdminPrivilege,
14476 /// The Cloud Storage bucket is missing necessary permissions.
14477 InsufficientGcsPermissions,
14478 /// The Cloud Storage bucket has an error in the file or contains invalid
14479 /// file information.
14480 InvalidFileInfo,
14481 /// The source instance has unsupported database settings for migration.
14482 UnsupportedDatabaseSettings,
14483 /// The replication user is missing parallel import specific privileges.
14484 /// (e.g. LOCK TABLES) for MySQL.
14485 MysqlParallelImportInsufficientPrivilege,
14486 /// The global variable local_infile is off on external server replica.
14487 LocalInfileOff,
14488 /// This code instructs customers to turn on point-in-time recovery manually
14489 /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
14490 TurnOnPitrAfterPromote,
14491 /// The minor version of replica database is incompatible with the source.
14492 IncompatibleDatabaseMinorVersion,
14493 /// This warning message indicates that Cloud SQL uses the maximum number of
14494 /// subscriptions to migrate data from the source to the destination.
14495 SourceMaxSubscriptions,
14496 /// Unable to verify definers on the source for MySQL.
14497 UnableToVerifyDefiners,
14498 /// If a time out occurs while the subscription counts are calculated, then
14499 /// this value is set to 1. Otherwise, this value is set to 2.
14500 SubscriptionCalculationStatus,
14501 /// Count of subscriptions needed to sync source data for PostgreSQL
14502 /// database.
14503 PgSubscriptionCount,
14504 /// Final parallel level that is used to do migration.
14505 PgSyncParallelLevel,
14506 /// The disk size of the replica instance is smaller than the data size of
14507 /// the source instance.
14508 InsufficientDiskSize,
14509 /// The data size of the source instance is greater than 1 TB, the number of
14510 /// cores of the replica instance is less than 8, and the memory of the
14511 /// replica is less than 32 GB.
14512 InsufficientMachineTier,
14513 /// The warning message indicates the unsupported extensions will not be
14514 /// migrated to the destination.
14515 UnsupportedExtensionsNotMigrated,
14516 /// The warning message indicates the pg_cron extension and settings will not
14517 /// be migrated to the destination.
14518 ExtensionsNotMigrated,
14519 /// The error message indicates that pg_cron flags are enabled on the
14520 /// destination which is not supported during the migration.
14521 PgCronFlagEnabledInReplica,
14522 /// This error message indicates that the specified extensions are not
14523 /// enabled on destination instance. For example, before you can migrate
14524 /// data to the destination instance, you must enable the PGAudit extension
14525 /// on the instance.
14526 ExtensionsNotEnabledInReplica,
14527 /// The source database has generated columns that can't be migrated. Please
14528 /// change them to regular columns before migration.
14529 UnsupportedColumns,
14530 /// The source database has users that aren't created in the replica.
14531 /// First, create all users, which are in the pg_user_mappings table
14532 /// of the source database, in the destination instance. Then, perform the
14533 /// migration.
14534 UsersNotCreatedInReplica,
14535 /// The selected objects include system objects that aren't supported for
14536 /// migration.
14537 UnsupportedSystemObjects,
14538 /// The source database has tables with the FULL or NOTHING replica identity.
14539 /// Before starting your migration, either remove the identity or change it
14540 /// to DEFAULT. Note that this is an error and will block the migration.
14541 UnsupportedTablesWithReplicaIdentity,
14542 /// The selected objects don't exist on the source instance.
14543 SelectedObjectsNotExistOnSource,
14544 /// PSC only destination instance does not have a network attachment URI.
14545 PscOnlyInstanceWithNoNetworkAttachmentUri,
14546 /// Selected objects reference unselected objects. Based on their object type
14547 /// (foreign key constraint or view), selected objects will fail during
14548 /// migration.
14549 SelectedObjectsReferenceUnselectedObjects,
14550 /// The migration will delete existing data in the replica; set
14551 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14552 /// in the request to acknowledge this. This is an error. MySQL only.
14553 ///
14554 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14555 PromptDeleteExisting,
14556 /// The migration will delete existing data in the replica;
14557 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14558 /// was set in the request acknowledging this. This is a warning rather than
14559 /// an error. MySQL only.
14560 ///
14561 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14562 WillDeleteExisting,
14563 /// The replication user is missing specific privileges to setup DDL
14564 /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
14565 PgDdlReplicationInsufficientPrivilege,
14566 /// If set, the enum was initialized with an unknown value.
14567 ///
14568 /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
14569 /// [SqlExternalSyncSettingErrorType::name].
14570 UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
14571 }
14572
14573 #[doc(hidden)]
14574 pub mod sql_external_sync_setting_error_type {
14575 #[allow(unused_imports)]
14576 use super::*;
14577 #[derive(Clone, Debug, PartialEq)]
14578 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14579 }
14580
14581 impl SqlExternalSyncSettingErrorType {
14582 /// Gets the enum value.
14583 ///
14584 /// Returns `None` if the enum contains an unknown value deserialized from
14585 /// the string representation of enums.
14586 pub fn value(&self) -> std::option::Option<i32> {
14587 match self {
14588 Self::Unspecified => std::option::Option::Some(0),
14589 Self::ConnectionFailure => std::option::Option::Some(1),
14590 Self::BinlogNotEnabled => std::option::Option::Some(2),
14591 Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
14592 Self::ReplicaAlreadySetup => std::option::Option::Some(4),
14593 Self::InsufficientPrivilege => std::option::Option::Some(5),
14594 Self::UnsupportedMigrationType => std::option::Option::Some(6),
14595 Self::NoPglogicalInstalled => std::option::Option::Some(7),
14596 Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
14597 Self::InvalidWalLevel => std::option::Option::Some(9),
14598 Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
14599 Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
14600 Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
14601 Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
14602 Self::UnsupportedExtensions => std::option::Option::Some(14),
14603 Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
14604 Self::InvalidLoggingSetup => std::option::Option::Some(16),
14605 Self::InvalidDbParam => std::option::Option::Some(17),
14606 Self::UnsupportedGtidMode => std::option::Option::Some(18),
14607 Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
14608 Self::UnsupportedTableDefinition => std::option::Option::Some(20),
14609 Self::UnsupportedDefiner => std::option::Option::Some(21),
14610 Self::SqlserverServernameMismatch => std::option::Option::Some(22),
14611 Self::PrimaryAlreadySetup => std::option::Option::Some(23),
14612 Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
14613 Self::BinlogRetentionSetting => std::option::Option::Some(25),
14614 Self::UnsupportedStorageEngine => std::option::Option::Some(26),
14615 Self::LimitedSupportTables => std::option::Option::Some(27),
14616 Self::ExistingDataInReplica => std::option::Option::Some(28),
14617 Self::MissingOptionalPrivileges => std::option::Option::Some(29),
14618 Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
14619 Self::InsufficientGcsPermissions => std::option::Option::Some(31),
14620 Self::InvalidFileInfo => std::option::Option::Some(32),
14621 Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
14622 Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
14623 Self::LocalInfileOff => std::option::Option::Some(35),
14624 Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
14625 Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
14626 Self::SourceMaxSubscriptions => std::option::Option::Some(38),
14627 Self::UnableToVerifyDefiners => std::option::Option::Some(39),
14628 Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
14629 Self::PgSubscriptionCount => std::option::Option::Some(41),
14630 Self::PgSyncParallelLevel => std::option::Option::Some(42),
14631 Self::InsufficientDiskSize => std::option::Option::Some(43),
14632 Self::InsufficientMachineTier => std::option::Option::Some(44),
14633 Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
14634 Self::ExtensionsNotMigrated => std::option::Option::Some(46),
14635 Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
14636 Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
14637 Self::UnsupportedColumns => std::option::Option::Some(49),
14638 Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
14639 Self::UnsupportedSystemObjects => std::option::Option::Some(51),
14640 Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
14641 Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
14642 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
14643 Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
14644 Self::PromptDeleteExisting => std::option::Option::Some(56),
14645 Self::WillDeleteExisting => std::option::Option::Some(57),
14646 Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
14647 Self::UnknownValue(u) => u.0.value(),
14648 }
14649 }
14650
14651 /// Gets the enum value as a string.
14652 ///
14653 /// Returns `None` if the enum contains an unknown value deserialized from
14654 /// the integer representation of enums.
14655 pub fn name(&self) -> std::option::Option<&str> {
14656 match self {
14657 Self::Unspecified => {
14658 std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
14659 }
14660 Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
14661 Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
14662 Self::IncompatibleDatabaseVersion => {
14663 std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
14664 }
14665 Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
14666 Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
14667 Self::UnsupportedMigrationType => {
14668 std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
14669 }
14670 Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
14671 Self::PglogicalNodeAlreadyExists => {
14672 std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
14673 }
14674 Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
14675 Self::InvalidSharedPreloadLibrary => {
14676 std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
14677 }
14678 Self::InsufficientMaxReplicationSlots => {
14679 std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
14680 }
14681 Self::InsufficientMaxWalSenders => {
14682 std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
14683 }
14684 Self::InsufficientMaxWorkerProcesses => {
14685 std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
14686 }
14687 Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
14688 Self::InvalidRdsLogicalReplication => {
14689 std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
14690 }
14691 Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
14692 Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
14693 Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
14694 Self::SqlserverAgentNotRunning => {
14695 std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
14696 }
14697 Self::UnsupportedTableDefinition => {
14698 std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
14699 }
14700 Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
14701 Self::SqlserverServernameMismatch => {
14702 std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
14703 }
14704 Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
14705 Self::UnsupportedBinlogFormat => {
14706 std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
14707 }
14708 Self::BinlogRetentionSetting => {
14709 std::option::Option::Some("BINLOG_RETENTION_SETTING")
14710 }
14711 Self::UnsupportedStorageEngine => {
14712 std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
14713 }
14714 Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
14715 Self::ExistingDataInReplica => {
14716 std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
14717 }
14718 Self::MissingOptionalPrivileges => {
14719 std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
14720 }
14721 Self::RiskyBackupAdminPrivilege => {
14722 std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
14723 }
14724 Self::InsufficientGcsPermissions => {
14725 std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
14726 }
14727 Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
14728 Self::UnsupportedDatabaseSettings => {
14729 std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
14730 }
14731 Self::MysqlParallelImportInsufficientPrivilege => {
14732 std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
14733 }
14734 Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
14735 Self::TurnOnPitrAfterPromote => {
14736 std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
14737 }
14738 Self::IncompatibleDatabaseMinorVersion => {
14739 std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
14740 }
14741 Self::SourceMaxSubscriptions => {
14742 std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
14743 }
14744 Self::UnableToVerifyDefiners => {
14745 std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
14746 }
14747 Self::SubscriptionCalculationStatus => {
14748 std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
14749 }
14750 Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
14751 Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
14752 Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
14753 Self::InsufficientMachineTier => {
14754 std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
14755 }
14756 Self::UnsupportedExtensionsNotMigrated => {
14757 std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
14758 }
14759 Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
14760 Self::PgCronFlagEnabledInReplica => {
14761 std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
14762 }
14763 Self::ExtensionsNotEnabledInReplica => {
14764 std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
14765 }
14766 Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
14767 Self::UsersNotCreatedInReplica => {
14768 std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
14769 }
14770 Self::UnsupportedSystemObjects => {
14771 std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
14772 }
14773 Self::UnsupportedTablesWithReplicaIdentity => {
14774 std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
14775 }
14776 Self::SelectedObjectsNotExistOnSource => {
14777 std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
14778 }
14779 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
14780 std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
14781 }
14782 Self::SelectedObjectsReferenceUnselectedObjects => {
14783 std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
14784 }
14785 Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
14786 Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
14787 Self::PgDdlReplicationInsufficientPrivilege => {
14788 std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
14789 }
14790 Self::UnknownValue(u) => u.0.name(),
14791 }
14792 }
14793 }
14794
14795 impl std::default::Default for SqlExternalSyncSettingErrorType {
14796 fn default() -> Self {
14797 use std::convert::From;
14798 Self::from(0)
14799 }
14800 }
14801
14802 impl std::fmt::Display for SqlExternalSyncSettingErrorType {
14803 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14804 wkt::internal::display_enum(f, self.name(), self.value())
14805 }
14806 }
14807
14808 impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
14809 fn from(value: i32) -> Self {
14810 match value {
14811 0 => Self::Unspecified,
14812 1 => Self::ConnectionFailure,
14813 2 => Self::BinlogNotEnabled,
14814 3 => Self::IncompatibleDatabaseVersion,
14815 4 => Self::ReplicaAlreadySetup,
14816 5 => Self::InsufficientPrivilege,
14817 6 => Self::UnsupportedMigrationType,
14818 7 => Self::NoPglogicalInstalled,
14819 8 => Self::PglogicalNodeAlreadyExists,
14820 9 => Self::InvalidWalLevel,
14821 10 => Self::InvalidSharedPreloadLibrary,
14822 11 => Self::InsufficientMaxReplicationSlots,
14823 12 => Self::InsufficientMaxWalSenders,
14824 13 => Self::InsufficientMaxWorkerProcesses,
14825 14 => Self::UnsupportedExtensions,
14826 15 => Self::InvalidRdsLogicalReplication,
14827 16 => Self::InvalidLoggingSetup,
14828 17 => Self::InvalidDbParam,
14829 18 => Self::UnsupportedGtidMode,
14830 19 => Self::SqlserverAgentNotRunning,
14831 20 => Self::UnsupportedTableDefinition,
14832 21 => Self::UnsupportedDefiner,
14833 22 => Self::SqlserverServernameMismatch,
14834 23 => Self::PrimaryAlreadySetup,
14835 24 => Self::UnsupportedBinlogFormat,
14836 25 => Self::BinlogRetentionSetting,
14837 26 => Self::UnsupportedStorageEngine,
14838 27 => Self::LimitedSupportTables,
14839 28 => Self::ExistingDataInReplica,
14840 29 => Self::MissingOptionalPrivileges,
14841 30 => Self::RiskyBackupAdminPrivilege,
14842 31 => Self::InsufficientGcsPermissions,
14843 32 => Self::InvalidFileInfo,
14844 33 => Self::UnsupportedDatabaseSettings,
14845 34 => Self::MysqlParallelImportInsufficientPrivilege,
14846 35 => Self::LocalInfileOff,
14847 36 => Self::TurnOnPitrAfterPromote,
14848 37 => Self::IncompatibleDatabaseMinorVersion,
14849 38 => Self::SourceMaxSubscriptions,
14850 39 => Self::UnableToVerifyDefiners,
14851 40 => Self::SubscriptionCalculationStatus,
14852 41 => Self::PgSubscriptionCount,
14853 42 => Self::PgSyncParallelLevel,
14854 43 => Self::InsufficientDiskSize,
14855 44 => Self::InsufficientMachineTier,
14856 45 => Self::UnsupportedExtensionsNotMigrated,
14857 46 => Self::ExtensionsNotMigrated,
14858 47 => Self::PgCronFlagEnabledInReplica,
14859 48 => Self::ExtensionsNotEnabledInReplica,
14860 49 => Self::UnsupportedColumns,
14861 50 => Self::UsersNotCreatedInReplica,
14862 51 => Self::UnsupportedSystemObjects,
14863 52 => Self::UnsupportedTablesWithReplicaIdentity,
14864 53 => Self::SelectedObjectsNotExistOnSource,
14865 54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
14866 55 => Self::SelectedObjectsReferenceUnselectedObjects,
14867 56 => Self::PromptDeleteExisting,
14868 57 => Self::WillDeleteExisting,
14869 58 => Self::PgDdlReplicationInsufficientPrivilege,
14870 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
14871 wkt::internal::UnknownEnumValue::Integer(value),
14872 )),
14873 }
14874 }
14875 }
14876
14877 impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
14878 fn from(value: &str) -> Self {
14879 use std::string::ToString;
14880 match value {
14881 "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
14882 "CONNECTION_FAILURE" => Self::ConnectionFailure,
14883 "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
14884 "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
14885 "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
14886 "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
14887 "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
14888 "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
14889 "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
14890 "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
14891 "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
14892 "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
14893 "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
14894 "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
14895 "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
14896 "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
14897 "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
14898 "INVALID_DB_PARAM" => Self::InvalidDbParam,
14899 "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
14900 "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
14901 "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
14902 "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
14903 "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
14904 "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
14905 "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
14906 "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
14907 "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
14908 "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
14909 "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
14910 "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
14911 "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
14912 "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
14913 "INVALID_FILE_INFO" => Self::InvalidFileInfo,
14914 "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
14915 "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
14916 Self::MysqlParallelImportInsufficientPrivilege
14917 }
14918 "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
14919 "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
14920 "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
14921 "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
14922 "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
14923 "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
14924 "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
14925 "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
14926 "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
14927 "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
14928 "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
14929 "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
14930 "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
14931 "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
14932 "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
14933 "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
14934 "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
14935 "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
14936 Self::UnsupportedTablesWithReplicaIdentity
14937 }
14938 "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
14939 "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
14940 Self::PscOnlyInstanceWithNoNetworkAttachmentUri
14941 }
14942 "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
14943 Self::SelectedObjectsReferenceUnselectedObjects
14944 }
14945 "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
14946 "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
14947 "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
14948 Self::PgDdlReplicationInsufficientPrivilege
14949 }
14950 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
14951 wkt::internal::UnknownEnumValue::String(value.to_string()),
14952 )),
14953 }
14954 }
14955 }
14956
14957 impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
14958 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14959 where
14960 S: serde::Serializer,
14961 {
14962 match self {
14963 Self::Unspecified => serializer.serialize_i32(0),
14964 Self::ConnectionFailure => serializer.serialize_i32(1),
14965 Self::BinlogNotEnabled => serializer.serialize_i32(2),
14966 Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
14967 Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
14968 Self::InsufficientPrivilege => serializer.serialize_i32(5),
14969 Self::UnsupportedMigrationType => serializer.serialize_i32(6),
14970 Self::NoPglogicalInstalled => serializer.serialize_i32(7),
14971 Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
14972 Self::InvalidWalLevel => serializer.serialize_i32(9),
14973 Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
14974 Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
14975 Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
14976 Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
14977 Self::UnsupportedExtensions => serializer.serialize_i32(14),
14978 Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
14979 Self::InvalidLoggingSetup => serializer.serialize_i32(16),
14980 Self::InvalidDbParam => serializer.serialize_i32(17),
14981 Self::UnsupportedGtidMode => serializer.serialize_i32(18),
14982 Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
14983 Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
14984 Self::UnsupportedDefiner => serializer.serialize_i32(21),
14985 Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
14986 Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
14987 Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
14988 Self::BinlogRetentionSetting => serializer.serialize_i32(25),
14989 Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
14990 Self::LimitedSupportTables => serializer.serialize_i32(27),
14991 Self::ExistingDataInReplica => serializer.serialize_i32(28),
14992 Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
14993 Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
14994 Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
14995 Self::InvalidFileInfo => serializer.serialize_i32(32),
14996 Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
14997 Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
14998 Self::LocalInfileOff => serializer.serialize_i32(35),
14999 Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
15000 Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
15001 Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
15002 Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
15003 Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
15004 Self::PgSubscriptionCount => serializer.serialize_i32(41),
15005 Self::PgSyncParallelLevel => serializer.serialize_i32(42),
15006 Self::InsufficientDiskSize => serializer.serialize_i32(43),
15007 Self::InsufficientMachineTier => serializer.serialize_i32(44),
15008 Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
15009 Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
15010 Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
15011 Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
15012 Self::UnsupportedColumns => serializer.serialize_i32(49),
15013 Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
15014 Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
15015 Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
15016 Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
15017 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
15018 Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
15019 Self::PromptDeleteExisting => serializer.serialize_i32(56),
15020 Self::WillDeleteExisting => serializer.serialize_i32(57),
15021 Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
15022 Self::UnknownValue(u) => u.0.serialize(serializer),
15023 }
15024 }
15025 }
15026
15027 impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
15028 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15029 where
15030 D: serde::Deserializer<'de>,
15031 {
15032 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
15033 SqlExternalSyncSettingErrorType,
15034 >::new(
15035 ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
15036 ))
15037 }
15038 }
15039}
15040
15041/// A list of objects that the user selects for replication from an external
15042/// source instance.
15043#[derive(Clone, Default, PartialEq)]
15044#[non_exhaustive]
15045pub struct SelectedObjects {
15046 /// Required. The name of the database to migrate.
15047 pub database: std::string::String,
15048
15049 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15050}
15051
15052impl SelectedObjects {
15053 pub fn new() -> Self {
15054 std::default::Default::default()
15055 }
15056
15057 /// Sets the value of [database][crate::model::SelectedObjects::database].
15058 ///
15059 /// # Example
15060 /// ```ignore,no_run
15061 /// # use google_cloud_sql_v1::model::SelectedObjects;
15062 /// let x = SelectedObjects::new().set_database("example");
15063 /// ```
15064 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15065 self.database = v.into();
15066 self
15067 }
15068}
15069
15070impl wkt::message::Message for SelectedObjects {
15071 fn typename() -> &'static str {
15072 "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
15073 }
15074}
15075
15076/// On-premises instance configuration.
15077#[derive(Clone, Default, PartialEq)]
15078#[non_exhaustive]
15079pub struct OnPremisesConfiguration {
15080 /// The host and port of the on-premises instance in host:port format
15081 pub host_port: std::string::String,
15082
15083 /// This is always `sql#onPremisesConfiguration`.
15084 pub kind: std::string::String,
15085
15086 /// The username for connecting to on-premises instance.
15087 pub username: std::string::String,
15088
15089 /// The password for connecting to on-premises instance.
15090 pub password: std::string::String,
15091
15092 /// PEM representation of the trusted CA's x509 certificate.
15093 pub ca_certificate: std::string::String,
15094
15095 /// PEM representation of the replica's x509 certificate.
15096 pub client_certificate: std::string::String,
15097
15098 /// PEM representation of the replica's private key. The corresponding public
15099 /// key is encoded in the client's certificate.
15100 pub client_key: std::string::String,
15101
15102 /// The dump file to create the Cloud SQL replica.
15103 pub dump_file_path: std::string::String,
15104
15105 /// The reference to Cloud SQL instance if the source is Cloud SQL.
15106 pub source_instance: std::option::Option<crate::model::InstanceReference>,
15107
15108 /// Optional. A list of objects that the user selects for replication from an
15109 /// external source instance.
15110 pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
15111
15112 /// Optional. SSL option for replica connection to the on-premises source.
15113 pub ssl_option: crate::model::on_premises_configuration::SslOption,
15114
15115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15116}
15117
15118impl OnPremisesConfiguration {
15119 pub fn new() -> Self {
15120 std::default::Default::default()
15121 }
15122
15123 /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
15124 ///
15125 /// # Example
15126 /// ```ignore,no_run
15127 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15128 /// let x = OnPremisesConfiguration::new().set_host_port("example");
15129 /// ```
15130 pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15131 self.host_port = v.into();
15132 self
15133 }
15134
15135 /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
15136 ///
15137 /// # Example
15138 /// ```ignore,no_run
15139 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15140 /// let x = OnPremisesConfiguration::new().set_kind("example");
15141 /// ```
15142 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15143 self.kind = v.into();
15144 self
15145 }
15146
15147 /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
15148 ///
15149 /// # Example
15150 /// ```ignore,no_run
15151 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15152 /// let x = OnPremisesConfiguration::new().set_username("example");
15153 /// ```
15154 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15155 self.username = v.into();
15156 self
15157 }
15158
15159 /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
15160 ///
15161 /// # Example
15162 /// ```ignore,no_run
15163 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15164 /// let x = OnPremisesConfiguration::new().set_password("example");
15165 /// ```
15166 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15167 self.password = v.into();
15168 self
15169 }
15170
15171 /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
15172 ///
15173 /// # Example
15174 /// ```ignore,no_run
15175 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15176 /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
15177 /// ```
15178 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15179 self.ca_certificate = v.into();
15180 self
15181 }
15182
15183 /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
15184 ///
15185 /// # Example
15186 /// ```ignore,no_run
15187 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15188 /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
15189 /// ```
15190 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15191 mut self,
15192 v: T,
15193 ) -> Self {
15194 self.client_certificate = v.into();
15195 self
15196 }
15197
15198 /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
15199 ///
15200 /// # Example
15201 /// ```ignore,no_run
15202 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15203 /// let x = OnPremisesConfiguration::new().set_client_key("example");
15204 /// ```
15205 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15206 self.client_key = v.into();
15207 self
15208 }
15209
15210 /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
15211 ///
15212 /// # Example
15213 /// ```ignore,no_run
15214 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15215 /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
15216 /// ```
15217 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15218 self.dump_file_path = v.into();
15219 self
15220 }
15221
15222 /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15223 ///
15224 /// # Example
15225 /// ```ignore,no_run
15226 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15227 /// use google_cloud_sql_v1::model::InstanceReference;
15228 /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
15229 /// ```
15230 pub fn set_source_instance<T>(mut self, v: T) -> Self
15231 where
15232 T: std::convert::Into<crate::model::InstanceReference>,
15233 {
15234 self.source_instance = std::option::Option::Some(v.into());
15235 self
15236 }
15237
15238 /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15239 ///
15240 /// # Example
15241 /// ```ignore,no_run
15242 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15243 /// use google_cloud_sql_v1::model::InstanceReference;
15244 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
15245 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
15246 /// ```
15247 pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
15248 where
15249 T: std::convert::Into<crate::model::InstanceReference>,
15250 {
15251 self.source_instance = v.map(|x| x.into());
15252 self
15253 }
15254
15255 /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
15256 ///
15257 /// # Example
15258 /// ```ignore,no_run
15259 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15260 /// use google_cloud_sql_v1::model::SelectedObjects;
15261 /// let x = OnPremisesConfiguration::new()
15262 /// .set_selected_objects([
15263 /// SelectedObjects::default()/* use setters */,
15264 /// SelectedObjects::default()/* use (different) setters */,
15265 /// ]);
15266 /// ```
15267 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
15268 where
15269 T: std::iter::IntoIterator<Item = V>,
15270 V: std::convert::Into<crate::model::SelectedObjects>,
15271 {
15272 use std::iter::Iterator;
15273 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
15274 self
15275 }
15276
15277 /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
15278 ///
15279 /// # Example
15280 /// ```ignore,no_run
15281 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15282 /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
15283 /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
15284 /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
15285 /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
15286 /// ```
15287 pub fn set_ssl_option<
15288 T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
15289 >(
15290 mut self,
15291 v: T,
15292 ) -> Self {
15293 self.ssl_option = v.into();
15294 self
15295 }
15296}
15297
15298impl wkt::message::Message for OnPremisesConfiguration {
15299 fn typename() -> &'static str {
15300 "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
15301 }
15302}
15303
15304/// Defines additional types related to [OnPremisesConfiguration].
15305pub mod on_premises_configuration {
15306 #[allow(unused_imports)]
15307 use super::*;
15308
15309 /// SslOption defines the SSL mode to be used for replica connection to the
15310 /// on-premises source.
15311 ///
15312 /// # Working with unknown values
15313 ///
15314 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15315 /// additional enum variants at any time. Adding new variants is not considered
15316 /// a breaking change. Applications should write their code in anticipation of:
15317 ///
15318 /// - New values appearing in future releases of the client library, **and**
15319 /// - New values received dynamically, without application changes.
15320 ///
15321 /// Please consult the [Working with enums] section in the user guide for some
15322 /// guidelines.
15323 ///
15324 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15325 #[derive(Clone, Debug, PartialEq)]
15326 #[non_exhaustive]
15327 pub enum SslOption {
15328 /// Unknown SSL option i.e. SSL option not specified by user.
15329 Unspecified,
15330 /// SSL is not used for replica connection to the on-premises source.
15331 Disable,
15332 /// SSL is required for replica connection to the on-premises source.
15333 Require,
15334 /// Verify CA is required for replica connection to the on-premises source.
15335 VerifyCa,
15336 /// If set, the enum was initialized with an unknown value.
15337 ///
15338 /// Applications can examine the value using [SslOption::value] or
15339 /// [SslOption::name].
15340 UnknownValue(ssl_option::UnknownValue),
15341 }
15342
15343 #[doc(hidden)]
15344 pub mod ssl_option {
15345 #[allow(unused_imports)]
15346 use super::*;
15347 #[derive(Clone, Debug, PartialEq)]
15348 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15349 }
15350
15351 impl SslOption {
15352 /// Gets the enum value.
15353 ///
15354 /// Returns `None` if the enum contains an unknown value deserialized from
15355 /// the string representation of enums.
15356 pub fn value(&self) -> std::option::Option<i32> {
15357 match self {
15358 Self::Unspecified => std::option::Option::Some(0),
15359 Self::Disable => std::option::Option::Some(1),
15360 Self::Require => std::option::Option::Some(2),
15361 Self::VerifyCa => std::option::Option::Some(3),
15362 Self::UnknownValue(u) => u.0.value(),
15363 }
15364 }
15365
15366 /// Gets the enum value as a string.
15367 ///
15368 /// Returns `None` if the enum contains an unknown value deserialized from
15369 /// the integer representation of enums.
15370 pub fn name(&self) -> std::option::Option<&str> {
15371 match self {
15372 Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
15373 Self::Disable => std::option::Option::Some("DISABLE"),
15374 Self::Require => std::option::Option::Some("REQUIRE"),
15375 Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
15376 Self::UnknownValue(u) => u.0.name(),
15377 }
15378 }
15379 }
15380
15381 impl std::default::Default for SslOption {
15382 fn default() -> Self {
15383 use std::convert::From;
15384 Self::from(0)
15385 }
15386 }
15387
15388 impl std::fmt::Display for SslOption {
15389 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15390 wkt::internal::display_enum(f, self.name(), self.value())
15391 }
15392 }
15393
15394 impl std::convert::From<i32> for SslOption {
15395 fn from(value: i32) -> Self {
15396 match value {
15397 0 => Self::Unspecified,
15398 1 => Self::Disable,
15399 2 => Self::Require,
15400 3 => Self::VerifyCa,
15401 _ => Self::UnknownValue(ssl_option::UnknownValue(
15402 wkt::internal::UnknownEnumValue::Integer(value),
15403 )),
15404 }
15405 }
15406 }
15407
15408 impl std::convert::From<&str> for SslOption {
15409 fn from(value: &str) -> Self {
15410 use std::string::ToString;
15411 match value {
15412 "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
15413 "DISABLE" => Self::Disable,
15414 "REQUIRE" => Self::Require,
15415 "VERIFY_CA" => Self::VerifyCa,
15416 _ => Self::UnknownValue(ssl_option::UnknownValue(
15417 wkt::internal::UnknownEnumValue::String(value.to_string()),
15418 )),
15419 }
15420 }
15421 }
15422
15423 impl serde::ser::Serialize for SslOption {
15424 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15425 where
15426 S: serde::Serializer,
15427 {
15428 match self {
15429 Self::Unspecified => serializer.serialize_i32(0),
15430 Self::Disable => serializer.serialize_i32(1),
15431 Self::Require => serializer.serialize_i32(2),
15432 Self::VerifyCa => serializer.serialize_i32(3),
15433 Self::UnknownValue(u) => u.0.serialize(serializer),
15434 }
15435 }
15436 }
15437
15438 impl<'de> serde::de::Deserialize<'de> for SslOption {
15439 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15440 where
15441 D: serde::Deserializer<'de>,
15442 {
15443 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
15444 ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
15445 ))
15446 }
15447 }
15448}
15449
15450/// Read-replica configuration for connecting to the primary instance.
15451#[derive(Clone, Default, PartialEq)]
15452#[non_exhaustive]
15453pub struct ReplicaConfiguration {
15454 /// This is always `sql#replicaConfiguration`.
15455 pub kind: std::string::String,
15456
15457 /// MySQL specific configuration when replicating from a MySQL on-premises
15458 /// primary instance. Replication configuration information such as the
15459 /// username, password, certificates, and keys are not stored in the instance
15460 /// metadata. The configuration information is used only to set up the
15461 /// replication connection and is stored by MySQL in a file named
15462 /// `master.info` in the data directory.
15463 pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
15464
15465 /// Specifies if the replica is the failover target. If the field is set to
15466 /// `true`, the replica will be designated as a failover replica. In case the
15467 /// primary instance fails, the replica instance will be promoted as the new
15468 /// primary instance. Only one replica can be specified as failover target, and
15469 /// the replica has to be in different zone with the primary instance.
15470 pub failover_target: std::option::Option<wkt::BoolValue>,
15471
15472 /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
15473 /// cascadable replica is a SQL Server cross region replica that supports
15474 /// replica(s) under it.
15475 pub cascadable_replica: std::option::Option<wkt::BoolValue>,
15476
15477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15478}
15479
15480impl ReplicaConfiguration {
15481 pub fn new() -> Self {
15482 std::default::Default::default()
15483 }
15484
15485 /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
15486 ///
15487 /// # Example
15488 /// ```ignore,no_run
15489 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15490 /// let x = ReplicaConfiguration::new().set_kind("example");
15491 /// ```
15492 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15493 self.kind = v.into();
15494 self
15495 }
15496
15497 /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15498 ///
15499 /// # Example
15500 /// ```ignore,no_run
15501 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15502 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15503 /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
15504 /// ```
15505 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
15506 where
15507 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15508 {
15509 self.mysql_replica_configuration = std::option::Option::Some(v.into());
15510 self
15511 }
15512
15513 /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15514 ///
15515 /// # Example
15516 /// ```ignore,no_run
15517 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15518 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15519 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
15520 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
15521 /// ```
15522 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15523 where
15524 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15525 {
15526 self.mysql_replica_configuration = v.map(|x| x.into());
15527 self
15528 }
15529
15530 /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15531 ///
15532 /// # Example
15533 /// ```ignore,no_run
15534 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15535 /// use wkt::BoolValue;
15536 /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
15537 /// ```
15538 pub fn set_failover_target<T>(mut self, v: T) -> Self
15539 where
15540 T: std::convert::Into<wkt::BoolValue>,
15541 {
15542 self.failover_target = std::option::Option::Some(v.into());
15543 self
15544 }
15545
15546 /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15547 ///
15548 /// # Example
15549 /// ```ignore,no_run
15550 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15551 /// use wkt::BoolValue;
15552 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
15553 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
15554 /// ```
15555 pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
15556 where
15557 T: std::convert::Into<wkt::BoolValue>,
15558 {
15559 self.failover_target = v.map(|x| x.into());
15560 self
15561 }
15562
15563 /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15564 ///
15565 /// # Example
15566 /// ```ignore,no_run
15567 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15568 /// use wkt::BoolValue;
15569 /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
15570 /// ```
15571 pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
15572 where
15573 T: std::convert::Into<wkt::BoolValue>,
15574 {
15575 self.cascadable_replica = std::option::Option::Some(v.into());
15576 self
15577 }
15578
15579 /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15580 ///
15581 /// # Example
15582 /// ```ignore,no_run
15583 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15584 /// use wkt::BoolValue;
15585 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
15586 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
15587 /// ```
15588 pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
15589 where
15590 T: std::convert::Into<wkt::BoolValue>,
15591 {
15592 self.cascadable_replica = v.map(|x| x.into());
15593 self
15594 }
15595}
15596
15597impl wkt::message::Message for ReplicaConfiguration {
15598 fn typename() -> &'static str {
15599 "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
15600 }
15601}
15602
15603/// Execute SQL statements request.
15604#[derive(Clone, Default, PartialEq)]
15605#[non_exhaustive]
15606pub struct SqlInstancesExecuteSqlRequest {
15607 /// Required. Database instance ID. This does not include the project ID.
15608 pub instance: std::string::String,
15609
15610 /// Required. Project ID of the project that contains the instance.
15611 pub project: std::string::String,
15612
15613 /// The request body.
15614 pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
15615
15616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15617}
15618
15619impl SqlInstancesExecuteSqlRequest {
15620 pub fn new() -> Self {
15621 std::default::Default::default()
15622 }
15623
15624 /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
15625 ///
15626 /// # Example
15627 /// ```ignore,no_run
15628 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15629 /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
15630 /// ```
15631 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15632 self.instance = v.into();
15633 self
15634 }
15635
15636 /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
15637 ///
15638 /// # Example
15639 /// ```ignore,no_run
15640 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15641 /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
15642 /// ```
15643 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15644 self.project = v.into();
15645 self
15646 }
15647
15648 /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15649 ///
15650 /// # Example
15651 /// ```ignore,no_run
15652 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15653 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15654 /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
15655 /// ```
15656 pub fn set_body<T>(mut self, v: T) -> Self
15657 where
15658 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15659 {
15660 self.body = std::option::Option::Some(v.into());
15661 self
15662 }
15663
15664 /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15665 ///
15666 /// # Example
15667 /// ```ignore,no_run
15668 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15669 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15670 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
15671 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
15672 /// ```
15673 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15674 where
15675 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15676 {
15677 self.body = v.map(|x| x.into());
15678 self
15679 }
15680}
15681
15682impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
15683 fn typename() -> &'static str {
15684 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
15685 }
15686}
15687
15688/// The request payload used to execute SQL statements.
15689#[derive(Clone, Default, PartialEq)]
15690#[non_exhaustive]
15691pub struct ExecuteSqlPayload {
15692 /// Optional. The name of an existing database user to connect to the database.
15693 /// When `auto_iam_authn` is set to true, this field is ignored and the API
15694 /// caller's IAM user is used.
15695 pub user: std::string::String,
15696
15697 /// Required. SQL statements to run on the database. It can be a single
15698 /// statement or a sequence of statements separated by semicolons.
15699 pub sql_statement: std::string::String,
15700
15701 /// Optional. Name of the database on which the statement will be executed.
15702 pub database: std::string::String,
15703
15704 /// Optional. The maximum number of rows returned per SQL statement.
15705 pub row_limit: i64,
15706
15707 /// Optional. Controls how the API should respond when the SQL execution result
15708 /// is incomplete due to the size limit or another error. The default mode is
15709 /// to throw an error.
15710 pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
15711
15712 /// Optional. Specifies the name of the application that is making the request.
15713 /// This field is used for telemetry. Only alphanumeric characters, dashes, and
15714 /// underscores are allowed. The maximum length is 32 characters.
15715 pub application: std::string::String,
15716
15717 /// Credentials for the database connection.
15718 pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
15719
15720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15721}
15722
15723impl ExecuteSqlPayload {
15724 pub fn new() -> Self {
15725 std::default::Default::default()
15726 }
15727
15728 /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
15729 ///
15730 /// # Example
15731 /// ```ignore,no_run
15732 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15733 /// let x = ExecuteSqlPayload::new().set_user("example");
15734 /// ```
15735 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15736 self.user = v.into();
15737 self
15738 }
15739
15740 /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
15741 ///
15742 /// # Example
15743 /// ```ignore,no_run
15744 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15745 /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
15746 /// ```
15747 pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15748 self.sql_statement = v.into();
15749 self
15750 }
15751
15752 /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
15753 ///
15754 /// # Example
15755 /// ```ignore,no_run
15756 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15757 /// let x = ExecuteSqlPayload::new().set_database("example");
15758 /// ```
15759 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15760 self.database = v.into();
15761 self
15762 }
15763
15764 /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
15765 ///
15766 /// # Example
15767 /// ```ignore,no_run
15768 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15769 /// let x = ExecuteSqlPayload::new().set_row_limit(42);
15770 /// ```
15771 pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15772 self.row_limit = v.into();
15773 self
15774 }
15775
15776 /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
15777 ///
15778 /// # Example
15779 /// ```ignore,no_run
15780 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15781 /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
15782 /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
15783 /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
15784 /// ```
15785 pub fn set_partial_result_mode<
15786 T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
15787 >(
15788 mut self,
15789 v: T,
15790 ) -> Self {
15791 self.partial_result_mode = v.into();
15792 self
15793 }
15794
15795 /// Sets the value of [application][crate::model::ExecuteSqlPayload::application].
15796 ///
15797 /// # Example
15798 /// ```ignore,no_run
15799 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15800 /// let x = ExecuteSqlPayload::new().set_application("example");
15801 /// ```
15802 pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15803 self.application = v.into();
15804 self
15805 }
15806
15807 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
15808 ///
15809 /// Note that all the setters affecting `user_password` are mutually
15810 /// exclusive.
15811 ///
15812 /// # Example
15813 /// ```ignore,no_run
15814 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15815 /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
15816 /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::AutoIamAuthn(true)));
15817 /// ```
15818 pub fn set_user_password<
15819 T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
15820 >(
15821 mut self,
15822 v: T,
15823 ) -> Self {
15824 self.user_password = v.into();
15825 self
15826 }
15827
15828 /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15829 /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
15830 /// holds a different branch.
15831 pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
15832 #[allow(unreachable_patterns)]
15833 self.user_password.as_ref().and_then(|v| match v {
15834 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
15835 std::option::Option::Some(v)
15836 }
15837 _ => std::option::Option::None,
15838 })
15839 }
15840
15841 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15842 /// to hold a `AutoIamAuthn`.
15843 ///
15844 /// Note that all the setters affecting `user_password` are
15845 /// mutually exclusive.
15846 ///
15847 /// # Example
15848 /// ```ignore,no_run
15849 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15850 /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
15851 /// assert!(x.auto_iam_authn().is_some());
15852 /// ```
15853 pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15854 self.user_password = std::option::Option::Some(
15855 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
15856 );
15857 self
15858 }
15859}
15860
15861impl wkt::message::Message for ExecuteSqlPayload {
15862 fn typename() -> &'static str {
15863 "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
15864 }
15865}
15866
15867/// Defines additional types related to [ExecuteSqlPayload].
15868pub mod execute_sql_payload {
15869 #[allow(unused_imports)]
15870 use super::*;
15871
15872 /// Controls how the API should respond when the SQL execution result exceeds
15873 /// 10 MB.
15874 ///
15875 /// # Working with unknown values
15876 ///
15877 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15878 /// additional enum variants at any time. Adding new variants is not considered
15879 /// a breaking change. Applications should write their code in anticipation of:
15880 ///
15881 /// - New values appearing in future releases of the client library, **and**
15882 /// - New values received dynamically, without application changes.
15883 ///
15884 /// Please consult the [Working with enums] section in the user guide for some
15885 /// guidelines.
15886 ///
15887 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15888 #[derive(Clone, Debug, PartialEq)]
15889 #[non_exhaustive]
15890 pub enum PartialResultMode {
15891 /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
15892 Unspecified,
15893 /// Throw an error if the result exceeds 10 MB or if only a partial result
15894 /// can be retrieved. Don't return the result.
15895 FailPartialResult,
15896 /// Return a truncated result and set `partial_result` to true if the result
15897 /// exceeds 10 MB or if only a partial result can be retrieved due to error.
15898 /// Don't throw an error.
15899 AllowPartialResult,
15900 /// If set, the enum was initialized with an unknown value.
15901 ///
15902 /// Applications can examine the value using [PartialResultMode::value] or
15903 /// [PartialResultMode::name].
15904 UnknownValue(partial_result_mode::UnknownValue),
15905 }
15906
15907 #[doc(hidden)]
15908 pub mod partial_result_mode {
15909 #[allow(unused_imports)]
15910 use super::*;
15911 #[derive(Clone, Debug, PartialEq)]
15912 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15913 }
15914
15915 impl PartialResultMode {
15916 /// Gets the enum value.
15917 ///
15918 /// Returns `None` if the enum contains an unknown value deserialized from
15919 /// the string representation of enums.
15920 pub fn value(&self) -> std::option::Option<i32> {
15921 match self {
15922 Self::Unspecified => std::option::Option::Some(0),
15923 Self::FailPartialResult => std::option::Option::Some(1),
15924 Self::AllowPartialResult => std::option::Option::Some(2),
15925 Self::UnknownValue(u) => u.0.value(),
15926 }
15927 }
15928
15929 /// Gets the enum value as a string.
15930 ///
15931 /// Returns `None` if the enum contains an unknown value deserialized from
15932 /// the integer representation of enums.
15933 pub fn name(&self) -> std::option::Option<&str> {
15934 match self {
15935 Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
15936 Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
15937 Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
15938 Self::UnknownValue(u) => u.0.name(),
15939 }
15940 }
15941 }
15942
15943 impl std::default::Default for PartialResultMode {
15944 fn default() -> Self {
15945 use std::convert::From;
15946 Self::from(0)
15947 }
15948 }
15949
15950 impl std::fmt::Display for PartialResultMode {
15951 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15952 wkt::internal::display_enum(f, self.name(), self.value())
15953 }
15954 }
15955
15956 impl std::convert::From<i32> for PartialResultMode {
15957 fn from(value: i32) -> Self {
15958 match value {
15959 0 => Self::Unspecified,
15960 1 => Self::FailPartialResult,
15961 2 => Self::AllowPartialResult,
15962 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
15963 wkt::internal::UnknownEnumValue::Integer(value),
15964 )),
15965 }
15966 }
15967 }
15968
15969 impl std::convert::From<&str> for PartialResultMode {
15970 fn from(value: &str) -> Self {
15971 use std::string::ToString;
15972 match value {
15973 "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
15974 "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
15975 "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
15976 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
15977 wkt::internal::UnknownEnumValue::String(value.to_string()),
15978 )),
15979 }
15980 }
15981 }
15982
15983 impl serde::ser::Serialize for PartialResultMode {
15984 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15985 where
15986 S: serde::Serializer,
15987 {
15988 match self {
15989 Self::Unspecified => serializer.serialize_i32(0),
15990 Self::FailPartialResult => serializer.serialize_i32(1),
15991 Self::AllowPartialResult => serializer.serialize_i32(2),
15992 Self::UnknownValue(u) => u.0.serialize(serializer),
15993 }
15994 }
15995 }
15996
15997 impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
15998 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15999 where
16000 D: serde::Deserializer<'de>,
16001 {
16002 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
16003 ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
16004 ))
16005 }
16006 }
16007
16008 /// Credentials for the database connection.
16009 #[derive(Clone, Debug, PartialEq)]
16010 #[non_exhaustive]
16011 pub enum UserPassword {
16012 /// Optional. When set to true, the API caller identity associated with the
16013 /// request is used for database authentication. The API caller must be an
16014 /// IAM user in the database.
16015 AutoIamAuthn(bool),
16016 }
16017}
16018
16019/// Execute SQL statements response.
16020#[derive(Clone, Default, PartialEq)]
16021#[non_exhaustive]
16022pub struct SqlInstancesExecuteSqlResponse {
16023 /// A list of notices and warnings generated during query execution.
16024 /// For PostgreSQL, this includes all notices and warnings.
16025 /// For MySQL, this includes warnings generated by the last executed statement.
16026 /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
16027 /// be executed after each statement.
16028 pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
16029
16030 /// The additional metadata information regarding the execution of the SQL
16031 /// statements.
16032 pub metadata: std::option::Option<crate::model::Metadata>,
16033
16034 /// The list of results after executing all the SQL statements.
16035 pub results: std::vec::Vec<crate::model::QueryResult>,
16036
16037 /// Contains the error from the database if the SQL execution failed.
16038 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16039
16040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16041}
16042
16043impl SqlInstancesExecuteSqlResponse {
16044 pub fn new() -> Self {
16045 std::default::Default::default()
16046 }
16047
16048 /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
16049 ///
16050 /// # Example
16051 /// ```ignore,no_run
16052 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16053 /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16054 /// let x = SqlInstancesExecuteSqlResponse::new()
16055 /// .set_messages([
16056 /// Message::default()/* use setters */,
16057 /// Message::default()/* use (different) setters */,
16058 /// ]);
16059 /// ```
16060 pub fn set_messages<T, V>(mut self, v: T) -> Self
16061 where
16062 T: std::iter::IntoIterator<Item = V>,
16063 V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
16064 {
16065 use std::iter::Iterator;
16066 self.messages = v.into_iter().map(|i| i.into()).collect();
16067 self
16068 }
16069
16070 /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16071 ///
16072 /// # Example
16073 /// ```ignore,no_run
16074 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16075 /// use google_cloud_sql_v1::model::Metadata;
16076 /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
16077 /// ```
16078 pub fn set_metadata<T>(mut self, v: T) -> Self
16079 where
16080 T: std::convert::Into<crate::model::Metadata>,
16081 {
16082 self.metadata = std::option::Option::Some(v.into());
16083 self
16084 }
16085
16086 /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16087 ///
16088 /// # Example
16089 /// ```ignore,no_run
16090 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16091 /// use google_cloud_sql_v1::model::Metadata;
16092 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
16093 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
16094 /// ```
16095 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16096 where
16097 T: std::convert::Into<crate::model::Metadata>,
16098 {
16099 self.metadata = v.map(|x| x.into());
16100 self
16101 }
16102
16103 /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
16104 ///
16105 /// # Example
16106 /// ```ignore,no_run
16107 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16108 /// use google_cloud_sql_v1::model::QueryResult;
16109 /// let x = SqlInstancesExecuteSqlResponse::new()
16110 /// .set_results([
16111 /// QueryResult::default()/* use setters */,
16112 /// QueryResult::default()/* use (different) setters */,
16113 /// ]);
16114 /// ```
16115 pub fn set_results<T, V>(mut self, v: T) -> Self
16116 where
16117 T: std::iter::IntoIterator<Item = V>,
16118 V: std::convert::Into<crate::model::QueryResult>,
16119 {
16120 use std::iter::Iterator;
16121 self.results = v.into_iter().map(|i| i.into()).collect();
16122 self
16123 }
16124
16125 /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16126 ///
16127 /// # Example
16128 /// ```ignore,no_run
16129 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16130 /// use google_cloud_rpc::model::Status;
16131 /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
16132 /// ```
16133 pub fn set_status<T>(mut self, v: T) -> Self
16134 where
16135 T: std::convert::Into<google_cloud_rpc::model::Status>,
16136 {
16137 self.status = std::option::Option::Some(v.into());
16138 self
16139 }
16140
16141 /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16142 ///
16143 /// # Example
16144 /// ```ignore,no_run
16145 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16146 /// use google_cloud_rpc::model::Status;
16147 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
16148 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
16149 /// ```
16150 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16151 where
16152 T: std::convert::Into<google_cloud_rpc::model::Status>,
16153 {
16154 self.status = v.map(|x| x.into());
16155 self
16156 }
16157}
16158
16159impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
16160 fn typename() -> &'static str {
16161 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
16162 }
16163}
16164
16165/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
16166pub mod sql_instances_execute_sql_response {
16167 #[allow(unused_imports)]
16168 use super::*;
16169
16170 /// Represents a notice or warning message from the database.
16171 #[derive(Clone, Default, PartialEq)]
16172 #[non_exhaustive]
16173 pub struct Message {
16174 /// The full message string.
16175 /// For PostgreSQL, this is a formatted string that may include severity,
16176 /// code, and the notice/warning message.
16177 /// For MySQL, this contains the warning message.
16178 pub message: std::option::Option<std::string::String>,
16179
16180 /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
16181 /// MySQL).
16182 pub severity: std::option::Option<std::string::String>,
16183
16184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16185 }
16186
16187 impl Message {
16188 pub fn new() -> Self {
16189 std::default::Default::default()
16190 }
16191
16192 /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16193 ///
16194 /// # Example
16195 /// ```ignore,no_run
16196 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16197 /// let x = Message::new().set_message("example");
16198 /// ```
16199 pub fn set_message<T>(mut self, v: T) -> Self
16200 where
16201 T: std::convert::Into<std::string::String>,
16202 {
16203 self.message = std::option::Option::Some(v.into());
16204 self
16205 }
16206
16207 /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16208 ///
16209 /// # Example
16210 /// ```ignore,no_run
16211 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16212 /// let x = Message::new().set_or_clear_message(Some("example"));
16213 /// let x = Message::new().set_or_clear_message(None::<String>);
16214 /// ```
16215 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
16216 where
16217 T: std::convert::Into<std::string::String>,
16218 {
16219 self.message = v.map(|x| x.into());
16220 self
16221 }
16222
16223 /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16224 ///
16225 /// # Example
16226 /// ```ignore,no_run
16227 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16228 /// let x = Message::new().set_severity("example");
16229 /// ```
16230 pub fn set_severity<T>(mut self, v: T) -> Self
16231 where
16232 T: std::convert::Into<std::string::String>,
16233 {
16234 self.severity = std::option::Option::Some(v.into());
16235 self
16236 }
16237
16238 /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16239 ///
16240 /// # Example
16241 /// ```ignore,no_run
16242 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16243 /// let x = Message::new().set_or_clear_severity(Some("example"));
16244 /// let x = Message::new().set_or_clear_severity(None::<String>);
16245 /// ```
16246 pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
16247 where
16248 T: std::convert::Into<std::string::String>,
16249 {
16250 self.severity = v.map(|x| x.into());
16251 self
16252 }
16253 }
16254
16255 impl wkt::message::Message for Message {
16256 fn typename() -> &'static str {
16257 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
16258 }
16259 }
16260}
16261
16262/// QueryResult contains the result of executing a single SQL statement.
16263#[derive(Clone, Default, PartialEq)]
16264#[non_exhaustive]
16265pub struct QueryResult {
16266 /// List of columns included in the result. This also includes the data type
16267 /// of the column.
16268 pub columns: std::vec::Vec<crate::model::Column>,
16269
16270 /// Rows returned by the SQL statement.
16271 pub rows: std::vec::Vec<crate::model::Row>,
16272
16273 /// Message related to the SQL execution result.
16274 pub message: std::string::String,
16275
16276 /// Set to true if the SQL execution's result is truncated due to size limits
16277 /// or an error retrieving results.
16278 pub partial_result: bool,
16279
16280 /// If results were truncated due to an error, details of that error.
16281 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16282
16283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16284}
16285
16286impl QueryResult {
16287 pub fn new() -> Self {
16288 std::default::Default::default()
16289 }
16290
16291 /// Sets the value of [columns][crate::model::QueryResult::columns].
16292 ///
16293 /// # Example
16294 /// ```ignore,no_run
16295 /// # use google_cloud_sql_v1::model::QueryResult;
16296 /// use google_cloud_sql_v1::model::Column;
16297 /// let x = QueryResult::new()
16298 /// .set_columns([
16299 /// Column::default()/* use setters */,
16300 /// Column::default()/* use (different) setters */,
16301 /// ]);
16302 /// ```
16303 pub fn set_columns<T, V>(mut self, v: T) -> Self
16304 where
16305 T: std::iter::IntoIterator<Item = V>,
16306 V: std::convert::Into<crate::model::Column>,
16307 {
16308 use std::iter::Iterator;
16309 self.columns = v.into_iter().map(|i| i.into()).collect();
16310 self
16311 }
16312
16313 /// Sets the value of [rows][crate::model::QueryResult::rows].
16314 ///
16315 /// # Example
16316 /// ```ignore,no_run
16317 /// # use google_cloud_sql_v1::model::QueryResult;
16318 /// use google_cloud_sql_v1::model::Row;
16319 /// let x = QueryResult::new()
16320 /// .set_rows([
16321 /// Row::default()/* use setters */,
16322 /// Row::default()/* use (different) setters */,
16323 /// ]);
16324 /// ```
16325 pub fn set_rows<T, V>(mut self, v: T) -> Self
16326 where
16327 T: std::iter::IntoIterator<Item = V>,
16328 V: std::convert::Into<crate::model::Row>,
16329 {
16330 use std::iter::Iterator;
16331 self.rows = v.into_iter().map(|i| i.into()).collect();
16332 self
16333 }
16334
16335 /// Sets the value of [message][crate::model::QueryResult::message].
16336 ///
16337 /// # Example
16338 /// ```ignore,no_run
16339 /// # use google_cloud_sql_v1::model::QueryResult;
16340 /// let x = QueryResult::new().set_message("example");
16341 /// ```
16342 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16343 self.message = v.into();
16344 self
16345 }
16346
16347 /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
16348 ///
16349 /// # Example
16350 /// ```ignore,no_run
16351 /// # use google_cloud_sql_v1::model::QueryResult;
16352 /// let x = QueryResult::new().set_partial_result(true);
16353 /// ```
16354 pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16355 self.partial_result = v.into();
16356 self
16357 }
16358
16359 /// Sets the value of [status][crate::model::QueryResult::status].
16360 ///
16361 /// # Example
16362 /// ```ignore,no_run
16363 /// # use google_cloud_sql_v1::model::QueryResult;
16364 /// use google_cloud_rpc::model::Status;
16365 /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
16366 /// ```
16367 pub fn set_status<T>(mut self, v: T) -> Self
16368 where
16369 T: std::convert::Into<google_cloud_rpc::model::Status>,
16370 {
16371 self.status = std::option::Option::Some(v.into());
16372 self
16373 }
16374
16375 /// Sets or clears the value of [status][crate::model::QueryResult::status].
16376 ///
16377 /// # Example
16378 /// ```ignore,no_run
16379 /// # use google_cloud_sql_v1::model::QueryResult;
16380 /// use google_cloud_rpc::model::Status;
16381 /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
16382 /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
16383 /// ```
16384 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16385 where
16386 T: std::convert::Into<google_cloud_rpc::model::Status>,
16387 {
16388 self.status = v.map(|x| x.into());
16389 self
16390 }
16391}
16392
16393impl wkt::message::Message for QueryResult {
16394 fn typename() -> &'static str {
16395 "type.googleapis.com/google.cloud.sql.v1.QueryResult"
16396 }
16397}
16398
16399/// Contains the name and datatype of a column.
16400#[derive(Clone, Default, PartialEq)]
16401#[non_exhaustive]
16402pub struct Column {
16403 /// Name of the column.
16404 pub name: std::string::String,
16405
16406 /// Datatype of the column.
16407 pub r#type: std::string::String,
16408
16409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16410}
16411
16412impl Column {
16413 pub fn new() -> Self {
16414 std::default::Default::default()
16415 }
16416
16417 /// Sets the value of [name][crate::model::Column::name].
16418 ///
16419 /// # Example
16420 /// ```ignore,no_run
16421 /// # use google_cloud_sql_v1::model::Column;
16422 /// let x = Column::new().set_name("example");
16423 /// ```
16424 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16425 self.name = v.into();
16426 self
16427 }
16428
16429 /// Sets the value of [r#type][crate::model::Column::type].
16430 ///
16431 /// # Example
16432 /// ```ignore,no_run
16433 /// # use google_cloud_sql_v1::model::Column;
16434 /// let x = Column::new().set_type("example");
16435 /// ```
16436 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16437 self.r#type = v.into();
16438 self
16439 }
16440}
16441
16442impl wkt::message::Message for Column {
16443 fn typename() -> &'static str {
16444 "type.googleapis.com/google.cloud.sql.v1.Column"
16445 }
16446}
16447
16448/// Contains the values for a row.
16449#[derive(Clone, Default, PartialEq)]
16450#[non_exhaustive]
16451pub struct Row {
16452 /// The values for the row.
16453 pub values: std::vec::Vec<crate::model::Value>,
16454
16455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16456}
16457
16458impl Row {
16459 pub fn new() -> Self {
16460 std::default::Default::default()
16461 }
16462
16463 /// Sets the value of [values][crate::model::Row::values].
16464 ///
16465 /// # Example
16466 /// ```ignore,no_run
16467 /// # use google_cloud_sql_v1::model::Row;
16468 /// use google_cloud_sql_v1::model::Value;
16469 /// let x = Row::new()
16470 /// .set_values([
16471 /// Value::default()/* use setters */,
16472 /// Value::default()/* use (different) setters */,
16473 /// ]);
16474 /// ```
16475 pub fn set_values<T, V>(mut self, v: T) -> Self
16476 where
16477 T: std::iter::IntoIterator<Item = V>,
16478 V: std::convert::Into<crate::model::Value>,
16479 {
16480 use std::iter::Iterator;
16481 self.values = v.into_iter().map(|i| i.into()).collect();
16482 self
16483 }
16484}
16485
16486impl wkt::message::Message for Row {
16487 fn typename() -> &'static str {
16488 "type.googleapis.com/google.cloud.sql.v1.Row"
16489 }
16490}
16491
16492/// The cell value of the table.
16493#[derive(Clone, Default, PartialEq)]
16494#[non_exhaustive]
16495pub struct Value {
16496 /// The cell value in string format.
16497 pub value: std::string::String,
16498
16499 /// If cell value is null, then this flag will be set to true.
16500 pub null_value: bool,
16501
16502 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16503}
16504
16505impl Value {
16506 pub fn new() -> Self {
16507 std::default::Default::default()
16508 }
16509
16510 /// Sets the value of [value][crate::model::Value::value].
16511 ///
16512 /// # Example
16513 /// ```ignore,no_run
16514 /// # use google_cloud_sql_v1::model::Value;
16515 /// let x = Value::new().set_value("example");
16516 /// ```
16517 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16518 self.value = v.into();
16519 self
16520 }
16521
16522 /// Sets the value of [null_value][crate::model::Value::null_value].
16523 ///
16524 /// # Example
16525 /// ```ignore,no_run
16526 /// # use google_cloud_sql_v1::model::Value;
16527 /// let x = Value::new().set_null_value(true);
16528 /// ```
16529 pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16530 self.null_value = v.into();
16531 self
16532 }
16533}
16534
16535impl wkt::message::Message for Value {
16536 fn typename() -> &'static str {
16537 "type.googleapis.com/google.cloud.sql.v1.Value"
16538 }
16539}
16540
16541/// The additional metadata information regarding the execution of the SQL
16542/// statements.
16543#[derive(Clone, Default, PartialEq)]
16544#[non_exhaustive]
16545pub struct Metadata {
16546 /// The time taken to execute the SQL statements.
16547 pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
16548
16549 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16550}
16551
16552impl Metadata {
16553 pub fn new() -> Self {
16554 std::default::Default::default()
16555 }
16556
16557 /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16558 ///
16559 /// # Example
16560 /// ```ignore,no_run
16561 /// # use google_cloud_sql_v1::model::Metadata;
16562 /// use wkt::Duration;
16563 /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
16564 /// ```
16565 pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
16566 where
16567 T: std::convert::Into<wkt::Duration>,
16568 {
16569 self.sql_statement_execution_time = std::option::Option::Some(v.into());
16570 self
16571 }
16572
16573 /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16574 ///
16575 /// # Example
16576 /// ```ignore,no_run
16577 /// # use google_cloud_sql_v1::model::Metadata;
16578 /// use wkt::Duration;
16579 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
16580 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
16581 /// ```
16582 pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
16583 where
16584 T: std::convert::Into<wkt::Duration>,
16585 {
16586 self.sql_statement_execution_time = v.map(|x| x.into());
16587 self
16588 }
16589}
16590
16591impl wkt::message::Message for Metadata {
16592 fn typename() -> &'static str {
16593 "type.googleapis.com/google.cloud.sql.v1.Metadata"
16594 }
16595}
16596
16597/// Request to acquire a lease for SSRS.
16598#[derive(Clone, Default, PartialEq)]
16599#[non_exhaustive]
16600pub struct SqlInstancesAcquireSsrsLeaseRequest {
16601 /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
16602 /// composed of lowercase letters, numbers, and hyphens, and it must start with
16603 /// a letter. The total length must be 98 characters or less (Example:
16604 /// instance-id).
16605 pub instance: std::string::String,
16606
16607 /// Required. Project ID of the project that contains the instance (Example:
16608 /// project-id).
16609 pub project: std::string::String,
16610
16611 /// Required. The request body.
16612 pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
16613
16614 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16615}
16616
16617impl SqlInstancesAcquireSsrsLeaseRequest {
16618 pub fn new() -> Self {
16619 std::default::Default::default()
16620 }
16621
16622 /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
16623 ///
16624 /// # Example
16625 /// ```ignore,no_run
16626 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16627 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
16628 /// ```
16629 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16630 self.instance = v.into();
16631 self
16632 }
16633
16634 /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
16635 ///
16636 /// # Example
16637 /// ```ignore,no_run
16638 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16639 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
16640 /// ```
16641 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16642 self.project = v.into();
16643 self
16644 }
16645
16646 /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16647 ///
16648 /// # Example
16649 /// ```ignore,no_run
16650 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16651 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16652 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
16653 /// ```
16654 pub fn set_body<T>(mut self, v: T) -> Self
16655 where
16656 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16657 {
16658 self.body = std::option::Option::Some(v.into());
16659 self
16660 }
16661
16662 /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16663 ///
16664 /// # Example
16665 /// ```ignore,no_run
16666 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16667 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16668 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
16669 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
16670 /// ```
16671 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16672 where
16673 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16674 {
16675 self.body = v.map(|x| x.into());
16676 self
16677 }
16678}
16679
16680impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
16681 fn typename() -> &'static str {
16682 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
16683 }
16684}
16685
16686/// Response for the acquire SSRS lease request.
16687#[derive(Clone, Default, PartialEq)]
16688#[non_exhaustive]
16689pub struct SqlInstancesAcquireSsrsLeaseResponse {
16690 /// The unique identifier for this operation.
16691 pub operation_id: std::string::String,
16692
16693 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16694}
16695
16696impl SqlInstancesAcquireSsrsLeaseResponse {
16697 pub fn new() -> Self {
16698 std::default::Default::default()
16699 }
16700
16701 /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
16702 ///
16703 /// # Example
16704 /// ```ignore,no_run
16705 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
16706 /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
16707 /// ```
16708 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16709 self.operation_id = v.into();
16710 self
16711 }
16712}
16713
16714impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
16715 fn typename() -> &'static str {
16716 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
16717 }
16718}
16719
16720/// Request to release a lease for SSRS.
16721#[derive(Clone, Default, PartialEq)]
16722#[non_exhaustive]
16723pub struct SqlInstancesReleaseSsrsLeaseRequest {
16724 /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
16725 /// The instance ID contains lowercase letters, numbers, and hyphens, and it
16726 /// must start with a letter. This ID can have a maximum length of 98
16727 /// characters.
16728 pub instance: std::string::String,
16729
16730 /// Required. The project ID that contains the instance.
16731 pub project: std::string::String,
16732
16733 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16734}
16735
16736impl SqlInstancesReleaseSsrsLeaseRequest {
16737 pub fn new() -> Self {
16738 std::default::Default::default()
16739 }
16740
16741 /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
16742 ///
16743 /// # Example
16744 /// ```ignore,no_run
16745 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16746 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
16747 /// ```
16748 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16749 self.instance = v.into();
16750 self
16751 }
16752
16753 /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
16754 ///
16755 /// # Example
16756 /// ```ignore,no_run
16757 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16758 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
16759 /// ```
16760 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16761 self.project = v.into();
16762 self
16763 }
16764}
16765
16766impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
16767 fn typename() -> &'static str {
16768 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
16769 }
16770}
16771
16772/// Response for the release SSRS lease request.
16773#[derive(Clone, Default, PartialEq)]
16774#[non_exhaustive]
16775pub struct SqlInstancesReleaseSsrsLeaseResponse {
16776 /// The unique identifier for this operation.
16777 pub operation_id: std::string::String,
16778
16779 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16780}
16781
16782impl SqlInstancesReleaseSsrsLeaseResponse {
16783 pub fn new() -> Self {
16784 std::default::Default::default()
16785 }
16786
16787 /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
16788 ///
16789 /// # Example
16790 /// ```ignore,no_run
16791 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
16792 /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
16793 /// ```
16794 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16795 self.operation_id = v.into();
16796 self
16797 }
16798}
16799
16800impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
16801 fn typename() -> &'static str {
16802 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
16803 }
16804}
16805
16806/// Request to perform a point in time restore on a Google Cloud Backup and
16807/// Disaster Recovery managed instance.
16808#[derive(Clone, Default, PartialEq)]
16809#[non_exhaustive]
16810pub struct SqlInstancesPointInTimeRestoreRequest {
16811 /// Required. The parent resource where you created this instance.
16812 /// Format: projects/{project}
16813 pub parent: std::string::String,
16814
16815 /// Required. The context for request to perform a PITR on a Google Cloud
16816 /// Backup and Disaster Recovery managed instance.
16817 pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
16818
16819 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16820}
16821
16822impl SqlInstancesPointInTimeRestoreRequest {
16823 pub fn new() -> Self {
16824 std::default::Default::default()
16825 }
16826
16827 /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
16828 ///
16829 /// # Example
16830 /// ```ignore,no_run
16831 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16832 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
16833 /// ```
16834 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16835 self.parent = v.into();
16836 self
16837 }
16838
16839 /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
16840 ///
16841 /// # Example
16842 /// ```ignore,no_run
16843 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16844 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
16845 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
16846 /// ```
16847 pub fn set_context<T>(mut self, v: T) -> Self
16848 where
16849 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
16850 {
16851 self.context = std::option::Option::Some(v.into());
16852 self
16853 }
16854
16855 /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
16856 ///
16857 /// # Example
16858 /// ```ignore,no_run
16859 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16860 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
16861 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
16862 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
16863 /// ```
16864 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
16865 where
16866 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
16867 {
16868 self.context = v.map(|x| x.into());
16869 self
16870 }
16871}
16872
16873impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
16874 fn typename() -> &'static str {
16875 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
16876 }
16877}
16878
16879/// Operations get request.
16880#[derive(Clone, Default, PartialEq)]
16881#[non_exhaustive]
16882pub struct SqlOperationsGetRequest {
16883 /// Required. Instance operation ID.
16884 pub operation: std::string::String,
16885
16886 /// Required. Project ID of the project that contains the instance.
16887 pub project: std::string::String,
16888
16889 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16890}
16891
16892impl SqlOperationsGetRequest {
16893 pub fn new() -> Self {
16894 std::default::Default::default()
16895 }
16896
16897 /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
16898 ///
16899 /// # Example
16900 /// ```ignore,no_run
16901 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
16902 /// let x = SqlOperationsGetRequest::new().set_operation("example");
16903 /// ```
16904 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16905 self.operation = v.into();
16906 self
16907 }
16908
16909 /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
16910 ///
16911 /// # Example
16912 /// ```ignore,no_run
16913 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
16914 /// let x = SqlOperationsGetRequest::new().set_project("example");
16915 /// ```
16916 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16917 self.project = v.into();
16918 self
16919 }
16920}
16921
16922impl wkt::message::Message for SqlOperationsGetRequest {
16923 fn typename() -> &'static str {
16924 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
16925 }
16926}
16927
16928/// Operations list request.
16929#[derive(Clone, Default, PartialEq)]
16930#[non_exhaustive]
16931pub struct SqlOperationsListRequest {
16932 /// Cloud SQL instance ID. This does not include the project ID.
16933 pub instance: std::string::String,
16934
16935 /// Maximum number of operations per response.
16936 pub max_results: u32,
16937
16938 /// A previously-returned page token representing part of the larger set of
16939 /// results to view.
16940 pub page_token: std::string::String,
16941
16942 /// Project ID of the project that contains the instance.
16943 pub project: std::string::String,
16944
16945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16946}
16947
16948impl SqlOperationsListRequest {
16949 pub fn new() -> Self {
16950 std::default::Default::default()
16951 }
16952
16953 /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
16954 ///
16955 /// # Example
16956 /// ```ignore,no_run
16957 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16958 /// let x = SqlOperationsListRequest::new().set_instance("example");
16959 /// ```
16960 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16961 self.instance = v.into();
16962 self
16963 }
16964
16965 /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
16966 ///
16967 /// # Example
16968 /// ```ignore,no_run
16969 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16970 /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
16971 /// ```
16972 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
16973 self.max_results = v.into();
16974 self
16975 }
16976
16977 /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
16978 ///
16979 /// # Example
16980 /// ```ignore,no_run
16981 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16982 /// let x = SqlOperationsListRequest::new().set_page_token("example");
16983 /// ```
16984 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16985 self.page_token = v.into();
16986 self
16987 }
16988
16989 /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
16990 ///
16991 /// # Example
16992 /// ```ignore,no_run
16993 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16994 /// let x = SqlOperationsListRequest::new().set_project("example");
16995 /// ```
16996 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16997 self.project = v.into();
16998 self
16999 }
17000}
17001
17002impl wkt::message::Message for SqlOperationsListRequest {
17003 fn typename() -> &'static str {
17004 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
17005 }
17006}
17007
17008/// Operations list response.
17009#[derive(Clone, Default, PartialEq)]
17010#[non_exhaustive]
17011pub struct OperationsListResponse {
17012 /// This is always `sql#operationsList`.
17013 pub kind: std::string::String,
17014
17015 /// List of operation resources.
17016 pub items: std::vec::Vec<crate::model::Operation>,
17017
17018 /// The continuation token, used to page through large result sets. Provide
17019 /// this value in a subsequent request to return the next page of results.
17020 pub next_page_token: std::string::String,
17021
17022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17023}
17024
17025impl OperationsListResponse {
17026 pub fn new() -> Self {
17027 std::default::Default::default()
17028 }
17029
17030 /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
17031 ///
17032 /// # Example
17033 /// ```ignore,no_run
17034 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17035 /// let x = OperationsListResponse::new().set_kind("example");
17036 /// ```
17037 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17038 self.kind = v.into();
17039 self
17040 }
17041
17042 /// Sets the value of [items][crate::model::OperationsListResponse::items].
17043 ///
17044 /// # Example
17045 /// ```ignore,no_run
17046 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17047 /// use google_cloud_sql_v1::model::Operation;
17048 /// let x = OperationsListResponse::new()
17049 /// .set_items([
17050 /// Operation::default()/* use setters */,
17051 /// Operation::default()/* use (different) setters */,
17052 /// ]);
17053 /// ```
17054 pub fn set_items<T, V>(mut self, v: T) -> Self
17055 where
17056 T: std::iter::IntoIterator<Item = V>,
17057 V: std::convert::Into<crate::model::Operation>,
17058 {
17059 use std::iter::Iterator;
17060 self.items = v.into_iter().map(|i| i.into()).collect();
17061 self
17062 }
17063
17064 /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
17065 ///
17066 /// # Example
17067 /// ```ignore,no_run
17068 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17069 /// let x = OperationsListResponse::new().set_next_page_token("example");
17070 /// ```
17071 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17072 self.next_page_token = v.into();
17073 self
17074 }
17075}
17076
17077impl wkt::message::Message for OperationsListResponse {
17078 fn typename() -> &'static str {
17079 "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
17080 }
17081}
17082
17083#[doc(hidden)]
17084impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
17085 type PageItem = crate::model::Operation;
17086
17087 fn items(self) -> std::vec::Vec<Self::PageItem> {
17088 self.items
17089 }
17090
17091 fn next_page_token(&self) -> std::string::String {
17092 use std::clone::Clone;
17093 self.next_page_token.clone()
17094 }
17095}
17096
17097/// Operations cancel request.
17098#[derive(Clone, Default, PartialEq)]
17099#[non_exhaustive]
17100pub struct SqlOperationsCancelRequest {
17101 /// Instance operation ID.
17102 pub operation: std::string::String,
17103
17104 /// Project ID of the project that contains the instance.
17105 pub project: std::string::String,
17106
17107 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17108}
17109
17110impl SqlOperationsCancelRequest {
17111 pub fn new() -> Self {
17112 std::default::Default::default()
17113 }
17114
17115 /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
17116 ///
17117 /// # Example
17118 /// ```ignore,no_run
17119 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17120 /// let x = SqlOperationsCancelRequest::new().set_operation("example");
17121 /// ```
17122 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17123 self.operation = v.into();
17124 self
17125 }
17126
17127 /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
17128 ///
17129 /// # Example
17130 /// ```ignore,no_run
17131 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17132 /// let x = SqlOperationsCancelRequest::new().set_project("example");
17133 /// ```
17134 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17135 self.project = v.into();
17136 self
17137 }
17138}
17139
17140impl wkt::message::Message for SqlOperationsCancelRequest {
17141 fn typename() -> &'static str {
17142 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
17143 }
17144}
17145
17146/// An entry for an Access Control list.
17147#[derive(Clone, Default, PartialEq)]
17148#[non_exhaustive]
17149pub struct AclEntry {
17150 /// The allowlisted value for the access control list.
17151 pub value: std::string::String,
17152
17153 /// The time when this access control entry expires in
17154 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
17155 /// `2012-11-15T16:19:00.094Z`.
17156 pub expiration_time: std::option::Option<wkt::Timestamp>,
17157
17158 /// Optional. A label to identify this entry.
17159 pub name: std::string::String,
17160
17161 /// This is always `sql#aclEntry`.
17162 pub kind: std::string::String,
17163
17164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17165}
17166
17167impl AclEntry {
17168 pub fn new() -> Self {
17169 std::default::Default::default()
17170 }
17171
17172 /// Sets the value of [value][crate::model::AclEntry::value].
17173 ///
17174 /// # Example
17175 /// ```ignore,no_run
17176 /// # use google_cloud_sql_v1::model::AclEntry;
17177 /// let x = AclEntry::new().set_value("example");
17178 /// ```
17179 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17180 self.value = v.into();
17181 self
17182 }
17183
17184 /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
17185 ///
17186 /// # Example
17187 /// ```ignore,no_run
17188 /// # use google_cloud_sql_v1::model::AclEntry;
17189 /// use wkt::Timestamp;
17190 /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
17191 /// ```
17192 pub fn set_expiration_time<T>(mut self, v: T) -> Self
17193 where
17194 T: std::convert::Into<wkt::Timestamp>,
17195 {
17196 self.expiration_time = std::option::Option::Some(v.into());
17197 self
17198 }
17199
17200 /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
17201 ///
17202 /// # Example
17203 /// ```ignore,no_run
17204 /// # use google_cloud_sql_v1::model::AclEntry;
17205 /// use wkt::Timestamp;
17206 /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
17207 /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
17208 /// ```
17209 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
17210 where
17211 T: std::convert::Into<wkt::Timestamp>,
17212 {
17213 self.expiration_time = v.map(|x| x.into());
17214 self
17215 }
17216
17217 /// Sets the value of [name][crate::model::AclEntry::name].
17218 ///
17219 /// # Example
17220 /// ```ignore,no_run
17221 /// # use google_cloud_sql_v1::model::AclEntry;
17222 /// let x = AclEntry::new().set_name("example");
17223 /// ```
17224 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17225 self.name = v.into();
17226 self
17227 }
17228
17229 /// Sets the value of [kind][crate::model::AclEntry::kind].
17230 ///
17231 /// # Example
17232 /// ```ignore,no_run
17233 /// # use google_cloud_sql_v1::model::AclEntry;
17234 /// let x = AclEntry::new().set_kind("example");
17235 /// ```
17236 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17237 self.kind = v.into();
17238 self
17239 }
17240}
17241
17242impl wkt::message::Message for AclEntry {
17243 fn typename() -> &'static str {
17244 "type.googleapis.com/google.cloud.sql.v1.AclEntry"
17245 }
17246}
17247
17248/// An Admin API warning message.
17249#[derive(Clone, Default, PartialEq)]
17250#[non_exhaustive]
17251pub struct ApiWarning {
17252 /// Code to uniquely identify the warning type.
17253 pub code: crate::model::api_warning::SqlApiWarningCode,
17254
17255 /// The warning message.
17256 pub message: std::string::String,
17257
17258 /// The region name for REGION_UNREACHABLE warning.
17259 pub region: std::string::String,
17260
17261 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17262}
17263
17264impl ApiWarning {
17265 pub fn new() -> Self {
17266 std::default::Default::default()
17267 }
17268
17269 /// Sets the value of [code][crate::model::ApiWarning::code].
17270 ///
17271 /// # Example
17272 /// ```ignore,no_run
17273 /// # use google_cloud_sql_v1::model::ApiWarning;
17274 /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
17275 /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
17276 /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
17277 /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
17278 /// ```
17279 pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
17280 mut self,
17281 v: T,
17282 ) -> Self {
17283 self.code = v.into();
17284 self
17285 }
17286
17287 /// Sets the value of [message][crate::model::ApiWarning::message].
17288 ///
17289 /// # Example
17290 /// ```ignore,no_run
17291 /// # use google_cloud_sql_v1::model::ApiWarning;
17292 /// let x = ApiWarning::new().set_message("example");
17293 /// ```
17294 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17295 self.message = v.into();
17296 self
17297 }
17298
17299 /// Sets the value of [region][crate::model::ApiWarning::region].
17300 ///
17301 /// # Example
17302 /// ```ignore,no_run
17303 /// # use google_cloud_sql_v1::model::ApiWarning;
17304 /// let x = ApiWarning::new().set_region("example");
17305 /// ```
17306 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17307 self.region = v.into();
17308 self
17309 }
17310}
17311
17312impl wkt::message::Message for ApiWarning {
17313 fn typename() -> &'static str {
17314 "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
17315 }
17316}
17317
17318/// Defines additional types related to [ApiWarning].
17319pub mod api_warning {
17320 #[allow(unused_imports)]
17321 use super::*;
17322
17323 ///
17324 /// # Working with unknown values
17325 ///
17326 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17327 /// additional enum variants at any time. Adding new variants is not considered
17328 /// a breaking change. Applications should write their code in anticipation of:
17329 ///
17330 /// - New values appearing in future releases of the client library, **and**
17331 /// - New values received dynamically, without application changes.
17332 ///
17333 /// Please consult the [Working with enums] section in the user guide for some
17334 /// guidelines.
17335 ///
17336 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17337 #[derive(Clone, Debug, PartialEq)]
17338 #[non_exhaustive]
17339 pub enum SqlApiWarningCode {
17340 /// An unknown or unset warning type from Cloud SQL API.
17341 Unspecified,
17342 /// Warning when one or more regions are not reachable. The returned result
17343 /// set may be incomplete.
17344 RegionUnreachable,
17345 /// Warning when user provided maxResults parameter exceeds the limit. The
17346 /// returned result set may be incomplete.
17347 MaxResultsExceedsLimit,
17348 /// Warning when user tries to create/update a user with credentials that
17349 /// have previously been compromised by a public data breach.
17350 CompromisedCredentials,
17351 /// Warning when the operation succeeds but some non-critical workflow state
17352 /// failed.
17353 InternalStateFailure,
17354 /// If set, the enum was initialized with an unknown value.
17355 ///
17356 /// Applications can examine the value using [SqlApiWarningCode::value] or
17357 /// [SqlApiWarningCode::name].
17358 UnknownValue(sql_api_warning_code::UnknownValue),
17359 }
17360
17361 #[doc(hidden)]
17362 pub mod sql_api_warning_code {
17363 #[allow(unused_imports)]
17364 use super::*;
17365 #[derive(Clone, Debug, PartialEq)]
17366 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17367 }
17368
17369 impl SqlApiWarningCode {
17370 /// Gets the enum value.
17371 ///
17372 /// Returns `None` if the enum contains an unknown value deserialized from
17373 /// the string representation of enums.
17374 pub fn value(&self) -> std::option::Option<i32> {
17375 match self {
17376 Self::Unspecified => std::option::Option::Some(0),
17377 Self::RegionUnreachable => std::option::Option::Some(1),
17378 Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
17379 Self::CompromisedCredentials => std::option::Option::Some(3),
17380 Self::InternalStateFailure => std::option::Option::Some(4),
17381 Self::UnknownValue(u) => u.0.value(),
17382 }
17383 }
17384
17385 /// Gets the enum value as a string.
17386 ///
17387 /// Returns `None` if the enum contains an unknown value deserialized from
17388 /// the integer representation of enums.
17389 pub fn name(&self) -> std::option::Option<&str> {
17390 match self {
17391 Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
17392 Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
17393 Self::MaxResultsExceedsLimit => {
17394 std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
17395 }
17396 Self::CompromisedCredentials => {
17397 std::option::Option::Some("COMPROMISED_CREDENTIALS")
17398 }
17399 Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
17400 Self::UnknownValue(u) => u.0.name(),
17401 }
17402 }
17403 }
17404
17405 impl std::default::Default for SqlApiWarningCode {
17406 fn default() -> Self {
17407 use std::convert::From;
17408 Self::from(0)
17409 }
17410 }
17411
17412 impl std::fmt::Display for SqlApiWarningCode {
17413 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17414 wkt::internal::display_enum(f, self.name(), self.value())
17415 }
17416 }
17417
17418 impl std::convert::From<i32> for SqlApiWarningCode {
17419 fn from(value: i32) -> Self {
17420 match value {
17421 0 => Self::Unspecified,
17422 1 => Self::RegionUnreachable,
17423 2 => Self::MaxResultsExceedsLimit,
17424 3 => Self::CompromisedCredentials,
17425 4 => Self::InternalStateFailure,
17426 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17427 wkt::internal::UnknownEnumValue::Integer(value),
17428 )),
17429 }
17430 }
17431 }
17432
17433 impl std::convert::From<&str> for SqlApiWarningCode {
17434 fn from(value: &str) -> Self {
17435 use std::string::ToString;
17436 match value {
17437 "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
17438 "REGION_UNREACHABLE" => Self::RegionUnreachable,
17439 "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
17440 "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
17441 "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
17442 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17443 wkt::internal::UnknownEnumValue::String(value.to_string()),
17444 )),
17445 }
17446 }
17447 }
17448
17449 impl serde::ser::Serialize for SqlApiWarningCode {
17450 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17451 where
17452 S: serde::Serializer,
17453 {
17454 match self {
17455 Self::Unspecified => serializer.serialize_i32(0),
17456 Self::RegionUnreachable => serializer.serialize_i32(1),
17457 Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
17458 Self::CompromisedCredentials => serializer.serialize_i32(3),
17459 Self::InternalStateFailure => serializer.serialize_i32(4),
17460 Self::UnknownValue(u) => u.0.serialize(serializer),
17461 }
17462 }
17463 }
17464
17465 impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
17466 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17467 where
17468 D: serde::Deserializer<'de>,
17469 {
17470 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
17471 ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
17472 ))
17473 }
17474 }
17475}
17476
17477/// We currently only support backup retention by specifying the number
17478/// of backups we will retain.
17479#[derive(Clone, Default, PartialEq)]
17480#[non_exhaustive]
17481pub struct BackupRetentionSettings {
17482 /// The unit that 'retained_backups' represents.
17483 pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
17484
17485 /// Depending on the value of retention_unit, this is used to determine
17486 /// if a backup needs to be deleted. If retention_unit is 'COUNT', we will
17487 /// retain this many backups.
17488 pub retained_backups: std::option::Option<wkt::Int32Value>,
17489
17490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17491}
17492
17493impl BackupRetentionSettings {
17494 pub fn new() -> Self {
17495 std::default::Default::default()
17496 }
17497
17498 /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
17499 ///
17500 /// # Example
17501 /// ```ignore,no_run
17502 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17503 /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
17504 /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
17505 /// ```
17506 pub fn set_retention_unit<
17507 T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
17508 >(
17509 mut self,
17510 v: T,
17511 ) -> Self {
17512 self.retention_unit = v.into();
17513 self
17514 }
17515
17516 /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17517 ///
17518 /// # Example
17519 /// ```ignore,no_run
17520 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17521 /// use wkt::Int32Value;
17522 /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
17523 /// ```
17524 pub fn set_retained_backups<T>(mut self, v: T) -> Self
17525 where
17526 T: std::convert::Into<wkt::Int32Value>,
17527 {
17528 self.retained_backups = std::option::Option::Some(v.into());
17529 self
17530 }
17531
17532 /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17533 ///
17534 /// # Example
17535 /// ```ignore,no_run
17536 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17537 /// use wkt::Int32Value;
17538 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
17539 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
17540 /// ```
17541 pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
17542 where
17543 T: std::convert::Into<wkt::Int32Value>,
17544 {
17545 self.retained_backups = v.map(|x| x.into());
17546 self
17547 }
17548}
17549
17550impl wkt::message::Message for BackupRetentionSettings {
17551 fn typename() -> &'static str {
17552 "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
17553 }
17554}
17555
17556/// Defines additional types related to [BackupRetentionSettings].
17557pub mod backup_retention_settings {
17558 #[allow(unused_imports)]
17559 use super::*;
17560
17561 /// The units that retained_backups specifies, we only support COUNT.
17562 ///
17563 /// # Working with unknown values
17564 ///
17565 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17566 /// additional enum variants at any time. Adding new variants is not considered
17567 /// a breaking change. Applications should write their code in anticipation of:
17568 ///
17569 /// - New values appearing in future releases of the client library, **and**
17570 /// - New values received dynamically, without application changes.
17571 ///
17572 /// Please consult the [Working with enums] section in the user guide for some
17573 /// guidelines.
17574 ///
17575 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17576 #[derive(Clone, Debug, PartialEq)]
17577 #[non_exhaustive]
17578 pub enum RetentionUnit {
17579 /// Backup retention unit is unspecified, will be treated as COUNT.
17580 Unspecified,
17581 /// Retention will be by count, eg. "retain the most recent 7 backups".
17582 Count,
17583 /// If set, the enum was initialized with an unknown value.
17584 ///
17585 /// Applications can examine the value using [RetentionUnit::value] or
17586 /// [RetentionUnit::name].
17587 UnknownValue(retention_unit::UnknownValue),
17588 }
17589
17590 #[doc(hidden)]
17591 pub mod retention_unit {
17592 #[allow(unused_imports)]
17593 use super::*;
17594 #[derive(Clone, Debug, PartialEq)]
17595 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17596 }
17597
17598 impl RetentionUnit {
17599 /// Gets the enum value.
17600 ///
17601 /// Returns `None` if the enum contains an unknown value deserialized from
17602 /// the string representation of enums.
17603 pub fn value(&self) -> std::option::Option<i32> {
17604 match self {
17605 Self::Unspecified => std::option::Option::Some(0),
17606 Self::Count => std::option::Option::Some(1),
17607 Self::UnknownValue(u) => u.0.value(),
17608 }
17609 }
17610
17611 /// Gets the enum value as a string.
17612 ///
17613 /// Returns `None` if the enum contains an unknown value deserialized from
17614 /// the integer representation of enums.
17615 pub fn name(&self) -> std::option::Option<&str> {
17616 match self {
17617 Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
17618 Self::Count => std::option::Option::Some("COUNT"),
17619 Self::UnknownValue(u) => u.0.name(),
17620 }
17621 }
17622 }
17623
17624 impl std::default::Default for RetentionUnit {
17625 fn default() -> Self {
17626 use std::convert::From;
17627 Self::from(0)
17628 }
17629 }
17630
17631 impl std::fmt::Display for RetentionUnit {
17632 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17633 wkt::internal::display_enum(f, self.name(), self.value())
17634 }
17635 }
17636
17637 impl std::convert::From<i32> for RetentionUnit {
17638 fn from(value: i32) -> Self {
17639 match value {
17640 0 => Self::Unspecified,
17641 1 => Self::Count,
17642 _ => Self::UnknownValue(retention_unit::UnknownValue(
17643 wkt::internal::UnknownEnumValue::Integer(value),
17644 )),
17645 }
17646 }
17647 }
17648
17649 impl std::convert::From<&str> for RetentionUnit {
17650 fn from(value: &str) -> Self {
17651 use std::string::ToString;
17652 match value {
17653 "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
17654 "COUNT" => Self::Count,
17655 _ => Self::UnknownValue(retention_unit::UnknownValue(
17656 wkt::internal::UnknownEnumValue::String(value.to_string()),
17657 )),
17658 }
17659 }
17660 }
17661
17662 impl serde::ser::Serialize for RetentionUnit {
17663 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17664 where
17665 S: serde::Serializer,
17666 {
17667 match self {
17668 Self::Unspecified => serializer.serialize_i32(0),
17669 Self::Count => serializer.serialize_i32(1),
17670 Self::UnknownValue(u) => u.0.serialize(serializer),
17671 }
17672 }
17673 }
17674
17675 impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
17676 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17677 where
17678 D: serde::Deserializer<'de>,
17679 {
17680 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
17681 ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
17682 ))
17683 }
17684 }
17685}
17686
17687/// Database instance backup configuration.
17688#[derive(Clone, Default, PartialEq)]
17689#[non_exhaustive]
17690pub struct BackupConfiguration {
17691 /// Start time for the daily backup configuration in UTC timezone in the 24
17692 /// hour format - `HH:MM`.
17693 pub start_time: std::string::String,
17694
17695 /// Whether this configuration is enabled.
17696 pub enabled: std::option::Option<wkt::BoolValue>,
17697
17698 /// This is always `sql#backupConfiguration`.
17699 pub kind: std::string::String,
17700
17701 /// (MySQL only) Whether binary log is enabled. If backup configuration is
17702 /// disabled, binarylog must be disabled as well.
17703 pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
17704
17705 /// Reserved for future use.
17706 pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
17707
17708 /// Location of the backup
17709 pub location: std::string::String,
17710
17711 /// Whether point in time recovery is enabled.
17712 pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
17713
17714 /// Backup retention settings.
17715 pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
17716
17717 /// The number of days of transaction logs we retain for point in time
17718 /// restore, from 1-7.
17719 pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
17720
17721 /// Output only. This value contains the storage location of transactional logs
17722 /// used to perform point-in-time recovery (PITR) for the database.
17723 pub transactional_log_storage_state:
17724 std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
17725
17726 /// Output only. Backup tier that manages the backups for the instance.
17727 pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
17728
17729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17730}
17731
17732impl BackupConfiguration {
17733 pub fn new() -> Self {
17734 std::default::Default::default()
17735 }
17736
17737 /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
17738 ///
17739 /// # Example
17740 /// ```ignore,no_run
17741 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17742 /// let x = BackupConfiguration::new().set_start_time("example");
17743 /// ```
17744 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17745 self.start_time = v.into();
17746 self
17747 }
17748
17749 /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
17750 ///
17751 /// # Example
17752 /// ```ignore,no_run
17753 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17754 /// use wkt::BoolValue;
17755 /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
17756 /// ```
17757 pub fn set_enabled<T>(mut self, v: T) -> Self
17758 where
17759 T: std::convert::Into<wkt::BoolValue>,
17760 {
17761 self.enabled = std::option::Option::Some(v.into());
17762 self
17763 }
17764
17765 /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
17766 ///
17767 /// # Example
17768 /// ```ignore,no_run
17769 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17770 /// use wkt::BoolValue;
17771 /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
17772 /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
17773 /// ```
17774 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17775 where
17776 T: std::convert::Into<wkt::BoolValue>,
17777 {
17778 self.enabled = v.map(|x| x.into());
17779 self
17780 }
17781
17782 /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
17783 ///
17784 /// # Example
17785 /// ```ignore,no_run
17786 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17787 /// let x = BackupConfiguration::new().set_kind("example");
17788 /// ```
17789 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17790 self.kind = v.into();
17791 self
17792 }
17793
17794 /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17795 ///
17796 /// # Example
17797 /// ```ignore,no_run
17798 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17799 /// use wkt::BoolValue;
17800 /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
17801 /// ```
17802 pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
17803 where
17804 T: std::convert::Into<wkt::BoolValue>,
17805 {
17806 self.binary_log_enabled = std::option::Option::Some(v.into());
17807 self
17808 }
17809
17810 /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17811 ///
17812 /// # Example
17813 /// ```ignore,no_run
17814 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17815 /// use wkt::BoolValue;
17816 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
17817 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
17818 /// ```
17819 pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17820 where
17821 T: std::convert::Into<wkt::BoolValue>,
17822 {
17823 self.binary_log_enabled = v.map(|x| x.into());
17824 self
17825 }
17826
17827 /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
17828 ///
17829 /// # Example
17830 /// ```ignore,no_run
17831 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17832 /// use wkt::BoolValue;
17833 /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
17834 /// ```
17835 pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
17836 where
17837 T: std::convert::Into<wkt::BoolValue>,
17838 {
17839 self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
17840 self
17841 }
17842
17843 /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
17844 ///
17845 /// # Example
17846 /// ```ignore,no_run
17847 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17848 /// use wkt::BoolValue;
17849 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
17850 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
17851 /// ```
17852 pub fn set_or_clear_replication_log_archiving_enabled<T>(
17853 mut self,
17854 v: std::option::Option<T>,
17855 ) -> Self
17856 where
17857 T: std::convert::Into<wkt::BoolValue>,
17858 {
17859 self.replication_log_archiving_enabled = v.map(|x| x.into());
17860 self
17861 }
17862
17863 /// Sets the value of [location][crate::model::BackupConfiguration::location].
17864 ///
17865 /// # Example
17866 /// ```ignore,no_run
17867 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17868 /// let x = BackupConfiguration::new().set_location("example");
17869 /// ```
17870 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17871 self.location = v.into();
17872 self
17873 }
17874
17875 /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
17876 ///
17877 /// # Example
17878 /// ```ignore,no_run
17879 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17880 /// use wkt::BoolValue;
17881 /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
17882 /// ```
17883 pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
17884 where
17885 T: std::convert::Into<wkt::BoolValue>,
17886 {
17887 self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
17888 self
17889 }
17890
17891 /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
17892 ///
17893 /// # Example
17894 /// ```ignore,no_run
17895 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17896 /// use wkt::BoolValue;
17897 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
17898 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
17899 /// ```
17900 pub fn set_or_clear_point_in_time_recovery_enabled<T>(
17901 mut self,
17902 v: std::option::Option<T>,
17903 ) -> Self
17904 where
17905 T: std::convert::Into<wkt::BoolValue>,
17906 {
17907 self.point_in_time_recovery_enabled = v.map(|x| x.into());
17908 self
17909 }
17910
17911 /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
17912 ///
17913 /// # Example
17914 /// ```ignore,no_run
17915 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17916 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
17917 /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
17918 /// ```
17919 pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
17920 where
17921 T: std::convert::Into<crate::model::BackupRetentionSettings>,
17922 {
17923 self.backup_retention_settings = std::option::Option::Some(v.into());
17924 self
17925 }
17926
17927 /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
17928 ///
17929 /// # Example
17930 /// ```ignore,no_run
17931 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17932 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
17933 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
17934 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
17935 /// ```
17936 pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
17937 where
17938 T: std::convert::Into<crate::model::BackupRetentionSettings>,
17939 {
17940 self.backup_retention_settings = v.map(|x| x.into());
17941 self
17942 }
17943
17944 /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
17945 ///
17946 /// # Example
17947 /// ```ignore,no_run
17948 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17949 /// use wkt::Int32Value;
17950 /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
17951 /// ```
17952 pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
17953 where
17954 T: std::convert::Into<wkt::Int32Value>,
17955 {
17956 self.transaction_log_retention_days = std::option::Option::Some(v.into());
17957 self
17958 }
17959
17960 /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
17961 ///
17962 /// # Example
17963 /// ```ignore,no_run
17964 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17965 /// use wkt::Int32Value;
17966 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
17967 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
17968 /// ```
17969 pub fn set_or_clear_transaction_log_retention_days<T>(
17970 mut self,
17971 v: std::option::Option<T>,
17972 ) -> Self
17973 where
17974 T: std::convert::Into<wkt::Int32Value>,
17975 {
17976 self.transaction_log_retention_days = v.map(|x| x.into());
17977 self
17978 }
17979
17980 /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
17981 ///
17982 /// # Example
17983 /// ```ignore,no_run
17984 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17985 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
17986 /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
17987 /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
17988 /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
17989 /// ```
17990 pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
17991 where
17992 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
17993 {
17994 self.transactional_log_storage_state = std::option::Option::Some(v.into());
17995 self
17996 }
17997
17998 /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
17999 ///
18000 /// # Example
18001 /// ```ignore,no_run
18002 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18003 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18004 /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
18005 /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
18006 /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
18007 /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
18008 /// ```
18009 pub fn set_or_clear_transactional_log_storage_state<T>(
18010 mut self,
18011 v: std::option::Option<T>,
18012 ) -> Self
18013 where
18014 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18015 {
18016 self.transactional_log_storage_state = v.map(|x| x.into());
18017 self
18018 }
18019
18020 /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18021 ///
18022 /// # Example
18023 /// ```ignore,no_run
18024 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18025 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18026 /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
18027 /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
18028 /// ```
18029 pub fn set_backup_tier<T>(mut self, v: T) -> Self
18030 where
18031 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18032 {
18033 self.backup_tier = std::option::Option::Some(v.into());
18034 self
18035 }
18036
18037 /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18038 ///
18039 /// # Example
18040 /// ```ignore,no_run
18041 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18042 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18043 /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
18044 /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
18045 /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
18046 /// ```
18047 pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
18048 where
18049 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18050 {
18051 self.backup_tier = v.map(|x| x.into());
18052 self
18053 }
18054}
18055
18056impl wkt::message::Message for BackupConfiguration {
18057 fn typename() -> &'static str {
18058 "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
18059 }
18060}
18061
18062/// Defines additional types related to [BackupConfiguration].
18063pub mod backup_configuration {
18064 #[allow(unused_imports)]
18065 use super::*;
18066
18067 /// This value contains the storage location of the transactional logs
18068 /// used to perform point-in-time recovery (PITR) for the database.
18069 ///
18070 /// # Working with unknown values
18071 ///
18072 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18073 /// additional enum variants at any time. Adding new variants is not considered
18074 /// a breaking change. Applications should write their code in anticipation of:
18075 ///
18076 /// - New values appearing in future releases of the client library, **and**
18077 /// - New values received dynamically, without application changes.
18078 ///
18079 /// Please consult the [Working with enums] section in the user guide for some
18080 /// guidelines.
18081 ///
18082 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18083 #[derive(Clone, Debug, PartialEq)]
18084 #[non_exhaustive]
18085 pub enum TransactionalLogStorageState {
18086 /// Unspecified.
18087 Unspecified,
18088 /// The transaction logs used for PITR for the instance are stored
18089 /// on a data disk.
18090 Disk,
18091 /// The transaction logs used for PITR for the instance are switching from
18092 /// being stored on a data disk to being stored in Cloud Storage.
18093 /// Only applicable to MySQL.
18094 SwitchingToCloudStorage,
18095 /// The transaction logs used for PITR for the instance are now stored
18096 /// in Cloud Storage. Previously, they were stored on a data disk.
18097 /// Only applicable to MySQL.
18098 SwitchedToCloudStorage,
18099 /// The transaction logs used for PITR for the instance are stored in
18100 /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
18101 CloudStorage,
18102 /// If set, the enum was initialized with an unknown value.
18103 ///
18104 /// Applications can examine the value using [TransactionalLogStorageState::value] or
18105 /// [TransactionalLogStorageState::name].
18106 UnknownValue(transactional_log_storage_state::UnknownValue),
18107 }
18108
18109 #[doc(hidden)]
18110 pub mod transactional_log_storage_state {
18111 #[allow(unused_imports)]
18112 use super::*;
18113 #[derive(Clone, Debug, PartialEq)]
18114 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18115 }
18116
18117 impl TransactionalLogStorageState {
18118 /// Gets the enum value.
18119 ///
18120 /// Returns `None` if the enum contains an unknown value deserialized from
18121 /// the string representation of enums.
18122 pub fn value(&self) -> std::option::Option<i32> {
18123 match self {
18124 Self::Unspecified => std::option::Option::Some(0),
18125 Self::Disk => std::option::Option::Some(1),
18126 Self::SwitchingToCloudStorage => std::option::Option::Some(2),
18127 Self::SwitchedToCloudStorage => std::option::Option::Some(3),
18128 Self::CloudStorage => std::option::Option::Some(4),
18129 Self::UnknownValue(u) => u.0.value(),
18130 }
18131 }
18132
18133 /// Gets the enum value as a string.
18134 ///
18135 /// Returns `None` if the enum contains an unknown value deserialized from
18136 /// the integer representation of enums.
18137 pub fn name(&self) -> std::option::Option<&str> {
18138 match self {
18139 Self::Unspecified => {
18140 std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
18141 }
18142 Self::Disk => std::option::Option::Some("DISK"),
18143 Self::SwitchingToCloudStorage => {
18144 std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
18145 }
18146 Self::SwitchedToCloudStorage => {
18147 std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
18148 }
18149 Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
18150 Self::UnknownValue(u) => u.0.name(),
18151 }
18152 }
18153 }
18154
18155 impl std::default::Default for TransactionalLogStorageState {
18156 fn default() -> Self {
18157 use std::convert::From;
18158 Self::from(0)
18159 }
18160 }
18161
18162 impl std::fmt::Display for TransactionalLogStorageState {
18163 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18164 wkt::internal::display_enum(f, self.name(), self.value())
18165 }
18166 }
18167
18168 impl std::convert::From<i32> for TransactionalLogStorageState {
18169 fn from(value: i32) -> Self {
18170 match value {
18171 0 => Self::Unspecified,
18172 1 => Self::Disk,
18173 2 => Self::SwitchingToCloudStorage,
18174 3 => Self::SwitchedToCloudStorage,
18175 4 => Self::CloudStorage,
18176 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18177 wkt::internal::UnknownEnumValue::Integer(value),
18178 )),
18179 }
18180 }
18181 }
18182
18183 impl std::convert::From<&str> for TransactionalLogStorageState {
18184 fn from(value: &str) -> Self {
18185 use std::string::ToString;
18186 match value {
18187 "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
18188 "DISK" => Self::Disk,
18189 "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
18190 "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
18191 "CLOUD_STORAGE" => Self::CloudStorage,
18192 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18193 wkt::internal::UnknownEnumValue::String(value.to_string()),
18194 )),
18195 }
18196 }
18197 }
18198
18199 impl serde::ser::Serialize for TransactionalLogStorageState {
18200 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18201 where
18202 S: serde::Serializer,
18203 {
18204 match self {
18205 Self::Unspecified => serializer.serialize_i32(0),
18206 Self::Disk => serializer.serialize_i32(1),
18207 Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
18208 Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
18209 Self::CloudStorage => serializer.serialize_i32(4),
18210 Self::UnknownValue(u) => u.0.serialize(serializer),
18211 }
18212 }
18213 }
18214
18215 impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
18216 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18217 where
18218 D: serde::Deserializer<'de>,
18219 {
18220 deserializer.deserialize_any(
18221 wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
18222 ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
18223 ),
18224 )
18225 }
18226 }
18227
18228 /// Backup tier that manages the backups for the instance.
18229 ///
18230 /// # Working with unknown values
18231 ///
18232 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18233 /// additional enum variants at any time. Adding new variants is not considered
18234 /// a breaking change. Applications should write their code in anticipation of:
18235 ///
18236 /// - New values appearing in future releases of the client library, **and**
18237 /// - New values received dynamically, without application changes.
18238 ///
18239 /// Please consult the [Working with enums] section in the user guide for some
18240 /// guidelines.
18241 ///
18242 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18243 #[derive(Clone, Debug, PartialEq)]
18244 #[non_exhaustive]
18245 pub enum BackupTier {
18246 /// Unspecified.
18247 Unspecified,
18248 /// Instance is managed by Cloud SQL.
18249 Standard,
18250 /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
18251 #[deprecated]
18252 Advanced,
18253 /// Instance is managed by Google Cloud Backup and DR Service.
18254 Enhanced,
18255 /// If set, the enum was initialized with an unknown value.
18256 ///
18257 /// Applications can examine the value using [BackupTier::value] or
18258 /// [BackupTier::name].
18259 UnknownValue(backup_tier::UnknownValue),
18260 }
18261
18262 #[doc(hidden)]
18263 pub mod backup_tier {
18264 #[allow(unused_imports)]
18265 use super::*;
18266 #[derive(Clone, Debug, PartialEq)]
18267 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18268 }
18269
18270 impl BackupTier {
18271 /// Gets the enum value.
18272 ///
18273 /// Returns `None` if the enum contains an unknown value deserialized from
18274 /// the string representation of enums.
18275 pub fn value(&self) -> std::option::Option<i32> {
18276 match self {
18277 Self::Unspecified => std::option::Option::Some(0),
18278 Self::Standard => std::option::Option::Some(1),
18279 Self::Advanced => std::option::Option::Some(2),
18280 Self::Enhanced => std::option::Option::Some(3),
18281 Self::UnknownValue(u) => u.0.value(),
18282 }
18283 }
18284
18285 /// Gets the enum value as a string.
18286 ///
18287 /// Returns `None` if the enum contains an unknown value deserialized from
18288 /// the integer representation of enums.
18289 pub fn name(&self) -> std::option::Option<&str> {
18290 match self {
18291 Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
18292 Self::Standard => std::option::Option::Some("STANDARD"),
18293 Self::Advanced => std::option::Option::Some("ADVANCED"),
18294 Self::Enhanced => std::option::Option::Some("ENHANCED"),
18295 Self::UnknownValue(u) => u.0.name(),
18296 }
18297 }
18298 }
18299
18300 impl std::default::Default for BackupTier {
18301 fn default() -> Self {
18302 use std::convert::From;
18303 Self::from(0)
18304 }
18305 }
18306
18307 impl std::fmt::Display for BackupTier {
18308 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18309 wkt::internal::display_enum(f, self.name(), self.value())
18310 }
18311 }
18312
18313 impl std::convert::From<i32> for BackupTier {
18314 fn from(value: i32) -> Self {
18315 match value {
18316 0 => Self::Unspecified,
18317 1 => Self::Standard,
18318 2 => Self::Advanced,
18319 3 => Self::Enhanced,
18320 _ => Self::UnknownValue(backup_tier::UnknownValue(
18321 wkt::internal::UnknownEnumValue::Integer(value),
18322 )),
18323 }
18324 }
18325 }
18326
18327 impl std::convert::From<&str> for BackupTier {
18328 fn from(value: &str) -> Self {
18329 use std::string::ToString;
18330 match value {
18331 "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
18332 "STANDARD" => Self::Standard,
18333 "ADVANCED" => Self::Advanced,
18334 "ENHANCED" => Self::Enhanced,
18335 _ => Self::UnknownValue(backup_tier::UnknownValue(
18336 wkt::internal::UnknownEnumValue::String(value.to_string()),
18337 )),
18338 }
18339 }
18340 }
18341
18342 impl serde::ser::Serialize for BackupTier {
18343 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18344 where
18345 S: serde::Serializer,
18346 {
18347 match self {
18348 Self::Unspecified => serializer.serialize_i32(0),
18349 Self::Standard => serializer.serialize_i32(1),
18350 Self::Advanced => serializer.serialize_i32(2),
18351 Self::Enhanced => serializer.serialize_i32(3),
18352 Self::UnknownValue(u) => u.0.serialize(serializer),
18353 }
18354 }
18355 }
18356
18357 impl<'de> serde::de::Deserialize<'de> for BackupTier {
18358 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18359 where
18360 D: serde::Deserializer<'de>,
18361 {
18362 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
18363 ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
18364 ))
18365 }
18366 }
18367}
18368
18369/// Perform disk shrink context.
18370#[derive(Clone, Default, PartialEq)]
18371#[non_exhaustive]
18372pub struct PerformDiskShrinkContext {
18373 /// The target disk shrink size in GigaBytes.
18374 pub target_size_gb: i64,
18375
18376 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18377}
18378
18379impl PerformDiskShrinkContext {
18380 pub fn new() -> Self {
18381 std::default::Default::default()
18382 }
18383
18384 /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
18385 ///
18386 /// # Example
18387 /// ```ignore,no_run
18388 /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
18389 /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
18390 /// ```
18391 pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18392 self.target_size_gb = v.into();
18393 self
18394 }
18395}
18396
18397impl wkt::message::Message for PerformDiskShrinkContext {
18398 fn typename() -> &'static str {
18399 "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
18400 }
18401}
18402
18403/// Structured PreCheckResponse containing message, type, and required
18404/// actions.
18405#[derive(Clone, Default, PartialEq)]
18406#[non_exhaustive]
18407pub struct PreCheckResponse {
18408 /// The message to be displayed to the user.
18409 pub message: std::option::Option<std::string::String>,
18410
18411 /// The type of message whether it is an info, warning, or error.
18412 pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
18413
18414 /// The actions that the user needs to take. Use repeated for multiple
18415 /// actions.
18416 pub actions_required: std::vec::Vec<std::string::String>,
18417
18418 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18419}
18420
18421impl PreCheckResponse {
18422 pub fn new() -> Self {
18423 std::default::Default::default()
18424 }
18425
18426 /// Sets the value of [message][crate::model::PreCheckResponse::message].
18427 ///
18428 /// # Example
18429 /// ```ignore,no_run
18430 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18431 /// let x = PreCheckResponse::new().set_message("example");
18432 /// ```
18433 pub fn set_message<T>(mut self, v: T) -> Self
18434 where
18435 T: std::convert::Into<std::string::String>,
18436 {
18437 self.message = std::option::Option::Some(v.into());
18438 self
18439 }
18440
18441 /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
18442 ///
18443 /// # Example
18444 /// ```ignore,no_run
18445 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18446 /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
18447 /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
18448 /// ```
18449 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
18450 where
18451 T: std::convert::Into<std::string::String>,
18452 {
18453 self.message = v.map(|x| x.into());
18454 self
18455 }
18456
18457 /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
18458 ///
18459 /// # Example
18460 /// ```ignore,no_run
18461 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18462 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18463 /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
18464 /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
18465 /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
18466 /// ```
18467 pub fn set_message_type<T>(mut self, v: T) -> Self
18468 where
18469 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18470 {
18471 self.message_type = std::option::Option::Some(v.into());
18472 self
18473 }
18474
18475 /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
18476 ///
18477 /// # Example
18478 /// ```ignore,no_run
18479 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18480 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18481 /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
18482 /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
18483 /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
18484 /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
18485 /// ```
18486 pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
18487 where
18488 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18489 {
18490 self.message_type = v.map(|x| x.into());
18491 self
18492 }
18493
18494 /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
18495 ///
18496 /// # Example
18497 /// ```ignore,no_run
18498 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18499 /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
18500 /// ```
18501 pub fn set_actions_required<T, V>(mut self, v: T) -> Self
18502 where
18503 T: std::iter::IntoIterator<Item = V>,
18504 V: std::convert::Into<std::string::String>,
18505 {
18506 use std::iter::Iterator;
18507 self.actions_required = v.into_iter().map(|i| i.into()).collect();
18508 self
18509 }
18510}
18511
18512impl wkt::message::Message for PreCheckResponse {
18513 fn typename() -> &'static str {
18514 "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
18515 }
18516}
18517
18518/// Defines additional types related to [PreCheckResponse].
18519pub mod pre_check_response {
18520 #[allow(unused_imports)]
18521 use super::*;
18522
18523 /// The type of message which can be an info, a warning, or an error that
18524 /// requires user intervention.
18525 ///
18526 /// # Working with unknown values
18527 ///
18528 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18529 /// additional enum variants at any time. Adding new variants is not considered
18530 /// a breaking change. Applications should write their code in anticipation of:
18531 ///
18532 /// - New values appearing in future releases of the client library, **and**
18533 /// - New values received dynamically, without application changes.
18534 ///
18535 /// Please consult the [Working with enums] section in the user guide for some
18536 /// guidelines.
18537 ///
18538 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18539 #[derive(Clone, Debug, PartialEq)]
18540 #[non_exhaustive]
18541 pub enum MessageType {
18542 /// Default unspecified value to prevent unintended behavior changes.
18543 Unspecified,
18544 /// General informational messages that don't require action.
18545 Info,
18546 /// Warnings that might impact the upgrade but don't block it.
18547 Warning,
18548 /// Errors that a user must resolve before proceeding with the upgrade.
18549 Error,
18550 /// If set, the enum was initialized with an unknown value.
18551 ///
18552 /// Applications can examine the value using [MessageType::value] or
18553 /// [MessageType::name].
18554 UnknownValue(message_type::UnknownValue),
18555 }
18556
18557 #[doc(hidden)]
18558 pub mod message_type {
18559 #[allow(unused_imports)]
18560 use super::*;
18561 #[derive(Clone, Debug, PartialEq)]
18562 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18563 }
18564
18565 impl MessageType {
18566 /// Gets the enum value.
18567 ///
18568 /// Returns `None` if the enum contains an unknown value deserialized from
18569 /// the string representation of enums.
18570 pub fn value(&self) -> std::option::Option<i32> {
18571 match self {
18572 Self::Unspecified => std::option::Option::Some(0),
18573 Self::Info => std::option::Option::Some(1),
18574 Self::Warning => std::option::Option::Some(2),
18575 Self::Error => std::option::Option::Some(3),
18576 Self::UnknownValue(u) => u.0.value(),
18577 }
18578 }
18579
18580 /// Gets the enum value as a string.
18581 ///
18582 /// Returns `None` if the enum contains an unknown value deserialized from
18583 /// the integer representation of enums.
18584 pub fn name(&self) -> std::option::Option<&str> {
18585 match self {
18586 Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
18587 Self::Info => std::option::Option::Some("INFO"),
18588 Self::Warning => std::option::Option::Some("WARNING"),
18589 Self::Error => std::option::Option::Some("ERROR"),
18590 Self::UnknownValue(u) => u.0.name(),
18591 }
18592 }
18593 }
18594
18595 impl std::default::Default for MessageType {
18596 fn default() -> Self {
18597 use std::convert::From;
18598 Self::from(0)
18599 }
18600 }
18601
18602 impl std::fmt::Display for MessageType {
18603 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18604 wkt::internal::display_enum(f, self.name(), self.value())
18605 }
18606 }
18607
18608 impl std::convert::From<i32> for MessageType {
18609 fn from(value: i32) -> Self {
18610 match value {
18611 0 => Self::Unspecified,
18612 1 => Self::Info,
18613 2 => Self::Warning,
18614 3 => Self::Error,
18615 _ => Self::UnknownValue(message_type::UnknownValue(
18616 wkt::internal::UnknownEnumValue::Integer(value),
18617 )),
18618 }
18619 }
18620 }
18621
18622 impl std::convert::From<&str> for MessageType {
18623 fn from(value: &str) -> Self {
18624 use std::string::ToString;
18625 match value {
18626 "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
18627 "INFO" => Self::Info,
18628 "WARNING" => Self::Warning,
18629 "ERROR" => Self::Error,
18630 _ => Self::UnknownValue(message_type::UnknownValue(
18631 wkt::internal::UnknownEnumValue::String(value.to_string()),
18632 )),
18633 }
18634 }
18635 }
18636
18637 impl serde::ser::Serialize for MessageType {
18638 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18639 where
18640 S: serde::Serializer,
18641 {
18642 match self {
18643 Self::Unspecified => serializer.serialize_i32(0),
18644 Self::Info => serializer.serialize_i32(1),
18645 Self::Warning => serializer.serialize_i32(2),
18646 Self::Error => serializer.serialize_i32(3),
18647 Self::UnknownValue(u) => u.0.serialize(serializer),
18648 }
18649 }
18650 }
18651
18652 impl<'de> serde::de::Deserialize<'de> for MessageType {
18653 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18654 where
18655 D: serde::Deserializer<'de>,
18656 {
18657 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
18658 ".google.cloud.sql.v1.PreCheckResponse.MessageType",
18659 ))
18660 }
18661 }
18662}
18663
18664/// Pre-check major version upgrade context.
18665#[derive(Clone, Default, PartialEq)]
18666#[non_exhaustive]
18667pub struct PreCheckMajorVersionUpgradeContext {
18668 /// Required. The target database version to upgrade to.
18669 pub target_database_version: crate::model::SqlDatabaseVersion,
18670
18671 /// Output only. The responses from the precheck operation.
18672 pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
18673
18674 /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
18675 pub kind: std::string::String,
18676
18677 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18678}
18679
18680impl PreCheckMajorVersionUpgradeContext {
18681 pub fn new() -> Self {
18682 std::default::Default::default()
18683 }
18684
18685 /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
18686 ///
18687 /// # Example
18688 /// ```ignore,no_run
18689 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18690 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
18691 /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
18692 /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
18693 /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
18694 /// ```
18695 pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
18696 mut self,
18697 v: T,
18698 ) -> Self {
18699 self.target_database_version = v.into();
18700 self
18701 }
18702
18703 /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
18704 ///
18705 /// # Example
18706 /// ```ignore,no_run
18707 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18708 /// use google_cloud_sql_v1::model::PreCheckResponse;
18709 /// let x = PreCheckMajorVersionUpgradeContext::new()
18710 /// .set_pre_check_response([
18711 /// PreCheckResponse::default()/* use setters */,
18712 /// PreCheckResponse::default()/* use (different) setters */,
18713 /// ]);
18714 /// ```
18715 pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
18716 where
18717 T: std::iter::IntoIterator<Item = V>,
18718 V: std::convert::Into<crate::model::PreCheckResponse>,
18719 {
18720 use std::iter::Iterator;
18721 self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
18722 self
18723 }
18724
18725 /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
18726 ///
18727 /// # Example
18728 /// ```ignore,no_run
18729 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18730 /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
18731 /// ```
18732 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18733 self.kind = v.into();
18734 self
18735 }
18736}
18737
18738impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
18739 fn typename() -> &'static str {
18740 "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
18741 }
18742}
18743
18744/// Backup context.
18745#[derive(Clone, Default, PartialEq)]
18746#[non_exhaustive]
18747pub struct BackupContext {
18748 /// The identifier of the backup.
18749 pub backup_id: i64,
18750
18751 /// This is always `sql#backupContext`.
18752 pub kind: std::string::String,
18753
18754 /// The name of the backup.
18755 /// Format: projects/{project}/backups/{backup}
18756 pub name: std::string::String,
18757
18758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18759}
18760
18761impl BackupContext {
18762 pub fn new() -> Self {
18763 std::default::Default::default()
18764 }
18765
18766 /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
18767 ///
18768 /// # Example
18769 /// ```ignore,no_run
18770 /// # use google_cloud_sql_v1::model::BackupContext;
18771 /// let x = BackupContext::new().set_backup_id(42);
18772 /// ```
18773 pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18774 self.backup_id = v.into();
18775 self
18776 }
18777
18778 /// Sets the value of [kind][crate::model::BackupContext::kind].
18779 ///
18780 /// # Example
18781 /// ```ignore,no_run
18782 /// # use google_cloud_sql_v1::model::BackupContext;
18783 /// let x = BackupContext::new().set_kind("example");
18784 /// ```
18785 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18786 self.kind = v.into();
18787 self
18788 }
18789
18790 /// Sets the value of [name][crate::model::BackupContext::name].
18791 ///
18792 /// # Example
18793 /// ```ignore,no_run
18794 /// # use google_cloud_sql_v1::model::BackupContext;
18795 /// let x = BackupContext::new().set_name("example");
18796 /// ```
18797 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18798 self.name = v.into();
18799 self
18800 }
18801}
18802
18803impl wkt::message::Message for BackupContext {
18804 fn typename() -> &'static str {
18805 "type.googleapis.com/google.cloud.sql.v1.BackupContext"
18806 }
18807}
18808
18809/// Represents a SQL database on the Cloud SQL instance.
18810#[derive(Clone, Default, PartialEq)]
18811#[non_exhaustive]
18812pub struct Database {
18813 /// This is always `sql#database`.
18814 pub kind: std::string::String,
18815
18816 /// The Cloud SQL charset value.
18817 pub charset: std::string::String,
18818
18819 /// The Cloud SQL collation value.
18820 pub collation: std::string::String,
18821
18822 /// This field is deprecated and will be removed from a future version of the
18823 /// API.
18824 pub etag: std::string::String,
18825
18826 /// The name of the database in the Cloud SQL instance. This does not include
18827 /// the project ID or instance name.
18828 pub name: std::string::String,
18829
18830 /// The name of the Cloud SQL instance. This does not include the project ID.
18831 pub instance: std::string::String,
18832
18833 /// The URI of this resource.
18834 pub self_link: std::string::String,
18835
18836 /// The project ID of the project containing the Cloud SQL database. The Google
18837 /// apps domain is prefixed if applicable.
18838 pub project: std::string::String,
18839
18840 pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
18841
18842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18843}
18844
18845impl Database {
18846 pub fn new() -> Self {
18847 std::default::Default::default()
18848 }
18849
18850 /// Sets the value of [kind][crate::model::Database::kind].
18851 ///
18852 /// # Example
18853 /// ```ignore,no_run
18854 /// # use google_cloud_sql_v1::model::Database;
18855 /// let x = Database::new().set_kind("example");
18856 /// ```
18857 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18858 self.kind = v.into();
18859 self
18860 }
18861
18862 /// Sets the value of [charset][crate::model::Database::charset].
18863 ///
18864 /// # Example
18865 /// ```ignore,no_run
18866 /// # use google_cloud_sql_v1::model::Database;
18867 /// let x = Database::new().set_charset("example");
18868 /// ```
18869 pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18870 self.charset = v.into();
18871 self
18872 }
18873
18874 /// Sets the value of [collation][crate::model::Database::collation].
18875 ///
18876 /// # Example
18877 /// ```ignore,no_run
18878 /// # use google_cloud_sql_v1::model::Database;
18879 /// let x = Database::new().set_collation("example");
18880 /// ```
18881 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18882 self.collation = v.into();
18883 self
18884 }
18885
18886 /// Sets the value of [etag][crate::model::Database::etag].
18887 ///
18888 /// # Example
18889 /// ```ignore,no_run
18890 /// # use google_cloud_sql_v1::model::Database;
18891 /// let x = Database::new().set_etag("example");
18892 /// ```
18893 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18894 self.etag = v.into();
18895 self
18896 }
18897
18898 /// Sets the value of [name][crate::model::Database::name].
18899 ///
18900 /// # Example
18901 /// ```ignore,no_run
18902 /// # use google_cloud_sql_v1::model::Database;
18903 /// let x = Database::new().set_name("example");
18904 /// ```
18905 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18906 self.name = v.into();
18907 self
18908 }
18909
18910 /// Sets the value of [instance][crate::model::Database::instance].
18911 ///
18912 /// # Example
18913 /// ```ignore,no_run
18914 /// # use google_cloud_sql_v1::model::Database;
18915 /// let x = Database::new().set_instance("example");
18916 /// ```
18917 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18918 self.instance = v.into();
18919 self
18920 }
18921
18922 /// Sets the value of [self_link][crate::model::Database::self_link].
18923 ///
18924 /// # Example
18925 /// ```ignore,no_run
18926 /// # use google_cloud_sql_v1::model::Database;
18927 /// let x = Database::new().set_self_link("example");
18928 /// ```
18929 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18930 self.self_link = v.into();
18931 self
18932 }
18933
18934 /// Sets the value of [project][crate::model::Database::project].
18935 ///
18936 /// # Example
18937 /// ```ignore,no_run
18938 /// # use google_cloud_sql_v1::model::Database;
18939 /// let x = Database::new().set_project("example");
18940 /// ```
18941 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18942 self.project = v.into();
18943 self
18944 }
18945
18946 /// Sets the value of [database_details][crate::model::Database::database_details].
18947 ///
18948 /// Note that all the setters affecting `database_details` are mutually
18949 /// exclusive.
18950 ///
18951 /// # Example
18952 /// ```ignore,no_run
18953 /// # use google_cloud_sql_v1::model::Database;
18954 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18955 /// let x = Database::new().set_database_details(Some(
18956 /// google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
18957 /// ```
18958 pub fn set_database_details<
18959 T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
18960 >(
18961 mut self,
18962 v: T,
18963 ) -> Self {
18964 self.database_details = v.into();
18965 self
18966 }
18967
18968 /// The value of [database_details][crate::model::Database::database_details]
18969 /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
18970 /// holds a different branch.
18971 pub fn sqlserver_database_details(
18972 &self,
18973 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
18974 #[allow(unreachable_patterns)]
18975 self.database_details.as_ref().and_then(|v| match v {
18976 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
18977 std::option::Option::Some(v)
18978 }
18979 _ => std::option::Option::None,
18980 })
18981 }
18982
18983 /// Sets the value of [database_details][crate::model::Database::database_details]
18984 /// to hold a `SqlserverDatabaseDetails`.
18985 ///
18986 /// Note that all the setters affecting `database_details` are
18987 /// mutually exclusive.
18988 ///
18989 /// # Example
18990 /// ```ignore,no_run
18991 /// # use google_cloud_sql_v1::model::Database;
18992 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18993 /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
18994 /// assert!(x.sqlserver_database_details().is_some());
18995 /// ```
18996 pub fn set_sqlserver_database_details<
18997 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
18998 >(
18999 mut self,
19000 v: T,
19001 ) -> Self {
19002 self.database_details = std::option::Option::Some(
19003 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
19004 );
19005 self
19006 }
19007}
19008
19009impl wkt::message::Message for Database {
19010 fn typename() -> &'static str {
19011 "type.googleapis.com/google.cloud.sql.v1.Database"
19012 }
19013}
19014
19015/// Defines additional types related to [Database].
19016pub mod database {
19017 #[allow(unused_imports)]
19018 use super::*;
19019
19020 #[derive(Clone, Debug, PartialEq)]
19021 #[non_exhaustive]
19022 pub enum DatabaseDetails {
19023 SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
19024 }
19025}
19026
19027/// Represents a Sql Server database on the Cloud SQL instance.
19028#[derive(Clone, Default, PartialEq)]
19029#[non_exhaustive]
19030pub struct SqlServerDatabaseDetails {
19031 /// The version of SQL Server with which the database is to be made compatible
19032 pub compatibility_level: i32,
19033
19034 /// The recovery model of a SQL Server database
19035 pub recovery_model: std::string::String,
19036
19037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19038}
19039
19040impl SqlServerDatabaseDetails {
19041 pub fn new() -> Self {
19042 std::default::Default::default()
19043 }
19044
19045 /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
19046 ///
19047 /// # Example
19048 /// ```ignore,no_run
19049 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19050 /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
19051 /// ```
19052 pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19053 self.compatibility_level = v.into();
19054 self
19055 }
19056
19057 /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
19058 ///
19059 /// # Example
19060 /// ```ignore,no_run
19061 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19062 /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
19063 /// ```
19064 pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19065 self.recovery_model = v.into();
19066 self
19067 }
19068}
19069
19070impl wkt::message::Message for SqlServerDatabaseDetails {
19071 fn typename() -> &'static str {
19072 "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
19073 }
19074}
19075
19076/// Database flags for Cloud SQL instances.
19077#[derive(Clone, Default, PartialEq)]
19078#[non_exhaustive]
19079pub struct DatabaseFlags {
19080 /// The name of the flag. These flags are passed at instance startup, so
19081 /// include both server options and system variables. Flags are
19082 /// specified with underscores, not hyphens. For more information, see
19083 /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
19084 /// in the Cloud SQL documentation.
19085 pub name: std::string::String,
19086
19087 /// The value of the flag. Boolean flags are set to `on` for true
19088 /// and `off` for false. This field must be omitted if the flag
19089 /// doesn't take a value.
19090 pub value: std::string::String,
19091
19092 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19093}
19094
19095impl DatabaseFlags {
19096 pub fn new() -> Self {
19097 std::default::Default::default()
19098 }
19099
19100 /// Sets the value of [name][crate::model::DatabaseFlags::name].
19101 ///
19102 /// # Example
19103 /// ```ignore,no_run
19104 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19105 /// let x = DatabaseFlags::new().set_name("example");
19106 /// ```
19107 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19108 self.name = v.into();
19109 self
19110 }
19111
19112 /// Sets the value of [value][crate::model::DatabaseFlags::value].
19113 ///
19114 /// # Example
19115 /// ```ignore,no_run
19116 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19117 /// let x = DatabaseFlags::new().set_value("example");
19118 /// ```
19119 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19120 self.value = v.into();
19121 self
19122 }
19123}
19124
19125impl wkt::message::Message for DatabaseFlags {
19126 fn typename() -> &'static str {
19127 "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
19128 }
19129}
19130
19131/// MySQL-specific external server sync settings.
19132#[derive(Clone, Default, PartialEq)]
19133#[non_exhaustive]
19134pub struct MySqlSyncConfig {
19135 /// Flags to use for the initial dump.
19136 pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
19137
19138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19139}
19140
19141impl MySqlSyncConfig {
19142 pub fn new() -> Self {
19143 std::default::Default::default()
19144 }
19145
19146 /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
19147 ///
19148 /// # Example
19149 /// ```ignore,no_run
19150 /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
19151 /// use google_cloud_sql_v1::model::SyncFlags;
19152 /// let x = MySqlSyncConfig::new()
19153 /// .set_initial_sync_flags([
19154 /// SyncFlags::default()/* use setters */,
19155 /// SyncFlags::default()/* use (different) setters */,
19156 /// ]);
19157 /// ```
19158 pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
19159 where
19160 T: std::iter::IntoIterator<Item = V>,
19161 V: std::convert::Into<crate::model::SyncFlags>,
19162 {
19163 use std::iter::Iterator;
19164 self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
19165 self
19166 }
19167}
19168
19169impl wkt::message::Message for MySqlSyncConfig {
19170 fn typename() -> &'static str {
19171 "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
19172 }
19173}
19174
19175/// Initial sync flags for certain Cloud SQL APIs.
19176/// Currently used for the MySQL external server initial dump.
19177#[derive(Clone, Default, PartialEq)]
19178#[non_exhaustive]
19179pub struct SyncFlags {
19180 /// The name of the flag.
19181 pub name: std::string::String,
19182
19183 /// The value of the flag. This field must be omitted if the flag
19184 /// doesn't take a value.
19185 pub value: std::string::String,
19186
19187 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19188}
19189
19190impl SyncFlags {
19191 pub fn new() -> Self {
19192 std::default::Default::default()
19193 }
19194
19195 /// Sets the value of [name][crate::model::SyncFlags::name].
19196 ///
19197 /// # Example
19198 /// ```ignore,no_run
19199 /// # use google_cloud_sql_v1::model::SyncFlags;
19200 /// let x = SyncFlags::new().set_name("example");
19201 /// ```
19202 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19203 self.name = v.into();
19204 self
19205 }
19206
19207 /// Sets the value of [value][crate::model::SyncFlags::value].
19208 ///
19209 /// # Example
19210 /// ```ignore,no_run
19211 /// # use google_cloud_sql_v1::model::SyncFlags;
19212 /// let x = SyncFlags::new().set_value("example");
19213 /// ```
19214 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19215 self.value = v.into();
19216 self
19217 }
19218}
19219
19220impl wkt::message::Message for SyncFlags {
19221 fn typename() -> &'static str {
19222 "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
19223 }
19224}
19225
19226/// Reference to another Cloud SQL instance.
19227#[derive(Clone, Default, PartialEq)]
19228#[non_exhaustive]
19229pub struct InstanceReference {
19230 /// The name of the Cloud SQL instance being referenced.
19231 /// This does not include the project ID.
19232 pub name: std::string::String,
19233
19234 /// The region of the Cloud SQL instance being referenced.
19235 pub region: std::string::String,
19236
19237 /// The project ID of the Cloud SQL instance being referenced.
19238 /// The default is the same project ID as the instance references it.
19239 pub project: std::string::String,
19240
19241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19242}
19243
19244impl InstanceReference {
19245 pub fn new() -> Self {
19246 std::default::Default::default()
19247 }
19248
19249 /// Sets the value of [name][crate::model::InstanceReference::name].
19250 ///
19251 /// # Example
19252 /// ```ignore,no_run
19253 /// # use google_cloud_sql_v1::model::InstanceReference;
19254 /// let x = InstanceReference::new().set_name("example");
19255 /// ```
19256 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19257 self.name = v.into();
19258 self
19259 }
19260
19261 /// Sets the value of [region][crate::model::InstanceReference::region].
19262 ///
19263 /// # Example
19264 /// ```ignore,no_run
19265 /// # use google_cloud_sql_v1::model::InstanceReference;
19266 /// let x = InstanceReference::new().set_region("example");
19267 /// ```
19268 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19269 self.region = v.into();
19270 self
19271 }
19272
19273 /// Sets the value of [project][crate::model::InstanceReference::project].
19274 ///
19275 /// # Example
19276 /// ```ignore,no_run
19277 /// # use google_cloud_sql_v1::model::InstanceReference;
19278 /// let x = InstanceReference::new().set_project("example");
19279 /// ```
19280 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19281 self.project = v.into();
19282 self
19283 }
19284}
19285
19286impl wkt::message::Message for InstanceReference {
19287 fn typename() -> &'static str {
19288 "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
19289 }
19290}
19291
19292/// Read-replica configuration for connecting to the on-premises primary
19293/// instance.
19294#[derive(Clone, Default, PartialEq)]
19295#[non_exhaustive]
19296pub struct DemoteMasterConfiguration {
19297 /// This is always `sql#demoteMasterConfiguration`.
19298 pub kind: std::string::String,
19299
19300 /// MySQL specific configuration when replicating from a MySQL on-premises
19301 /// primary instance. Replication configuration information such as the
19302 /// username, password, certificates, and keys are not stored in the instance
19303 /// metadata. The configuration information is used only to set up the
19304 /// replication connection and is stored by MySQL in a file named
19305 /// `master.info` in the data directory.
19306 pub mysql_replica_configuration:
19307 std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19308
19309 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19310}
19311
19312impl DemoteMasterConfiguration {
19313 pub fn new() -> Self {
19314 std::default::Default::default()
19315 }
19316
19317 /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
19318 ///
19319 /// # Example
19320 /// ```ignore,no_run
19321 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19322 /// let x = DemoteMasterConfiguration::new().set_kind("example");
19323 /// ```
19324 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19325 self.kind = v.into();
19326 self
19327 }
19328
19329 /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19330 ///
19331 /// # Example
19332 /// ```ignore,no_run
19333 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19334 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19335 /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
19336 /// ```
19337 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
19338 where
19339 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19340 {
19341 self.mysql_replica_configuration = std::option::Option::Some(v.into());
19342 self
19343 }
19344
19345 /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19346 ///
19347 /// # Example
19348 /// ```ignore,no_run
19349 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19350 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19351 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
19352 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
19353 /// ```
19354 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
19355 where
19356 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19357 {
19358 self.mysql_replica_configuration = v.map(|x| x.into());
19359 self
19360 }
19361}
19362
19363impl wkt::message::Message for DemoteMasterConfiguration {
19364 fn typename() -> &'static str {
19365 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
19366 }
19367}
19368
19369/// Read-replica configuration specific to MySQL databases.
19370#[derive(Clone, Default, PartialEq)]
19371#[non_exhaustive]
19372pub struct DemoteMasterMySqlReplicaConfiguration {
19373 /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
19374 pub kind: std::string::String,
19375
19376 /// The username for the replication connection.
19377 pub username: std::string::String,
19378
19379 /// The password for the replication connection.
19380 pub password: std::string::String,
19381
19382 /// PEM representation of the replica's private key. The corresponding public
19383 /// key is encoded in the client's certificate. The format of the replica's
19384 /// private key can be either PKCS #1 or PKCS #8.
19385 pub client_key: std::string::String,
19386
19387 /// PEM representation of the replica's x509 certificate.
19388 pub client_certificate: std::string::String,
19389
19390 /// PEM representation of the trusted CA's x509 certificate.
19391 pub ca_certificate: std::string::String,
19392
19393 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19394}
19395
19396impl DemoteMasterMySqlReplicaConfiguration {
19397 pub fn new() -> Self {
19398 std::default::Default::default()
19399 }
19400
19401 /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
19402 ///
19403 /// # Example
19404 /// ```ignore,no_run
19405 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19406 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
19407 /// ```
19408 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19409 self.kind = v.into();
19410 self
19411 }
19412
19413 /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
19414 ///
19415 /// # Example
19416 /// ```ignore,no_run
19417 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19418 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
19419 /// ```
19420 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19421 self.username = v.into();
19422 self
19423 }
19424
19425 /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
19426 ///
19427 /// # Example
19428 /// ```ignore,no_run
19429 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19430 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
19431 /// ```
19432 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19433 self.password = v.into();
19434 self
19435 }
19436
19437 /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
19438 ///
19439 /// # Example
19440 /// ```ignore,no_run
19441 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19442 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
19443 /// ```
19444 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19445 self.client_key = v.into();
19446 self
19447 }
19448
19449 /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
19450 ///
19451 /// # Example
19452 /// ```ignore,no_run
19453 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19454 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
19455 /// ```
19456 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
19457 mut self,
19458 v: T,
19459 ) -> Self {
19460 self.client_certificate = v.into();
19461 self
19462 }
19463
19464 /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
19465 ///
19466 /// # Example
19467 /// ```ignore,no_run
19468 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19469 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
19470 /// ```
19471 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19472 self.ca_certificate = v.into();
19473 self
19474 }
19475}
19476
19477impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
19478 fn typename() -> &'static str {
19479 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
19480 }
19481}
19482
19483/// Database instance export context.
19484#[derive(Clone, Default, PartialEq)]
19485#[non_exhaustive]
19486pub struct ExportContext {
19487 /// The path to the file in Google Cloud Storage where the export will be
19488 /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
19489 /// already exists, the request succeeds, but the operation fails. If
19490 /// `fileType` is `SQL` and the filename ends with .gz,
19491 /// the contents are compressed.
19492 pub uri: std::string::String,
19493
19494 /// Databases to be exported. <br /> `MySQL instances:` If
19495 /// `fileType` is `SQL` and no database is specified, all
19496 /// databases are exported, except for the `mysql` system database.
19497 /// If `fileType` is `CSV`, you can specify one database,
19498 /// either by using this property or by using the
19499 /// `csvExportOptions.selectQuery` property, which takes precedence
19500 /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
19501 /// database by name, all user databases in the instance are exported.
19502 /// This excludes system databases and Cloud SQL databases used to manage
19503 /// internal operations. Exporting all user databases is only available for
19504 /// directory-formatted parallel export. If `fileType` is `CSV`,
19505 /// this database must match the one specified in the
19506 /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
19507 /// instances:` You must specify one database to be exported, and the
19508 /// `fileType` must be `BAK`.
19509 pub databases: std::vec::Vec<std::string::String>,
19510
19511 /// This is always `sql#exportContext`.
19512 pub kind: std::string::String,
19513
19514 /// Options for exporting data as SQL statements.
19515 pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
19516
19517 /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
19518 /// instances only.
19519 pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
19520
19521 /// The file type for the specified uri.
19522 pub file_type: crate::model::SqlFileType,
19523
19524 /// Whether to perform a serverless export.
19525 pub offload: std::option::Option<wkt::BoolValue>,
19526
19527 /// Options for exporting data as BAK files.
19528 pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
19529
19530 /// Optional. Export parameters specific to SQL Server TDE certificates
19531 pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
19532
19533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19534}
19535
19536impl ExportContext {
19537 pub fn new() -> Self {
19538 std::default::Default::default()
19539 }
19540
19541 /// Sets the value of [uri][crate::model::ExportContext::uri].
19542 ///
19543 /// # Example
19544 /// ```ignore,no_run
19545 /// # use google_cloud_sql_v1::model::ExportContext;
19546 /// let x = ExportContext::new().set_uri("example");
19547 /// ```
19548 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19549 self.uri = v.into();
19550 self
19551 }
19552
19553 /// Sets the value of [databases][crate::model::ExportContext::databases].
19554 ///
19555 /// # Example
19556 /// ```ignore,no_run
19557 /// # use google_cloud_sql_v1::model::ExportContext;
19558 /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
19559 /// ```
19560 pub fn set_databases<T, V>(mut self, v: T) -> Self
19561 where
19562 T: std::iter::IntoIterator<Item = V>,
19563 V: std::convert::Into<std::string::String>,
19564 {
19565 use std::iter::Iterator;
19566 self.databases = v.into_iter().map(|i| i.into()).collect();
19567 self
19568 }
19569
19570 /// Sets the value of [kind][crate::model::ExportContext::kind].
19571 ///
19572 /// # Example
19573 /// ```ignore,no_run
19574 /// # use google_cloud_sql_v1::model::ExportContext;
19575 /// let x = ExportContext::new().set_kind("example");
19576 /// ```
19577 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19578 self.kind = v.into();
19579 self
19580 }
19581
19582 /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19583 ///
19584 /// # Example
19585 /// ```ignore,no_run
19586 /// # use google_cloud_sql_v1::model::ExportContext;
19587 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19588 /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
19589 /// ```
19590 pub fn set_sql_export_options<T>(mut self, v: T) -> Self
19591 where
19592 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19593 {
19594 self.sql_export_options = std::option::Option::Some(v.into());
19595 self
19596 }
19597
19598 /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19599 ///
19600 /// # Example
19601 /// ```ignore,no_run
19602 /// # use google_cloud_sql_v1::model::ExportContext;
19603 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19604 /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
19605 /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
19606 /// ```
19607 pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19608 where
19609 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19610 {
19611 self.sql_export_options = v.map(|x| x.into());
19612 self
19613 }
19614
19615 /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19616 ///
19617 /// # Example
19618 /// ```ignore,no_run
19619 /// # use google_cloud_sql_v1::model::ExportContext;
19620 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19621 /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
19622 /// ```
19623 pub fn set_csv_export_options<T>(mut self, v: T) -> Self
19624 where
19625 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19626 {
19627 self.csv_export_options = std::option::Option::Some(v.into());
19628 self
19629 }
19630
19631 /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19632 ///
19633 /// # Example
19634 /// ```ignore,no_run
19635 /// # use google_cloud_sql_v1::model::ExportContext;
19636 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19637 /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
19638 /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
19639 /// ```
19640 pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19641 where
19642 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19643 {
19644 self.csv_export_options = v.map(|x| x.into());
19645 self
19646 }
19647
19648 /// Sets the value of [file_type][crate::model::ExportContext::file_type].
19649 ///
19650 /// # Example
19651 /// ```ignore,no_run
19652 /// # use google_cloud_sql_v1::model::ExportContext;
19653 /// use google_cloud_sql_v1::model::SqlFileType;
19654 /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
19655 /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
19656 /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
19657 /// ```
19658 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
19659 self.file_type = v.into();
19660 self
19661 }
19662
19663 /// Sets the value of [offload][crate::model::ExportContext::offload].
19664 ///
19665 /// # Example
19666 /// ```ignore,no_run
19667 /// # use google_cloud_sql_v1::model::ExportContext;
19668 /// use wkt::BoolValue;
19669 /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
19670 /// ```
19671 pub fn set_offload<T>(mut self, v: T) -> Self
19672 where
19673 T: std::convert::Into<wkt::BoolValue>,
19674 {
19675 self.offload = std::option::Option::Some(v.into());
19676 self
19677 }
19678
19679 /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
19680 ///
19681 /// # Example
19682 /// ```ignore,no_run
19683 /// # use google_cloud_sql_v1::model::ExportContext;
19684 /// use wkt::BoolValue;
19685 /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
19686 /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
19687 /// ```
19688 pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
19689 where
19690 T: std::convert::Into<wkt::BoolValue>,
19691 {
19692 self.offload = v.map(|x| x.into());
19693 self
19694 }
19695
19696 /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19697 ///
19698 /// # Example
19699 /// ```ignore,no_run
19700 /// # use google_cloud_sql_v1::model::ExportContext;
19701 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19702 /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
19703 /// ```
19704 pub fn set_bak_export_options<T>(mut self, v: T) -> Self
19705 where
19706 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19707 {
19708 self.bak_export_options = std::option::Option::Some(v.into());
19709 self
19710 }
19711
19712 /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19713 ///
19714 /// # Example
19715 /// ```ignore,no_run
19716 /// # use google_cloud_sql_v1::model::ExportContext;
19717 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19718 /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
19719 /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
19720 /// ```
19721 pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19722 where
19723 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19724 {
19725 self.bak_export_options = v.map(|x| x.into());
19726 self
19727 }
19728
19729 /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19730 ///
19731 /// # Example
19732 /// ```ignore,no_run
19733 /// # use google_cloud_sql_v1::model::ExportContext;
19734 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19735 /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
19736 /// ```
19737 pub fn set_tde_export_options<T>(mut self, v: T) -> Self
19738 where
19739 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19740 {
19741 self.tde_export_options = std::option::Option::Some(v.into());
19742 self
19743 }
19744
19745 /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19746 ///
19747 /// # Example
19748 /// ```ignore,no_run
19749 /// # use google_cloud_sql_v1::model::ExportContext;
19750 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19751 /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
19752 /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
19753 /// ```
19754 pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19755 where
19756 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19757 {
19758 self.tde_export_options = v.map(|x| x.into());
19759 self
19760 }
19761}
19762
19763impl wkt::message::Message for ExportContext {
19764 fn typename() -> &'static str {
19765 "type.googleapis.com/google.cloud.sql.v1.ExportContext"
19766 }
19767}
19768
19769/// Defines additional types related to [ExportContext].
19770pub mod export_context {
19771 #[allow(unused_imports)]
19772 use super::*;
19773
19774 #[derive(Clone, Default, PartialEq)]
19775 #[non_exhaustive]
19776 pub struct SqlCsvExportOptions {
19777 /// The select query used to extract the data.
19778 pub select_query: std::string::String,
19779
19780 /// Specifies the character that should appear before a data character that
19781 /// needs to be escaped.
19782 pub escape_character: std::string::String,
19783
19784 /// Specifies the quoting character to be used when a data value is quoted.
19785 pub quote_character: std::string::String,
19786
19787 /// Specifies the character that separates columns within each row (line) of
19788 /// the file.
19789 pub fields_terminated_by: std::string::String,
19790
19791 /// This is used to separate lines. If a line does not contain all fields,
19792 /// the rest of the columns are set to their default values.
19793 pub lines_terminated_by: std::string::String,
19794
19795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19796 }
19797
19798 impl SqlCsvExportOptions {
19799 pub fn new() -> Self {
19800 std::default::Default::default()
19801 }
19802
19803 /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
19804 ///
19805 /// # Example
19806 /// ```ignore,no_run
19807 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19808 /// let x = SqlCsvExportOptions::new().set_select_query("example");
19809 /// ```
19810 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
19811 mut self,
19812 v: T,
19813 ) -> Self {
19814 self.select_query = v.into();
19815 self
19816 }
19817
19818 /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
19819 ///
19820 /// # Example
19821 /// ```ignore,no_run
19822 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19823 /// let x = SqlCsvExportOptions::new().set_escape_character("example");
19824 /// ```
19825 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
19826 mut self,
19827 v: T,
19828 ) -> Self {
19829 self.escape_character = v.into();
19830 self
19831 }
19832
19833 /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
19834 ///
19835 /// # Example
19836 /// ```ignore,no_run
19837 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19838 /// let x = SqlCsvExportOptions::new().set_quote_character("example");
19839 /// ```
19840 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
19841 mut self,
19842 v: T,
19843 ) -> Self {
19844 self.quote_character = v.into();
19845 self
19846 }
19847
19848 /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
19849 ///
19850 /// # Example
19851 /// ```ignore,no_run
19852 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19853 /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
19854 /// ```
19855 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
19856 mut self,
19857 v: T,
19858 ) -> Self {
19859 self.fields_terminated_by = v.into();
19860 self
19861 }
19862
19863 /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
19864 ///
19865 /// # Example
19866 /// ```ignore,no_run
19867 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19868 /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
19869 /// ```
19870 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
19871 mut self,
19872 v: T,
19873 ) -> Self {
19874 self.lines_terminated_by = v.into();
19875 self
19876 }
19877 }
19878
19879 impl wkt::message::Message for SqlCsvExportOptions {
19880 fn typename() -> &'static str {
19881 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
19882 }
19883 }
19884
19885 #[derive(Clone, Default, PartialEq)]
19886 #[non_exhaustive]
19887 pub struct SqlExportOptions {
19888 /// Tables to export, or that were exported, from the specified database. If
19889 /// you specify tables, specify one and only one database. For PostgreSQL
19890 /// instances, you can specify only one table.
19891 pub tables: std::vec::Vec<std::string::String>,
19892
19893 /// Export only schemas.
19894 pub schema_only: std::option::Option<wkt::BoolValue>,
19895
19896 pub mysql_export_options: std::option::Option<
19897 crate::model::export_context::sql_export_options::MysqlExportOptions,
19898 >,
19899
19900 /// Optional. The number of threads to use for parallel export.
19901 pub threads: std::option::Option<wkt::Int32Value>,
19902
19903 /// Optional. Whether or not the export should be parallel.
19904 pub parallel: std::option::Option<wkt::BoolValue>,
19905
19906 /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
19907 pub postgres_export_options: std::option::Option<
19908 crate::model::export_context::sql_export_options::PostgresExportOptions,
19909 >,
19910
19911 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19912 }
19913
19914 impl SqlExportOptions {
19915 pub fn new() -> Self {
19916 std::default::Default::default()
19917 }
19918
19919 /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
19920 ///
19921 /// # Example
19922 /// ```ignore,no_run
19923 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19924 /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
19925 /// ```
19926 pub fn set_tables<T, V>(mut self, v: T) -> Self
19927 where
19928 T: std::iter::IntoIterator<Item = V>,
19929 V: std::convert::Into<std::string::String>,
19930 {
19931 use std::iter::Iterator;
19932 self.tables = v.into_iter().map(|i| i.into()).collect();
19933 self
19934 }
19935
19936 /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
19937 ///
19938 /// # Example
19939 /// ```ignore,no_run
19940 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19941 /// use wkt::BoolValue;
19942 /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
19943 /// ```
19944 pub fn set_schema_only<T>(mut self, v: T) -> Self
19945 where
19946 T: std::convert::Into<wkt::BoolValue>,
19947 {
19948 self.schema_only = std::option::Option::Some(v.into());
19949 self
19950 }
19951
19952 /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
19953 ///
19954 /// # Example
19955 /// ```ignore,no_run
19956 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19957 /// use wkt::BoolValue;
19958 /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
19959 /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
19960 /// ```
19961 pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
19962 where
19963 T: std::convert::Into<wkt::BoolValue>,
19964 {
19965 self.schema_only = v.map(|x| x.into());
19966 self
19967 }
19968
19969 /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
19970 ///
19971 /// # Example
19972 /// ```ignore,no_run
19973 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19974 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
19975 /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
19976 /// ```
19977 pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
19978 where
19979 T: std::convert::Into<
19980 crate::model::export_context::sql_export_options::MysqlExportOptions,
19981 >,
19982 {
19983 self.mysql_export_options = std::option::Option::Some(v.into());
19984 self
19985 }
19986
19987 /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
19988 ///
19989 /// # Example
19990 /// ```ignore,no_run
19991 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19992 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
19993 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
19994 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
19995 /// ```
19996 pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19997 where
19998 T: std::convert::Into<
19999 crate::model::export_context::sql_export_options::MysqlExportOptions,
20000 >,
20001 {
20002 self.mysql_export_options = v.map(|x| x.into());
20003 self
20004 }
20005
20006 /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20007 ///
20008 /// # Example
20009 /// ```ignore,no_run
20010 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20011 /// use wkt::Int32Value;
20012 /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
20013 /// ```
20014 pub fn set_threads<T>(mut self, v: T) -> Self
20015 where
20016 T: std::convert::Into<wkt::Int32Value>,
20017 {
20018 self.threads = std::option::Option::Some(v.into());
20019 self
20020 }
20021
20022 /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20023 ///
20024 /// # Example
20025 /// ```ignore,no_run
20026 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20027 /// use wkt::Int32Value;
20028 /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20029 /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
20030 /// ```
20031 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20032 where
20033 T: std::convert::Into<wkt::Int32Value>,
20034 {
20035 self.threads = v.map(|x| x.into());
20036 self
20037 }
20038
20039 /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20040 ///
20041 /// # Example
20042 /// ```ignore,no_run
20043 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20044 /// use wkt::BoolValue;
20045 /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20046 /// ```
20047 pub fn set_parallel<T>(mut self, v: T) -> Self
20048 where
20049 T: std::convert::Into<wkt::BoolValue>,
20050 {
20051 self.parallel = std::option::Option::Some(v.into());
20052 self
20053 }
20054
20055 /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20056 ///
20057 /// # Example
20058 /// ```ignore,no_run
20059 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20060 /// use wkt::BoolValue;
20061 /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20062 /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20063 /// ```
20064 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20065 where
20066 T: std::convert::Into<wkt::BoolValue>,
20067 {
20068 self.parallel = v.map(|x| x.into());
20069 self
20070 }
20071
20072 /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20073 ///
20074 /// # Example
20075 /// ```ignore,no_run
20076 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20077 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20078 /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
20079 /// ```
20080 pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
20081 where
20082 T: std::convert::Into<
20083 crate::model::export_context::sql_export_options::PostgresExportOptions,
20084 >,
20085 {
20086 self.postgres_export_options = std::option::Option::Some(v.into());
20087 self
20088 }
20089
20090 /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20091 ///
20092 /// # Example
20093 /// ```ignore,no_run
20094 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20095 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20096 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
20097 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
20098 /// ```
20099 pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20100 where
20101 T: std::convert::Into<
20102 crate::model::export_context::sql_export_options::PostgresExportOptions,
20103 >,
20104 {
20105 self.postgres_export_options = v.map(|x| x.into());
20106 self
20107 }
20108 }
20109
20110 impl wkt::message::Message for SqlExportOptions {
20111 fn typename() -> &'static str {
20112 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
20113 }
20114 }
20115
20116 /// Defines additional types related to [SqlExportOptions].
20117 pub mod sql_export_options {
20118 #[allow(unused_imports)]
20119 use super::*;
20120
20121 /// Options for exporting from MySQL.
20122 #[derive(Clone, Default, PartialEq)]
20123 #[non_exhaustive]
20124 pub struct MysqlExportOptions {
20125 /// Option to include SQL statement required to set up replication. If set
20126 /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
20127 /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
20128 /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
20129 /// has no effect. If set to any value other than `1`, --set-gtid-purged
20130 /// is set to OFF.
20131 pub master_data: std::option::Option<wkt::Int32Value>,
20132
20133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20134 }
20135
20136 impl MysqlExportOptions {
20137 pub fn new() -> Self {
20138 std::default::Default::default()
20139 }
20140
20141 /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20142 ///
20143 /// # Example
20144 /// ```ignore,no_run
20145 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20146 /// use wkt::Int32Value;
20147 /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
20148 /// ```
20149 pub fn set_master_data<T>(mut self, v: T) -> Self
20150 where
20151 T: std::convert::Into<wkt::Int32Value>,
20152 {
20153 self.master_data = std::option::Option::Some(v.into());
20154 self
20155 }
20156
20157 /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20158 ///
20159 /// # Example
20160 /// ```ignore,no_run
20161 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20162 /// use wkt::Int32Value;
20163 /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
20164 /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
20165 /// ```
20166 pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
20167 where
20168 T: std::convert::Into<wkt::Int32Value>,
20169 {
20170 self.master_data = v.map(|x| x.into());
20171 self
20172 }
20173 }
20174
20175 impl wkt::message::Message for MysqlExportOptions {
20176 fn typename() -> &'static str {
20177 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
20178 }
20179 }
20180
20181 /// Options for exporting from a Cloud SQL for PostgreSQL instance.
20182 #[derive(Clone, Default, PartialEq)]
20183 #[non_exhaustive]
20184 pub struct PostgresExportOptions {
20185 /// Optional. Use this option to include DROP \<code\><object>\</code\>
20186 /// SQL statements. Use these statements to delete database objects before
20187 /// running the import operation.
20188 pub clean: std::option::Option<wkt::BoolValue>,
20189
20190 /// Optional. Option to include an IF EXISTS SQL statement with each DROP
20191 /// statement produced by clean.
20192 pub if_exists: std::option::Option<wkt::BoolValue>,
20193
20194 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20195 }
20196
20197 impl PostgresExportOptions {
20198 pub fn new() -> Self {
20199 std::default::Default::default()
20200 }
20201
20202 /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20203 ///
20204 /// # Example
20205 /// ```ignore,no_run
20206 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20207 /// use wkt::BoolValue;
20208 /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
20209 /// ```
20210 pub fn set_clean<T>(mut self, v: T) -> Self
20211 where
20212 T: std::convert::Into<wkt::BoolValue>,
20213 {
20214 self.clean = std::option::Option::Some(v.into());
20215 self
20216 }
20217
20218 /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20219 ///
20220 /// # Example
20221 /// ```ignore,no_run
20222 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20223 /// use wkt::BoolValue;
20224 /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20225 /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
20226 /// ```
20227 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20228 where
20229 T: std::convert::Into<wkt::BoolValue>,
20230 {
20231 self.clean = v.map(|x| x.into());
20232 self
20233 }
20234
20235 /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20236 ///
20237 /// # Example
20238 /// ```ignore,no_run
20239 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20240 /// use wkt::BoolValue;
20241 /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
20242 /// ```
20243 pub fn set_if_exists<T>(mut self, v: T) -> Self
20244 where
20245 T: std::convert::Into<wkt::BoolValue>,
20246 {
20247 self.if_exists = std::option::Option::Some(v.into());
20248 self
20249 }
20250
20251 /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20252 ///
20253 /// # Example
20254 /// ```ignore,no_run
20255 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20256 /// use wkt::BoolValue;
20257 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
20258 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
20259 /// ```
20260 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
20261 where
20262 T: std::convert::Into<wkt::BoolValue>,
20263 {
20264 self.if_exists = v.map(|x| x.into());
20265 self
20266 }
20267 }
20268
20269 impl wkt::message::Message for PostgresExportOptions {
20270 fn typename() -> &'static str {
20271 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
20272 }
20273 }
20274 }
20275
20276 /// Options for exporting BAK files (SQL Server-only)
20277 #[derive(Clone, Default, PartialEq)]
20278 #[non_exhaustive]
20279 pub struct SqlBakExportOptions {
20280 /// Whether or not the export should be striped.
20281 pub striped: std::option::Option<wkt::BoolValue>,
20282
20283 /// Option for specifying how many stripes to use for the export.
20284 /// If blank, and the value of the striped field is true,
20285 /// the number of stripes is automatically chosen.
20286 pub stripe_count: std::option::Option<wkt::Int32Value>,
20287
20288 /// Type of this bak file will be export, FULL or DIFF, SQL Server only
20289 pub bak_type: crate::model::BakType,
20290
20291 /// Deprecated: copy_only is deprecated. Use differential_base instead
20292 #[deprecated]
20293 pub copy_only: std::option::Option<wkt::BoolValue>,
20294
20295 /// Whether or not the backup can be used as a differential base
20296 /// copy_only backup can not be served as differential base
20297 pub differential_base: std::option::Option<wkt::BoolValue>,
20298
20299 /// Optional. The begin timestamp when transaction log will be included in
20300 /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
20301 /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20302 /// available logs from the beginning of retention period will be included.
20303 /// Only applied to Cloud SQL for SQL Server.
20304 pub export_log_start_time: std::option::Option<wkt::Timestamp>,
20305
20306 /// Optional. The end timestamp when transaction log will be included in the
20307 /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
20308 /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20309 /// available logs until current time will be included. Only applied to Cloud
20310 /// SQL for SQL Server.
20311 pub export_log_end_time: std::option::Option<wkt::Timestamp>,
20312
20313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20314 }
20315
20316 impl SqlBakExportOptions {
20317 pub fn new() -> Self {
20318 std::default::Default::default()
20319 }
20320
20321 /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20322 ///
20323 /// # Example
20324 /// ```ignore,no_run
20325 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20326 /// use wkt::BoolValue;
20327 /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
20328 /// ```
20329 pub fn set_striped<T>(mut self, v: T) -> Self
20330 where
20331 T: std::convert::Into<wkt::BoolValue>,
20332 {
20333 self.striped = std::option::Option::Some(v.into());
20334 self
20335 }
20336
20337 /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20338 ///
20339 /// # Example
20340 /// ```ignore,no_run
20341 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20342 /// use wkt::BoolValue;
20343 /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
20344 /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
20345 /// ```
20346 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
20347 where
20348 T: std::convert::Into<wkt::BoolValue>,
20349 {
20350 self.striped = v.map(|x| x.into());
20351 self
20352 }
20353
20354 /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20355 ///
20356 /// # Example
20357 /// ```ignore,no_run
20358 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20359 /// use wkt::Int32Value;
20360 /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
20361 /// ```
20362 pub fn set_stripe_count<T>(mut self, v: T) -> Self
20363 where
20364 T: std::convert::Into<wkt::Int32Value>,
20365 {
20366 self.stripe_count = std::option::Option::Some(v.into());
20367 self
20368 }
20369
20370 /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20371 ///
20372 /// # Example
20373 /// ```ignore,no_run
20374 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20375 /// use wkt::Int32Value;
20376 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
20377 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
20378 /// ```
20379 pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
20380 where
20381 T: std::convert::Into<wkt::Int32Value>,
20382 {
20383 self.stripe_count = v.map(|x| x.into());
20384 self
20385 }
20386
20387 /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
20388 ///
20389 /// # Example
20390 /// ```ignore,no_run
20391 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20392 /// use google_cloud_sql_v1::model::BakType;
20393 /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
20394 /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
20395 /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
20396 /// ```
20397 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
20398 self.bak_type = v.into();
20399 self
20400 }
20401
20402 /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20403 ///
20404 /// # Example
20405 /// ```ignore,no_run
20406 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20407 /// use wkt::BoolValue;
20408 /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
20409 /// ```
20410 #[deprecated]
20411 pub fn set_copy_only<T>(mut self, v: T) -> Self
20412 where
20413 T: std::convert::Into<wkt::BoolValue>,
20414 {
20415 self.copy_only = std::option::Option::Some(v.into());
20416 self
20417 }
20418
20419 /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20420 ///
20421 /// # Example
20422 /// ```ignore,no_run
20423 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20424 /// use wkt::BoolValue;
20425 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
20426 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
20427 /// ```
20428 #[deprecated]
20429 pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
20430 where
20431 T: std::convert::Into<wkt::BoolValue>,
20432 {
20433 self.copy_only = v.map(|x| x.into());
20434 self
20435 }
20436
20437 /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20438 ///
20439 /// # Example
20440 /// ```ignore,no_run
20441 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20442 /// use wkt::BoolValue;
20443 /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
20444 /// ```
20445 pub fn set_differential_base<T>(mut self, v: T) -> Self
20446 where
20447 T: std::convert::Into<wkt::BoolValue>,
20448 {
20449 self.differential_base = std::option::Option::Some(v.into());
20450 self
20451 }
20452
20453 /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20454 ///
20455 /// # Example
20456 /// ```ignore,no_run
20457 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20458 /// use wkt::BoolValue;
20459 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
20460 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
20461 /// ```
20462 pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
20463 where
20464 T: std::convert::Into<wkt::BoolValue>,
20465 {
20466 self.differential_base = v.map(|x| x.into());
20467 self
20468 }
20469
20470 /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20471 ///
20472 /// # Example
20473 /// ```ignore,no_run
20474 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20475 /// use wkt::Timestamp;
20476 /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
20477 /// ```
20478 pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
20479 where
20480 T: std::convert::Into<wkt::Timestamp>,
20481 {
20482 self.export_log_start_time = std::option::Option::Some(v.into());
20483 self
20484 }
20485
20486 /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20487 ///
20488 /// # Example
20489 /// ```ignore,no_run
20490 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20491 /// use wkt::Timestamp;
20492 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
20493 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
20494 /// ```
20495 pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
20496 where
20497 T: std::convert::Into<wkt::Timestamp>,
20498 {
20499 self.export_log_start_time = v.map(|x| x.into());
20500 self
20501 }
20502
20503 /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20504 ///
20505 /// # Example
20506 /// ```ignore,no_run
20507 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20508 /// use wkt::Timestamp;
20509 /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
20510 /// ```
20511 pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
20512 where
20513 T: std::convert::Into<wkt::Timestamp>,
20514 {
20515 self.export_log_end_time = std::option::Option::Some(v.into());
20516 self
20517 }
20518
20519 /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20520 ///
20521 /// # Example
20522 /// ```ignore,no_run
20523 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20524 /// use wkt::Timestamp;
20525 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
20526 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
20527 /// ```
20528 pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
20529 where
20530 T: std::convert::Into<wkt::Timestamp>,
20531 {
20532 self.export_log_end_time = v.map(|x| x.into());
20533 self
20534 }
20535 }
20536
20537 impl wkt::message::Message for SqlBakExportOptions {
20538 fn typename() -> &'static str {
20539 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
20540 }
20541 }
20542
20543 #[derive(Clone, Default, PartialEq)]
20544 #[non_exhaustive]
20545 pub struct SqlTdeExportOptions {
20546 /// Required. Path to the TDE certificate public key
20547 /// in the form gs://bucketName/fileName.
20548 /// The instance must have write access to the bucket.
20549 /// Applicable only for SQL Server instances.
20550 pub certificate_path: std::string::String,
20551
20552 /// Required. Path to the TDE certificate private key
20553 /// in the form gs://bucketName/fileName.
20554 /// The instance must have write access to the location.
20555 /// Applicable only for SQL Server instances.
20556 pub private_key_path: std::string::String,
20557
20558 /// Required. Password that encrypts the private key.
20559 pub private_key_password: std::string::String,
20560
20561 /// Required. Certificate name.
20562 /// Applicable only for SQL Server instances.
20563 pub name: std::string::String,
20564
20565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20566 }
20567
20568 impl SqlTdeExportOptions {
20569 pub fn new() -> Self {
20570 std::default::Default::default()
20571 }
20572
20573 /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
20574 ///
20575 /// # Example
20576 /// ```ignore,no_run
20577 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20578 /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
20579 /// ```
20580 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
20581 mut self,
20582 v: T,
20583 ) -> Self {
20584 self.certificate_path = v.into();
20585 self
20586 }
20587
20588 /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
20589 ///
20590 /// # Example
20591 /// ```ignore,no_run
20592 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20593 /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
20594 /// ```
20595 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
20596 mut self,
20597 v: T,
20598 ) -> Self {
20599 self.private_key_path = v.into();
20600 self
20601 }
20602
20603 /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
20604 ///
20605 /// # Example
20606 /// ```ignore,no_run
20607 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20608 /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
20609 /// ```
20610 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
20611 mut self,
20612 v: T,
20613 ) -> Self {
20614 self.private_key_password = v.into();
20615 self
20616 }
20617
20618 /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
20619 ///
20620 /// # Example
20621 /// ```ignore,no_run
20622 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20623 /// let x = SqlTdeExportOptions::new().set_name("example");
20624 /// ```
20625 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20626 self.name = v.into();
20627 self
20628 }
20629 }
20630
20631 impl wkt::message::Message for SqlTdeExportOptions {
20632 fn typename() -> &'static str {
20633 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
20634 }
20635 }
20636}
20637
20638/// Database instance import context.
20639#[derive(Clone, Default, PartialEq)]
20640#[non_exhaustive]
20641pub struct ImportContext {
20642 /// Path to the import file in Cloud Storage, in the form
20643 /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
20644 /// when `fileType` is `SQL`. The instance must have
20645 /// write permissions to the bucket and read access to the file.
20646 pub uri: std::string::String,
20647
20648 /// The target database for the import. If `fileType` is `SQL`, this field
20649 /// is required only if the import file does not specify a database, and is
20650 /// overridden by any database specification in the import file. For entire
20651 /// instance parallel import operations, the database is overridden by the
20652 /// database name stored in subdirectory name. If
20653 /// `fileType` is `CSV`, one database must be specified.
20654 pub database: std::string::String,
20655
20656 /// This is always `sql#importContext`.
20657 pub kind: std::string::String,
20658
20659 /// The file type for the specified uri.\`SQL`: The file
20660 /// contains SQL statements. \`CSV`: The file contains CSV data.
20661 pub file_type: crate::model::SqlFileType,
20662
20663 /// Options for importing data as CSV.
20664 pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
20665
20666 /// The PostgreSQL user for this import operation. PostgreSQL instances only.
20667 pub import_user: std::string::String,
20668
20669 /// Import parameters specific to SQL Server .BAK files
20670 pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
20671
20672 /// Optional. Options for importing data from SQL statements.
20673 pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
20674
20675 /// Optional. Import parameters specific to SQL Server TDE certificates
20676 pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
20677
20678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20679}
20680
20681impl ImportContext {
20682 pub fn new() -> Self {
20683 std::default::Default::default()
20684 }
20685
20686 /// Sets the value of [uri][crate::model::ImportContext::uri].
20687 ///
20688 /// # Example
20689 /// ```ignore,no_run
20690 /// # use google_cloud_sql_v1::model::ImportContext;
20691 /// let x = ImportContext::new().set_uri("example");
20692 /// ```
20693 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20694 self.uri = v.into();
20695 self
20696 }
20697
20698 /// Sets the value of [database][crate::model::ImportContext::database].
20699 ///
20700 /// # Example
20701 /// ```ignore,no_run
20702 /// # use google_cloud_sql_v1::model::ImportContext;
20703 /// let x = ImportContext::new().set_database("example");
20704 /// ```
20705 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20706 self.database = v.into();
20707 self
20708 }
20709
20710 /// Sets the value of [kind][crate::model::ImportContext::kind].
20711 ///
20712 /// # Example
20713 /// ```ignore,no_run
20714 /// # use google_cloud_sql_v1::model::ImportContext;
20715 /// let x = ImportContext::new().set_kind("example");
20716 /// ```
20717 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20718 self.kind = v.into();
20719 self
20720 }
20721
20722 /// Sets the value of [file_type][crate::model::ImportContext::file_type].
20723 ///
20724 /// # Example
20725 /// ```ignore,no_run
20726 /// # use google_cloud_sql_v1::model::ImportContext;
20727 /// use google_cloud_sql_v1::model::SqlFileType;
20728 /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
20729 /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
20730 /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
20731 /// ```
20732 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
20733 self.file_type = v.into();
20734 self
20735 }
20736
20737 /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20738 ///
20739 /// # Example
20740 /// ```ignore,no_run
20741 /// # use google_cloud_sql_v1::model::ImportContext;
20742 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20743 /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
20744 /// ```
20745 pub fn set_csv_import_options<T>(mut self, v: T) -> Self
20746 where
20747 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20748 {
20749 self.csv_import_options = std::option::Option::Some(v.into());
20750 self
20751 }
20752
20753 /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20754 ///
20755 /// # Example
20756 /// ```ignore,no_run
20757 /// # use google_cloud_sql_v1::model::ImportContext;
20758 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20759 /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
20760 /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
20761 /// ```
20762 pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20763 where
20764 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20765 {
20766 self.csv_import_options = v.map(|x| x.into());
20767 self
20768 }
20769
20770 /// Sets the value of [import_user][crate::model::ImportContext::import_user].
20771 ///
20772 /// # Example
20773 /// ```ignore,no_run
20774 /// # use google_cloud_sql_v1::model::ImportContext;
20775 /// let x = ImportContext::new().set_import_user("example");
20776 /// ```
20777 pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20778 self.import_user = v.into();
20779 self
20780 }
20781
20782 /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
20783 ///
20784 /// # Example
20785 /// ```ignore,no_run
20786 /// # use google_cloud_sql_v1::model::ImportContext;
20787 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
20788 /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
20789 /// ```
20790 pub fn set_bak_import_options<T>(mut self, v: T) -> Self
20791 where
20792 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
20793 {
20794 self.bak_import_options = std::option::Option::Some(v.into());
20795 self
20796 }
20797
20798 /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
20799 ///
20800 /// # Example
20801 /// ```ignore,no_run
20802 /// # use google_cloud_sql_v1::model::ImportContext;
20803 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
20804 /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
20805 /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
20806 /// ```
20807 pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20808 where
20809 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
20810 {
20811 self.bak_import_options = v.map(|x| x.into());
20812 self
20813 }
20814
20815 /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
20816 ///
20817 /// # Example
20818 /// ```ignore,no_run
20819 /// # use google_cloud_sql_v1::model::ImportContext;
20820 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20821 /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
20822 /// ```
20823 pub fn set_sql_import_options<T>(mut self, v: T) -> Self
20824 where
20825 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
20826 {
20827 self.sql_import_options = std::option::Option::Some(v.into());
20828 self
20829 }
20830
20831 /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
20832 ///
20833 /// # Example
20834 /// ```ignore,no_run
20835 /// # use google_cloud_sql_v1::model::ImportContext;
20836 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20837 /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
20838 /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
20839 /// ```
20840 pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20841 where
20842 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
20843 {
20844 self.sql_import_options = v.map(|x| x.into());
20845 self
20846 }
20847
20848 /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
20849 ///
20850 /// # Example
20851 /// ```ignore,no_run
20852 /// # use google_cloud_sql_v1::model::ImportContext;
20853 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
20854 /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
20855 /// ```
20856 pub fn set_tde_import_options<T>(mut self, v: T) -> Self
20857 where
20858 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
20859 {
20860 self.tde_import_options = std::option::Option::Some(v.into());
20861 self
20862 }
20863
20864 /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
20865 ///
20866 /// # Example
20867 /// ```ignore,no_run
20868 /// # use google_cloud_sql_v1::model::ImportContext;
20869 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
20870 /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
20871 /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
20872 /// ```
20873 pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20874 where
20875 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
20876 {
20877 self.tde_import_options = v.map(|x| x.into());
20878 self
20879 }
20880}
20881
20882impl wkt::message::Message for ImportContext {
20883 fn typename() -> &'static str {
20884 "type.googleapis.com/google.cloud.sql.v1.ImportContext"
20885 }
20886}
20887
20888/// Defines additional types related to [ImportContext].
20889pub mod import_context {
20890 #[allow(unused_imports)]
20891 use super::*;
20892
20893 #[derive(Clone, Default, PartialEq)]
20894 #[non_exhaustive]
20895 pub struct SqlImportOptions {
20896 /// Optional. The number of threads to use for parallel import.
20897 pub threads: std::option::Option<wkt::Int32Value>,
20898
20899 /// Optional. Whether or not the import should be parallel.
20900 pub parallel: std::option::Option<wkt::BoolValue>,
20901
20902 /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
20903 pub postgres_import_options: std::option::Option<
20904 crate::model::import_context::sql_import_options::PostgresImportOptions,
20905 >,
20906
20907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20908 }
20909
20910 impl SqlImportOptions {
20911 pub fn new() -> Self {
20912 std::default::Default::default()
20913 }
20914
20915 /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
20916 ///
20917 /// # Example
20918 /// ```ignore,no_run
20919 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20920 /// use wkt::Int32Value;
20921 /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
20922 /// ```
20923 pub fn set_threads<T>(mut self, v: T) -> Self
20924 where
20925 T: std::convert::Into<wkt::Int32Value>,
20926 {
20927 self.threads = std::option::Option::Some(v.into());
20928 self
20929 }
20930
20931 /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
20932 ///
20933 /// # Example
20934 /// ```ignore,no_run
20935 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20936 /// use wkt::Int32Value;
20937 /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20938 /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
20939 /// ```
20940 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20941 where
20942 T: std::convert::Into<wkt::Int32Value>,
20943 {
20944 self.threads = v.map(|x| x.into());
20945 self
20946 }
20947
20948 /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
20949 ///
20950 /// # Example
20951 /// ```ignore,no_run
20952 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20953 /// use wkt::BoolValue;
20954 /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20955 /// ```
20956 pub fn set_parallel<T>(mut self, v: T) -> Self
20957 where
20958 T: std::convert::Into<wkt::BoolValue>,
20959 {
20960 self.parallel = std::option::Option::Some(v.into());
20961 self
20962 }
20963
20964 /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
20965 ///
20966 /// # Example
20967 /// ```ignore,no_run
20968 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20969 /// use wkt::BoolValue;
20970 /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20971 /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20972 /// ```
20973 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20974 where
20975 T: std::convert::Into<wkt::BoolValue>,
20976 {
20977 self.parallel = v.map(|x| x.into());
20978 self
20979 }
20980
20981 /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
20982 ///
20983 /// # Example
20984 /// ```ignore,no_run
20985 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20986 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
20987 /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
20988 /// ```
20989 pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
20990 where
20991 T: std::convert::Into<
20992 crate::model::import_context::sql_import_options::PostgresImportOptions,
20993 >,
20994 {
20995 self.postgres_import_options = std::option::Option::Some(v.into());
20996 self
20997 }
20998
20999 /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21000 ///
21001 /// # Example
21002 /// ```ignore,no_run
21003 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21004 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21005 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
21006 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
21007 /// ```
21008 pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21009 where
21010 T: std::convert::Into<
21011 crate::model::import_context::sql_import_options::PostgresImportOptions,
21012 >,
21013 {
21014 self.postgres_import_options = v.map(|x| x.into());
21015 self
21016 }
21017 }
21018
21019 impl wkt::message::Message for SqlImportOptions {
21020 fn typename() -> &'static str {
21021 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
21022 }
21023 }
21024
21025 /// Defines additional types related to [SqlImportOptions].
21026 pub mod sql_import_options {
21027 #[allow(unused_imports)]
21028 use super::*;
21029
21030 #[derive(Clone, Default, PartialEq)]
21031 #[non_exhaustive]
21032 pub struct PostgresImportOptions {
21033 /// Optional. The --clean flag for the pg_restore utility. This flag
21034 /// applies only if you enabled Cloud SQL to import files in parallel.
21035 pub clean: std::option::Option<wkt::BoolValue>,
21036
21037 /// Optional. The --if-exists flag for the pg_restore utility. This flag
21038 /// applies only if you enabled Cloud SQL to import files in parallel.
21039 pub if_exists: std::option::Option<wkt::BoolValue>,
21040
21041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21042 }
21043
21044 impl PostgresImportOptions {
21045 pub fn new() -> Self {
21046 std::default::Default::default()
21047 }
21048
21049 /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21050 ///
21051 /// # Example
21052 /// ```ignore,no_run
21053 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21054 /// use wkt::BoolValue;
21055 /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
21056 /// ```
21057 pub fn set_clean<T>(mut self, v: T) -> Self
21058 where
21059 T: std::convert::Into<wkt::BoolValue>,
21060 {
21061 self.clean = std::option::Option::Some(v.into());
21062 self
21063 }
21064
21065 /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21066 ///
21067 /// # Example
21068 /// ```ignore,no_run
21069 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21070 /// use wkt::BoolValue;
21071 /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
21072 /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
21073 /// ```
21074 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
21075 where
21076 T: std::convert::Into<wkt::BoolValue>,
21077 {
21078 self.clean = v.map(|x| x.into());
21079 self
21080 }
21081
21082 /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21083 ///
21084 /// # Example
21085 /// ```ignore,no_run
21086 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21087 /// use wkt::BoolValue;
21088 /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21089 /// ```
21090 pub fn set_if_exists<T>(mut self, v: T) -> Self
21091 where
21092 T: std::convert::Into<wkt::BoolValue>,
21093 {
21094 self.if_exists = std::option::Option::Some(v.into());
21095 self
21096 }
21097
21098 /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21099 ///
21100 /// # Example
21101 /// ```ignore,no_run
21102 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21103 /// use wkt::BoolValue;
21104 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21105 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21106 /// ```
21107 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21108 where
21109 T: std::convert::Into<wkt::BoolValue>,
21110 {
21111 self.if_exists = v.map(|x| x.into());
21112 self
21113 }
21114 }
21115
21116 impl wkt::message::Message for PostgresImportOptions {
21117 fn typename() -> &'static str {
21118 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
21119 }
21120 }
21121 }
21122
21123 #[derive(Clone, Default, PartialEq)]
21124 #[non_exhaustive]
21125 pub struct SqlCsvImportOptions {
21126 /// The table to which CSV data is imported.
21127 pub table: std::string::String,
21128
21129 /// The columns to which CSV data is imported. If not specified, all columns
21130 /// of the database table are loaded with CSV data.
21131 pub columns: std::vec::Vec<std::string::String>,
21132
21133 /// Specifies the character that should appear before a data character that
21134 /// needs to be escaped.
21135 pub escape_character: std::string::String,
21136
21137 /// Specifies the quoting character to be used when a data value is quoted.
21138 pub quote_character: std::string::String,
21139
21140 /// Specifies the character that separates columns within each row (line) of
21141 /// the file.
21142 pub fields_terminated_by: std::string::String,
21143
21144 /// This is used to separate lines. If a line does not contain all fields,
21145 /// the rest of the columns are set to their default values.
21146 pub lines_terminated_by: std::string::String,
21147
21148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21149 }
21150
21151 impl SqlCsvImportOptions {
21152 pub fn new() -> Self {
21153 std::default::Default::default()
21154 }
21155
21156 /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
21157 ///
21158 /// # Example
21159 /// ```ignore,no_run
21160 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21161 /// let x = SqlCsvImportOptions::new().set_table("example");
21162 /// ```
21163 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21164 self.table = v.into();
21165 self
21166 }
21167
21168 /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
21169 ///
21170 /// # Example
21171 /// ```ignore,no_run
21172 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21173 /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
21174 /// ```
21175 pub fn set_columns<T, V>(mut self, v: T) -> Self
21176 where
21177 T: std::iter::IntoIterator<Item = V>,
21178 V: std::convert::Into<std::string::String>,
21179 {
21180 use std::iter::Iterator;
21181 self.columns = v.into_iter().map(|i| i.into()).collect();
21182 self
21183 }
21184
21185 /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
21186 ///
21187 /// # Example
21188 /// ```ignore,no_run
21189 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21190 /// let x = SqlCsvImportOptions::new().set_escape_character("example");
21191 /// ```
21192 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21193 mut self,
21194 v: T,
21195 ) -> Self {
21196 self.escape_character = v.into();
21197 self
21198 }
21199
21200 /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
21201 ///
21202 /// # Example
21203 /// ```ignore,no_run
21204 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21205 /// let x = SqlCsvImportOptions::new().set_quote_character("example");
21206 /// ```
21207 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21208 mut self,
21209 v: T,
21210 ) -> Self {
21211 self.quote_character = v.into();
21212 self
21213 }
21214
21215 /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
21216 ///
21217 /// # Example
21218 /// ```ignore,no_run
21219 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21220 /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
21221 /// ```
21222 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21223 mut self,
21224 v: T,
21225 ) -> Self {
21226 self.fields_terminated_by = v.into();
21227 self
21228 }
21229
21230 /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
21231 ///
21232 /// # Example
21233 /// ```ignore,no_run
21234 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21235 /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
21236 /// ```
21237 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21238 mut self,
21239 v: T,
21240 ) -> Self {
21241 self.lines_terminated_by = v.into();
21242 self
21243 }
21244 }
21245
21246 impl wkt::message::Message for SqlCsvImportOptions {
21247 fn typename() -> &'static str {
21248 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
21249 }
21250 }
21251
21252 #[derive(Clone, Default, PartialEq)]
21253 #[non_exhaustive]
21254 pub struct SqlBakImportOptions {
21255 pub encryption_options: std::option::Option<
21256 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21257 >,
21258
21259 /// Whether or not the backup set being restored is striped.
21260 /// Applies only to Cloud SQL for SQL Server.
21261 pub striped: std::option::Option<wkt::BoolValue>,
21262
21263 /// Whether or not the backup importing will restore database
21264 /// with NORECOVERY option.
21265 /// Applies only to Cloud SQL for SQL Server.
21266 pub no_recovery: std::option::Option<wkt::BoolValue>,
21267
21268 /// Whether or not the backup importing request will just bring database
21269 /// online without downloading Bak content only one of "no_recovery" and
21270 /// "recovery_only" can be true otherwise error will return. Applies only to
21271 /// Cloud SQL for SQL Server.
21272 pub recovery_only: std::option::Option<wkt::BoolValue>,
21273
21274 /// Type of the bak content, FULL or DIFF
21275 pub bak_type: crate::model::BakType,
21276
21277 /// Optional. The timestamp when the import should stop. This timestamp is in
21278 /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
21279 /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
21280 /// keyword and applies to Cloud SQL for SQL Server only.
21281 pub stop_at: std::option::Option<wkt::Timestamp>,
21282
21283 /// Optional. The marked transaction where the import should stop. This field
21284 /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
21285 /// Server only.
21286 pub stop_at_mark: std::string::String,
21287
21288 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21289 }
21290
21291 impl SqlBakImportOptions {
21292 pub fn new() -> Self {
21293 std::default::Default::default()
21294 }
21295
21296 /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21297 ///
21298 /// # Example
21299 /// ```ignore,no_run
21300 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21301 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21302 /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
21303 /// ```
21304 pub fn set_encryption_options<T>(mut self, v: T) -> Self
21305 where
21306 T: std::convert::Into<
21307 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21308 >,
21309 {
21310 self.encryption_options = std::option::Option::Some(v.into());
21311 self
21312 }
21313
21314 /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21315 ///
21316 /// # Example
21317 /// ```ignore,no_run
21318 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21319 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21320 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
21321 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
21322 /// ```
21323 pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
21324 where
21325 T: std::convert::Into<
21326 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21327 >,
21328 {
21329 self.encryption_options = v.map(|x| x.into());
21330 self
21331 }
21332
21333 /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21334 ///
21335 /// # Example
21336 /// ```ignore,no_run
21337 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21338 /// use wkt::BoolValue;
21339 /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
21340 /// ```
21341 pub fn set_striped<T>(mut self, v: T) -> Self
21342 where
21343 T: std::convert::Into<wkt::BoolValue>,
21344 {
21345 self.striped = std::option::Option::Some(v.into());
21346 self
21347 }
21348
21349 /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21350 ///
21351 /// # Example
21352 /// ```ignore,no_run
21353 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21354 /// use wkt::BoolValue;
21355 /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21356 /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
21357 /// ```
21358 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21359 where
21360 T: std::convert::Into<wkt::BoolValue>,
21361 {
21362 self.striped = v.map(|x| x.into());
21363 self
21364 }
21365
21366 /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21367 ///
21368 /// # Example
21369 /// ```ignore,no_run
21370 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21371 /// use wkt::BoolValue;
21372 /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
21373 /// ```
21374 pub fn set_no_recovery<T>(mut self, v: T) -> Self
21375 where
21376 T: std::convert::Into<wkt::BoolValue>,
21377 {
21378 self.no_recovery = std::option::Option::Some(v.into());
21379 self
21380 }
21381
21382 /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21383 ///
21384 /// # Example
21385 /// ```ignore,no_run
21386 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21387 /// use wkt::BoolValue;
21388 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
21389 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
21390 /// ```
21391 pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
21392 where
21393 T: std::convert::Into<wkt::BoolValue>,
21394 {
21395 self.no_recovery = v.map(|x| x.into());
21396 self
21397 }
21398
21399 /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21400 ///
21401 /// # Example
21402 /// ```ignore,no_run
21403 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21404 /// use wkt::BoolValue;
21405 /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
21406 /// ```
21407 pub fn set_recovery_only<T>(mut self, v: T) -> Self
21408 where
21409 T: std::convert::Into<wkt::BoolValue>,
21410 {
21411 self.recovery_only = std::option::Option::Some(v.into());
21412 self
21413 }
21414
21415 /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21416 ///
21417 /// # Example
21418 /// ```ignore,no_run
21419 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21420 /// use wkt::BoolValue;
21421 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
21422 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
21423 /// ```
21424 pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
21425 where
21426 T: std::convert::Into<wkt::BoolValue>,
21427 {
21428 self.recovery_only = v.map(|x| x.into());
21429 self
21430 }
21431
21432 /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
21433 ///
21434 /// # Example
21435 /// ```ignore,no_run
21436 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21437 /// use google_cloud_sql_v1::model::BakType;
21438 /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
21439 /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
21440 /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
21441 /// ```
21442 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
21443 self.bak_type = v.into();
21444 self
21445 }
21446
21447 /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21448 ///
21449 /// # Example
21450 /// ```ignore,no_run
21451 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21452 /// use wkt::Timestamp;
21453 /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
21454 /// ```
21455 pub fn set_stop_at<T>(mut self, v: T) -> Self
21456 where
21457 T: std::convert::Into<wkt::Timestamp>,
21458 {
21459 self.stop_at = std::option::Option::Some(v.into());
21460 self
21461 }
21462
21463 /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21464 ///
21465 /// # Example
21466 /// ```ignore,no_run
21467 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21468 /// use wkt::Timestamp;
21469 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
21470 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
21471 /// ```
21472 pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
21473 where
21474 T: std::convert::Into<wkt::Timestamp>,
21475 {
21476 self.stop_at = v.map(|x| x.into());
21477 self
21478 }
21479
21480 /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
21481 ///
21482 /// # Example
21483 /// ```ignore,no_run
21484 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21485 /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
21486 /// ```
21487 pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
21488 mut self,
21489 v: T,
21490 ) -> Self {
21491 self.stop_at_mark = v.into();
21492 self
21493 }
21494 }
21495
21496 impl wkt::message::Message for SqlBakImportOptions {
21497 fn typename() -> &'static str {
21498 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
21499 }
21500 }
21501
21502 /// Defines additional types related to [SqlBakImportOptions].
21503 pub mod sql_bak_import_options {
21504 #[allow(unused_imports)]
21505 use super::*;
21506
21507 #[derive(Clone, Default, PartialEq)]
21508 #[non_exhaustive]
21509 pub struct EncryptionOptions {
21510 /// Path to the Certificate (.cer) in Cloud Storage, in the form
21511 /// `gs://bucketName/fileName`. The instance must have
21512 /// write permissions to the bucket and read access to the file.
21513 pub cert_path: std::string::String,
21514
21515 /// Path to the Certificate Private Key (.pvk) in Cloud Storage, in the
21516 /// form `gs://bucketName/fileName`. The instance must have
21517 /// write permissions to the bucket and read access to the file.
21518 pub pvk_path: std::string::String,
21519
21520 /// Password that encrypts the private key
21521 pub pvk_password: std::string::String,
21522
21523 /// Optional. Whether the imported file remains encrypted.
21524 pub keep_encrypted: std::option::Option<wkt::BoolValue>,
21525
21526 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21527 }
21528
21529 impl EncryptionOptions {
21530 pub fn new() -> Self {
21531 std::default::Default::default()
21532 }
21533
21534 /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
21535 ///
21536 /// # Example
21537 /// ```ignore,no_run
21538 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21539 /// let x = EncryptionOptions::new().set_cert_path("example");
21540 /// ```
21541 pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
21542 mut self,
21543 v: T,
21544 ) -> Self {
21545 self.cert_path = v.into();
21546 self
21547 }
21548
21549 /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
21550 ///
21551 /// # Example
21552 /// ```ignore,no_run
21553 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21554 /// let x = EncryptionOptions::new().set_pvk_path("example");
21555 /// ```
21556 pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
21557 mut self,
21558 v: T,
21559 ) -> Self {
21560 self.pvk_path = v.into();
21561 self
21562 }
21563
21564 /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
21565 ///
21566 /// # Example
21567 /// ```ignore,no_run
21568 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21569 /// let x = EncryptionOptions::new().set_pvk_password("example");
21570 /// ```
21571 pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
21572 mut self,
21573 v: T,
21574 ) -> Self {
21575 self.pvk_password = v.into();
21576 self
21577 }
21578
21579 /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21580 ///
21581 /// # Example
21582 /// ```ignore,no_run
21583 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21584 /// use wkt::BoolValue;
21585 /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
21586 /// ```
21587 pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
21588 where
21589 T: std::convert::Into<wkt::BoolValue>,
21590 {
21591 self.keep_encrypted = std::option::Option::Some(v.into());
21592 self
21593 }
21594
21595 /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21596 ///
21597 /// # Example
21598 /// ```ignore,no_run
21599 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21600 /// use wkt::BoolValue;
21601 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
21602 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
21603 /// ```
21604 pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
21605 where
21606 T: std::convert::Into<wkt::BoolValue>,
21607 {
21608 self.keep_encrypted = v.map(|x| x.into());
21609 self
21610 }
21611 }
21612
21613 impl wkt::message::Message for EncryptionOptions {
21614 fn typename() -> &'static str {
21615 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
21616 }
21617 }
21618 }
21619
21620 #[derive(Clone, Default, PartialEq)]
21621 #[non_exhaustive]
21622 pub struct SqlTdeImportOptions {
21623 /// Required. Path to the TDE certificate public key
21624 /// in the form gs://bucketName/fileName.
21625 /// The instance must have read access to the file.
21626 /// Applicable only for SQL Server instances.
21627 pub certificate_path: std::string::String,
21628
21629 /// Required. Path to the TDE certificate private key
21630 /// in the form gs://bucketName/fileName.
21631 /// The instance must have read access to the file.
21632 /// Applicable only for SQL Server instances.
21633 pub private_key_path: std::string::String,
21634
21635 /// Required. Password that encrypts the private key.
21636 pub private_key_password: std::string::String,
21637
21638 /// Required. Certificate name.
21639 /// Applicable only for SQL Server instances.
21640 pub name: std::string::String,
21641
21642 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21643 }
21644
21645 impl SqlTdeImportOptions {
21646 pub fn new() -> Self {
21647 std::default::Default::default()
21648 }
21649
21650 /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
21651 ///
21652 /// # Example
21653 /// ```ignore,no_run
21654 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21655 /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
21656 /// ```
21657 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
21658 mut self,
21659 v: T,
21660 ) -> Self {
21661 self.certificate_path = v.into();
21662 self
21663 }
21664
21665 /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
21666 ///
21667 /// # Example
21668 /// ```ignore,no_run
21669 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21670 /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
21671 /// ```
21672 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
21673 mut self,
21674 v: T,
21675 ) -> Self {
21676 self.private_key_path = v.into();
21677 self
21678 }
21679
21680 /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
21681 ///
21682 /// # Example
21683 /// ```ignore,no_run
21684 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21685 /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
21686 /// ```
21687 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
21688 mut self,
21689 v: T,
21690 ) -> Self {
21691 self.private_key_password = v.into();
21692 self
21693 }
21694
21695 /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
21696 ///
21697 /// # Example
21698 /// ```ignore,no_run
21699 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21700 /// let x = SqlTdeImportOptions::new().set_name("example");
21701 /// ```
21702 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21703 self.name = v.into();
21704 self
21705 }
21706 }
21707
21708 impl wkt::message::Message for SqlTdeImportOptions {
21709 fn typename() -> &'static str {
21710 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
21711 }
21712 }
21713}
21714
21715/// IP Management configuration.
21716#[derive(Clone, Default, PartialEq)]
21717#[non_exhaustive]
21718pub struct IpConfiguration {
21719 /// Whether the instance is assigned a public IP address or not.
21720 pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
21721
21722 /// The resource link for the VPC network from which the Cloud SQL instance is
21723 /// accessible for private IP. For example,
21724 /// `/projects/myProject/global/networks/default`. This setting can
21725 /// be updated, but it cannot be removed after it is set.
21726 pub private_network: std::string::String,
21727
21728 /// Use `ssl_mode` instead.
21729 ///
21730 /// Whether SSL/TLS connections over IP are enforced.
21731 /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
21732 /// For SSL/TLS connections, the client certificate won't be verified. If
21733 /// set to true, then only allow connections encrypted with SSL/TLS and with
21734 /// valid client certificates. If you want to enforce SSL/TLS without enforcing
21735 /// the requirement for valid client certificates, then use the `ssl_mode` flag
21736 /// instead of the `require_ssl` flag.
21737 pub require_ssl: std::option::Option<wkt::BoolValue>,
21738
21739 /// The list of external networks that are allowed to connect to the instance
21740 /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
21741 /// example: `157.197.200.0/24`).
21742 pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
21743
21744 /// The name of the allocated ip range for the private ip Cloud SQL instance.
21745 /// For example: "google-managed-services-default". If set, the instance ip
21746 /// will be created in the allocated range. The range name must comply with
21747 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
21748 /// must be 1-63 characters long and match the regular expression
21749 /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
21750 pub allocated_ip_range: std::string::String,
21751
21752 /// Controls connectivity to private IP instances from Google services,
21753 /// such as BigQuery.
21754 pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
21755
21756 /// Specify how SSL/TLS is enforced in database connections. If you must use
21757 /// the `require_ssl` flag for backward compatibility, then only the following
21758 /// value pairs are valid:
21759 ///
21760 /// For PostgreSQL and MySQL:
21761 ///
21762 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21763 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
21764 /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
21765 ///
21766 /// For SQL Server:
21767 ///
21768 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21769 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
21770 ///
21771 /// The value of `ssl_mode` has priority over the value of `require_ssl`.
21772 ///
21773 /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
21774 /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
21775 /// connections, while `require_ssl=false` means accept both non-SSL
21776 /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
21777 /// `ssl_mode` and accepts only SSL connections.
21778 pub ssl_mode: crate::model::ip_configuration::SslMode,
21779
21780 /// PSC settings for this instance.
21781 pub psc_config: std::option::Option<crate::model::PscConfig>,
21782
21783 /// Specify what type of CA is used for the server certificate.
21784 pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
21785
21786 /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
21787 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
21788
21789 /// Optional. The resource name of the server CA pool for an instance with
21790 /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
21791 /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
21792 pub server_ca_pool: std::option::Option<std::string::String>,
21793
21794 /// Optional. Controls the automatic server certificate rotation feature. This
21795 /// feature is disabled by default. When enabled, the server certificate will
21796 /// be automatically rotated during Cloud SQL scheduled maintenance or
21797 /// self-service maintenance updates up to six months before it expires. This
21798 /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
21799 /// or CUSTOMER_MANAGED_CAS_CA.
21800 pub server_certificate_rotation_mode:
21801 std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
21802
21803 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21804}
21805
21806impl IpConfiguration {
21807 pub fn new() -> Self {
21808 std::default::Default::default()
21809 }
21810
21811 /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
21812 ///
21813 /// # Example
21814 /// ```ignore,no_run
21815 /// # use google_cloud_sql_v1::model::IpConfiguration;
21816 /// use wkt::BoolValue;
21817 /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
21818 /// ```
21819 pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
21820 where
21821 T: std::convert::Into<wkt::BoolValue>,
21822 {
21823 self.ipv4_enabled = std::option::Option::Some(v.into());
21824 self
21825 }
21826
21827 /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
21828 ///
21829 /// # Example
21830 /// ```ignore,no_run
21831 /// # use google_cloud_sql_v1::model::IpConfiguration;
21832 /// use wkt::BoolValue;
21833 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
21834 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
21835 /// ```
21836 pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
21837 where
21838 T: std::convert::Into<wkt::BoolValue>,
21839 {
21840 self.ipv4_enabled = v.map(|x| x.into());
21841 self
21842 }
21843
21844 /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
21845 ///
21846 /// # Example
21847 /// ```ignore,no_run
21848 /// # use google_cloud_sql_v1::model::IpConfiguration;
21849 /// let x = IpConfiguration::new().set_private_network("example");
21850 /// ```
21851 pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21852 self.private_network = v.into();
21853 self
21854 }
21855
21856 /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
21857 ///
21858 /// # Example
21859 /// ```ignore,no_run
21860 /// # use google_cloud_sql_v1::model::IpConfiguration;
21861 /// use wkt::BoolValue;
21862 /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
21863 /// ```
21864 pub fn set_require_ssl<T>(mut self, v: T) -> Self
21865 where
21866 T: std::convert::Into<wkt::BoolValue>,
21867 {
21868 self.require_ssl = std::option::Option::Some(v.into());
21869 self
21870 }
21871
21872 /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
21873 ///
21874 /// # Example
21875 /// ```ignore,no_run
21876 /// # use google_cloud_sql_v1::model::IpConfiguration;
21877 /// use wkt::BoolValue;
21878 /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
21879 /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
21880 /// ```
21881 pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
21882 where
21883 T: std::convert::Into<wkt::BoolValue>,
21884 {
21885 self.require_ssl = v.map(|x| x.into());
21886 self
21887 }
21888
21889 /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
21890 ///
21891 /// # Example
21892 /// ```ignore,no_run
21893 /// # use google_cloud_sql_v1::model::IpConfiguration;
21894 /// use google_cloud_sql_v1::model::AclEntry;
21895 /// let x = IpConfiguration::new()
21896 /// .set_authorized_networks([
21897 /// AclEntry::default()/* use setters */,
21898 /// AclEntry::default()/* use (different) setters */,
21899 /// ]);
21900 /// ```
21901 pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
21902 where
21903 T: std::iter::IntoIterator<Item = V>,
21904 V: std::convert::Into<crate::model::AclEntry>,
21905 {
21906 use std::iter::Iterator;
21907 self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
21908 self
21909 }
21910
21911 /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
21912 ///
21913 /// # Example
21914 /// ```ignore,no_run
21915 /// # use google_cloud_sql_v1::model::IpConfiguration;
21916 /// let x = IpConfiguration::new().set_allocated_ip_range("example");
21917 /// ```
21918 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
21919 mut self,
21920 v: T,
21921 ) -> Self {
21922 self.allocated_ip_range = v.into();
21923 self
21924 }
21925
21926 /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
21927 ///
21928 /// # Example
21929 /// ```ignore,no_run
21930 /// # use google_cloud_sql_v1::model::IpConfiguration;
21931 /// use wkt::BoolValue;
21932 /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
21933 /// ```
21934 pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
21935 where
21936 T: std::convert::Into<wkt::BoolValue>,
21937 {
21938 self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
21939 self
21940 }
21941
21942 /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
21943 ///
21944 /// # Example
21945 /// ```ignore,no_run
21946 /// # use google_cloud_sql_v1::model::IpConfiguration;
21947 /// use wkt::BoolValue;
21948 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
21949 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
21950 /// ```
21951 pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
21952 mut self,
21953 v: std::option::Option<T>,
21954 ) -> Self
21955 where
21956 T: std::convert::Into<wkt::BoolValue>,
21957 {
21958 self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
21959 self
21960 }
21961
21962 /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
21963 ///
21964 /// # Example
21965 /// ```ignore,no_run
21966 /// # use google_cloud_sql_v1::model::IpConfiguration;
21967 /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
21968 /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
21969 /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
21970 /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
21971 /// ```
21972 pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
21973 mut self,
21974 v: T,
21975 ) -> Self {
21976 self.ssl_mode = v.into();
21977 self
21978 }
21979
21980 /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
21981 ///
21982 /// # Example
21983 /// ```ignore,no_run
21984 /// # use google_cloud_sql_v1::model::IpConfiguration;
21985 /// use google_cloud_sql_v1::model::PscConfig;
21986 /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
21987 /// ```
21988 pub fn set_psc_config<T>(mut self, v: T) -> Self
21989 where
21990 T: std::convert::Into<crate::model::PscConfig>,
21991 {
21992 self.psc_config = std::option::Option::Some(v.into());
21993 self
21994 }
21995
21996 /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
21997 ///
21998 /// # Example
21999 /// ```ignore,no_run
22000 /// # use google_cloud_sql_v1::model::IpConfiguration;
22001 /// use google_cloud_sql_v1::model::PscConfig;
22002 /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
22003 /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
22004 /// ```
22005 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
22006 where
22007 T: std::convert::Into<crate::model::PscConfig>,
22008 {
22009 self.psc_config = v.map(|x| x.into());
22010 self
22011 }
22012
22013 /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22014 ///
22015 /// # Example
22016 /// ```ignore,no_run
22017 /// # use google_cloud_sql_v1::model::IpConfiguration;
22018 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22019 /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
22020 /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
22021 /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
22022 /// ```
22023 pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
22024 where
22025 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22026 {
22027 self.server_ca_mode = std::option::Option::Some(v.into());
22028 self
22029 }
22030
22031 /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22032 ///
22033 /// # Example
22034 /// ```ignore,no_run
22035 /// # use google_cloud_sql_v1::model::IpConfiguration;
22036 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22037 /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
22038 /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
22039 /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
22040 /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
22041 /// ```
22042 pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
22043 where
22044 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22045 {
22046 self.server_ca_mode = v.map(|x| x.into());
22047 self
22048 }
22049
22050 /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
22051 ///
22052 /// # Example
22053 /// ```ignore,no_run
22054 /// # use google_cloud_sql_v1::model::IpConfiguration;
22055 /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
22056 /// ```
22057 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
22058 where
22059 T: std::iter::IntoIterator<Item = V>,
22060 V: std::convert::Into<std::string::String>,
22061 {
22062 use std::iter::Iterator;
22063 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
22064 self
22065 }
22066
22067 /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22068 ///
22069 /// # Example
22070 /// ```ignore,no_run
22071 /// # use google_cloud_sql_v1::model::IpConfiguration;
22072 /// let x = IpConfiguration::new().set_server_ca_pool("example");
22073 /// ```
22074 pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
22075 where
22076 T: std::convert::Into<std::string::String>,
22077 {
22078 self.server_ca_pool = std::option::Option::Some(v.into());
22079 self
22080 }
22081
22082 /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22083 ///
22084 /// # Example
22085 /// ```ignore,no_run
22086 /// # use google_cloud_sql_v1::model::IpConfiguration;
22087 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
22088 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
22089 /// ```
22090 pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
22091 where
22092 T: std::convert::Into<std::string::String>,
22093 {
22094 self.server_ca_pool = v.map(|x| x.into());
22095 self
22096 }
22097
22098 /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22099 ///
22100 /// # Example
22101 /// ```ignore,no_run
22102 /// # use google_cloud_sql_v1::model::IpConfiguration;
22103 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22104 /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
22105 /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
22106 /// ```
22107 pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
22108 where
22109 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22110 {
22111 self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
22112 self
22113 }
22114
22115 /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22116 ///
22117 /// # Example
22118 /// ```ignore,no_run
22119 /// # use google_cloud_sql_v1::model::IpConfiguration;
22120 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22121 /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
22122 /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
22123 /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
22124 /// ```
22125 pub fn set_or_clear_server_certificate_rotation_mode<T>(
22126 mut self,
22127 v: std::option::Option<T>,
22128 ) -> Self
22129 where
22130 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22131 {
22132 self.server_certificate_rotation_mode = v.map(|x| x.into());
22133 self
22134 }
22135}
22136
22137impl wkt::message::Message for IpConfiguration {
22138 fn typename() -> &'static str {
22139 "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
22140 }
22141}
22142
22143/// Defines additional types related to [IpConfiguration].
22144pub mod ip_configuration {
22145 #[allow(unused_imports)]
22146 use super::*;
22147
22148 /// The SSL options for database connections.
22149 ///
22150 /// # Working with unknown values
22151 ///
22152 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22153 /// additional enum variants at any time. Adding new variants is not considered
22154 /// a breaking change. Applications should write their code in anticipation of:
22155 ///
22156 /// - New values appearing in future releases of the client library, **and**
22157 /// - New values received dynamically, without application changes.
22158 ///
22159 /// Please consult the [Working with enums] section in the user guide for some
22160 /// guidelines.
22161 ///
22162 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22163 #[derive(Clone, Debug, PartialEq)]
22164 #[non_exhaustive]
22165 pub enum SslMode {
22166 /// The SSL mode is unknown.
22167 Unspecified,
22168 /// Allow non-SSL/non-TLS and SSL/TLS connections.
22169 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22170 /// isn't verified.
22171 ///
22172 /// When this value is used, the legacy `require_ssl` flag must be false or
22173 /// cleared to avoid a conflict between the values of the two flags.
22174 AllowUnencryptedAndEncrypted,
22175 /// Only allow connections encrypted with SSL/TLS.
22176 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22177 /// isn't verified.
22178 ///
22179 /// When this value is used, the legacy `require_ssl` flag must be false or
22180 /// cleared to avoid a conflict between the values of the two flags.
22181 EncryptedOnly,
22182 /// Only allow connections encrypted with SSL/TLS and with valid
22183 /// client certificates.
22184 ///
22185 /// When this value is used, the legacy `require_ssl` flag must be true or
22186 /// cleared to avoid the conflict between values of two flags.
22187 /// PostgreSQL clients or users that connect using IAM database
22188 /// authentication must use either the
22189 /// [Cloud SQL Auth
22190 /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
22191 /// [Cloud SQL
22192 /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
22193 /// to enforce client identity verification.
22194 ///
22195 /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
22196 TrustedClientCertificateRequired,
22197 /// If set, the enum was initialized with an unknown value.
22198 ///
22199 /// Applications can examine the value using [SslMode::value] or
22200 /// [SslMode::name].
22201 UnknownValue(ssl_mode::UnknownValue),
22202 }
22203
22204 #[doc(hidden)]
22205 pub mod ssl_mode {
22206 #[allow(unused_imports)]
22207 use super::*;
22208 #[derive(Clone, Debug, PartialEq)]
22209 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22210 }
22211
22212 impl SslMode {
22213 /// Gets the enum value.
22214 ///
22215 /// Returns `None` if the enum contains an unknown value deserialized from
22216 /// the string representation of enums.
22217 pub fn value(&self) -> std::option::Option<i32> {
22218 match self {
22219 Self::Unspecified => std::option::Option::Some(0),
22220 Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
22221 Self::EncryptedOnly => std::option::Option::Some(2),
22222 Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
22223 Self::UnknownValue(u) => u.0.value(),
22224 }
22225 }
22226
22227 /// Gets the enum value as a string.
22228 ///
22229 /// Returns `None` if the enum contains an unknown value deserialized from
22230 /// the integer representation of enums.
22231 pub fn name(&self) -> std::option::Option<&str> {
22232 match self {
22233 Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
22234 Self::AllowUnencryptedAndEncrypted => {
22235 std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
22236 }
22237 Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
22238 Self::TrustedClientCertificateRequired => {
22239 std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
22240 }
22241 Self::UnknownValue(u) => u.0.name(),
22242 }
22243 }
22244 }
22245
22246 impl std::default::Default for SslMode {
22247 fn default() -> Self {
22248 use std::convert::From;
22249 Self::from(0)
22250 }
22251 }
22252
22253 impl std::fmt::Display for SslMode {
22254 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22255 wkt::internal::display_enum(f, self.name(), self.value())
22256 }
22257 }
22258
22259 impl std::convert::From<i32> for SslMode {
22260 fn from(value: i32) -> Self {
22261 match value {
22262 0 => Self::Unspecified,
22263 1 => Self::AllowUnencryptedAndEncrypted,
22264 2 => Self::EncryptedOnly,
22265 3 => Self::TrustedClientCertificateRequired,
22266 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22267 wkt::internal::UnknownEnumValue::Integer(value),
22268 )),
22269 }
22270 }
22271 }
22272
22273 impl std::convert::From<&str> for SslMode {
22274 fn from(value: &str) -> Self {
22275 use std::string::ToString;
22276 match value {
22277 "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
22278 "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
22279 "ENCRYPTED_ONLY" => Self::EncryptedOnly,
22280 "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
22281 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22282 wkt::internal::UnknownEnumValue::String(value.to_string()),
22283 )),
22284 }
22285 }
22286 }
22287
22288 impl serde::ser::Serialize for SslMode {
22289 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22290 where
22291 S: serde::Serializer,
22292 {
22293 match self {
22294 Self::Unspecified => serializer.serialize_i32(0),
22295 Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
22296 Self::EncryptedOnly => serializer.serialize_i32(2),
22297 Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
22298 Self::UnknownValue(u) => u.0.serialize(serializer),
22299 }
22300 }
22301 }
22302
22303 impl<'de> serde::de::Deserialize<'de> for SslMode {
22304 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22305 where
22306 D: serde::Deserializer<'de>,
22307 {
22308 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
22309 ".google.cloud.sql.v1.IpConfiguration.SslMode",
22310 ))
22311 }
22312 }
22313
22314 /// Various Certificate Authority (CA) modes for certificate signing.
22315 ///
22316 /// # Working with unknown values
22317 ///
22318 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22319 /// additional enum variants at any time. Adding new variants is not considered
22320 /// a breaking change. Applications should write their code in anticipation of:
22321 ///
22322 /// - New values appearing in future releases of the client library, **and**
22323 /// - New values received dynamically, without application changes.
22324 ///
22325 /// Please consult the [Working with enums] section in the user guide for some
22326 /// guidelines.
22327 ///
22328 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22329 #[derive(Clone, Debug, PartialEq)]
22330 #[non_exhaustive]
22331 pub enum CaMode {
22332 /// CA mode is unspecified. It is effectively the same as
22333 /// `GOOGLE_MANAGED_INTERNAL_CA`.
22334 Unspecified,
22335 /// Google-managed self-signed internal CA.
22336 GoogleManagedInternalCa,
22337 /// Google-managed regional CA part of root CA hierarchy hosted on Google
22338 /// Cloud's Certificate Authority Service (CAS).
22339 GoogleManagedCasCa,
22340 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
22341 /// Service (CAS).
22342 CustomerManagedCasCa,
22343 /// If set, the enum was initialized with an unknown value.
22344 ///
22345 /// Applications can examine the value using [CaMode::value] or
22346 /// [CaMode::name].
22347 UnknownValue(ca_mode::UnknownValue),
22348 }
22349
22350 #[doc(hidden)]
22351 pub mod ca_mode {
22352 #[allow(unused_imports)]
22353 use super::*;
22354 #[derive(Clone, Debug, PartialEq)]
22355 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22356 }
22357
22358 impl CaMode {
22359 /// Gets the enum value.
22360 ///
22361 /// Returns `None` if the enum contains an unknown value deserialized from
22362 /// the string representation of enums.
22363 pub fn value(&self) -> std::option::Option<i32> {
22364 match self {
22365 Self::Unspecified => std::option::Option::Some(0),
22366 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
22367 Self::GoogleManagedCasCa => std::option::Option::Some(2),
22368 Self::CustomerManagedCasCa => std::option::Option::Some(3),
22369 Self::UnknownValue(u) => u.0.value(),
22370 }
22371 }
22372
22373 /// Gets the enum value as a string.
22374 ///
22375 /// Returns `None` if the enum contains an unknown value deserialized from
22376 /// the integer representation of enums.
22377 pub fn name(&self) -> std::option::Option<&str> {
22378 match self {
22379 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
22380 Self::GoogleManagedInternalCa => {
22381 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
22382 }
22383 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
22384 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
22385 Self::UnknownValue(u) => u.0.name(),
22386 }
22387 }
22388 }
22389
22390 impl std::default::Default for CaMode {
22391 fn default() -> Self {
22392 use std::convert::From;
22393 Self::from(0)
22394 }
22395 }
22396
22397 impl std::fmt::Display for CaMode {
22398 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22399 wkt::internal::display_enum(f, self.name(), self.value())
22400 }
22401 }
22402
22403 impl std::convert::From<i32> for CaMode {
22404 fn from(value: i32) -> Self {
22405 match value {
22406 0 => Self::Unspecified,
22407 1 => Self::GoogleManagedInternalCa,
22408 2 => Self::GoogleManagedCasCa,
22409 3 => Self::CustomerManagedCasCa,
22410 _ => Self::UnknownValue(ca_mode::UnknownValue(
22411 wkt::internal::UnknownEnumValue::Integer(value),
22412 )),
22413 }
22414 }
22415 }
22416
22417 impl std::convert::From<&str> for CaMode {
22418 fn from(value: &str) -> Self {
22419 use std::string::ToString;
22420 match value {
22421 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
22422 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
22423 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
22424 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
22425 _ => Self::UnknownValue(ca_mode::UnknownValue(
22426 wkt::internal::UnknownEnumValue::String(value.to_string()),
22427 )),
22428 }
22429 }
22430 }
22431
22432 impl serde::ser::Serialize for CaMode {
22433 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22434 where
22435 S: serde::Serializer,
22436 {
22437 match self {
22438 Self::Unspecified => serializer.serialize_i32(0),
22439 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
22440 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
22441 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
22442 Self::UnknownValue(u) => u.0.serialize(serializer),
22443 }
22444 }
22445 }
22446
22447 impl<'de> serde::de::Deserialize<'de> for CaMode {
22448 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22449 where
22450 D: serde::Deserializer<'de>,
22451 {
22452 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
22453 ".google.cloud.sql.v1.IpConfiguration.CaMode",
22454 ))
22455 }
22456 }
22457
22458 /// Settings for automatic server certificate rotation.
22459 ///
22460 /// # Working with unknown values
22461 ///
22462 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22463 /// additional enum variants at any time. Adding new variants is not considered
22464 /// a breaking change. Applications should write their code in anticipation of:
22465 ///
22466 /// - New values appearing in future releases of the client library, **and**
22467 /// - New values received dynamically, without application changes.
22468 ///
22469 /// Please consult the [Working with enums] section in the user guide for some
22470 /// guidelines.
22471 ///
22472 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
22473 #[derive(Clone, Debug, PartialEq)]
22474 #[non_exhaustive]
22475 pub enum ServerCertificateRotationMode {
22476 /// Unspecified: no automatic server certificate rotation.
22477 Unspecified,
22478 /// No automatic server certificate rotation. The user must [manage server
22479 /// certificate
22480 /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
22481 /// on their side.
22482 NoAutomaticRotation,
22483 /// Automatic server certificate rotation during Cloud SQL scheduled
22484 /// maintenance or self-service maintenance updates. Requires
22485 /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
22486 /// `CUSTOMER_MANAGED_CAS_CA`.
22487 AutomaticRotationDuringMaintenance,
22488 /// If set, the enum was initialized with an unknown value.
22489 ///
22490 /// Applications can examine the value using [ServerCertificateRotationMode::value] or
22491 /// [ServerCertificateRotationMode::name].
22492 UnknownValue(server_certificate_rotation_mode::UnknownValue),
22493 }
22494
22495 #[doc(hidden)]
22496 pub mod server_certificate_rotation_mode {
22497 #[allow(unused_imports)]
22498 use super::*;
22499 #[derive(Clone, Debug, PartialEq)]
22500 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22501 }
22502
22503 impl ServerCertificateRotationMode {
22504 /// Gets the enum value.
22505 ///
22506 /// Returns `None` if the enum contains an unknown value deserialized from
22507 /// the string representation of enums.
22508 pub fn value(&self) -> std::option::Option<i32> {
22509 match self {
22510 Self::Unspecified => std::option::Option::Some(0),
22511 Self::NoAutomaticRotation => std::option::Option::Some(1),
22512 Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
22513 Self::UnknownValue(u) => u.0.value(),
22514 }
22515 }
22516
22517 /// Gets the enum value as a string.
22518 ///
22519 /// Returns `None` if the enum contains an unknown value deserialized from
22520 /// the integer representation of enums.
22521 pub fn name(&self) -> std::option::Option<&str> {
22522 match self {
22523 Self::Unspecified => {
22524 std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
22525 }
22526 Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
22527 Self::AutomaticRotationDuringMaintenance => {
22528 std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
22529 }
22530 Self::UnknownValue(u) => u.0.name(),
22531 }
22532 }
22533 }
22534
22535 impl std::default::Default for ServerCertificateRotationMode {
22536 fn default() -> Self {
22537 use std::convert::From;
22538 Self::from(0)
22539 }
22540 }
22541
22542 impl std::fmt::Display for ServerCertificateRotationMode {
22543 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22544 wkt::internal::display_enum(f, self.name(), self.value())
22545 }
22546 }
22547
22548 impl std::convert::From<i32> for ServerCertificateRotationMode {
22549 fn from(value: i32) -> Self {
22550 match value {
22551 0 => Self::Unspecified,
22552 1 => Self::NoAutomaticRotation,
22553 2 => Self::AutomaticRotationDuringMaintenance,
22554 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22555 wkt::internal::UnknownEnumValue::Integer(value),
22556 )),
22557 }
22558 }
22559 }
22560
22561 impl std::convert::From<&str> for ServerCertificateRotationMode {
22562 fn from(value: &str) -> Self {
22563 use std::string::ToString;
22564 match value {
22565 "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
22566 "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
22567 "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
22568 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22569 wkt::internal::UnknownEnumValue::String(value.to_string()),
22570 )),
22571 }
22572 }
22573 }
22574
22575 impl serde::ser::Serialize for ServerCertificateRotationMode {
22576 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22577 where
22578 S: serde::Serializer,
22579 {
22580 match self {
22581 Self::Unspecified => serializer.serialize_i32(0),
22582 Self::NoAutomaticRotation => serializer.serialize_i32(1),
22583 Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
22584 Self::UnknownValue(u) => u.0.serialize(serializer),
22585 }
22586 }
22587 }
22588
22589 impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
22590 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22591 where
22592 D: serde::Deserializer<'de>,
22593 {
22594 deserializer.deserialize_any(
22595 wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
22596 ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
22597 ),
22598 )
22599 }
22600 }
22601}
22602
22603/// PSC settings for a Cloud SQL instance.
22604#[derive(Clone, Default, PartialEq)]
22605#[non_exhaustive]
22606pub struct PscConfig {
22607 /// Whether PSC connectivity is enabled for this instance.
22608 pub psc_enabled: std::option::Option<bool>,
22609
22610 /// Optional. The list of consumer projects that are allow-listed for PSC
22611 /// connections to this instance. This instance can be connected to with PSC
22612 /// from any network in these projects.
22613 ///
22614 /// Each consumer project in this list may be represented by a project number
22615 /// (numeric) or by a project id (alphanumeric).
22616 pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
22617
22618 /// Optional. The list of settings for requested Private Service Connect
22619 /// consumer endpoints that can be used to connect to this Cloud SQL instance.
22620 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
22621
22622 /// Optional. The network attachment of the consumer network that the
22623 /// Private Service Connect enabled Cloud SQL instance is
22624 /// authorized to connect via PSC interface.
22625 /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
22626 pub network_attachment_uri: std::string::String,
22627
22628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22629}
22630
22631impl PscConfig {
22632 pub fn new() -> Self {
22633 std::default::Default::default()
22634 }
22635
22636 /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22637 ///
22638 /// # Example
22639 /// ```ignore,no_run
22640 /// # use google_cloud_sql_v1::model::PscConfig;
22641 /// let x = PscConfig::new().set_psc_enabled(true);
22642 /// ```
22643 pub fn set_psc_enabled<T>(mut self, v: T) -> Self
22644 where
22645 T: std::convert::Into<bool>,
22646 {
22647 self.psc_enabled = std::option::Option::Some(v.into());
22648 self
22649 }
22650
22651 /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22652 ///
22653 /// # Example
22654 /// ```ignore,no_run
22655 /// # use google_cloud_sql_v1::model::PscConfig;
22656 /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
22657 /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
22658 /// ```
22659 pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22660 where
22661 T: std::convert::Into<bool>,
22662 {
22663 self.psc_enabled = v.map(|x| x.into());
22664 self
22665 }
22666
22667 /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
22668 ///
22669 /// # Example
22670 /// ```ignore,no_run
22671 /// # use google_cloud_sql_v1::model::PscConfig;
22672 /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
22673 /// ```
22674 pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
22675 where
22676 T: std::iter::IntoIterator<Item = V>,
22677 V: std::convert::Into<std::string::String>,
22678 {
22679 use std::iter::Iterator;
22680 self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
22681 self
22682 }
22683
22684 /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
22685 ///
22686 /// # Example
22687 /// ```ignore,no_run
22688 /// # use google_cloud_sql_v1::model::PscConfig;
22689 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22690 /// let x = PscConfig::new()
22691 /// .set_psc_auto_connections([
22692 /// PscAutoConnectionConfig::default()/* use setters */,
22693 /// PscAutoConnectionConfig::default()/* use (different) setters */,
22694 /// ]);
22695 /// ```
22696 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
22697 where
22698 T: std::iter::IntoIterator<Item = V>,
22699 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
22700 {
22701 use std::iter::Iterator;
22702 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
22703 self
22704 }
22705
22706 /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
22707 ///
22708 /// # Example
22709 /// ```ignore,no_run
22710 /// # use google_cloud_sql_v1::model::PscConfig;
22711 /// let x = PscConfig::new().set_network_attachment_uri("example");
22712 /// ```
22713 pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
22714 mut self,
22715 v: T,
22716 ) -> Self {
22717 self.network_attachment_uri = v.into();
22718 self
22719 }
22720}
22721
22722impl wkt::message::Message for PscConfig {
22723 fn typename() -> &'static str {
22724 "type.googleapis.com/google.cloud.sql.v1.PscConfig"
22725 }
22726}
22727
22728/// Settings for an automatically-setup Private Service Connect consumer endpoint
22729/// that is used to connect to a Cloud SQL instance.
22730#[derive(Clone, Default, PartialEq)]
22731#[non_exhaustive]
22732pub struct PscAutoConnectionConfig {
22733 /// Optional. This is the project ID of consumer service project of this
22734 /// consumer endpoint.
22735 ///
22736 /// Optional. This is only applicable if consumer_network is a shared vpc
22737 /// network.
22738 pub consumer_project: std::string::String,
22739
22740 /// Optional. The consumer network of this consumer endpoint. This must be a
22741 /// resource path that includes both the host project and the network name.
22742 ///
22743 /// For example, `projects/project1/global/networks/network1`.
22744 ///
22745 /// The consumer host project of this network might be different from the
22746 /// consumer service project.
22747 pub consumer_network: std::string::String,
22748
22749 /// The IP address of the consumer endpoint.
22750 pub ip_address: std::option::Option<std::string::String>,
22751
22752 /// The connection status of the consumer endpoint.
22753 pub status: std::option::Option<std::string::String>,
22754
22755 /// The connection policy status of the consumer network.
22756 pub consumer_network_status: std::option::Option<std::string::String>,
22757
22758 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22759}
22760
22761impl PscAutoConnectionConfig {
22762 pub fn new() -> Self {
22763 std::default::Default::default()
22764 }
22765
22766 /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
22767 ///
22768 /// # Example
22769 /// ```ignore,no_run
22770 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22771 /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
22772 /// ```
22773 pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
22774 mut self,
22775 v: T,
22776 ) -> Self {
22777 self.consumer_project = v.into();
22778 self
22779 }
22780
22781 /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
22782 ///
22783 /// # Example
22784 /// ```ignore,no_run
22785 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22786 /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
22787 /// ```
22788 pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
22789 mut self,
22790 v: T,
22791 ) -> Self {
22792 self.consumer_network = v.into();
22793 self
22794 }
22795
22796 /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
22797 ///
22798 /// # Example
22799 /// ```ignore,no_run
22800 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22801 /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
22802 /// ```
22803 pub fn set_ip_address<T>(mut self, v: T) -> Self
22804 where
22805 T: std::convert::Into<std::string::String>,
22806 {
22807 self.ip_address = std::option::Option::Some(v.into());
22808 self
22809 }
22810
22811 /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
22812 ///
22813 /// # Example
22814 /// ```ignore,no_run
22815 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22816 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
22817 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
22818 /// ```
22819 pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
22820 where
22821 T: std::convert::Into<std::string::String>,
22822 {
22823 self.ip_address = v.map(|x| x.into());
22824 self
22825 }
22826
22827 /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
22828 ///
22829 /// # Example
22830 /// ```ignore,no_run
22831 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22832 /// let x = PscAutoConnectionConfig::new().set_status("example");
22833 /// ```
22834 pub fn set_status<T>(mut self, v: T) -> Self
22835 where
22836 T: std::convert::Into<std::string::String>,
22837 {
22838 self.status = std::option::Option::Some(v.into());
22839 self
22840 }
22841
22842 /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
22843 ///
22844 /// # Example
22845 /// ```ignore,no_run
22846 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22847 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
22848 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
22849 /// ```
22850 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
22851 where
22852 T: std::convert::Into<std::string::String>,
22853 {
22854 self.status = v.map(|x| x.into());
22855 self
22856 }
22857
22858 /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
22859 ///
22860 /// # Example
22861 /// ```ignore,no_run
22862 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22863 /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
22864 /// ```
22865 pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
22866 where
22867 T: std::convert::Into<std::string::String>,
22868 {
22869 self.consumer_network_status = std::option::Option::Some(v.into());
22870 self
22871 }
22872
22873 /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
22874 ///
22875 /// # Example
22876 /// ```ignore,no_run
22877 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22878 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
22879 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
22880 /// ```
22881 pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
22882 where
22883 T: std::convert::Into<std::string::String>,
22884 {
22885 self.consumer_network_status = v.map(|x| x.into());
22886 self
22887 }
22888}
22889
22890impl wkt::message::Message for PscAutoConnectionConfig {
22891 fn typename() -> &'static str {
22892 "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
22893 }
22894}
22895
22896/// Preferred location. This specifies where a Cloud SQL instance is located.
22897/// Note that if the preferred location is not available, the instance will be
22898/// located as close as possible within the region. Only one location may be
22899/// specified.
22900#[derive(Clone, Default, PartialEq)]
22901#[non_exhaustive]
22902pub struct LocationPreference {
22903 /// The App Engine application to follow, it must be in the same region as the
22904 /// Cloud SQL instance. WARNING: Changing this might restart the instance.
22905 #[deprecated]
22906 pub follow_gae_application: std::string::String,
22907
22908 /// The preferred Compute Engine zone (for example: us-central1-a,
22909 /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
22910 pub zone: std::string::String,
22911
22912 /// The preferred Compute Engine zone for the secondary/failover
22913 /// (for example: us-central1-a, us-central1-b, etc.).
22914 /// To disable this field, set it to 'no_secondary_zone'.
22915 pub secondary_zone: std::string::String,
22916
22917 /// This is always `sql#locationPreference`.
22918 pub kind: std::string::String,
22919
22920 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22921}
22922
22923impl LocationPreference {
22924 pub fn new() -> Self {
22925 std::default::Default::default()
22926 }
22927
22928 /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
22929 ///
22930 /// # Example
22931 /// ```ignore,no_run
22932 /// # use google_cloud_sql_v1::model::LocationPreference;
22933 /// let x = LocationPreference::new().set_follow_gae_application("example");
22934 /// ```
22935 #[deprecated]
22936 pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
22937 mut self,
22938 v: T,
22939 ) -> Self {
22940 self.follow_gae_application = v.into();
22941 self
22942 }
22943
22944 /// Sets the value of [zone][crate::model::LocationPreference::zone].
22945 ///
22946 /// # Example
22947 /// ```ignore,no_run
22948 /// # use google_cloud_sql_v1::model::LocationPreference;
22949 /// let x = LocationPreference::new().set_zone("example");
22950 /// ```
22951 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22952 self.zone = v.into();
22953 self
22954 }
22955
22956 /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
22957 ///
22958 /// # Example
22959 /// ```ignore,no_run
22960 /// # use google_cloud_sql_v1::model::LocationPreference;
22961 /// let x = LocationPreference::new().set_secondary_zone("example");
22962 /// ```
22963 pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22964 self.secondary_zone = v.into();
22965 self
22966 }
22967
22968 /// Sets the value of [kind][crate::model::LocationPreference::kind].
22969 ///
22970 /// # Example
22971 /// ```ignore,no_run
22972 /// # use google_cloud_sql_v1::model::LocationPreference;
22973 /// let x = LocationPreference::new().set_kind("example");
22974 /// ```
22975 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22976 self.kind = v.into();
22977 self
22978 }
22979}
22980
22981impl wkt::message::Message for LocationPreference {
22982 fn typename() -> &'static str {
22983 "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
22984 }
22985}
22986
22987/// Maintenance window. This specifies when a Cloud SQL instance is
22988/// restarted for system maintenance purposes.
22989#[derive(Clone, Default, PartialEq)]
22990#[non_exhaustive]
22991pub struct MaintenanceWindow {
22992 /// Hour of day - 0 to 23. Specify in the UTC time zone.
22993 pub hour: std::option::Option<wkt::Int32Value>,
22994
22995 /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
22996 /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
22997 /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
22998 pub day: std::option::Option<wkt::Int32Value>,
22999
23000 /// Maintenance timing settings: `canary`, `stable`, or `week5`.
23001 /// For more information, see [About maintenance on Cloud SQL
23002 /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
23003 pub update_track: crate::model::SqlUpdateTrack,
23004
23005 /// This is always `sql#maintenanceWindow`.
23006 pub kind: std::string::String,
23007
23008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23009}
23010
23011impl MaintenanceWindow {
23012 pub fn new() -> Self {
23013 std::default::Default::default()
23014 }
23015
23016 /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
23017 ///
23018 /// # Example
23019 /// ```ignore,no_run
23020 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23021 /// use wkt::Int32Value;
23022 /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
23023 /// ```
23024 pub fn set_hour<T>(mut self, v: T) -> Self
23025 where
23026 T: std::convert::Into<wkt::Int32Value>,
23027 {
23028 self.hour = std::option::Option::Some(v.into());
23029 self
23030 }
23031
23032 /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
23033 ///
23034 /// # Example
23035 /// ```ignore,no_run
23036 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23037 /// use wkt::Int32Value;
23038 /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
23039 /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
23040 /// ```
23041 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
23042 where
23043 T: std::convert::Into<wkt::Int32Value>,
23044 {
23045 self.hour = v.map(|x| x.into());
23046 self
23047 }
23048
23049 /// Sets the value of [day][crate::model::MaintenanceWindow::day].
23050 ///
23051 /// # Example
23052 /// ```ignore,no_run
23053 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23054 /// use wkt::Int32Value;
23055 /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
23056 /// ```
23057 pub fn set_day<T>(mut self, v: T) -> Self
23058 where
23059 T: std::convert::Into<wkt::Int32Value>,
23060 {
23061 self.day = std::option::Option::Some(v.into());
23062 self
23063 }
23064
23065 /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
23066 ///
23067 /// # Example
23068 /// ```ignore,no_run
23069 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23070 /// use wkt::Int32Value;
23071 /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
23072 /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
23073 /// ```
23074 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
23075 where
23076 T: std::convert::Into<wkt::Int32Value>,
23077 {
23078 self.day = v.map(|x| x.into());
23079 self
23080 }
23081
23082 /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
23083 ///
23084 /// # Example
23085 /// ```ignore,no_run
23086 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23087 /// use google_cloud_sql_v1::model::SqlUpdateTrack;
23088 /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
23089 /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
23090 /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
23091 /// ```
23092 pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
23093 mut self,
23094 v: T,
23095 ) -> Self {
23096 self.update_track = v.into();
23097 self
23098 }
23099
23100 /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
23101 ///
23102 /// # Example
23103 /// ```ignore,no_run
23104 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23105 /// let x = MaintenanceWindow::new().set_kind("example");
23106 /// ```
23107 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23108 self.kind = v.into();
23109 self
23110 }
23111}
23112
23113impl wkt::message::Message for MaintenanceWindow {
23114 fn typename() -> &'static str {
23115 "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
23116 }
23117}
23118
23119/// Deny maintenance Periods. This specifies a date range during when all CSA
23120/// rollout will be denied.
23121#[derive(Clone, Default, PartialEq)]
23122#[non_exhaustive]
23123pub struct DenyMaintenancePeriod {
23124 /// "deny maintenance period" start date. If the year of the start date is
23125 /// empty, the year of the end date also must be empty. In this case, it means
23126 /// the deny maintenance period recurs every year. The date is in format
23127 /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
23128 pub start_date: std::string::String,
23129
23130 /// "deny maintenance period" end date. If the year of the end date is empty,
23131 /// the year of the start date also must be empty. In this case, it means the
23132 /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
23133 /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
23134 pub end_date: std::string::String,
23135
23136 /// Time in UTC when the "deny maintenance period" starts on start_date and
23137 /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
23138 pub time: std::string::String,
23139
23140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23141}
23142
23143impl DenyMaintenancePeriod {
23144 pub fn new() -> Self {
23145 std::default::Default::default()
23146 }
23147
23148 /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
23149 ///
23150 /// # Example
23151 /// ```ignore,no_run
23152 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23153 /// let x = DenyMaintenancePeriod::new().set_start_date("example");
23154 /// ```
23155 pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23156 self.start_date = v.into();
23157 self
23158 }
23159
23160 /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
23161 ///
23162 /// # Example
23163 /// ```ignore,no_run
23164 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23165 /// let x = DenyMaintenancePeriod::new().set_end_date("example");
23166 /// ```
23167 pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23168 self.end_date = v.into();
23169 self
23170 }
23171
23172 /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
23173 ///
23174 /// # Example
23175 /// ```ignore,no_run
23176 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23177 /// let x = DenyMaintenancePeriod::new().set_time("example");
23178 /// ```
23179 pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23180 self.time = v.into();
23181 self
23182 }
23183}
23184
23185impl wkt::message::Message for DenyMaintenancePeriod {
23186 fn typename() -> &'static str {
23187 "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
23188 }
23189}
23190
23191/// Insights configuration. This specifies when Cloud SQL Insights feature is
23192/// enabled and optional configuration.
23193#[derive(Clone, Default, PartialEq)]
23194#[non_exhaustive]
23195pub struct InsightsConfig {
23196 /// Whether Query Insights feature is enabled.
23197 pub query_insights_enabled: bool,
23198
23199 /// Whether Query Insights will record client address when enabled.
23200 pub record_client_address: bool,
23201
23202 /// Whether Query Insights will record application tags from query when
23203 /// enabled.
23204 pub record_application_tags: bool,
23205
23206 /// Maximum query length stored in bytes. Default value: 1024 bytes.
23207 /// Range: 256-4500 bytes. Query lengths greater than this field value will be
23208 /// truncated to this value. When unset, query length will be the default
23209 /// value. Changing query length will restart the database.
23210 pub query_string_length: std::option::Option<wkt::Int32Value>,
23211
23212 /// Number of query execution plans captured by Insights per minute
23213 /// for all queries combined. Default is 5.
23214 pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
23215
23216 /// Optional. Whether enhanced query insights feature is enabled.
23217 pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
23218
23219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23220}
23221
23222impl InsightsConfig {
23223 pub fn new() -> Self {
23224 std::default::Default::default()
23225 }
23226
23227 /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
23228 ///
23229 /// # Example
23230 /// ```ignore,no_run
23231 /// # use google_cloud_sql_v1::model::InsightsConfig;
23232 /// let x = InsightsConfig::new().set_query_insights_enabled(true);
23233 /// ```
23234 pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23235 self.query_insights_enabled = v.into();
23236 self
23237 }
23238
23239 /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
23240 ///
23241 /// # Example
23242 /// ```ignore,no_run
23243 /// # use google_cloud_sql_v1::model::InsightsConfig;
23244 /// let x = InsightsConfig::new().set_record_client_address(true);
23245 /// ```
23246 pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23247 self.record_client_address = v.into();
23248 self
23249 }
23250
23251 /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
23252 ///
23253 /// # Example
23254 /// ```ignore,no_run
23255 /// # use google_cloud_sql_v1::model::InsightsConfig;
23256 /// let x = InsightsConfig::new().set_record_application_tags(true);
23257 /// ```
23258 pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23259 self.record_application_tags = v.into();
23260 self
23261 }
23262
23263 /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23264 ///
23265 /// # Example
23266 /// ```ignore,no_run
23267 /// # use google_cloud_sql_v1::model::InsightsConfig;
23268 /// use wkt::Int32Value;
23269 /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
23270 /// ```
23271 pub fn set_query_string_length<T>(mut self, v: T) -> Self
23272 where
23273 T: std::convert::Into<wkt::Int32Value>,
23274 {
23275 self.query_string_length = std::option::Option::Some(v.into());
23276 self
23277 }
23278
23279 /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23280 ///
23281 /// # Example
23282 /// ```ignore,no_run
23283 /// # use google_cloud_sql_v1::model::InsightsConfig;
23284 /// use wkt::Int32Value;
23285 /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
23286 /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
23287 /// ```
23288 pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
23289 where
23290 T: std::convert::Into<wkt::Int32Value>,
23291 {
23292 self.query_string_length = v.map(|x| x.into());
23293 self
23294 }
23295
23296 /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23297 ///
23298 /// # Example
23299 /// ```ignore,no_run
23300 /// # use google_cloud_sql_v1::model::InsightsConfig;
23301 /// use wkt::Int32Value;
23302 /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
23303 /// ```
23304 pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
23305 where
23306 T: std::convert::Into<wkt::Int32Value>,
23307 {
23308 self.query_plans_per_minute = std::option::Option::Some(v.into());
23309 self
23310 }
23311
23312 /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23313 ///
23314 /// # Example
23315 /// ```ignore,no_run
23316 /// # use google_cloud_sql_v1::model::InsightsConfig;
23317 /// use wkt::Int32Value;
23318 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
23319 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
23320 /// ```
23321 pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
23322 where
23323 T: std::convert::Into<wkt::Int32Value>,
23324 {
23325 self.query_plans_per_minute = v.map(|x| x.into());
23326 self
23327 }
23328
23329 /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23330 ///
23331 /// # Example
23332 /// ```ignore,no_run
23333 /// # use google_cloud_sql_v1::model::InsightsConfig;
23334 /// use wkt::BoolValue;
23335 /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
23336 /// ```
23337 pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
23338 where
23339 T: std::convert::Into<wkt::BoolValue>,
23340 {
23341 self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
23342 self
23343 }
23344
23345 /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23346 ///
23347 /// # Example
23348 /// ```ignore,no_run
23349 /// # use google_cloud_sql_v1::model::InsightsConfig;
23350 /// use wkt::BoolValue;
23351 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
23352 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
23353 /// ```
23354 pub fn set_or_clear_enhanced_query_insights_enabled<T>(
23355 mut self,
23356 v: std::option::Option<T>,
23357 ) -> Self
23358 where
23359 T: std::convert::Into<wkt::BoolValue>,
23360 {
23361 self.enhanced_query_insights_enabled = v.map(|x| x.into());
23362 self
23363 }
23364}
23365
23366impl wkt::message::Message for InsightsConfig {
23367 fn typename() -> &'static str {
23368 "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
23369 }
23370}
23371
23372/// Read-replica configuration specific to MySQL databases.
23373#[derive(Clone, Default, PartialEq)]
23374#[non_exhaustive]
23375pub struct MySqlReplicaConfiguration {
23376 /// Path to a SQL dump file in Google Cloud Storage from which the replica
23377 /// instance is to be created. The URI is in the form gs://bucketName/fileName.
23378 /// Compressed gzip files (.gz) are also supported.
23379 /// Dumps have the binlog co-ordinates from which replication
23380 /// begins. This can be accomplished by setting --master-data to 1 when using
23381 /// mysqldump.
23382 pub dump_file_path: std::string::String,
23383
23384 /// The username for the replication connection.
23385 pub username: std::string::String,
23386
23387 /// The password for the replication connection.
23388 pub password: std::string::String,
23389
23390 /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
23391 pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
23392
23393 /// Interval in milliseconds between replication heartbeats.
23394 pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
23395
23396 /// PEM representation of the trusted CA's x509 certificate.
23397 pub ca_certificate: std::string::String,
23398
23399 /// PEM representation of the replica's x509 certificate.
23400 pub client_certificate: std::string::String,
23401
23402 /// PEM representation of the replica's private key. The corresponding public
23403 /// key is encoded in the client's certificate.
23404 pub client_key: std::string::String,
23405
23406 /// A list of permissible ciphers to use for SSL encryption.
23407 pub ssl_cipher: std::string::String,
23408
23409 /// Whether or not to check the primary instance's Common Name value in the
23410 /// certificate that it sends during the SSL handshake.
23411 pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
23412
23413 /// This is always `sql#mysqlReplicaConfiguration`.
23414 pub kind: std::string::String,
23415
23416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23417}
23418
23419impl MySqlReplicaConfiguration {
23420 pub fn new() -> Self {
23421 std::default::Default::default()
23422 }
23423
23424 /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
23425 ///
23426 /// # Example
23427 /// ```ignore,no_run
23428 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23429 /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
23430 /// ```
23431 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23432 self.dump_file_path = v.into();
23433 self
23434 }
23435
23436 /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
23437 ///
23438 /// # Example
23439 /// ```ignore,no_run
23440 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23441 /// let x = MySqlReplicaConfiguration::new().set_username("example");
23442 /// ```
23443 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23444 self.username = v.into();
23445 self
23446 }
23447
23448 /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
23449 ///
23450 /// # Example
23451 /// ```ignore,no_run
23452 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23453 /// let x = MySqlReplicaConfiguration::new().set_password("example");
23454 /// ```
23455 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23456 self.password = v.into();
23457 self
23458 }
23459
23460 /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23461 ///
23462 /// # Example
23463 /// ```ignore,no_run
23464 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23465 /// use wkt::Int32Value;
23466 /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
23467 /// ```
23468 pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
23469 where
23470 T: std::convert::Into<wkt::Int32Value>,
23471 {
23472 self.connect_retry_interval = std::option::Option::Some(v.into());
23473 self
23474 }
23475
23476 /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23477 ///
23478 /// # Example
23479 /// ```ignore,no_run
23480 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23481 /// use wkt::Int32Value;
23482 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
23483 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
23484 /// ```
23485 pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
23486 where
23487 T: std::convert::Into<wkt::Int32Value>,
23488 {
23489 self.connect_retry_interval = v.map(|x| x.into());
23490 self
23491 }
23492
23493 /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23494 ///
23495 /// # Example
23496 /// ```ignore,no_run
23497 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23498 /// use wkt::Int64Value;
23499 /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
23500 /// ```
23501 pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
23502 where
23503 T: std::convert::Into<wkt::Int64Value>,
23504 {
23505 self.master_heartbeat_period = std::option::Option::Some(v.into());
23506 self
23507 }
23508
23509 /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23510 ///
23511 /// # Example
23512 /// ```ignore,no_run
23513 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23514 /// use wkt::Int64Value;
23515 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
23516 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
23517 /// ```
23518 pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
23519 where
23520 T: std::convert::Into<wkt::Int64Value>,
23521 {
23522 self.master_heartbeat_period = v.map(|x| x.into());
23523 self
23524 }
23525
23526 /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
23527 ///
23528 /// # Example
23529 /// ```ignore,no_run
23530 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23531 /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
23532 /// ```
23533 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23534 self.ca_certificate = v.into();
23535 self
23536 }
23537
23538 /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
23539 ///
23540 /// # Example
23541 /// ```ignore,no_run
23542 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23543 /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
23544 /// ```
23545 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
23546 mut self,
23547 v: T,
23548 ) -> Self {
23549 self.client_certificate = v.into();
23550 self
23551 }
23552
23553 /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
23554 ///
23555 /// # Example
23556 /// ```ignore,no_run
23557 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23558 /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
23559 /// ```
23560 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23561 self.client_key = v.into();
23562 self
23563 }
23564
23565 /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
23566 ///
23567 /// # Example
23568 /// ```ignore,no_run
23569 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23570 /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
23571 /// ```
23572 pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23573 self.ssl_cipher = v.into();
23574 self
23575 }
23576
23577 /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23578 ///
23579 /// # Example
23580 /// ```ignore,no_run
23581 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23582 /// use wkt::BoolValue;
23583 /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
23584 /// ```
23585 pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
23586 where
23587 T: std::convert::Into<wkt::BoolValue>,
23588 {
23589 self.verify_server_certificate = std::option::Option::Some(v.into());
23590 self
23591 }
23592
23593 /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23594 ///
23595 /// # Example
23596 /// ```ignore,no_run
23597 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23598 /// use wkt::BoolValue;
23599 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
23600 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
23601 /// ```
23602 pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23603 where
23604 T: std::convert::Into<wkt::BoolValue>,
23605 {
23606 self.verify_server_certificate = v.map(|x| x.into());
23607 self
23608 }
23609
23610 /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
23611 ///
23612 /// # Example
23613 /// ```ignore,no_run
23614 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23615 /// let x = MySqlReplicaConfiguration::new().set_kind("example");
23616 /// ```
23617 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23618 self.kind = v.into();
23619 self
23620 }
23621}
23622
23623impl wkt::message::Message for MySqlReplicaConfiguration {
23624 fn typename() -> &'static str {
23625 "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
23626 }
23627}
23628
23629/// Disk encryption configuration for an instance.
23630#[derive(Clone, Default, PartialEq)]
23631#[non_exhaustive]
23632pub struct DiskEncryptionConfiguration {
23633 /// Resource name of KMS key for disk encryption
23634 pub kms_key_name: std::string::String,
23635
23636 /// This is always `sql#diskEncryptionConfiguration`.
23637 pub kind: std::string::String,
23638
23639 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23640}
23641
23642impl DiskEncryptionConfiguration {
23643 pub fn new() -> Self {
23644 std::default::Default::default()
23645 }
23646
23647 /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
23648 ///
23649 /// # Example
23650 /// ```ignore,no_run
23651 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23652 /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
23653 /// ```
23654 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23655 self.kms_key_name = v.into();
23656 self
23657 }
23658
23659 /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
23660 ///
23661 /// # Example
23662 /// ```ignore,no_run
23663 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23664 /// let x = DiskEncryptionConfiguration::new().set_kind("example");
23665 /// ```
23666 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23667 self.kind = v.into();
23668 self
23669 }
23670}
23671
23672impl wkt::message::Message for DiskEncryptionConfiguration {
23673 fn typename() -> &'static str {
23674 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
23675 }
23676}
23677
23678/// Disk encryption status for an instance.
23679#[derive(Clone, Default, PartialEq)]
23680#[non_exhaustive]
23681pub struct DiskEncryptionStatus {
23682 /// KMS key version used to encrypt the Cloud SQL instance resource
23683 pub kms_key_version_name: std::string::String,
23684
23685 /// This is always `sql#diskEncryptionStatus`.
23686 pub kind: std::string::String,
23687
23688 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23689}
23690
23691impl DiskEncryptionStatus {
23692 pub fn new() -> Self {
23693 std::default::Default::default()
23694 }
23695
23696 /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
23697 ///
23698 /// # Example
23699 /// ```ignore,no_run
23700 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23701 /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
23702 /// ```
23703 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
23704 mut self,
23705 v: T,
23706 ) -> Self {
23707 self.kms_key_version_name = v.into();
23708 self
23709 }
23710
23711 /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
23712 ///
23713 /// # Example
23714 /// ```ignore,no_run
23715 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23716 /// let x = DiskEncryptionStatus::new().set_kind("example");
23717 /// ```
23718 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23719 self.kind = v.into();
23720 self
23721 }
23722}
23723
23724impl wkt::message::Message for DiskEncryptionStatus {
23725 fn typename() -> &'static str {
23726 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
23727 }
23728}
23729
23730/// Database instance IP mapping
23731#[derive(Clone, Default, PartialEq)]
23732#[non_exhaustive]
23733pub struct IpMapping {
23734 /// The type of this IP address. A `PRIMARY` address is a public address that
23735 /// can accept incoming connections. A `PRIVATE` address is a private address
23736 /// that can accept incoming connections. An `OUTGOING` address is the source
23737 /// address of connections originating from the instance, if supported.
23738 pub r#type: crate::model::SqlIpAddressType,
23739
23740 /// The IP address assigned.
23741 pub ip_address: std::string::String,
23742
23743 /// The due time for this IP to be retired in
23744 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
23745 /// `2012-11-15T16:19:00.094Z`. This field is only available when
23746 /// the IP is scheduled to be retired.
23747 pub time_to_retire: std::option::Option<wkt::Timestamp>,
23748
23749 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23750}
23751
23752impl IpMapping {
23753 pub fn new() -> Self {
23754 std::default::Default::default()
23755 }
23756
23757 /// Sets the value of [r#type][crate::model::IpMapping::type].
23758 ///
23759 /// # Example
23760 /// ```ignore,no_run
23761 /// # use google_cloud_sql_v1::model::IpMapping;
23762 /// use google_cloud_sql_v1::model::SqlIpAddressType;
23763 /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
23764 /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
23765 /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
23766 /// ```
23767 pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
23768 self.r#type = v.into();
23769 self
23770 }
23771
23772 /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
23773 ///
23774 /// # Example
23775 /// ```ignore,no_run
23776 /// # use google_cloud_sql_v1::model::IpMapping;
23777 /// let x = IpMapping::new().set_ip_address("example");
23778 /// ```
23779 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23780 self.ip_address = v.into();
23781 self
23782 }
23783
23784 /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
23785 ///
23786 /// # Example
23787 /// ```ignore,no_run
23788 /// # use google_cloud_sql_v1::model::IpMapping;
23789 /// use wkt::Timestamp;
23790 /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
23791 /// ```
23792 pub fn set_time_to_retire<T>(mut self, v: T) -> Self
23793 where
23794 T: std::convert::Into<wkt::Timestamp>,
23795 {
23796 self.time_to_retire = std::option::Option::Some(v.into());
23797 self
23798 }
23799
23800 /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
23801 ///
23802 /// # Example
23803 /// ```ignore,no_run
23804 /// # use google_cloud_sql_v1::model::IpMapping;
23805 /// use wkt::Timestamp;
23806 /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
23807 /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
23808 /// ```
23809 pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
23810 where
23811 T: std::convert::Into<wkt::Timestamp>,
23812 {
23813 self.time_to_retire = v.map(|x| x.into());
23814 self
23815 }
23816}
23817
23818impl wkt::message::Message for IpMapping {
23819 fn typename() -> &'static str {
23820 "type.googleapis.com/google.cloud.sql.v1.IpMapping"
23821 }
23822}
23823
23824/// The sub operation type based on the operation type.
23825#[derive(Clone, Default, PartialEq)]
23826#[non_exhaustive]
23827pub struct SqlSubOperationType {
23828 /// Sub operation details corresponding to the operation type.
23829 pub sub_operation_details:
23830 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
23831
23832 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23833}
23834
23835impl SqlSubOperationType {
23836 pub fn new() -> Self {
23837 std::default::Default::default()
23838 }
23839
23840 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
23841 ///
23842 /// Note that all the setters affecting `sub_operation_details` are mutually
23843 /// exclusive.
23844 ///
23845 /// # Example
23846 /// ```ignore,no_run
23847 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
23848 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
23849 /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
23850 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
23851 /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
23852 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
23853 /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
23854 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
23855 /// ```
23856 pub fn set_sub_operation_details<
23857 T: std::convert::Into<
23858 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
23859 >,
23860 >(
23861 mut self,
23862 v: T,
23863 ) -> Self {
23864 self.sub_operation_details = v.into();
23865 self
23866 }
23867
23868 /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
23869 /// if it holds a `MaintenanceType`, `None` if the field is not set or
23870 /// holds a different branch.
23871 pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
23872 #[allow(unreachable_patterns)]
23873 self.sub_operation_details.as_ref().and_then(|v| match v {
23874 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
23875 std::option::Option::Some(v)
23876 }
23877 _ => std::option::Option::None,
23878 })
23879 }
23880
23881 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
23882 /// to hold a `MaintenanceType`.
23883 ///
23884 /// Note that all the setters affecting `sub_operation_details` are
23885 /// mutually exclusive.
23886 ///
23887 /// # Example
23888 /// ```ignore,no_run
23889 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
23890 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
23891 /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
23892 /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
23893 /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
23894 /// assert!(x0.maintenance_type().is_some());
23895 /// assert!(x1.maintenance_type().is_some());
23896 /// assert!(x2.maintenance_type().is_some());
23897 /// ```
23898 pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
23899 mut self,
23900 v: T,
23901 ) -> Self {
23902 self.sub_operation_details = std::option::Option::Some(
23903 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
23904 );
23905 self
23906 }
23907}
23908
23909impl wkt::message::Message for SqlSubOperationType {
23910 fn typename() -> &'static str {
23911 "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
23912 }
23913}
23914
23915/// Defines additional types related to [SqlSubOperationType].
23916pub mod sql_sub_operation_type {
23917 #[allow(unused_imports)]
23918 use super::*;
23919
23920 /// Sub operation details corresponding to the operation type.
23921 #[derive(Clone, Debug, PartialEq)]
23922 #[non_exhaustive]
23923 pub enum SubOperationDetails {
23924 /// The type of maintenance to be performed on the instance.
23925 MaintenanceType(crate::model::SqlMaintenanceType),
23926 }
23927}
23928
23929/// An Operation resource. For successful operations that return an
23930/// Operation resource, only the fields relevant to the operation are populated
23931/// in the resource.
23932#[derive(Clone, Default, PartialEq)]
23933#[non_exhaustive]
23934pub struct Operation {
23935 /// This is always `sql#operation`.
23936 pub kind: std::string::String,
23937
23938 pub target_link: std::string::String,
23939
23940 /// The status of an operation.
23941 pub status: crate::model::operation::SqlOperationStatus,
23942
23943 /// The email address of the user who initiated this operation.
23944 pub user: std::string::String,
23945
23946 /// The time this operation was enqueued in UTC timezone in [RFC
23947 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23948 /// `2012-11-15T16:19:00.094Z`.
23949 pub insert_time: std::option::Option<wkt::Timestamp>,
23950
23951 /// The time this operation actually started in UTC timezone in [RFC
23952 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23953 /// `2012-11-15T16:19:00.094Z`.
23954 pub start_time: std::option::Option<wkt::Timestamp>,
23955
23956 /// The time this operation finished in UTC timezone in [RFC
23957 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23958 /// `2012-11-15T16:19:00.094Z`.
23959 pub end_time: std::option::Option<wkt::Timestamp>,
23960
23961 /// If errors occurred during processing of this operation, this field will be
23962 /// populated.
23963 pub error: std::option::Option<crate::model::OperationErrors>,
23964
23965 /// An Admin API warning message.
23966 pub api_warning: std::option::Option<crate::model::ApiWarning>,
23967
23968 /// The type of the operation. Valid values are:
23969 ///
23970 /// * `CREATE`
23971 /// * `DELETE`
23972 /// * `UPDATE`
23973 /// * `RESTART`
23974 /// * `IMPORT`
23975 /// * `EXPORT`
23976 /// * `BACKUP_VOLUME`
23977 /// * `RESTORE_VOLUME`
23978 /// * `CREATE_USER`
23979 /// * `DELETE_USER`
23980 /// * `CREATE_DATABASE`
23981 /// * `DELETE_DATABASE`
23982 pub operation_type: crate::model::operation::SqlOperationType,
23983
23984 /// The context for import operation, if applicable.
23985 pub import_context: std::option::Option<crate::model::ImportContext>,
23986
23987 /// The context for export operation, if applicable.
23988 pub export_context: std::option::Option<crate::model::ExportContext>,
23989
23990 /// The context for backup operation, if applicable.
23991 pub backup_context: std::option::Option<crate::model::BackupContext>,
23992
23993 /// This field is only populated when the operation_type is
23994 /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
23995 /// The PreCheckMajorVersionUpgradeContext message itself contains the details
23996 /// for that pre-check, such as the target database version for the upgrade
23997 /// and the results of the check (including any warnings or errors found).
23998 pub pre_check_major_version_upgrade_context:
23999 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
24000
24001 /// An identifier that uniquely identifies the operation. You can use this
24002 /// identifier to retrieve the Operations resource that has information about
24003 /// the operation.
24004 pub name: std::string::String,
24005
24006 /// Name of the resource on which this operation runs.
24007 pub target_id: std::string::String,
24008
24009 /// The URI of this resource.
24010 pub self_link: std::string::String,
24011
24012 /// The project ID of the target instance related to this operation.
24013 pub target_project: std::string::String,
24014
24015 /// The context for acquire SSRS lease operation, if applicable.
24016 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
24017
24018 /// Optional. The sub operation based on the operation type.
24019 pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
24020
24021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24022}
24023
24024impl Operation {
24025 pub fn new() -> Self {
24026 std::default::Default::default()
24027 }
24028
24029 /// Sets the value of [kind][crate::model::Operation::kind].
24030 ///
24031 /// # Example
24032 /// ```ignore,no_run
24033 /// # use google_cloud_sql_v1::model::Operation;
24034 /// let x = Operation::new().set_kind("example");
24035 /// ```
24036 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24037 self.kind = v.into();
24038 self
24039 }
24040
24041 /// Sets the value of [target_link][crate::model::Operation::target_link].
24042 ///
24043 /// # Example
24044 /// ```ignore,no_run
24045 /// # use google_cloud_sql_v1::model::Operation;
24046 /// let x = Operation::new().set_target_link("example");
24047 /// ```
24048 pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24049 self.target_link = v.into();
24050 self
24051 }
24052
24053 /// Sets the value of [status][crate::model::Operation::status].
24054 ///
24055 /// # Example
24056 /// ```ignore,no_run
24057 /// # use google_cloud_sql_v1::model::Operation;
24058 /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
24059 /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
24060 /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
24061 /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
24062 /// ```
24063 pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
24064 mut self,
24065 v: T,
24066 ) -> Self {
24067 self.status = v.into();
24068 self
24069 }
24070
24071 /// Sets the value of [user][crate::model::Operation::user].
24072 ///
24073 /// # Example
24074 /// ```ignore,no_run
24075 /// # use google_cloud_sql_v1::model::Operation;
24076 /// let x = Operation::new().set_user("example");
24077 /// ```
24078 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24079 self.user = v.into();
24080 self
24081 }
24082
24083 /// Sets the value of [insert_time][crate::model::Operation::insert_time].
24084 ///
24085 /// # Example
24086 /// ```ignore,no_run
24087 /// # use google_cloud_sql_v1::model::Operation;
24088 /// use wkt::Timestamp;
24089 /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
24090 /// ```
24091 pub fn set_insert_time<T>(mut self, v: T) -> Self
24092 where
24093 T: std::convert::Into<wkt::Timestamp>,
24094 {
24095 self.insert_time = std::option::Option::Some(v.into());
24096 self
24097 }
24098
24099 /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
24100 ///
24101 /// # Example
24102 /// ```ignore,no_run
24103 /// # use google_cloud_sql_v1::model::Operation;
24104 /// use wkt::Timestamp;
24105 /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
24106 /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
24107 /// ```
24108 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
24109 where
24110 T: std::convert::Into<wkt::Timestamp>,
24111 {
24112 self.insert_time = v.map(|x| x.into());
24113 self
24114 }
24115
24116 /// Sets the value of [start_time][crate::model::Operation::start_time].
24117 ///
24118 /// # Example
24119 /// ```ignore,no_run
24120 /// # use google_cloud_sql_v1::model::Operation;
24121 /// use wkt::Timestamp;
24122 /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
24123 /// ```
24124 pub fn set_start_time<T>(mut self, v: T) -> Self
24125 where
24126 T: std::convert::Into<wkt::Timestamp>,
24127 {
24128 self.start_time = std::option::Option::Some(v.into());
24129 self
24130 }
24131
24132 /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
24133 ///
24134 /// # Example
24135 /// ```ignore,no_run
24136 /// # use google_cloud_sql_v1::model::Operation;
24137 /// use wkt::Timestamp;
24138 /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
24139 /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
24140 /// ```
24141 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
24142 where
24143 T: std::convert::Into<wkt::Timestamp>,
24144 {
24145 self.start_time = v.map(|x| x.into());
24146 self
24147 }
24148
24149 /// Sets the value of [end_time][crate::model::Operation::end_time].
24150 ///
24151 /// # Example
24152 /// ```ignore,no_run
24153 /// # use google_cloud_sql_v1::model::Operation;
24154 /// use wkt::Timestamp;
24155 /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
24156 /// ```
24157 pub fn set_end_time<T>(mut self, v: T) -> Self
24158 where
24159 T: std::convert::Into<wkt::Timestamp>,
24160 {
24161 self.end_time = std::option::Option::Some(v.into());
24162 self
24163 }
24164
24165 /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
24166 ///
24167 /// # Example
24168 /// ```ignore,no_run
24169 /// # use google_cloud_sql_v1::model::Operation;
24170 /// use wkt::Timestamp;
24171 /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
24172 /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
24173 /// ```
24174 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
24175 where
24176 T: std::convert::Into<wkt::Timestamp>,
24177 {
24178 self.end_time = v.map(|x| x.into());
24179 self
24180 }
24181
24182 /// Sets the value of [error][crate::model::Operation::error].
24183 ///
24184 /// # Example
24185 /// ```ignore,no_run
24186 /// # use google_cloud_sql_v1::model::Operation;
24187 /// use google_cloud_sql_v1::model::OperationErrors;
24188 /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
24189 /// ```
24190 pub fn set_error<T>(mut self, v: T) -> Self
24191 where
24192 T: std::convert::Into<crate::model::OperationErrors>,
24193 {
24194 self.error = std::option::Option::Some(v.into());
24195 self
24196 }
24197
24198 /// Sets or clears the value of [error][crate::model::Operation::error].
24199 ///
24200 /// # Example
24201 /// ```ignore,no_run
24202 /// # use google_cloud_sql_v1::model::Operation;
24203 /// use google_cloud_sql_v1::model::OperationErrors;
24204 /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
24205 /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
24206 /// ```
24207 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
24208 where
24209 T: std::convert::Into<crate::model::OperationErrors>,
24210 {
24211 self.error = v.map(|x| x.into());
24212 self
24213 }
24214
24215 /// Sets the value of [api_warning][crate::model::Operation::api_warning].
24216 ///
24217 /// # Example
24218 /// ```ignore,no_run
24219 /// # use google_cloud_sql_v1::model::Operation;
24220 /// use google_cloud_sql_v1::model::ApiWarning;
24221 /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
24222 /// ```
24223 pub fn set_api_warning<T>(mut self, v: T) -> Self
24224 where
24225 T: std::convert::Into<crate::model::ApiWarning>,
24226 {
24227 self.api_warning = std::option::Option::Some(v.into());
24228 self
24229 }
24230
24231 /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
24232 ///
24233 /// # Example
24234 /// ```ignore,no_run
24235 /// # use google_cloud_sql_v1::model::Operation;
24236 /// use google_cloud_sql_v1::model::ApiWarning;
24237 /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
24238 /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
24239 /// ```
24240 pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
24241 where
24242 T: std::convert::Into<crate::model::ApiWarning>,
24243 {
24244 self.api_warning = v.map(|x| x.into());
24245 self
24246 }
24247
24248 /// Sets the value of [operation_type][crate::model::Operation::operation_type].
24249 ///
24250 /// # Example
24251 /// ```ignore,no_run
24252 /// # use google_cloud_sql_v1::model::Operation;
24253 /// use google_cloud_sql_v1::model::operation::SqlOperationType;
24254 /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
24255 /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
24256 /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
24257 /// ```
24258 pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
24259 mut self,
24260 v: T,
24261 ) -> Self {
24262 self.operation_type = v.into();
24263 self
24264 }
24265
24266 /// Sets the value of [import_context][crate::model::Operation::import_context].
24267 ///
24268 /// # Example
24269 /// ```ignore,no_run
24270 /// # use google_cloud_sql_v1::model::Operation;
24271 /// use google_cloud_sql_v1::model::ImportContext;
24272 /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
24273 /// ```
24274 pub fn set_import_context<T>(mut self, v: T) -> Self
24275 where
24276 T: std::convert::Into<crate::model::ImportContext>,
24277 {
24278 self.import_context = std::option::Option::Some(v.into());
24279 self
24280 }
24281
24282 /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
24283 ///
24284 /// # Example
24285 /// ```ignore,no_run
24286 /// # use google_cloud_sql_v1::model::Operation;
24287 /// use google_cloud_sql_v1::model::ImportContext;
24288 /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
24289 /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
24290 /// ```
24291 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
24292 where
24293 T: std::convert::Into<crate::model::ImportContext>,
24294 {
24295 self.import_context = v.map(|x| x.into());
24296 self
24297 }
24298
24299 /// Sets the value of [export_context][crate::model::Operation::export_context].
24300 ///
24301 /// # Example
24302 /// ```ignore,no_run
24303 /// # use google_cloud_sql_v1::model::Operation;
24304 /// use google_cloud_sql_v1::model::ExportContext;
24305 /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
24306 /// ```
24307 pub fn set_export_context<T>(mut self, v: T) -> Self
24308 where
24309 T: std::convert::Into<crate::model::ExportContext>,
24310 {
24311 self.export_context = std::option::Option::Some(v.into());
24312 self
24313 }
24314
24315 /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
24316 ///
24317 /// # Example
24318 /// ```ignore,no_run
24319 /// # use google_cloud_sql_v1::model::Operation;
24320 /// use google_cloud_sql_v1::model::ExportContext;
24321 /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
24322 /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
24323 /// ```
24324 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
24325 where
24326 T: std::convert::Into<crate::model::ExportContext>,
24327 {
24328 self.export_context = v.map(|x| x.into());
24329 self
24330 }
24331
24332 /// Sets the value of [backup_context][crate::model::Operation::backup_context].
24333 ///
24334 /// # Example
24335 /// ```ignore,no_run
24336 /// # use google_cloud_sql_v1::model::Operation;
24337 /// use google_cloud_sql_v1::model::BackupContext;
24338 /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
24339 /// ```
24340 pub fn set_backup_context<T>(mut self, v: T) -> Self
24341 where
24342 T: std::convert::Into<crate::model::BackupContext>,
24343 {
24344 self.backup_context = std::option::Option::Some(v.into());
24345 self
24346 }
24347
24348 /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
24349 ///
24350 /// # Example
24351 /// ```ignore,no_run
24352 /// # use google_cloud_sql_v1::model::Operation;
24353 /// use google_cloud_sql_v1::model::BackupContext;
24354 /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
24355 /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
24356 /// ```
24357 pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
24358 where
24359 T: std::convert::Into<crate::model::BackupContext>,
24360 {
24361 self.backup_context = v.map(|x| x.into());
24362 self
24363 }
24364
24365 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24366 ///
24367 /// # Example
24368 /// ```ignore,no_run
24369 /// # use google_cloud_sql_v1::model::Operation;
24370 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24371 /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
24372 /// ```
24373 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
24374 where
24375 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24376 {
24377 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
24378 self
24379 }
24380
24381 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24382 ///
24383 /// # Example
24384 /// ```ignore,no_run
24385 /// # use google_cloud_sql_v1::model::Operation;
24386 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24387 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
24388 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
24389 /// ```
24390 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
24391 mut self,
24392 v: std::option::Option<T>,
24393 ) -> Self
24394 where
24395 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24396 {
24397 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
24398 self
24399 }
24400
24401 /// Sets the value of [name][crate::model::Operation::name].
24402 ///
24403 /// # Example
24404 /// ```ignore,no_run
24405 /// # use google_cloud_sql_v1::model::Operation;
24406 /// let x = Operation::new().set_name("example");
24407 /// ```
24408 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24409 self.name = v.into();
24410 self
24411 }
24412
24413 /// Sets the value of [target_id][crate::model::Operation::target_id].
24414 ///
24415 /// # Example
24416 /// ```ignore,no_run
24417 /// # use google_cloud_sql_v1::model::Operation;
24418 /// let x = Operation::new().set_target_id("example");
24419 /// ```
24420 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24421 self.target_id = v.into();
24422 self
24423 }
24424
24425 /// Sets the value of [self_link][crate::model::Operation::self_link].
24426 ///
24427 /// # Example
24428 /// ```ignore,no_run
24429 /// # use google_cloud_sql_v1::model::Operation;
24430 /// let x = Operation::new().set_self_link("example");
24431 /// ```
24432 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24433 self.self_link = v.into();
24434 self
24435 }
24436
24437 /// Sets the value of [target_project][crate::model::Operation::target_project].
24438 ///
24439 /// # Example
24440 /// ```ignore,no_run
24441 /// # use google_cloud_sql_v1::model::Operation;
24442 /// let x = Operation::new().set_target_project("example");
24443 /// ```
24444 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24445 self.target_project = v.into();
24446 self
24447 }
24448
24449 /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24450 ///
24451 /// # Example
24452 /// ```ignore,no_run
24453 /// # use google_cloud_sql_v1::model::Operation;
24454 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24455 /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
24456 /// ```
24457 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
24458 where
24459 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24460 {
24461 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
24462 self
24463 }
24464
24465 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24466 ///
24467 /// # Example
24468 /// ```ignore,no_run
24469 /// # use google_cloud_sql_v1::model::Operation;
24470 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24471 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
24472 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
24473 /// ```
24474 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
24475 where
24476 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24477 {
24478 self.acquire_ssrs_lease_context = v.map(|x| x.into());
24479 self
24480 }
24481
24482 /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24483 ///
24484 /// # Example
24485 /// ```ignore,no_run
24486 /// # use google_cloud_sql_v1::model::Operation;
24487 /// use google_cloud_sql_v1::model::SqlSubOperationType;
24488 /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
24489 /// ```
24490 pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
24491 where
24492 T: std::convert::Into<crate::model::SqlSubOperationType>,
24493 {
24494 self.sub_operation_type = std::option::Option::Some(v.into());
24495 self
24496 }
24497
24498 /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24499 ///
24500 /// # Example
24501 /// ```ignore,no_run
24502 /// # use google_cloud_sql_v1::model::Operation;
24503 /// use google_cloud_sql_v1::model::SqlSubOperationType;
24504 /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
24505 /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
24506 /// ```
24507 pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
24508 where
24509 T: std::convert::Into<crate::model::SqlSubOperationType>,
24510 {
24511 self.sub_operation_type = v.map(|x| x.into());
24512 self
24513 }
24514}
24515
24516impl wkt::message::Message for Operation {
24517 fn typename() -> &'static str {
24518 "type.googleapis.com/google.cloud.sql.v1.Operation"
24519 }
24520}
24521
24522/// Defines additional types related to [Operation].
24523pub mod operation {
24524 #[allow(unused_imports)]
24525 use super::*;
24526
24527 /// The type of Cloud SQL operation.
24528 ///
24529 /// # Working with unknown values
24530 ///
24531 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24532 /// additional enum variants at any time. Adding new variants is not considered
24533 /// a breaking change. Applications should write their code in anticipation of:
24534 ///
24535 /// - New values appearing in future releases of the client library, **and**
24536 /// - New values received dynamically, without application changes.
24537 ///
24538 /// Please consult the [Working with enums] section in the user guide for some
24539 /// guidelines.
24540 ///
24541 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
24542 #[derive(Clone, Debug, PartialEq)]
24543 #[non_exhaustive]
24544 pub enum SqlOperationType {
24545 /// Unknown operation type.
24546 Unspecified,
24547 /// Imports data into a Cloud SQL instance.
24548 Import,
24549 /// Exports data from a Cloud SQL instance to a Cloud Storage
24550 /// bucket.
24551 Export,
24552 /// Creates a new Cloud SQL instance.
24553 Create,
24554 /// Updates the settings of a Cloud SQL instance.
24555 Update,
24556 /// Deletes a Cloud SQL instance.
24557 Delete,
24558 /// Restarts the Cloud SQL instance.
24559 Restart,
24560 #[deprecated]
24561 Backup,
24562 #[deprecated]
24563 Snapshot,
24564 /// Performs instance backup.
24565 BackupVolume,
24566 /// Deletes an instance backup.
24567 DeleteVolume,
24568 /// Restores an instance backup.
24569 RestoreVolume,
24570 /// Injects a privileged user in mysql for MOB instances.
24571 InjectUser,
24572 /// Clones a Cloud SQL instance.
24573 Clone,
24574 /// Stops replication on a Cloud SQL read replica instance.
24575 StopReplica,
24576 /// Starts replication on a Cloud SQL read replica instance.
24577 StartReplica,
24578 /// Promotes a Cloud SQL replica instance.
24579 PromoteReplica,
24580 /// Creates a Cloud SQL replica instance.
24581 CreateReplica,
24582 /// Creates a new user in a Cloud SQL instance.
24583 CreateUser,
24584 /// Deletes a user from a Cloud SQL instance.
24585 DeleteUser,
24586 /// Updates an existing user in a Cloud SQL instance. If a user with the
24587 /// specified username doesn't exist, a new user is created.
24588 UpdateUser,
24589 /// Creates a database in the Cloud SQL instance.
24590 CreateDatabase,
24591 /// Deletes a database in the Cloud SQL instance.
24592 DeleteDatabase,
24593 /// Updates a database in the Cloud SQL instance.
24594 UpdateDatabase,
24595 /// Performs failover of an HA-enabled Cloud SQL
24596 /// failover replica.
24597 Failover,
24598 /// Deletes the backup taken by a backup run.
24599 DeleteBackup,
24600 RecreateReplica,
24601 /// Truncates a general or slow log table in MySQL.
24602 TruncateLog,
24603 /// Demotes the stand-alone instance to be a Cloud SQL
24604 /// read replica for an external database server.
24605 DemoteMaster,
24606 /// Indicates that the instance is currently in maintenance. Maintenance
24607 /// typically causes the instance to be unavailable for 1-3 minutes.
24608 Maintenance,
24609 /// This field is deprecated, and will be removed in future version of API.
24610 #[deprecated]
24611 EnablePrivateIp,
24612 #[deprecated]
24613 DeferMaintenance,
24614 /// Creates clone instance.
24615 #[deprecated]
24616 CreateClone,
24617 /// Reschedule maintenance to another time.
24618 RescheduleMaintenance,
24619 /// Starts external sync of a Cloud SQL EM replica to an external primary
24620 /// instance.
24621 StartExternalSync,
24622 /// Recovers logs from an instance's old data disk.
24623 LogCleanup,
24624 /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
24625 /// recovery.
24626 AutoRestart,
24627 /// Re-encrypts CMEK instances with latest key version.
24628 Reencrypt,
24629 /// Switches the roles of the primary and replica pair. The target instance
24630 /// should be the replica.
24631 Switchover,
24632 /// Update a backup.
24633 UpdateBackup,
24634 /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
24635 AcquireSsrsLease,
24636 /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
24637 ReleaseSsrsLease,
24638 /// Reconfigures old primary after a promote replica operation. Effect of a
24639 /// promote operation to the old primary is executed in this operation,
24640 /// asynchronously from the promote replica operation executed to the
24641 /// replica.
24642 ReconfigureOldPrimary,
24643 /// Indicates that the instance, its read replicas, and its cascading
24644 /// replicas are in maintenance. Maintenance typically gets initiated on
24645 /// groups of replicas first, followed by the primary instance. For each
24646 /// instance, maintenance typically causes the instance to be unavailable for
24647 /// 1-3 minutes.
24648 #[deprecated]
24649 ClusterMaintenance,
24650 /// Indicates that the instance (and any of its replicas) are currently in
24651 /// maintenance. This is initiated as a self-service request by using SSM.
24652 /// Maintenance typically causes the instance to be unavailable for 1-3
24653 /// minutes.
24654 #[deprecated]
24655 SelfServiceMaintenance,
24656 /// Switches a primary instance to a replica. This operation runs as part of
24657 /// a switchover operation to the original primary instance.
24658 SwitchoverToReplica,
24659 /// Updates the major version of a Cloud SQL instance.
24660 MajorVersionUpgrade,
24661 /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
24662 #[deprecated]
24663 AdvancedBackup,
24664 /// Changes the BackupTier of a Cloud SQL instance.
24665 ManageBackup,
24666 /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
24667 EnhancedBackup,
24668 /// Repairs entire read pool or specified read pool nodes in the read pool.
24669 RepairReadPool,
24670 /// Creates a Cloud SQL read pool instance.
24671 CreateReadPool,
24672 /// If set, the enum was initialized with an unknown value.
24673 ///
24674 /// Applications can examine the value using [SqlOperationType::value] or
24675 /// [SqlOperationType::name].
24676 UnknownValue(sql_operation_type::UnknownValue),
24677 }
24678
24679 #[doc(hidden)]
24680 pub mod sql_operation_type {
24681 #[allow(unused_imports)]
24682 use super::*;
24683 #[derive(Clone, Debug, PartialEq)]
24684 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24685 }
24686
24687 impl SqlOperationType {
24688 /// Gets the enum value.
24689 ///
24690 /// Returns `None` if the enum contains an unknown value deserialized from
24691 /// the string representation of enums.
24692 pub fn value(&self) -> std::option::Option<i32> {
24693 match self {
24694 Self::Unspecified => std::option::Option::Some(0),
24695 Self::Import => std::option::Option::Some(1),
24696 Self::Export => std::option::Option::Some(2),
24697 Self::Create => std::option::Option::Some(3),
24698 Self::Update => std::option::Option::Some(4),
24699 Self::Delete => std::option::Option::Some(5),
24700 Self::Restart => std::option::Option::Some(6),
24701 Self::Backup => std::option::Option::Some(7),
24702 Self::Snapshot => std::option::Option::Some(8),
24703 Self::BackupVolume => std::option::Option::Some(9),
24704 Self::DeleteVolume => std::option::Option::Some(10),
24705 Self::RestoreVolume => std::option::Option::Some(11),
24706 Self::InjectUser => std::option::Option::Some(12),
24707 Self::Clone => std::option::Option::Some(14),
24708 Self::StopReplica => std::option::Option::Some(15),
24709 Self::StartReplica => std::option::Option::Some(16),
24710 Self::PromoteReplica => std::option::Option::Some(17),
24711 Self::CreateReplica => std::option::Option::Some(18),
24712 Self::CreateUser => std::option::Option::Some(19),
24713 Self::DeleteUser => std::option::Option::Some(20),
24714 Self::UpdateUser => std::option::Option::Some(21),
24715 Self::CreateDatabase => std::option::Option::Some(22),
24716 Self::DeleteDatabase => std::option::Option::Some(23),
24717 Self::UpdateDatabase => std::option::Option::Some(24),
24718 Self::Failover => std::option::Option::Some(25),
24719 Self::DeleteBackup => std::option::Option::Some(26),
24720 Self::RecreateReplica => std::option::Option::Some(27),
24721 Self::TruncateLog => std::option::Option::Some(28),
24722 Self::DemoteMaster => std::option::Option::Some(29),
24723 Self::Maintenance => std::option::Option::Some(30),
24724 Self::EnablePrivateIp => std::option::Option::Some(31),
24725 Self::DeferMaintenance => std::option::Option::Some(32),
24726 Self::CreateClone => std::option::Option::Some(33),
24727 Self::RescheduleMaintenance => std::option::Option::Some(34),
24728 Self::StartExternalSync => std::option::Option::Some(35),
24729 Self::LogCleanup => std::option::Option::Some(36),
24730 Self::AutoRestart => std::option::Option::Some(37),
24731 Self::Reencrypt => std::option::Option::Some(38),
24732 Self::Switchover => std::option::Option::Some(39),
24733 Self::UpdateBackup => std::option::Option::Some(40),
24734 Self::AcquireSsrsLease => std::option::Option::Some(42),
24735 Self::ReleaseSsrsLease => std::option::Option::Some(43),
24736 Self::ReconfigureOldPrimary => std::option::Option::Some(44),
24737 Self::ClusterMaintenance => std::option::Option::Some(45),
24738 Self::SelfServiceMaintenance => std::option::Option::Some(46),
24739 Self::SwitchoverToReplica => std::option::Option::Some(47),
24740 Self::MajorVersionUpgrade => std::option::Option::Some(48),
24741 Self::AdvancedBackup => std::option::Option::Some(49),
24742 Self::ManageBackup => std::option::Option::Some(50),
24743 Self::EnhancedBackup => std::option::Option::Some(51),
24744 Self::RepairReadPool => std::option::Option::Some(52),
24745 Self::CreateReadPool => std::option::Option::Some(53),
24746 Self::UnknownValue(u) => u.0.value(),
24747 }
24748 }
24749
24750 /// Gets the enum value as a string.
24751 ///
24752 /// Returns `None` if the enum contains an unknown value deserialized from
24753 /// the integer representation of enums.
24754 pub fn name(&self) -> std::option::Option<&str> {
24755 match self {
24756 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
24757 Self::Import => std::option::Option::Some("IMPORT"),
24758 Self::Export => std::option::Option::Some("EXPORT"),
24759 Self::Create => std::option::Option::Some("CREATE"),
24760 Self::Update => std::option::Option::Some("UPDATE"),
24761 Self::Delete => std::option::Option::Some("DELETE"),
24762 Self::Restart => std::option::Option::Some("RESTART"),
24763 Self::Backup => std::option::Option::Some("BACKUP"),
24764 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
24765 Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
24766 Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
24767 Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
24768 Self::InjectUser => std::option::Option::Some("INJECT_USER"),
24769 Self::Clone => std::option::Option::Some("CLONE"),
24770 Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
24771 Self::StartReplica => std::option::Option::Some("START_REPLICA"),
24772 Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
24773 Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
24774 Self::CreateUser => std::option::Option::Some("CREATE_USER"),
24775 Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
24776 Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
24777 Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
24778 Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
24779 Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
24780 Self::Failover => std::option::Option::Some("FAILOVER"),
24781 Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
24782 Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
24783 Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
24784 Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
24785 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
24786 Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
24787 Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
24788 Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
24789 Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
24790 Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
24791 Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
24792 Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
24793 Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
24794 Self::Switchover => std::option::Option::Some("SWITCHOVER"),
24795 Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
24796 Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
24797 Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
24798 Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
24799 Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
24800 Self::SelfServiceMaintenance => {
24801 std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
24802 }
24803 Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
24804 Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
24805 Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
24806 Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
24807 Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
24808 Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
24809 Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
24810 Self::UnknownValue(u) => u.0.name(),
24811 }
24812 }
24813 }
24814
24815 impl std::default::Default for SqlOperationType {
24816 fn default() -> Self {
24817 use std::convert::From;
24818 Self::from(0)
24819 }
24820 }
24821
24822 impl std::fmt::Display for SqlOperationType {
24823 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24824 wkt::internal::display_enum(f, self.name(), self.value())
24825 }
24826 }
24827
24828 impl std::convert::From<i32> for SqlOperationType {
24829 fn from(value: i32) -> Self {
24830 match value {
24831 0 => Self::Unspecified,
24832 1 => Self::Import,
24833 2 => Self::Export,
24834 3 => Self::Create,
24835 4 => Self::Update,
24836 5 => Self::Delete,
24837 6 => Self::Restart,
24838 7 => Self::Backup,
24839 8 => Self::Snapshot,
24840 9 => Self::BackupVolume,
24841 10 => Self::DeleteVolume,
24842 11 => Self::RestoreVolume,
24843 12 => Self::InjectUser,
24844 14 => Self::Clone,
24845 15 => Self::StopReplica,
24846 16 => Self::StartReplica,
24847 17 => Self::PromoteReplica,
24848 18 => Self::CreateReplica,
24849 19 => Self::CreateUser,
24850 20 => Self::DeleteUser,
24851 21 => Self::UpdateUser,
24852 22 => Self::CreateDatabase,
24853 23 => Self::DeleteDatabase,
24854 24 => Self::UpdateDatabase,
24855 25 => Self::Failover,
24856 26 => Self::DeleteBackup,
24857 27 => Self::RecreateReplica,
24858 28 => Self::TruncateLog,
24859 29 => Self::DemoteMaster,
24860 30 => Self::Maintenance,
24861 31 => Self::EnablePrivateIp,
24862 32 => Self::DeferMaintenance,
24863 33 => Self::CreateClone,
24864 34 => Self::RescheduleMaintenance,
24865 35 => Self::StartExternalSync,
24866 36 => Self::LogCleanup,
24867 37 => Self::AutoRestart,
24868 38 => Self::Reencrypt,
24869 39 => Self::Switchover,
24870 40 => Self::UpdateBackup,
24871 42 => Self::AcquireSsrsLease,
24872 43 => Self::ReleaseSsrsLease,
24873 44 => Self::ReconfigureOldPrimary,
24874 45 => Self::ClusterMaintenance,
24875 46 => Self::SelfServiceMaintenance,
24876 47 => Self::SwitchoverToReplica,
24877 48 => Self::MajorVersionUpgrade,
24878 49 => Self::AdvancedBackup,
24879 50 => Self::ManageBackup,
24880 51 => Self::EnhancedBackup,
24881 52 => Self::RepairReadPool,
24882 53 => Self::CreateReadPool,
24883 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
24884 wkt::internal::UnknownEnumValue::Integer(value),
24885 )),
24886 }
24887 }
24888 }
24889
24890 impl std::convert::From<&str> for SqlOperationType {
24891 fn from(value: &str) -> Self {
24892 use std::string::ToString;
24893 match value {
24894 "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
24895 "IMPORT" => Self::Import,
24896 "EXPORT" => Self::Export,
24897 "CREATE" => Self::Create,
24898 "UPDATE" => Self::Update,
24899 "DELETE" => Self::Delete,
24900 "RESTART" => Self::Restart,
24901 "BACKUP" => Self::Backup,
24902 "SNAPSHOT" => Self::Snapshot,
24903 "BACKUP_VOLUME" => Self::BackupVolume,
24904 "DELETE_VOLUME" => Self::DeleteVolume,
24905 "RESTORE_VOLUME" => Self::RestoreVolume,
24906 "INJECT_USER" => Self::InjectUser,
24907 "CLONE" => Self::Clone,
24908 "STOP_REPLICA" => Self::StopReplica,
24909 "START_REPLICA" => Self::StartReplica,
24910 "PROMOTE_REPLICA" => Self::PromoteReplica,
24911 "CREATE_REPLICA" => Self::CreateReplica,
24912 "CREATE_USER" => Self::CreateUser,
24913 "DELETE_USER" => Self::DeleteUser,
24914 "UPDATE_USER" => Self::UpdateUser,
24915 "CREATE_DATABASE" => Self::CreateDatabase,
24916 "DELETE_DATABASE" => Self::DeleteDatabase,
24917 "UPDATE_DATABASE" => Self::UpdateDatabase,
24918 "FAILOVER" => Self::Failover,
24919 "DELETE_BACKUP" => Self::DeleteBackup,
24920 "RECREATE_REPLICA" => Self::RecreateReplica,
24921 "TRUNCATE_LOG" => Self::TruncateLog,
24922 "DEMOTE_MASTER" => Self::DemoteMaster,
24923 "MAINTENANCE" => Self::Maintenance,
24924 "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
24925 "DEFER_MAINTENANCE" => Self::DeferMaintenance,
24926 "CREATE_CLONE" => Self::CreateClone,
24927 "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
24928 "START_EXTERNAL_SYNC" => Self::StartExternalSync,
24929 "LOG_CLEANUP" => Self::LogCleanup,
24930 "AUTO_RESTART" => Self::AutoRestart,
24931 "REENCRYPT" => Self::Reencrypt,
24932 "SWITCHOVER" => Self::Switchover,
24933 "UPDATE_BACKUP" => Self::UpdateBackup,
24934 "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
24935 "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
24936 "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
24937 "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
24938 "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
24939 "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
24940 "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
24941 "ADVANCED_BACKUP" => Self::AdvancedBackup,
24942 "MANAGE_BACKUP" => Self::ManageBackup,
24943 "ENHANCED_BACKUP" => Self::EnhancedBackup,
24944 "REPAIR_READ_POOL" => Self::RepairReadPool,
24945 "CREATE_READ_POOL" => Self::CreateReadPool,
24946 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
24947 wkt::internal::UnknownEnumValue::String(value.to_string()),
24948 )),
24949 }
24950 }
24951 }
24952
24953 impl serde::ser::Serialize for SqlOperationType {
24954 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24955 where
24956 S: serde::Serializer,
24957 {
24958 match self {
24959 Self::Unspecified => serializer.serialize_i32(0),
24960 Self::Import => serializer.serialize_i32(1),
24961 Self::Export => serializer.serialize_i32(2),
24962 Self::Create => serializer.serialize_i32(3),
24963 Self::Update => serializer.serialize_i32(4),
24964 Self::Delete => serializer.serialize_i32(5),
24965 Self::Restart => serializer.serialize_i32(6),
24966 Self::Backup => serializer.serialize_i32(7),
24967 Self::Snapshot => serializer.serialize_i32(8),
24968 Self::BackupVolume => serializer.serialize_i32(9),
24969 Self::DeleteVolume => serializer.serialize_i32(10),
24970 Self::RestoreVolume => serializer.serialize_i32(11),
24971 Self::InjectUser => serializer.serialize_i32(12),
24972 Self::Clone => serializer.serialize_i32(14),
24973 Self::StopReplica => serializer.serialize_i32(15),
24974 Self::StartReplica => serializer.serialize_i32(16),
24975 Self::PromoteReplica => serializer.serialize_i32(17),
24976 Self::CreateReplica => serializer.serialize_i32(18),
24977 Self::CreateUser => serializer.serialize_i32(19),
24978 Self::DeleteUser => serializer.serialize_i32(20),
24979 Self::UpdateUser => serializer.serialize_i32(21),
24980 Self::CreateDatabase => serializer.serialize_i32(22),
24981 Self::DeleteDatabase => serializer.serialize_i32(23),
24982 Self::UpdateDatabase => serializer.serialize_i32(24),
24983 Self::Failover => serializer.serialize_i32(25),
24984 Self::DeleteBackup => serializer.serialize_i32(26),
24985 Self::RecreateReplica => serializer.serialize_i32(27),
24986 Self::TruncateLog => serializer.serialize_i32(28),
24987 Self::DemoteMaster => serializer.serialize_i32(29),
24988 Self::Maintenance => serializer.serialize_i32(30),
24989 Self::EnablePrivateIp => serializer.serialize_i32(31),
24990 Self::DeferMaintenance => serializer.serialize_i32(32),
24991 Self::CreateClone => serializer.serialize_i32(33),
24992 Self::RescheduleMaintenance => serializer.serialize_i32(34),
24993 Self::StartExternalSync => serializer.serialize_i32(35),
24994 Self::LogCleanup => serializer.serialize_i32(36),
24995 Self::AutoRestart => serializer.serialize_i32(37),
24996 Self::Reencrypt => serializer.serialize_i32(38),
24997 Self::Switchover => serializer.serialize_i32(39),
24998 Self::UpdateBackup => serializer.serialize_i32(40),
24999 Self::AcquireSsrsLease => serializer.serialize_i32(42),
25000 Self::ReleaseSsrsLease => serializer.serialize_i32(43),
25001 Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
25002 Self::ClusterMaintenance => serializer.serialize_i32(45),
25003 Self::SelfServiceMaintenance => serializer.serialize_i32(46),
25004 Self::SwitchoverToReplica => serializer.serialize_i32(47),
25005 Self::MajorVersionUpgrade => serializer.serialize_i32(48),
25006 Self::AdvancedBackup => serializer.serialize_i32(49),
25007 Self::ManageBackup => serializer.serialize_i32(50),
25008 Self::EnhancedBackup => serializer.serialize_i32(51),
25009 Self::RepairReadPool => serializer.serialize_i32(52),
25010 Self::CreateReadPool => serializer.serialize_i32(53),
25011 Self::UnknownValue(u) => u.0.serialize(serializer),
25012 }
25013 }
25014 }
25015
25016 impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
25017 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25018 where
25019 D: serde::Deserializer<'de>,
25020 {
25021 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
25022 ".google.cloud.sql.v1.Operation.SqlOperationType",
25023 ))
25024 }
25025 }
25026
25027 /// The status of an operation.
25028 ///
25029 /// # Working with unknown values
25030 ///
25031 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25032 /// additional enum variants at any time. Adding new variants is not considered
25033 /// a breaking change. Applications should write their code in anticipation of:
25034 ///
25035 /// - New values appearing in future releases of the client library, **and**
25036 /// - New values received dynamically, without application changes.
25037 ///
25038 /// Please consult the [Working with enums] section in the user guide for some
25039 /// guidelines.
25040 ///
25041 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25042 #[derive(Clone, Debug, PartialEq)]
25043 #[non_exhaustive]
25044 pub enum SqlOperationStatus {
25045 /// The state of the operation is unknown.
25046 Unspecified,
25047 /// The operation has been queued, but has not started yet.
25048 Pending,
25049 /// The operation is running.
25050 Running,
25051 /// The operation completed.
25052 Done,
25053 /// If set, the enum was initialized with an unknown value.
25054 ///
25055 /// Applications can examine the value using [SqlOperationStatus::value] or
25056 /// [SqlOperationStatus::name].
25057 UnknownValue(sql_operation_status::UnknownValue),
25058 }
25059
25060 #[doc(hidden)]
25061 pub mod sql_operation_status {
25062 #[allow(unused_imports)]
25063 use super::*;
25064 #[derive(Clone, Debug, PartialEq)]
25065 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25066 }
25067
25068 impl SqlOperationStatus {
25069 /// Gets the enum value.
25070 ///
25071 /// Returns `None` if the enum contains an unknown value deserialized from
25072 /// the string representation of enums.
25073 pub fn value(&self) -> std::option::Option<i32> {
25074 match self {
25075 Self::Unspecified => std::option::Option::Some(0),
25076 Self::Pending => std::option::Option::Some(1),
25077 Self::Running => std::option::Option::Some(2),
25078 Self::Done => std::option::Option::Some(3),
25079 Self::UnknownValue(u) => u.0.value(),
25080 }
25081 }
25082
25083 /// Gets the enum value as a string.
25084 ///
25085 /// Returns `None` if the enum contains an unknown value deserialized from
25086 /// the integer representation of enums.
25087 pub fn name(&self) -> std::option::Option<&str> {
25088 match self {
25089 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
25090 Self::Pending => std::option::Option::Some("PENDING"),
25091 Self::Running => std::option::Option::Some("RUNNING"),
25092 Self::Done => std::option::Option::Some("DONE"),
25093 Self::UnknownValue(u) => u.0.name(),
25094 }
25095 }
25096 }
25097
25098 impl std::default::Default for SqlOperationStatus {
25099 fn default() -> Self {
25100 use std::convert::From;
25101 Self::from(0)
25102 }
25103 }
25104
25105 impl std::fmt::Display for SqlOperationStatus {
25106 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25107 wkt::internal::display_enum(f, self.name(), self.value())
25108 }
25109 }
25110
25111 impl std::convert::From<i32> for SqlOperationStatus {
25112 fn from(value: i32) -> Self {
25113 match value {
25114 0 => Self::Unspecified,
25115 1 => Self::Pending,
25116 2 => Self::Running,
25117 3 => Self::Done,
25118 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25119 wkt::internal::UnknownEnumValue::Integer(value),
25120 )),
25121 }
25122 }
25123 }
25124
25125 impl std::convert::From<&str> for SqlOperationStatus {
25126 fn from(value: &str) -> Self {
25127 use std::string::ToString;
25128 match value {
25129 "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
25130 "PENDING" => Self::Pending,
25131 "RUNNING" => Self::Running,
25132 "DONE" => Self::Done,
25133 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25134 wkt::internal::UnknownEnumValue::String(value.to_string()),
25135 )),
25136 }
25137 }
25138 }
25139
25140 impl serde::ser::Serialize for SqlOperationStatus {
25141 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25142 where
25143 S: serde::Serializer,
25144 {
25145 match self {
25146 Self::Unspecified => serializer.serialize_i32(0),
25147 Self::Pending => serializer.serialize_i32(1),
25148 Self::Running => serializer.serialize_i32(2),
25149 Self::Done => serializer.serialize_i32(3),
25150 Self::UnknownValue(u) => u.0.serialize(serializer),
25151 }
25152 }
25153 }
25154
25155 impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
25156 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25157 where
25158 D: serde::Deserializer<'de>,
25159 {
25160 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
25161 ".google.cloud.sql.v1.Operation.SqlOperationStatus",
25162 ))
25163 }
25164 }
25165}
25166
25167/// Database instance operation error.
25168#[derive(Clone, Default, PartialEq)]
25169#[non_exhaustive]
25170pub struct OperationError {
25171 /// This is always `sql#operationError`.
25172 pub kind: std::string::String,
25173
25174 /// Identifies the specific error that occurred.
25175 pub code: std::string::String,
25176
25177 /// Additional information about the error encountered.
25178 pub message: std::string::String,
25179
25180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25181}
25182
25183impl OperationError {
25184 pub fn new() -> Self {
25185 std::default::Default::default()
25186 }
25187
25188 /// Sets the value of [kind][crate::model::OperationError::kind].
25189 ///
25190 /// # Example
25191 /// ```ignore,no_run
25192 /// # use google_cloud_sql_v1::model::OperationError;
25193 /// let x = OperationError::new().set_kind("example");
25194 /// ```
25195 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25196 self.kind = v.into();
25197 self
25198 }
25199
25200 /// Sets the value of [code][crate::model::OperationError::code].
25201 ///
25202 /// # Example
25203 /// ```ignore,no_run
25204 /// # use google_cloud_sql_v1::model::OperationError;
25205 /// let x = OperationError::new().set_code("example");
25206 /// ```
25207 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25208 self.code = v.into();
25209 self
25210 }
25211
25212 /// Sets the value of [message][crate::model::OperationError::message].
25213 ///
25214 /// # Example
25215 /// ```ignore,no_run
25216 /// # use google_cloud_sql_v1::model::OperationError;
25217 /// let x = OperationError::new().set_message("example");
25218 /// ```
25219 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25220 self.message = v.into();
25221 self
25222 }
25223}
25224
25225impl wkt::message::Message for OperationError {
25226 fn typename() -> &'static str {
25227 "type.googleapis.com/google.cloud.sql.v1.OperationError"
25228 }
25229}
25230
25231/// Database instance operation errors list wrapper.
25232#[derive(Clone, Default, PartialEq)]
25233#[non_exhaustive]
25234pub struct OperationErrors {
25235 /// This is always `sql#operationErrors`.
25236 pub kind: std::string::String,
25237
25238 /// The list of errors encountered while processing this operation.
25239 pub errors: std::vec::Vec<crate::model::OperationError>,
25240
25241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25242}
25243
25244impl OperationErrors {
25245 pub fn new() -> Self {
25246 std::default::Default::default()
25247 }
25248
25249 /// Sets the value of [kind][crate::model::OperationErrors::kind].
25250 ///
25251 /// # Example
25252 /// ```ignore,no_run
25253 /// # use google_cloud_sql_v1::model::OperationErrors;
25254 /// let x = OperationErrors::new().set_kind("example");
25255 /// ```
25256 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25257 self.kind = v.into();
25258 self
25259 }
25260
25261 /// Sets the value of [errors][crate::model::OperationErrors::errors].
25262 ///
25263 /// # Example
25264 /// ```ignore,no_run
25265 /// # use google_cloud_sql_v1::model::OperationErrors;
25266 /// use google_cloud_sql_v1::model::OperationError;
25267 /// let x = OperationErrors::new()
25268 /// .set_errors([
25269 /// OperationError::default()/* use setters */,
25270 /// OperationError::default()/* use (different) setters */,
25271 /// ]);
25272 /// ```
25273 pub fn set_errors<T, V>(mut self, v: T) -> Self
25274 where
25275 T: std::iter::IntoIterator<Item = V>,
25276 V: std::convert::Into<crate::model::OperationError>,
25277 {
25278 use std::iter::Iterator;
25279 self.errors = v.into_iter().map(|i| i.into()).collect();
25280 self
25281 }
25282}
25283
25284impl wkt::message::Message for OperationErrors {
25285 fn typename() -> &'static str {
25286 "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
25287 }
25288}
25289
25290/// Database instance local user password validation policy.
25291/// This message defines the password policy for local database users.
25292/// When enabled, it enforces constraints on password complexity, length,
25293/// and reuse. Keep this policy enabled to help prevent unauthorized access.
25294#[derive(Clone, Default, PartialEq)]
25295#[non_exhaustive]
25296pub struct PasswordValidationPolicy {
25297 /// Minimum number of characters allowed.
25298 pub min_length: std::option::Option<wkt::Int32Value>,
25299
25300 /// The complexity of the password.
25301 pub complexity: crate::model::password_validation_policy::Complexity,
25302
25303 /// Number of previous passwords that cannot be reused.
25304 pub reuse_interval: std::option::Option<wkt::Int32Value>,
25305
25306 /// Disallow username as a part of the password.
25307 pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
25308
25309 /// Minimum interval after which the password can be changed. This flag is only
25310 /// supported for PostgreSQL.
25311 pub password_change_interval: std::option::Option<wkt::Duration>,
25312
25313 /// Whether to enable the password policy or not. When enabled, passwords must
25314 /// meet complexity requirements. Keep this policy enabled to help prevent
25315 /// unauthorized access. Disabling this policy allows weak passwords.
25316 pub enable_password_policy: std::option::Option<wkt::BoolValue>,
25317
25318 /// This field is deprecated and will be removed in a future version of the
25319 /// API.
25320 #[deprecated]
25321 pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
25322
25323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25324}
25325
25326impl PasswordValidationPolicy {
25327 pub fn new() -> Self {
25328 std::default::Default::default()
25329 }
25330
25331 /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25332 ///
25333 /// # Example
25334 /// ```ignore,no_run
25335 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25336 /// use wkt::Int32Value;
25337 /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
25338 /// ```
25339 pub fn set_min_length<T>(mut self, v: T) -> Self
25340 where
25341 T: std::convert::Into<wkt::Int32Value>,
25342 {
25343 self.min_length = std::option::Option::Some(v.into());
25344 self
25345 }
25346
25347 /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25348 ///
25349 /// # Example
25350 /// ```ignore,no_run
25351 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25352 /// use wkt::Int32Value;
25353 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
25354 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
25355 /// ```
25356 pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
25357 where
25358 T: std::convert::Into<wkt::Int32Value>,
25359 {
25360 self.min_length = v.map(|x| x.into());
25361 self
25362 }
25363
25364 /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
25365 ///
25366 /// # Example
25367 /// ```ignore,no_run
25368 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25369 /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
25370 /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
25371 /// ```
25372 pub fn set_complexity<
25373 T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
25374 >(
25375 mut self,
25376 v: T,
25377 ) -> Self {
25378 self.complexity = v.into();
25379 self
25380 }
25381
25382 /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25383 ///
25384 /// # Example
25385 /// ```ignore,no_run
25386 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25387 /// use wkt::Int32Value;
25388 /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
25389 /// ```
25390 pub fn set_reuse_interval<T>(mut self, v: T) -> Self
25391 where
25392 T: std::convert::Into<wkt::Int32Value>,
25393 {
25394 self.reuse_interval = std::option::Option::Some(v.into());
25395 self
25396 }
25397
25398 /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25399 ///
25400 /// # Example
25401 /// ```ignore,no_run
25402 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25403 /// use wkt::Int32Value;
25404 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
25405 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
25406 /// ```
25407 pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
25408 where
25409 T: std::convert::Into<wkt::Int32Value>,
25410 {
25411 self.reuse_interval = v.map(|x| x.into());
25412 self
25413 }
25414
25415 /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25416 ///
25417 /// # Example
25418 /// ```ignore,no_run
25419 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25420 /// use wkt::BoolValue;
25421 /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
25422 /// ```
25423 pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
25424 where
25425 T: std::convert::Into<wkt::BoolValue>,
25426 {
25427 self.disallow_username_substring = std::option::Option::Some(v.into());
25428 self
25429 }
25430
25431 /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25432 ///
25433 /// # Example
25434 /// ```ignore,no_run
25435 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25436 /// use wkt::BoolValue;
25437 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
25438 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
25439 /// ```
25440 pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
25441 where
25442 T: std::convert::Into<wkt::BoolValue>,
25443 {
25444 self.disallow_username_substring = v.map(|x| x.into());
25445 self
25446 }
25447
25448 /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25449 ///
25450 /// # Example
25451 /// ```ignore,no_run
25452 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25453 /// use wkt::Duration;
25454 /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
25455 /// ```
25456 pub fn set_password_change_interval<T>(mut self, v: T) -> Self
25457 where
25458 T: std::convert::Into<wkt::Duration>,
25459 {
25460 self.password_change_interval = std::option::Option::Some(v.into());
25461 self
25462 }
25463
25464 /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25465 ///
25466 /// # Example
25467 /// ```ignore,no_run
25468 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25469 /// use wkt::Duration;
25470 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
25471 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
25472 /// ```
25473 pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
25474 where
25475 T: std::convert::Into<wkt::Duration>,
25476 {
25477 self.password_change_interval = v.map(|x| x.into());
25478 self
25479 }
25480
25481 /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25482 ///
25483 /// # Example
25484 /// ```ignore,no_run
25485 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25486 /// use wkt::BoolValue;
25487 /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
25488 /// ```
25489 pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
25490 where
25491 T: std::convert::Into<wkt::BoolValue>,
25492 {
25493 self.enable_password_policy = std::option::Option::Some(v.into());
25494 self
25495 }
25496
25497 /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25498 ///
25499 /// # Example
25500 /// ```ignore,no_run
25501 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25502 /// use wkt::BoolValue;
25503 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
25504 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
25505 /// ```
25506 pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
25507 where
25508 T: std::convert::Into<wkt::BoolValue>,
25509 {
25510 self.enable_password_policy = v.map(|x| x.into());
25511 self
25512 }
25513
25514 /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25515 ///
25516 /// # Example
25517 /// ```ignore,no_run
25518 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25519 /// use wkt::BoolValue;
25520 /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
25521 /// ```
25522 #[deprecated]
25523 pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
25524 where
25525 T: std::convert::Into<wkt::BoolValue>,
25526 {
25527 self.disallow_compromised_credentials = std::option::Option::Some(v.into());
25528 self
25529 }
25530
25531 /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25532 ///
25533 /// # Example
25534 /// ```ignore,no_run
25535 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25536 /// use wkt::BoolValue;
25537 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
25538 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
25539 /// ```
25540 #[deprecated]
25541 pub fn set_or_clear_disallow_compromised_credentials<T>(
25542 mut self,
25543 v: std::option::Option<T>,
25544 ) -> Self
25545 where
25546 T: std::convert::Into<wkt::BoolValue>,
25547 {
25548 self.disallow_compromised_credentials = v.map(|x| x.into());
25549 self
25550 }
25551}
25552
25553impl wkt::message::Message for PasswordValidationPolicy {
25554 fn typename() -> &'static str {
25555 "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
25556 }
25557}
25558
25559/// Defines additional types related to [PasswordValidationPolicy].
25560pub mod password_validation_policy {
25561 #[allow(unused_imports)]
25562 use super::*;
25563
25564 /// The complexity choices of the password.
25565 ///
25566 /// # Working with unknown values
25567 ///
25568 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25569 /// additional enum variants at any time. Adding new variants is not considered
25570 /// a breaking change. Applications should write their code in anticipation of:
25571 ///
25572 /// - New values appearing in future releases of the client library, **and**
25573 /// - New values received dynamically, without application changes.
25574 ///
25575 /// Please consult the [Working with enums] section in the user guide for some
25576 /// guidelines.
25577 ///
25578 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
25579 #[derive(Clone, Debug, PartialEq)]
25580 #[non_exhaustive]
25581 pub enum Complexity {
25582 /// Complexity check is not specified.
25583 Unspecified,
25584 /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
25585 /// characters.
25586 Default,
25587 /// If set, the enum was initialized with an unknown value.
25588 ///
25589 /// Applications can examine the value using [Complexity::value] or
25590 /// [Complexity::name].
25591 UnknownValue(complexity::UnknownValue),
25592 }
25593
25594 #[doc(hidden)]
25595 pub mod complexity {
25596 #[allow(unused_imports)]
25597 use super::*;
25598 #[derive(Clone, Debug, PartialEq)]
25599 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25600 }
25601
25602 impl Complexity {
25603 /// Gets the enum value.
25604 ///
25605 /// Returns `None` if the enum contains an unknown value deserialized from
25606 /// the string representation of enums.
25607 pub fn value(&self) -> std::option::Option<i32> {
25608 match self {
25609 Self::Unspecified => std::option::Option::Some(0),
25610 Self::Default => std::option::Option::Some(1),
25611 Self::UnknownValue(u) => u.0.value(),
25612 }
25613 }
25614
25615 /// Gets the enum value as a string.
25616 ///
25617 /// Returns `None` if the enum contains an unknown value deserialized from
25618 /// the integer representation of enums.
25619 pub fn name(&self) -> std::option::Option<&str> {
25620 match self {
25621 Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
25622 Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
25623 Self::UnknownValue(u) => u.0.name(),
25624 }
25625 }
25626 }
25627
25628 impl std::default::Default for Complexity {
25629 fn default() -> Self {
25630 use std::convert::From;
25631 Self::from(0)
25632 }
25633 }
25634
25635 impl std::fmt::Display for Complexity {
25636 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25637 wkt::internal::display_enum(f, self.name(), self.value())
25638 }
25639 }
25640
25641 impl std::convert::From<i32> for Complexity {
25642 fn from(value: i32) -> Self {
25643 match value {
25644 0 => Self::Unspecified,
25645 1 => Self::Default,
25646 _ => Self::UnknownValue(complexity::UnknownValue(
25647 wkt::internal::UnknownEnumValue::Integer(value),
25648 )),
25649 }
25650 }
25651 }
25652
25653 impl std::convert::From<&str> for Complexity {
25654 fn from(value: &str) -> Self {
25655 use std::string::ToString;
25656 match value {
25657 "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
25658 "COMPLEXITY_DEFAULT" => Self::Default,
25659 _ => Self::UnknownValue(complexity::UnknownValue(
25660 wkt::internal::UnknownEnumValue::String(value.to_string()),
25661 )),
25662 }
25663 }
25664 }
25665
25666 impl serde::ser::Serialize for Complexity {
25667 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25668 where
25669 S: serde::Serializer,
25670 {
25671 match self {
25672 Self::Unspecified => serializer.serialize_i32(0),
25673 Self::Default => serializer.serialize_i32(1),
25674 Self::UnknownValue(u) => u.0.serialize(serializer),
25675 }
25676 }
25677 }
25678
25679 impl<'de> serde::de::Deserialize<'de> for Complexity {
25680 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25681 where
25682 D: serde::Deserializer<'de>,
25683 {
25684 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
25685 ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
25686 ))
25687 }
25688 }
25689}
25690
25691/// Data cache configurations.
25692#[derive(Clone, Default, PartialEq)]
25693#[non_exhaustive]
25694pub struct DataCacheConfig {
25695 /// Whether data cache is enabled for the instance.
25696 pub data_cache_enabled: bool,
25697
25698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25699}
25700
25701impl DataCacheConfig {
25702 pub fn new() -> Self {
25703 std::default::Default::default()
25704 }
25705
25706 /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
25707 ///
25708 /// # Example
25709 /// ```ignore,no_run
25710 /// # use google_cloud_sql_v1::model::DataCacheConfig;
25711 /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
25712 /// ```
25713 pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25714 self.data_cache_enabled = v.into();
25715 self
25716 }
25717}
25718
25719impl wkt::message::Message for DataCacheConfig {
25720 fn typename() -> &'static str {
25721 "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
25722 }
25723}
25724
25725/// Config used to determine the final backup settings for the instance.
25726#[derive(Clone, Default, PartialEq)]
25727#[non_exhaustive]
25728pub struct FinalBackupConfig {
25729 /// Whether the final backup is enabled for the instance.
25730 pub enabled: std::option::Option<bool>,
25731
25732 /// The number of days to retain the final backup after the instance deletion.
25733 /// The final backup will be purged at (time_of_instance_deletion +
25734 /// retention_days).
25735 pub retention_days: std::option::Option<i32>,
25736
25737 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25738}
25739
25740impl FinalBackupConfig {
25741 pub fn new() -> Self {
25742 std::default::Default::default()
25743 }
25744
25745 /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
25746 ///
25747 /// # Example
25748 /// ```ignore,no_run
25749 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25750 /// let x = FinalBackupConfig::new().set_enabled(true);
25751 /// ```
25752 pub fn set_enabled<T>(mut self, v: T) -> Self
25753 where
25754 T: std::convert::Into<bool>,
25755 {
25756 self.enabled = std::option::Option::Some(v.into());
25757 self
25758 }
25759
25760 /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
25761 ///
25762 /// # Example
25763 /// ```ignore,no_run
25764 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25765 /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
25766 /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
25767 /// ```
25768 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
25769 where
25770 T: std::convert::Into<bool>,
25771 {
25772 self.enabled = v.map(|x| x.into());
25773 self
25774 }
25775
25776 /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
25777 ///
25778 /// # Example
25779 /// ```ignore,no_run
25780 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25781 /// let x = FinalBackupConfig::new().set_retention_days(42);
25782 /// ```
25783 pub fn set_retention_days<T>(mut self, v: T) -> Self
25784 where
25785 T: std::convert::Into<i32>,
25786 {
25787 self.retention_days = std::option::Option::Some(v.into());
25788 self
25789 }
25790
25791 /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
25792 ///
25793 /// # Example
25794 /// ```ignore,no_run
25795 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25796 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
25797 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
25798 /// ```
25799 pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
25800 where
25801 T: std::convert::Into<i32>,
25802 {
25803 self.retention_days = v.map(|x| x.into());
25804 self
25805 }
25806}
25807
25808impl wkt::message::Message for FinalBackupConfig {
25809 fn typename() -> &'static str {
25810 "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
25811 }
25812}
25813
25814/// Database instance settings.
25815#[derive(Clone, Default, PartialEq)]
25816#[non_exhaustive]
25817pub struct Settings {
25818 /// The version of instance settings. This is a required field for update
25819 /// method to make sure concurrent updates are handled properly. During update,
25820 /// use the most recent settingsVersion value for this instance and do not try
25821 /// to update this value.
25822 pub settings_version: std::option::Option<wkt::Int64Value>,
25823
25824 /// The App Engine app IDs that can access this instance.
25825 /// (Deprecated) Applied to First Generation instances only.
25826 #[deprecated]
25827 pub authorized_gae_applications: std::vec::Vec<std::string::String>,
25828
25829 /// The tier (or machine type) for this instance, for example
25830 /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
25831 pub tier: std::string::String,
25832
25833 /// This is always `sql#settings`.
25834 pub kind: std::string::String,
25835
25836 /// User-provided labels, represented as a dictionary where each label is a
25837 /// single key value pair.
25838 pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
25839
25840 /// Availability type. Potential values:
25841 ///
25842 /// * `ZONAL`: The instance serves data from only one zone. Outages in that
25843 /// zone affect data accessibility.
25844 /// * `REGIONAL`: The instance can serve data from more than one zone in a
25845 /// region (it is highly available)./
25846 ///
25847 /// For more information, see [Overview of the High Availability
25848 /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
25849 pub availability_type: crate::model::SqlAvailabilityType,
25850
25851 /// The pricing plan for this instance. This can be either `PER_USE` or
25852 /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
25853 pub pricing_plan: crate::model::SqlPricingPlan,
25854
25855 /// The type of replication this instance uses. This can be either
25856 /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
25857 /// applicable to First Generation instances.
25858 #[deprecated]
25859 pub replication_type: crate::model::SqlReplicationType,
25860
25861 /// The maximum size to which storage capacity can be automatically increased.
25862 /// The default value is 0, which specifies that there is no limit.
25863 pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
25864
25865 /// The activation policy specifies when the instance is activated; it is
25866 /// applicable only when the instance state is RUNNABLE. Valid values:
25867 ///
25868 /// * `ALWAYS`: The instance is on, and remains so even in the absence of
25869 /// connection requests.
25870 /// * `NEVER`: The instance is off; it is not activated, even if a
25871 /// connection request arrives.
25872 pub activation_policy: crate::model::settings::SqlActivationPolicy,
25873
25874 /// The settings for IP Management. This allows to enable or disable the
25875 /// instance IP and manage which external networks can connect to the instance.
25876 /// The IPv4 address cannot be disabled for Second Generation instances.
25877 pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
25878
25879 /// Configuration to increase storage size automatically. The default value is
25880 /// true.
25881 pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
25882
25883 /// The location preference settings. This allows the instance to be located as
25884 /// near as possible to either an App Engine app or Compute Engine zone for
25885 /// better performance. App Engine co-location was only applicable to First
25886 /// Generation instances.
25887 pub location_preference: std::option::Option<crate::model::LocationPreference>,
25888
25889 /// The database flags passed to the instance at startup.
25890 pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
25891
25892 /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
25893 /// First Generation instances.
25894 pub data_disk_type: crate::model::SqlDataDiskType,
25895
25896 /// The maintenance window for this instance. This specifies when the instance
25897 /// can be restarted for maintenance purposes.
25898 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
25899
25900 /// The daily backup configuration for the instance.
25901 pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
25902
25903 /// Configuration specific to read replica instances. Indicates whether
25904 /// replication is enabled or not. WARNING: Changing this restarts the
25905 /// instance.
25906 pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
25907
25908 /// Configuration specific to read replica instances. Indicates whether
25909 /// database flags for crash-safe replication are enabled. This property was
25910 /// only applicable to First Generation instances.
25911 #[deprecated]
25912 pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
25913
25914 /// The size of data disk, in GB. The data disk size minimum is 10GB.
25915 pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
25916
25917 /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
25918 pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
25919
25920 /// The name of server Instance collation.
25921 pub collation: std::string::String,
25922
25923 /// Deny maintenance periods
25924 pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
25925
25926 /// Insights configuration, for now relevant only for Postgres.
25927 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
25928
25929 /// The local user password validation policy of the instance.
25930 pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
25931
25932 /// SQL Server specific audit configuration.
25933 pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
25934
25935 /// Optional. The edition of the instance.
25936 pub edition: crate::model::settings::Edition,
25937
25938 /// Specifies if connections must use Cloud SQL connectors.
25939 /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
25940 /// can be connected without Cloud SQL
25941 /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
25942 /// Connectors).
25943 ///
25944 /// Note that using REQUIRED disables all existing authorized networks. If
25945 /// this field is not specified when creating a new instance, NOT_REQUIRED is
25946 /// used. If this field is not specified when patching or updating an existing
25947 /// instance, it is left unchanged in the instance.
25948 pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
25949
25950 /// Configuration to protect against accidental instance deletion.
25951 pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
25952
25953 /// Server timezone, relevant only for Cloud SQL for SQL Server.
25954 pub time_zone: std::string::String,
25955
25956 /// Specifies advanced machine configuration for the instances relevant only
25957 /// for SQL Server.
25958 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
25959
25960 /// Configuration for data cache.
25961 pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
25962
25963 /// Optional. Configuration value for recreation of replica after certain
25964 /// replication lag
25965 pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
25966
25967 /// Optional. When this parameter is set to true, Cloud SQL instances can
25968 /// connect to Vertex AI to pass requests for real-time predictions and
25969 /// insights to the AI. The default value is false. This applies only to Cloud
25970 /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
25971 pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
25972
25973 /// Optional. By default, Cloud SQL instances have schema extraction disabled
25974 /// for Dataplex. When this parameter is set to true, schema extraction for
25975 /// Dataplex on Cloud SQL instances is activated.
25976 pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
25977
25978 /// Optional. When this parameter is set to true, Cloud SQL retains backups of
25979 /// the instance even after the instance is deleted. The ON_DEMAND backup will
25980 /// be retained until customer deletes the backup or the project. The AUTOMATED
25981 /// backup will be retained based on the backups retention setting.
25982 pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
25983
25984 /// Optional. Provisioned number of I/O operations per second for the data
25985 /// disk. This field is only used for hyperdisk-balanced disk types.
25986 pub data_disk_provisioned_iops: std::option::Option<i64>,
25987
25988 /// Optional. Provisioned throughput measured in MiB per second for the data
25989 /// disk. This field is only used for hyperdisk-balanced disk types.
25990 pub data_disk_provisioned_throughput: std::option::Option<i64>,
25991
25992 /// Optional. The managed connection pooling configuration for the instance.
25993 pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
25994
25995 /// Optional. The final backup configuration for the instance.
25996 pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
25997
25998 /// Optional. The read pool auto-scale configuration for the instance.
25999 pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
26000
26001 /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
26002 /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
26003 /// versions. The MySQL version must be 8.0.35 or higher.
26004 pub auto_upgrade_enabled: std::option::Option<bool>,
26005
26006 /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
26007 pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
26008
26009 /// This parameter controls whether to allow using ExecuteSql API to connect to
26010 /// the instance. Not allowed by default.
26011 pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
26012
26013 /// Optional. Configuration for Performance Capture, provides diagnostic
26014 /// metrics during high load situations.
26015 pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
26016
26017 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26018}
26019
26020impl Settings {
26021 pub fn new() -> Self {
26022 std::default::Default::default()
26023 }
26024
26025 /// Sets the value of [settings_version][crate::model::Settings::settings_version].
26026 ///
26027 /// # Example
26028 /// ```ignore,no_run
26029 /// # use google_cloud_sql_v1::model::Settings;
26030 /// use wkt::Int64Value;
26031 /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
26032 /// ```
26033 pub fn set_settings_version<T>(mut self, v: T) -> Self
26034 where
26035 T: std::convert::Into<wkt::Int64Value>,
26036 {
26037 self.settings_version = std::option::Option::Some(v.into());
26038 self
26039 }
26040
26041 /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
26042 ///
26043 /// # Example
26044 /// ```ignore,no_run
26045 /// # use google_cloud_sql_v1::model::Settings;
26046 /// use wkt::Int64Value;
26047 /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
26048 /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
26049 /// ```
26050 pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
26051 where
26052 T: std::convert::Into<wkt::Int64Value>,
26053 {
26054 self.settings_version = v.map(|x| x.into());
26055 self
26056 }
26057
26058 /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
26059 ///
26060 /// # Example
26061 /// ```ignore,no_run
26062 /// # use google_cloud_sql_v1::model::Settings;
26063 /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
26064 /// ```
26065 #[deprecated]
26066 pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
26067 where
26068 T: std::iter::IntoIterator<Item = V>,
26069 V: std::convert::Into<std::string::String>,
26070 {
26071 use std::iter::Iterator;
26072 self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
26073 self
26074 }
26075
26076 /// Sets the value of [tier][crate::model::Settings::tier].
26077 ///
26078 /// # Example
26079 /// ```ignore,no_run
26080 /// # use google_cloud_sql_v1::model::Settings;
26081 /// let x = Settings::new().set_tier("example");
26082 /// ```
26083 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26084 self.tier = v.into();
26085 self
26086 }
26087
26088 /// Sets the value of [kind][crate::model::Settings::kind].
26089 ///
26090 /// # Example
26091 /// ```ignore,no_run
26092 /// # use google_cloud_sql_v1::model::Settings;
26093 /// let x = Settings::new().set_kind("example");
26094 /// ```
26095 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26096 self.kind = v.into();
26097 self
26098 }
26099
26100 /// Sets the value of [user_labels][crate::model::Settings::user_labels].
26101 ///
26102 /// # Example
26103 /// ```ignore,no_run
26104 /// # use google_cloud_sql_v1::model::Settings;
26105 /// let x = Settings::new().set_user_labels([
26106 /// ("key0", "abc"),
26107 /// ("key1", "xyz"),
26108 /// ]);
26109 /// ```
26110 pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
26111 where
26112 T: std::iter::IntoIterator<Item = (K, V)>,
26113 K: std::convert::Into<std::string::String>,
26114 V: std::convert::Into<std::string::String>,
26115 {
26116 use std::iter::Iterator;
26117 self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26118 self
26119 }
26120
26121 /// Sets the value of [availability_type][crate::model::Settings::availability_type].
26122 ///
26123 /// # Example
26124 /// ```ignore,no_run
26125 /// # use google_cloud_sql_v1::model::Settings;
26126 /// use google_cloud_sql_v1::model::SqlAvailabilityType;
26127 /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
26128 /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
26129 /// ```
26130 pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
26131 mut self,
26132 v: T,
26133 ) -> Self {
26134 self.availability_type = v.into();
26135 self
26136 }
26137
26138 /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
26139 ///
26140 /// # Example
26141 /// ```ignore,no_run
26142 /// # use google_cloud_sql_v1::model::Settings;
26143 /// use google_cloud_sql_v1::model::SqlPricingPlan;
26144 /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
26145 /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
26146 /// ```
26147 pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
26148 mut self,
26149 v: T,
26150 ) -> Self {
26151 self.pricing_plan = v.into();
26152 self
26153 }
26154
26155 /// Sets the value of [replication_type][crate::model::Settings::replication_type].
26156 ///
26157 /// # Example
26158 /// ```ignore,no_run
26159 /// # use google_cloud_sql_v1::model::Settings;
26160 /// use google_cloud_sql_v1::model::SqlReplicationType;
26161 /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
26162 /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
26163 /// ```
26164 #[deprecated]
26165 pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
26166 mut self,
26167 v: T,
26168 ) -> Self {
26169 self.replication_type = v.into();
26170 self
26171 }
26172
26173 /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26174 ///
26175 /// # Example
26176 /// ```ignore,no_run
26177 /// # use google_cloud_sql_v1::model::Settings;
26178 /// use wkt::Int64Value;
26179 /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
26180 /// ```
26181 pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
26182 where
26183 T: std::convert::Into<wkt::Int64Value>,
26184 {
26185 self.storage_auto_resize_limit = std::option::Option::Some(v.into());
26186 self
26187 }
26188
26189 /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26190 ///
26191 /// # Example
26192 /// ```ignore,no_run
26193 /// # use google_cloud_sql_v1::model::Settings;
26194 /// use wkt::Int64Value;
26195 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
26196 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
26197 /// ```
26198 pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
26199 where
26200 T: std::convert::Into<wkt::Int64Value>,
26201 {
26202 self.storage_auto_resize_limit = v.map(|x| x.into());
26203 self
26204 }
26205
26206 /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
26207 ///
26208 /// # Example
26209 /// ```ignore,no_run
26210 /// # use google_cloud_sql_v1::model::Settings;
26211 /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
26212 /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
26213 /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
26214 /// ```
26215 pub fn set_activation_policy<
26216 T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
26217 >(
26218 mut self,
26219 v: T,
26220 ) -> Self {
26221 self.activation_policy = v.into();
26222 self
26223 }
26224
26225 /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
26226 ///
26227 /// # Example
26228 /// ```ignore,no_run
26229 /// # use google_cloud_sql_v1::model::Settings;
26230 /// use google_cloud_sql_v1::model::IpConfiguration;
26231 /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
26232 /// ```
26233 pub fn set_ip_configuration<T>(mut self, v: T) -> Self
26234 where
26235 T: std::convert::Into<crate::model::IpConfiguration>,
26236 {
26237 self.ip_configuration = std::option::Option::Some(v.into());
26238 self
26239 }
26240
26241 /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
26242 ///
26243 /// # Example
26244 /// ```ignore,no_run
26245 /// # use google_cloud_sql_v1::model::Settings;
26246 /// use google_cloud_sql_v1::model::IpConfiguration;
26247 /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
26248 /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
26249 /// ```
26250 pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26251 where
26252 T: std::convert::Into<crate::model::IpConfiguration>,
26253 {
26254 self.ip_configuration = v.map(|x| x.into());
26255 self
26256 }
26257
26258 /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26259 ///
26260 /// # Example
26261 /// ```ignore,no_run
26262 /// # use google_cloud_sql_v1::model::Settings;
26263 /// use wkt::BoolValue;
26264 /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
26265 /// ```
26266 pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
26267 where
26268 T: std::convert::Into<wkt::BoolValue>,
26269 {
26270 self.storage_auto_resize = std::option::Option::Some(v.into());
26271 self
26272 }
26273
26274 /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26275 ///
26276 /// # Example
26277 /// ```ignore,no_run
26278 /// # use google_cloud_sql_v1::model::Settings;
26279 /// use wkt::BoolValue;
26280 /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
26281 /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
26282 /// ```
26283 pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
26284 where
26285 T: std::convert::Into<wkt::BoolValue>,
26286 {
26287 self.storage_auto_resize = v.map(|x| x.into());
26288 self
26289 }
26290
26291 /// Sets the value of [location_preference][crate::model::Settings::location_preference].
26292 ///
26293 /// # Example
26294 /// ```ignore,no_run
26295 /// # use google_cloud_sql_v1::model::Settings;
26296 /// use google_cloud_sql_v1::model::LocationPreference;
26297 /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
26298 /// ```
26299 pub fn set_location_preference<T>(mut self, v: T) -> Self
26300 where
26301 T: std::convert::Into<crate::model::LocationPreference>,
26302 {
26303 self.location_preference = std::option::Option::Some(v.into());
26304 self
26305 }
26306
26307 /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
26308 ///
26309 /// # Example
26310 /// ```ignore,no_run
26311 /// # use google_cloud_sql_v1::model::Settings;
26312 /// use google_cloud_sql_v1::model::LocationPreference;
26313 /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
26314 /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
26315 /// ```
26316 pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
26317 where
26318 T: std::convert::Into<crate::model::LocationPreference>,
26319 {
26320 self.location_preference = v.map(|x| x.into());
26321 self
26322 }
26323
26324 /// Sets the value of [database_flags][crate::model::Settings::database_flags].
26325 ///
26326 /// # Example
26327 /// ```ignore,no_run
26328 /// # use google_cloud_sql_v1::model::Settings;
26329 /// use google_cloud_sql_v1::model::DatabaseFlags;
26330 /// let x = Settings::new()
26331 /// .set_database_flags([
26332 /// DatabaseFlags::default()/* use setters */,
26333 /// DatabaseFlags::default()/* use (different) setters */,
26334 /// ]);
26335 /// ```
26336 pub fn set_database_flags<T, V>(mut self, v: T) -> Self
26337 where
26338 T: std::iter::IntoIterator<Item = V>,
26339 V: std::convert::Into<crate::model::DatabaseFlags>,
26340 {
26341 use std::iter::Iterator;
26342 self.database_flags = v.into_iter().map(|i| i.into()).collect();
26343 self
26344 }
26345
26346 /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
26347 ///
26348 /// # Example
26349 /// ```ignore,no_run
26350 /// # use google_cloud_sql_v1::model::Settings;
26351 /// use google_cloud_sql_v1::model::SqlDataDiskType;
26352 /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
26353 /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
26354 /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
26355 /// ```
26356 pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
26357 mut self,
26358 v: T,
26359 ) -> Self {
26360 self.data_disk_type = v.into();
26361 self
26362 }
26363
26364 /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
26365 ///
26366 /// # Example
26367 /// ```ignore,no_run
26368 /// # use google_cloud_sql_v1::model::Settings;
26369 /// use google_cloud_sql_v1::model::MaintenanceWindow;
26370 /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
26371 /// ```
26372 pub fn set_maintenance_window<T>(mut self, v: T) -> Self
26373 where
26374 T: std::convert::Into<crate::model::MaintenanceWindow>,
26375 {
26376 self.maintenance_window = std::option::Option::Some(v.into());
26377 self
26378 }
26379
26380 /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
26381 ///
26382 /// # Example
26383 /// ```ignore,no_run
26384 /// # use google_cloud_sql_v1::model::Settings;
26385 /// use google_cloud_sql_v1::model::MaintenanceWindow;
26386 /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
26387 /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
26388 /// ```
26389 pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
26390 where
26391 T: std::convert::Into<crate::model::MaintenanceWindow>,
26392 {
26393 self.maintenance_window = v.map(|x| x.into());
26394 self
26395 }
26396
26397 /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
26398 ///
26399 /// # Example
26400 /// ```ignore,no_run
26401 /// # use google_cloud_sql_v1::model::Settings;
26402 /// use google_cloud_sql_v1::model::BackupConfiguration;
26403 /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
26404 /// ```
26405 pub fn set_backup_configuration<T>(mut self, v: T) -> Self
26406 where
26407 T: std::convert::Into<crate::model::BackupConfiguration>,
26408 {
26409 self.backup_configuration = std::option::Option::Some(v.into());
26410 self
26411 }
26412
26413 /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
26414 ///
26415 /// # Example
26416 /// ```ignore,no_run
26417 /// # use google_cloud_sql_v1::model::Settings;
26418 /// use google_cloud_sql_v1::model::BackupConfiguration;
26419 /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
26420 /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
26421 /// ```
26422 pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26423 where
26424 T: std::convert::Into<crate::model::BackupConfiguration>,
26425 {
26426 self.backup_configuration = v.map(|x| x.into());
26427 self
26428 }
26429
26430 /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26431 ///
26432 /// # Example
26433 /// ```ignore,no_run
26434 /// # use google_cloud_sql_v1::model::Settings;
26435 /// use wkt::BoolValue;
26436 /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
26437 /// ```
26438 pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
26439 where
26440 T: std::convert::Into<wkt::BoolValue>,
26441 {
26442 self.database_replication_enabled = std::option::Option::Some(v.into());
26443 self
26444 }
26445
26446 /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26447 ///
26448 /// # Example
26449 /// ```ignore,no_run
26450 /// # use google_cloud_sql_v1::model::Settings;
26451 /// use wkt::BoolValue;
26452 /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
26453 /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
26454 /// ```
26455 pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26456 where
26457 T: std::convert::Into<wkt::BoolValue>,
26458 {
26459 self.database_replication_enabled = v.map(|x| x.into());
26460 self
26461 }
26462
26463 /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26464 ///
26465 /// # Example
26466 /// ```ignore,no_run
26467 /// # use google_cloud_sql_v1::model::Settings;
26468 /// use wkt::BoolValue;
26469 /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
26470 /// ```
26471 #[deprecated]
26472 pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
26473 where
26474 T: std::convert::Into<wkt::BoolValue>,
26475 {
26476 self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
26477 self
26478 }
26479
26480 /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26481 ///
26482 /// # Example
26483 /// ```ignore,no_run
26484 /// # use google_cloud_sql_v1::model::Settings;
26485 /// use wkt::BoolValue;
26486 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
26487 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
26488 /// ```
26489 #[deprecated]
26490 pub fn set_or_clear_crash_safe_replication_enabled<T>(
26491 mut self,
26492 v: std::option::Option<T>,
26493 ) -> Self
26494 where
26495 T: std::convert::Into<wkt::BoolValue>,
26496 {
26497 self.crash_safe_replication_enabled = v.map(|x| x.into());
26498 self
26499 }
26500
26501 /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26502 ///
26503 /// # Example
26504 /// ```ignore,no_run
26505 /// # use google_cloud_sql_v1::model::Settings;
26506 /// use wkt::Int64Value;
26507 /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
26508 /// ```
26509 pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
26510 where
26511 T: std::convert::Into<wkt::Int64Value>,
26512 {
26513 self.data_disk_size_gb = std::option::Option::Some(v.into());
26514 self
26515 }
26516
26517 /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26518 ///
26519 /// # Example
26520 /// ```ignore,no_run
26521 /// # use google_cloud_sql_v1::model::Settings;
26522 /// use wkt::Int64Value;
26523 /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
26524 /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
26525 /// ```
26526 pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
26527 where
26528 T: std::convert::Into<wkt::Int64Value>,
26529 {
26530 self.data_disk_size_gb = v.map(|x| x.into());
26531 self
26532 }
26533
26534 /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
26535 ///
26536 /// # Example
26537 /// ```ignore,no_run
26538 /// # use google_cloud_sql_v1::model::Settings;
26539 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26540 /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
26541 /// ```
26542 pub fn set_active_directory_config<T>(mut self, v: T) -> Self
26543 where
26544 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26545 {
26546 self.active_directory_config = std::option::Option::Some(v.into());
26547 self
26548 }
26549
26550 /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
26551 ///
26552 /// # Example
26553 /// ```ignore,no_run
26554 /// # use google_cloud_sql_v1::model::Settings;
26555 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26556 /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
26557 /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
26558 /// ```
26559 pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
26560 where
26561 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26562 {
26563 self.active_directory_config = v.map(|x| x.into());
26564 self
26565 }
26566
26567 /// Sets the value of [collation][crate::model::Settings::collation].
26568 ///
26569 /// # Example
26570 /// ```ignore,no_run
26571 /// # use google_cloud_sql_v1::model::Settings;
26572 /// let x = Settings::new().set_collation("example");
26573 /// ```
26574 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26575 self.collation = v.into();
26576 self
26577 }
26578
26579 /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
26580 ///
26581 /// # Example
26582 /// ```ignore,no_run
26583 /// # use google_cloud_sql_v1::model::Settings;
26584 /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
26585 /// let x = Settings::new()
26586 /// .set_deny_maintenance_periods([
26587 /// DenyMaintenancePeriod::default()/* use setters */,
26588 /// DenyMaintenancePeriod::default()/* use (different) setters */,
26589 /// ]);
26590 /// ```
26591 pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
26592 where
26593 T: std::iter::IntoIterator<Item = V>,
26594 V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
26595 {
26596 use std::iter::Iterator;
26597 self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
26598 self
26599 }
26600
26601 /// Sets the value of [insights_config][crate::model::Settings::insights_config].
26602 ///
26603 /// # Example
26604 /// ```ignore,no_run
26605 /// # use google_cloud_sql_v1::model::Settings;
26606 /// use google_cloud_sql_v1::model::InsightsConfig;
26607 /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
26608 /// ```
26609 pub fn set_insights_config<T>(mut self, v: T) -> Self
26610 where
26611 T: std::convert::Into<crate::model::InsightsConfig>,
26612 {
26613 self.insights_config = std::option::Option::Some(v.into());
26614 self
26615 }
26616
26617 /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
26618 ///
26619 /// # Example
26620 /// ```ignore,no_run
26621 /// # use google_cloud_sql_v1::model::Settings;
26622 /// use google_cloud_sql_v1::model::InsightsConfig;
26623 /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
26624 /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
26625 /// ```
26626 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
26627 where
26628 T: std::convert::Into<crate::model::InsightsConfig>,
26629 {
26630 self.insights_config = v.map(|x| x.into());
26631 self
26632 }
26633
26634 /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26635 ///
26636 /// # Example
26637 /// ```ignore,no_run
26638 /// # use google_cloud_sql_v1::model::Settings;
26639 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26640 /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
26641 /// ```
26642 pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
26643 where
26644 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26645 {
26646 self.password_validation_policy = std::option::Option::Some(v.into());
26647 self
26648 }
26649
26650 /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26651 ///
26652 /// # Example
26653 /// ```ignore,no_run
26654 /// # use google_cloud_sql_v1::model::Settings;
26655 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26656 /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
26657 /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
26658 /// ```
26659 pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
26660 where
26661 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26662 {
26663 self.password_validation_policy = v.map(|x| x.into());
26664 self
26665 }
26666
26667 /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26668 ///
26669 /// # Example
26670 /// ```ignore,no_run
26671 /// # use google_cloud_sql_v1::model::Settings;
26672 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26673 /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
26674 /// ```
26675 pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
26676 where
26677 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26678 {
26679 self.sql_server_audit_config = std::option::Option::Some(v.into());
26680 self
26681 }
26682
26683 /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26684 ///
26685 /// # Example
26686 /// ```ignore,no_run
26687 /// # use google_cloud_sql_v1::model::Settings;
26688 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26689 /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
26690 /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
26691 /// ```
26692 pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
26693 where
26694 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26695 {
26696 self.sql_server_audit_config = v.map(|x| x.into());
26697 self
26698 }
26699
26700 /// Sets the value of [edition][crate::model::Settings::edition].
26701 ///
26702 /// # Example
26703 /// ```ignore,no_run
26704 /// # use google_cloud_sql_v1::model::Settings;
26705 /// use google_cloud_sql_v1::model::settings::Edition;
26706 /// let x0 = Settings::new().set_edition(Edition::Enterprise);
26707 /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
26708 /// ```
26709 pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
26710 mut self,
26711 v: T,
26712 ) -> Self {
26713 self.edition = v.into();
26714 self
26715 }
26716
26717 /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
26718 ///
26719 /// # Example
26720 /// ```ignore,no_run
26721 /// # use google_cloud_sql_v1::model::Settings;
26722 /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
26723 /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
26724 /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
26725 /// ```
26726 pub fn set_connector_enforcement<
26727 T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
26728 >(
26729 mut self,
26730 v: T,
26731 ) -> Self {
26732 self.connector_enforcement = v.into();
26733 self
26734 }
26735
26736 /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26737 ///
26738 /// # Example
26739 /// ```ignore,no_run
26740 /// # use google_cloud_sql_v1::model::Settings;
26741 /// use wkt::BoolValue;
26742 /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
26743 /// ```
26744 pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
26745 where
26746 T: std::convert::Into<wkt::BoolValue>,
26747 {
26748 self.deletion_protection_enabled = std::option::Option::Some(v.into());
26749 self
26750 }
26751
26752 /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26753 ///
26754 /// # Example
26755 /// ```ignore,no_run
26756 /// # use google_cloud_sql_v1::model::Settings;
26757 /// use wkt::BoolValue;
26758 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
26759 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
26760 /// ```
26761 pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26762 where
26763 T: std::convert::Into<wkt::BoolValue>,
26764 {
26765 self.deletion_protection_enabled = v.map(|x| x.into());
26766 self
26767 }
26768
26769 /// Sets the value of [time_zone][crate::model::Settings::time_zone].
26770 ///
26771 /// # Example
26772 /// ```ignore,no_run
26773 /// # use google_cloud_sql_v1::model::Settings;
26774 /// let x = Settings::new().set_time_zone("example");
26775 /// ```
26776 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26777 self.time_zone = v.into();
26778 self
26779 }
26780
26781 /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
26782 ///
26783 /// # Example
26784 /// ```ignore,no_run
26785 /// # use google_cloud_sql_v1::model::Settings;
26786 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
26787 /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
26788 /// ```
26789 pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
26790 where
26791 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
26792 {
26793 self.advanced_machine_features = std::option::Option::Some(v.into());
26794 self
26795 }
26796
26797 /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
26798 ///
26799 /// # Example
26800 /// ```ignore,no_run
26801 /// # use google_cloud_sql_v1::model::Settings;
26802 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
26803 /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
26804 /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
26805 /// ```
26806 pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
26807 where
26808 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
26809 {
26810 self.advanced_machine_features = v.map(|x| x.into());
26811 self
26812 }
26813
26814 /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
26815 ///
26816 /// # Example
26817 /// ```ignore,no_run
26818 /// # use google_cloud_sql_v1::model::Settings;
26819 /// use google_cloud_sql_v1::model::DataCacheConfig;
26820 /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
26821 /// ```
26822 pub fn set_data_cache_config<T>(mut self, v: T) -> Self
26823 where
26824 T: std::convert::Into<crate::model::DataCacheConfig>,
26825 {
26826 self.data_cache_config = std::option::Option::Some(v.into());
26827 self
26828 }
26829
26830 /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
26831 ///
26832 /// # Example
26833 /// ```ignore,no_run
26834 /// # use google_cloud_sql_v1::model::Settings;
26835 /// use google_cloud_sql_v1::model::DataCacheConfig;
26836 /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
26837 /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
26838 /// ```
26839 pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
26840 where
26841 T: std::convert::Into<crate::model::DataCacheConfig>,
26842 {
26843 self.data_cache_config = v.map(|x| x.into());
26844 self
26845 }
26846
26847 /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
26848 ///
26849 /// # Example
26850 /// ```ignore,no_run
26851 /// # use google_cloud_sql_v1::model::Settings;
26852 /// use wkt::Int32Value;
26853 /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
26854 /// ```
26855 pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
26856 where
26857 T: std::convert::Into<wkt::Int32Value>,
26858 {
26859 self.replication_lag_max_seconds = std::option::Option::Some(v.into());
26860 self
26861 }
26862
26863 /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
26864 ///
26865 /// # Example
26866 /// ```ignore,no_run
26867 /// # use google_cloud_sql_v1::model::Settings;
26868 /// use wkt::Int32Value;
26869 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
26870 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
26871 /// ```
26872 pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
26873 where
26874 T: std::convert::Into<wkt::Int32Value>,
26875 {
26876 self.replication_lag_max_seconds = v.map(|x| x.into());
26877 self
26878 }
26879
26880 /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
26881 ///
26882 /// # Example
26883 /// ```ignore,no_run
26884 /// # use google_cloud_sql_v1::model::Settings;
26885 /// use wkt::BoolValue;
26886 /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
26887 /// ```
26888 pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
26889 where
26890 T: std::convert::Into<wkt::BoolValue>,
26891 {
26892 self.enable_google_ml_integration = std::option::Option::Some(v.into());
26893 self
26894 }
26895
26896 /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
26897 ///
26898 /// # Example
26899 /// ```ignore,no_run
26900 /// # use google_cloud_sql_v1::model::Settings;
26901 /// use wkt::BoolValue;
26902 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
26903 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
26904 /// ```
26905 pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
26906 where
26907 T: std::convert::Into<wkt::BoolValue>,
26908 {
26909 self.enable_google_ml_integration = v.map(|x| x.into());
26910 self
26911 }
26912
26913 /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
26914 ///
26915 /// # Example
26916 /// ```ignore,no_run
26917 /// # use google_cloud_sql_v1::model::Settings;
26918 /// use wkt::BoolValue;
26919 /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
26920 /// ```
26921 pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
26922 where
26923 T: std::convert::Into<wkt::BoolValue>,
26924 {
26925 self.enable_dataplex_integration = std::option::Option::Some(v.into());
26926 self
26927 }
26928
26929 /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
26930 ///
26931 /// # Example
26932 /// ```ignore,no_run
26933 /// # use google_cloud_sql_v1::model::Settings;
26934 /// use wkt::BoolValue;
26935 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
26936 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
26937 /// ```
26938 pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
26939 where
26940 T: std::convert::Into<wkt::BoolValue>,
26941 {
26942 self.enable_dataplex_integration = v.map(|x| x.into());
26943 self
26944 }
26945
26946 /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
26947 ///
26948 /// # Example
26949 /// ```ignore,no_run
26950 /// # use google_cloud_sql_v1::model::Settings;
26951 /// use wkt::BoolValue;
26952 /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
26953 /// ```
26954 pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
26955 where
26956 T: std::convert::Into<wkt::BoolValue>,
26957 {
26958 self.retain_backups_on_delete = std::option::Option::Some(v.into());
26959 self
26960 }
26961
26962 /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
26963 ///
26964 /// # Example
26965 /// ```ignore,no_run
26966 /// # use google_cloud_sql_v1::model::Settings;
26967 /// use wkt::BoolValue;
26968 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
26969 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
26970 /// ```
26971 pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
26972 where
26973 T: std::convert::Into<wkt::BoolValue>,
26974 {
26975 self.retain_backups_on_delete = v.map(|x| x.into());
26976 self
26977 }
26978
26979 /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
26980 ///
26981 /// # Example
26982 /// ```ignore,no_run
26983 /// # use google_cloud_sql_v1::model::Settings;
26984 /// let x = Settings::new().set_data_disk_provisioned_iops(42);
26985 /// ```
26986 pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
26987 where
26988 T: std::convert::Into<i64>,
26989 {
26990 self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
26991 self
26992 }
26993
26994 /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
26995 ///
26996 /// # Example
26997 /// ```ignore,no_run
26998 /// # use google_cloud_sql_v1::model::Settings;
26999 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
27000 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
27001 /// ```
27002 pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
27003 where
27004 T: std::convert::Into<i64>,
27005 {
27006 self.data_disk_provisioned_iops = v.map(|x| x.into());
27007 self
27008 }
27009
27010 /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27011 ///
27012 /// # Example
27013 /// ```ignore,no_run
27014 /// # use google_cloud_sql_v1::model::Settings;
27015 /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
27016 /// ```
27017 pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
27018 where
27019 T: std::convert::Into<i64>,
27020 {
27021 self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
27022 self
27023 }
27024
27025 /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27026 ///
27027 /// # Example
27028 /// ```ignore,no_run
27029 /// # use google_cloud_sql_v1::model::Settings;
27030 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
27031 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
27032 /// ```
27033 pub fn set_or_clear_data_disk_provisioned_throughput<T>(
27034 mut self,
27035 v: std::option::Option<T>,
27036 ) -> Self
27037 where
27038 T: std::convert::Into<i64>,
27039 {
27040 self.data_disk_provisioned_throughput = v.map(|x| x.into());
27041 self
27042 }
27043
27044 /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27045 ///
27046 /// # Example
27047 /// ```ignore,no_run
27048 /// # use google_cloud_sql_v1::model::Settings;
27049 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27050 /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
27051 /// ```
27052 pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
27053 where
27054 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27055 {
27056 self.connection_pool_config = std::option::Option::Some(v.into());
27057 self
27058 }
27059
27060 /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27061 ///
27062 /// # Example
27063 /// ```ignore,no_run
27064 /// # use google_cloud_sql_v1::model::Settings;
27065 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27066 /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
27067 /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
27068 /// ```
27069 pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
27070 where
27071 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27072 {
27073 self.connection_pool_config = v.map(|x| x.into());
27074 self
27075 }
27076
27077 /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
27078 ///
27079 /// # Example
27080 /// ```ignore,no_run
27081 /// # use google_cloud_sql_v1::model::Settings;
27082 /// use google_cloud_sql_v1::model::FinalBackupConfig;
27083 /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
27084 /// ```
27085 pub fn set_final_backup_config<T>(mut self, v: T) -> Self
27086 where
27087 T: std::convert::Into<crate::model::FinalBackupConfig>,
27088 {
27089 self.final_backup_config = std::option::Option::Some(v.into());
27090 self
27091 }
27092
27093 /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
27094 ///
27095 /// # Example
27096 /// ```ignore,no_run
27097 /// # use google_cloud_sql_v1::model::Settings;
27098 /// use google_cloud_sql_v1::model::FinalBackupConfig;
27099 /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
27100 /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
27101 /// ```
27102 pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
27103 where
27104 T: std::convert::Into<crate::model::FinalBackupConfig>,
27105 {
27106 self.final_backup_config = v.map(|x| x.into());
27107 self
27108 }
27109
27110 /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27111 ///
27112 /// # Example
27113 /// ```ignore,no_run
27114 /// # use google_cloud_sql_v1::model::Settings;
27115 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27116 /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
27117 /// ```
27118 pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
27119 where
27120 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27121 {
27122 self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
27123 self
27124 }
27125
27126 /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27127 ///
27128 /// # Example
27129 /// ```ignore,no_run
27130 /// # use google_cloud_sql_v1::model::Settings;
27131 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27132 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
27133 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
27134 /// ```
27135 pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
27136 where
27137 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27138 {
27139 self.read_pool_auto_scale_config = v.map(|x| x.into());
27140 self
27141 }
27142
27143 /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27144 ///
27145 /// # Example
27146 /// ```ignore,no_run
27147 /// # use google_cloud_sql_v1::model::Settings;
27148 /// let x = Settings::new().set_auto_upgrade_enabled(true);
27149 /// ```
27150 pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
27151 where
27152 T: std::convert::Into<bool>,
27153 {
27154 self.auto_upgrade_enabled = std::option::Option::Some(v.into());
27155 self
27156 }
27157
27158 /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27159 ///
27160 /// # Example
27161 /// ```ignore,no_run
27162 /// # use google_cloud_sql_v1::model::Settings;
27163 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
27164 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
27165 /// ```
27166 pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27167 where
27168 T: std::convert::Into<bool>,
27169 {
27170 self.auto_upgrade_enabled = v.map(|x| x.into());
27171 self
27172 }
27173
27174 /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
27175 ///
27176 /// # Example
27177 /// ```ignore,no_run
27178 /// # use google_cloud_sql_v1::model::Settings;
27179 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27180 /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
27181 /// ```
27182 pub fn set_entraid_config<T>(mut self, v: T) -> Self
27183 where
27184 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27185 {
27186 self.entraid_config = std::option::Option::Some(v.into());
27187 self
27188 }
27189
27190 /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
27191 ///
27192 /// # Example
27193 /// ```ignore,no_run
27194 /// # use google_cloud_sql_v1::model::Settings;
27195 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27196 /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
27197 /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
27198 /// ```
27199 pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
27200 where
27201 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27202 {
27203 self.entraid_config = v.map(|x| x.into());
27204 self
27205 }
27206
27207 /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
27208 ///
27209 /// # Example
27210 /// ```ignore,no_run
27211 /// # use google_cloud_sql_v1::model::Settings;
27212 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27213 /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
27214 /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
27215 /// ```
27216 pub fn set_data_api_access<T>(mut self, v: T) -> Self
27217 where
27218 T: std::convert::Into<crate::model::settings::DataApiAccess>,
27219 {
27220 self.data_api_access = std::option::Option::Some(v.into());
27221 self
27222 }
27223
27224 /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
27225 ///
27226 /// # Example
27227 /// ```ignore,no_run
27228 /// # use google_cloud_sql_v1::model::Settings;
27229 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27230 /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
27231 /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
27232 /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
27233 /// ```
27234 pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
27235 where
27236 T: std::convert::Into<crate::model::settings::DataApiAccess>,
27237 {
27238 self.data_api_access = v.map(|x| x.into());
27239 self
27240 }
27241
27242 /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27243 ///
27244 /// # Example
27245 /// ```ignore,no_run
27246 /// # use google_cloud_sql_v1::model::Settings;
27247 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27248 /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
27249 /// ```
27250 pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
27251 where
27252 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27253 {
27254 self.performance_capture_config = std::option::Option::Some(v.into());
27255 self
27256 }
27257
27258 /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27259 ///
27260 /// # Example
27261 /// ```ignore,no_run
27262 /// # use google_cloud_sql_v1::model::Settings;
27263 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27264 /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
27265 /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
27266 /// ```
27267 pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
27268 where
27269 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27270 {
27271 self.performance_capture_config = v.map(|x| x.into());
27272 self
27273 }
27274}
27275
27276impl wkt::message::Message for Settings {
27277 fn typename() -> &'static str {
27278 "type.googleapis.com/google.cloud.sql.v1.Settings"
27279 }
27280}
27281
27282/// Defines additional types related to [Settings].
27283pub mod settings {
27284 #[allow(unused_imports)]
27285 use super::*;
27286
27287 /// Specifies when the instance is activated.
27288 ///
27289 /// # Working with unknown values
27290 ///
27291 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27292 /// additional enum variants at any time. Adding new variants is not considered
27293 /// a breaking change. Applications should write their code in anticipation of:
27294 ///
27295 /// - New values appearing in future releases of the client library, **and**
27296 /// - New values received dynamically, without application changes.
27297 ///
27298 /// Please consult the [Working with enums] section in the user guide for some
27299 /// guidelines.
27300 ///
27301 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27302 #[derive(Clone, Debug, PartialEq)]
27303 #[non_exhaustive]
27304 pub enum SqlActivationPolicy {
27305 /// Unknown activation plan.
27306 Unspecified,
27307 /// The instance is always up and running.
27308 Always,
27309 /// The instance never starts.
27310 Never,
27311 /// The instance starts upon receiving requests.
27312 #[deprecated]
27313 OnDemand,
27314 /// If set, the enum was initialized with an unknown value.
27315 ///
27316 /// Applications can examine the value using [SqlActivationPolicy::value] or
27317 /// [SqlActivationPolicy::name].
27318 UnknownValue(sql_activation_policy::UnknownValue),
27319 }
27320
27321 #[doc(hidden)]
27322 pub mod sql_activation_policy {
27323 #[allow(unused_imports)]
27324 use super::*;
27325 #[derive(Clone, Debug, PartialEq)]
27326 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27327 }
27328
27329 impl SqlActivationPolicy {
27330 /// Gets the enum value.
27331 ///
27332 /// Returns `None` if the enum contains an unknown value deserialized from
27333 /// the string representation of enums.
27334 pub fn value(&self) -> std::option::Option<i32> {
27335 match self {
27336 Self::Unspecified => std::option::Option::Some(0),
27337 Self::Always => std::option::Option::Some(1),
27338 Self::Never => std::option::Option::Some(2),
27339 Self::OnDemand => std::option::Option::Some(3),
27340 Self::UnknownValue(u) => u.0.value(),
27341 }
27342 }
27343
27344 /// Gets the enum value as a string.
27345 ///
27346 /// Returns `None` if the enum contains an unknown value deserialized from
27347 /// the integer representation of enums.
27348 pub fn name(&self) -> std::option::Option<&str> {
27349 match self {
27350 Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
27351 Self::Always => std::option::Option::Some("ALWAYS"),
27352 Self::Never => std::option::Option::Some("NEVER"),
27353 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
27354 Self::UnknownValue(u) => u.0.name(),
27355 }
27356 }
27357 }
27358
27359 impl std::default::Default for SqlActivationPolicy {
27360 fn default() -> Self {
27361 use std::convert::From;
27362 Self::from(0)
27363 }
27364 }
27365
27366 impl std::fmt::Display for SqlActivationPolicy {
27367 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27368 wkt::internal::display_enum(f, self.name(), self.value())
27369 }
27370 }
27371
27372 impl std::convert::From<i32> for SqlActivationPolicy {
27373 fn from(value: i32) -> Self {
27374 match value {
27375 0 => Self::Unspecified,
27376 1 => Self::Always,
27377 2 => Self::Never,
27378 3 => Self::OnDemand,
27379 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27380 wkt::internal::UnknownEnumValue::Integer(value),
27381 )),
27382 }
27383 }
27384 }
27385
27386 impl std::convert::From<&str> for SqlActivationPolicy {
27387 fn from(value: &str) -> Self {
27388 use std::string::ToString;
27389 match value {
27390 "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
27391 "ALWAYS" => Self::Always,
27392 "NEVER" => Self::Never,
27393 "ON_DEMAND" => Self::OnDemand,
27394 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27395 wkt::internal::UnknownEnumValue::String(value.to_string()),
27396 )),
27397 }
27398 }
27399 }
27400
27401 impl serde::ser::Serialize for SqlActivationPolicy {
27402 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27403 where
27404 S: serde::Serializer,
27405 {
27406 match self {
27407 Self::Unspecified => serializer.serialize_i32(0),
27408 Self::Always => serializer.serialize_i32(1),
27409 Self::Never => serializer.serialize_i32(2),
27410 Self::OnDemand => serializer.serialize_i32(3),
27411 Self::UnknownValue(u) => u.0.serialize(serializer),
27412 }
27413 }
27414 }
27415
27416 impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
27417 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27418 where
27419 D: serde::Deserializer<'de>,
27420 {
27421 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
27422 ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
27423 ))
27424 }
27425 }
27426
27427 /// The edition of the instance.
27428 ///
27429 /// # Working with unknown values
27430 ///
27431 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27432 /// additional enum variants at any time. Adding new variants is not considered
27433 /// a breaking change. Applications should write their code in anticipation of:
27434 ///
27435 /// - New values appearing in future releases of the client library, **and**
27436 /// - New values received dynamically, without application changes.
27437 ///
27438 /// Please consult the [Working with enums] section in the user guide for some
27439 /// guidelines.
27440 ///
27441 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27442 #[derive(Clone, Debug, PartialEq)]
27443 #[non_exhaustive]
27444 pub enum Edition {
27445 /// The instance did not specify the edition.
27446 Unspecified,
27447 /// The instance is an enterprise edition.
27448 Enterprise,
27449 /// The instance is an Enterprise Plus edition.
27450 EnterprisePlus,
27451 /// If set, the enum was initialized with an unknown value.
27452 ///
27453 /// Applications can examine the value using [Edition::value] or
27454 /// [Edition::name].
27455 UnknownValue(edition::UnknownValue),
27456 }
27457
27458 #[doc(hidden)]
27459 pub mod edition {
27460 #[allow(unused_imports)]
27461 use super::*;
27462 #[derive(Clone, Debug, PartialEq)]
27463 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27464 }
27465
27466 impl Edition {
27467 /// Gets the enum value.
27468 ///
27469 /// Returns `None` if the enum contains an unknown value deserialized from
27470 /// the string representation of enums.
27471 pub fn value(&self) -> std::option::Option<i32> {
27472 match self {
27473 Self::Unspecified => std::option::Option::Some(0),
27474 Self::Enterprise => std::option::Option::Some(2),
27475 Self::EnterprisePlus => std::option::Option::Some(3),
27476 Self::UnknownValue(u) => u.0.value(),
27477 }
27478 }
27479
27480 /// Gets the enum value as a string.
27481 ///
27482 /// Returns `None` if the enum contains an unknown value deserialized from
27483 /// the integer representation of enums.
27484 pub fn name(&self) -> std::option::Option<&str> {
27485 match self {
27486 Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
27487 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
27488 Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
27489 Self::UnknownValue(u) => u.0.name(),
27490 }
27491 }
27492 }
27493
27494 impl std::default::Default for Edition {
27495 fn default() -> Self {
27496 use std::convert::From;
27497 Self::from(0)
27498 }
27499 }
27500
27501 impl std::fmt::Display for Edition {
27502 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27503 wkt::internal::display_enum(f, self.name(), self.value())
27504 }
27505 }
27506
27507 impl std::convert::From<i32> for Edition {
27508 fn from(value: i32) -> Self {
27509 match value {
27510 0 => Self::Unspecified,
27511 2 => Self::Enterprise,
27512 3 => Self::EnterprisePlus,
27513 _ => Self::UnknownValue(edition::UnknownValue(
27514 wkt::internal::UnknownEnumValue::Integer(value),
27515 )),
27516 }
27517 }
27518 }
27519
27520 impl std::convert::From<&str> for Edition {
27521 fn from(value: &str) -> Self {
27522 use std::string::ToString;
27523 match value {
27524 "EDITION_UNSPECIFIED" => Self::Unspecified,
27525 "ENTERPRISE" => Self::Enterprise,
27526 "ENTERPRISE_PLUS" => Self::EnterprisePlus,
27527 _ => Self::UnknownValue(edition::UnknownValue(
27528 wkt::internal::UnknownEnumValue::String(value.to_string()),
27529 )),
27530 }
27531 }
27532 }
27533
27534 impl serde::ser::Serialize for Edition {
27535 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27536 where
27537 S: serde::Serializer,
27538 {
27539 match self {
27540 Self::Unspecified => serializer.serialize_i32(0),
27541 Self::Enterprise => serializer.serialize_i32(2),
27542 Self::EnterprisePlus => serializer.serialize_i32(3),
27543 Self::UnknownValue(u) => u.0.serialize(serializer),
27544 }
27545 }
27546 }
27547
27548 impl<'de> serde::de::Deserialize<'de> for Edition {
27549 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27550 where
27551 D: serde::Deserializer<'de>,
27552 {
27553 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
27554 ".google.cloud.sql.v1.Settings.Edition",
27555 ))
27556 }
27557 }
27558
27559 /// The options for enforcing Cloud SQL connectors in the instance.
27560 ///
27561 /// # Working with unknown values
27562 ///
27563 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27564 /// additional enum variants at any time. Adding new variants is not considered
27565 /// a breaking change. Applications should write their code in anticipation of:
27566 ///
27567 /// - New values appearing in future releases of the client library, **and**
27568 /// - New values received dynamically, without application changes.
27569 ///
27570 /// Please consult the [Working with enums] section in the user guide for some
27571 /// guidelines.
27572 ///
27573 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27574 #[derive(Clone, Debug, PartialEq)]
27575 #[non_exhaustive]
27576 pub enum ConnectorEnforcement {
27577 /// The requirement for Cloud SQL connectors is unknown.
27578 Unspecified,
27579 /// Do not require Cloud SQL connectors.
27580 NotRequired,
27581 /// Require all connections to use Cloud SQL connectors, including the
27582 /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
27583 /// Note: This disables all existing authorized networks.
27584 Required,
27585 /// If set, the enum was initialized with an unknown value.
27586 ///
27587 /// Applications can examine the value using [ConnectorEnforcement::value] or
27588 /// [ConnectorEnforcement::name].
27589 UnknownValue(connector_enforcement::UnknownValue),
27590 }
27591
27592 #[doc(hidden)]
27593 pub mod connector_enforcement {
27594 #[allow(unused_imports)]
27595 use super::*;
27596 #[derive(Clone, Debug, PartialEq)]
27597 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27598 }
27599
27600 impl ConnectorEnforcement {
27601 /// Gets the enum value.
27602 ///
27603 /// Returns `None` if the enum contains an unknown value deserialized from
27604 /// the string representation of enums.
27605 pub fn value(&self) -> std::option::Option<i32> {
27606 match self {
27607 Self::Unspecified => std::option::Option::Some(0),
27608 Self::NotRequired => std::option::Option::Some(1),
27609 Self::Required => std::option::Option::Some(2),
27610 Self::UnknownValue(u) => u.0.value(),
27611 }
27612 }
27613
27614 /// Gets the enum value as a string.
27615 ///
27616 /// Returns `None` if the enum contains an unknown value deserialized from
27617 /// the integer representation of enums.
27618 pub fn name(&self) -> std::option::Option<&str> {
27619 match self {
27620 Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
27621 Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
27622 Self::Required => std::option::Option::Some("REQUIRED"),
27623 Self::UnknownValue(u) => u.0.name(),
27624 }
27625 }
27626 }
27627
27628 impl std::default::Default for ConnectorEnforcement {
27629 fn default() -> Self {
27630 use std::convert::From;
27631 Self::from(0)
27632 }
27633 }
27634
27635 impl std::fmt::Display for ConnectorEnforcement {
27636 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27637 wkt::internal::display_enum(f, self.name(), self.value())
27638 }
27639 }
27640
27641 impl std::convert::From<i32> for ConnectorEnforcement {
27642 fn from(value: i32) -> Self {
27643 match value {
27644 0 => Self::Unspecified,
27645 1 => Self::NotRequired,
27646 2 => Self::Required,
27647 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27648 wkt::internal::UnknownEnumValue::Integer(value),
27649 )),
27650 }
27651 }
27652 }
27653
27654 impl std::convert::From<&str> for ConnectorEnforcement {
27655 fn from(value: &str) -> Self {
27656 use std::string::ToString;
27657 match value {
27658 "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
27659 "NOT_REQUIRED" => Self::NotRequired,
27660 "REQUIRED" => Self::Required,
27661 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27662 wkt::internal::UnknownEnumValue::String(value.to_string()),
27663 )),
27664 }
27665 }
27666 }
27667
27668 impl serde::ser::Serialize for ConnectorEnforcement {
27669 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27670 where
27671 S: serde::Serializer,
27672 {
27673 match self {
27674 Self::Unspecified => serializer.serialize_i32(0),
27675 Self::NotRequired => serializer.serialize_i32(1),
27676 Self::Required => serializer.serialize_i32(2),
27677 Self::UnknownValue(u) => u.0.serialize(serializer),
27678 }
27679 }
27680 }
27681
27682 impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
27683 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27684 where
27685 D: serde::Deserializer<'de>,
27686 {
27687 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
27688 ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
27689 ))
27690 }
27691 }
27692
27693 /// ExecuteSql API's access to the instance.
27694 ///
27695 /// # Working with unknown values
27696 ///
27697 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27698 /// additional enum variants at any time. Adding new variants is not considered
27699 /// a breaking change. Applications should write their code in anticipation of:
27700 ///
27701 /// - New values appearing in future releases of the client library, **and**
27702 /// - New values received dynamically, without application changes.
27703 ///
27704 /// Please consult the [Working with enums] section in the user guide for some
27705 /// guidelines.
27706 ///
27707 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
27708 #[derive(Clone, Debug, PartialEq)]
27709 #[non_exhaustive]
27710 pub enum DataApiAccess {
27711 /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
27712 Unspecified,
27713 /// Disallow using ExecuteSql API to connect to the instance.
27714 DisallowDataApi,
27715 /// Allow using ExecuteSql API to connect to the instance. For private IP
27716 /// instances, this allows authorized users to access the instance from
27717 /// the public internet using ExecuteSql API.
27718 AllowDataApi,
27719 /// If set, the enum was initialized with an unknown value.
27720 ///
27721 /// Applications can examine the value using [DataApiAccess::value] or
27722 /// [DataApiAccess::name].
27723 UnknownValue(data_api_access::UnknownValue),
27724 }
27725
27726 #[doc(hidden)]
27727 pub mod data_api_access {
27728 #[allow(unused_imports)]
27729 use super::*;
27730 #[derive(Clone, Debug, PartialEq)]
27731 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27732 }
27733
27734 impl DataApiAccess {
27735 /// Gets the enum value.
27736 ///
27737 /// Returns `None` if the enum contains an unknown value deserialized from
27738 /// the string representation of enums.
27739 pub fn value(&self) -> std::option::Option<i32> {
27740 match self {
27741 Self::Unspecified => std::option::Option::Some(0),
27742 Self::DisallowDataApi => std::option::Option::Some(1),
27743 Self::AllowDataApi => std::option::Option::Some(2),
27744 Self::UnknownValue(u) => u.0.value(),
27745 }
27746 }
27747
27748 /// Gets the enum value as a string.
27749 ///
27750 /// Returns `None` if the enum contains an unknown value deserialized from
27751 /// the integer representation of enums.
27752 pub fn name(&self) -> std::option::Option<&str> {
27753 match self {
27754 Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
27755 Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
27756 Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
27757 Self::UnknownValue(u) => u.0.name(),
27758 }
27759 }
27760 }
27761
27762 impl std::default::Default for DataApiAccess {
27763 fn default() -> Self {
27764 use std::convert::From;
27765 Self::from(0)
27766 }
27767 }
27768
27769 impl std::fmt::Display for DataApiAccess {
27770 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27771 wkt::internal::display_enum(f, self.name(), self.value())
27772 }
27773 }
27774
27775 impl std::convert::From<i32> for DataApiAccess {
27776 fn from(value: i32) -> Self {
27777 match value {
27778 0 => Self::Unspecified,
27779 1 => Self::DisallowDataApi,
27780 2 => Self::AllowDataApi,
27781 _ => Self::UnknownValue(data_api_access::UnknownValue(
27782 wkt::internal::UnknownEnumValue::Integer(value),
27783 )),
27784 }
27785 }
27786 }
27787
27788 impl std::convert::From<&str> for DataApiAccess {
27789 fn from(value: &str) -> Self {
27790 use std::string::ToString;
27791 match value {
27792 "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
27793 "DISALLOW_DATA_API" => Self::DisallowDataApi,
27794 "ALLOW_DATA_API" => Self::AllowDataApi,
27795 _ => Self::UnknownValue(data_api_access::UnknownValue(
27796 wkt::internal::UnknownEnumValue::String(value.to_string()),
27797 )),
27798 }
27799 }
27800 }
27801
27802 impl serde::ser::Serialize for DataApiAccess {
27803 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27804 where
27805 S: serde::Serializer,
27806 {
27807 match self {
27808 Self::Unspecified => serializer.serialize_i32(0),
27809 Self::DisallowDataApi => serializer.serialize_i32(1),
27810 Self::AllowDataApi => serializer.serialize_i32(2),
27811 Self::UnknownValue(u) => u.0.serialize(serializer),
27812 }
27813 }
27814 }
27815
27816 impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
27817 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27818 where
27819 D: serde::Deserializer<'de>,
27820 {
27821 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
27822 ".google.cloud.sql.v1.Settings.DataApiAccess",
27823 ))
27824 }
27825 }
27826}
27827
27828/// Performance Capture configuration.
27829#[derive(Clone, Default, PartialEq)]
27830#[non_exhaustive]
27831pub struct PerformanceCaptureConfig {
27832 /// Optional. Enable or disable the Performance Capture feature.
27833 pub enabled: std::option::Option<bool>,
27834
27835 /// Optional. The time interval in seconds between any two probes.
27836 pub probing_interval_seconds: std::option::Option<i32>,
27837
27838 /// Optional. The minimum number of consecutive readings above threshold that
27839 /// triggers instance state capture.
27840 pub probe_threshold: std::option::Option<i32>,
27841
27842 /// Optional. The minimum number of server threads running to trigger the
27843 /// capture on primary.
27844 pub running_threads_threshold: std::option::Option<i32>,
27845
27846 /// Optional. The minimum number of seconds replica must be lagging behind
27847 /// primary to trigger capture on replica.
27848 pub seconds_behind_source_threshold: std::option::Option<i32>,
27849
27850 /// Optional. The amount of time in seconds that a transaction needs to have
27851 /// been open before the watcher starts recording it.
27852 pub transaction_duration_threshold: std::option::Option<i32>,
27853
27854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27855}
27856
27857impl PerformanceCaptureConfig {
27858 pub fn new() -> Self {
27859 std::default::Default::default()
27860 }
27861
27862 /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
27863 ///
27864 /// # Example
27865 /// ```ignore,no_run
27866 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27867 /// let x = PerformanceCaptureConfig::new().set_enabled(true);
27868 /// ```
27869 pub fn set_enabled<T>(mut self, v: T) -> Self
27870 where
27871 T: std::convert::Into<bool>,
27872 {
27873 self.enabled = std::option::Option::Some(v.into());
27874 self
27875 }
27876
27877 /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
27878 ///
27879 /// # Example
27880 /// ```ignore,no_run
27881 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27882 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
27883 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
27884 /// ```
27885 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27886 where
27887 T: std::convert::Into<bool>,
27888 {
27889 self.enabled = v.map(|x| x.into());
27890 self
27891 }
27892
27893 /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
27894 ///
27895 /// # Example
27896 /// ```ignore,no_run
27897 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27898 /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
27899 /// ```
27900 pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
27901 where
27902 T: std::convert::Into<i32>,
27903 {
27904 self.probing_interval_seconds = std::option::Option::Some(v.into());
27905 self
27906 }
27907
27908 /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
27909 ///
27910 /// # Example
27911 /// ```ignore,no_run
27912 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27913 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
27914 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
27915 /// ```
27916 pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
27917 where
27918 T: std::convert::Into<i32>,
27919 {
27920 self.probing_interval_seconds = v.map(|x| x.into());
27921 self
27922 }
27923
27924 /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
27925 ///
27926 /// # Example
27927 /// ```ignore,no_run
27928 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27929 /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
27930 /// ```
27931 pub fn set_probe_threshold<T>(mut self, v: T) -> Self
27932 where
27933 T: std::convert::Into<i32>,
27934 {
27935 self.probe_threshold = std::option::Option::Some(v.into());
27936 self
27937 }
27938
27939 /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
27940 ///
27941 /// # Example
27942 /// ```ignore,no_run
27943 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27944 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
27945 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
27946 /// ```
27947 pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
27948 where
27949 T: std::convert::Into<i32>,
27950 {
27951 self.probe_threshold = v.map(|x| x.into());
27952 self
27953 }
27954
27955 /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
27956 ///
27957 /// # Example
27958 /// ```ignore,no_run
27959 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27960 /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
27961 /// ```
27962 pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
27963 where
27964 T: std::convert::Into<i32>,
27965 {
27966 self.running_threads_threshold = std::option::Option::Some(v.into());
27967 self
27968 }
27969
27970 /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
27971 ///
27972 /// # Example
27973 /// ```ignore,no_run
27974 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27975 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
27976 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
27977 /// ```
27978 pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
27979 where
27980 T: std::convert::Into<i32>,
27981 {
27982 self.running_threads_threshold = v.map(|x| x.into());
27983 self
27984 }
27985
27986 /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
27987 ///
27988 /// # Example
27989 /// ```ignore,no_run
27990 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27991 /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
27992 /// ```
27993 pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
27994 where
27995 T: std::convert::Into<i32>,
27996 {
27997 self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
27998 self
27999 }
28000
28001 /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28002 ///
28003 /// # Example
28004 /// ```ignore,no_run
28005 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28006 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
28007 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
28008 /// ```
28009 pub fn set_or_clear_seconds_behind_source_threshold<T>(
28010 mut self,
28011 v: std::option::Option<T>,
28012 ) -> Self
28013 where
28014 T: std::convert::Into<i32>,
28015 {
28016 self.seconds_behind_source_threshold = v.map(|x| x.into());
28017 self
28018 }
28019
28020 /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28021 ///
28022 /// # Example
28023 /// ```ignore,no_run
28024 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28025 /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
28026 /// ```
28027 pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
28028 where
28029 T: std::convert::Into<i32>,
28030 {
28031 self.transaction_duration_threshold = std::option::Option::Some(v.into());
28032 self
28033 }
28034
28035 /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28036 ///
28037 /// # Example
28038 /// ```ignore,no_run
28039 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28040 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
28041 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
28042 /// ```
28043 pub fn set_or_clear_transaction_duration_threshold<T>(
28044 mut self,
28045 v: std::option::Option<T>,
28046 ) -> Self
28047 where
28048 T: std::convert::Into<i32>,
28049 {
28050 self.transaction_duration_threshold = v.map(|x| x.into());
28051 self
28052 }
28053}
28054
28055impl wkt::message::Message for PerformanceCaptureConfig {
28056 fn typename() -> &'static str {
28057 "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
28058 }
28059}
28060
28061/// Connection pool flags for Cloud SQL instances managed connection pool
28062/// configuration.
28063#[derive(Clone, Default, PartialEq)]
28064#[non_exhaustive]
28065pub struct ConnectionPoolFlags {
28066 /// Required. The name of the flag.
28067 pub name: std::string::String,
28068
28069 /// Required. The value of the flag. Boolean flags are set to `on` for true
28070 /// and `off` for false. This field must be omitted if the flag
28071 /// doesn't take a value.
28072 pub value: std::string::String,
28073
28074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28075}
28076
28077impl ConnectionPoolFlags {
28078 pub fn new() -> Self {
28079 std::default::Default::default()
28080 }
28081
28082 /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
28083 ///
28084 /// # Example
28085 /// ```ignore,no_run
28086 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28087 /// let x = ConnectionPoolFlags::new().set_name("example");
28088 /// ```
28089 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28090 self.name = v.into();
28091 self
28092 }
28093
28094 /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
28095 ///
28096 /// # Example
28097 /// ```ignore,no_run
28098 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28099 /// let x = ConnectionPoolFlags::new().set_value("example");
28100 /// ```
28101 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28102 self.value = v.into();
28103 self
28104 }
28105}
28106
28107impl wkt::message::Message for ConnectionPoolFlags {
28108 fn typename() -> &'static str {
28109 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
28110 }
28111}
28112
28113/// The managed connection pooling configuration.
28114#[derive(Clone, Default, PartialEq)]
28115#[non_exhaustive]
28116pub struct ConnectionPoolConfig {
28117 /// Whether managed connection pooling is enabled.
28118 pub connection_pooling_enabled: std::option::Option<bool>,
28119
28120 /// Optional. List of connection pool configuration flags.
28121 pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
28122
28123 /// Output only. Number of connection poolers.
28124 pub pooler_count: std::option::Option<i32>,
28125
28126 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28127}
28128
28129impl ConnectionPoolConfig {
28130 pub fn new() -> Self {
28131 std::default::Default::default()
28132 }
28133
28134 /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28135 ///
28136 /// # Example
28137 /// ```ignore,no_run
28138 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28139 /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
28140 /// ```
28141 pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
28142 where
28143 T: std::convert::Into<bool>,
28144 {
28145 self.connection_pooling_enabled = std::option::Option::Some(v.into());
28146 self
28147 }
28148
28149 /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28150 ///
28151 /// # Example
28152 /// ```ignore,no_run
28153 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28154 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
28155 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
28156 /// ```
28157 pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28158 where
28159 T: std::convert::Into<bool>,
28160 {
28161 self.connection_pooling_enabled = v.map(|x| x.into());
28162 self
28163 }
28164
28165 /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
28166 ///
28167 /// # Example
28168 /// ```ignore,no_run
28169 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28170 /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
28171 /// let x = ConnectionPoolConfig::new()
28172 /// .set_flags([
28173 /// ConnectionPoolFlags::default()/* use setters */,
28174 /// ConnectionPoolFlags::default()/* use (different) setters */,
28175 /// ]);
28176 /// ```
28177 pub fn set_flags<T, V>(mut self, v: T) -> Self
28178 where
28179 T: std::iter::IntoIterator<Item = V>,
28180 V: std::convert::Into<crate::model::ConnectionPoolFlags>,
28181 {
28182 use std::iter::Iterator;
28183 self.flags = v.into_iter().map(|i| i.into()).collect();
28184 self
28185 }
28186
28187 /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28188 ///
28189 /// # Example
28190 /// ```ignore,no_run
28191 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28192 /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
28193 /// ```
28194 pub fn set_pooler_count<T>(mut self, v: T) -> Self
28195 where
28196 T: std::convert::Into<i32>,
28197 {
28198 self.pooler_count = std::option::Option::Some(v.into());
28199 self
28200 }
28201
28202 /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28203 ///
28204 /// # Example
28205 /// ```ignore,no_run
28206 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28207 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
28208 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
28209 /// ```
28210 pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
28211 where
28212 T: std::convert::Into<i32>,
28213 {
28214 self.pooler_count = v.map(|x| x.into());
28215 self
28216 }
28217}
28218
28219impl wkt::message::Message for ConnectionPoolConfig {
28220 fn typename() -> &'static str {
28221 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
28222 }
28223}
28224
28225/// The read pool auto-scale configuration.
28226#[derive(Clone, Default, PartialEq)]
28227#[non_exhaustive]
28228pub struct ReadPoolAutoScaleConfig {
28229 /// Indicates whether read pool auto scaling is enabled.
28230 pub enabled: std::option::Option<bool>,
28231
28232 /// Minimum number of read pool nodes to be maintained.
28233 pub min_node_count: std::option::Option<i32>,
28234
28235 /// Maximum number of read pool nodes to be maintained.
28236 pub max_node_count: std::option::Option<i32>,
28237
28238 /// Optional. Target metrics for read pool auto scaling.
28239 pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
28240
28241 /// Indicates whether read pool auto scaling supports scale in operations
28242 /// (removing nodes).
28243 pub disable_scale_in: std::option::Option<bool>,
28244
28245 /// The cooldown period for scale-in operations.
28246 pub scale_in_cooldown_seconds: std::option::Option<i32>,
28247
28248 /// The cooldown period for scale-out operations.
28249 pub scale_out_cooldown_seconds: std::option::Option<i32>,
28250
28251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28252}
28253
28254impl ReadPoolAutoScaleConfig {
28255 pub fn new() -> Self {
28256 std::default::Default::default()
28257 }
28258
28259 /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28260 ///
28261 /// # Example
28262 /// ```ignore,no_run
28263 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28264 /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
28265 /// ```
28266 pub fn set_enabled<T>(mut self, v: T) -> Self
28267 where
28268 T: std::convert::Into<bool>,
28269 {
28270 self.enabled = std::option::Option::Some(v.into());
28271 self
28272 }
28273
28274 /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28275 ///
28276 /// # Example
28277 /// ```ignore,no_run
28278 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28279 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
28280 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
28281 /// ```
28282 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28283 where
28284 T: std::convert::Into<bool>,
28285 {
28286 self.enabled = v.map(|x| x.into());
28287 self
28288 }
28289
28290 /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28291 ///
28292 /// # Example
28293 /// ```ignore,no_run
28294 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28295 /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
28296 /// ```
28297 pub fn set_min_node_count<T>(mut self, v: T) -> Self
28298 where
28299 T: std::convert::Into<i32>,
28300 {
28301 self.min_node_count = std::option::Option::Some(v.into());
28302 self
28303 }
28304
28305 /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28306 ///
28307 /// # Example
28308 /// ```ignore,no_run
28309 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28310 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
28311 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
28312 /// ```
28313 pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28314 where
28315 T: std::convert::Into<i32>,
28316 {
28317 self.min_node_count = v.map(|x| x.into());
28318 self
28319 }
28320
28321 /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28322 ///
28323 /// # Example
28324 /// ```ignore,no_run
28325 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28326 /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
28327 /// ```
28328 pub fn set_max_node_count<T>(mut self, v: T) -> Self
28329 where
28330 T: std::convert::Into<i32>,
28331 {
28332 self.max_node_count = std::option::Option::Some(v.into());
28333 self
28334 }
28335
28336 /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28337 ///
28338 /// # Example
28339 /// ```ignore,no_run
28340 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28341 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
28342 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
28343 /// ```
28344 pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28345 where
28346 T: std::convert::Into<i32>,
28347 {
28348 self.max_node_count = v.map(|x| x.into());
28349 self
28350 }
28351
28352 /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
28353 ///
28354 /// # Example
28355 /// ```ignore,no_run
28356 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28357 /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28358 /// let x = ReadPoolAutoScaleConfig::new()
28359 /// .set_target_metrics([
28360 /// TargetMetric::default()/* use setters */,
28361 /// TargetMetric::default()/* use (different) setters */,
28362 /// ]);
28363 /// ```
28364 pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
28365 where
28366 T: std::iter::IntoIterator<Item = V>,
28367 V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
28368 {
28369 use std::iter::Iterator;
28370 self.target_metrics = v.into_iter().map(|i| i.into()).collect();
28371 self
28372 }
28373
28374 /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28375 ///
28376 /// # Example
28377 /// ```ignore,no_run
28378 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28379 /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
28380 /// ```
28381 pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
28382 where
28383 T: std::convert::Into<bool>,
28384 {
28385 self.disable_scale_in = std::option::Option::Some(v.into());
28386 self
28387 }
28388
28389 /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28390 ///
28391 /// # Example
28392 /// ```ignore,no_run
28393 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28394 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
28395 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
28396 /// ```
28397 pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
28398 where
28399 T: std::convert::Into<bool>,
28400 {
28401 self.disable_scale_in = v.map(|x| x.into());
28402 self
28403 }
28404
28405 /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28406 ///
28407 /// # Example
28408 /// ```ignore,no_run
28409 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28410 /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
28411 /// ```
28412 pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
28413 where
28414 T: std::convert::Into<i32>,
28415 {
28416 self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
28417 self
28418 }
28419
28420 /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28421 ///
28422 /// # Example
28423 /// ```ignore,no_run
28424 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28425 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
28426 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
28427 /// ```
28428 pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28429 where
28430 T: std::convert::Into<i32>,
28431 {
28432 self.scale_in_cooldown_seconds = v.map(|x| x.into());
28433 self
28434 }
28435
28436 /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28437 ///
28438 /// # Example
28439 /// ```ignore,no_run
28440 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28441 /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
28442 /// ```
28443 pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
28444 where
28445 T: std::convert::Into<i32>,
28446 {
28447 self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
28448 self
28449 }
28450
28451 /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28452 ///
28453 /// # Example
28454 /// ```ignore,no_run
28455 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28456 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
28457 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
28458 /// ```
28459 pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28460 where
28461 T: std::convert::Into<i32>,
28462 {
28463 self.scale_out_cooldown_seconds = v.map(|x| x.into());
28464 self
28465 }
28466}
28467
28468impl wkt::message::Message for ReadPoolAutoScaleConfig {
28469 fn typename() -> &'static str {
28470 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
28471 }
28472}
28473
28474/// Defines additional types related to [ReadPoolAutoScaleConfig].
28475pub mod read_pool_auto_scale_config {
28476 #[allow(unused_imports)]
28477 use super::*;
28478
28479 /// Target metric for read pool auto scaling.
28480 #[derive(Clone, Default, PartialEq)]
28481 #[non_exhaustive]
28482 pub struct TargetMetric {
28483 /// The metric name to be used for auto scaling.
28484 pub metric: std::option::Option<std::string::String>,
28485
28486 /// The target value for the metric.
28487 pub target_value: std::option::Option<f32>,
28488
28489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28490 }
28491
28492 impl TargetMetric {
28493 pub fn new() -> Self {
28494 std::default::Default::default()
28495 }
28496
28497 /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28498 ///
28499 /// # Example
28500 /// ```ignore,no_run
28501 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28502 /// let x = TargetMetric::new().set_metric("example");
28503 /// ```
28504 pub fn set_metric<T>(mut self, v: T) -> Self
28505 where
28506 T: std::convert::Into<std::string::String>,
28507 {
28508 self.metric = std::option::Option::Some(v.into());
28509 self
28510 }
28511
28512 /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28513 ///
28514 /// # Example
28515 /// ```ignore,no_run
28516 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28517 /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
28518 /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
28519 /// ```
28520 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
28521 where
28522 T: std::convert::Into<std::string::String>,
28523 {
28524 self.metric = v.map(|x| x.into());
28525 self
28526 }
28527
28528 /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28529 ///
28530 /// # Example
28531 /// ```ignore,no_run
28532 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28533 /// let x = TargetMetric::new().set_target_value(42.0);
28534 /// ```
28535 pub fn set_target_value<T>(mut self, v: T) -> Self
28536 where
28537 T: std::convert::Into<f32>,
28538 {
28539 self.target_value = std::option::Option::Some(v.into());
28540 self
28541 }
28542
28543 /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28544 ///
28545 /// # Example
28546 /// ```ignore,no_run
28547 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28548 /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
28549 /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
28550 /// ```
28551 pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
28552 where
28553 T: std::convert::Into<f32>,
28554 {
28555 self.target_value = v.map(|x| x.into());
28556 self
28557 }
28558 }
28559
28560 impl wkt::message::Message for TargetMetric {
28561 fn typename() -> &'static str {
28562 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
28563 }
28564 }
28565}
28566
28567/// Specifies options for controlling advanced machine features.
28568#[derive(Clone, Default, PartialEq)]
28569#[non_exhaustive]
28570pub struct AdvancedMachineFeatures {
28571 /// The number of threads per physical core.
28572 pub threads_per_core: i32,
28573
28574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28575}
28576
28577impl AdvancedMachineFeatures {
28578 pub fn new() -> Self {
28579 std::default::Default::default()
28580 }
28581
28582 /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
28583 ///
28584 /// # Example
28585 /// ```ignore,no_run
28586 /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
28587 /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
28588 /// ```
28589 pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28590 self.threads_per_core = v.into();
28591 self
28592 }
28593}
28594
28595impl wkt::message::Message for AdvancedMachineFeatures {
28596 fn typename() -> &'static str {
28597 "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
28598 }
28599}
28600
28601/// SslCerts Resource
28602#[derive(Clone, Default, PartialEq)]
28603#[non_exhaustive]
28604pub struct SslCert {
28605 /// This is always `sql#sslCert`.
28606 pub kind: std::string::String,
28607
28608 /// Serial number, as extracted from the certificate.
28609 pub cert_serial_number: std::string::String,
28610
28611 /// PEM representation.
28612 pub cert: std::string::String,
28613
28614 /// The time when the certificate was created in [RFC
28615 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28616 /// `2012-11-15T16:19:00.094Z`
28617 pub create_time: std::option::Option<wkt::Timestamp>,
28618
28619 /// User supplied name. Constrained to [a-zA-Z.-_ ]+.
28620 pub common_name: std::string::String,
28621
28622 /// The time when the certificate expires in [RFC
28623 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28624 /// `2012-11-15T16:19:00.094Z`.
28625 pub expiration_time: std::option::Option<wkt::Timestamp>,
28626
28627 /// Sha1 Fingerprint.
28628 pub sha1_fingerprint: std::string::String,
28629
28630 /// Name of the database instance.
28631 pub instance: std::string::String,
28632
28633 /// The URI of this resource.
28634 pub self_link: std::string::String,
28635
28636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28637}
28638
28639impl SslCert {
28640 pub fn new() -> Self {
28641 std::default::Default::default()
28642 }
28643
28644 /// Sets the value of [kind][crate::model::SslCert::kind].
28645 ///
28646 /// # Example
28647 /// ```ignore,no_run
28648 /// # use google_cloud_sql_v1::model::SslCert;
28649 /// let x = SslCert::new().set_kind("example");
28650 /// ```
28651 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28652 self.kind = v.into();
28653 self
28654 }
28655
28656 /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
28657 ///
28658 /// # Example
28659 /// ```ignore,no_run
28660 /// # use google_cloud_sql_v1::model::SslCert;
28661 /// let x = SslCert::new().set_cert_serial_number("example");
28662 /// ```
28663 pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
28664 mut self,
28665 v: T,
28666 ) -> Self {
28667 self.cert_serial_number = v.into();
28668 self
28669 }
28670
28671 /// Sets the value of [cert][crate::model::SslCert::cert].
28672 ///
28673 /// # Example
28674 /// ```ignore,no_run
28675 /// # use google_cloud_sql_v1::model::SslCert;
28676 /// let x = SslCert::new().set_cert("example");
28677 /// ```
28678 pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28679 self.cert = v.into();
28680 self
28681 }
28682
28683 /// Sets the value of [create_time][crate::model::SslCert::create_time].
28684 ///
28685 /// # Example
28686 /// ```ignore,no_run
28687 /// # use google_cloud_sql_v1::model::SslCert;
28688 /// use wkt::Timestamp;
28689 /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
28690 /// ```
28691 pub fn set_create_time<T>(mut self, v: T) -> Self
28692 where
28693 T: std::convert::Into<wkt::Timestamp>,
28694 {
28695 self.create_time = std::option::Option::Some(v.into());
28696 self
28697 }
28698
28699 /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
28700 ///
28701 /// # Example
28702 /// ```ignore,no_run
28703 /// # use google_cloud_sql_v1::model::SslCert;
28704 /// use wkt::Timestamp;
28705 /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
28706 /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
28707 /// ```
28708 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
28709 where
28710 T: std::convert::Into<wkt::Timestamp>,
28711 {
28712 self.create_time = v.map(|x| x.into());
28713 self
28714 }
28715
28716 /// Sets the value of [common_name][crate::model::SslCert::common_name].
28717 ///
28718 /// # Example
28719 /// ```ignore,no_run
28720 /// # use google_cloud_sql_v1::model::SslCert;
28721 /// let x = SslCert::new().set_common_name("example");
28722 /// ```
28723 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28724 self.common_name = v.into();
28725 self
28726 }
28727
28728 /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
28729 ///
28730 /// # Example
28731 /// ```ignore,no_run
28732 /// # use google_cloud_sql_v1::model::SslCert;
28733 /// use wkt::Timestamp;
28734 /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
28735 /// ```
28736 pub fn set_expiration_time<T>(mut self, v: T) -> Self
28737 where
28738 T: std::convert::Into<wkt::Timestamp>,
28739 {
28740 self.expiration_time = std::option::Option::Some(v.into());
28741 self
28742 }
28743
28744 /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
28745 ///
28746 /// # Example
28747 /// ```ignore,no_run
28748 /// # use google_cloud_sql_v1::model::SslCert;
28749 /// use wkt::Timestamp;
28750 /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
28751 /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
28752 /// ```
28753 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
28754 where
28755 T: std::convert::Into<wkt::Timestamp>,
28756 {
28757 self.expiration_time = v.map(|x| x.into());
28758 self
28759 }
28760
28761 /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
28762 ///
28763 /// # Example
28764 /// ```ignore,no_run
28765 /// # use google_cloud_sql_v1::model::SslCert;
28766 /// let x = SslCert::new().set_sha1_fingerprint("example");
28767 /// ```
28768 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
28769 mut self,
28770 v: T,
28771 ) -> Self {
28772 self.sha1_fingerprint = v.into();
28773 self
28774 }
28775
28776 /// Sets the value of [instance][crate::model::SslCert::instance].
28777 ///
28778 /// # Example
28779 /// ```ignore,no_run
28780 /// # use google_cloud_sql_v1::model::SslCert;
28781 /// let x = SslCert::new().set_instance("example");
28782 /// ```
28783 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28784 self.instance = v.into();
28785 self
28786 }
28787
28788 /// Sets the value of [self_link][crate::model::SslCert::self_link].
28789 ///
28790 /// # Example
28791 /// ```ignore,no_run
28792 /// # use google_cloud_sql_v1::model::SslCert;
28793 /// let x = SslCert::new().set_self_link("example");
28794 /// ```
28795 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28796 self.self_link = v.into();
28797 self
28798 }
28799}
28800
28801impl wkt::message::Message for SslCert {
28802 fn typename() -> &'static str {
28803 "type.googleapis.com/google.cloud.sql.v1.SslCert"
28804 }
28805}
28806
28807/// SslCertDetail.
28808#[derive(Clone, Default, PartialEq)]
28809#[non_exhaustive]
28810pub struct SslCertDetail {
28811 /// The public information about the cert.
28812 pub cert_info: std::option::Option<crate::model::SslCert>,
28813
28814 /// The private key for the client cert, in pem format. Keep private in order
28815 /// to protect your security.
28816 pub cert_private_key: std::string::String,
28817
28818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28819}
28820
28821impl SslCertDetail {
28822 pub fn new() -> Self {
28823 std::default::Default::default()
28824 }
28825
28826 /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
28827 ///
28828 /// # Example
28829 /// ```ignore,no_run
28830 /// # use google_cloud_sql_v1::model::SslCertDetail;
28831 /// use google_cloud_sql_v1::model::SslCert;
28832 /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
28833 /// ```
28834 pub fn set_cert_info<T>(mut self, v: T) -> Self
28835 where
28836 T: std::convert::Into<crate::model::SslCert>,
28837 {
28838 self.cert_info = std::option::Option::Some(v.into());
28839 self
28840 }
28841
28842 /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
28843 ///
28844 /// # Example
28845 /// ```ignore,no_run
28846 /// # use google_cloud_sql_v1::model::SslCertDetail;
28847 /// use google_cloud_sql_v1::model::SslCert;
28848 /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
28849 /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
28850 /// ```
28851 pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
28852 where
28853 T: std::convert::Into<crate::model::SslCert>,
28854 {
28855 self.cert_info = v.map(|x| x.into());
28856 self
28857 }
28858
28859 /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
28860 ///
28861 /// # Example
28862 /// ```ignore,no_run
28863 /// # use google_cloud_sql_v1::model::SslCertDetail;
28864 /// let x = SslCertDetail::new().set_cert_private_key("example");
28865 /// ```
28866 pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
28867 mut self,
28868 v: T,
28869 ) -> Self {
28870 self.cert_private_key = v.into();
28871 self
28872 }
28873}
28874
28875impl wkt::message::Message for SslCertDetail {
28876 fn typename() -> &'static str {
28877 "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
28878 }
28879}
28880
28881/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
28882#[derive(Clone, Default, PartialEq)]
28883#[non_exhaustive]
28884pub struct SqlActiveDirectoryConfig {
28885 /// This is always sql#activeDirectoryConfig.
28886 pub kind: std::string::String,
28887
28888 /// The name of the domain (e.g., mydomain.com).
28889 pub domain: std::string::String,
28890
28891 /// Optional. The mode of the Active Directory configuration.
28892 pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
28893
28894 /// Optional. Domain controller IPv4 addresses used to bootstrap Active
28895 /// Directory.
28896 pub dns_servers: std::vec::Vec<std::string::String>,
28897
28898 /// Optional. The secret manager key storing the administrator credential.
28899 /// (e.g., projects/{project}/secrets/{secret}).
28900 pub admin_credential_secret_name: std::string::String,
28901
28902 /// Optional. The organizational unit distinguished name. This is the full
28903 /// hierarchical path to the organizational unit.
28904 pub organizational_unit: std::string::String,
28905
28906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28907}
28908
28909impl SqlActiveDirectoryConfig {
28910 pub fn new() -> Self {
28911 std::default::Default::default()
28912 }
28913
28914 /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
28915 ///
28916 /// # Example
28917 /// ```ignore,no_run
28918 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28919 /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
28920 /// ```
28921 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28922 self.kind = v.into();
28923 self
28924 }
28925
28926 /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
28927 ///
28928 /// # Example
28929 /// ```ignore,no_run
28930 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28931 /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
28932 /// ```
28933 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28934 self.domain = v.into();
28935 self
28936 }
28937
28938 /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
28939 ///
28940 /// # Example
28941 /// ```ignore,no_run
28942 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28943 /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
28944 /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
28945 /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
28946 /// ```
28947 pub fn set_mode<
28948 T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
28949 >(
28950 mut self,
28951 v: T,
28952 ) -> Self {
28953 self.mode = v.into();
28954 self
28955 }
28956
28957 /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
28958 ///
28959 /// # Example
28960 /// ```ignore,no_run
28961 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28962 /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
28963 /// ```
28964 pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
28965 where
28966 T: std::iter::IntoIterator<Item = V>,
28967 V: std::convert::Into<std::string::String>,
28968 {
28969 use std::iter::Iterator;
28970 self.dns_servers = v.into_iter().map(|i| i.into()).collect();
28971 self
28972 }
28973
28974 /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
28975 ///
28976 /// # Example
28977 /// ```ignore,no_run
28978 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28979 /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
28980 /// ```
28981 pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
28982 mut self,
28983 v: T,
28984 ) -> Self {
28985 self.admin_credential_secret_name = v.into();
28986 self
28987 }
28988
28989 /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
28990 ///
28991 /// # Example
28992 /// ```ignore,no_run
28993 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28994 /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
28995 /// ```
28996 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
28997 mut self,
28998 v: T,
28999 ) -> Self {
29000 self.organizational_unit = v.into();
29001 self
29002 }
29003}
29004
29005impl wkt::message::Message for SqlActiveDirectoryConfig {
29006 fn typename() -> &'static str {
29007 "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
29008 }
29009}
29010
29011/// Defines additional types related to [SqlActiveDirectoryConfig].
29012pub mod sql_active_directory_config {
29013 #[allow(unused_imports)]
29014 use super::*;
29015
29016 /// The modes of Active Directory configuration.
29017 ///
29018 /// # Working with unknown values
29019 ///
29020 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29021 /// additional enum variants at any time. Adding new variants is not considered
29022 /// a breaking change. Applications should write their code in anticipation of:
29023 ///
29024 /// - New values appearing in future releases of the client library, **and**
29025 /// - New values received dynamically, without application changes.
29026 ///
29027 /// Please consult the [Working with enums] section in the user guide for some
29028 /// guidelines.
29029 ///
29030 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29031 #[derive(Clone, Debug, PartialEq)]
29032 #[non_exhaustive]
29033 pub enum ActiveDirectoryMode {
29034 /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
29035 /// not specified to maintain backward compatibility.
29036 Unspecified,
29037 /// Managed Active Directory mode.
29038 ManagedActiveDirectory,
29039 /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
29040 #[deprecated]
29041 SelfManagedActiveDirectory,
29042 /// Customer-managed Active Directory mode.
29043 CustomerManagedActiveDirectory,
29044 /// If set, the enum was initialized with an unknown value.
29045 ///
29046 /// Applications can examine the value using [ActiveDirectoryMode::value] or
29047 /// [ActiveDirectoryMode::name].
29048 UnknownValue(active_directory_mode::UnknownValue),
29049 }
29050
29051 #[doc(hidden)]
29052 pub mod active_directory_mode {
29053 #[allow(unused_imports)]
29054 use super::*;
29055 #[derive(Clone, Debug, PartialEq)]
29056 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29057 }
29058
29059 impl ActiveDirectoryMode {
29060 /// Gets the enum value.
29061 ///
29062 /// Returns `None` if the enum contains an unknown value deserialized from
29063 /// the string representation of enums.
29064 pub fn value(&self) -> std::option::Option<i32> {
29065 match self {
29066 Self::Unspecified => std::option::Option::Some(0),
29067 Self::ManagedActiveDirectory => std::option::Option::Some(1),
29068 Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
29069 Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
29070 Self::UnknownValue(u) => u.0.value(),
29071 }
29072 }
29073
29074 /// Gets the enum value as a string.
29075 ///
29076 /// Returns `None` if the enum contains an unknown value deserialized from
29077 /// the integer representation of enums.
29078 pub fn name(&self) -> std::option::Option<&str> {
29079 match self {
29080 Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
29081 Self::ManagedActiveDirectory => {
29082 std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
29083 }
29084 Self::SelfManagedActiveDirectory => {
29085 std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
29086 }
29087 Self::CustomerManagedActiveDirectory => {
29088 std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
29089 }
29090 Self::UnknownValue(u) => u.0.name(),
29091 }
29092 }
29093 }
29094
29095 impl std::default::Default for ActiveDirectoryMode {
29096 fn default() -> Self {
29097 use std::convert::From;
29098 Self::from(0)
29099 }
29100 }
29101
29102 impl std::fmt::Display for ActiveDirectoryMode {
29103 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29104 wkt::internal::display_enum(f, self.name(), self.value())
29105 }
29106 }
29107
29108 impl std::convert::From<i32> for ActiveDirectoryMode {
29109 fn from(value: i32) -> Self {
29110 match value {
29111 0 => Self::Unspecified,
29112 1 => Self::ManagedActiveDirectory,
29113 2 => Self::SelfManagedActiveDirectory,
29114 3 => Self::CustomerManagedActiveDirectory,
29115 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29116 wkt::internal::UnknownEnumValue::Integer(value),
29117 )),
29118 }
29119 }
29120 }
29121
29122 impl std::convert::From<&str> for ActiveDirectoryMode {
29123 fn from(value: &str) -> Self {
29124 use std::string::ToString;
29125 match value {
29126 "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
29127 "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
29128 "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
29129 "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
29130 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29131 wkt::internal::UnknownEnumValue::String(value.to_string()),
29132 )),
29133 }
29134 }
29135 }
29136
29137 impl serde::ser::Serialize for ActiveDirectoryMode {
29138 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29139 where
29140 S: serde::Serializer,
29141 {
29142 match self {
29143 Self::Unspecified => serializer.serialize_i32(0),
29144 Self::ManagedActiveDirectory => serializer.serialize_i32(1),
29145 Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
29146 Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
29147 Self::UnknownValue(u) => u.0.serialize(serializer),
29148 }
29149 }
29150 }
29151
29152 impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
29153 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29154 where
29155 D: serde::Deserializer<'de>,
29156 {
29157 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
29158 ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
29159 ))
29160 }
29161 }
29162}
29163
29164/// SQL Server specific audit configuration.
29165#[derive(Clone, Default, PartialEq)]
29166#[non_exhaustive]
29167pub struct SqlServerAuditConfig {
29168 /// This is always sql#sqlServerAuditConfig
29169 pub kind: std::string::String,
29170
29171 /// The name of the destination bucket (e.g., gs://mybucket).
29172 pub bucket: std::string::String,
29173
29174 /// How long to keep generated audit files.
29175 pub retention_interval: std::option::Option<wkt::Duration>,
29176
29177 /// How often to upload generated audit files.
29178 pub upload_interval: std::option::Option<wkt::Duration>,
29179
29180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29181}
29182
29183impl SqlServerAuditConfig {
29184 pub fn new() -> Self {
29185 std::default::Default::default()
29186 }
29187
29188 /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
29189 ///
29190 /// # Example
29191 /// ```ignore,no_run
29192 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29193 /// let x = SqlServerAuditConfig::new().set_kind("example");
29194 /// ```
29195 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29196 self.kind = v.into();
29197 self
29198 }
29199
29200 /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
29201 ///
29202 /// # Example
29203 /// ```ignore,no_run
29204 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29205 /// let x = SqlServerAuditConfig::new().set_bucket("example");
29206 /// ```
29207 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29208 self.bucket = v.into();
29209 self
29210 }
29211
29212 /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29213 ///
29214 /// # Example
29215 /// ```ignore,no_run
29216 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29217 /// use wkt::Duration;
29218 /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
29219 /// ```
29220 pub fn set_retention_interval<T>(mut self, v: T) -> Self
29221 where
29222 T: std::convert::Into<wkt::Duration>,
29223 {
29224 self.retention_interval = std::option::Option::Some(v.into());
29225 self
29226 }
29227
29228 /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29229 ///
29230 /// # Example
29231 /// ```ignore,no_run
29232 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29233 /// use wkt::Duration;
29234 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
29235 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
29236 /// ```
29237 pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
29238 where
29239 T: std::convert::Into<wkt::Duration>,
29240 {
29241 self.retention_interval = v.map(|x| x.into());
29242 self
29243 }
29244
29245 /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29246 ///
29247 /// # Example
29248 /// ```ignore,no_run
29249 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29250 /// use wkt::Duration;
29251 /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
29252 /// ```
29253 pub fn set_upload_interval<T>(mut self, v: T) -> Self
29254 where
29255 T: std::convert::Into<wkt::Duration>,
29256 {
29257 self.upload_interval = std::option::Option::Some(v.into());
29258 self
29259 }
29260
29261 /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29262 ///
29263 /// # Example
29264 /// ```ignore,no_run
29265 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29266 /// use wkt::Duration;
29267 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
29268 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
29269 /// ```
29270 pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
29271 where
29272 T: std::convert::Into<wkt::Duration>,
29273 {
29274 self.upload_interval = v.map(|x| x.into());
29275 self
29276 }
29277}
29278
29279impl wkt::message::Message for SqlServerAuditConfig {
29280 fn typename() -> &'static str {
29281 "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
29282 }
29283}
29284
29285/// SQL Server Entra ID configuration.
29286#[derive(Clone, Default, PartialEq)]
29287#[non_exhaustive]
29288pub struct SqlServerEntraIdConfig {
29289 /// Output only. This is always sql#sqlServerEntraIdConfig
29290 pub kind: std::string::String,
29291
29292 /// Optional. The tenant ID for the Entra ID configuration.
29293 pub tenant_id: std::string::String,
29294
29295 /// Optional. The application ID for the Entra ID configuration.
29296 pub application_id: std::string::String,
29297
29298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29299}
29300
29301impl SqlServerEntraIdConfig {
29302 pub fn new() -> Self {
29303 std::default::Default::default()
29304 }
29305
29306 /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
29307 ///
29308 /// # Example
29309 /// ```ignore,no_run
29310 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29311 /// let x = SqlServerEntraIdConfig::new().set_kind("example");
29312 /// ```
29313 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29314 self.kind = v.into();
29315 self
29316 }
29317
29318 /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
29319 ///
29320 /// # Example
29321 /// ```ignore,no_run
29322 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29323 /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
29324 /// ```
29325 pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29326 self.tenant_id = v.into();
29327 self
29328 }
29329
29330 /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
29331 ///
29332 /// # Example
29333 /// ```ignore,no_run
29334 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29335 /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
29336 /// ```
29337 pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29338 self.application_id = v.into();
29339 self
29340 }
29341}
29342
29343impl wkt::message::Message for SqlServerEntraIdConfig {
29344 fn typename() -> &'static str {
29345 "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
29346 }
29347}
29348
29349/// Acquire SSRS lease context.
29350#[derive(Clone, Default, PartialEq)]
29351#[non_exhaustive]
29352pub struct AcquireSsrsLeaseContext {
29353 /// The username to be used as the setup login to connect to the database
29354 /// server for SSRS setup.
29355 pub setup_login: std::option::Option<std::string::String>,
29356
29357 /// The username to be used as the service login to connect to the report
29358 /// database for SSRS setup.
29359 pub service_login: std::option::Option<std::string::String>,
29360
29361 /// The report database to be used for SSRS setup.
29362 pub report_database: std::option::Option<std::string::String>,
29363
29364 /// Lease duration needed for SSRS setup.
29365 pub duration: std::option::Option<wkt::Duration>,
29366
29367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29368}
29369
29370impl AcquireSsrsLeaseContext {
29371 pub fn new() -> Self {
29372 std::default::Default::default()
29373 }
29374
29375 /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29376 ///
29377 /// # Example
29378 /// ```ignore,no_run
29379 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29380 /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
29381 /// ```
29382 pub fn set_setup_login<T>(mut self, v: T) -> Self
29383 where
29384 T: std::convert::Into<std::string::String>,
29385 {
29386 self.setup_login = std::option::Option::Some(v.into());
29387 self
29388 }
29389
29390 /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29391 ///
29392 /// # Example
29393 /// ```ignore,no_run
29394 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29395 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
29396 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
29397 /// ```
29398 pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
29399 where
29400 T: std::convert::Into<std::string::String>,
29401 {
29402 self.setup_login = v.map(|x| x.into());
29403 self
29404 }
29405
29406 /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29407 ///
29408 /// # Example
29409 /// ```ignore,no_run
29410 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29411 /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
29412 /// ```
29413 pub fn set_service_login<T>(mut self, v: T) -> Self
29414 where
29415 T: std::convert::Into<std::string::String>,
29416 {
29417 self.service_login = std::option::Option::Some(v.into());
29418 self
29419 }
29420
29421 /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29422 ///
29423 /// # Example
29424 /// ```ignore,no_run
29425 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29426 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
29427 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
29428 /// ```
29429 pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
29430 where
29431 T: std::convert::Into<std::string::String>,
29432 {
29433 self.service_login = v.map(|x| x.into());
29434 self
29435 }
29436
29437 /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29438 ///
29439 /// # Example
29440 /// ```ignore,no_run
29441 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29442 /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
29443 /// ```
29444 pub fn set_report_database<T>(mut self, v: T) -> Self
29445 where
29446 T: std::convert::Into<std::string::String>,
29447 {
29448 self.report_database = std::option::Option::Some(v.into());
29449 self
29450 }
29451
29452 /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29453 ///
29454 /// # Example
29455 /// ```ignore,no_run
29456 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29457 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
29458 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
29459 /// ```
29460 pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
29461 where
29462 T: std::convert::Into<std::string::String>,
29463 {
29464 self.report_database = v.map(|x| x.into());
29465 self
29466 }
29467
29468 /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29469 ///
29470 /// # Example
29471 /// ```ignore,no_run
29472 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29473 /// use wkt::Duration;
29474 /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
29475 /// ```
29476 pub fn set_duration<T>(mut self, v: T) -> Self
29477 where
29478 T: std::convert::Into<wkt::Duration>,
29479 {
29480 self.duration = std::option::Option::Some(v.into());
29481 self
29482 }
29483
29484 /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29485 ///
29486 /// # Example
29487 /// ```ignore,no_run
29488 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29489 /// use wkt::Duration;
29490 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
29491 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
29492 /// ```
29493 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
29494 where
29495 T: std::convert::Into<wkt::Duration>,
29496 {
29497 self.duration = v.map(|x| x.into());
29498 self
29499 }
29500}
29501
29502impl wkt::message::Message for AcquireSsrsLeaseContext {
29503 fn typename() -> &'static str {
29504 "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
29505 }
29506}
29507
29508/// DNS metadata.
29509#[derive(Clone, Default, PartialEq)]
29510#[non_exhaustive]
29511pub struct DnsNameMapping {
29512 /// Output only. The DNS name.
29513 pub name: std::string::String,
29514
29515 /// Output only. The connection type of the DNS name.
29516 pub connection_type: crate::model::dns_name_mapping::ConnectionType,
29517
29518 /// Output only. The scope that the DNS name applies to.
29519 pub dns_scope: crate::model::dns_name_mapping::DnsScope,
29520
29521 /// Output only. The manager for this DNS record.
29522 pub record_manager: crate::model::dns_name_mapping::RecordManager,
29523
29524 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29525}
29526
29527impl DnsNameMapping {
29528 pub fn new() -> Self {
29529 std::default::Default::default()
29530 }
29531
29532 /// Sets the value of [name][crate::model::DnsNameMapping::name].
29533 ///
29534 /// # Example
29535 /// ```ignore,no_run
29536 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29537 /// let x = DnsNameMapping::new().set_name("example");
29538 /// ```
29539 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29540 self.name = v.into();
29541 self
29542 }
29543
29544 /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
29545 ///
29546 /// # Example
29547 /// ```ignore,no_run
29548 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29549 /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
29550 /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
29551 /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
29552 /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
29553 /// ```
29554 pub fn set_connection_type<
29555 T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
29556 >(
29557 mut self,
29558 v: T,
29559 ) -> Self {
29560 self.connection_type = v.into();
29561 self
29562 }
29563
29564 /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
29565 ///
29566 /// # Example
29567 /// ```ignore,no_run
29568 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29569 /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
29570 /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
29571 /// let x1 = DnsNameMapping::new().set_dns_scope(DnsScope::Cluster);
29572 /// ```
29573 pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
29574 mut self,
29575 v: T,
29576 ) -> Self {
29577 self.dns_scope = v.into();
29578 self
29579 }
29580
29581 /// Sets the value of [record_manager][crate::model::DnsNameMapping::record_manager].
29582 ///
29583 /// # Example
29584 /// ```ignore,no_run
29585 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29586 /// use google_cloud_sql_v1::model::dns_name_mapping::RecordManager;
29587 /// let x0 = DnsNameMapping::new().set_record_manager(RecordManager::Customer);
29588 /// let x1 = DnsNameMapping::new().set_record_manager(RecordManager::CloudSqlAutomation);
29589 /// ```
29590 pub fn set_record_manager<
29591 T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
29592 >(
29593 mut self,
29594 v: T,
29595 ) -> Self {
29596 self.record_manager = v.into();
29597 self
29598 }
29599}
29600
29601impl wkt::message::Message for DnsNameMapping {
29602 fn typename() -> &'static str {
29603 "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
29604 }
29605}
29606
29607/// Defines additional types related to [DnsNameMapping].
29608pub mod dns_name_mapping {
29609 #[allow(unused_imports)]
29610 use super::*;
29611
29612 /// The connection type of the DNS name.
29613 /// This enum is not frozen, and new values may be added in the future.
29614 ///
29615 /// # Working with unknown values
29616 ///
29617 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29618 /// additional enum variants at any time. Adding new variants is not considered
29619 /// a breaking change. Applications should write their code in anticipation of:
29620 ///
29621 /// - New values appearing in future releases of the client library, **and**
29622 /// - New values received dynamically, without application changes.
29623 ///
29624 /// Please consult the [Working with enums] section in the user guide for some
29625 /// guidelines.
29626 ///
29627 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29628 #[derive(Clone, Debug, PartialEq)]
29629 #[non_exhaustive]
29630 pub enum ConnectionType {
29631 /// Unknown connection type.
29632 Unspecified,
29633 /// Public IP.
29634 Public,
29635 /// Private services access (private IP).
29636 PrivateServicesAccess,
29637 /// Private Service Connect.
29638 PrivateServiceConnect,
29639 /// If set, the enum was initialized with an unknown value.
29640 ///
29641 /// Applications can examine the value using [ConnectionType::value] or
29642 /// [ConnectionType::name].
29643 UnknownValue(connection_type::UnknownValue),
29644 }
29645
29646 #[doc(hidden)]
29647 pub mod connection_type {
29648 #[allow(unused_imports)]
29649 use super::*;
29650 #[derive(Clone, Debug, PartialEq)]
29651 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29652 }
29653
29654 impl ConnectionType {
29655 /// Gets the enum value.
29656 ///
29657 /// Returns `None` if the enum contains an unknown value deserialized from
29658 /// the string representation of enums.
29659 pub fn value(&self) -> std::option::Option<i32> {
29660 match self {
29661 Self::Unspecified => std::option::Option::Some(0),
29662 Self::Public => std::option::Option::Some(1),
29663 Self::PrivateServicesAccess => std::option::Option::Some(2),
29664 Self::PrivateServiceConnect => std::option::Option::Some(3),
29665 Self::UnknownValue(u) => u.0.value(),
29666 }
29667 }
29668
29669 /// Gets the enum value as a string.
29670 ///
29671 /// Returns `None` if the enum contains an unknown value deserialized from
29672 /// the integer representation of enums.
29673 pub fn name(&self) -> std::option::Option<&str> {
29674 match self {
29675 Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
29676 Self::Public => std::option::Option::Some("PUBLIC"),
29677 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
29678 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
29679 Self::UnknownValue(u) => u.0.name(),
29680 }
29681 }
29682 }
29683
29684 impl std::default::Default for ConnectionType {
29685 fn default() -> Self {
29686 use std::convert::From;
29687 Self::from(0)
29688 }
29689 }
29690
29691 impl std::fmt::Display for ConnectionType {
29692 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29693 wkt::internal::display_enum(f, self.name(), self.value())
29694 }
29695 }
29696
29697 impl std::convert::From<i32> for ConnectionType {
29698 fn from(value: i32) -> Self {
29699 match value {
29700 0 => Self::Unspecified,
29701 1 => Self::Public,
29702 2 => Self::PrivateServicesAccess,
29703 3 => Self::PrivateServiceConnect,
29704 _ => Self::UnknownValue(connection_type::UnknownValue(
29705 wkt::internal::UnknownEnumValue::Integer(value),
29706 )),
29707 }
29708 }
29709 }
29710
29711 impl std::convert::From<&str> for ConnectionType {
29712 fn from(value: &str) -> Self {
29713 use std::string::ToString;
29714 match value {
29715 "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
29716 "PUBLIC" => Self::Public,
29717 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
29718 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
29719 _ => Self::UnknownValue(connection_type::UnknownValue(
29720 wkt::internal::UnknownEnumValue::String(value.to_string()),
29721 )),
29722 }
29723 }
29724 }
29725
29726 impl serde::ser::Serialize for ConnectionType {
29727 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29728 where
29729 S: serde::Serializer,
29730 {
29731 match self {
29732 Self::Unspecified => serializer.serialize_i32(0),
29733 Self::Public => serializer.serialize_i32(1),
29734 Self::PrivateServicesAccess => serializer.serialize_i32(2),
29735 Self::PrivateServiceConnect => serializer.serialize_i32(3),
29736 Self::UnknownValue(u) => u.0.serialize(serializer),
29737 }
29738 }
29739 }
29740
29741 impl<'de> serde::de::Deserialize<'de> for ConnectionType {
29742 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29743 where
29744 D: serde::Deserializer<'de>,
29745 {
29746 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
29747 ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
29748 ))
29749 }
29750 }
29751
29752 /// The scope that the DNS name applies to.
29753 ///
29754 /// # Working with unknown values
29755 ///
29756 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29757 /// additional enum variants at any time. Adding new variants is not considered
29758 /// a breaking change. Applications should write their code in anticipation of:
29759 ///
29760 /// - New values appearing in future releases of the client library, **and**
29761 /// - New values received dynamically, without application changes.
29762 ///
29763 /// Please consult the [Working with enums] section in the user guide for some
29764 /// guidelines.
29765 ///
29766 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29767 #[derive(Clone, Debug, PartialEq)]
29768 #[non_exhaustive]
29769 pub enum DnsScope {
29770 /// DNS scope not set. This value should not be used.
29771 Unspecified,
29772 /// Indicates an instance-level DNS name.
29773 Instance,
29774 /// Indicates a cluster-level DNS name.
29775 Cluster,
29776 /// If set, the enum was initialized with an unknown value.
29777 ///
29778 /// Applications can examine the value using [DnsScope::value] or
29779 /// [DnsScope::name].
29780 UnknownValue(dns_scope::UnknownValue),
29781 }
29782
29783 #[doc(hidden)]
29784 pub mod dns_scope {
29785 #[allow(unused_imports)]
29786 use super::*;
29787 #[derive(Clone, Debug, PartialEq)]
29788 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29789 }
29790
29791 impl DnsScope {
29792 /// Gets the enum value.
29793 ///
29794 /// Returns `None` if the enum contains an unknown value deserialized from
29795 /// the string representation of enums.
29796 pub fn value(&self) -> std::option::Option<i32> {
29797 match self {
29798 Self::Unspecified => std::option::Option::Some(0),
29799 Self::Instance => std::option::Option::Some(1),
29800 Self::Cluster => std::option::Option::Some(2),
29801 Self::UnknownValue(u) => u.0.value(),
29802 }
29803 }
29804
29805 /// Gets the enum value as a string.
29806 ///
29807 /// Returns `None` if the enum contains an unknown value deserialized from
29808 /// the integer representation of enums.
29809 pub fn name(&self) -> std::option::Option<&str> {
29810 match self {
29811 Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
29812 Self::Instance => std::option::Option::Some("INSTANCE"),
29813 Self::Cluster => std::option::Option::Some("CLUSTER"),
29814 Self::UnknownValue(u) => u.0.name(),
29815 }
29816 }
29817 }
29818
29819 impl std::default::Default for DnsScope {
29820 fn default() -> Self {
29821 use std::convert::From;
29822 Self::from(0)
29823 }
29824 }
29825
29826 impl std::fmt::Display for DnsScope {
29827 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29828 wkt::internal::display_enum(f, self.name(), self.value())
29829 }
29830 }
29831
29832 impl std::convert::From<i32> for DnsScope {
29833 fn from(value: i32) -> Self {
29834 match value {
29835 0 => Self::Unspecified,
29836 1 => Self::Instance,
29837 2 => Self::Cluster,
29838 _ => Self::UnknownValue(dns_scope::UnknownValue(
29839 wkt::internal::UnknownEnumValue::Integer(value),
29840 )),
29841 }
29842 }
29843 }
29844
29845 impl std::convert::From<&str> for DnsScope {
29846 fn from(value: &str) -> Self {
29847 use std::string::ToString;
29848 match value {
29849 "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
29850 "INSTANCE" => Self::Instance,
29851 "CLUSTER" => Self::Cluster,
29852 _ => Self::UnknownValue(dns_scope::UnknownValue(
29853 wkt::internal::UnknownEnumValue::String(value.to_string()),
29854 )),
29855 }
29856 }
29857 }
29858
29859 impl serde::ser::Serialize for DnsScope {
29860 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29861 where
29862 S: serde::Serializer,
29863 {
29864 match self {
29865 Self::Unspecified => serializer.serialize_i32(0),
29866 Self::Instance => serializer.serialize_i32(1),
29867 Self::Cluster => serializer.serialize_i32(2),
29868 Self::UnknownValue(u) => u.0.serialize(serializer),
29869 }
29870 }
29871 }
29872
29873 impl<'de> serde::de::Deserialize<'de> for DnsScope {
29874 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29875 where
29876 D: serde::Deserializer<'de>,
29877 {
29878 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
29879 ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
29880 ))
29881 }
29882 }
29883
29884 /// The system responsible for managing the DNS record.
29885 ///
29886 /// # Working with unknown values
29887 ///
29888 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29889 /// additional enum variants at any time. Adding new variants is not considered
29890 /// a breaking change. Applications should write their code in anticipation of:
29891 ///
29892 /// - New values appearing in future releases of the client library, **and**
29893 /// - New values received dynamically, without application changes.
29894 ///
29895 /// Please consult the [Working with enums] section in the user guide for some
29896 /// guidelines.
29897 ///
29898 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
29899 #[derive(Clone, Debug, PartialEq)]
29900 #[non_exhaustive]
29901 pub enum RecordManager {
29902 /// Record manager not set. This value should not be used.
29903 Unspecified,
29904 /// The record may be managed by the customer. It is not automatically
29905 /// managed by Cloud SQL automation.
29906 Customer,
29907 /// The record is managed by Cloud SQL, which will create, update,
29908 /// and delete the DNS records for the zone automatically when
29909 /// the Cloud SQL database instance is created or updated.
29910 CloudSqlAutomation,
29911 /// If set, the enum was initialized with an unknown value.
29912 ///
29913 /// Applications can examine the value using [RecordManager::value] or
29914 /// [RecordManager::name].
29915 UnknownValue(record_manager::UnknownValue),
29916 }
29917
29918 #[doc(hidden)]
29919 pub mod record_manager {
29920 #[allow(unused_imports)]
29921 use super::*;
29922 #[derive(Clone, Debug, PartialEq)]
29923 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29924 }
29925
29926 impl RecordManager {
29927 /// Gets the enum value.
29928 ///
29929 /// Returns `None` if the enum contains an unknown value deserialized from
29930 /// the string representation of enums.
29931 pub fn value(&self) -> std::option::Option<i32> {
29932 match self {
29933 Self::Unspecified => std::option::Option::Some(0),
29934 Self::Customer => std::option::Option::Some(1),
29935 Self::CloudSqlAutomation => std::option::Option::Some(2),
29936 Self::UnknownValue(u) => u.0.value(),
29937 }
29938 }
29939
29940 /// Gets the enum value as a string.
29941 ///
29942 /// Returns `None` if the enum contains an unknown value deserialized from
29943 /// the integer representation of enums.
29944 pub fn name(&self) -> std::option::Option<&str> {
29945 match self {
29946 Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
29947 Self::Customer => std::option::Option::Some("CUSTOMER"),
29948 Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
29949 Self::UnknownValue(u) => u.0.name(),
29950 }
29951 }
29952 }
29953
29954 impl std::default::Default for RecordManager {
29955 fn default() -> Self {
29956 use std::convert::From;
29957 Self::from(0)
29958 }
29959 }
29960
29961 impl std::fmt::Display for RecordManager {
29962 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29963 wkt::internal::display_enum(f, self.name(), self.value())
29964 }
29965 }
29966
29967 impl std::convert::From<i32> for RecordManager {
29968 fn from(value: i32) -> Self {
29969 match value {
29970 0 => Self::Unspecified,
29971 1 => Self::Customer,
29972 2 => Self::CloudSqlAutomation,
29973 _ => Self::UnknownValue(record_manager::UnknownValue(
29974 wkt::internal::UnknownEnumValue::Integer(value),
29975 )),
29976 }
29977 }
29978 }
29979
29980 impl std::convert::From<&str> for RecordManager {
29981 fn from(value: &str) -> Self {
29982 use std::string::ToString;
29983 match value {
29984 "RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
29985 "CUSTOMER" => Self::Customer,
29986 "CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
29987 _ => Self::UnknownValue(record_manager::UnknownValue(
29988 wkt::internal::UnknownEnumValue::String(value.to_string()),
29989 )),
29990 }
29991 }
29992 }
29993
29994 impl serde::ser::Serialize for RecordManager {
29995 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29996 where
29997 S: serde::Serializer,
29998 {
29999 match self {
30000 Self::Unspecified => serializer.serialize_i32(0),
30001 Self::Customer => serializer.serialize_i32(1),
30002 Self::CloudSqlAutomation => serializer.serialize_i32(2),
30003 Self::UnknownValue(u) => u.0.serialize(serializer),
30004 }
30005 }
30006 }
30007
30008 impl<'de> serde::de::Deserialize<'de> for RecordManager {
30009 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30010 where
30011 D: serde::Deserializer<'de>,
30012 {
30013 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
30014 ".google.cloud.sql.v1.DnsNameMapping.RecordManager",
30015 ))
30016 }
30017 }
30018}
30019
30020#[derive(Clone, Default, PartialEq)]
30021#[non_exhaustive]
30022pub struct SqlSslCertsDeleteRequest {
30023 /// Cloud SQL instance ID. This does not include the project ID.
30024 pub instance: std::string::String,
30025
30026 /// Project ID of the project that contains the instance.
30027 pub project: std::string::String,
30028
30029 /// Sha1 FingerPrint.
30030 pub sha1_fingerprint: std::string::String,
30031
30032 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30033}
30034
30035impl SqlSslCertsDeleteRequest {
30036 pub fn new() -> Self {
30037 std::default::Default::default()
30038 }
30039
30040 /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
30041 ///
30042 /// # Example
30043 /// ```ignore,no_run
30044 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30045 /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
30046 /// ```
30047 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30048 self.instance = v.into();
30049 self
30050 }
30051
30052 /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
30053 ///
30054 /// # Example
30055 /// ```ignore,no_run
30056 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30057 /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
30058 /// ```
30059 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30060 self.project = v.into();
30061 self
30062 }
30063
30064 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
30065 ///
30066 /// # Example
30067 /// ```ignore,no_run
30068 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30069 /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
30070 /// ```
30071 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30072 mut self,
30073 v: T,
30074 ) -> Self {
30075 self.sha1_fingerprint = v.into();
30076 self
30077 }
30078}
30079
30080impl wkt::message::Message for SqlSslCertsDeleteRequest {
30081 fn typename() -> &'static str {
30082 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
30083 }
30084}
30085
30086#[derive(Clone, Default, PartialEq)]
30087#[non_exhaustive]
30088pub struct SqlSslCertsGetRequest {
30089 /// Cloud SQL instance ID. This does not include the project ID.
30090 pub instance: std::string::String,
30091
30092 /// Project ID of the project that contains the instance.
30093 pub project: std::string::String,
30094
30095 /// Sha1 FingerPrint.
30096 pub sha1_fingerprint: std::string::String,
30097
30098 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30099}
30100
30101impl SqlSslCertsGetRequest {
30102 pub fn new() -> Self {
30103 std::default::Default::default()
30104 }
30105
30106 /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
30107 ///
30108 /// # Example
30109 /// ```ignore,no_run
30110 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30111 /// let x = SqlSslCertsGetRequest::new().set_instance("example");
30112 /// ```
30113 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30114 self.instance = v.into();
30115 self
30116 }
30117
30118 /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
30119 ///
30120 /// # Example
30121 /// ```ignore,no_run
30122 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30123 /// let x = SqlSslCertsGetRequest::new().set_project("example");
30124 /// ```
30125 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30126 self.project = v.into();
30127 self
30128 }
30129
30130 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
30131 ///
30132 /// # Example
30133 /// ```ignore,no_run
30134 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30135 /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
30136 /// ```
30137 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30138 mut self,
30139 v: T,
30140 ) -> Self {
30141 self.sha1_fingerprint = v.into();
30142 self
30143 }
30144}
30145
30146impl wkt::message::Message for SqlSslCertsGetRequest {
30147 fn typename() -> &'static str {
30148 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
30149 }
30150}
30151
30152#[derive(Clone, Default, PartialEq)]
30153#[non_exhaustive]
30154pub struct SqlSslCertsInsertRequest {
30155 /// Cloud SQL instance ID. This does not include the project ID.
30156 pub instance: std::string::String,
30157
30158 /// Project ID of the project that contains the instance.
30159 pub project: std::string::String,
30160
30161 pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
30162
30163 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30164}
30165
30166impl SqlSslCertsInsertRequest {
30167 pub fn new() -> Self {
30168 std::default::Default::default()
30169 }
30170
30171 /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
30172 ///
30173 /// # Example
30174 /// ```ignore,no_run
30175 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30176 /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
30177 /// ```
30178 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30179 self.instance = v.into();
30180 self
30181 }
30182
30183 /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
30184 ///
30185 /// # Example
30186 /// ```ignore,no_run
30187 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30188 /// let x = SqlSslCertsInsertRequest::new().set_project("example");
30189 /// ```
30190 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30191 self.project = v.into();
30192 self
30193 }
30194
30195 /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30196 ///
30197 /// # Example
30198 /// ```ignore,no_run
30199 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30200 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30201 /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
30202 /// ```
30203 pub fn set_body<T>(mut self, v: T) -> Self
30204 where
30205 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30206 {
30207 self.body = std::option::Option::Some(v.into());
30208 self
30209 }
30210
30211 /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30212 ///
30213 /// # Example
30214 /// ```ignore,no_run
30215 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30216 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30217 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
30218 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
30219 /// ```
30220 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30221 where
30222 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30223 {
30224 self.body = v.map(|x| x.into());
30225 self
30226 }
30227}
30228
30229impl wkt::message::Message for SqlSslCertsInsertRequest {
30230 fn typename() -> &'static str {
30231 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
30232 }
30233}
30234
30235#[derive(Clone, Default, PartialEq)]
30236#[non_exhaustive]
30237pub struct SqlSslCertsListRequest {
30238 /// Cloud SQL instance ID. This does not include the project ID.
30239 pub instance: std::string::String,
30240
30241 /// Project ID of the project that contains the instance.
30242 pub project: std::string::String,
30243
30244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30245}
30246
30247impl SqlSslCertsListRequest {
30248 pub fn new() -> Self {
30249 std::default::Default::default()
30250 }
30251
30252 /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
30253 ///
30254 /// # Example
30255 /// ```ignore,no_run
30256 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30257 /// let x = SqlSslCertsListRequest::new().set_instance("example");
30258 /// ```
30259 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30260 self.instance = v.into();
30261 self
30262 }
30263
30264 /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
30265 ///
30266 /// # Example
30267 /// ```ignore,no_run
30268 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30269 /// let x = SqlSslCertsListRequest::new().set_project("example");
30270 /// ```
30271 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30272 self.project = v.into();
30273 self
30274 }
30275}
30276
30277impl wkt::message::Message for SqlSslCertsListRequest {
30278 fn typename() -> &'static str {
30279 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
30280 }
30281}
30282
30283/// SslCerts insert request.
30284#[derive(Clone, Default, PartialEq)]
30285#[non_exhaustive]
30286pub struct SslCertsInsertRequest {
30287 /// User supplied name. Must be a distinct name from the other certificates
30288 /// for this instance.
30289 pub common_name: std::string::String,
30290
30291 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30292}
30293
30294impl SslCertsInsertRequest {
30295 pub fn new() -> Self {
30296 std::default::Default::default()
30297 }
30298
30299 /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
30300 ///
30301 /// # Example
30302 /// ```ignore,no_run
30303 /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
30304 /// let x = SslCertsInsertRequest::new().set_common_name("example");
30305 /// ```
30306 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30307 self.common_name = v.into();
30308 self
30309 }
30310}
30311
30312impl wkt::message::Message for SslCertsInsertRequest {
30313 fn typename() -> &'static str {
30314 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
30315 }
30316}
30317
30318/// SslCert insert response.
30319#[derive(Clone, Default, PartialEq)]
30320#[non_exhaustive]
30321pub struct SslCertsInsertResponse {
30322 /// This is always `sql#sslCertsInsert`.
30323 pub kind: std::string::String,
30324
30325 /// The operation to track the ssl certs insert request.
30326 pub operation: std::option::Option<crate::model::Operation>,
30327
30328 /// The server Certificate Authority's certificate. If this is missing you can
30329 /// force a new one to be generated by calling resetSslConfig method on
30330 /// instances resource.
30331 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
30332
30333 /// The new client certificate and private key.
30334 pub client_cert: std::option::Option<crate::model::SslCertDetail>,
30335
30336 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30337}
30338
30339impl SslCertsInsertResponse {
30340 pub fn new() -> Self {
30341 std::default::Default::default()
30342 }
30343
30344 /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
30345 ///
30346 /// # Example
30347 /// ```ignore,no_run
30348 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30349 /// let x = SslCertsInsertResponse::new().set_kind("example");
30350 /// ```
30351 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30352 self.kind = v.into();
30353 self
30354 }
30355
30356 /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
30357 ///
30358 /// # Example
30359 /// ```ignore,no_run
30360 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30361 /// use google_cloud_sql_v1::model::Operation;
30362 /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
30363 /// ```
30364 pub fn set_operation<T>(mut self, v: T) -> Self
30365 where
30366 T: std::convert::Into<crate::model::Operation>,
30367 {
30368 self.operation = std::option::Option::Some(v.into());
30369 self
30370 }
30371
30372 /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
30373 ///
30374 /// # Example
30375 /// ```ignore,no_run
30376 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30377 /// use google_cloud_sql_v1::model::Operation;
30378 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
30379 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
30380 /// ```
30381 pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
30382 where
30383 T: std::convert::Into<crate::model::Operation>,
30384 {
30385 self.operation = v.map(|x| x.into());
30386 self
30387 }
30388
30389 /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30390 ///
30391 /// # Example
30392 /// ```ignore,no_run
30393 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30394 /// use google_cloud_sql_v1::model::SslCert;
30395 /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
30396 /// ```
30397 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
30398 where
30399 T: std::convert::Into<crate::model::SslCert>,
30400 {
30401 self.server_ca_cert = std::option::Option::Some(v.into());
30402 self
30403 }
30404
30405 /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30406 ///
30407 /// # Example
30408 /// ```ignore,no_run
30409 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30410 /// use google_cloud_sql_v1::model::SslCert;
30411 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
30412 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
30413 /// ```
30414 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
30415 where
30416 T: std::convert::Into<crate::model::SslCert>,
30417 {
30418 self.server_ca_cert = v.map(|x| x.into());
30419 self
30420 }
30421
30422 /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30423 ///
30424 /// # Example
30425 /// ```ignore,no_run
30426 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30427 /// use google_cloud_sql_v1::model::SslCertDetail;
30428 /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
30429 /// ```
30430 pub fn set_client_cert<T>(mut self, v: T) -> Self
30431 where
30432 T: std::convert::Into<crate::model::SslCertDetail>,
30433 {
30434 self.client_cert = std::option::Option::Some(v.into());
30435 self
30436 }
30437
30438 /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30439 ///
30440 /// # Example
30441 /// ```ignore,no_run
30442 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30443 /// use google_cloud_sql_v1::model::SslCertDetail;
30444 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
30445 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
30446 /// ```
30447 pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
30448 where
30449 T: std::convert::Into<crate::model::SslCertDetail>,
30450 {
30451 self.client_cert = v.map(|x| x.into());
30452 self
30453 }
30454}
30455
30456impl wkt::message::Message for SslCertsInsertResponse {
30457 fn typename() -> &'static str {
30458 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
30459 }
30460}
30461
30462/// SslCerts list response.
30463#[derive(Clone, Default, PartialEq)]
30464#[non_exhaustive]
30465pub struct SslCertsListResponse {
30466 /// This is always `sql#sslCertsList`.
30467 pub kind: std::string::String,
30468
30469 /// List of client certificates for the instance.
30470 pub items: std::vec::Vec<crate::model::SslCert>,
30471
30472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30473}
30474
30475impl SslCertsListResponse {
30476 pub fn new() -> Self {
30477 std::default::Default::default()
30478 }
30479
30480 /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
30481 ///
30482 /// # Example
30483 /// ```ignore,no_run
30484 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30485 /// let x = SslCertsListResponse::new().set_kind("example");
30486 /// ```
30487 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30488 self.kind = v.into();
30489 self
30490 }
30491
30492 /// Sets the value of [items][crate::model::SslCertsListResponse::items].
30493 ///
30494 /// # Example
30495 /// ```ignore,no_run
30496 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30497 /// use google_cloud_sql_v1::model::SslCert;
30498 /// let x = SslCertsListResponse::new()
30499 /// .set_items([
30500 /// SslCert::default()/* use setters */,
30501 /// SslCert::default()/* use (different) setters */,
30502 /// ]);
30503 /// ```
30504 pub fn set_items<T, V>(mut self, v: T) -> Self
30505 where
30506 T: std::iter::IntoIterator<Item = V>,
30507 V: std::convert::Into<crate::model::SslCert>,
30508 {
30509 use std::iter::Iterator;
30510 self.items = v.into_iter().map(|i| i.into()).collect();
30511 self
30512 }
30513}
30514
30515impl wkt::message::Message for SslCertsListResponse {
30516 fn typename() -> &'static str {
30517 "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
30518 }
30519}
30520
30521/// Tiers list request.
30522#[derive(Clone, Default, PartialEq)]
30523#[non_exhaustive]
30524pub struct SqlTiersListRequest {
30525 /// Project ID of the project for which to list tiers.
30526 pub project: std::string::String,
30527
30528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30529}
30530
30531impl SqlTiersListRequest {
30532 pub fn new() -> Self {
30533 std::default::Default::default()
30534 }
30535
30536 /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
30537 ///
30538 /// # Example
30539 /// ```ignore,no_run
30540 /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
30541 /// let x = SqlTiersListRequest::new().set_project("example");
30542 /// ```
30543 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30544 self.project = v.into();
30545 self
30546 }
30547}
30548
30549impl wkt::message::Message for SqlTiersListRequest {
30550 fn typename() -> &'static str {
30551 "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
30552 }
30553}
30554
30555/// Tiers list response.
30556#[derive(Clone, Default, PartialEq)]
30557#[non_exhaustive]
30558pub struct TiersListResponse {
30559 /// This is always `sql#tiersList`.
30560 pub kind: std::string::String,
30561
30562 /// List of tiers.
30563 pub items: std::vec::Vec<crate::model::Tier>,
30564
30565 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30566}
30567
30568impl TiersListResponse {
30569 pub fn new() -> Self {
30570 std::default::Default::default()
30571 }
30572
30573 /// Sets the value of [kind][crate::model::TiersListResponse::kind].
30574 ///
30575 /// # Example
30576 /// ```ignore,no_run
30577 /// # use google_cloud_sql_v1::model::TiersListResponse;
30578 /// let x = TiersListResponse::new().set_kind("example");
30579 /// ```
30580 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30581 self.kind = v.into();
30582 self
30583 }
30584
30585 /// Sets the value of [items][crate::model::TiersListResponse::items].
30586 ///
30587 /// # Example
30588 /// ```ignore,no_run
30589 /// # use google_cloud_sql_v1::model::TiersListResponse;
30590 /// use google_cloud_sql_v1::model::Tier;
30591 /// let x = TiersListResponse::new()
30592 /// .set_items([
30593 /// Tier::default()/* use setters */,
30594 /// Tier::default()/* use (different) setters */,
30595 /// ]);
30596 /// ```
30597 pub fn set_items<T, V>(mut self, v: T) -> Self
30598 where
30599 T: std::iter::IntoIterator<Item = V>,
30600 V: std::convert::Into<crate::model::Tier>,
30601 {
30602 use std::iter::Iterator;
30603 self.items = v.into_iter().map(|i| i.into()).collect();
30604 self
30605 }
30606}
30607
30608impl wkt::message::Message for TiersListResponse {
30609 fn typename() -> &'static str {
30610 "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
30611 }
30612}
30613
30614/// A Google Cloud SQL service tier resource.
30615#[derive(Clone, Default, PartialEq)]
30616#[non_exhaustive]
30617pub struct Tier {
30618 /// An identifier for the machine type, for example, `db-custom-1-3840`. For
30619 /// related information, see [Pricing](/sql/pricing).
30620 pub tier: std::string::String,
30621
30622 /// The maximum RAM usage of this tier in bytes.
30623 pub ram: i64,
30624
30625 /// This is always `sql#tier`.
30626 pub kind: std::string::String,
30627
30628 /// The maximum disk size of this tier in bytes.
30629 pub disk_quota: i64,
30630
30631 /// The applicable regions for this tier.
30632 pub region: std::vec::Vec<std::string::String>,
30633
30634 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30635}
30636
30637impl Tier {
30638 pub fn new() -> Self {
30639 std::default::Default::default()
30640 }
30641
30642 /// Sets the value of [tier][crate::model::Tier::tier].
30643 ///
30644 /// # Example
30645 /// ```ignore,no_run
30646 /// # use google_cloud_sql_v1::model::Tier;
30647 /// let x = Tier::new().set_tier("example");
30648 /// ```
30649 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30650 self.tier = v.into();
30651 self
30652 }
30653
30654 /// Sets the value of [ram][crate::model::Tier::ram].
30655 ///
30656 /// # Example
30657 /// ```ignore,no_run
30658 /// # use google_cloud_sql_v1::model::Tier;
30659 /// let x = Tier::new().set_ram(42);
30660 /// ```
30661 pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30662 self.ram = v.into();
30663 self
30664 }
30665
30666 /// Sets the value of [kind][crate::model::Tier::kind].
30667 ///
30668 /// # Example
30669 /// ```ignore,no_run
30670 /// # use google_cloud_sql_v1::model::Tier;
30671 /// let x = Tier::new().set_kind("example");
30672 /// ```
30673 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30674 self.kind = v.into();
30675 self
30676 }
30677
30678 /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
30679 ///
30680 /// # Example
30681 /// ```ignore,no_run
30682 /// # use google_cloud_sql_v1::model::Tier;
30683 /// let x = Tier::new().set_disk_quota(42);
30684 /// ```
30685 pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30686 self.disk_quota = v.into();
30687 self
30688 }
30689
30690 /// Sets the value of [region][crate::model::Tier::region].
30691 ///
30692 /// # Example
30693 /// ```ignore,no_run
30694 /// # use google_cloud_sql_v1::model::Tier;
30695 /// let x = Tier::new().set_region(["a", "b", "c"]);
30696 /// ```
30697 pub fn set_region<T, V>(mut self, v: T) -> Self
30698 where
30699 T: std::iter::IntoIterator<Item = V>,
30700 V: std::convert::Into<std::string::String>,
30701 {
30702 use std::iter::Iterator;
30703 self.region = v.into_iter().map(|i| i.into()).collect();
30704 self
30705 }
30706}
30707
30708impl wkt::message::Message for Tier {
30709 fn typename() -> &'static str {
30710 "type.googleapis.com/google.cloud.sql.v1.Tier"
30711 }
30712}
30713
30714#[derive(Clone, Default, PartialEq)]
30715#[non_exhaustive]
30716pub struct SqlUsersDeleteRequest {
30717 /// Host of the user in the instance.
30718 pub host: std::string::String,
30719
30720 /// Database instance ID. This does not include the project ID.
30721 pub instance: std::string::String,
30722
30723 /// Name of the user in the instance.
30724 pub name: std::string::String,
30725
30726 /// Project ID of the project that contains the instance.
30727 pub project: std::string::String,
30728
30729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30730}
30731
30732impl SqlUsersDeleteRequest {
30733 pub fn new() -> Self {
30734 std::default::Default::default()
30735 }
30736
30737 /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
30738 ///
30739 /// # Example
30740 /// ```ignore,no_run
30741 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30742 /// let x = SqlUsersDeleteRequest::new().set_host("example");
30743 /// ```
30744 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30745 self.host = v.into();
30746 self
30747 }
30748
30749 /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
30750 ///
30751 /// # Example
30752 /// ```ignore,no_run
30753 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30754 /// let x = SqlUsersDeleteRequest::new().set_instance("example");
30755 /// ```
30756 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30757 self.instance = v.into();
30758 self
30759 }
30760
30761 /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
30762 ///
30763 /// # Example
30764 /// ```ignore,no_run
30765 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30766 /// let x = SqlUsersDeleteRequest::new().set_name("example");
30767 /// ```
30768 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30769 self.name = v.into();
30770 self
30771 }
30772
30773 /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
30774 ///
30775 /// # Example
30776 /// ```ignore,no_run
30777 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30778 /// let x = SqlUsersDeleteRequest::new().set_project("example");
30779 /// ```
30780 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30781 self.project = v.into();
30782 self
30783 }
30784}
30785
30786impl wkt::message::Message for SqlUsersDeleteRequest {
30787 fn typename() -> &'static str {
30788 "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
30789 }
30790}
30791
30792/// Request message for Users Get RPC
30793#[derive(Clone, Default, PartialEq)]
30794#[non_exhaustive]
30795pub struct SqlUsersGetRequest {
30796 /// Database instance ID. This does not include the project ID.
30797 pub instance: std::string::String,
30798
30799 /// User of the instance.
30800 pub name: std::string::String,
30801
30802 /// Project ID of the project that contains the instance.
30803 pub project: std::string::String,
30804
30805 /// Host of a user of the instance.
30806 pub host: std::string::String,
30807
30808 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30809}
30810
30811impl SqlUsersGetRequest {
30812 pub fn new() -> Self {
30813 std::default::Default::default()
30814 }
30815
30816 /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
30817 ///
30818 /// # Example
30819 /// ```ignore,no_run
30820 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30821 /// let x = SqlUsersGetRequest::new().set_instance("example");
30822 /// ```
30823 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30824 self.instance = v.into();
30825 self
30826 }
30827
30828 /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
30829 ///
30830 /// # Example
30831 /// ```ignore,no_run
30832 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30833 /// let x = SqlUsersGetRequest::new().set_name("example");
30834 /// ```
30835 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30836 self.name = v.into();
30837 self
30838 }
30839
30840 /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
30841 ///
30842 /// # Example
30843 /// ```ignore,no_run
30844 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30845 /// let x = SqlUsersGetRequest::new().set_project("example");
30846 /// ```
30847 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30848 self.project = v.into();
30849 self
30850 }
30851
30852 /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
30853 ///
30854 /// # Example
30855 /// ```ignore,no_run
30856 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30857 /// let x = SqlUsersGetRequest::new().set_host("example");
30858 /// ```
30859 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30860 self.host = v.into();
30861 self
30862 }
30863}
30864
30865impl wkt::message::Message for SqlUsersGetRequest {
30866 fn typename() -> &'static str {
30867 "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
30868 }
30869}
30870
30871#[derive(Clone, Default, PartialEq)]
30872#[non_exhaustive]
30873pub struct SqlUsersInsertRequest {
30874 /// Database instance ID. This does not include the project ID.
30875 pub instance: std::string::String,
30876
30877 /// Project ID of the project that contains the instance.
30878 pub project: std::string::String,
30879
30880 pub body: std::option::Option<crate::model::User>,
30881
30882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30883}
30884
30885impl SqlUsersInsertRequest {
30886 pub fn new() -> Self {
30887 std::default::Default::default()
30888 }
30889
30890 /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
30891 ///
30892 /// # Example
30893 /// ```ignore,no_run
30894 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30895 /// let x = SqlUsersInsertRequest::new().set_instance("example");
30896 /// ```
30897 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30898 self.instance = v.into();
30899 self
30900 }
30901
30902 /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
30903 ///
30904 /// # Example
30905 /// ```ignore,no_run
30906 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30907 /// let x = SqlUsersInsertRequest::new().set_project("example");
30908 /// ```
30909 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30910 self.project = v.into();
30911 self
30912 }
30913
30914 /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
30915 ///
30916 /// # Example
30917 /// ```ignore,no_run
30918 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30919 /// use google_cloud_sql_v1::model::User;
30920 /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
30921 /// ```
30922 pub fn set_body<T>(mut self, v: T) -> Self
30923 where
30924 T: std::convert::Into<crate::model::User>,
30925 {
30926 self.body = std::option::Option::Some(v.into());
30927 self
30928 }
30929
30930 /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
30931 ///
30932 /// # Example
30933 /// ```ignore,no_run
30934 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30935 /// use google_cloud_sql_v1::model::User;
30936 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
30937 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
30938 /// ```
30939 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30940 where
30941 T: std::convert::Into<crate::model::User>,
30942 {
30943 self.body = v.map(|x| x.into());
30944 self
30945 }
30946}
30947
30948impl wkt::message::Message for SqlUsersInsertRequest {
30949 fn typename() -> &'static str {
30950 "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
30951 }
30952}
30953
30954#[derive(Clone, Default, PartialEq)]
30955#[non_exhaustive]
30956pub struct SqlUsersListRequest {
30957 /// Database instance ID. This does not include the project ID.
30958 pub instance: std::string::String,
30959
30960 /// Project ID of the project that contains the instance.
30961 pub project: std::string::String,
30962
30963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30964}
30965
30966impl SqlUsersListRequest {
30967 pub fn new() -> Self {
30968 std::default::Default::default()
30969 }
30970
30971 /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
30972 ///
30973 /// # Example
30974 /// ```ignore,no_run
30975 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
30976 /// let x = SqlUsersListRequest::new().set_instance("example");
30977 /// ```
30978 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30979 self.instance = v.into();
30980 self
30981 }
30982
30983 /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
30984 ///
30985 /// # Example
30986 /// ```ignore,no_run
30987 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
30988 /// let x = SqlUsersListRequest::new().set_project("example");
30989 /// ```
30990 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30991 self.project = v.into();
30992 self
30993 }
30994}
30995
30996impl wkt::message::Message for SqlUsersListRequest {
30997 fn typename() -> &'static str {
30998 "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
30999 }
31000}
31001
31002#[derive(Clone, Default, PartialEq)]
31003#[non_exhaustive]
31004pub struct SqlUsersUpdateRequest {
31005 /// Optional. Host of the user in the instance.
31006 pub host: std::string::String,
31007
31008 /// Database instance ID. This does not include the project ID.
31009 pub instance: std::string::String,
31010
31011 /// Name of the user in the instance.
31012 pub name: std::string::String,
31013
31014 /// Project ID of the project that contains the instance.
31015 pub project: std::string::String,
31016
31017 /// Optional. List of database roles to grant to the user. body.database_roles
31018 /// will be ignored for update request.
31019 pub database_roles: std::vec::Vec<std::string::String>,
31020
31021 /// Optional. Specifies whether to revoke existing roles that are not present
31022 /// in the `database_roles` field. If `false` or unset, the database roles
31023 /// specified in `database_roles` are added to the user's existing roles.
31024 pub revoke_existing_roles: std::option::Option<bool>,
31025
31026 pub body: std::option::Option<crate::model::User>,
31027
31028 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31029}
31030
31031impl SqlUsersUpdateRequest {
31032 pub fn new() -> Self {
31033 std::default::Default::default()
31034 }
31035
31036 /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
31037 ///
31038 /// # Example
31039 /// ```ignore,no_run
31040 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31041 /// let x = SqlUsersUpdateRequest::new().set_host("example");
31042 /// ```
31043 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31044 self.host = v.into();
31045 self
31046 }
31047
31048 /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
31049 ///
31050 /// # Example
31051 /// ```ignore,no_run
31052 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31053 /// let x = SqlUsersUpdateRequest::new().set_instance("example");
31054 /// ```
31055 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31056 self.instance = v.into();
31057 self
31058 }
31059
31060 /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
31061 ///
31062 /// # Example
31063 /// ```ignore,no_run
31064 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31065 /// let x = SqlUsersUpdateRequest::new().set_name("example");
31066 /// ```
31067 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31068 self.name = v.into();
31069 self
31070 }
31071
31072 /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
31073 ///
31074 /// # Example
31075 /// ```ignore,no_run
31076 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31077 /// let x = SqlUsersUpdateRequest::new().set_project("example");
31078 /// ```
31079 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31080 self.project = v.into();
31081 self
31082 }
31083
31084 /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
31085 ///
31086 /// # Example
31087 /// ```ignore,no_run
31088 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31089 /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
31090 /// ```
31091 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31092 where
31093 T: std::iter::IntoIterator<Item = V>,
31094 V: std::convert::Into<std::string::String>,
31095 {
31096 use std::iter::Iterator;
31097 self.database_roles = v.into_iter().map(|i| i.into()).collect();
31098 self
31099 }
31100
31101 /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31102 ///
31103 /// # Example
31104 /// ```ignore,no_run
31105 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31106 /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_roles(true);
31107 /// ```
31108 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
31109 where
31110 T: std::convert::Into<bool>,
31111 {
31112 self.revoke_existing_roles = std::option::Option::Some(v.into());
31113 self
31114 }
31115
31116 /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31117 ///
31118 /// # Example
31119 /// ```ignore,no_run
31120 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31121 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(Some(false));
31122 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(None::<bool>);
31123 /// ```
31124 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
31125 where
31126 T: std::convert::Into<bool>,
31127 {
31128 self.revoke_existing_roles = v.map(|x| x.into());
31129 self
31130 }
31131
31132 /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
31133 ///
31134 /// # Example
31135 /// ```ignore,no_run
31136 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31137 /// use google_cloud_sql_v1::model::User;
31138 /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
31139 /// ```
31140 pub fn set_body<T>(mut self, v: T) -> Self
31141 where
31142 T: std::convert::Into<crate::model::User>,
31143 {
31144 self.body = std::option::Option::Some(v.into());
31145 self
31146 }
31147
31148 /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
31149 ///
31150 /// # Example
31151 /// ```ignore,no_run
31152 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31153 /// use google_cloud_sql_v1::model::User;
31154 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
31155 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
31156 /// ```
31157 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31158 where
31159 T: std::convert::Into<crate::model::User>,
31160 {
31161 self.body = v.map(|x| x.into());
31162 self
31163 }
31164}
31165
31166impl wkt::message::Message for SqlUsersUpdateRequest {
31167 fn typename() -> &'static str {
31168 "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
31169 }
31170}
31171
31172/// User level password validation policy.
31173#[derive(Clone, Default, PartialEq)]
31174#[non_exhaustive]
31175pub struct UserPasswordValidationPolicy {
31176 /// Number of failed login attempts allowed before user get locked.
31177 pub allowed_failed_attempts: i32,
31178
31179 /// Expiration duration after password is updated.
31180 pub password_expiration_duration: std::option::Option<wkt::Duration>,
31181
31182 /// If true, failed login attempts check will be enabled.
31183 pub enable_failed_attempts_check: bool,
31184
31185 /// Output only. Read-only password status.
31186 pub status: std::option::Option<crate::model::PasswordStatus>,
31187
31188 /// If true, the user must specify the current password before changing the
31189 /// password. This flag is supported only for MySQL.
31190 pub enable_password_verification: bool,
31191
31192 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31193}
31194
31195impl UserPasswordValidationPolicy {
31196 pub fn new() -> Self {
31197 std::default::Default::default()
31198 }
31199
31200 /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
31201 ///
31202 /// # Example
31203 /// ```ignore,no_run
31204 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31205 /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
31206 /// ```
31207 pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31208 self.allowed_failed_attempts = v.into();
31209 self
31210 }
31211
31212 /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31213 ///
31214 /// # Example
31215 /// ```ignore,no_run
31216 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31217 /// use wkt::Duration;
31218 /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
31219 /// ```
31220 pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
31221 where
31222 T: std::convert::Into<wkt::Duration>,
31223 {
31224 self.password_expiration_duration = std::option::Option::Some(v.into());
31225 self
31226 }
31227
31228 /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31229 ///
31230 /// # Example
31231 /// ```ignore,no_run
31232 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31233 /// use wkt::Duration;
31234 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
31235 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
31236 /// ```
31237 pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
31238 where
31239 T: std::convert::Into<wkt::Duration>,
31240 {
31241 self.password_expiration_duration = v.map(|x| x.into());
31242 self
31243 }
31244
31245 /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
31246 ///
31247 /// # Example
31248 /// ```ignore,no_run
31249 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31250 /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
31251 /// ```
31252 pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31253 self.enable_failed_attempts_check = v.into();
31254 self
31255 }
31256
31257 /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
31258 ///
31259 /// # Example
31260 /// ```ignore,no_run
31261 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31262 /// use google_cloud_sql_v1::model::PasswordStatus;
31263 /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
31264 /// ```
31265 pub fn set_status<T>(mut self, v: T) -> Self
31266 where
31267 T: std::convert::Into<crate::model::PasswordStatus>,
31268 {
31269 self.status = std::option::Option::Some(v.into());
31270 self
31271 }
31272
31273 /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
31274 ///
31275 /// # Example
31276 /// ```ignore,no_run
31277 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31278 /// use google_cloud_sql_v1::model::PasswordStatus;
31279 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
31280 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
31281 /// ```
31282 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
31283 where
31284 T: std::convert::Into<crate::model::PasswordStatus>,
31285 {
31286 self.status = v.map(|x| x.into());
31287 self
31288 }
31289
31290 /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
31291 ///
31292 /// # Example
31293 /// ```ignore,no_run
31294 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31295 /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
31296 /// ```
31297 pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31298 self.enable_password_verification = v.into();
31299 self
31300 }
31301}
31302
31303impl wkt::message::Message for UserPasswordValidationPolicy {
31304 fn typename() -> &'static str {
31305 "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
31306 }
31307}
31308
31309/// Read-only password status.
31310#[derive(Clone, Default, PartialEq)]
31311#[non_exhaustive]
31312pub struct PasswordStatus {
31313 /// If true, user does not have login privileges.
31314 pub locked: bool,
31315
31316 /// The expiration time of the current password.
31317 pub password_expiration_time: std::option::Option<wkt::Timestamp>,
31318
31319 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31320}
31321
31322impl PasswordStatus {
31323 pub fn new() -> Self {
31324 std::default::Default::default()
31325 }
31326
31327 /// Sets the value of [locked][crate::model::PasswordStatus::locked].
31328 ///
31329 /// # Example
31330 /// ```ignore,no_run
31331 /// # use google_cloud_sql_v1::model::PasswordStatus;
31332 /// let x = PasswordStatus::new().set_locked(true);
31333 /// ```
31334 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31335 self.locked = v.into();
31336 self
31337 }
31338
31339 /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31340 ///
31341 /// # Example
31342 /// ```ignore,no_run
31343 /// # use google_cloud_sql_v1::model::PasswordStatus;
31344 /// use wkt::Timestamp;
31345 /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
31346 /// ```
31347 pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
31348 where
31349 T: std::convert::Into<wkt::Timestamp>,
31350 {
31351 self.password_expiration_time = std::option::Option::Some(v.into());
31352 self
31353 }
31354
31355 /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31356 ///
31357 /// # Example
31358 /// ```ignore,no_run
31359 /// # use google_cloud_sql_v1::model::PasswordStatus;
31360 /// use wkt::Timestamp;
31361 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
31362 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
31363 /// ```
31364 pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
31365 where
31366 T: std::convert::Into<wkt::Timestamp>,
31367 {
31368 self.password_expiration_time = v.map(|x| x.into());
31369 self
31370 }
31371}
31372
31373impl wkt::message::Message for PasswordStatus {
31374 fn typename() -> &'static str {
31375 "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
31376 }
31377}
31378
31379/// A Cloud SQL user resource.
31380#[derive(Clone, Default, PartialEq)]
31381#[non_exhaustive]
31382pub struct User {
31383 /// This is always `sql#user`.
31384 pub kind: std::string::String,
31385
31386 /// The password for the user.
31387 pub password: std::string::String,
31388
31389 /// This field is deprecated and will be removed from a future version of the
31390 /// API.
31391 pub etag: std::string::String,
31392
31393 /// The name of the user in the Cloud SQL instance. Can be omitted for
31394 /// `update` because it is already specified in the URL.
31395 pub name: std::string::String,
31396
31397 /// Optional. The host from which the user can connect. For `insert`
31398 /// operations, host defaults to an empty string. For `update`
31399 /// operations, host is specified as part of the request URL. The host name
31400 /// cannot be updated after insertion. For a MySQL instance, it's required;
31401 /// for a PostgreSQL or SQL Server instance, it's optional.
31402 pub host: std::string::String,
31403
31404 /// The name of the Cloud SQL instance. This does not include the project ID.
31405 /// Can be omitted for `update` because it is already specified on the
31406 /// URL.
31407 pub instance: std::string::String,
31408
31409 /// The project ID of the project containing the Cloud SQL database. The Google
31410 /// apps domain is prefixed if applicable. Can be omitted for `update` because
31411 /// it is already specified on the URL.
31412 pub project: std::string::String,
31413
31414 /// The user type. It determines the method to authenticate the user during
31415 /// login. The default is the database's built-in user type.
31416 pub r#type: crate::model::user::SqlUserType,
31417
31418 /// Optional. The full email for an IAM user. For normal database users, this
31419 /// will not be filled. Only applicable to MySQL database users.
31420 pub iam_email: std::string::String,
31421
31422 /// User level password validation policy.
31423 pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
31424
31425 /// Dual password status for the user.
31426 pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
31427
31428 /// Indicates if a group is active or inactive for IAM database authentication.
31429 pub iam_status: std::option::Option<crate::model::user::IamStatus>,
31430
31431 /// Optional. Role memberships of the user
31432 pub database_roles: std::vec::Vec<std::string::String>,
31433
31434 /// User details for specific database type
31435 pub user_details: std::option::Option<crate::model::user::UserDetails>,
31436
31437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31438}
31439
31440impl User {
31441 pub fn new() -> Self {
31442 std::default::Default::default()
31443 }
31444
31445 /// Sets the value of [kind][crate::model::User::kind].
31446 ///
31447 /// # Example
31448 /// ```ignore,no_run
31449 /// # use google_cloud_sql_v1::model::User;
31450 /// let x = User::new().set_kind("example");
31451 /// ```
31452 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31453 self.kind = v.into();
31454 self
31455 }
31456
31457 /// Sets the value of [password][crate::model::User::password].
31458 ///
31459 /// # Example
31460 /// ```ignore,no_run
31461 /// # use google_cloud_sql_v1::model::User;
31462 /// let x = User::new().set_password("example");
31463 /// ```
31464 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31465 self.password = v.into();
31466 self
31467 }
31468
31469 /// Sets the value of [etag][crate::model::User::etag].
31470 ///
31471 /// # Example
31472 /// ```ignore,no_run
31473 /// # use google_cloud_sql_v1::model::User;
31474 /// let x = User::new().set_etag("example");
31475 /// ```
31476 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31477 self.etag = v.into();
31478 self
31479 }
31480
31481 /// Sets the value of [name][crate::model::User::name].
31482 ///
31483 /// # Example
31484 /// ```ignore,no_run
31485 /// # use google_cloud_sql_v1::model::User;
31486 /// let x = User::new().set_name("example");
31487 /// ```
31488 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31489 self.name = v.into();
31490 self
31491 }
31492
31493 /// Sets the value of [host][crate::model::User::host].
31494 ///
31495 /// # Example
31496 /// ```ignore,no_run
31497 /// # use google_cloud_sql_v1::model::User;
31498 /// let x = User::new().set_host("example");
31499 /// ```
31500 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31501 self.host = v.into();
31502 self
31503 }
31504
31505 /// Sets the value of [instance][crate::model::User::instance].
31506 ///
31507 /// # Example
31508 /// ```ignore,no_run
31509 /// # use google_cloud_sql_v1::model::User;
31510 /// let x = User::new().set_instance("example");
31511 /// ```
31512 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31513 self.instance = v.into();
31514 self
31515 }
31516
31517 /// Sets the value of [project][crate::model::User::project].
31518 ///
31519 /// # Example
31520 /// ```ignore,no_run
31521 /// # use google_cloud_sql_v1::model::User;
31522 /// let x = User::new().set_project("example");
31523 /// ```
31524 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31525 self.project = v.into();
31526 self
31527 }
31528
31529 /// Sets the value of [r#type][crate::model::User::type].
31530 ///
31531 /// # Example
31532 /// ```ignore,no_run
31533 /// # use google_cloud_sql_v1::model::User;
31534 /// use google_cloud_sql_v1::model::user::SqlUserType;
31535 /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
31536 /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
31537 /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
31538 /// ```
31539 pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
31540 mut self,
31541 v: T,
31542 ) -> Self {
31543 self.r#type = v.into();
31544 self
31545 }
31546
31547 /// Sets the value of [iam_email][crate::model::User::iam_email].
31548 ///
31549 /// # Example
31550 /// ```ignore,no_run
31551 /// # use google_cloud_sql_v1::model::User;
31552 /// let x = User::new().set_iam_email("example");
31553 /// ```
31554 pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31555 self.iam_email = v.into();
31556 self
31557 }
31558
31559 /// Sets the value of [password_policy][crate::model::User::password_policy].
31560 ///
31561 /// # Example
31562 /// ```ignore,no_run
31563 /// # use google_cloud_sql_v1::model::User;
31564 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31565 /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
31566 /// ```
31567 pub fn set_password_policy<T>(mut self, v: T) -> Self
31568 where
31569 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31570 {
31571 self.password_policy = std::option::Option::Some(v.into());
31572 self
31573 }
31574
31575 /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
31576 ///
31577 /// # Example
31578 /// ```ignore,no_run
31579 /// # use google_cloud_sql_v1::model::User;
31580 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31581 /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
31582 /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
31583 /// ```
31584 pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
31585 where
31586 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31587 {
31588 self.password_policy = v.map(|x| x.into());
31589 self
31590 }
31591
31592 /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
31593 ///
31594 /// # Example
31595 /// ```ignore,no_run
31596 /// # use google_cloud_sql_v1::model::User;
31597 /// use google_cloud_sql_v1::model::user::DualPasswordType;
31598 /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
31599 /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
31600 /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
31601 /// ```
31602 pub fn set_dual_password_type<T>(mut self, v: T) -> Self
31603 where
31604 T: std::convert::Into<crate::model::user::DualPasswordType>,
31605 {
31606 self.dual_password_type = std::option::Option::Some(v.into());
31607 self
31608 }
31609
31610 /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
31611 ///
31612 /// # Example
31613 /// ```ignore,no_run
31614 /// # use google_cloud_sql_v1::model::User;
31615 /// use google_cloud_sql_v1::model::user::DualPasswordType;
31616 /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
31617 /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
31618 /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
31619 /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
31620 /// ```
31621 pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
31622 where
31623 T: std::convert::Into<crate::model::user::DualPasswordType>,
31624 {
31625 self.dual_password_type = v.map(|x| x.into());
31626 self
31627 }
31628
31629 /// Sets the value of [iam_status][crate::model::User::iam_status].
31630 ///
31631 /// # Example
31632 /// ```ignore,no_run
31633 /// # use google_cloud_sql_v1::model::User;
31634 /// use google_cloud_sql_v1::model::user::IamStatus;
31635 /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
31636 /// let x1 = User::new().set_iam_status(IamStatus::Active);
31637 /// ```
31638 pub fn set_iam_status<T>(mut self, v: T) -> Self
31639 where
31640 T: std::convert::Into<crate::model::user::IamStatus>,
31641 {
31642 self.iam_status = std::option::Option::Some(v.into());
31643 self
31644 }
31645
31646 /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
31647 ///
31648 /// # Example
31649 /// ```ignore,no_run
31650 /// # use google_cloud_sql_v1::model::User;
31651 /// use google_cloud_sql_v1::model::user::IamStatus;
31652 /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
31653 /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
31654 /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
31655 /// ```
31656 pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
31657 where
31658 T: std::convert::Into<crate::model::user::IamStatus>,
31659 {
31660 self.iam_status = v.map(|x| x.into());
31661 self
31662 }
31663
31664 /// Sets the value of [database_roles][crate::model::User::database_roles].
31665 ///
31666 /// # Example
31667 /// ```ignore,no_run
31668 /// # use google_cloud_sql_v1::model::User;
31669 /// let x = User::new().set_database_roles(["a", "b", "c"]);
31670 /// ```
31671 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31672 where
31673 T: std::iter::IntoIterator<Item = V>,
31674 V: std::convert::Into<std::string::String>,
31675 {
31676 use std::iter::Iterator;
31677 self.database_roles = v.into_iter().map(|i| i.into()).collect();
31678 self
31679 }
31680
31681 /// Sets the value of [user_details][crate::model::User::user_details].
31682 ///
31683 /// Note that all the setters affecting `user_details` are mutually
31684 /// exclusive.
31685 ///
31686 /// # Example
31687 /// ```ignore,no_run
31688 /// # use google_cloud_sql_v1::model::User;
31689 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
31690 /// let x = User::new().set_user_details(Some(
31691 /// google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
31692 /// ```
31693 pub fn set_user_details<
31694 T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
31695 >(
31696 mut self,
31697 v: T,
31698 ) -> Self {
31699 self.user_details = v.into();
31700 self
31701 }
31702
31703 /// The value of [user_details][crate::model::User::user_details]
31704 /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
31705 /// holds a different branch.
31706 pub fn sqlserver_user_details(
31707 &self,
31708 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
31709 #[allow(unreachable_patterns)]
31710 self.user_details.as_ref().and_then(|v| match v {
31711 crate::model::user::UserDetails::SqlserverUserDetails(v) => {
31712 std::option::Option::Some(v)
31713 }
31714 _ => std::option::Option::None,
31715 })
31716 }
31717
31718 /// Sets the value of [user_details][crate::model::User::user_details]
31719 /// to hold a `SqlserverUserDetails`.
31720 ///
31721 /// Note that all the setters affecting `user_details` are
31722 /// mutually exclusive.
31723 ///
31724 /// # Example
31725 /// ```ignore,no_run
31726 /// # use google_cloud_sql_v1::model::User;
31727 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
31728 /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
31729 /// assert!(x.sqlserver_user_details().is_some());
31730 /// ```
31731 pub fn set_sqlserver_user_details<
31732 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
31733 >(
31734 mut self,
31735 v: T,
31736 ) -> Self {
31737 self.user_details = std::option::Option::Some(
31738 crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
31739 );
31740 self
31741 }
31742}
31743
31744impl wkt::message::Message for User {
31745 fn typename() -> &'static str {
31746 "type.googleapis.com/google.cloud.sql.v1.User"
31747 }
31748}
31749
31750/// Defines additional types related to [User].
31751pub mod user {
31752 #[allow(unused_imports)]
31753 use super::*;
31754
31755 /// The user type.
31756 ///
31757 /// # Working with unknown values
31758 ///
31759 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31760 /// additional enum variants at any time. Adding new variants is not considered
31761 /// a breaking change. Applications should write their code in anticipation of:
31762 ///
31763 /// - New values appearing in future releases of the client library, **and**
31764 /// - New values received dynamically, without application changes.
31765 ///
31766 /// Please consult the [Working with enums] section in the user guide for some
31767 /// guidelines.
31768 ///
31769 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31770 #[derive(Clone, Debug, PartialEq)]
31771 #[non_exhaustive]
31772 pub enum SqlUserType {
31773 /// The database's built-in user type.
31774 BuiltIn,
31775 /// Cloud IAM user.
31776 CloudIamUser,
31777 /// Cloud IAM service account.
31778 CloudIamServiceAccount,
31779 /// Cloud IAM group. Not used for login.
31780 CloudIamGroup,
31781 /// Read-only. Login for a user that belongs to the Cloud IAM group.
31782 CloudIamGroupUser,
31783 /// Read-only. Login for a service account that belongs to the
31784 /// Cloud IAM group.
31785 CloudIamGroupServiceAccount,
31786 /// Microsoft Entra ID user.
31787 EntraidUser,
31788 /// If set, the enum was initialized with an unknown value.
31789 ///
31790 /// Applications can examine the value using [SqlUserType::value] or
31791 /// [SqlUserType::name].
31792 UnknownValue(sql_user_type::UnknownValue),
31793 }
31794
31795 #[doc(hidden)]
31796 pub mod sql_user_type {
31797 #[allow(unused_imports)]
31798 use super::*;
31799 #[derive(Clone, Debug, PartialEq)]
31800 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31801 }
31802
31803 impl SqlUserType {
31804 /// Gets the enum value.
31805 ///
31806 /// Returns `None` if the enum contains an unknown value deserialized from
31807 /// the string representation of enums.
31808 pub fn value(&self) -> std::option::Option<i32> {
31809 match self {
31810 Self::BuiltIn => std::option::Option::Some(0),
31811 Self::CloudIamUser => std::option::Option::Some(1),
31812 Self::CloudIamServiceAccount => std::option::Option::Some(2),
31813 Self::CloudIamGroup => std::option::Option::Some(3),
31814 Self::CloudIamGroupUser => std::option::Option::Some(4),
31815 Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
31816 Self::EntraidUser => std::option::Option::Some(7),
31817 Self::UnknownValue(u) => u.0.value(),
31818 }
31819 }
31820
31821 /// Gets the enum value as a string.
31822 ///
31823 /// Returns `None` if the enum contains an unknown value deserialized from
31824 /// the integer representation of enums.
31825 pub fn name(&self) -> std::option::Option<&str> {
31826 match self {
31827 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
31828 Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
31829 Self::CloudIamServiceAccount => {
31830 std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
31831 }
31832 Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
31833 Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
31834 Self::CloudIamGroupServiceAccount => {
31835 std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
31836 }
31837 Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
31838 Self::UnknownValue(u) => u.0.name(),
31839 }
31840 }
31841 }
31842
31843 impl std::default::Default for SqlUserType {
31844 fn default() -> Self {
31845 use std::convert::From;
31846 Self::from(0)
31847 }
31848 }
31849
31850 impl std::fmt::Display for SqlUserType {
31851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31852 wkt::internal::display_enum(f, self.name(), self.value())
31853 }
31854 }
31855
31856 impl std::convert::From<i32> for SqlUserType {
31857 fn from(value: i32) -> Self {
31858 match value {
31859 0 => Self::BuiltIn,
31860 1 => Self::CloudIamUser,
31861 2 => Self::CloudIamServiceAccount,
31862 3 => Self::CloudIamGroup,
31863 4 => Self::CloudIamGroupUser,
31864 5 => Self::CloudIamGroupServiceAccount,
31865 7 => Self::EntraidUser,
31866 _ => Self::UnknownValue(sql_user_type::UnknownValue(
31867 wkt::internal::UnknownEnumValue::Integer(value),
31868 )),
31869 }
31870 }
31871 }
31872
31873 impl std::convert::From<&str> for SqlUserType {
31874 fn from(value: &str) -> Self {
31875 use std::string::ToString;
31876 match value {
31877 "BUILT_IN" => Self::BuiltIn,
31878 "CLOUD_IAM_USER" => Self::CloudIamUser,
31879 "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
31880 "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
31881 "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
31882 "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
31883 "ENTRAID_USER" => Self::EntraidUser,
31884 _ => Self::UnknownValue(sql_user_type::UnknownValue(
31885 wkt::internal::UnknownEnumValue::String(value.to_string()),
31886 )),
31887 }
31888 }
31889 }
31890
31891 impl serde::ser::Serialize for SqlUserType {
31892 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31893 where
31894 S: serde::Serializer,
31895 {
31896 match self {
31897 Self::BuiltIn => serializer.serialize_i32(0),
31898 Self::CloudIamUser => serializer.serialize_i32(1),
31899 Self::CloudIamServiceAccount => serializer.serialize_i32(2),
31900 Self::CloudIamGroup => serializer.serialize_i32(3),
31901 Self::CloudIamGroupUser => serializer.serialize_i32(4),
31902 Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
31903 Self::EntraidUser => serializer.serialize_i32(7),
31904 Self::UnknownValue(u) => u.0.serialize(serializer),
31905 }
31906 }
31907 }
31908
31909 impl<'de> serde::de::Deserialize<'de> for SqlUserType {
31910 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31911 where
31912 D: serde::Deserializer<'de>,
31913 {
31914 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
31915 ".google.cloud.sql.v1.User.SqlUserType",
31916 ))
31917 }
31918 }
31919
31920 /// The type of retained password.
31921 ///
31922 /// # Working with unknown values
31923 ///
31924 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31925 /// additional enum variants at any time. Adding new variants is not considered
31926 /// a breaking change. Applications should write their code in anticipation of:
31927 ///
31928 /// - New values appearing in future releases of the client library, **and**
31929 /// - New values received dynamically, without application changes.
31930 ///
31931 /// Please consult the [Working with enums] section in the user guide for some
31932 /// guidelines.
31933 ///
31934 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
31935 #[derive(Clone, Debug, PartialEq)]
31936 #[non_exhaustive]
31937 pub enum DualPasswordType {
31938 /// The default value.
31939 Unspecified,
31940 /// Do not update the user's dual password status.
31941 NoModifyDualPassword,
31942 /// No dual password usable for connecting using this user.
31943 NoDualPassword,
31944 /// Dual password usable for connecting using this user.
31945 DualPassword,
31946 /// If set, the enum was initialized with an unknown value.
31947 ///
31948 /// Applications can examine the value using [DualPasswordType::value] or
31949 /// [DualPasswordType::name].
31950 UnknownValue(dual_password_type::UnknownValue),
31951 }
31952
31953 #[doc(hidden)]
31954 pub mod dual_password_type {
31955 #[allow(unused_imports)]
31956 use super::*;
31957 #[derive(Clone, Debug, PartialEq)]
31958 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31959 }
31960
31961 impl DualPasswordType {
31962 /// Gets the enum value.
31963 ///
31964 /// Returns `None` if the enum contains an unknown value deserialized from
31965 /// the string representation of enums.
31966 pub fn value(&self) -> std::option::Option<i32> {
31967 match self {
31968 Self::Unspecified => std::option::Option::Some(0),
31969 Self::NoModifyDualPassword => std::option::Option::Some(1),
31970 Self::NoDualPassword => std::option::Option::Some(2),
31971 Self::DualPassword => std::option::Option::Some(3),
31972 Self::UnknownValue(u) => u.0.value(),
31973 }
31974 }
31975
31976 /// Gets the enum value as a string.
31977 ///
31978 /// Returns `None` if the enum contains an unknown value deserialized from
31979 /// the integer representation of enums.
31980 pub fn name(&self) -> std::option::Option<&str> {
31981 match self {
31982 Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
31983 Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
31984 Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
31985 Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
31986 Self::UnknownValue(u) => u.0.name(),
31987 }
31988 }
31989 }
31990
31991 impl std::default::Default for DualPasswordType {
31992 fn default() -> Self {
31993 use std::convert::From;
31994 Self::from(0)
31995 }
31996 }
31997
31998 impl std::fmt::Display for DualPasswordType {
31999 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32000 wkt::internal::display_enum(f, self.name(), self.value())
32001 }
32002 }
32003
32004 impl std::convert::From<i32> for DualPasswordType {
32005 fn from(value: i32) -> Self {
32006 match value {
32007 0 => Self::Unspecified,
32008 1 => Self::NoModifyDualPassword,
32009 2 => Self::NoDualPassword,
32010 3 => Self::DualPassword,
32011 _ => Self::UnknownValue(dual_password_type::UnknownValue(
32012 wkt::internal::UnknownEnumValue::Integer(value),
32013 )),
32014 }
32015 }
32016 }
32017
32018 impl std::convert::From<&str> for DualPasswordType {
32019 fn from(value: &str) -> Self {
32020 use std::string::ToString;
32021 match value {
32022 "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
32023 "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
32024 "NO_DUAL_PASSWORD" => Self::NoDualPassword,
32025 "DUAL_PASSWORD" => Self::DualPassword,
32026 _ => Self::UnknownValue(dual_password_type::UnknownValue(
32027 wkt::internal::UnknownEnumValue::String(value.to_string()),
32028 )),
32029 }
32030 }
32031 }
32032
32033 impl serde::ser::Serialize for DualPasswordType {
32034 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32035 where
32036 S: serde::Serializer,
32037 {
32038 match self {
32039 Self::Unspecified => serializer.serialize_i32(0),
32040 Self::NoModifyDualPassword => serializer.serialize_i32(1),
32041 Self::NoDualPassword => serializer.serialize_i32(2),
32042 Self::DualPassword => serializer.serialize_i32(3),
32043 Self::UnknownValue(u) => u.0.serialize(serializer),
32044 }
32045 }
32046 }
32047
32048 impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
32049 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32050 where
32051 D: serde::Deserializer<'de>,
32052 {
32053 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
32054 ".google.cloud.sql.v1.User.DualPasswordType",
32055 ))
32056 }
32057 }
32058
32059 /// Indicates if a group is available for IAM database authentication.
32060 ///
32061 /// # Working with unknown values
32062 ///
32063 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32064 /// additional enum variants at any time. Adding new variants is not considered
32065 /// a breaking change. Applications should write their code in anticipation of:
32066 ///
32067 /// - New values appearing in future releases of the client library, **and**
32068 /// - New values received dynamically, without application changes.
32069 ///
32070 /// Please consult the [Working with enums] section in the user guide for some
32071 /// guidelines.
32072 ///
32073 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32074 #[derive(Clone, Debug, PartialEq)]
32075 #[non_exhaustive]
32076 pub enum IamStatus {
32077 /// The default value for users that are not of type CLOUD_IAM_GROUP.
32078 /// Only CLOUD_IAM_GROUP users will be inactive or active.
32079 /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
32080 /// display whether they are active or inactive as that is not applicable to
32081 /// them.
32082 Unspecified,
32083 /// INACTIVE indicates a group is not available for IAM database
32084 /// authentication.
32085 Inactive,
32086 /// ACTIVE indicates a group is available for IAM database authentication.
32087 Active,
32088 /// If set, the enum was initialized with an unknown value.
32089 ///
32090 /// Applications can examine the value using [IamStatus::value] or
32091 /// [IamStatus::name].
32092 UnknownValue(iam_status::UnknownValue),
32093 }
32094
32095 #[doc(hidden)]
32096 pub mod iam_status {
32097 #[allow(unused_imports)]
32098 use super::*;
32099 #[derive(Clone, Debug, PartialEq)]
32100 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32101 }
32102
32103 impl IamStatus {
32104 /// Gets the enum value.
32105 ///
32106 /// Returns `None` if the enum contains an unknown value deserialized from
32107 /// the string representation of enums.
32108 pub fn value(&self) -> std::option::Option<i32> {
32109 match self {
32110 Self::Unspecified => std::option::Option::Some(0),
32111 Self::Inactive => std::option::Option::Some(1),
32112 Self::Active => std::option::Option::Some(2),
32113 Self::UnknownValue(u) => u.0.value(),
32114 }
32115 }
32116
32117 /// Gets the enum value as a string.
32118 ///
32119 /// Returns `None` if the enum contains an unknown value deserialized from
32120 /// the integer representation of enums.
32121 pub fn name(&self) -> std::option::Option<&str> {
32122 match self {
32123 Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
32124 Self::Inactive => std::option::Option::Some("INACTIVE"),
32125 Self::Active => std::option::Option::Some("ACTIVE"),
32126 Self::UnknownValue(u) => u.0.name(),
32127 }
32128 }
32129 }
32130
32131 impl std::default::Default for IamStatus {
32132 fn default() -> Self {
32133 use std::convert::From;
32134 Self::from(0)
32135 }
32136 }
32137
32138 impl std::fmt::Display for IamStatus {
32139 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32140 wkt::internal::display_enum(f, self.name(), self.value())
32141 }
32142 }
32143
32144 impl std::convert::From<i32> for IamStatus {
32145 fn from(value: i32) -> Self {
32146 match value {
32147 0 => Self::Unspecified,
32148 1 => Self::Inactive,
32149 2 => Self::Active,
32150 _ => Self::UnknownValue(iam_status::UnknownValue(
32151 wkt::internal::UnknownEnumValue::Integer(value),
32152 )),
32153 }
32154 }
32155 }
32156
32157 impl std::convert::From<&str> for IamStatus {
32158 fn from(value: &str) -> Self {
32159 use std::string::ToString;
32160 match value {
32161 "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
32162 "INACTIVE" => Self::Inactive,
32163 "ACTIVE" => Self::Active,
32164 _ => Self::UnknownValue(iam_status::UnknownValue(
32165 wkt::internal::UnknownEnumValue::String(value.to_string()),
32166 )),
32167 }
32168 }
32169 }
32170
32171 impl serde::ser::Serialize for IamStatus {
32172 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32173 where
32174 S: serde::Serializer,
32175 {
32176 match self {
32177 Self::Unspecified => serializer.serialize_i32(0),
32178 Self::Inactive => serializer.serialize_i32(1),
32179 Self::Active => serializer.serialize_i32(2),
32180 Self::UnknownValue(u) => u.0.serialize(serializer),
32181 }
32182 }
32183 }
32184
32185 impl<'de> serde::de::Deserialize<'de> for IamStatus {
32186 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32187 where
32188 D: serde::Deserializer<'de>,
32189 {
32190 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
32191 ".google.cloud.sql.v1.User.IamStatus",
32192 ))
32193 }
32194 }
32195
32196 /// User details for specific database type
32197 #[derive(Clone, Debug, PartialEq)]
32198 #[non_exhaustive]
32199 pub enum UserDetails {
32200 SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
32201 }
32202}
32203
32204/// Represents a Sql Server user on the Cloud SQL instance.
32205#[derive(Clone, Default, PartialEq)]
32206#[non_exhaustive]
32207pub struct SqlServerUserDetails {
32208 /// If the user has been disabled
32209 pub disabled: bool,
32210
32211 /// The server roles for this user
32212 pub server_roles: std::vec::Vec<std::string::String>,
32213
32214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32215}
32216
32217impl SqlServerUserDetails {
32218 pub fn new() -> Self {
32219 std::default::Default::default()
32220 }
32221
32222 /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
32223 ///
32224 /// # Example
32225 /// ```ignore,no_run
32226 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32227 /// let x = SqlServerUserDetails::new().set_disabled(true);
32228 /// ```
32229 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32230 self.disabled = v.into();
32231 self
32232 }
32233
32234 /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
32235 ///
32236 /// # Example
32237 /// ```ignore,no_run
32238 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32239 /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
32240 /// ```
32241 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
32242 where
32243 T: std::iter::IntoIterator<Item = V>,
32244 V: std::convert::Into<std::string::String>,
32245 {
32246 use std::iter::Iterator;
32247 self.server_roles = v.into_iter().map(|i| i.into()).collect();
32248 self
32249 }
32250}
32251
32252impl wkt::message::Message for SqlServerUserDetails {
32253 fn typename() -> &'static str {
32254 "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
32255 }
32256}
32257
32258/// User list response.
32259#[derive(Clone, Default, PartialEq)]
32260#[non_exhaustive]
32261pub struct UsersListResponse {
32262 /// This is always `sql#usersList`.
32263 pub kind: std::string::String,
32264
32265 /// List of user resources in the instance.
32266 pub items: std::vec::Vec<crate::model::User>,
32267
32268 /// Unused.
32269 #[deprecated]
32270 pub next_page_token: std::string::String,
32271
32272 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32273}
32274
32275impl UsersListResponse {
32276 pub fn new() -> Self {
32277 std::default::Default::default()
32278 }
32279
32280 /// Sets the value of [kind][crate::model::UsersListResponse::kind].
32281 ///
32282 /// # Example
32283 /// ```ignore,no_run
32284 /// # use google_cloud_sql_v1::model::UsersListResponse;
32285 /// let x = UsersListResponse::new().set_kind("example");
32286 /// ```
32287 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32288 self.kind = v.into();
32289 self
32290 }
32291
32292 /// Sets the value of [items][crate::model::UsersListResponse::items].
32293 ///
32294 /// # Example
32295 /// ```ignore,no_run
32296 /// # use google_cloud_sql_v1::model::UsersListResponse;
32297 /// use google_cloud_sql_v1::model::User;
32298 /// let x = UsersListResponse::new()
32299 /// .set_items([
32300 /// User::default()/* use setters */,
32301 /// User::default()/* use (different) setters */,
32302 /// ]);
32303 /// ```
32304 pub fn set_items<T, V>(mut self, v: T) -> Self
32305 where
32306 T: std::iter::IntoIterator<Item = V>,
32307 V: std::convert::Into<crate::model::User>,
32308 {
32309 use std::iter::Iterator;
32310 self.items = v.into_iter().map(|i| i.into()).collect();
32311 self
32312 }
32313
32314 /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
32315 ///
32316 /// # Example
32317 /// ```ignore,no_run
32318 /// # use google_cloud_sql_v1::model::UsersListResponse;
32319 /// let x = UsersListResponse::new().set_next_page_token("example");
32320 /// ```
32321 #[deprecated]
32322 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32323 self.next_page_token = v.into();
32324 self
32325 }
32326}
32327
32328impl wkt::message::Message for UsersListResponse {
32329 fn typename() -> &'static str {
32330 "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
32331 }
32332}
32333
32334/// The status of a backup run.
32335///
32336/// # Working with unknown values
32337///
32338/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32339/// additional enum variants at any time. Adding new variants is not considered
32340/// a breaking change. Applications should write their code in anticipation of:
32341///
32342/// - New values appearing in future releases of the client library, **and**
32343/// - New values received dynamically, without application changes.
32344///
32345/// Please consult the [Working with enums] section in the user guide for some
32346/// guidelines.
32347///
32348/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32349#[derive(Clone, Debug, PartialEq)]
32350#[non_exhaustive]
32351pub enum SqlBackupRunStatus {
32352 /// The status of the run is unknown.
32353 Unspecified,
32354 /// The backup operation was enqueued.
32355 Enqueued,
32356 /// The backup is overdue across a given backup window. Indicates a
32357 /// problem. Example: Long-running operation in progress during
32358 /// the whole window.
32359 Overdue,
32360 /// The backup is in progress.
32361 Running,
32362 /// The backup failed.
32363 Failed,
32364 /// The backup was successful.
32365 Successful,
32366 /// The backup was skipped (without problems) for a given backup
32367 /// window. Example: Instance was idle.
32368 Skipped,
32369 /// The backup is about to be deleted.
32370 DeletionPending,
32371 /// The backup deletion failed.
32372 DeletionFailed,
32373 /// The backup has been deleted.
32374 Deleted,
32375 /// If set, the enum was initialized with an unknown value.
32376 ///
32377 /// Applications can examine the value using [SqlBackupRunStatus::value] or
32378 /// [SqlBackupRunStatus::name].
32379 UnknownValue(sql_backup_run_status::UnknownValue),
32380}
32381
32382#[doc(hidden)]
32383pub mod sql_backup_run_status {
32384 #[allow(unused_imports)]
32385 use super::*;
32386 #[derive(Clone, Debug, PartialEq)]
32387 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32388}
32389
32390impl SqlBackupRunStatus {
32391 /// Gets the enum value.
32392 ///
32393 /// Returns `None` if the enum contains an unknown value deserialized from
32394 /// the string representation of enums.
32395 pub fn value(&self) -> std::option::Option<i32> {
32396 match self {
32397 Self::Unspecified => std::option::Option::Some(0),
32398 Self::Enqueued => std::option::Option::Some(1),
32399 Self::Overdue => std::option::Option::Some(2),
32400 Self::Running => std::option::Option::Some(3),
32401 Self::Failed => std::option::Option::Some(4),
32402 Self::Successful => std::option::Option::Some(5),
32403 Self::Skipped => std::option::Option::Some(6),
32404 Self::DeletionPending => std::option::Option::Some(7),
32405 Self::DeletionFailed => std::option::Option::Some(8),
32406 Self::Deleted => std::option::Option::Some(9),
32407 Self::UnknownValue(u) => u.0.value(),
32408 }
32409 }
32410
32411 /// Gets the enum value as a string.
32412 ///
32413 /// Returns `None` if the enum contains an unknown value deserialized from
32414 /// the integer representation of enums.
32415 pub fn name(&self) -> std::option::Option<&str> {
32416 match self {
32417 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
32418 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
32419 Self::Overdue => std::option::Option::Some("OVERDUE"),
32420 Self::Running => std::option::Option::Some("RUNNING"),
32421 Self::Failed => std::option::Option::Some("FAILED"),
32422 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
32423 Self::Skipped => std::option::Option::Some("SKIPPED"),
32424 Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
32425 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
32426 Self::Deleted => std::option::Option::Some("DELETED"),
32427 Self::UnknownValue(u) => u.0.name(),
32428 }
32429 }
32430}
32431
32432impl std::default::Default for SqlBackupRunStatus {
32433 fn default() -> Self {
32434 use std::convert::From;
32435 Self::from(0)
32436 }
32437}
32438
32439impl std::fmt::Display for SqlBackupRunStatus {
32440 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32441 wkt::internal::display_enum(f, self.name(), self.value())
32442 }
32443}
32444
32445impl std::convert::From<i32> for SqlBackupRunStatus {
32446 fn from(value: i32) -> Self {
32447 match value {
32448 0 => Self::Unspecified,
32449 1 => Self::Enqueued,
32450 2 => Self::Overdue,
32451 3 => Self::Running,
32452 4 => Self::Failed,
32453 5 => Self::Successful,
32454 6 => Self::Skipped,
32455 7 => Self::DeletionPending,
32456 8 => Self::DeletionFailed,
32457 9 => Self::Deleted,
32458 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32459 wkt::internal::UnknownEnumValue::Integer(value),
32460 )),
32461 }
32462 }
32463}
32464
32465impl std::convert::From<&str> for SqlBackupRunStatus {
32466 fn from(value: &str) -> Self {
32467 use std::string::ToString;
32468 match value {
32469 "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
32470 "ENQUEUED" => Self::Enqueued,
32471 "OVERDUE" => Self::Overdue,
32472 "RUNNING" => Self::Running,
32473 "FAILED" => Self::Failed,
32474 "SUCCESSFUL" => Self::Successful,
32475 "SKIPPED" => Self::Skipped,
32476 "DELETION_PENDING" => Self::DeletionPending,
32477 "DELETION_FAILED" => Self::DeletionFailed,
32478 "DELETED" => Self::Deleted,
32479 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32480 wkt::internal::UnknownEnumValue::String(value.to_string()),
32481 )),
32482 }
32483 }
32484}
32485
32486impl serde::ser::Serialize for SqlBackupRunStatus {
32487 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32488 where
32489 S: serde::Serializer,
32490 {
32491 match self {
32492 Self::Unspecified => serializer.serialize_i32(0),
32493 Self::Enqueued => serializer.serialize_i32(1),
32494 Self::Overdue => serializer.serialize_i32(2),
32495 Self::Running => serializer.serialize_i32(3),
32496 Self::Failed => serializer.serialize_i32(4),
32497 Self::Successful => serializer.serialize_i32(5),
32498 Self::Skipped => serializer.serialize_i32(6),
32499 Self::DeletionPending => serializer.serialize_i32(7),
32500 Self::DeletionFailed => serializer.serialize_i32(8),
32501 Self::Deleted => serializer.serialize_i32(9),
32502 Self::UnknownValue(u) => u.0.serialize(serializer),
32503 }
32504 }
32505}
32506
32507impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
32508 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32509 where
32510 D: serde::Deserializer<'de>,
32511 {
32512 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
32513 ".google.cloud.sql.v1.SqlBackupRunStatus",
32514 ))
32515 }
32516}
32517
32518/// Defines the supported backup kinds.
32519///
32520/// # Working with unknown values
32521///
32522/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32523/// additional enum variants at any time. Adding new variants is not considered
32524/// a breaking change. Applications should write their code in anticipation of:
32525///
32526/// - New values appearing in future releases of the client library, **and**
32527/// - New values received dynamically, without application changes.
32528///
32529/// Please consult the [Working with enums] section in the user guide for some
32530/// guidelines.
32531///
32532/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32533#[derive(Clone, Debug, PartialEq)]
32534#[non_exhaustive]
32535pub enum SqlBackupKind {
32536 /// This is an unknown BackupKind.
32537 Unspecified,
32538 /// Snapshot-based backups.
32539 Snapshot,
32540 /// Physical backups.
32541 Physical,
32542 /// If set, the enum was initialized with an unknown value.
32543 ///
32544 /// Applications can examine the value using [SqlBackupKind::value] or
32545 /// [SqlBackupKind::name].
32546 UnknownValue(sql_backup_kind::UnknownValue),
32547}
32548
32549#[doc(hidden)]
32550pub mod sql_backup_kind {
32551 #[allow(unused_imports)]
32552 use super::*;
32553 #[derive(Clone, Debug, PartialEq)]
32554 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32555}
32556
32557impl SqlBackupKind {
32558 /// Gets the enum value.
32559 ///
32560 /// Returns `None` if the enum contains an unknown value deserialized from
32561 /// the string representation of enums.
32562 pub fn value(&self) -> std::option::Option<i32> {
32563 match self {
32564 Self::Unspecified => std::option::Option::Some(0),
32565 Self::Snapshot => std::option::Option::Some(1),
32566 Self::Physical => std::option::Option::Some(2),
32567 Self::UnknownValue(u) => u.0.value(),
32568 }
32569 }
32570
32571 /// Gets the enum value as a string.
32572 ///
32573 /// Returns `None` if the enum contains an unknown value deserialized from
32574 /// the integer representation of enums.
32575 pub fn name(&self) -> std::option::Option<&str> {
32576 match self {
32577 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
32578 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
32579 Self::Physical => std::option::Option::Some("PHYSICAL"),
32580 Self::UnknownValue(u) => u.0.name(),
32581 }
32582 }
32583}
32584
32585impl std::default::Default for SqlBackupKind {
32586 fn default() -> Self {
32587 use std::convert::From;
32588 Self::from(0)
32589 }
32590}
32591
32592impl std::fmt::Display for SqlBackupKind {
32593 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32594 wkt::internal::display_enum(f, self.name(), self.value())
32595 }
32596}
32597
32598impl std::convert::From<i32> for SqlBackupKind {
32599 fn from(value: i32) -> Self {
32600 match value {
32601 0 => Self::Unspecified,
32602 1 => Self::Snapshot,
32603 2 => Self::Physical,
32604 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32605 wkt::internal::UnknownEnumValue::Integer(value),
32606 )),
32607 }
32608 }
32609}
32610
32611impl std::convert::From<&str> for SqlBackupKind {
32612 fn from(value: &str) -> Self {
32613 use std::string::ToString;
32614 match value {
32615 "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
32616 "SNAPSHOT" => Self::Snapshot,
32617 "PHYSICAL" => Self::Physical,
32618 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32619 wkt::internal::UnknownEnumValue::String(value.to_string()),
32620 )),
32621 }
32622 }
32623}
32624
32625impl serde::ser::Serialize for SqlBackupKind {
32626 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32627 where
32628 S: serde::Serializer,
32629 {
32630 match self {
32631 Self::Unspecified => serializer.serialize_i32(0),
32632 Self::Snapshot => serializer.serialize_i32(1),
32633 Self::Physical => serializer.serialize_i32(2),
32634 Self::UnknownValue(u) => u.0.serialize(serializer),
32635 }
32636 }
32637}
32638
32639impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
32640 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32641 where
32642 D: serde::Deserializer<'de>,
32643 {
32644 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
32645 ".google.cloud.sql.v1.SqlBackupKind",
32646 ))
32647 }
32648}
32649
32650/// Type of backup (i.e. automated, on demand, etc).
32651///
32652/// # Working with unknown values
32653///
32654/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32655/// additional enum variants at any time. Adding new variants is not considered
32656/// a breaking change. Applications should write their code in anticipation of:
32657///
32658/// - New values appearing in future releases of the client library, **and**
32659/// - New values received dynamically, without application changes.
32660///
32661/// Please consult the [Working with enums] section in the user guide for some
32662/// guidelines.
32663///
32664/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32665#[derive(Clone, Debug, PartialEq)]
32666#[non_exhaustive]
32667pub enum SqlBackupRunType {
32668 /// This is an unknown BackupRun type.
32669 Unspecified,
32670 /// The backup schedule automatically triggers a backup.
32671 Automated,
32672 /// The user manually triggers a backup.
32673 OnDemand,
32674 /// If set, the enum was initialized with an unknown value.
32675 ///
32676 /// Applications can examine the value using [SqlBackupRunType::value] or
32677 /// [SqlBackupRunType::name].
32678 UnknownValue(sql_backup_run_type::UnknownValue),
32679}
32680
32681#[doc(hidden)]
32682pub mod sql_backup_run_type {
32683 #[allow(unused_imports)]
32684 use super::*;
32685 #[derive(Clone, Debug, PartialEq)]
32686 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32687}
32688
32689impl SqlBackupRunType {
32690 /// Gets the enum value.
32691 ///
32692 /// Returns `None` if the enum contains an unknown value deserialized from
32693 /// the string representation of enums.
32694 pub fn value(&self) -> std::option::Option<i32> {
32695 match self {
32696 Self::Unspecified => std::option::Option::Some(0),
32697 Self::Automated => std::option::Option::Some(1),
32698 Self::OnDemand => std::option::Option::Some(2),
32699 Self::UnknownValue(u) => u.0.value(),
32700 }
32701 }
32702
32703 /// Gets the enum value as a string.
32704 ///
32705 /// Returns `None` if the enum contains an unknown value deserialized from
32706 /// the integer representation of enums.
32707 pub fn name(&self) -> std::option::Option<&str> {
32708 match self {
32709 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
32710 Self::Automated => std::option::Option::Some("AUTOMATED"),
32711 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
32712 Self::UnknownValue(u) => u.0.name(),
32713 }
32714 }
32715}
32716
32717impl std::default::Default for SqlBackupRunType {
32718 fn default() -> Self {
32719 use std::convert::From;
32720 Self::from(0)
32721 }
32722}
32723
32724impl std::fmt::Display for SqlBackupRunType {
32725 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32726 wkt::internal::display_enum(f, self.name(), self.value())
32727 }
32728}
32729
32730impl std::convert::From<i32> for SqlBackupRunType {
32731 fn from(value: i32) -> Self {
32732 match value {
32733 0 => Self::Unspecified,
32734 1 => Self::Automated,
32735 2 => Self::OnDemand,
32736 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
32737 wkt::internal::UnknownEnumValue::Integer(value),
32738 )),
32739 }
32740 }
32741}
32742
32743impl std::convert::From<&str> for SqlBackupRunType {
32744 fn from(value: &str) -> Self {
32745 use std::string::ToString;
32746 match value {
32747 "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
32748 "AUTOMATED" => Self::Automated,
32749 "ON_DEMAND" => Self::OnDemand,
32750 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
32751 wkt::internal::UnknownEnumValue::String(value.to_string()),
32752 )),
32753 }
32754 }
32755}
32756
32757impl serde::ser::Serialize for SqlBackupRunType {
32758 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32759 where
32760 S: serde::Serializer,
32761 {
32762 match self {
32763 Self::Unspecified => serializer.serialize_i32(0),
32764 Self::Automated => serializer.serialize_i32(1),
32765 Self::OnDemand => serializer.serialize_i32(2),
32766 Self::UnknownValue(u) => u.0.serialize(serializer),
32767 }
32768 }
32769}
32770
32771impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
32772 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32773 where
32774 D: serde::Deserializer<'de>,
32775 {
32776 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
32777 ".google.cloud.sql.v1.SqlBackupRunType",
32778 ))
32779 }
32780}
32781
32782///
32783/// # Working with unknown values
32784///
32785/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32786/// additional enum variants at any time. Adding new variants is not considered
32787/// a breaking change. Applications should write their code in anticipation of:
32788///
32789/// - New values appearing in future releases of the client library, **and**
32790/// - New values received dynamically, without application changes.
32791///
32792/// Please consult the [Working with enums] section in the user guide for some
32793/// guidelines.
32794///
32795/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32796#[derive(Clone, Debug, PartialEq)]
32797#[non_exhaustive]
32798pub enum SqlFlagType {
32799 /// This is an unknown flag type.
32800 Unspecified,
32801 /// Boolean type flag.
32802 Boolean,
32803 /// String type flag.
32804 String,
32805 /// Integer type flag.
32806 Integer,
32807 /// Flag type used for a server startup option.
32808 None,
32809 /// Type introduced specially for MySQL TimeZone offset. Accept a string value
32810 /// with the format [-12:59, 13:00].
32811 MysqlTimezoneOffset,
32812 /// Float type flag.
32813 Float,
32814 /// Comma-separated list of the strings in a SqlFlagType enum.
32815 RepeatedString,
32816 /// If set, the enum was initialized with an unknown value.
32817 ///
32818 /// Applications can examine the value using [SqlFlagType::value] or
32819 /// [SqlFlagType::name].
32820 UnknownValue(sql_flag_type::UnknownValue),
32821}
32822
32823#[doc(hidden)]
32824pub mod sql_flag_type {
32825 #[allow(unused_imports)]
32826 use super::*;
32827 #[derive(Clone, Debug, PartialEq)]
32828 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32829}
32830
32831impl SqlFlagType {
32832 /// Gets the enum value.
32833 ///
32834 /// Returns `None` if the enum contains an unknown value deserialized from
32835 /// the string representation of enums.
32836 pub fn value(&self) -> std::option::Option<i32> {
32837 match self {
32838 Self::Unspecified => std::option::Option::Some(0),
32839 Self::Boolean => std::option::Option::Some(1),
32840 Self::String => std::option::Option::Some(2),
32841 Self::Integer => std::option::Option::Some(3),
32842 Self::None => std::option::Option::Some(4),
32843 Self::MysqlTimezoneOffset => std::option::Option::Some(5),
32844 Self::Float => std::option::Option::Some(6),
32845 Self::RepeatedString => std::option::Option::Some(7),
32846 Self::UnknownValue(u) => u.0.value(),
32847 }
32848 }
32849
32850 /// Gets the enum value as a string.
32851 ///
32852 /// Returns `None` if the enum contains an unknown value deserialized from
32853 /// the integer representation of enums.
32854 pub fn name(&self) -> std::option::Option<&str> {
32855 match self {
32856 Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
32857 Self::Boolean => std::option::Option::Some("BOOLEAN"),
32858 Self::String => std::option::Option::Some("STRING"),
32859 Self::Integer => std::option::Option::Some("INTEGER"),
32860 Self::None => std::option::Option::Some("NONE"),
32861 Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
32862 Self::Float => std::option::Option::Some("FLOAT"),
32863 Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
32864 Self::UnknownValue(u) => u.0.name(),
32865 }
32866 }
32867}
32868
32869impl std::default::Default for SqlFlagType {
32870 fn default() -> Self {
32871 use std::convert::From;
32872 Self::from(0)
32873 }
32874}
32875
32876impl std::fmt::Display for SqlFlagType {
32877 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32878 wkt::internal::display_enum(f, self.name(), self.value())
32879 }
32880}
32881
32882impl std::convert::From<i32> for SqlFlagType {
32883 fn from(value: i32) -> Self {
32884 match value {
32885 0 => Self::Unspecified,
32886 1 => Self::Boolean,
32887 2 => Self::String,
32888 3 => Self::Integer,
32889 4 => Self::None,
32890 5 => Self::MysqlTimezoneOffset,
32891 6 => Self::Float,
32892 7 => Self::RepeatedString,
32893 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
32894 wkt::internal::UnknownEnumValue::Integer(value),
32895 )),
32896 }
32897 }
32898}
32899
32900impl std::convert::From<&str> for SqlFlagType {
32901 fn from(value: &str) -> Self {
32902 use std::string::ToString;
32903 match value {
32904 "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
32905 "BOOLEAN" => Self::Boolean,
32906 "STRING" => Self::String,
32907 "INTEGER" => Self::Integer,
32908 "NONE" => Self::None,
32909 "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
32910 "FLOAT" => Self::Float,
32911 "REPEATED_STRING" => Self::RepeatedString,
32912 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
32913 wkt::internal::UnknownEnumValue::String(value.to_string()),
32914 )),
32915 }
32916 }
32917}
32918
32919impl serde::ser::Serialize for SqlFlagType {
32920 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32921 where
32922 S: serde::Serializer,
32923 {
32924 match self {
32925 Self::Unspecified => serializer.serialize_i32(0),
32926 Self::Boolean => serializer.serialize_i32(1),
32927 Self::String => serializer.serialize_i32(2),
32928 Self::Integer => serializer.serialize_i32(3),
32929 Self::None => serializer.serialize_i32(4),
32930 Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
32931 Self::Float => serializer.serialize_i32(6),
32932 Self::RepeatedString => serializer.serialize_i32(7),
32933 Self::UnknownValue(u) => u.0.serialize(serializer),
32934 }
32935 }
32936}
32937
32938impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
32939 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32940 where
32941 D: serde::Deserializer<'de>,
32942 {
32943 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
32944 ".google.cloud.sql.v1.SqlFlagType",
32945 ))
32946 }
32947}
32948
32949/// Scopes of a flag describe where the flag is used.
32950///
32951/// # Working with unknown values
32952///
32953/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32954/// additional enum variants at any time. Adding new variants is not considered
32955/// a breaking change. Applications should write their code in anticipation of:
32956///
32957/// - New values appearing in future releases of the client library, **and**
32958/// - New values received dynamically, without application changes.
32959///
32960/// Please consult the [Working with enums] section in the user guide for some
32961/// guidelines.
32962///
32963/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
32964#[derive(Clone, Debug, PartialEq)]
32965#[non_exhaustive]
32966pub enum SqlFlagScope {
32967 /// Assume database flags if unspecified
32968 Unspecified,
32969 /// database flags
32970 Database,
32971 /// connection pool configuration flags
32972 ConnectionPool,
32973 /// If set, the enum was initialized with an unknown value.
32974 ///
32975 /// Applications can examine the value using [SqlFlagScope::value] or
32976 /// [SqlFlagScope::name].
32977 UnknownValue(sql_flag_scope::UnknownValue),
32978}
32979
32980#[doc(hidden)]
32981pub mod sql_flag_scope {
32982 #[allow(unused_imports)]
32983 use super::*;
32984 #[derive(Clone, Debug, PartialEq)]
32985 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32986}
32987
32988impl SqlFlagScope {
32989 /// Gets the enum value.
32990 ///
32991 /// Returns `None` if the enum contains an unknown value deserialized from
32992 /// the string representation of enums.
32993 pub fn value(&self) -> std::option::Option<i32> {
32994 match self {
32995 Self::Unspecified => std::option::Option::Some(0),
32996 Self::Database => std::option::Option::Some(1),
32997 Self::ConnectionPool => std::option::Option::Some(2),
32998 Self::UnknownValue(u) => u.0.value(),
32999 }
33000 }
33001
33002 /// Gets the enum value as a string.
33003 ///
33004 /// Returns `None` if the enum contains an unknown value deserialized from
33005 /// the integer representation of enums.
33006 pub fn name(&self) -> std::option::Option<&str> {
33007 match self {
33008 Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
33009 Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
33010 Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
33011 Self::UnknownValue(u) => u.0.name(),
33012 }
33013 }
33014}
33015
33016impl std::default::Default for SqlFlagScope {
33017 fn default() -> Self {
33018 use std::convert::From;
33019 Self::from(0)
33020 }
33021}
33022
33023impl std::fmt::Display for SqlFlagScope {
33024 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33025 wkt::internal::display_enum(f, self.name(), self.value())
33026 }
33027}
33028
33029impl std::convert::From<i32> for SqlFlagScope {
33030 fn from(value: i32) -> Self {
33031 match value {
33032 0 => Self::Unspecified,
33033 1 => Self::Database,
33034 2 => Self::ConnectionPool,
33035 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33036 wkt::internal::UnknownEnumValue::Integer(value),
33037 )),
33038 }
33039 }
33040}
33041
33042impl std::convert::From<&str> for SqlFlagScope {
33043 fn from(value: &str) -> Self {
33044 use std::string::ToString;
33045 match value {
33046 "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
33047 "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
33048 "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
33049 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33050 wkt::internal::UnknownEnumValue::String(value.to_string()),
33051 )),
33052 }
33053 }
33054}
33055
33056impl serde::ser::Serialize for SqlFlagScope {
33057 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33058 where
33059 S: serde::Serializer,
33060 {
33061 match self {
33062 Self::Unspecified => serializer.serialize_i32(0),
33063 Self::Database => serializer.serialize_i32(1),
33064 Self::ConnectionPool => serializer.serialize_i32(2),
33065 Self::UnknownValue(u) => u.0.serialize(serializer),
33066 }
33067 }
33068}
33069
33070impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
33071 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33072 where
33073 D: serde::Deserializer<'de>,
33074 {
33075 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
33076 ".google.cloud.sql.v1.SqlFlagScope",
33077 ))
33078 }
33079}
33080
33081/// External Sync parallel level.
33082///
33083/// # Working with unknown values
33084///
33085/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33086/// additional enum variants at any time. Adding new variants is not considered
33087/// a breaking change. Applications should write their code in anticipation of:
33088///
33089/// - New values appearing in future releases of the client library, **and**
33090/// - New values received dynamically, without application changes.
33091///
33092/// Please consult the [Working with enums] section in the user guide for some
33093/// guidelines.
33094///
33095/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33096#[derive(Clone, Debug, PartialEq)]
33097#[non_exhaustive]
33098pub enum ExternalSyncParallelLevel {
33099 /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
33100 Unspecified,
33101 /// Minimal parallel level.
33102 Min,
33103 /// Optimal parallel level.
33104 Optimal,
33105 /// Maximum parallel level.
33106 Max,
33107 /// If set, the enum was initialized with an unknown value.
33108 ///
33109 /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
33110 /// [ExternalSyncParallelLevel::name].
33111 UnknownValue(external_sync_parallel_level::UnknownValue),
33112}
33113
33114#[doc(hidden)]
33115pub mod external_sync_parallel_level {
33116 #[allow(unused_imports)]
33117 use super::*;
33118 #[derive(Clone, Debug, PartialEq)]
33119 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33120}
33121
33122impl ExternalSyncParallelLevel {
33123 /// Gets the enum value.
33124 ///
33125 /// Returns `None` if the enum contains an unknown value deserialized from
33126 /// the string representation of enums.
33127 pub fn value(&self) -> std::option::Option<i32> {
33128 match self {
33129 Self::Unspecified => std::option::Option::Some(0),
33130 Self::Min => std::option::Option::Some(1),
33131 Self::Optimal => std::option::Option::Some(2),
33132 Self::Max => std::option::Option::Some(3),
33133 Self::UnknownValue(u) => u.0.value(),
33134 }
33135 }
33136
33137 /// Gets the enum value as a string.
33138 ///
33139 /// Returns `None` if the enum contains an unknown value deserialized from
33140 /// the integer representation of enums.
33141 pub fn name(&self) -> std::option::Option<&str> {
33142 match self {
33143 Self::Unspecified => {
33144 std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
33145 }
33146 Self::Min => std::option::Option::Some("MIN"),
33147 Self::Optimal => std::option::Option::Some("OPTIMAL"),
33148 Self::Max => std::option::Option::Some("MAX"),
33149 Self::UnknownValue(u) => u.0.name(),
33150 }
33151 }
33152}
33153
33154impl std::default::Default for ExternalSyncParallelLevel {
33155 fn default() -> Self {
33156 use std::convert::From;
33157 Self::from(0)
33158 }
33159}
33160
33161impl std::fmt::Display for ExternalSyncParallelLevel {
33162 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33163 wkt::internal::display_enum(f, self.name(), self.value())
33164 }
33165}
33166
33167impl std::convert::From<i32> for ExternalSyncParallelLevel {
33168 fn from(value: i32) -> Self {
33169 match value {
33170 0 => Self::Unspecified,
33171 1 => Self::Min,
33172 2 => Self::Optimal,
33173 3 => Self::Max,
33174 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33175 wkt::internal::UnknownEnumValue::Integer(value),
33176 )),
33177 }
33178 }
33179}
33180
33181impl std::convert::From<&str> for ExternalSyncParallelLevel {
33182 fn from(value: &str) -> Self {
33183 use std::string::ToString;
33184 match value {
33185 "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
33186 "MIN" => Self::Min,
33187 "OPTIMAL" => Self::Optimal,
33188 "MAX" => Self::Max,
33189 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33190 wkt::internal::UnknownEnumValue::String(value.to_string()),
33191 )),
33192 }
33193 }
33194}
33195
33196impl serde::ser::Serialize for ExternalSyncParallelLevel {
33197 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33198 where
33199 S: serde::Serializer,
33200 {
33201 match self {
33202 Self::Unspecified => serializer.serialize_i32(0),
33203 Self::Min => serializer.serialize_i32(1),
33204 Self::Optimal => serializer.serialize_i32(2),
33205 Self::Max => serializer.serialize_i32(3),
33206 Self::UnknownValue(u) => u.0.serialize(serializer),
33207 }
33208 }
33209}
33210
33211impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
33212 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33213 where
33214 D: serde::Deserializer<'de>,
33215 {
33216 deserializer.deserialize_any(
33217 wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
33218 ".google.cloud.sql.v1.ExternalSyncParallelLevel",
33219 ),
33220 )
33221 }
33222}
33223
33224///
33225/// # Working with unknown values
33226///
33227/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33228/// additional enum variants at any time. Adding new variants is not considered
33229/// a breaking change. Applications should write their code in anticipation of:
33230///
33231/// - New values appearing in future releases of the client library, **and**
33232/// - New values received dynamically, without application changes.
33233///
33234/// Please consult the [Working with enums] section in the user guide for some
33235/// guidelines.
33236///
33237/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33238#[derive(Clone, Debug, PartialEq)]
33239#[non_exhaustive]
33240pub enum SqlInstanceType {
33241 /// This is an unknown Cloud SQL instance type.
33242 Unspecified,
33243 /// A regular Cloud SQL instance that is not replicating from a primary
33244 /// instance.
33245 CloudSqlInstance,
33246 /// An instance running on the customer's premises that is not managed by
33247 /// Cloud SQL.
33248 OnPremisesInstance,
33249 /// A Cloud SQL instance acting as a read-replica.
33250 ReadReplicaInstance,
33251 /// A Cloud SQL read pool.
33252 ReadPoolInstance,
33253 /// If set, the enum was initialized with an unknown value.
33254 ///
33255 /// Applications can examine the value using [SqlInstanceType::value] or
33256 /// [SqlInstanceType::name].
33257 UnknownValue(sql_instance_type::UnknownValue),
33258}
33259
33260#[doc(hidden)]
33261pub mod sql_instance_type {
33262 #[allow(unused_imports)]
33263 use super::*;
33264 #[derive(Clone, Debug, PartialEq)]
33265 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33266}
33267
33268impl SqlInstanceType {
33269 /// Gets the enum value.
33270 ///
33271 /// Returns `None` if the enum contains an unknown value deserialized from
33272 /// the string representation of enums.
33273 pub fn value(&self) -> std::option::Option<i32> {
33274 match self {
33275 Self::Unspecified => std::option::Option::Some(0),
33276 Self::CloudSqlInstance => std::option::Option::Some(1),
33277 Self::OnPremisesInstance => std::option::Option::Some(2),
33278 Self::ReadReplicaInstance => std::option::Option::Some(3),
33279 Self::ReadPoolInstance => std::option::Option::Some(5),
33280 Self::UnknownValue(u) => u.0.value(),
33281 }
33282 }
33283
33284 /// Gets the enum value as a string.
33285 ///
33286 /// Returns `None` if the enum contains an unknown value deserialized from
33287 /// the integer representation of enums.
33288 pub fn name(&self) -> std::option::Option<&str> {
33289 match self {
33290 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
33291 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
33292 Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
33293 Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
33294 Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
33295 Self::UnknownValue(u) => u.0.name(),
33296 }
33297 }
33298}
33299
33300impl std::default::Default for SqlInstanceType {
33301 fn default() -> Self {
33302 use std::convert::From;
33303 Self::from(0)
33304 }
33305}
33306
33307impl std::fmt::Display for SqlInstanceType {
33308 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33309 wkt::internal::display_enum(f, self.name(), self.value())
33310 }
33311}
33312
33313impl std::convert::From<i32> for SqlInstanceType {
33314 fn from(value: i32) -> Self {
33315 match value {
33316 0 => Self::Unspecified,
33317 1 => Self::CloudSqlInstance,
33318 2 => Self::OnPremisesInstance,
33319 3 => Self::ReadReplicaInstance,
33320 5 => Self::ReadPoolInstance,
33321 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33322 wkt::internal::UnknownEnumValue::Integer(value),
33323 )),
33324 }
33325 }
33326}
33327
33328impl std::convert::From<&str> for SqlInstanceType {
33329 fn from(value: &str) -> Self {
33330 use std::string::ToString;
33331 match value {
33332 "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33333 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
33334 "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
33335 "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
33336 "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
33337 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33338 wkt::internal::UnknownEnumValue::String(value.to_string()),
33339 )),
33340 }
33341 }
33342}
33343
33344impl serde::ser::Serialize for SqlInstanceType {
33345 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33346 where
33347 S: serde::Serializer,
33348 {
33349 match self {
33350 Self::Unspecified => serializer.serialize_i32(0),
33351 Self::CloudSqlInstance => serializer.serialize_i32(1),
33352 Self::OnPremisesInstance => serializer.serialize_i32(2),
33353 Self::ReadReplicaInstance => serializer.serialize_i32(3),
33354 Self::ReadPoolInstance => serializer.serialize_i32(5),
33355 Self::UnknownValue(u) => u.0.serialize(serializer),
33356 }
33357 }
33358}
33359
33360impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
33361 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33362 where
33363 D: serde::Deserializer<'de>,
33364 {
33365 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
33366 ".google.cloud.sql.v1.SqlInstanceType",
33367 ))
33368 }
33369}
33370
33371/// The suspension reason of the database instance if the state is SUSPENDED.
33372///
33373/// # Working with unknown values
33374///
33375/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33376/// additional enum variants at any time. Adding new variants is not considered
33377/// a breaking change. Applications should write their code in anticipation of:
33378///
33379/// - New values appearing in future releases of the client library, **and**
33380/// - New values received dynamically, without application changes.
33381///
33382/// Please consult the [Working with enums] section in the user guide for some
33383/// guidelines.
33384///
33385/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33386#[derive(Clone, Debug, PartialEq)]
33387#[non_exhaustive]
33388pub enum SqlSuspensionReason {
33389 /// This is an unknown suspension reason.
33390 Unspecified,
33391 /// The instance is suspended due to billing issues (for example:, account
33392 /// issue)
33393 BillingIssue,
33394 /// The instance is suspended due to illegal content (for example:, child
33395 /// pornography, copyrighted material, etc.).
33396 LegalIssue,
33397 /// The instance is causing operational issues (for example:, causing the
33398 /// database to crash).
33399 OperationalIssue,
33400 /// The KMS key used by the instance is either revoked or denied access to
33401 KmsKeyIssue,
33402 /// If set, the enum was initialized with an unknown value.
33403 ///
33404 /// Applications can examine the value using [SqlSuspensionReason::value] or
33405 /// [SqlSuspensionReason::name].
33406 UnknownValue(sql_suspension_reason::UnknownValue),
33407}
33408
33409#[doc(hidden)]
33410pub mod sql_suspension_reason {
33411 #[allow(unused_imports)]
33412 use super::*;
33413 #[derive(Clone, Debug, PartialEq)]
33414 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33415}
33416
33417impl SqlSuspensionReason {
33418 /// Gets the enum value.
33419 ///
33420 /// Returns `None` if the enum contains an unknown value deserialized from
33421 /// the string representation of enums.
33422 pub fn value(&self) -> std::option::Option<i32> {
33423 match self {
33424 Self::Unspecified => std::option::Option::Some(0),
33425 Self::BillingIssue => std::option::Option::Some(2),
33426 Self::LegalIssue => std::option::Option::Some(3),
33427 Self::OperationalIssue => std::option::Option::Some(4),
33428 Self::KmsKeyIssue => std::option::Option::Some(5),
33429 Self::UnknownValue(u) => u.0.value(),
33430 }
33431 }
33432
33433 /// Gets the enum value as a string.
33434 ///
33435 /// Returns `None` if the enum contains an unknown value deserialized from
33436 /// the integer representation of enums.
33437 pub fn name(&self) -> std::option::Option<&str> {
33438 match self {
33439 Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
33440 Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
33441 Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
33442 Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
33443 Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
33444 Self::UnknownValue(u) => u.0.name(),
33445 }
33446 }
33447}
33448
33449impl std::default::Default for SqlSuspensionReason {
33450 fn default() -> Self {
33451 use std::convert::From;
33452 Self::from(0)
33453 }
33454}
33455
33456impl std::fmt::Display for SqlSuspensionReason {
33457 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33458 wkt::internal::display_enum(f, self.name(), self.value())
33459 }
33460}
33461
33462impl std::convert::From<i32> for SqlSuspensionReason {
33463 fn from(value: i32) -> Self {
33464 match value {
33465 0 => Self::Unspecified,
33466 2 => Self::BillingIssue,
33467 3 => Self::LegalIssue,
33468 4 => Self::OperationalIssue,
33469 5 => Self::KmsKeyIssue,
33470 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33471 wkt::internal::UnknownEnumValue::Integer(value),
33472 )),
33473 }
33474 }
33475}
33476
33477impl std::convert::From<&str> for SqlSuspensionReason {
33478 fn from(value: &str) -> Self {
33479 use std::string::ToString;
33480 match value {
33481 "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
33482 "BILLING_ISSUE" => Self::BillingIssue,
33483 "LEGAL_ISSUE" => Self::LegalIssue,
33484 "OPERATIONAL_ISSUE" => Self::OperationalIssue,
33485 "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
33486 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33487 wkt::internal::UnknownEnumValue::String(value.to_string()),
33488 )),
33489 }
33490 }
33491}
33492
33493impl serde::ser::Serialize for SqlSuspensionReason {
33494 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33495 where
33496 S: serde::Serializer,
33497 {
33498 match self {
33499 Self::Unspecified => serializer.serialize_i32(0),
33500 Self::BillingIssue => serializer.serialize_i32(2),
33501 Self::LegalIssue => serializer.serialize_i32(3),
33502 Self::OperationalIssue => serializer.serialize_i32(4),
33503 Self::KmsKeyIssue => serializer.serialize_i32(5),
33504 Self::UnknownValue(u) => u.0.serialize(serializer),
33505 }
33506 }
33507}
33508
33509impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
33510 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33511 where
33512 D: serde::Deserializer<'de>,
33513 {
33514 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
33515 ".google.cloud.sql.v1.SqlSuspensionReason",
33516 ))
33517 }
33518}
33519
33520///
33521/// # Working with unknown values
33522///
33523/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33524/// additional enum variants at any time. Adding new variants is not considered
33525/// a breaking change. Applications should write their code in anticipation of:
33526///
33527/// - New values appearing in future releases of the client library, **and**
33528/// - New values received dynamically, without application changes.
33529///
33530/// Please consult the [Working with enums] section in the user guide for some
33531/// guidelines.
33532///
33533/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33534#[derive(Clone, Debug, PartialEq)]
33535#[non_exhaustive]
33536pub enum SqlFileType {
33537 /// Unknown file type.
33538 Unspecified,
33539 /// File containing SQL statements.
33540 Sql,
33541 /// File in CSV format.
33542 Csv,
33543 Bak,
33544 /// TDE certificate.
33545 Tde,
33546 /// If set, the enum was initialized with an unknown value.
33547 ///
33548 /// Applications can examine the value using [SqlFileType::value] or
33549 /// [SqlFileType::name].
33550 UnknownValue(sql_file_type::UnknownValue),
33551}
33552
33553#[doc(hidden)]
33554pub mod sql_file_type {
33555 #[allow(unused_imports)]
33556 use super::*;
33557 #[derive(Clone, Debug, PartialEq)]
33558 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33559}
33560
33561impl SqlFileType {
33562 /// Gets the enum value.
33563 ///
33564 /// Returns `None` if the enum contains an unknown value deserialized from
33565 /// the string representation of enums.
33566 pub fn value(&self) -> std::option::Option<i32> {
33567 match self {
33568 Self::Unspecified => std::option::Option::Some(0),
33569 Self::Sql => std::option::Option::Some(1),
33570 Self::Csv => std::option::Option::Some(2),
33571 Self::Bak => std::option::Option::Some(4),
33572 Self::Tde => std::option::Option::Some(8),
33573 Self::UnknownValue(u) => u.0.value(),
33574 }
33575 }
33576
33577 /// Gets the enum value as a string.
33578 ///
33579 /// Returns `None` if the enum contains an unknown value deserialized from
33580 /// the integer representation of enums.
33581 pub fn name(&self) -> std::option::Option<&str> {
33582 match self {
33583 Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
33584 Self::Sql => std::option::Option::Some("SQL"),
33585 Self::Csv => std::option::Option::Some("CSV"),
33586 Self::Bak => std::option::Option::Some("BAK"),
33587 Self::Tde => std::option::Option::Some("TDE"),
33588 Self::UnknownValue(u) => u.0.name(),
33589 }
33590 }
33591}
33592
33593impl std::default::Default for SqlFileType {
33594 fn default() -> Self {
33595 use std::convert::From;
33596 Self::from(0)
33597 }
33598}
33599
33600impl std::fmt::Display for SqlFileType {
33601 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33602 wkt::internal::display_enum(f, self.name(), self.value())
33603 }
33604}
33605
33606impl std::convert::From<i32> for SqlFileType {
33607 fn from(value: i32) -> Self {
33608 match value {
33609 0 => Self::Unspecified,
33610 1 => Self::Sql,
33611 2 => Self::Csv,
33612 4 => Self::Bak,
33613 8 => Self::Tde,
33614 _ => Self::UnknownValue(sql_file_type::UnknownValue(
33615 wkt::internal::UnknownEnumValue::Integer(value),
33616 )),
33617 }
33618 }
33619}
33620
33621impl std::convert::From<&str> for SqlFileType {
33622 fn from(value: &str) -> Self {
33623 use std::string::ToString;
33624 match value {
33625 "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
33626 "SQL" => Self::Sql,
33627 "CSV" => Self::Csv,
33628 "BAK" => Self::Bak,
33629 "TDE" => Self::Tde,
33630 _ => Self::UnknownValue(sql_file_type::UnknownValue(
33631 wkt::internal::UnknownEnumValue::String(value.to_string()),
33632 )),
33633 }
33634 }
33635}
33636
33637impl serde::ser::Serialize for SqlFileType {
33638 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33639 where
33640 S: serde::Serializer,
33641 {
33642 match self {
33643 Self::Unspecified => serializer.serialize_i32(0),
33644 Self::Sql => serializer.serialize_i32(1),
33645 Self::Csv => serializer.serialize_i32(2),
33646 Self::Bak => serializer.serialize_i32(4),
33647 Self::Tde => serializer.serialize_i32(8),
33648 Self::UnknownValue(u) => u.0.serialize(serializer),
33649 }
33650 }
33651}
33652
33653impl<'de> serde::de::Deserialize<'de> for SqlFileType {
33654 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33655 where
33656 D: serde::Deserializer<'de>,
33657 {
33658 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
33659 ".google.cloud.sql.v1.SqlFileType",
33660 ))
33661 }
33662}
33663
33664///
33665/// # Working with unknown values
33666///
33667/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33668/// additional enum variants at any time. Adding new variants is not considered
33669/// a breaking change. Applications should write their code in anticipation of:
33670///
33671/// - New values appearing in future releases of the client library, **and**
33672/// - New values received dynamically, without application changes.
33673///
33674/// Please consult the [Working with enums] section in the user guide for some
33675/// guidelines.
33676///
33677/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33678#[derive(Clone, Debug, PartialEq)]
33679#[non_exhaustive]
33680pub enum BakType {
33681 /// Default type.
33682 Unspecified,
33683 /// Full backup.
33684 Full,
33685 /// Differential backup.
33686 Diff,
33687 /// Transaction Log backup
33688 Tlog,
33689 /// If set, the enum was initialized with an unknown value.
33690 ///
33691 /// Applications can examine the value using [BakType::value] or
33692 /// [BakType::name].
33693 UnknownValue(bak_type::UnknownValue),
33694}
33695
33696#[doc(hidden)]
33697pub mod bak_type {
33698 #[allow(unused_imports)]
33699 use super::*;
33700 #[derive(Clone, Debug, PartialEq)]
33701 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33702}
33703
33704impl BakType {
33705 /// Gets the enum value.
33706 ///
33707 /// Returns `None` if the enum contains an unknown value deserialized from
33708 /// the string representation of enums.
33709 pub fn value(&self) -> std::option::Option<i32> {
33710 match self {
33711 Self::Unspecified => std::option::Option::Some(0),
33712 Self::Full => std::option::Option::Some(1),
33713 Self::Diff => std::option::Option::Some(2),
33714 Self::Tlog => std::option::Option::Some(3),
33715 Self::UnknownValue(u) => u.0.value(),
33716 }
33717 }
33718
33719 /// Gets the enum value as a string.
33720 ///
33721 /// Returns `None` if the enum contains an unknown value deserialized from
33722 /// the integer representation of enums.
33723 pub fn name(&self) -> std::option::Option<&str> {
33724 match self {
33725 Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
33726 Self::Full => std::option::Option::Some("FULL"),
33727 Self::Diff => std::option::Option::Some("DIFF"),
33728 Self::Tlog => std::option::Option::Some("TLOG"),
33729 Self::UnknownValue(u) => u.0.name(),
33730 }
33731 }
33732}
33733
33734impl std::default::Default for BakType {
33735 fn default() -> Self {
33736 use std::convert::From;
33737 Self::from(0)
33738 }
33739}
33740
33741impl std::fmt::Display for BakType {
33742 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33743 wkt::internal::display_enum(f, self.name(), self.value())
33744 }
33745}
33746
33747impl std::convert::From<i32> for BakType {
33748 fn from(value: i32) -> Self {
33749 match value {
33750 0 => Self::Unspecified,
33751 1 => Self::Full,
33752 2 => Self::Diff,
33753 3 => Self::Tlog,
33754 _ => Self::UnknownValue(bak_type::UnknownValue(
33755 wkt::internal::UnknownEnumValue::Integer(value),
33756 )),
33757 }
33758 }
33759}
33760
33761impl std::convert::From<&str> for BakType {
33762 fn from(value: &str) -> Self {
33763 use std::string::ToString;
33764 match value {
33765 "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
33766 "FULL" => Self::Full,
33767 "DIFF" => Self::Diff,
33768 "TLOG" => Self::Tlog,
33769 _ => Self::UnknownValue(bak_type::UnknownValue(
33770 wkt::internal::UnknownEnumValue::String(value.to_string()),
33771 )),
33772 }
33773 }
33774}
33775
33776impl serde::ser::Serialize for BakType {
33777 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33778 where
33779 S: serde::Serializer,
33780 {
33781 match self {
33782 Self::Unspecified => serializer.serialize_i32(0),
33783 Self::Full => serializer.serialize_i32(1),
33784 Self::Diff => serializer.serialize_i32(2),
33785 Self::Tlog => serializer.serialize_i32(3),
33786 Self::UnknownValue(u) => u.0.serialize(serializer),
33787 }
33788 }
33789}
33790
33791impl<'de> serde::de::Deserialize<'de> for BakType {
33792 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33793 where
33794 D: serde::Deserializer<'de>,
33795 {
33796 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
33797 ".google.cloud.sql.v1.BakType",
33798 ))
33799 }
33800}
33801
33802/// The type of maintenance to be performed on the instance.
33803///
33804/// # Working with unknown values
33805///
33806/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33807/// additional enum variants at any time. Adding new variants is not considered
33808/// a breaking change. Applications should write their code in anticipation of:
33809///
33810/// - New values appearing in future releases of the client library, **and**
33811/// - New values received dynamically, without application changes.
33812///
33813/// Please consult the [Working with enums] section in the user guide for some
33814/// guidelines.
33815///
33816/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33817#[derive(Clone, Debug, PartialEq)]
33818#[non_exhaustive]
33819pub enum SqlMaintenanceType {
33820 /// Maintenance type is unspecified.
33821 Unspecified,
33822 /// Indicates that a standalone instance is undergoing maintenance. The
33823 /// instance can be either a primary instance or a replica.
33824 InstanceMaintenance,
33825 /// Indicates that the primary instance and all of its replicas, including
33826 /// cascading replicas, are undergoing maintenance. Maintenance is performed on
33827 /// groups of replicas first, followed by the primary instance.
33828 ReplicaIncludedMaintenance,
33829 /// Indicates that the standalone instance is undergoing maintenance, initiated
33830 /// by self-service. The instance can be either a primary instance or a
33831 /// replica.
33832 InstanceSelfServiceMaintenance,
33833 /// Indicates that the primary instance and all of its replicas are undergoing
33834 /// maintenance, initiated by self-service. Maintenance is performed on groups
33835 /// of replicas first, followed by the primary instance.
33836 ReplicaIncludedSelfServiceMaintenance,
33837 /// If set, the enum was initialized with an unknown value.
33838 ///
33839 /// Applications can examine the value using [SqlMaintenanceType::value] or
33840 /// [SqlMaintenanceType::name].
33841 UnknownValue(sql_maintenance_type::UnknownValue),
33842}
33843
33844#[doc(hidden)]
33845pub mod sql_maintenance_type {
33846 #[allow(unused_imports)]
33847 use super::*;
33848 #[derive(Clone, Debug, PartialEq)]
33849 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33850}
33851
33852impl SqlMaintenanceType {
33853 /// Gets the enum value.
33854 ///
33855 /// Returns `None` if the enum contains an unknown value deserialized from
33856 /// the string representation of enums.
33857 pub fn value(&self) -> std::option::Option<i32> {
33858 match self {
33859 Self::Unspecified => std::option::Option::Some(0),
33860 Self::InstanceMaintenance => std::option::Option::Some(1),
33861 Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
33862 Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
33863 Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
33864 Self::UnknownValue(u) => u.0.value(),
33865 }
33866 }
33867
33868 /// Gets the enum value as a string.
33869 ///
33870 /// Returns `None` if the enum contains an unknown value deserialized from
33871 /// the integer representation of enums.
33872 pub fn name(&self) -> std::option::Option<&str> {
33873 match self {
33874 Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
33875 Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
33876 Self::ReplicaIncludedMaintenance => {
33877 std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
33878 }
33879 Self::InstanceSelfServiceMaintenance => {
33880 std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
33881 }
33882 Self::ReplicaIncludedSelfServiceMaintenance => {
33883 std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
33884 }
33885 Self::UnknownValue(u) => u.0.name(),
33886 }
33887 }
33888}
33889
33890impl std::default::Default for SqlMaintenanceType {
33891 fn default() -> Self {
33892 use std::convert::From;
33893 Self::from(0)
33894 }
33895}
33896
33897impl std::fmt::Display for SqlMaintenanceType {
33898 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33899 wkt::internal::display_enum(f, self.name(), self.value())
33900 }
33901}
33902
33903impl std::convert::From<i32> for SqlMaintenanceType {
33904 fn from(value: i32) -> Self {
33905 match value {
33906 0 => Self::Unspecified,
33907 1 => Self::InstanceMaintenance,
33908 2 => Self::ReplicaIncludedMaintenance,
33909 3 => Self::InstanceSelfServiceMaintenance,
33910 4 => Self::ReplicaIncludedSelfServiceMaintenance,
33911 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
33912 wkt::internal::UnknownEnumValue::Integer(value),
33913 )),
33914 }
33915 }
33916}
33917
33918impl std::convert::From<&str> for SqlMaintenanceType {
33919 fn from(value: &str) -> Self {
33920 use std::string::ToString;
33921 match value {
33922 "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33923 "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
33924 "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
33925 "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
33926 "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
33927 Self::ReplicaIncludedSelfServiceMaintenance
33928 }
33929 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
33930 wkt::internal::UnknownEnumValue::String(value.to_string()),
33931 )),
33932 }
33933 }
33934}
33935
33936impl serde::ser::Serialize for SqlMaintenanceType {
33937 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33938 where
33939 S: serde::Serializer,
33940 {
33941 match self {
33942 Self::Unspecified => serializer.serialize_i32(0),
33943 Self::InstanceMaintenance => serializer.serialize_i32(1),
33944 Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
33945 Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
33946 Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
33947 Self::UnknownValue(u) => u.0.serialize(serializer),
33948 }
33949 }
33950}
33951
33952impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
33953 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33954 where
33955 D: serde::Deserializer<'de>,
33956 {
33957 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
33958 ".google.cloud.sql.v1.SqlMaintenanceType",
33959 ))
33960 }
33961}
33962
33963///
33964/// # Working with unknown values
33965///
33966/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33967/// additional enum variants at any time. Adding new variants is not considered
33968/// a breaking change. Applications should write their code in anticipation of:
33969///
33970/// - New values appearing in future releases of the client library, **and**
33971/// - New values received dynamically, without application changes.
33972///
33973/// Please consult the [Working with enums] section in the user guide for some
33974/// guidelines.
33975///
33976/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
33977#[derive(Clone, Debug, PartialEq)]
33978#[non_exhaustive]
33979pub enum SqlBackendType {
33980 /// This is an unknown backend type for instance.
33981 Unspecified,
33982 /// V1 speckle instance.
33983 #[deprecated]
33984 FirstGen,
33985 /// V2 speckle instance.
33986 SecondGen,
33987 /// On premises instance.
33988 External,
33989 /// If set, the enum was initialized with an unknown value.
33990 ///
33991 /// Applications can examine the value using [SqlBackendType::value] or
33992 /// [SqlBackendType::name].
33993 UnknownValue(sql_backend_type::UnknownValue),
33994}
33995
33996#[doc(hidden)]
33997pub mod sql_backend_type {
33998 #[allow(unused_imports)]
33999 use super::*;
34000 #[derive(Clone, Debug, PartialEq)]
34001 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34002}
34003
34004impl SqlBackendType {
34005 /// Gets the enum value.
34006 ///
34007 /// Returns `None` if the enum contains an unknown value deserialized from
34008 /// the string representation of enums.
34009 pub fn value(&self) -> std::option::Option<i32> {
34010 match self {
34011 Self::Unspecified => std::option::Option::Some(0),
34012 Self::FirstGen => std::option::Option::Some(1),
34013 Self::SecondGen => std::option::Option::Some(2),
34014 Self::External => std::option::Option::Some(3),
34015 Self::UnknownValue(u) => u.0.value(),
34016 }
34017 }
34018
34019 /// Gets the enum value as a string.
34020 ///
34021 /// Returns `None` if the enum contains an unknown value deserialized from
34022 /// the integer representation of enums.
34023 pub fn name(&self) -> std::option::Option<&str> {
34024 match self {
34025 Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
34026 Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
34027 Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
34028 Self::External => std::option::Option::Some("EXTERNAL"),
34029 Self::UnknownValue(u) => u.0.name(),
34030 }
34031 }
34032}
34033
34034impl std::default::Default for SqlBackendType {
34035 fn default() -> Self {
34036 use std::convert::From;
34037 Self::from(0)
34038 }
34039}
34040
34041impl std::fmt::Display for SqlBackendType {
34042 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34043 wkt::internal::display_enum(f, self.name(), self.value())
34044 }
34045}
34046
34047impl std::convert::From<i32> for SqlBackendType {
34048 fn from(value: i32) -> Self {
34049 match value {
34050 0 => Self::Unspecified,
34051 1 => Self::FirstGen,
34052 2 => Self::SecondGen,
34053 3 => Self::External,
34054 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34055 wkt::internal::UnknownEnumValue::Integer(value),
34056 )),
34057 }
34058 }
34059}
34060
34061impl std::convert::From<&str> for SqlBackendType {
34062 fn from(value: &str) -> Self {
34063 use std::string::ToString;
34064 match value {
34065 "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
34066 "FIRST_GEN" => Self::FirstGen,
34067 "SECOND_GEN" => Self::SecondGen,
34068 "EXTERNAL" => Self::External,
34069 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34070 wkt::internal::UnknownEnumValue::String(value.to_string()),
34071 )),
34072 }
34073 }
34074}
34075
34076impl serde::ser::Serialize for SqlBackendType {
34077 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34078 where
34079 S: serde::Serializer,
34080 {
34081 match self {
34082 Self::Unspecified => serializer.serialize_i32(0),
34083 Self::FirstGen => serializer.serialize_i32(1),
34084 Self::SecondGen => serializer.serialize_i32(2),
34085 Self::External => serializer.serialize_i32(3),
34086 Self::UnknownValue(u) => u.0.serialize(serializer),
34087 }
34088 }
34089}
34090
34091impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
34092 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34093 where
34094 D: serde::Deserializer<'de>,
34095 {
34096 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
34097 ".google.cloud.sql.v1.SqlBackendType",
34098 ))
34099 }
34100}
34101
34102///
34103/// # Working with unknown values
34104///
34105/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34106/// additional enum variants at any time. Adding new variants is not considered
34107/// a breaking change. Applications should write their code in anticipation of:
34108///
34109/// - New values appearing in future releases of the client library, **and**
34110/// - New values received dynamically, without application changes.
34111///
34112/// Please consult the [Working with enums] section in the user guide for some
34113/// guidelines.
34114///
34115/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34116#[derive(Clone, Debug, PartialEq)]
34117#[non_exhaustive]
34118pub enum SqlIpAddressType {
34119 /// This is an unknown IP address type.
34120 Unspecified,
34121 /// IP address the customer is supposed to connect to. Usually this is the
34122 /// load balancer's IP address
34123 Primary,
34124 /// Source IP address of the connection a read replica establishes to its
34125 /// external primary instance. This IP address can be allowlisted by the
34126 /// customer in case it has a firewall that filters incoming connection to its
34127 /// on premises primary instance.
34128 Outgoing,
34129 /// Private IP used when using private IPs and network peering.
34130 Private,
34131 /// V1 IP of a migrated instance. We want the user to
34132 /// decommission this IP as soon as the migration is complete.
34133 /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
34134 Migrated1StGen,
34135 /// If set, the enum was initialized with an unknown value.
34136 ///
34137 /// Applications can examine the value using [SqlIpAddressType::value] or
34138 /// [SqlIpAddressType::name].
34139 UnknownValue(sql_ip_address_type::UnknownValue),
34140}
34141
34142#[doc(hidden)]
34143pub mod sql_ip_address_type {
34144 #[allow(unused_imports)]
34145 use super::*;
34146 #[derive(Clone, Debug, PartialEq)]
34147 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34148}
34149
34150impl SqlIpAddressType {
34151 /// Gets the enum value.
34152 ///
34153 /// Returns `None` if the enum contains an unknown value deserialized from
34154 /// the string representation of enums.
34155 pub fn value(&self) -> std::option::Option<i32> {
34156 match self {
34157 Self::Unspecified => std::option::Option::Some(0),
34158 Self::Primary => std::option::Option::Some(1),
34159 Self::Outgoing => std::option::Option::Some(2),
34160 Self::Private => std::option::Option::Some(3),
34161 Self::Migrated1StGen => std::option::Option::Some(4),
34162 Self::UnknownValue(u) => u.0.value(),
34163 }
34164 }
34165
34166 /// Gets the enum value as a string.
34167 ///
34168 /// Returns `None` if the enum contains an unknown value deserialized from
34169 /// the integer representation of enums.
34170 pub fn name(&self) -> std::option::Option<&str> {
34171 match self {
34172 Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
34173 Self::Primary => std::option::Option::Some("PRIMARY"),
34174 Self::Outgoing => std::option::Option::Some("OUTGOING"),
34175 Self::Private => std::option::Option::Some("PRIVATE"),
34176 Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
34177 Self::UnknownValue(u) => u.0.name(),
34178 }
34179 }
34180}
34181
34182impl std::default::Default for SqlIpAddressType {
34183 fn default() -> Self {
34184 use std::convert::From;
34185 Self::from(0)
34186 }
34187}
34188
34189impl std::fmt::Display for SqlIpAddressType {
34190 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34191 wkt::internal::display_enum(f, self.name(), self.value())
34192 }
34193}
34194
34195impl std::convert::From<i32> for SqlIpAddressType {
34196 fn from(value: i32) -> Self {
34197 match value {
34198 0 => Self::Unspecified,
34199 1 => Self::Primary,
34200 2 => Self::Outgoing,
34201 3 => Self::Private,
34202 4 => Self::Migrated1StGen,
34203 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34204 wkt::internal::UnknownEnumValue::Integer(value),
34205 )),
34206 }
34207 }
34208}
34209
34210impl std::convert::From<&str> for SqlIpAddressType {
34211 fn from(value: &str) -> Self {
34212 use std::string::ToString;
34213 match value {
34214 "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
34215 "PRIMARY" => Self::Primary,
34216 "OUTGOING" => Self::Outgoing,
34217 "PRIVATE" => Self::Private,
34218 "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
34219 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34220 wkt::internal::UnknownEnumValue::String(value.to_string()),
34221 )),
34222 }
34223 }
34224}
34225
34226impl serde::ser::Serialize for SqlIpAddressType {
34227 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34228 where
34229 S: serde::Serializer,
34230 {
34231 match self {
34232 Self::Unspecified => serializer.serialize_i32(0),
34233 Self::Primary => serializer.serialize_i32(1),
34234 Self::Outgoing => serializer.serialize_i32(2),
34235 Self::Private => serializer.serialize_i32(3),
34236 Self::Migrated1StGen => serializer.serialize_i32(4),
34237 Self::UnknownValue(u) => u.0.serialize(serializer),
34238 }
34239 }
34240}
34241
34242impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
34243 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34244 where
34245 D: serde::Deserializer<'de>,
34246 {
34247 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
34248 ".google.cloud.sql.v1.SqlIpAddressType",
34249 ))
34250 }
34251}
34252
34253/// The database engine type and version.
34254///
34255/// # Working with unknown values
34256///
34257/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34258/// additional enum variants at any time. Adding new variants is not considered
34259/// a breaking change. Applications should write their code in anticipation of:
34260///
34261/// - New values appearing in future releases of the client library, **and**
34262/// - New values received dynamically, without application changes.
34263///
34264/// Please consult the [Working with enums] section in the user guide for some
34265/// guidelines.
34266///
34267/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34268#[derive(Clone, Debug, PartialEq)]
34269#[non_exhaustive]
34270pub enum SqlDatabaseVersion {
34271 /// This is an unknown database version.
34272 Unspecified,
34273 /// The database version is MySQL 5.1.
34274 #[deprecated]
34275 Mysql51,
34276 /// The database version is MySQL 5.5.
34277 #[deprecated]
34278 Mysql55,
34279 /// The database version is MySQL 5.6.
34280 Mysql56,
34281 /// The database version is MySQL 5.7.
34282 Mysql57,
34283 /// The database version is MySQL 8.
34284 Mysql80,
34285 /// The database major version is MySQL 8.0 and the minor version is 18.
34286 Mysql8018,
34287 /// The database major version is MySQL 8.0 and the minor version is 26.
34288 Mysql8026,
34289 /// The database major version is MySQL 8.0 and the minor version is 27.
34290 Mysql8027,
34291 /// The database major version is MySQL 8.0 and the minor version is 28.
34292 Mysql8028,
34293 /// The database major version is MySQL 8.0 and the minor version is 29.
34294 #[deprecated]
34295 Mysql8029,
34296 /// The database major version is MySQL 8.0 and the minor version is 30.
34297 Mysql8030,
34298 /// The database major version is MySQL 8.0 and the minor version is 31.
34299 Mysql8031,
34300 /// The database major version is MySQL 8.0 and the minor version is 32.
34301 Mysql8032,
34302 /// The database major version is MySQL 8.0 and the minor version is 33.
34303 Mysql8033,
34304 /// The database major version is MySQL 8.0 and the minor version is 34.
34305 Mysql8034,
34306 /// The database major version is MySQL 8.0 and the minor version is 35.
34307 Mysql8035,
34308 /// The database major version is MySQL 8.0 and the minor version is 36.
34309 Mysql8036,
34310 /// The database major version is MySQL 8.0 and the minor version is 37.
34311 Mysql8037,
34312 /// The database major version is MySQL 8.0 and the minor version is 39.
34313 Mysql8039,
34314 /// The database major version is MySQL 8.0 and the minor version is 40.
34315 Mysql8040,
34316 /// The database major version is MySQL 8.0 and the minor version is 41.
34317 Mysql8041,
34318 /// The database major version is MySQL 8.0 and the minor version is 42.
34319 Mysql8042,
34320 /// The database major version is MySQL 8.0 and the minor version is 43.
34321 Mysql8043,
34322 /// The database major version is MySQL 8.0 and the minor version is 44.
34323 Mysql8044,
34324 /// The database major version is MySQL 8.0 and the minor version is 45.
34325 Mysql8045,
34326 /// The database major version is MySQL 8.0 and the minor version is 46.
34327 Mysql8046,
34328 /// The database version is MySQL 8.4.
34329 Mysql84,
34330 /// The database version is MySQL 9.7.
34331 Mysql97,
34332 /// The database version is SQL Server 2017 Standard.
34333 Sqlserver2017Standard,
34334 /// The database version is SQL Server 2017 Enterprise.
34335 Sqlserver2017Enterprise,
34336 /// The database version is SQL Server 2017 Express.
34337 Sqlserver2017Express,
34338 /// The database version is SQL Server 2017 Web.
34339 Sqlserver2017Web,
34340 /// The database version is PostgreSQL 9.6.
34341 Postgres96,
34342 /// The database version is PostgreSQL 10.
34343 Postgres10,
34344 /// The database version is PostgreSQL 11.
34345 Postgres11,
34346 /// The database version is PostgreSQL 12.
34347 Postgres12,
34348 /// The database version is PostgreSQL 13.
34349 Postgres13,
34350 /// The database version is PostgreSQL 14.
34351 Postgres14,
34352 /// The database version is PostgreSQL 15.
34353 Postgres15,
34354 /// The database version is PostgreSQL 16.
34355 Postgres16,
34356 /// The database version is PostgreSQL 17.
34357 Postgres17,
34358 /// The database version is PostgreSQL 18.
34359 Postgres18,
34360 /// The database version is SQL Server 2019 Standard.
34361 Sqlserver2019Standard,
34362 /// The database version is SQL Server 2019 Enterprise.
34363 Sqlserver2019Enterprise,
34364 /// The database version is SQL Server 2019 Express.
34365 Sqlserver2019Express,
34366 /// The database version is SQL Server 2019 Web.
34367 Sqlserver2019Web,
34368 /// The database version is SQL Server 2022 Standard.
34369 Sqlserver2022Standard,
34370 /// The database version is SQL Server 2022 Enterprise.
34371 Sqlserver2022Enterprise,
34372 /// The database version is SQL Server 2022 Express.
34373 Sqlserver2022Express,
34374 /// The database version is SQL Server 2022 Web.
34375 Sqlserver2022Web,
34376 /// If set, the enum was initialized with an unknown value.
34377 ///
34378 /// Applications can examine the value using [SqlDatabaseVersion::value] or
34379 /// [SqlDatabaseVersion::name].
34380 UnknownValue(sql_database_version::UnknownValue),
34381}
34382
34383#[doc(hidden)]
34384pub mod sql_database_version {
34385 #[allow(unused_imports)]
34386 use super::*;
34387 #[derive(Clone, Debug, PartialEq)]
34388 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34389}
34390
34391impl SqlDatabaseVersion {
34392 /// Gets the enum value.
34393 ///
34394 /// Returns `None` if the enum contains an unknown value deserialized from
34395 /// the string representation of enums.
34396 pub fn value(&self) -> std::option::Option<i32> {
34397 match self {
34398 Self::Unspecified => std::option::Option::Some(0),
34399 Self::Mysql51 => std::option::Option::Some(2),
34400 Self::Mysql55 => std::option::Option::Some(3),
34401 Self::Mysql56 => std::option::Option::Some(5),
34402 Self::Mysql57 => std::option::Option::Some(6),
34403 Self::Mysql80 => std::option::Option::Some(20),
34404 Self::Mysql8018 => std::option::Option::Some(41),
34405 Self::Mysql8026 => std::option::Option::Some(85),
34406 Self::Mysql8027 => std::option::Option::Some(111),
34407 Self::Mysql8028 => std::option::Option::Some(132),
34408 Self::Mysql8029 => std::option::Option::Some(148),
34409 Self::Mysql8030 => std::option::Option::Some(174),
34410 Self::Mysql8031 => std::option::Option::Some(197),
34411 Self::Mysql8032 => std::option::Option::Some(213),
34412 Self::Mysql8033 => std::option::Option::Some(238),
34413 Self::Mysql8034 => std::option::Option::Some(239),
34414 Self::Mysql8035 => std::option::Option::Some(240),
34415 Self::Mysql8036 => std::option::Option::Some(241),
34416 Self::Mysql8037 => std::option::Option::Some(355),
34417 Self::Mysql8039 => std::option::Option::Some(357),
34418 Self::Mysql8040 => std::option::Option::Some(358),
34419 Self::Mysql8041 => std::option::Option::Some(488),
34420 Self::Mysql8042 => std::option::Option::Some(489),
34421 Self::Mysql8043 => std::option::Option::Some(553),
34422 Self::Mysql8044 => std::option::Option::Some(554),
34423 Self::Mysql8045 => std::option::Option::Some(555),
34424 Self::Mysql8046 => std::option::Option::Some(556),
34425 Self::Mysql84 => std::option::Option::Some(398),
34426 Self::Mysql97 => std::option::Option::Some(654),
34427 Self::Sqlserver2017Standard => std::option::Option::Some(11),
34428 Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
34429 Self::Sqlserver2017Express => std::option::Option::Some(15),
34430 Self::Sqlserver2017Web => std::option::Option::Some(16),
34431 Self::Postgres96 => std::option::Option::Some(9),
34432 Self::Postgres10 => std::option::Option::Some(18),
34433 Self::Postgres11 => std::option::Option::Some(10),
34434 Self::Postgres12 => std::option::Option::Some(19),
34435 Self::Postgres13 => std::option::Option::Some(23),
34436 Self::Postgres14 => std::option::Option::Some(110),
34437 Self::Postgres15 => std::option::Option::Some(172),
34438 Self::Postgres16 => std::option::Option::Some(272),
34439 Self::Postgres17 => std::option::Option::Some(408),
34440 Self::Postgres18 => std::option::Option::Some(557),
34441 Self::Sqlserver2019Standard => std::option::Option::Some(26),
34442 Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
34443 Self::Sqlserver2019Express => std::option::Option::Some(28),
34444 Self::Sqlserver2019Web => std::option::Option::Some(29),
34445 Self::Sqlserver2022Standard => std::option::Option::Some(199),
34446 Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
34447 Self::Sqlserver2022Express => std::option::Option::Some(201),
34448 Self::Sqlserver2022Web => std::option::Option::Some(202),
34449 Self::UnknownValue(u) => u.0.value(),
34450 }
34451 }
34452
34453 /// Gets the enum value as a string.
34454 ///
34455 /// Returns `None` if the enum contains an unknown value deserialized from
34456 /// the integer representation of enums.
34457 pub fn name(&self) -> std::option::Option<&str> {
34458 match self {
34459 Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
34460 Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
34461 Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
34462 Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
34463 Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
34464 Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
34465 Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
34466 Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
34467 Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
34468 Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
34469 Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
34470 Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
34471 Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
34472 Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
34473 Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
34474 Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
34475 Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
34476 Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
34477 Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
34478 Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
34479 Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
34480 Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
34481 Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
34482 Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
34483 Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
34484 Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
34485 Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
34486 Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
34487 Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
34488 Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
34489 Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
34490 Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
34491 Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
34492 Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
34493 Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
34494 Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
34495 Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
34496 Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
34497 Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
34498 Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
34499 Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
34500 Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
34501 Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
34502 Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
34503 Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
34504 Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
34505 Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
34506 Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
34507 Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
34508 Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
34509 Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
34510 Self::UnknownValue(u) => u.0.name(),
34511 }
34512 }
34513}
34514
34515impl std::default::Default for SqlDatabaseVersion {
34516 fn default() -> Self {
34517 use std::convert::From;
34518 Self::from(0)
34519 }
34520}
34521
34522impl std::fmt::Display for SqlDatabaseVersion {
34523 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34524 wkt::internal::display_enum(f, self.name(), self.value())
34525 }
34526}
34527
34528impl std::convert::From<i32> for SqlDatabaseVersion {
34529 fn from(value: i32) -> Self {
34530 match value {
34531 0 => Self::Unspecified,
34532 2 => Self::Mysql51,
34533 3 => Self::Mysql55,
34534 5 => Self::Mysql56,
34535 6 => Self::Mysql57,
34536 9 => Self::Postgres96,
34537 10 => Self::Postgres11,
34538 11 => Self::Sqlserver2017Standard,
34539 14 => Self::Sqlserver2017Enterprise,
34540 15 => Self::Sqlserver2017Express,
34541 16 => Self::Sqlserver2017Web,
34542 18 => Self::Postgres10,
34543 19 => Self::Postgres12,
34544 20 => Self::Mysql80,
34545 23 => Self::Postgres13,
34546 26 => Self::Sqlserver2019Standard,
34547 27 => Self::Sqlserver2019Enterprise,
34548 28 => Self::Sqlserver2019Express,
34549 29 => Self::Sqlserver2019Web,
34550 41 => Self::Mysql8018,
34551 85 => Self::Mysql8026,
34552 110 => Self::Postgres14,
34553 111 => Self::Mysql8027,
34554 132 => Self::Mysql8028,
34555 148 => Self::Mysql8029,
34556 172 => Self::Postgres15,
34557 174 => Self::Mysql8030,
34558 197 => Self::Mysql8031,
34559 199 => Self::Sqlserver2022Standard,
34560 200 => Self::Sqlserver2022Enterprise,
34561 201 => Self::Sqlserver2022Express,
34562 202 => Self::Sqlserver2022Web,
34563 213 => Self::Mysql8032,
34564 238 => Self::Mysql8033,
34565 239 => Self::Mysql8034,
34566 240 => Self::Mysql8035,
34567 241 => Self::Mysql8036,
34568 272 => Self::Postgres16,
34569 355 => Self::Mysql8037,
34570 357 => Self::Mysql8039,
34571 358 => Self::Mysql8040,
34572 398 => Self::Mysql84,
34573 408 => Self::Postgres17,
34574 488 => Self::Mysql8041,
34575 489 => Self::Mysql8042,
34576 553 => Self::Mysql8043,
34577 554 => Self::Mysql8044,
34578 555 => Self::Mysql8045,
34579 556 => Self::Mysql8046,
34580 557 => Self::Postgres18,
34581 654 => Self::Mysql97,
34582 _ => Self::UnknownValue(sql_database_version::UnknownValue(
34583 wkt::internal::UnknownEnumValue::Integer(value),
34584 )),
34585 }
34586 }
34587}
34588
34589impl std::convert::From<&str> for SqlDatabaseVersion {
34590 fn from(value: &str) -> Self {
34591 use std::string::ToString;
34592 match value {
34593 "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
34594 "MYSQL_5_1" => Self::Mysql51,
34595 "MYSQL_5_5" => Self::Mysql55,
34596 "MYSQL_5_6" => Self::Mysql56,
34597 "MYSQL_5_7" => Self::Mysql57,
34598 "MYSQL_8_0" => Self::Mysql80,
34599 "MYSQL_8_0_18" => Self::Mysql8018,
34600 "MYSQL_8_0_26" => Self::Mysql8026,
34601 "MYSQL_8_0_27" => Self::Mysql8027,
34602 "MYSQL_8_0_28" => Self::Mysql8028,
34603 "MYSQL_8_0_29" => Self::Mysql8029,
34604 "MYSQL_8_0_30" => Self::Mysql8030,
34605 "MYSQL_8_0_31" => Self::Mysql8031,
34606 "MYSQL_8_0_32" => Self::Mysql8032,
34607 "MYSQL_8_0_33" => Self::Mysql8033,
34608 "MYSQL_8_0_34" => Self::Mysql8034,
34609 "MYSQL_8_0_35" => Self::Mysql8035,
34610 "MYSQL_8_0_36" => Self::Mysql8036,
34611 "MYSQL_8_0_37" => Self::Mysql8037,
34612 "MYSQL_8_0_39" => Self::Mysql8039,
34613 "MYSQL_8_0_40" => Self::Mysql8040,
34614 "MYSQL_8_0_41" => Self::Mysql8041,
34615 "MYSQL_8_0_42" => Self::Mysql8042,
34616 "MYSQL_8_0_43" => Self::Mysql8043,
34617 "MYSQL_8_0_44" => Self::Mysql8044,
34618 "MYSQL_8_0_45" => Self::Mysql8045,
34619 "MYSQL_8_0_46" => Self::Mysql8046,
34620 "MYSQL_8_4" => Self::Mysql84,
34621 "MYSQL_9_7" => Self::Mysql97,
34622 "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
34623 "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
34624 "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
34625 "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
34626 "POSTGRES_9_6" => Self::Postgres96,
34627 "POSTGRES_10" => Self::Postgres10,
34628 "POSTGRES_11" => Self::Postgres11,
34629 "POSTGRES_12" => Self::Postgres12,
34630 "POSTGRES_13" => Self::Postgres13,
34631 "POSTGRES_14" => Self::Postgres14,
34632 "POSTGRES_15" => Self::Postgres15,
34633 "POSTGRES_16" => Self::Postgres16,
34634 "POSTGRES_17" => Self::Postgres17,
34635 "POSTGRES_18" => Self::Postgres18,
34636 "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
34637 "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
34638 "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
34639 "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
34640 "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
34641 "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
34642 "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
34643 "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
34644 _ => Self::UnknownValue(sql_database_version::UnknownValue(
34645 wkt::internal::UnknownEnumValue::String(value.to_string()),
34646 )),
34647 }
34648 }
34649}
34650
34651impl serde::ser::Serialize for SqlDatabaseVersion {
34652 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34653 where
34654 S: serde::Serializer,
34655 {
34656 match self {
34657 Self::Unspecified => serializer.serialize_i32(0),
34658 Self::Mysql51 => serializer.serialize_i32(2),
34659 Self::Mysql55 => serializer.serialize_i32(3),
34660 Self::Mysql56 => serializer.serialize_i32(5),
34661 Self::Mysql57 => serializer.serialize_i32(6),
34662 Self::Mysql80 => serializer.serialize_i32(20),
34663 Self::Mysql8018 => serializer.serialize_i32(41),
34664 Self::Mysql8026 => serializer.serialize_i32(85),
34665 Self::Mysql8027 => serializer.serialize_i32(111),
34666 Self::Mysql8028 => serializer.serialize_i32(132),
34667 Self::Mysql8029 => serializer.serialize_i32(148),
34668 Self::Mysql8030 => serializer.serialize_i32(174),
34669 Self::Mysql8031 => serializer.serialize_i32(197),
34670 Self::Mysql8032 => serializer.serialize_i32(213),
34671 Self::Mysql8033 => serializer.serialize_i32(238),
34672 Self::Mysql8034 => serializer.serialize_i32(239),
34673 Self::Mysql8035 => serializer.serialize_i32(240),
34674 Self::Mysql8036 => serializer.serialize_i32(241),
34675 Self::Mysql8037 => serializer.serialize_i32(355),
34676 Self::Mysql8039 => serializer.serialize_i32(357),
34677 Self::Mysql8040 => serializer.serialize_i32(358),
34678 Self::Mysql8041 => serializer.serialize_i32(488),
34679 Self::Mysql8042 => serializer.serialize_i32(489),
34680 Self::Mysql8043 => serializer.serialize_i32(553),
34681 Self::Mysql8044 => serializer.serialize_i32(554),
34682 Self::Mysql8045 => serializer.serialize_i32(555),
34683 Self::Mysql8046 => serializer.serialize_i32(556),
34684 Self::Mysql84 => serializer.serialize_i32(398),
34685 Self::Mysql97 => serializer.serialize_i32(654),
34686 Self::Sqlserver2017Standard => serializer.serialize_i32(11),
34687 Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
34688 Self::Sqlserver2017Express => serializer.serialize_i32(15),
34689 Self::Sqlserver2017Web => serializer.serialize_i32(16),
34690 Self::Postgres96 => serializer.serialize_i32(9),
34691 Self::Postgres10 => serializer.serialize_i32(18),
34692 Self::Postgres11 => serializer.serialize_i32(10),
34693 Self::Postgres12 => serializer.serialize_i32(19),
34694 Self::Postgres13 => serializer.serialize_i32(23),
34695 Self::Postgres14 => serializer.serialize_i32(110),
34696 Self::Postgres15 => serializer.serialize_i32(172),
34697 Self::Postgres16 => serializer.serialize_i32(272),
34698 Self::Postgres17 => serializer.serialize_i32(408),
34699 Self::Postgres18 => serializer.serialize_i32(557),
34700 Self::Sqlserver2019Standard => serializer.serialize_i32(26),
34701 Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
34702 Self::Sqlserver2019Express => serializer.serialize_i32(28),
34703 Self::Sqlserver2019Web => serializer.serialize_i32(29),
34704 Self::Sqlserver2022Standard => serializer.serialize_i32(199),
34705 Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
34706 Self::Sqlserver2022Express => serializer.serialize_i32(201),
34707 Self::Sqlserver2022Web => serializer.serialize_i32(202),
34708 Self::UnknownValue(u) => u.0.serialize(serializer),
34709 }
34710 }
34711}
34712
34713impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
34714 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34715 where
34716 D: serde::Deserializer<'de>,
34717 {
34718 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
34719 ".google.cloud.sql.v1.SqlDatabaseVersion",
34720 ))
34721 }
34722}
34723
34724/// The pricing plan for this instance.
34725///
34726/// # Working with unknown values
34727///
34728/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34729/// additional enum variants at any time. Adding new variants is not considered
34730/// a breaking change. Applications should write their code in anticipation of:
34731///
34732/// - New values appearing in future releases of the client library, **and**
34733/// - New values received dynamically, without application changes.
34734///
34735/// Please consult the [Working with enums] section in the user guide for some
34736/// guidelines.
34737///
34738/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34739#[derive(Clone, Debug, PartialEq)]
34740#[non_exhaustive]
34741pub enum SqlPricingPlan {
34742 /// This is an unknown pricing plan for this instance.
34743 Unspecified,
34744 /// The instance is billed at a monthly flat rate.
34745 Package,
34746 /// The instance is billed per usage.
34747 PerUse,
34748 /// If set, the enum was initialized with an unknown value.
34749 ///
34750 /// Applications can examine the value using [SqlPricingPlan::value] or
34751 /// [SqlPricingPlan::name].
34752 UnknownValue(sql_pricing_plan::UnknownValue),
34753}
34754
34755#[doc(hidden)]
34756pub mod sql_pricing_plan {
34757 #[allow(unused_imports)]
34758 use super::*;
34759 #[derive(Clone, Debug, PartialEq)]
34760 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34761}
34762
34763impl SqlPricingPlan {
34764 /// Gets the enum value.
34765 ///
34766 /// Returns `None` if the enum contains an unknown value deserialized from
34767 /// the string representation of enums.
34768 pub fn value(&self) -> std::option::Option<i32> {
34769 match self {
34770 Self::Unspecified => std::option::Option::Some(0),
34771 Self::Package => std::option::Option::Some(1),
34772 Self::PerUse => std::option::Option::Some(2),
34773 Self::UnknownValue(u) => u.0.value(),
34774 }
34775 }
34776
34777 /// Gets the enum value as a string.
34778 ///
34779 /// Returns `None` if the enum contains an unknown value deserialized from
34780 /// the integer representation of enums.
34781 pub fn name(&self) -> std::option::Option<&str> {
34782 match self {
34783 Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
34784 Self::Package => std::option::Option::Some("PACKAGE"),
34785 Self::PerUse => std::option::Option::Some("PER_USE"),
34786 Self::UnknownValue(u) => u.0.name(),
34787 }
34788 }
34789}
34790
34791impl std::default::Default for SqlPricingPlan {
34792 fn default() -> Self {
34793 use std::convert::From;
34794 Self::from(0)
34795 }
34796}
34797
34798impl std::fmt::Display for SqlPricingPlan {
34799 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34800 wkt::internal::display_enum(f, self.name(), self.value())
34801 }
34802}
34803
34804impl std::convert::From<i32> for SqlPricingPlan {
34805 fn from(value: i32) -> Self {
34806 match value {
34807 0 => Self::Unspecified,
34808 1 => Self::Package,
34809 2 => Self::PerUse,
34810 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
34811 wkt::internal::UnknownEnumValue::Integer(value),
34812 )),
34813 }
34814 }
34815}
34816
34817impl std::convert::From<&str> for SqlPricingPlan {
34818 fn from(value: &str) -> Self {
34819 use std::string::ToString;
34820 match value {
34821 "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
34822 "PACKAGE" => Self::Package,
34823 "PER_USE" => Self::PerUse,
34824 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
34825 wkt::internal::UnknownEnumValue::String(value.to_string()),
34826 )),
34827 }
34828 }
34829}
34830
34831impl serde::ser::Serialize for SqlPricingPlan {
34832 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34833 where
34834 S: serde::Serializer,
34835 {
34836 match self {
34837 Self::Unspecified => serializer.serialize_i32(0),
34838 Self::Package => serializer.serialize_i32(1),
34839 Self::PerUse => serializer.serialize_i32(2),
34840 Self::UnknownValue(u) => u.0.serialize(serializer),
34841 }
34842 }
34843}
34844
34845impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
34846 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34847 where
34848 D: serde::Deserializer<'de>,
34849 {
34850 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
34851 ".google.cloud.sql.v1.SqlPricingPlan",
34852 ))
34853 }
34854}
34855
34856///
34857/// # Working with unknown values
34858///
34859/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34860/// additional enum variants at any time. Adding new variants is not considered
34861/// a breaking change. Applications should write their code in anticipation of:
34862///
34863/// - New values appearing in future releases of the client library, **and**
34864/// - New values received dynamically, without application changes.
34865///
34866/// Please consult the [Working with enums] section in the user guide for some
34867/// guidelines.
34868///
34869/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
34870#[derive(Clone, Debug, PartialEq)]
34871#[non_exhaustive]
34872pub enum SqlReplicationType {
34873 /// This is an unknown replication type for a Cloud SQL instance.
34874 Unspecified,
34875 /// The synchronous replication mode for First Generation instances. It is the
34876 /// default value.
34877 Synchronous,
34878 /// The asynchronous replication mode for First Generation instances. It
34879 /// provides a slight performance gain, but if an outage occurs while this
34880 /// option is set to asynchronous, you can lose up to a few seconds of updates
34881 /// to your data.
34882 Asynchronous,
34883 /// If set, the enum was initialized with an unknown value.
34884 ///
34885 /// Applications can examine the value using [SqlReplicationType::value] or
34886 /// [SqlReplicationType::name].
34887 UnknownValue(sql_replication_type::UnknownValue),
34888}
34889
34890#[doc(hidden)]
34891pub mod sql_replication_type {
34892 #[allow(unused_imports)]
34893 use super::*;
34894 #[derive(Clone, Debug, PartialEq)]
34895 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34896}
34897
34898impl SqlReplicationType {
34899 /// Gets the enum value.
34900 ///
34901 /// Returns `None` if the enum contains an unknown value deserialized from
34902 /// the string representation of enums.
34903 pub fn value(&self) -> std::option::Option<i32> {
34904 match self {
34905 Self::Unspecified => std::option::Option::Some(0),
34906 Self::Synchronous => std::option::Option::Some(1),
34907 Self::Asynchronous => std::option::Option::Some(2),
34908 Self::UnknownValue(u) => u.0.value(),
34909 }
34910 }
34911
34912 /// Gets the enum value as a string.
34913 ///
34914 /// Returns `None` if the enum contains an unknown value deserialized from
34915 /// the integer representation of enums.
34916 pub fn name(&self) -> std::option::Option<&str> {
34917 match self {
34918 Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
34919 Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
34920 Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
34921 Self::UnknownValue(u) => u.0.name(),
34922 }
34923 }
34924}
34925
34926impl std::default::Default for SqlReplicationType {
34927 fn default() -> Self {
34928 use std::convert::From;
34929 Self::from(0)
34930 }
34931}
34932
34933impl std::fmt::Display for SqlReplicationType {
34934 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34935 wkt::internal::display_enum(f, self.name(), self.value())
34936 }
34937}
34938
34939impl std::convert::From<i32> for SqlReplicationType {
34940 fn from(value: i32) -> Self {
34941 match value {
34942 0 => Self::Unspecified,
34943 1 => Self::Synchronous,
34944 2 => Self::Asynchronous,
34945 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
34946 wkt::internal::UnknownEnumValue::Integer(value),
34947 )),
34948 }
34949 }
34950}
34951
34952impl std::convert::From<&str> for SqlReplicationType {
34953 fn from(value: &str) -> Self {
34954 use std::string::ToString;
34955 match value {
34956 "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
34957 "SYNCHRONOUS" => Self::Synchronous,
34958 "ASYNCHRONOUS" => Self::Asynchronous,
34959 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
34960 wkt::internal::UnknownEnumValue::String(value.to_string()),
34961 )),
34962 }
34963 }
34964}
34965
34966impl serde::ser::Serialize for SqlReplicationType {
34967 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34968 where
34969 S: serde::Serializer,
34970 {
34971 match self {
34972 Self::Unspecified => serializer.serialize_i32(0),
34973 Self::Synchronous => serializer.serialize_i32(1),
34974 Self::Asynchronous => serializer.serialize_i32(2),
34975 Self::UnknownValue(u) => u.0.serialize(serializer),
34976 }
34977 }
34978}
34979
34980impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
34981 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34982 where
34983 D: serde::Deserializer<'de>,
34984 {
34985 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
34986 ".google.cloud.sql.v1.SqlReplicationType",
34987 ))
34988 }
34989}
34990
34991/// The type of disk that is used for a v2 instance to use.
34992///
34993/// # Working with unknown values
34994///
34995/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34996/// additional enum variants at any time. Adding new variants is not considered
34997/// a breaking change. Applications should write their code in anticipation of:
34998///
34999/// - New values appearing in future releases of the client library, **and**
35000/// - New values received dynamically, without application changes.
35001///
35002/// Please consult the [Working with enums] section in the user guide for some
35003/// guidelines.
35004///
35005/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35006#[derive(Clone, Debug, PartialEq)]
35007#[non_exhaustive]
35008pub enum SqlDataDiskType {
35009 /// This is an unknown data disk type.
35010 Unspecified,
35011 /// An SSD data disk.
35012 PdSsd,
35013 /// An HDD data disk.
35014 PdHdd,
35015 /// This field is deprecated and will be removed from a future version of the
35016 /// API.
35017 #[deprecated]
35018 ObsoleteLocalSsd,
35019 /// A Hyperdisk Balanced data disk.
35020 HyperdiskBalanced,
35021 /// If set, the enum was initialized with an unknown value.
35022 ///
35023 /// Applications can examine the value using [SqlDataDiskType::value] or
35024 /// [SqlDataDiskType::name].
35025 UnknownValue(sql_data_disk_type::UnknownValue),
35026}
35027
35028#[doc(hidden)]
35029pub mod sql_data_disk_type {
35030 #[allow(unused_imports)]
35031 use super::*;
35032 #[derive(Clone, Debug, PartialEq)]
35033 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35034}
35035
35036impl SqlDataDiskType {
35037 /// Gets the enum value.
35038 ///
35039 /// Returns `None` if the enum contains an unknown value deserialized from
35040 /// the string representation of enums.
35041 pub fn value(&self) -> std::option::Option<i32> {
35042 match self {
35043 Self::Unspecified => std::option::Option::Some(0),
35044 Self::PdSsd => std::option::Option::Some(1),
35045 Self::PdHdd => std::option::Option::Some(2),
35046 Self::ObsoleteLocalSsd => std::option::Option::Some(3),
35047 Self::HyperdiskBalanced => std::option::Option::Some(4),
35048 Self::UnknownValue(u) => u.0.value(),
35049 }
35050 }
35051
35052 /// Gets the enum value as a string.
35053 ///
35054 /// Returns `None` if the enum contains an unknown value deserialized from
35055 /// the integer representation of enums.
35056 pub fn name(&self) -> std::option::Option<&str> {
35057 match self {
35058 Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
35059 Self::PdSsd => std::option::Option::Some("PD_SSD"),
35060 Self::PdHdd => std::option::Option::Some("PD_HDD"),
35061 Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
35062 Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
35063 Self::UnknownValue(u) => u.0.name(),
35064 }
35065 }
35066}
35067
35068impl std::default::Default for SqlDataDiskType {
35069 fn default() -> Self {
35070 use std::convert::From;
35071 Self::from(0)
35072 }
35073}
35074
35075impl std::fmt::Display for SqlDataDiskType {
35076 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35077 wkt::internal::display_enum(f, self.name(), self.value())
35078 }
35079}
35080
35081impl std::convert::From<i32> for SqlDataDiskType {
35082 fn from(value: i32) -> Self {
35083 match value {
35084 0 => Self::Unspecified,
35085 1 => Self::PdSsd,
35086 2 => Self::PdHdd,
35087 3 => Self::ObsoleteLocalSsd,
35088 4 => Self::HyperdiskBalanced,
35089 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35090 wkt::internal::UnknownEnumValue::Integer(value),
35091 )),
35092 }
35093 }
35094}
35095
35096impl std::convert::From<&str> for SqlDataDiskType {
35097 fn from(value: &str) -> Self {
35098 use std::string::ToString;
35099 match value {
35100 "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
35101 "PD_SSD" => Self::PdSsd,
35102 "PD_HDD" => Self::PdHdd,
35103 "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
35104 "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
35105 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35106 wkt::internal::UnknownEnumValue::String(value.to_string()),
35107 )),
35108 }
35109 }
35110}
35111
35112impl serde::ser::Serialize for SqlDataDiskType {
35113 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35114 where
35115 S: serde::Serializer,
35116 {
35117 match self {
35118 Self::Unspecified => serializer.serialize_i32(0),
35119 Self::PdSsd => serializer.serialize_i32(1),
35120 Self::PdHdd => serializer.serialize_i32(2),
35121 Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
35122 Self::HyperdiskBalanced => serializer.serialize_i32(4),
35123 Self::UnknownValue(u) => u.0.serialize(serializer),
35124 }
35125 }
35126}
35127
35128impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
35129 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35130 where
35131 D: serde::Deserializer<'de>,
35132 {
35133 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
35134 ".google.cloud.sql.v1.SqlDataDiskType",
35135 ))
35136 }
35137}
35138
35139/// The availability type of the given Cloud SQL instance.
35140///
35141/// # Working with unknown values
35142///
35143/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35144/// additional enum variants at any time. Adding new variants is not considered
35145/// a breaking change. Applications should write their code in anticipation of:
35146///
35147/// - New values appearing in future releases of the client library, **and**
35148/// - New values received dynamically, without application changes.
35149///
35150/// Please consult the [Working with enums] section in the user guide for some
35151/// guidelines.
35152///
35153/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35154#[derive(Clone, Debug, PartialEq)]
35155#[non_exhaustive]
35156pub enum SqlAvailabilityType {
35157 /// This is an unknown Availability type.
35158 Unspecified,
35159 /// Zonal available instance.
35160 Zonal,
35161 /// Regional available instance.
35162 Regional,
35163 /// If set, the enum was initialized with an unknown value.
35164 ///
35165 /// Applications can examine the value using [SqlAvailabilityType::value] or
35166 /// [SqlAvailabilityType::name].
35167 UnknownValue(sql_availability_type::UnknownValue),
35168}
35169
35170#[doc(hidden)]
35171pub mod sql_availability_type {
35172 #[allow(unused_imports)]
35173 use super::*;
35174 #[derive(Clone, Debug, PartialEq)]
35175 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35176}
35177
35178impl SqlAvailabilityType {
35179 /// Gets the enum value.
35180 ///
35181 /// Returns `None` if the enum contains an unknown value deserialized from
35182 /// the string representation of enums.
35183 pub fn value(&self) -> std::option::Option<i32> {
35184 match self {
35185 Self::Unspecified => std::option::Option::Some(0),
35186 Self::Zonal => std::option::Option::Some(1),
35187 Self::Regional => std::option::Option::Some(2),
35188 Self::UnknownValue(u) => u.0.value(),
35189 }
35190 }
35191
35192 /// Gets the enum value as a string.
35193 ///
35194 /// Returns `None` if the enum contains an unknown value deserialized from
35195 /// the integer representation of enums.
35196 pub fn name(&self) -> std::option::Option<&str> {
35197 match self {
35198 Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
35199 Self::Zonal => std::option::Option::Some("ZONAL"),
35200 Self::Regional => std::option::Option::Some("REGIONAL"),
35201 Self::UnknownValue(u) => u.0.name(),
35202 }
35203 }
35204}
35205
35206impl std::default::Default for SqlAvailabilityType {
35207 fn default() -> Self {
35208 use std::convert::From;
35209 Self::from(0)
35210 }
35211}
35212
35213impl std::fmt::Display for SqlAvailabilityType {
35214 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35215 wkt::internal::display_enum(f, self.name(), self.value())
35216 }
35217}
35218
35219impl std::convert::From<i32> for SqlAvailabilityType {
35220 fn from(value: i32) -> Self {
35221 match value {
35222 0 => Self::Unspecified,
35223 1 => Self::Zonal,
35224 2 => Self::Regional,
35225 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35226 wkt::internal::UnknownEnumValue::Integer(value),
35227 )),
35228 }
35229 }
35230}
35231
35232impl std::convert::From<&str> for SqlAvailabilityType {
35233 fn from(value: &str) -> Self {
35234 use std::string::ToString;
35235 match value {
35236 "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
35237 "ZONAL" => Self::Zonal,
35238 "REGIONAL" => Self::Regional,
35239 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35240 wkt::internal::UnknownEnumValue::String(value.to_string()),
35241 )),
35242 }
35243 }
35244}
35245
35246impl serde::ser::Serialize for SqlAvailabilityType {
35247 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35248 where
35249 S: serde::Serializer,
35250 {
35251 match self {
35252 Self::Unspecified => serializer.serialize_i32(0),
35253 Self::Zonal => serializer.serialize_i32(1),
35254 Self::Regional => serializer.serialize_i32(2),
35255 Self::UnknownValue(u) => u.0.serialize(serializer),
35256 }
35257 }
35258}
35259
35260impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
35261 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35262 where
35263 D: serde::Deserializer<'de>,
35264 {
35265 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
35266 ".google.cloud.sql.v1.SqlAvailabilityType",
35267 ))
35268 }
35269}
35270
35271///
35272/// # Working with unknown values
35273///
35274/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35275/// additional enum variants at any time. Adding new variants is not considered
35276/// a breaking change. Applications should write their code in anticipation of:
35277///
35278/// - New values appearing in future releases of the client library, **and**
35279/// - New values received dynamically, without application changes.
35280///
35281/// Please consult the [Working with enums] section in the user guide for some
35282/// guidelines.
35283///
35284/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
35285#[derive(Clone, Debug, PartialEq)]
35286#[non_exhaustive]
35287pub enum SqlUpdateTrack {
35288 /// This is an unknown maintenance timing preference.
35289 Unspecified,
35290 /// For an instance with a scheduled maintenance window, this maintenance
35291 /// timing indicates that the maintenance update is scheduled 7 to 14 days
35292 /// after the notification is sent out. Also referred to as `Week 1` (Console)
35293 /// and `preview` (gcloud CLI).
35294 Canary,
35295 /// For an instance with a scheduled maintenance window, this maintenance
35296 /// timing indicates that the maintenance update is scheduled 15 to 21 days
35297 /// after the notification is sent out. Also referred to as `Week 2` (Console)
35298 /// and `production` (gcloud CLI).
35299 Stable,
35300 /// For instance with a scheduled maintenance window, this maintenance
35301 /// timing indicates that the maintenance update is scheduled 35 to 42 days
35302 /// after the notification is sent out.
35303 Week5,
35304 /// If set, the enum was initialized with an unknown value.
35305 ///
35306 /// Applications can examine the value using [SqlUpdateTrack::value] or
35307 /// [SqlUpdateTrack::name].
35308 UnknownValue(sql_update_track::UnknownValue),
35309}
35310
35311#[doc(hidden)]
35312pub mod sql_update_track {
35313 #[allow(unused_imports)]
35314 use super::*;
35315 #[derive(Clone, Debug, PartialEq)]
35316 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35317}
35318
35319impl SqlUpdateTrack {
35320 /// Gets the enum value.
35321 ///
35322 /// Returns `None` if the enum contains an unknown value deserialized from
35323 /// the string representation of enums.
35324 pub fn value(&self) -> std::option::Option<i32> {
35325 match self {
35326 Self::Unspecified => std::option::Option::Some(0),
35327 Self::Canary => std::option::Option::Some(1),
35328 Self::Stable => std::option::Option::Some(2),
35329 Self::Week5 => std::option::Option::Some(3),
35330 Self::UnknownValue(u) => u.0.value(),
35331 }
35332 }
35333
35334 /// Gets the enum value as a string.
35335 ///
35336 /// Returns `None` if the enum contains an unknown value deserialized from
35337 /// the integer representation of enums.
35338 pub fn name(&self) -> std::option::Option<&str> {
35339 match self {
35340 Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
35341 Self::Canary => std::option::Option::Some("canary"),
35342 Self::Stable => std::option::Option::Some("stable"),
35343 Self::Week5 => std::option::Option::Some("week5"),
35344 Self::UnknownValue(u) => u.0.name(),
35345 }
35346 }
35347}
35348
35349impl std::default::Default for SqlUpdateTrack {
35350 fn default() -> Self {
35351 use std::convert::From;
35352 Self::from(0)
35353 }
35354}
35355
35356impl std::fmt::Display for SqlUpdateTrack {
35357 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35358 wkt::internal::display_enum(f, self.name(), self.value())
35359 }
35360}
35361
35362impl std::convert::From<i32> for SqlUpdateTrack {
35363 fn from(value: i32) -> Self {
35364 match value {
35365 0 => Self::Unspecified,
35366 1 => Self::Canary,
35367 2 => Self::Stable,
35368 3 => Self::Week5,
35369 _ => Self::UnknownValue(sql_update_track::UnknownValue(
35370 wkt::internal::UnknownEnumValue::Integer(value),
35371 )),
35372 }
35373 }
35374}
35375
35376impl std::convert::From<&str> for SqlUpdateTrack {
35377 fn from(value: &str) -> Self {
35378 use std::string::ToString;
35379 match value {
35380 "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
35381 "canary" => Self::Canary,
35382 "stable" => Self::Stable,
35383 "week5" => Self::Week5,
35384 _ => Self::UnknownValue(sql_update_track::UnknownValue(
35385 wkt::internal::UnknownEnumValue::String(value.to_string()),
35386 )),
35387 }
35388 }
35389}
35390
35391impl serde::ser::Serialize for SqlUpdateTrack {
35392 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35393 where
35394 S: serde::Serializer,
35395 {
35396 match self {
35397 Self::Unspecified => serializer.serialize_i32(0),
35398 Self::Canary => serializer.serialize_i32(1),
35399 Self::Stable => serializer.serialize_i32(2),
35400 Self::Week5 => serializer.serialize_i32(3),
35401 Self::UnknownValue(u) => u.0.serialize(serializer),
35402 }
35403 }
35404}
35405
35406impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
35407 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35408 where
35409 D: serde::Deserializer<'de>,
35410 {
35411 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
35412 ".google.cloud.sql.v1.SqlUpdateTrack",
35413 ))
35414 }
35415}