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 lazy_static;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// Backup runs delete request.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct SqlBackupRunsDeleteRequest {
42 /// The ID of the backup run to delete. To find a backup run ID, use the
43 /// [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/backupRuns/list)
44 /// method.
45 pub id: i64,
46
47 /// Cloud SQL instance ID. This does not include the project ID.
48 pub instance: std::string::String,
49
50 /// Project ID of the project that contains the instance.
51 pub project: std::string::String,
52
53 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
54}
55
56impl SqlBackupRunsDeleteRequest {
57 pub fn new() -> Self {
58 std::default::Default::default()
59 }
60
61 /// Sets the value of [id][crate::model::SqlBackupRunsDeleteRequest::id].
62 ///
63 /// # Example
64 /// ```ignore,no_run
65 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
66 /// let x = SqlBackupRunsDeleteRequest::new().set_id(42);
67 /// ```
68 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
69 self.id = v.into();
70 self
71 }
72
73 /// Sets the value of [instance][crate::model::SqlBackupRunsDeleteRequest::instance].
74 ///
75 /// # Example
76 /// ```ignore,no_run
77 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
78 /// let x = SqlBackupRunsDeleteRequest::new().set_instance("example");
79 /// ```
80 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
81 self.instance = v.into();
82 self
83 }
84
85 /// Sets the value of [project][crate::model::SqlBackupRunsDeleteRequest::project].
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_sql_v1::model::SqlBackupRunsDeleteRequest;
90 /// let x = SqlBackupRunsDeleteRequest::new().set_project("example");
91 /// ```
92 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
93 self.project = v.into();
94 self
95 }
96}
97
98impl wkt::message::Message for SqlBackupRunsDeleteRequest {
99 fn typename() -> &'static str {
100 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsDeleteRequest"
101 }
102}
103
104/// Backup runs get request.
105#[derive(Clone, Default, PartialEq)]
106#[non_exhaustive]
107pub struct SqlBackupRunsGetRequest {
108 /// The ID of this backup run.
109 pub id: i64,
110
111 /// Cloud SQL instance ID. This does not include the project ID.
112 pub instance: std::string::String,
113
114 /// Project ID of the project that contains the instance.
115 pub project: std::string::String,
116
117 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
118}
119
120impl SqlBackupRunsGetRequest {
121 pub fn new() -> Self {
122 std::default::Default::default()
123 }
124
125 /// Sets the value of [id][crate::model::SqlBackupRunsGetRequest::id].
126 ///
127 /// # Example
128 /// ```ignore,no_run
129 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
130 /// let x = SqlBackupRunsGetRequest::new().set_id(42);
131 /// ```
132 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
133 self.id = v.into();
134 self
135 }
136
137 /// Sets the value of [instance][crate::model::SqlBackupRunsGetRequest::instance].
138 ///
139 /// # Example
140 /// ```ignore,no_run
141 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
142 /// let x = SqlBackupRunsGetRequest::new().set_instance("example");
143 /// ```
144 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
145 self.instance = v.into();
146 self
147 }
148
149 /// Sets the value of [project][crate::model::SqlBackupRunsGetRequest::project].
150 ///
151 /// # Example
152 /// ```ignore,no_run
153 /// # use google_cloud_sql_v1::model::SqlBackupRunsGetRequest;
154 /// let x = SqlBackupRunsGetRequest::new().set_project("example");
155 /// ```
156 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
157 self.project = v.into();
158 self
159 }
160}
161
162impl wkt::message::Message for SqlBackupRunsGetRequest {
163 fn typename() -> &'static str {
164 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsGetRequest"
165 }
166}
167
168/// Backup runs insert request.
169#[derive(Clone, Default, PartialEq)]
170#[non_exhaustive]
171pub struct SqlBackupRunsInsertRequest {
172 /// Cloud SQL instance ID. This does not include the project ID.
173 pub instance: std::string::String,
174
175 /// Project ID of the project that contains the instance.
176 pub project: std::string::String,
177
178 pub body: std::option::Option<crate::model::BackupRun>,
179
180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
181}
182
183impl SqlBackupRunsInsertRequest {
184 pub fn new() -> Self {
185 std::default::Default::default()
186 }
187
188 /// Sets the value of [instance][crate::model::SqlBackupRunsInsertRequest::instance].
189 ///
190 /// # Example
191 /// ```ignore,no_run
192 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
193 /// let x = SqlBackupRunsInsertRequest::new().set_instance("example");
194 /// ```
195 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
196 self.instance = v.into();
197 self
198 }
199
200 /// Sets the value of [project][crate::model::SqlBackupRunsInsertRequest::project].
201 ///
202 /// # Example
203 /// ```ignore,no_run
204 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
205 /// let x = SqlBackupRunsInsertRequest::new().set_project("example");
206 /// ```
207 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
208 self.project = v.into();
209 self
210 }
211
212 /// Sets the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
213 ///
214 /// # Example
215 /// ```ignore,no_run
216 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
217 /// use google_cloud_sql_v1::model::BackupRun;
218 /// let x = SqlBackupRunsInsertRequest::new().set_body(BackupRun::default()/* use setters */);
219 /// ```
220 pub fn set_body<T>(mut self, v: T) -> Self
221 where
222 T: std::convert::Into<crate::model::BackupRun>,
223 {
224 self.body = std::option::Option::Some(v.into());
225 self
226 }
227
228 /// Sets or clears the value of [body][crate::model::SqlBackupRunsInsertRequest::body].
229 ///
230 /// # Example
231 /// ```ignore,no_run
232 /// # use google_cloud_sql_v1::model::SqlBackupRunsInsertRequest;
233 /// use google_cloud_sql_v1::model::BackupRun;
234 /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(Some(BackupRun::default()/* use setters */));
235 /// let x = SqlBackupRunsInsertRequest::new().set_or_clear_body(None::<BackupRun>);
236 /// ```
237 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
238 where
239 T: std::convert::Into<crate::model::BackupRun>,
240 {
241 self.body = v.map(|x| x.into());
242 self
243 }
244}
245
246impl wkt::message::Message for SqlBackupRunsInsertRequest {
247 fn typename() -> &'static str {
248 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsInsertRequest"
249 }
250}
251
252/// Backup runs list request.
253#[derive(Clone, Default, PartialEq)]
254#[non_exhaustive]
255pub struct SqlBackupRunsListRequest {
256 /// Cloud SQL instance ID, or "-" for all instances. This does not include
257 /// the project ID.
258 pub instance: std::string::String,
259
260 /// Maximum number of backup runs per response.
261 pub max_results: i32,
262
263 /// A previously-returned page token representing part of the larger set of
264 /// results to view.
265 pub page_token: std::string::String,
266
267 /// Project ID of the project that contains the instance.
268 pub project: std::string::String,
269
270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
271}
272
273impl SqlBackupRunsListRequest {
274 pub fn new() -> Self {
275 std::default::Default::default()
276 }
277
278 /// Sets the value of [instance][crate::model::SqlBackupRunsListRequest::instance].
279 ///
280 /// # Example
281 /// ```ignore,no_run
282 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
283 /// let x = SqlBackupRunsListRequest::new().set_instance("example");
284 /// ```
285 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
286 self.instance = v.into();
287 self
288 }
289
290 /// Sets the value of [max_results][crate::model::SqlBackupRunsListRequest::max_results].
291 ///
292 /// # Example
293 /// ```ignore,no_run
294 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
295 /// let x = SqlBackupRunsListRequest::new().set_max_results(42);
296 /// ```
297 pub fn set_max_results<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
298 self.max_results = v.into();
299 self
300 }
301
302 /// Sets the value of [page_token][crate::model::SqlBackupRunsListRequest::page_token].
303 ///
304 /// # Example
305 /// ```ignore,no_run
306 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
307 /// let x = SqlBackupRunsListRequest::new().set_page_token("example");
308 /// ```
309 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
310 self.page_token = v.into();
311 self
312 }
313
314 /// Sets the value of [project][crate::model::SqlBackupRunsListRequest::project].
315 ///
316 /// # Example
317 /// ```ignore,no_run
318 /// # use google_cloud_sql_v1::model::SqlBackupRunsListRequest;
319 /// let x = SqlBackupRunsListRequest::new().set_project("example");
320 /// ```
321 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
322 self.project = v.into();
323 self
324 }
325}
326
327impl wkt::message::Message for SqlBackupRunsListRequest {
328 fn typename() -> &'static str {
329 "type.googleapis.com/google.cloud.sql.v1.SqlBackupRunsListRequest"
330 }
331}
332
333/// A BackupRun resource.
334#[derive(Clone, Default, PartialEq)]
335#[non_exhaustive]
336pub struct BackupRun {
337 /// This is always `sql#backupRun`.
338 pub kind: std::string::String,
339
340 /// The status of this run.
341 pub status: crate::model::SqlBackupRunStatus,
342
343 /// The time the run was enqueued in UTC timezone in
344 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
345 /// `2012-11-15T16:19:00.094Z`.
346 pub enqueued_time: std::option::Option<wkt::Timestamp>,
347
348 /// The identifier for this backup run. Unique only for a specific Cloud SQL
349 /// instance.
350 pub id: i64,
351
352 /// The time the backup operation actually started in UTC timezone in
353 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
354 /// `2012-11-15T16:19:00.094Z`.
355 pub start_time: std::option::Option<wkt::Timestamp>,
356
357 /// The time the backup operation completed in UTC timezone in
358 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
359 /// `2012-11-15T16:19:00.094Z`.
360 pub end_time: std::option::Option<wkt::Timestamp>,
361
362 /// Information about why the backup operation failed. This is only present if
363 /// the run has the FAILED status.
364 pub error: std::option::Option<crate::model::OperationError>,
365
366 /// The type of this run; can be either "AUTOMATED" or "ON_DEMAND" or "FINAL".
367 /// This field defaults to "ON_DEMAND" and is ignored, when specified for
368 /// insert requests.
369 pub r#type: crate::model::SqlBackupRunType,
370
371 /// The description of this run, only applicable to on-demand backups.
372 pub description: std::string::String,
373
374 /// The start time of the backup window during which this the backup was
375 /// attempted in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for
376 /// example `2012-11-15T16:19:00.094Z`.
377 pub window_start_time: std::option::Option<wkt::Timestamp>,
378
379 /// Name of the database instance.
380 pub instance: std::string::String,
381
382 /// The URI of this resource.
383 pub self_link: std::string::String,
384
385 /// Location of the backups.
386 pub location: std::string::String,
387
388 /// Output only. The instance database version at the time this backup was
389 /// made.
390 pub database_version: crate::model::SqlDatabaseVersion,
391
392 /// Encryption configuration specific to a backup.
393 pub disk_encryption_configuration:
394 std::option::Option<crate::model::DiskEncryptionConfiguration>,
395
396 /// Encryption status specific to a backup.
397 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
398
399 /// Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
400 pub backup_kind: crate::model::SqlBackupKind,
401
402 /// Backup time zone to prevent restores to an instance with
403 /// a different time zone. Now relevant only for SQL Server.
404 pub time_zone: std::string::String,
405
406 /// Output only. The maximum chargeable bytes for the backup.
407 pub max_chargeable_bytes: std::option::Option<i64>,
408
409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
410}
411
412impl BackupRun {
413 pub fn new() -> Self {
414 std::default::Default::default()
415 }
416
417 /// Sets the value of [kind][crate::model::BackupRun::kind].
418 ///
419 /// # Example
420 /// ```ignore,no_run
421 /// # use google_cloud_sql_v1::model::BackupRun;
422 /// let x = BackupRun::new().set_kind("example");
423 /// ```
424 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
425 self.kind = v.into();
426 self
427 }
428
429 /// Sets the value of [status][crate::model::BackupRun::status].
430 ///
431 /// # Example
432 /// ```ignore,no_run
433 /// # use google_cloud_sql_v1::model::BackupRun;
434 /// use google_cloud_sql_v1::model::SqlBackupRunStatus;
435 /// let x0 = BackupRun::new().set_status(SqlBackupRunStatus::Enqueued);
436 /// let x1 = BackupRun::new().set_status(SqlBackupRunStatus::Overdue);
437 /// let x2 = BackupRun::new().set_status(SqlBackupRunStatus::Running);
438 /// ```
439 pub fn set_status<T: std::convert::Into<crate::model::SqlBackupRunStatus>>(
440 mut self,
441 v: T,
442 ) -> Self {
443 self.status = v.into();
444 self
445 }
446
447 /// Sets the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
448 ///
449 /// # Example
450 /// ```ignore,no_run
451 /// # use google_cloud_sql_v1::model::BackupRun;
452 /// use wkt::Timestamp;
453 /// let x = BackupRun::new().set_enqueued_time(Timestamp::default()/* use setters */);
454 /// ```
455 pub fn set_enqueued_time<T>(mut self, v: T) -> Self
456 where
457 T: std::convert::Into<wkt::Timestamp>,
458 {
459 self.enqueued_time = std::option::Option::Some(v.into());
460 self
461 }
462
463 /// Sets or clears the value of [enqueued_time][crate::model::BackupRun::enqueued_time].
464 ///
465 /// # Example
466 /// ```ignore,no_run
467 /// # use google_cloud_sql_v1::model::BackupRun;
468 /// use wkt::Timestamp;
469 /// let x = BackupRun::new().set_or_clear_enqueued_time(Some(Timestamp::default()/* use setters */));
470 /// let x = BackupRun::new().set_or_clear_enqueued_time(None::<Timestamp>);
471 /// ```
472 pub fn set_or_clear_enqueued_time<T>(mut self, v: std::option::Option<T>) -> Self
473 where
474 T: std::convert::Into<wkt::Timestamp>,
475 {
476 self.enqueued_time = v.map(|x| x.into());
477 self
478 }
479
480 /// Sets the value of [id][crate::model::BackupRun::id].
481 ///
482 /// # Example
483 /// ```ignore,no_run
484 /// # use google_cloud_sql_v1::model::BackupRun;
485 /// let x = BackupRun::new().set_id(42);
486 /// ```
487 pub fn set_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
488 self.id = v.into();
489 self
490 }
491
492 /// Sets the value of [start_time][crate::model::BackupRun::start_time].
493 ///
494 /// # Example
495 /// ```ignore,no_run
496 /// # use google_cloud_sql_v1::model::BackupRun;
497 /// use wkt::Timestamp;
498 /// let x = BackupRun::new().set_start_time(Timestamp::default()/* use setters */);
499 /// ```
500 pub fn set_start_time<T>(mut self, v: T) -> Self
501 where
502 T: std::convert::Into<wkt::Timestamp>,
503 {
504 self.start_time = std::option::Option::Some(v.into());
505 self
506 }
507
508 /// Sets or clears the value of [start_time][crate::model::BackupRun::start_time].
509 ///
510 /// # Example
511 /// ```ignore,no_run
512 /// # use google_cloud_sql_v1::model::BackupRun;
513 /// use wkt::Timestamp;
514 /// let x = BackupRun::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
515 /// let x = BackupRun::new().set_or_clear_start_time(None::<Timestamp>);
516 /// ```
517 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
518 where
519 T: std::convert::Into<wkt::Timestamp>,
520 {
521 self.start_time = v.map(|x| x.into());
522 self
523 }
524
525 /// Sets the value of [end_time][crate::model::BackupRun::end_time].
526 ///
527 /// # Example
528 /// ```ignore,no_run
529 /// # use google_cloud_sql_v1::model::BackupRun;
530 /// use wkt::Timestamp;
531 /// let x = BackupRun::new().set_end_time(Timestamp::default()/* use setters */);
532 /// ```
533 pub fn set_end_time<T>(mut self, v: T) -> Self
534 where
535 T: std::convert::Into<wkt::Timestamp>,
536 {
537 self.end_time = std::option::Option::Some(v.into());
538 self
539 }
540
541 /// Sets or clears the value of [end_time][crate::model::BackupRun::end_time].
542 ///
543 /// # Example
544 /// ```ignore,no_run
545 /// # use google_cloud_sql_v1::model::BackupRun;
546 /// use wkt::Timestamp;
547 /// let x = BackupRun::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
548 /// let x = BackupRun::new().set_or_clear_end_time(None::<Timestamp>);
549 /// ```
550 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
551 where
552 T: std::convert::Into<wkt::Timestamp>,
553 {
554 self.end_time = v.map(|x| x.into());
555 self
556 }
557
558 /// Sets the value of [error][crate::model::BackupRun::error].
559 ///
560 /// # Example
561 /// ```ignore,no_run
562 /// # use google_cloud_sql_v1::model::BackupRun;
563 /// use google_cloud_sql_v1::model::OperationError;
564 /// let x = BackupRun::new().set_error(OperationError::default()/* use setters */);
565 /// ```
566 pub fn set_error<T>(mut self, v: T) -> Self
567 where
568 T: std::convert::Into<crate::model::OperationError>,
569 {
570 self.error = std::option::Option::Some(v.into());
571 self
572 }
573
574 /// Sets or clears the value of [error][crate::model::BackupRun::error].
575 ///
576 /// # Example
577 /// ```ignore,no_run
578 /// # use google_cloud_sql_v1::model::BackupRun;
579 /// use google_cloud_sql_v1::model::OperationError;
580 /// let x = BackupRun::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
581 /// let x = BackupRun::new().set_or_clear_error(None::<OperationError>);
582 /// ```
583 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
584 where
585 T: std::convert::Into<crate::model::OperationError>,
586 {
587 self.error = v.map(|x| x.into());
588 self
589 }
590
591 /// Sets the value of [r#type][crate::model::BackupRun::type].
592 ///
593 /// # Example
594 /// ```ignore,no_run
595 /// # use google_cloud_sql_v1::model::BackupRun;
596 /// use google_cloud_sql_v1::model::SqlBackupRunType;
597 /// let x0 = BackupRun::new().set_type(SqlBackupRunType::Automated);
598 /// let x1 = BackupRun::new().set_type(SqlBackupRunType::OnDemand);
599 /// ```
600 pub fn set_type<T: std::convert::Into<crate::model::SqlBackupRunType>>(mut self, v: T) -> Self {
601 self.r#type = v.into();
602 self
603 }
604
605 /// Sets the value of [description][crate::model::BackupRun::description].
606 ///
607 /// # Example
608 /// ```ignore,no_run
609 /// # use google_cloud_sql_v1::model::BackupRun;
610 /// let x = BackupRun::new().set_description("example");
611 /// ```
612 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
613 self.description = v.into();
614 self
615 }
616
617 /// Sets the value of [window_start_time][crate::model::BackupRun::window_start_time].
618 ///
619 /// # Example
620 /// ```ignore,no_run
621 /// # use google_cloud_sql_v1::model::BackupRun;
622 /// use wkt::Timestamp;
623 /// let x = BackupRun::new().set_window_start_time(Timestamp::default()/* use setters */);
624 /// ```
625 pub fn set_window_start_time<T>(mut self, v: T) -> Self
626 where
627 T: std::convert::Into<wkt::Timestamp>,
628 {
629 self.window_start_time = std::option::Option::Some(v.into());
630 self
631 }
632
633 /// Sets or clears the value of [window_start_time][crate::model::BackupRun::window_start_time].
634 ///
635 /// # Example
636 /// ```ignore,no_run
637 /// # use google_cloud_sql_v1::model::BackupRun;
638 /// use wkt::Timestamp;
639 /// let x = BackupRun::new().set_or_clear_window_start_time(Some(Timestamp::default()/* use setters */));
640 /// let x = BackupRun::new().set_or_clear_window_start_time(None::<Timestamp>);
641 /// ```
642 pub fn set_or_clear_window_start_time<T>(mut self, v: std::option::Option<T>) -> Self
643 where
644 T: std::convert::Into<wkt::Timestamp>,
645 {
646 self.window_start_time = v.map(|x| x.into());
647 self
648 }
649
650 /// Sets the value of [instance][crate::model::BackupRun::instance].
651 ///
652 /// # Example
653 /// ```ignore,no_run
654 /// # use google_cloud_sql_v1::model::BackupRun;
655 /// let x = BackupRun::new().set_instance("example");
656 /// ```
657 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
658 self.instance = v.into();
659 self
660 }
661
662 /// Sets the value of [self_link][crate::model::BackupRun::self_link].
663 ///
664 /// # Example
665 /// ```ignore,no_run
666 /// # use google_cloud_sql_v1::model::BackupRun;
667 /// let x = BackupRun::new().set_self_link("example");
668 /// ```
669 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
670 self.self_link = v.into();
671 self
672 }
673
674 /// Sets the value of [location][crate::model::BackupRun::location].
675 ///
676 /// # Example
677 /// ```ignore,no_run
678 /// # use google_cloud_sql_v1::model::BackupRun;
679 /// let x = BackupRun::new().set_location("example");
680 /// ```
681 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
682 self.location = v.into();
683 self
684 }
685
686 /// Sets the value of [database_version][crate::model::BackupRun::database_version].
687 ///
688 /// # Example
689 /// ```ignore,no_run
690 /// # use google_cloud_sql_v1::model::BackupRun;
691 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
692 /// let x0 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql56);
693 /// let x1 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql57);
694 /// let x2 = BackupRun::new().set_database_version(SqlDatabaseVersion::Mysql80);
695 /// ```
696 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
697 mut self,
698 v: T,
699 ) -> Self {
700 self.database_version = v.into();
701 self
702 }
703
704 /// Sets the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
705 ///
706 /// # Example
707 /// ```ignore,no_run
708 /// # use google_cloud_sql_v1::model::BackupRun;
709 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
710 /// let x = BackupRun::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
711 /// ```
712 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
713 where
714 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
715 {
716 self.disk_encryption_configuration = std::option::Option::Some(v.into());
717 self
718 }
719
720 /// Sets or clears the value of [disk_encryption_configuration][crate::model::BackupRun::disk_encryption_configuration].
721 ///
722 /// # Example
723 /// ```ignore,no_run
724 /// # use google_cloud_sql_v1::model::BackupRun;
725 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
726 /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
727 /// let x = BackupRun::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
728 /// ```
729 pub fn set_or_clear_disk_encryption_configuration<T>(
730 mut self,
731 v: std::option::Option<T>,
732 ) -> Self
733 where
734 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
735 {
736 self.disk_encryption_configuration = v.map(|x| x.into());
737 self
738 }
739
740 /// Sets the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
741 ///
742 /// # Example
743 /// ```ignore,no_run
744 /// # use google_cloud_sql_v1::model::BackupRun;
745 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
746 /// let x = BackupRun::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
747 /// ```
748 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
749 where
750 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
751 {
752 self.disk_encryption_status = std::option::Option::Some(v.into());
753 self
754 }
755
756 /// Sets or clears the value of [disk_encryption_status][crate::model::BackupRun::disk_encryption_status].
757 ///
758 /// # Example
759 /// ```ignore,no_run
760 /// # use google_cloud_sql_v1::model::BackupRun;
761 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
762 /// let x = BackupRun::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
763 /// let x = BackupRun::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
764 /// ```
765 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
766 where
767 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
768 {
769 self.disk_encryption_status = v.map(|x| x.into());
770 self
771 }
772
773 /// Sets the value of [backup_kind][crate::model::BackupRun::backup_kind].
774 ///
775 /// # Example
776 /// ```ignore,no_run
777 /// # use google_cloud_sql_v1::model::BackupRun;
778 /// use google_cloud_sql_v1::model::SqlBackupKind;
779 /// let x0 = BackupRun::new().set_backup_kind(SqlBackupKind::Snapshot);
780 /// let x1 = BackupRun::new().set_backup_kind(SqlBackupKind::Physical);
781 /// ```
782 pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
783 mut self,
784 v: T,
785 ) -> Self {
786 self.backup_kind = v.into();
787 self
788 }
789
790 /// Sets the value of [time_zone][crate::model::BackupRun::time_zone].
791 ///
792 /// # Example
793 /// ```ignore,no_run
794 /// # use google_cloud_sql_v1::model::BackupRun;
795 /// let x = BackupRun::new().set_time_zone("example");
796 /// ```
797 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
798 self.time_zone = v.into();
799 self
800 }
801
802 /// Sets the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
803 ///
804 /// # Example
805 /// ```ignore,no_run
806 /// # use google_cloud_sql_v1::model::BackupRun;
807 /// let x = BackupRun::new().set_max_chargeable_bytes(42);
808 /// ```
809 pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
810 where
811 T: std::convert::Into<i64>,
812 {
813 self.max_chargeable_bytes = std::option::Option::Some(v.into());
814 self
815 }
816
817 /// Sets or clears the value of [max_chargeable_bytes][crate::model::BackupRun::max_chargeable_bytes].
818 ///
819 /// # Example
820 /// ```ignore,no_run
821 /// # use google_cloud_sql_v1::model::BackupRun;
822 /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(Some(42));
823 /// let x = BackupRun::new().set_or_clear_max_chargeable_bytes(None::<i32>);
824 /// ```
825 pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
826 where
827 T: std::convert::Into<i64>,
828 {
829 self.max_chargeable_bytes = v.map(|x| x.into());
830 self
831 }
832}
833
834impl wkt::message::Message for BackupRun {
835 fn typename() -> &'static str {
836 "type.googleapis.com/google.cloud.sql.v1.BackupRun"
837 }
838}
839
840/// Backup run list results.
841#[derive(Clone, Default, PartialEq)]
842#[non_exhaustive]
843pub struct BackupRunsListResponse {
844 /// This is always `sql#backupRunsList`.
845 pub kind: std::string::String,
846
847 /// A list of backup runs in reverse chronological order of the enqueued time.
848 pub items: std::vec::Vec<crate::model::BackupRun>,
849
850 /// The continuation token, used to page through large result sets. Provide
851 /// this value in a subsequent request to return the next page of results.
852 pub next_page_token: std::string::String,
853
854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
855}
856
857impl BackupRunsListResponse {
858 pub fn new() -> Self {
859 std::default::Default::default()
860 }
861
862 /// Sets the value of [kind][crate::model::BackupRunsListResponse::kind].
863 ///
864 /// # Example
865 /// ```ignore,no_run
866 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
867 /// let x = BackupRunsListResponse::new().set_kind("example");
868 /// ```
869 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
870 self.kind = v.into();
871 self
872 }
873
874 /// Sets the value of [items][crate::model::BackupRunsListResponse::items].
875 ///
876 /// # Example
877 /// ```ignore,no_run
878 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
879 /// use google_cloud_sql_v1::model::BackupRun;
880 /// let x = BackupRunsListResponse::new()
881 /// .set_items([
882 /// BackupRun::default()/* use setters */,
883 /// BackupRun::default()/* use (different) setters */,
884 /// ]);
885 /// ```
886 pub fn set_items<T, V>(mut self, v: T) -> Self
887 where
888 T: std::iter::IntoIterator<Item = V>,
889 V: std::convert::Into<crate::model::BackupRun>,
890 {
891 use std::iter::Iterator;
892 self.items = v.into_iter().map(|i| i.into()).collect();
893 self
894 }
895
896 /// Sets the value of [next_page_token][crate::model::BackupRunsListResponse::next_page_token].
897 ///
898 /// # Example
899 /// ```ignore,no_run
900 /// # use google_cloud_sql_v1::model::BackupRunsListResponse;
901 /// let x = BackupRunsListResponse::new().set_next_page_token("example");
902 /// ```
903 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
904 self.next_page_token = v.into();
905 self
906 }
907}
908
909impl wkt::message::Message for BackupRunsListResponse {
910 fn typename() -> &'static str {
911 "type.googleapis.com/google.cloud.sql.v1.BackupRunsListResponse"
912 }
913}
914
915#[doc(hidden)]
916impl google_cloud_gax::paginator::internal::PageableResponse for BackupRunsListResponse {
917 type PageItem = crate::model::BackupRun;
918
919 fn items(self) -> std::vec::Vec<Self::PageItem> {
920 self.items
921 }
922
923 fn next_page_token(&self) -> std::string::String {
924 use std::clone::Clone;
925 self.next_page_token.clone()
926 }
927}
928
929/// The request payload to create the backup
930#[derive(Clone, Default, PartialEq)]
931#[non_exhaustive]
932pub struct CreateBackupRequest {
933 /// Required. The parent resource where this backup is created.
934 /// Format: projects/{project}
935 pub parent: std::string::String,
936
937 /// Required. The Backup to create.
938 pub backup: std::option::Option<crate::model::Backup>,
939
940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
941}
942
943impl CreateBackupRequest {
944 pub fn new() -> Self {
945 std::default::Default::default()
946 }
947
948 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
949 ///
950 /// # Example
951 /// ```ignore,no_run
952 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
953 /// let x = CreateBackupRequest::new().set_parent("example");
954 /// ```
955 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
956 self.parent = v.into();
957 self
958 }
959
960 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
961 ///
962 /// # Example
963 /// ```ignore,no_run
964 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
965 /// use google_cloud_sql_v1::model::Backup;
966 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
967 /// ```
968 pub fn set_backup<T>(mut self, v: T) -> Self
969 where
970 T: std::convert::Into<crate::model::Backup>,
971 {
972 self.backup = std::option::Option::Some(v.into());
973 self
974 }
975
976 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
977 ///
978 /// # Example
979 /// ```ignore,no_run
980 /// # use google_cloud_sql_v1::model::CreateBackupRequest;
981 /// use google_cloud_sql_v1::model::Backup;
982 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
983 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
984 /// ```
985 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
986 where
987 T: std::convert::Into<crate::model::Backup>,
988 {
989 self.backup = v.map(|x| x.into());
990 self
991 }
992}
993
994impl wkt::message::Message for CreateBackupRequest {
995 fn typename() -> &'static str {
996 "type.googleapis.com/google.cloud.sql.v1.CreateBackupRequest"
997 }
998}
999
1000/// The request payload to get the backup.
1001#[derive(Clone, Default, PartialEq)]
1002#[non_exhaustive]
1003pub struct GetBackupRequest {
1004 /// Required. The name of the backup to retrieve.
1005 /// Format: projects/{project}/backups/{backup}
1006 pub name: std::string::String,
1007
1008 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1009}
1010
1011impl GetBackupRequest {
1012 pub fn new() -> Self {
1013 std::default::Default::default()
1014 }
1015
1016 /// Sets the value of [name][crate::model::GetBackupRequest::name].
1017 ///
1018 /// # Example
1019 /// ```ignore,no_run
1020 /// # use google_cloud_sql_v1::model::GetBackupRequest;
1021 /// let x = GetBackupRequest::new().set_name("example");
1022 /// ```
1023 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1024 self.name = v.into();
1025 self
1026 }
1027}
1028
1029impl wkt::message::Message for GetBackupRequest {
1030 fn typename() -> &'static str {
1031 "type.googleapis.com/google.cloud.sql.v1.GetBackupRequest"
1032 }
1033}
1034
1035/// The request payload to list the backups.
1036#[derive(Clone, Default, PartialEq)]
1037#[non_exhaustive]
1038pub struct ListBackupsRequest {
1039 /// Required. The parent that owns this collection of backups.
1040 /// Format: projects/{project}
1041 pub parent: std::string::String,
1042
1043 /// The maximum number of backups to return per response. The service might
1044 /// return fewer backups than this value. If a value for this parameter isn't
1045 /// specified, then, at most, 500 backups are returned. The maximum value is
1046 /// 2,000. Any values that you set, which are greater than 2,000, are changed
1047 /// to 2,000.
1048 pub page_size: i32,
1049
1050 /// A page token, received from a previous `ListBackups` call.
1051 /// Provide this to retrieve the subsequent page.
1052 ///
1053 /// When paginating, all other parameters provided to `ListBackups` must match
1054 /// the call that provided the page token.
1055 pub page_token: std::string::String,
1056
1057 /// Multiple filter queries are separated by spaces. For example,
1058 /// 'instance:abc AND type:FINAL, 'location:us',
1059 /// 'backupInterval.startTime>=1950-01-01T01:01:25.771Z'. You can filter by
1060 /// type, instance, backupInterval.startTime (creation time), or location.
1061 pub filter: std::string::String,
1062
1063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1064}
1065
1066impl ListBackupsRequest {
1067 pub fn new() -> Self {
1068 std::default::Default::default()
1069 }
1070
1071 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1072 ///
1073 /// # Example
1074 /// ```ignore,no_run
1075 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1076 /// let x = ListBackupsRequest::new().set_parent("example");
1077 /// ```
1078 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1079 self.parent = v.into();
1080 self
1081 }
1082
1083 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1084 ///
1085 /// # Example
1086 /// ```ignore,no_run
1087 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1088 /// let x = ListBackupsRequest::new().set_page_size(42);
1089 /// ```
1090 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1091 self.page_size = v.into();
1092 self
1093 }
1094
1095 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1096 ///
1097 /// # Example
1098 /// ```ignore,no_run
1099 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1100 /// let x = ListBackupsRequest::new().set_page_token("example");
1101 /// ```
1102 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1103 self.page_token = v.into();
1104 self
1105 }
1106
1107 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1108 ///
1109 /// # Example
1110 /// ```ignore,no_run
1111 /// # use google_cloud_sql_v1::model::ListBackupsRequest;
1112 /// let x = ListBackupsRequest::new().set_filter("example");
1113 /// ```
1114 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1115 self.filter = v.into();
1116 self
1117 }
1118}
1119
1120impl wkt::message::Message for ListBackupsRequest {
1121 fn typename() -> &'static str {
1122 "type.googleapis.com/google.cloud.sql.v1.ListBackupsRequest"
1123 }
1124}
1125
1126/// The response payload containing a list of the backups.
1127#[derive(Clone, Default, PartialEq)]
1128#[non_exhaustive]
1129pub struct ListBackupsResponse {
1130 /// A list of backups.
1131 pub backups: std::vec::Vec<crate::model::Backup>,
1132
1133 /// A token, which can be sent as `page_token` to retrieve the next page.
1134 /// If this field is omitted, then there aren't subsequent pages.
1135 pub next_page_token: std::string::String,
1136
1137 /// If a region isn't unavailable or if an unknown error occurs, then a warning
1138 /// message is returned.
1139 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
1140
1141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1142}
1143
1144impl ListBackupsResponse {
1145 pub fn new() -> Self {
1146 std::default::Default::default()
1147 }
1148
1149 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1150 ///
1151 /// # Example
1152 /// ```ignore,no_run
1153 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1154 /// use google_cloud_sql_v1::model::Backup;
1155 /// let x = ListBackupsResponse::new()
1156 /// .set_backups([
1157 /// Backup::default()/* use setters */,
1158 /// Backup::default()/* use (different) setters */,
1159 /// ]);
1160 /// ```
1161 pub fn set_backups<T, V>(mut self, v: T) -> Self
1162 where
1163 T: std::iter::IntoIterator<Item = V>,
1164 V: std::convert::Into<crate::model::Backup>,
1165 {
1166 use std::iter::Iterator;
1167 self.backups = v.into_iter().map(|i| i.into()).collect();
1168 self
1169 }
1170
1171 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1172 ///
1173 /// # Example
1174 /// ```ignore,no_run
1175 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1176 /// let x = ListBackupsResponse::new().set_next_page_token("example");
1177 /// ```
1178 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1179 self.next_page_token = v.into();
1180 self
1181 }
1182
1183 /// Sets the value of [warnings][crate::model::ListBackupsResponse::warnings].
1184 ///
1185 /// # Example
1186 /// ```ignore,no_run
1187 /// # use google_cloud_sql_v1::model::ListBackupsResponse;
1188 /// use google_cloud_sql_v1::model::ApiWarning;
1189 /// let x = ListBackupsResponse::new()
1190 /// .set_warnings([
1191 /// ApiWarning::default()/* use setters */,
1192 /// ApiWarning::default()/* use (different) setters */,
1193 /// ]);
1194 /// ```
1195 pub fn set_warnings<T, V>(mut self, v: T) -> Self
1196 where
1197 T: std::iter::IntoIterator<Item = V>,
1198 V: std::convert::Into<crate::model::ApiWarning>,
1199 {
1200 use std::iter::Iterator;
1201 self.warnings = v.into_iter().map(|i| i.into()).collect();
1202 self
1203 }
1204}
1205
1206impl wkt::message::Message for ListBackupsResponse {
1207 fn typename() -> &'static str {
1208 "type.googleapis.com/google.cloud.sql.v1.ListBackupsResponse"
1209 }
1210}
1211
1212#[doc(hidden)]
1213impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1214 type PageItem = crate::model::Backup;
1215
1216 fn items(self) -> std::vec::Vec<Self::PageItem> {
1217 self.backups
1218 }
1219
1220 fn next_page_token(&self) -> std::string::String {
1221 use std::clone::Clone;
1222 self.next_page_token.clone()
1223 }
1224}
1225
1226/// The request payload to update the backup.
1227#[derive(Clone, Default, PartialEq)]
1228#[non_exhaustive]
1229pub struct UpdateBackupRequest {
1230 /// Required. The backup to update.
1231 /// The backup’s `name` field is used to identify the backup to update.
1232 /// Format: projects/{project}/backups/{backup}
1233 pub backup: std::option::Option<crate::model::Backup>,
1234
1235 /// The list of fields that you can update. You can update only the description
1236 /// and retention period of the final backup.
1237 pub update_mask: std::option::Option<wkt::FieldMask>,
1238
1239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1240}
1241
1242impl UpdateBackupRequest {
1243 pub fn new() -> Self {
1244 std::default::Default::default()
1245 }
1246
1247 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
1248 ///
1249 /// # Example
1250 /// ```ignore,no_run
1251 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1252 /// use google_cloud_sql_v1::model::Backup;
1253 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1254 /// ```
1255 pub fn set_backup<T>(mut self, v: T) -> Self
1256 where
1257 T: std::convert::Into<crate::model::Backup>,
1258 {
1259 self.backup = std::option::Option::Some(v.into());
1260 self
1261 }
1262
1263 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
1264 ///
1265 /// # Example
1266 /// ```ignore,no_run
1267 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1268 /// use google_cloud_sql_v1::model::Backup;
1269 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
1270 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
1271 /// ```
1272 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
1273 where
1274 T: std::convert::Into<crate::model::Backup>,
1275 {
1276 self.backup = v.map(|x| x.into());
1277 self
1278 }
1279
1280 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1281 ///
1282 /// # Example
1283 /// ```ignore,no_run
1284 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1285 /// use wkt::FieldMask;
1286 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1287 /// ```
1288 pub fn set_update_mask<T>(mut self, v: T) -> Self
1289 where
1290 T: std::convert::Into<wkt::FieldMask>,
1291 {
1292 self.update_mask = std::option::Option::Some(v.into());
1293 self
1294 }
1295
1296 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
1297 ///
1298 /// # Example
1299 /// ```ignore,no_run
1300 /// # use google_cloud_sql_v1::model::UpdateBackupRequest;
1301 /// use wkt::FieldMask;
1302 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1303 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1304 /// ```
1305 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1306 where
1307 T: std::convert::Into<wkt::FieldMask>,
1308 {
1309 self.update_mask = v.map(|x| x.into());
1310 self
1311 }
1312}
1313
1314impl wkt::message::Message for UpdateBackupRequest {
1315 fn typename() -> &'static str {
1316 "type.googleapis.com/google.cloud.sql.v1.UpdateBackupRequest"
1317 }
1318}
1319
1320/// The request payload to delete the backup.
1321#[derive(Clone, Default, PartialEq)]
1322#[non_exhaustive]
1323pub struct DeleteBackupRequest {
1324 /// Required. The name of the backup to delete.
1325 /// Format: projects/{project}/backups/{backup}
1326 pub name: std::string::String,
1327
1328 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1329}
1330
1331impl DeleteBackupRequest {
1332 pub fn new() -> Self {
1333 std::default::Default::default()
1334 }
1335
1336 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
1337 ///
1338 /// # Example
1339 /// ```ignore,no_run
1340 /// # use google_cloud_sql_v1::model::DeleteBackupRequest;
1341 /// let x = DeleteBackupRequest::new().set_name("example");
1342 /// ```
1343 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1344 self.name = v.into();
1345 self
1346 }
1347}
1348
1349impl wkt::message::Message for DeleteBackupRequest {
1350 fn typename() -> &'static str {
1351 "type.googleapis.com/google.cloud.sql.v1.DeleteBackupRequest"
1352 }
1353}
1354
1355/// A backup resource.
1356#[derive(Clone, Default, PartialEq)]
1357#[non_exhaustive]
1358pub struct Backup {
1359 /// Output only. The resource name of the backup.
1360 /// Format: projects/{project}/backups/{backup}.
1361 pub name: std::string::String,
1362
1363 /// Output only. This is always `sql#backup`.
1364 pub kind: std::string::String,
1365
1366 /// Output only. The URI of this resource.
1367 pub self_link: std::string::String,
1368
1369 /// Output only. The type of this backup. The type can be "AUTOMATED",
1370 /// "ON_DEMAND" or “FINAL”.
1371 pub r#type: crate::model::backup::SqlBackupType,
1372
1373 /// The description of this backup.
1374 pub description: std::string::String,
1375
1376 /// The name of the source database instance.
1377 pub instance: std::string::String,
1378
1379 /// The storage location of the backups. The location can be multi-regional.
1380 pub location: std::string::String,
1381
1382 /// Output only. This output contains the following values:
1383 /// start_time: All database writes up to this time are available.
1384 /// end_time: Any database writes after this time aren't available.
1385 pub backup_interval: std::option::Option<google_cloud_type::model::Interval>,
1386
1387 /// Output only. The status of this backup.
1388 pub state: crate::model::backup::SqlBackupState,
1389
1390 /// Output only. Information about why the backup operation fails (for example,
1391 /// when the backup state fails).
1392 pub error: std::option::Option<crate::model::OperationError>,
1393
1394 /// Output only. This output contains the encryption configuration for a backup
1395 /// and the resource name of the KMS key for disk encryption.
1396 pub kms_key: std::string::String,
1397
1398 /// Output only. This output contains the encryption status for a backup and
1399 /// the version of the KMS key that's used to encrypt the Cloud SQL instance.
1400 pub kms_key_version: std::string::String,
1401
1402 /// Output only. Specifies the kind of backup, PHYSICAL or DEFAULT_SNAPSHOT.
1403 pub backup_kind: crate::model::SqlBackupKind,
1404
1405 /// Output only. This output contains a backup time zone. If a Cloud SQL for
1406 /// SQL Server instance has a different time zone from the backup's time zone,
1407 /// then the restore to the instance doesn't happen.
1408 pub time_zone: std::string::String,
1409
1410 /// Output only. The database version of the instance of at the time this
1411 /// backup was made.
1412 pub database_version: crate::model::SqlDatabaseVersion,
1413
1414 /// Output only. The maximum chargeable bytes for the backup.
1415 pub max_chargeable_bytes: std::option::Option<i64>,
1416
1417 /// Optional. Output only. Timestamp in UTC of when the instance associated
1418 /// with this backup is deleted.
1419 pub instance_deletion_time: std::option::Option<wkt::Timestamp>,
1420
1421 /// Optional. Output only. The instance setting of the source instance that's
1422 /// associated with this backup.
1423 pub instance_settings: std::option::Option<crate::model::DatabaseInstance>,
1424
1425 /// Output only. The mapping to backup run resource used for IAM validations.
1426 pub backup_run: std::string::String,
1427
1428 /// Output only. This status indicates whether the backup satisfies PZS.
1429 ///
1430 /// The status is reserved for future use.
1431 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
1432
1433 /// Output only. This status indicates whether the backup satisfies PZI.
1434 ///
1435 /// The status is reserved for future use.
1436 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
1437
1438 pub expiration: std::option::Option<crate::model::backup::Expiration>,
1439
1440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1441}
1442
1443impl Backup {
1444 pub fn new() -> Self {
1445 std::default::Default::default()
1446 }
1447
1448 /// Sets the value of [name][crate::model::Backup::name].
1449 ///
1450 /// # Example
1451 /// ```ignore,no_run
1452 /// # use google_cloud_sql_v1::model::Backup;
1453 /// let x = Backup::new().set_name("example");
1454 /// ```
1455 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1456 self.name = v.into();
1457 self
1458 }
1459
1460 /// Sets the value of [kind][crate::model::Backup::kind].
1461 ///
1462 /// # Example
1463 /// ```ignore,no_run
1464 /// # use google_cloud_sql_v1::model::Backup;
1465 /// let x = Backup::new().set_kind("example");
1466 /// ```
1467 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1468 self.kind = v.into();
1469 self
1470 }
1471
1472 /// Sets the value of [self_link][crate::model::Backup::self_link].
1473 ///
1474 /// # Example
1475 /// ```ignore,no_run
1476 /// # use google_cloud_sql_v1::model::Backup;
1477 /// let x = Backup::new().set_self_link("example");
1478 /// ```
1479 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1480 self.self_link = v.into();
1481 self
1482 }
1483
1484 /// Sets the value of [r#type][crate::model::Backup::type].
1485 ///
1486 /// # Example
1487 /// ```ignore,no_run
1488 /// # use google_cloud_sql_v1::model::Backup;
1489 /// use google_cloud_sql_v1::model::backup::SqlBackupType;
1490 /// let x0 = Backup::new().set_type(SqlBackupType::Automated);
1491 /// let x1 = Backup::new().set_type(SqlBackupType::OnDemand);
1492 /// let x2 = Backup::new().set_type(SqlBackupType::Final);
1493 /// ```
1494 pub fn set_type<T: std::convert::Into<crate::model::backup::SqlBackupType>>(
1495 mut self,
1496 v: T,
1497 ) -> Self {
1498 self.r#type = v.into();
1499 self
1500 }
1501
1502 /// Sets the value of [description][crate::model::Backup::description].
1503 ///
1504 /// # Example
1505 /// ```ignore,no_run
1506 /// # use google_cloud_sql_v1::model::Backup;
1507 /// let x = Backup::new().set_description("example");
1508 /// ```
1509 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1510 self.description = v.into();
1511 self
1512 }
1513
1514 /// Sets the value of [instance][crate::model::Backup::instance].
1515 ///
1516 /// # Example
1517 /// ```ignore,no_run
1518 /// # use google_cloud_sql_v1::model::Backup;
1519 /// let x = Backup::new().set_instance("example");
1520 /// ```
1521 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1522 self.instance = v.into();
1523 self
1524 }
1525
1526 /// Sets the value of [location][crate::model::Backup::location].
1527 ///
1528 /// # Example
1529 /// ```ignore,no_run
1530 /// # use google_cloud_sql_v1::model::Backup;
1531 /// let x = Backup::new().set_location("example");
1532 /// ```
1533 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1534 self.location = v.into();
1535 self
1536 }
1537
1538 /// Sets the value of [backup_interval][crate::model::Backup::backup_interval].
1539 ///
1540 /// # Example
1541 /// ```ignore,no_run
1542 /// # use google_cloud_sql_v1::model::Backup;
1543 /// use google_cloud_type::model::Interval;
1544 /// let x = Backup::new().set_backup_interval(Interval::default()/* use setters */);
1545 /// ```
1546 pub fn set_backup_interval<T>(mut self, v: T) -> Self
1547 where
1548 T: std::convert::Into<google_cloud_type::model::Interval>,
1549 {
1550 self.backup_interval = std::option::Option::Some(v.into());
1551 self
1552 }
1553
1554 /// Sets or clears the value of [backup_interval][crate::model::Backup::backup_interval].
1555 ///
1556 /// # Example
1557 /// ```ignore,no_run
1558 /// # use google_cloud_sql_v1::model::Backup;
1559 /// use google_cloud_type::model::Interval;
1560 /// let x = Backup::new().set_or_clear_backup_interval(Some(Interval::default()/* use setters */));
1561 /// let x = Backup::new().set_or_clear_backup_interval(None::<Interval>);
1562 /// ```
1563 pub fn set_or_clear_backup_interval<T>(mut self, v: std::option::Option<T>) -> Self
1564 where
1565 T: std::convert::Into<google_cloud_type::model::Interval>,
1566 {
1567 self.backup_interval = v.map(|x| x.into());
1568 self
1569 }
1570
1571 /// Sets the value of [state][crate::model::Backup::state].
1572 ///
1573 /// # Example
1574 /// ```ignore,no_run
1575 /// # use google_cloud_sql_v1::model::Backup;
1576 /// use google_cloud_sql_v1::model::backup::SqlBackupState;
1577 /// let x0 = Backup::new().set_state(SqlBackupState::Enqueued);
1578 /// let x1 = Backup::new().set_state(SqlBackupState::Running);
1579 /// let x2 = Backup::new().set_state(SqlBackupState::Failed);
1580 /// ```
1581 pub fn set_state<T: std::convert::Into<crate::model::backup::SqlBackupState>>(
1582 mut self,
1583 v: T,
1584 ) -> Self {
1585 self.state = v.into();
1586 self
1587 }
1588
1589 /// Sets the value of [error][crate::model::Backup::error].
1590 ///
1591 /// # Example
1592 /// ```ignore,no_run
1593 /// # use google_cloud_sql_v1::model::Backup;
1594 /// use google_cloud_sql_v1::model::OperationError;
1595 /// let x = Backup::new().set_error(OperationError::default()/* use setters */);
1596 /// ```
1597 pub fn set_error<T>(mut self, v: T) -> Self
1598 where
1599 T: std::convert::Into<crate::model::OperationError>,
1600 {
1601 self.error = std::option::Option::Some(v.into());
1602 self
1603 }
1604
1605 /// Sets or clears the value of [error][crate::model::Backup::error].
1606 ///
1607 /// # Example
1608 /// ```ignore,no_run
1609 /// # use google_cloud_sql_v1::model::Backup;
1610 /// use google_cloud_sql_v1::model::OperationError;
1611 /// let x = Backup::new().set_or_clear_error(Some(OperationError::default()/* use setters */));
1612 /// let x = Backup::new().set_or_clear_error(None::<OperationError>);
1613 /// ```
1614 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
1615 where
1616 T: std::convert::Into<crate::model::OperationError>,
1617 {
1618 self.error = v.map(|x| x.into());
1619 self
1620 }
1621
1622 /// Sets the value of [kms_key][crate::model::Backup::kms_key].
1623 ///
1624 /// # Example
1625 /// ```ignore,no_run
1626 /// # use google_cloud_sql_v1::model::Backup;
1627 /// let x = Backup::new().set_kms_key("example");
1628 /// ```
1629 pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1630 self.kms_key = v.into();
1631 self
1632 }
1633
1634 /// Sets the value of [kms_key_version][crate::model::Backup::kms_key_version].
1635 ///
1636 /// # Example
1637 /// ```ignore,no_run
1638 /// # use google_cloud_sql_v1::model::Backup;
1639 /// let x = Backup::new().set_kms_key_version("example");
1640 /// ```
1641 pub fn set_kms_key_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.kms_key_version = v.into();
1643 self
1644 }
1645
1646 /// Sets the value of [backup_kind][crate::model::Backup::backup_kind].
1647 ///
1648 /// # Example
1649 /// ```ignore,no_run
1650 /// # use google_cloud_sql_v1::model::Backup;
1651 /// use google_cloud_sql_v1::model::SqlBackupKind;
1652 /// let x0 = Backup::new().set_backup_kind(SqlBackupKind::Snapshot);
1653 /// let x1 = Backup::new().set_backup_kind(SqlBackupKind::Physical);
1654 /// ```
1655 pub fn set_backup_kind<T: std::convert::Into<crate::model::SqlBackupKind>>(
1656 mut self,
1657 v: T,
1658 ) -> Self {
1659 self.backup_kind = v.into();
1660 self
1661 }
1662
1663 /// Sets the value of [time_zone][crate::model::Backup::time_zone].
1664 ///
1665 /// # Example
1666 /// ```ignore,no_run
1667 /// # use google_cloud_sql_v1::model::Backup;
1668 /// let x = Backup::new().set_time_zone("example");
1669 /// ```
1670 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1671 self.time_zone = v.into();
1672 self
1673 }
1674
1675 /// Sets the value of [database_version][crate::model::Backup::database_version].
1676 ///
1677 /// # Example
1678 /// ```ignore,no_run
1679 /// # use google_cloud_sql_v1::model::Backup;
1680 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
1681 /// let x0 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql56);
1682 /// let x1 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql57);
1683 /// let x2 = Backup::new().set_database_version(SqlDatabaseVersion::Mysql80);
1684 /// ```
1685 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
1686 mut self,
1687 v: T,
1688 ) -> Self {
1689 self.database_version = v.into();
1690 self
1691 }
1692
1693 /// Sets the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1694 ///
1695 /// # Example
1696 /// ```ignore,no_run
1697 /// # use google_cloud_sql_v1::model::Backup;
1698 /// let x = Backup::new().set_max_chargeable_bytes(42);
1699 /// ```
1700 pub fn set_max_chargeable_bytes<T>(mut self, v: T) -> Self
1701 where
1702 T: std::convert::Into<i64>,
1703 {
1704 self.max_chargeable_bytes = std::option::Option::Some(v.into());
1705 self
1706 }
1707
1708 /// Sets or clears the value of [max_chargeable_bytes][crate::model::Backup::max_chargeable_bytes].
1709 ///
1710 /// # Example
1711 /// ```ignore,no_run
1712 /// # use google_cloud_sql_v1::model::Backup;
1713 /// let x = Backup::new().set_or_clear_max_chargeable_bytes(Some(42));
1714 /// let x = Backup::new().set_or_clear_max_chargeable_bytes(None::<i32>);
1715 /// ```
1716 pub fn set_or_clear_max_chargeable_bytes<T>(mut self, v: std::option::Option<T>) -> Self
1717 where
1718 T: std::convert::Into<i64>,
1719 {
1720 self.max_chargeable_bytes = v.map(|x| x.into());
1721 self
1722 }
1723
1724 /// Sets the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1725 ///
1726 /// # Example
1727 /// ```ignore,no_run
1728 /// # use google_cloud_sql_v1::model::Backup;
1729 /// use wkt::Timestamp;
1730 /// let x = Backup::new().set_instance_deletion_time(Timestamp::default()/* use setters */);
1731 /// ```
1732 pub fn set_instance_deletion_time<T>(mut self, v: T) -> Self
1733 where
1734 T: std::convert::Into<wkt::Timestamp>,
1735 {
1736 self.instance_deletion_time = std::option::Option::Some(v.into());
1737 self
1738 }
1739
1740 /// Sets or clears the value of [instance_deletion_time][crate::model::Backup::instance_deletion_time].
1741 ///
1742 /// # Example
1743 /// ```ignore,no_run
1744 /// # use google_cloud_sql_v1::model::Backup;
1745 /// use wkt::Timestamp;
1746 /// let x = Backup::new().set_or_clear_instance_deletion_time(Some(Timestamp::default()/* use setters */));
1747 /// let x = Backup::new().set_or_clear_instance_deletion_time(None::<Timestamp>);
1748 /// ```
1749 pub fn set_or_clear_instance_deletion_time<T>(mut self, v: std::option::Option<T>) -> Self
1750 where
1751 T: std::convert::Into<wkt::Timestamp>,
1752 {
1753 self.instance_deletion_time = v.map(|x| x.into());
1754 self
1755 }
1756
1757 /// Sets the value of [instance_settings][crate::model::Backup::instance_settings].
1758 ///
1759 /// # Example
1760 /// ```ignore,no_run
1761 /// # use google_cloud_sql_v1::model::Backup;
1762 /// use google_cloud_sql_v1::model::DatabaseInstance;
1763 /// let x = Backup::new().set_instance_settings(DatabaseInstance::default()/* use setters */);
1764 /// ```
1765 pub fn set_instance_settings<T>(mut self, v: T) -> Self
1766 where
1767 T: std::convert::Into<crate::model::DatabaseInstance>,
1768 {
1769 self.instance_settings = std::option::Option::Some(v.into());
1770 self
1771 }
1772
1773 /// Sets or clears the value of [instance_settings][crate::model::Backup::instance_settings].
1774 ///
1775 /// # Example
1776 /// ```ignore,no_run
1777 /// # use google_cloud_sql_v1::model::Backup;
1778 /// use google_cloud_sql_v1::model::DatabaseInstance;
1779 /// let x = Backup::new().set_or_clear_instance_settings(Some(DatabaseInstance::default()/* use setters */));
1780 /// let x = Backup::new().set_or_clear_instance_settings(None::<DatabaseInstance>);
1781 /// ```
1782 pub fn set_or_clear_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
1783 where
1784 T: std::convert::Into<crate::model::DatabaseInstance>,
1785 {
1786 self.instance_settings = v.map(|x| x.into());
1787 self
1788 }
1789
1790 /// Sets the value of [backup_run][crate::model::Backup::backup_run].
1791 ///
1792 /// # Example
1793 /// ```ignore,no_run
1794 /// # use google_cloud_sql_v1::model::Backup;
1795 /// let x = Backup::new().set_backup_run("example");
1796 /// ```
1797 pub fn set_backup_run<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1798 self.backup_run = v.into();
1799 self
1800 }
1801
1802 /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1803 ///
1804 /// # Example
1805 /// ```ignore,no_run
1806 /// # use google_cloud_sql_v1::model::Backup;
1807 /// use wkt::BoolValue;
1808 /// let x = Backup::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
1809 /// ```
1810 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
1811 where
1812 T: std::convert::Into<wkt::BoolValue>,
1813 {
1814 self.satisfies_pzs = std::option::Option::Some(v.into());
1815 self
1816 }
1817
1818 /// Sets or clears the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1819 ///
1820 /// # Example
1821 /// ```ignore,no_run
1822 /// # use google_cloud_sql_v1::model::Backup;
1823 /// use wkt::BoolValue;
1824 /// let x = Backup::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
1825 /// let x = Backup::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
1826 /// ```
1827 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
1828 where
1829 T: std::convert::Into<wkt::BoolValue>,
1830 {
1831 self.satisfies_pzs = v.map(|x| x.into());
1832 self
1833 }
1834
1835 /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1836 ///
1837 /// # Example
1838 /// ```ignore,no_run
1839 /// # use google_cloud_sql_v1::model::Backup;
1840 /// use wkt::BoolValue;
1841 /// let x = Backup::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
1842 /// ```
1843 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
1844 where
1845 T: std::convert::Into<wkt::BoolValue>,
1846 {
1847 self.satisfies_pzi = std::option::Option::Some(v.into());
1848 self
1849 }
1850
1851 /// Sets or clears the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1852 ///
1853 /// # Example
1854 /// ```ignore,no_run
1855 /// # use google_cloud_sql_v1::model::Backup;
1856 /// use wkt::BoolValue;
1857 /// let x = Backup::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
1858 /// let x = Backup::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
1859 /// ```
1860 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
1861 where
1862 T: std::convert::Into<wkt::BoolValue>,
1863 {
1864 self.satisfies_pzi = v.map(|x| x.into());
1865 self
1866 }
1867
1868 /// Sets the value of [expiration][crate::model::Backup::expiration].
1869 ///
1870 /// Note that all the setters affecting `expiration` are mutually
1871 /// exclusive.
1872 ///
1873 /// # Example
1874 /// ```ignore,no_run
1875 /// # use google_cloud_sql_v1::model::Backup;
1876 /// use google_cloud_sql_v1::model::backup::Expiration;
1877 /// let x = Backup::new().set_expiration(Some(Expiration::TtlDays(42)));
1878 /// ```
1879 pub fn set_expiration<
1880 T: std::convert::Into<std::option::Option<crate::model::backup::Expiration>>,
1881 >(
1882 mut self,
1883 v: T,
1884 ) -> Self {
1885 self.expiration = v.into();
1886 self
1887 }
1888
1889 /// The value of [expiration][crate::model::Backup::expiration]
1890 /// if it holds a `TtlDays`, `None` if the field is not set or
1891 /// holds a different branch.
1892 pub fn ttl_days(&self) -> std::option::Option<&i64> {
1893 #[allow(unreachable_patterns)]
1894 self.expiration.as_ref().and_then(|v| match v {
1895 crate::model::backup::Expiration::TtlDays(v) => std::option::Option::Some(v),
1896 _ => std::option::Option::None,
1897 })
1898 }
1899
1900 /// Sets the value of [expiration][crate::model::Backup::expiration]
1901 /// to hold a `TtlDays`.
1902 ///
1903 /// Note that all the setters affecting `expiration` are
1904 /// mutually exclusive.
1905 ///
1906 /// # Example
1907 /// ```ignore,no_run
1908 /// # use google_cloud_sql_v1::model::Backup;
1909 /// let x = Backup::new().set_ttl_days(42);
1910 /// assert!(x.ttl_days().is_some());
1911 /// assert!(x.expiry_time().is_none());
1912 /// ```
1913 pub fn set_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1914 self.expiration =
1915 std::option::Option::Some(crate::model::backup::Expiration::TtlDays(v.into()));
1916 self
1917 }
1918
1919 /// The value of [expiration][crate::model::Backup::expiration]
1920 /// if it holds a `ExpiryTime`, `None` if the field is not set or
1921 /// holds a different branch.
1922 pub fn expiry_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1923 #[allow(unreachable_patterns)]
1924 self.expiration.as_ref().and_then(|v| match v {
1925 crate::model::backup::Expiration::ExpiryTime(v) => std::option::Option::Some(v),
1926 _ => std::option::Option::None,
1927 })
1928 }
1929
1930 /// Sets the value of [expiration][crate::model::Backup::expiration]
1931 /// to hold a `ExpiryTime`.
1932 ///
1933 /// Note that all the setters affecting `expiration` are
1934 /// mutually exclusive.
1935 ///
1936 /// # Example
1937 /// ```ignore,no_run
1938 /// # use google_cloud_sql_v1::model::Backup;
1939 /// use wkt::Timestamp;
1940 /// let x = Backup::new().set_expiry_time(Timestamp::default()/* use setters */);
1941 /// assert!(x.expiry_time().is_some());
1942 /// assert!(x.ttl_days().is_none());
1943 /// ```
1944 pub fn set_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1945 mut self,
1946 v: T,
1947 ) -> Self {
1948 self.expiration =
1949 std::option::Option::Some(crate::model::backup::Expiration::ExpiryTime(v.into()));
1950 self
1951 }
1952}
1953
1954impl wkt::message::Message for Backup {
1955 fn typename() -> &'static str {
1956 "type.googleapis.com/google.cloud.sql.v1.Backup"
1957 }
1958}
1959
1960/// Defines additional types related to [Backup].
1961pub mod backup {
1962 #[allow(unused_imports)]
1963 use super::*;
1964
1965 /// The backup type.
1966 ///
1967 /// # Working with unknown values
1968 ///
1969 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1970 /// additional enum variants at any time. Adding new variants is not considered
1971 /// a breaking change. Applications should write their code in anticipation of:
1972 ///
1973 /// - New values appearing in future releases of the client library, **and**
1974 /// - New values received dynamically, without application changes.
1975 ///
1976 /// Please consult the [Working with enums] section in the user guide for some
1977 /// guidelines.
1978 ///
1979 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1980 #[derive(Clone, Debug, PartialEq)]
1981 #[non_exhaustive]
1982 pub enum SqlBackupType {
1983 /// This is an unknown backup type.
1984 Unspecified,
1985 /// The backup schedule triggers a backup automatically.
1986 Automated,
1987 /// The user triggers a backup manually.
1988 OnDemand,
1989 /// The backup created when instance is deleted.
1990 Final,
1991 /// If set, the enum was initialized with an unknown value.
1992 ///
1993 /// Applications can examine the value using [SqlBackupType::value] or
1994 /// [SqlBackupType::name].
1995 UnknownValue(sql_backup_type::UnknownValue),
1996 }
1997
1998 #[doc(hidden)]
1999 pub mod sql_backup_type {
2000 #[allow(unused_imports)]
2001 use super::*;
2002 #[derive(Clone, Debug, PartialEq)]
2003 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2004 }
2005
2006 impl SqlBackupType {
2007 /// Gets the enum value.
2008 ///
2009 /// Returns `None` if the enum contains an unknown value deserialized from
2010 /// the string representation of enums.
2011 pub fn value(&self) -> std::option::Option<i32> {
2012 match self {
2013 Self::Unspecified => std::option::Option::Some(0),
2014 Self::Automated => std::option::Option::Some(1),
2015 Self::OnDemand => std::option::Option::Some(2),
2016 Self::Final => std::option::Option::Some(3),
2017 Self::UnknownValue(u) => u.0.value(),
2018 }
2019 }
2020
2021 /// Gets the enum value as a string.
2022 ///
2023 /// Returns `None` if the enum contains an unknown value deserialized from
2024 /// the integer representation of enums.
2025 pub fn name(&self) -> std::option::Option<&str> {
2026 match self {
2027 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_TYPE_UNSPECIFIED"),
2028 Self::Automated => std::option::Option::Some("AUTOMATED"),
2029 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
2030 Self::Final => std::option::Option::Some("FINAL"),
2031 Self::UnknownValue(u) => u.0.name(),
2032 }
2033 }
2034 }
2035
2036 impl std::default::Default for SqlBackupType {
2037 fn default() -> Self {
2038 use std::convert::From;
2039 Self::from(0)
2040 }
2041 }
2042
2043 impl std::fmt::Display for SqlBackupType {
2044 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2045 wkt::internal::display_enum(f, self.name(), self.value())
2046 }
2047 }
2048
2049 impl std::convert::From<i32> for SqlBackupType {
2050 fn from(value: i32) -> Self {
2051 match value {
2052 0 => Self::Unspecified,
2053 1 => Self::Automated,
2054 2 => Self::OnDemand,
2055 3 => Self::Final,
2056 _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2057 wkt::internal::UnknownEnumValue::Integer(value),
2058 )),
2059 }
2060 }
2061 }
2062
2063 impl std::convert::From<&str> for SqlBackupType {
2064 fn from(value: &str) -> Self {
2065 use std::string::ToString;
2066 match value {
2067 "SQL_BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
2068 "AUTOMATED" => Self::Automated,
2069 "ON_DEMAND" => Self::OnDemand,
2070 "FINAL" => Self::Final,
2071 _ => Self::UnknownValue(sql_backup_type::UnknownValue(
2072 wkt::internal::UnknownEnumValue::String(value.to_string()),
2073 )),
2074 }
2075 }
2076 }
2077
2078 impl serde::ser::Serialize for SqlBackupType {
2079 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2080 where
2081 S: serde::Serializer,
2082 {
2083 match self {
2084 Self::Unspecified => serializer.serialize_i32(0),
2085 Self::Automated => serializer.serialize_i32(1),
2086 Self::OnDemand => serializer.serialize_i32(2),
2087 Self::Final => serializer.serialize_i32(3),
2088 Self::UnknownValue(u) => u.0.serialize(serializer),
2089 }
2090 }
2091 }
2092
2093 impl<'de> serde::de::Deserialize<'de> for SqlBackupType {
2094 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2095 where
2096 D: serde::Deserializer<'de>,
2097 {
2098 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupType>::new(
2099 ".google.cloud.sql.v1.Backup.SqlBackupType",
2100 ))
2101 }
2102 }
2103
2104 /// The backup's state
2105 ///
2106 /// # Working with unknown values
2107 ///
2108 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2109 /// additional enum variants at any time. Adding new variants is not considered
2110 /// a breaking change. Applications should write their code in anticipation of:
2111 ///
2112 /// - New values appearing in future releases of the client library, **and**
2113 /// - New values received dynamically, without application changes.
2114 ///
2115 /// Please consult the [Working with enums] section in the user guide for some
2116 /// guidelines.
2117 ///
2118 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2119 #[derive(Clone, Debug, PartialEq)]
2120 #[non_exhaustive]
2121 pub enum SqlBackupState {
2122 /// The state of the backup is unknown.
2123 Unspecified,
2124 /// The backup that's added to a queue.
2125 Enqueued,
2126 /// The backup is in progress.
2127 Running,
2128 /// The backup failed.
2129 Failed,
2130 /// The backup is successful.
2131 Successful,
2132 /// The backup is being deleted.
2133 Deleting,
2134 /// Deletion of the backup failed.
2135 DeletionFailed,
2136 /// If set, the enum was initialized with an unknown value.
2137 ///
2138 /// Applications can examine the value using [SqlBackupState::value] or
2139 /// [SqlBackupState::name].
2140 UnknownValue(sql_backup_state::UnknownValue),
2141 }
2142
2143 #[doc(hidden)]
2144 pub mod sql_backup_state {
2145 #[allow(unused_imports)]
2146 use super::*;
2147 #[derive(Clone, Debug, PartialEq)]
2148 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2149 }
2150
2151 impl SqlBackupState {
2152 /// Gets the enum value.
2153 ///
2154 /// Returns `None` if the enum contains an unknown value deserialized from
2155 /// the string representation of enums.
2156 pub fn value(&self) -> std::option::Option<i32> {
2157 match self {
2158 Self::Unspecified => std::option::Option::Some(0),
2159 Self::Enqueued => std::option::Option::Some(1),
2160 Self::Running => std::option::Option::Some(2),
2161 Self::Failed => std::option::Option::Some(3),
2162 Self::Successful => std::option::Option::Some(4),
2163 Self::Deleting => std::option::Option::Some(5),
2164 Self::DeletionFailed => std::option::Option::Some(6),
2165 Self::UnknownValue(u) => u.0.value(),
2166 }
2167 }
2168
2169 /// Gets the enum value as a string.
2170 ///
2171 /// Returns `None` if the enum contains an unknown value deserialized from
2172 /// the integer representation of enums.
2173 pub fn name(&self) -> std::option::Option<&str> {
2174 match self {
2175 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_STATE_UNSPECIFIED"),
2176 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
2177 Self::Running => std::option::Option::Some("RUNNING"),
2178 Self::Failed => std::option::Option::Some("FAILED"),
2179 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
2180 Self::Deleting => std::option::Option::Some("DELETING"),
2181 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
2182 Self::UnknownValue(u) => u.0.name(),
2183 }
2184 }
2185 }
2186
2187 impl std::default::Default for SqlBackupState {
2188 fn default() -> Self {
2189 use std::convert::From;
2190 Self::from(0)
2191 }
2192 }
2193
2194 impl std::fmt::Display for SqlBackupState {
2195 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2196 wkt::internal::display_enum(f, self.name(), self.value())
2197 }
2198 }
2199
2200 impl std::convert::From<i32> for SqlBackupState {
2201 fn from(value: i32) -> Self {
2202 match value {
2203 0 => Self::Unspecified,
2204 1 => Self::Enqueued,
2205 2 => Self::Running,
2206 3 => Self::Failed,
2207 4 => Self::Successful,
2208 5 => Self::Deleting,
2209 6 => Self::DeletionFailed,
2210 _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2211 wkt::internal::UnknownEnumValue::Integer(value),
2212 )),
2213 }
2214 }
2215 }
2216
2217 impl std::convert::From<&str> for SqlBackupState {
2218 fn from(value: &str) -> Self {
2219 use std::string::ToString;
2220 match value {
2221 "SQL_BACKUP_STATE_UNSPECIFIED" => Self::Unspecified,
2222 "ENQUEUED" => Self::Enqueued,
2223 "RUNNING" => Self::Running,
2224 "FAILED" => Self::Failed,
2225 "SUCCESSFUL" => Self::Successful,
2226 "DELETING" => Self::Deleting,
2227 "DELETION_FAILED" => Self::DeletionFailed,
2228 _ => Self::UnknownValue(sql_backup_state::UnknownValue(
2229 wkt::internal::UnknownEnumValue::String(value.to_string()),
2230 )),
2231 }
2232 }
2233 }
2234
2235 impl serde::ser::Serialize for SqlBackupState {
2236 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2237 where
2238 S: serde::Serializer,
2239 {
2240 match self {
2241 Self::Unspecified => serializer.serialize_i32(0),
2242 Self::Enqueued => serializer.serialize_i32(1),
2243 Self::Running => serializer.serialize_i32(2),
2244 Self::Failed => serializer.serialize_i32(3),
2245 Self::Successful => serializer.serialize_i32(4),
2246 Self::Deleting => serializer.serialize_i32(5),
2247 Self::DeletionFailed => serializer.serialize_i32(6),
2248 Self::UnknownValue(u) => u.0.serialize(serializer),
2249 }
2250 }
2251 }
2252
2253 impl<'de> serde::de::Deserialize<'de> for SqlBackupState {
2254 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2255 where
2256 D: serde::Deserializer<'de>,
2257 {
2258 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupState>::new(
2259 ".google.cloud.sql.v1.Backup.SqlBackupState",
2260 ))
2261 }
2262 }
2263
2264 #[derive(Clone, Debug, PartialEq)]
2265 #[non_exhaustive]
2266 pub enum Expiration {
2267 /// Input only. The time-to-live (TTL) interval for this resource (in days).
2268 /// For example: ttlDays:7, means 7 days from the current time. The
2269 /// expiration time can't exceed 365 days from the time that the backup is
2270 /// created.
2271 TtlDays(i64),
2272 /// Backup expiration time.
2273 /// A UTC timestamp of when this backup expired.
2274 ExpiryTime(std::boxed::Box<wkt::Timestamp>),
2275 }
2276}
2277
2278/// Connect settings retrieval request.
2279#[derive(Clone, Default, PartialEq)]
2280#[non_exhaustive]
2281pub struct GetConnectSettingsRequest {
2282 /// Cloud SQL instance ID. This does not include the project ID.
2283 pub instance: std::string::String,
2284
2285 /// Project ID of the project that contains the instance.
2286 pub project: std::string::String,
2287
2288 /// Optional. Optional snapshot read timestamp to trade freshness for
2289 /// performance.
2290 pub read_time: std::option::Option<wkt::Timestamp>,
2291
2292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2293}
2294
2295impl GetConnectSettingsRequest {
2296 pub fn new() -> Self {
2297 std::default::Default::default()
2298 }
2299
2300 /// Sets the value of [instance][crate::model::GetConnectSettingsRequest::instance].
2301 ///
2302 /// # Example
2303 /// ```ignore,no_run
2304 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2305 /// let x = GetConnectSettingsRequest::new().set_instance("example");
2306 /// ```
2307 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2308 self.instance = v.into();
2309 self
2310 }
2311
2312 /// Sets the value of [project][crate::model::GetConnectSettingsRequest::project].
2313 ///
2314 /// # Example
2315 /// ```ignore,no_run
2316 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2317 /// let x = GetConnectSettingsRequest::new().set_project("example");
2318 /// ```
2319 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.project = v.into();
2321 self
2322 }
2323
2324 /// Sets the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2325 ///
2326 /// # Example
2327 /// ```ignore,no_run
2328 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2329 /// use wkt::Timestamp;
2330 /// let x = GetConnectSettingsRequest::new().set_read_time(Timestamp::default()/* use setters */);
2331 /// ```
2332 pub fn set_read_time<T>(mut self, v: T) -> Self
2333 where
2334 T: std::convert::Into<wkt::Timestamp>,
2335 {
2336 self.read_time = std::option::Option::Some(v.into());
2337 self
2338 }
2339
2340 /// Sets or clears the value of [read_time][crate::model::GetConnectSettingsRequest::read_time].
2341 ///
2342 /// # Example
2343 /// ```ignore,no_run
2344 /// # use google_cloud_sql_v1::model::GetConnectSettingsRequest;
2345 /// use wkt::Timestamp;
2346 /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
2347 /// let x = GetConnectSettingsRequest::new().set_or_clear_read_time(None::<Timestamp>);
2348 /// ```
2349 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
2350 where
2351 T: std::convert::Into<wkt::Timestamp>,
2352 {
2353 self.read_time = v.map(|x| x.into());
2354 self
2355 }
2356}
2357
2358impl wkt::message::Message for GetConnectSettingsRequest {
2359 fn typename() -> &'static str {
2360 "type.googleapis.com/google.cloud.sql.v1.GetConnectSettingsRequest"
2361 }
2362}
2363
2364/// Connect settings retrieval response.
2365#[derive(Clone, Default, PartialEq)]
2366#[non_exhaustive]
2367pub struct ConnectSettings {
2368 /// This is always `sql#connectSettings`.
2369 pub kind: std::string::String,
2370
2371 /// SSL configuration.
2372 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
2373
2374 /// The assigned IP addresses for the instance.
2375 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2376
2377 /// The cloud region for the instance. For example, `us-central1`,
2378 /// `europe-west1`. The region cannot be changed after instance creation.
2379 pub region: std::string::String,
2380
2381 /// The database engine type and version. The `databaseVersion`
2382 /// field cannot be changed after instance creation.
2383 /// MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
2384 /// or `MYSQL_5_6`.
2385 /// PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
2386 /// `POSTGRES_11`, `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
2387 /// SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
2388 /// `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
2389 /// `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
2390 /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
2391 /// `SQLSERVER_2019_WEB`.
2392 pub database_version: crate::model::SqlDatabaseVersion,
2393
2394 /// `SECOND_GEN`: Cloud SQL database instance.
2395 /// `EXTERNAL`: A database server that is not managed by Google.
2396 /// This property is read-only; use the `tier` property in the `settings`
2397 /// object to determine the database type.
2398 pub backend_type: crate::model::SqlBackendType,
2399
2400 /// Whether PSC connectivity is enabled for this instance.
2401 pub psc_enabled: bool,
2402
2403 /// The dns name of the instance.
2404 pub dns_name: std::string::String,
2405
2406 /// Specify what type of CA is used for the server certificate.
2407 pub server_ca_mode: crate::model::connect_settings::CaMode,
2408
2409 /// Custom subject alternative names for the server certificate.
2410 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
2411
2412 /// Output only. The list of DNS names used by this instance.
2413 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2414
2415 /// The number of read pool nodes in a read pool.
2416 pub node_count: std::option::Option<i32>,
2417
2418 /// Output only. Entries containing information about each read pool node of
2419 /// the read pool.
2420 pub nodes: std::vec::Vec<crate::model::connect_settings::ConnectPoolNodeConfig>,
2421
2422 /// Optional. Output only. mdx_protocol_support controls how the client uses
2423 /// metadata exchange when connecting to the instance. The values in the list
2424 /// representing parts of the MDX protocol that are supported by this instance.
2425 /// When the list is empty, the instance does not support MDX, so the client
2426 /// must not send an MDX request. The default is empty.
2427 pub mdx_protocol_support: std::vec::Vec<crate::model::connect_settings::MdxProtocolSupport>,
2428
2429 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2430}
2431
2432impl ConnectSettings {
2433 pub fn new() -> Self {
2434 std::default::Default::default()
2435 }
2436
2437 /// Sets the value of [kind][crate::model::ConnectSettings::kind].
2438 ///
2439 /// # Example
2440 /// ```ignore,no_run
2441 /// # use google_cloud_sql_v1::model::ConnectSettings;
2442 /// let x = ConnectSettings::new().set_kind("example");
2443 /// ```
2444 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2445 self.kind = v.into();
2446 self
2447 }
2448
2449 /// Sets the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2450 ///
2451 /// # Example
2452 /// ```ignore,no_run
2453 /// # use google_cloud_sql_v1::model::ConnectSettings;
2454 /// use google_cloud_sql_v1::model::SslCert;
2455 /// let x = ConnectSettings::new().set_server_ca_cert(SslCert::default()/* use setters */);
2456 /// ```
2457 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
2458 where
2459 T: std::convert::Into<crate::model::SslCert>,
2460 {
2461 self.server_ca_cert = std::option::Option::Some(v.into());
2462 self
2463 }
2464
2465 /// Sets or clears the value of [server_ca_cert][crate::model::ConnectSettings::server_ca_cert].
2466 ///
2467 /// # Example
2468 /// ```ignore,no_run
2469 /// # use google_cloud_sql_v1::model::ConnectSettings;
2470 /// use google_cloud_sql_v1::model::SslCert;
2471 /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
2472 /// let x = ConnectSettings::new().set_or_clear_server_ca_cert(None::<SslCert>);
2473 /// ```
2474 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
2475 where
2476 T: std::convert::Into<crate::model::SslCert>,
2477 {
2478 self.server_ca_cert = v.map(|x| x.into());
2479 self
2480 }
2481
2482 /// Sets the value of [ip_addresses][crate::model::ConnectSettings::ip_addresses].
2483 ///
2484 /// # Example
2485 /// ```ignore,no_run
2486 /// # use google_cloud_sql_v1::model::ConnectSettings;
2487 /// use google_cloud_sql_v1::model::IpMapping;
2488 /// let x = ConnectSettings::new()
2489 /// .set_ip_addresses([
2490 /// IpMapping::default()/* use setters */,
2491 /// IpMapping::default()/* use (different) setters */,
2492 /// ]);
2493 /// ```
2494 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2495 where
2496 T: std::iter::IntoIterator<Item = V>,
2497 V: std::convert::Into<crate::model::IpMapping>,
2498 {
2499 use std::iter::Iterator;
2500 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2501 self
2502 }
2503
2504 /// Sets the value of [region][crate::model::ConnectSettings::region].
2505 ///
2506 /// # Example
2507 /// ```ignore,no_run
2508 /// # use google_cloud_sql_v1::model::ConnectSettings;
2509 /// let x = ConnectSettings::new().set_region("example");
2510 /// ```
2511 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2512 self.region = v.into();
2513 self
2514 }
2515
2516 /// Sets the value of [database_version][crate::model::ConnectSettings::database_version].
2517 ///
2518 /// # Example
2519 /// ```ignore,no_run
2520 /// # use google_cloud_sql_v1::model::ConnectSettings;
2521 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
2522 /// let x0 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql56);
2523 /// let x1 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql57);
2524 /// let x2 = ConnectSettings::new().set_database_version(SqlDatabaseVersion::Mysql80);
2525 /// ```
2526 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
2527 mut self,
2528 v: T,
2529 ) -> Self {
2530 self.database_version = v.into();
2531 self
2532 }
2533
2534 /// Sets the value of [backend_type][crate::model::ConnectSettings::backend_type].
2535 ///
2536 /// # Example
2537 /// ```ignore,no_run
2538 /// # use google_cloud_sql_v1::model::ConnectSettings;
2539 /// use google_cloud_sql_v1::model::SqlBackendType;
2540 /// let x0 = ConnectSettings::new().set_backend_type(SqlBackendType::SecondGen);
2541 /// let x1 = ConnectSettings::new().set_backend_type(SqlBackendType::External);
2542 /// ```
2543 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
2544 mut self,
2545 v: T,
2546 ) -> Self {
2547 self.backend_type = v.into();
2548 self
2549 }
2550
2551 /// Sets the value of [psc_enabled][crate::model::ConnectSettings::psc_enabled].
2552 ///
2553 /// # Example
2554 /// ```ignore,no_run
2555 /// # use google_cloud_sql_v1::model::ConnectSettings;
2556 /// let x = ConnectSettings::new().set_psc_enabled(true);
2557 /// ```
2558 pub fn set_psc_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2559 self.psc_enabled = v.into();
2560 self
2561 }
2562
2563 /// Sets the value of [dns_name][crate::model::ConnectSettings::dns_name].
2564 ///
2565 /// # Example
2566 /// ```ignore,no_run
2567 /// # use google_cloud_sql_v1::model::ConnectSettings;
2568 /// let x = ConnectSettings::new().set_dns_name("example");
2569 /// ```
2570 pub fn set_dns_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2571 self.dns_name = v.into();
2572 self
2573 }
2574
2575 /// Sets the value of [server_ca_mode][crate::model::ConnectSettings::server_ca_mode].
2576 ///
2577 /// # Example
2578 /// ```ignore,no_run
2579 /// # use google_cloud_sql_v1::model::ConnectSettings;
2580 /// use google_cloud_sql_v1::model::connect_settings::CaMode;
2581 /// let x0 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
2582 /// let x1 = ConnectSettings::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
2583 /// let x2 = ConnectSettings::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
2584 /// ```
2585 pub fn set_server_ca_mode<T: std::convert::Into<crate::model::connect_settings::CaMode>>(
2586 mut self,
2587 v: T,
2588 ) -> Self {
2589 self.server_ca_mode = v.into();
2590 self
2591 }
2592
2593 /// Sets the value of [custom_subject_alternative_names][crate::model::ConnectSettings::custom_subject_alternative_names].
2594 ///
2595 /// # Example
2596 /// ```ignore,no_run
2597 /// # use google_cloud_sql_v1::model::ConnectSettings;
2598 /// let x = ConnectSettings::new().set_custom_subject_alternative_names(["a", "b", "c"]);
2599 /// ```
2600 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
2601 where
2602 T: std::iter::IntoIterator<Item = V>,
2603 V: std::convert::Into<std::string::String>,
2604 {
2605 use std::iter::Iterator;
2606 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
2607 self
2608 }
2609
2610 /// Sets the value of [dns_names][crate::model::ConnectSettings::dns_names].
2611 ///
2612 /// # Example
2613 /// ```ignore,no_run
2614 /// # use google_cloud_sql_v1::model::ConnectSettings;
2615 /// use google_cloud_sql_v1::model::DnsNameMapping;
2616 /// let x = ConnectSettings::new()
2617 /// .set_dns_names([
2618 /// DnsNameMapping::default()/* use setters */,
2619 /// DnsNameMapping::default()/* use (different) setters */,
2620 /// ]);
2621 /// ```
2622 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2623 where
2624 T: std::iter::IntoIterator<Item = V>,
2625 V: std::convert::Into<crate::model::DnsNameMapping>,
2626 {
2627 use std::iter::Iterator;
2628 self.dns_names = v.into_iter().map(|i| i.into()).collect();
2629 self
2630 }
2631
2632 /// Sets the value of [node_count][crate::model::ConnectSettings::node_count].
2633 ///
2634 /// # Example
2635 /// ```ignore,no_run
2636 /// # use google_cloud_sql_v1::model::ConnectSettings;
2637 /// let x = ConnectSettings::new().set_node_count(42);
2638 /// ```
2639 pub fn set_node_count<T>(mut self, v: T) -> Self
2640 where
2641 T: std::convert::Into<i32>,
2642 {
2643 self.node_count = std::option::Option::Some(v.into());
2644 self
2645 }
2646
2647 /// Sets or clears the value of [node_count][crate::model::ConnectSettings::node_count].
2648 ///
2649 /// # Example
2650 /// ```ignore,no_run
2651 /// # use google_cloud_sql_v1::model::ConnectSettings;
2652 /// let x = ConnectSettings::new().set_or_clear_node_count(Some(42));
2653 /// let x = ConnectSettings::new().set_or_clear_node_count(None::<i32>);
2654 /// ```
2655 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
2656 where
2657 T: std::convert::Into<i32>,
2658 {
2659 self.node_count = v.map(|x| x.into());
2660 self
2661 }
2662
2663 /// Sets the value of [nodes][crate::model::ConnectSettings::nodes].
2664 ///
2665 /// # Example
2666 /// ```ignore,no_run
2667 /// # use google_cloud_sql_v1::model::ConnectSettings;
2668 /// use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2669 /// let x = ConnectSettings::new()
2670 /// .set_nodes([
2671 /// ConnectPoolNodeConfig::default()/* use setters */,
2672 /// ConnectPoolNodeConfig::default()/* use (different) setters */,
2673 /// ]);
2674 /// ```
2675 pub fn set_nodes<T, V>(mut self, v: T) -> Self
2676 where
2677 T: std::iter::IntoIterator<Item = V>,
2678 V: std::convert::Into<crate::model::connect_settings::ConnectPoolNodeConfig>,
2679 {
2680 use std::iter::Iterator;
2681 self.nodes = v.into_iter().map(|i| i.into()).collect();
2682 self
2683 }
2684
2685 /// Sets the value of [mdx_protocol_support][crate::model::ConnectSettings::mdx_protocol_support].
2686 ///
2687 /// # Example
2688 /// ```ignore,no_run
2689 /// # use google_cloud_sql_v1::model::ConnectSettings;
2690 /// use google_cloud_sql_v1::model::connect_settings::MdxProtocolSupport;
2691 /// let x = ConnectSettings::new().set_mdx_protocol_support([
2692 /// MdxProtocolSupport::ClientProtocolType,
2693 /// ]);
2694 /// ```
2695 pub fn set_mdx_protocol_support<T, V>(mut self, v: T) -> Self
2696 where
2697 T: std::iter::IntoIterator<Item = V>,
2698 V: std::convert::Into<crate::model::connect_settings::MdxProtocolSupport>,
2699 {
2700 use std::iter::Iterator;
2701 self.mdx_protocol_support = v.into_iter().map(|i| i.into()).collect();
2702 self
2703 }
2704}
2705
2706impl wkt::message::Message for ConnectSettings {
2707 fn typename() -> &'static str {
2708 "type.googleapis.com/google.cloud.sql.v1.ConnectSettings"
2709 }
2710}
2711
2712/// Defines additional types related to [ConnectSettings].
2713pub mod connect_settings {
2714 #[allow(unused_imports)]
2715 use super::*;
2716
2717 /// Details of a single read pool node of a read pool.
2718 #[derive(Clone, Default, PartialEq)]
2719 #[non_exhaustive]
2720 pub struct ConnectPoolNodeConfig {
2721 /// Output only. The name of the read pool node. Doesn't include the project
2722 /// ID.
2723 pub name: std::option::Option<std::string::String>,
2724
2725 /// Output only. Mappings containing IP addresses that can be used to connect
2726 /// to the read pool node.
2727 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
2728
2729 /// Output only. The DNS name of the read pool node.
2730 pub dns_name: std::option::Option<std::string::String>,
2731
2732 /// Output only. The list of DNS names used by this read pool node.
2733 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
2734
2735 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2736 }
2737
2738 impl ConnectPoolNodeConfig {
2739 pub fn new() -> Self {
2740 std::default::Default::default()
2741 }
2742
2743 /// Sets the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2744 ///
2745 /// # Example
2746 /// ```ignore,no_run
2747 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2748 /// let x = ConnectPoolNodeConfig::new().set_name("example");
2749 /// ```
2750 pub fn set_name<T>(mut self, v: T) -> Self
2751 where
2752 T: std::convert::Into<std::string::String>,
2753 {
2754 self.name = std::option::Option::Some(v.into());
2755 self
2756 }
2757
2758 /// Sets or clears the value of [name][crate::model::connect_settings::ConnectPoolNodeConfig::name].
2759 ///
2760 /// # Example
2761 /// ```ignore,no_run
2762 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2763 /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(Some("example"));
2764 /// let x = ConnectPoolNodeConfig::new().set_or_clear_name(None::<String>);
2765 /// ```
2766 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
2767 where
2768 T: std::convert::Into<std::string::String>,
2769 {
2770 self.name = v.map(|x| x.into());
2771 self
2772 }
2773
2774 /// Sets the value of [ip_addresses][crate::model::connect_settings::ConnectPoolNodeConfig::ip_addresses].
2775 ///
2776 /// # Example
2777 /// ```ignore,no_run
2778 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2779 /// use google_cloud_sql_v1::model::IpMapping;
2780 /// let x = ConnectPoolNodeConfig::new()
2781 /// .set_ip_addresses([
2782 /// IpMapping::default()/* use setters */,
2783 /// IpMapping::default()/* use (different) setters */,
2784 /// ]);
2785 /// ```
2786 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
2787 where
2788 T: std::iter::IntoIterator<Item = V>,
2789 V: std::convert::Into<crate::model::IpMapping>,
2790 {
2791 use std::iter::Iterator;
2792 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
2793 self
2794 }
2795
2796 /// Sets the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2797 ///
2798 /// # Example
2799 /// ```ignore,no_run
2800 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2801 /// let x = ConnectPoolNodeConfig::new().set_dns_name("example");
2802 /// ```
2803 pub fn set_dns_name<T>(mut self, v: T) -> Self
2804 where
2805 T: std::convert::Into<std::string::String>,
2806 {
2807 self.dns_name = std::option::Option::Some(v.into());
2808 self
2809 }
2810
2811 /// Sets or clears the value of [dns_name][crate::model::connect_settings::ConnectPoolNodeConfig::dns_name].
2812 ///
2813 /// # Example
2814 /// ```ignore,no_run
2815 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2816 /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
2817 /// let x = ConnectPoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
2818 /// ```
2819 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
2820 where
2821 T: std::convert::Into<std::string::String>,
2822 {
2823 self.dns_name = v.map(|x| x.into());
2824 self
2825 }
2826
2827 /// Sets the value of [dns_names][crate::model::connect_settings::ConnectPoolNodeConfig::dns_names].
2828 ///
2829 /// # Example
2830 /// ```ignore,no_run
2831 /// # use google_cloud_sql_v1::model::connect_settings::ConnectPoolNodeConfig;
2832 /// use google_cloud_sql_v1::model::DnsNameMapping;
2833 /// let x = ConnectPoolNodeConfig::new()
2834 /// .set_dns_names([
2835 /// DnsNameMapping::default()/* use setters */,
2836 /// DnsNameMapping::default()/* use (different) setters */,
2837 /// ]);
2838 /// ```
2839 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
2840 where
2841 T: std::iter::IntoIterator<Item = V>,
2842 V: std::convert::Into<crate::model::DnsNameMapping>,
2843 {
2844 use std::iter::Iterator;
2845 self.dns_names = v.into_iter().map(|i| i.into()).collect();
2846 self
2847 }
2848 }
2849
2850 impl wkt::message::Message for ConnectPoolNodeConfig {
2851 fn typename() -> &'static str {
2852 "type.googleapis.com/google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig"
2853 }
2854 }
2855
2856 /// Various Certificate Authority (CA) modes for certificate signing.
2857 ///
2858 /// # Working with unknown values
2859 ///
2860 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2861 /// additional enum variants at any time. Adding new variants is not considered
2862 /// a breaking change. Applications should write their code in anticipation of:
2863 ///
2864 /// - New values appearing in future releases of the client library, **and**
2865 /// - New values received dynamically, without application changes.
2866 ///
2867 /// Please consult the [Working with enums] section in the user guide for some
2868 /// guidelines.
2869 ///
2870 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2871 #[derive(Clone, Debug, PartialEq)]
2872 #[non_exhaustive]
2873 pub enum CaMode {
2874 /// CA mode is unknown.
2875 Unspecified,
2876 /// Google-managed self-signed internal CA.
2877 GoogleManagedInternalCa,
2878 /// Google-managed regional CA part of root CA hierarchy hosted on Google
2879 /// Cloud's Certificate Authority Service (CAS).
2880 GoogleManagedCasCa,
2881 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
2882 /// Service (CAS).
2883 CustomerManagedCasCa,
2884 /// If set, the enum was initialized with an unknown value.
2885 ///
2886 /// Applications can examine the value using [CaMode::value] or
2887 /// [CaMode::name].
2888 UnknownValue(ca_mode::UnknownValue),
2889 }
2890
2891 #[doc(hidden)]
2892 pub mod ca_mode {
2893 #[allow(unused_imports)]
2894 use super::*;
2895 #[derive(Clone, Debug, PartialEq)]
2896 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2897 }
2898
2899 impl CaMode {
2900 /// Gets the enum value.
2901 ///
2902 /// Returns `None` if the enum contains an unknown value deserialized from
2903 /// the string representation of enums.
2904 pub fn value(&self) -> std::option::Option<i32> {
2905 match self {
2906 Self::Unspecified => std::option::Option::Some(0),
2907 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
2908 Self::GoogleManagedCasCa => std::option::Option::Some(2),
2909 Self::CustomerManagedCasCa => std::option::Option::Some(3),
2910 Self::UnknownValue(u) => u.0.value(),
2911 }
2912 }
2913
2914 /// Gets the enum value as a string.
2915 ///
2916 /// Returns `None` if the enum contains an unknown value deserialized from
2917 /// the integer representation of enums.
2918 pub fn name(&self) -> std::option::Option<&str> {
2919 match self {
2920 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
2921 Self::GoogleManagedInternalCa => {
2922 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
2923 }
2924 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
2925 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
2926 Self::UnknownValue(u) => u.0.name(),
2927 }
2928 }
2929 }
2930
2931 impl std::default::Default for CaMode {
2932 fn default() -> Self {
2933 use std::convert::From;
2934 Self::from(0)
2935 }
2936 }
2937
2938 impl std::fmt::Display for CaMode {
2939 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2940 wkt::internal::display_enum(f, self.name(), self.value())
2941 }
2942 }
2943
2944 impl std::convert::From<i32> for CaMode {
2945 fn from(value: i32) -> Self {
2946 match value {
2947 0 => Self::Unspecified,
2948 1 => Self::GoogleManagedInternalCa,
2949 2 => Self::GoogleManagedCasCa,
2950 3 => Self::CustomerManagedCasCa,
2951 _ => Self::UnknownValue(ca_mode::UnknownValue(
2952 wkt::internal::UnknownEnumValue::Integer(value),
2953 )),
2954 }
2955 }
2956 }
2957
2958 impl std::convert::From<&str> for CaMode {
2959 fn from(value: &str) -> Self {
2960 use std::string::ToString;
2961 match value {
2962 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
2963 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
2964 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
2965 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
2966 _ => Self::UnknownValue(ca_mode::UnknownValue(
2967 wkt::internal::UnknownEnumValue::String(value.to_string()),
2968 )),
2969 }
2970 }
2971 }
2972
2973 impl serde::ser::Serialize for CaMode {
2974 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2975 where
2976 S: serde::Serializer,
2977 {
2978 match self {
2979 Self::Unspecified => serializer.serialize_i32(0),
2980 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
2981 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
2982 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
2983 Self::UnknownValue(u) => u.0.serialize(serializer),
2984 }
2985 }
2986 }
2987
2988 impl<'de> serde::de::Deserialize<'de> for CaMode {
2989 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2990 where
2991 D: serde::Deserializer<'de>,
2992 {
2993 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
2994 ".google.cloud.sql.v1.ConnectSettings.CaMode",
2995 ))
2996 }
2997 }
2998
2999 /// MdxProtocolSupport describes parts of the MDX protocol supported by this
3000 /// instance.
3001 ///
3002 /// # Working with unknown values
3003 ///
3004 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3005 /// additional enum variants at any time. Adding new variants is not considered
3006 /// a breaking change. Applications should write their code in anticipation of:
3007 ///
3008 /// - New values appearing in future releases of the client library, **and**
3009 /// - New values received dynamically, without application changes.
3010 ///
3011 /// Please consult the [Working with enums] section in the user guide for some
3012 /// guidelines.
3013 ///
3014 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3015 #[derive(Clone, Debug, PartialEq)]
3016 #[non_exhaustive]
3017 pub enum MdxProtocolSupport {
3018 /// Not specified.
3019 Unspecified,
3020 /// Client should send the client protocol type in the MDX request.
3021 ClientProtocolType,
3022 /// If set, the enum was initialized with an unknown value.
3023 ///
3024 /// Applications can examine the value using [MdxProtocolSupport::value] or
3025 /// [MdxProtocolSupport::name].
3026 UnknownValue(mdx_protocol_support::UnknownValue),
3027 }
3028
3029 #[doc(hidden)]
3030 pub mod mdx_protocol_support {
3031 #[allow(unused_imports)]
3032 use super::*;
3033 #[derive(Clone, Debug, PartialEq)]
3034 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3035 }
3036
3037 impl MdxProtocolSupport {
3038 /// Gets the enum value.
3039 ///
3040 /// Returns `None` if the enum contains an unknown value deserialized from
3041 /// the string representation of enums.
3042 pub fn value(&self) -> std::option::Option<i32> {
3043 match self {
3044 Self::Unspecified => std::option::Option::Some(0),
3045 Self::ClientProtocolType => std::option::Option::Some(1),
3046 Self::UnknownValue(u) => u.0.value(),
3047 }
3048 }
3049
3050 /// Gets the enum value as a string.
3051 ///
3052 /// Returns `None` if the enum contains an unknown value deserialized from
3053 /// the integer representation of enums.
3054 pub fn name(&self) -> std::option::Option<&str> {
3055 match self {
3056 Self::Unspecified => std::option::Option::Some("MDX_PROTOCOL_SUPPORT_UNSPECIFIED"),
3057 Self::ClientProtocolType => std::option::Option::Some("CLIENT_PROTOCOL_TYPE"),
3058 Self::UnknownValue(u) => u.0.name(),
3059 }
3060 }
3061 }
3062
3063 impl std::default::Default for MdxProtocolSupport {
3064 fn default() -> Self {
3065 use std::convert::From;
3066 Self::from(0)
3067 }
3068 }
3069
3070 impl std::fmt::Display for MdxProtocolSupport {
3071 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3072 wkt::internal::display_enum(f, self.name(), self.value())
3073 }
3074 }
3075
3076 impl std::convert::From<i32> for MdxProtocolSupport {
3077 fn from(value: i32) -> Self {
3078 match value {
3079 0 => Self::Unspecified,
3080 1 => Self::ClientProtocolType,
3081 _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3082 wkt::internal::UnknownEnumValue::Integer(value),
3083 )),
3084 }
3085 }
3086 }
3087
3088 impl std::convert::From<&str> for MdxProtocolSupport {
3089 fn from(value: &str) -> Self {
3090 use std::string::ToString;
3091 match value {
3092 "MDX_PROTOCOL_SUPPORT_UNSPECIFIED" => Self::Unspecified,
3093 "CLIENT_PROTOCOL_TYPE" => Self::ClientProtocolType,
3094 _ => Self::UnknownValue(mdx_protocol_support::UnknownValue(
3095 wkt::internal::UnknownEnumValue::String(value.to_string()),
3096 )),
3097 }
3098 }
3099 }
3100
3101 impl serde::ser::Serialize for MdxProtocolSupport {
3102 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3103 where
3104 S: serde::Serializer,
3105 {
3106 match self {
3107 Self::Unspecified => serializer.serialize_i32(0),
3108 Self::ClientProtocolType => serializer.serialize_i32(1),
3109 Self::UnknownValue(u) => u.0.serialize(serializer),
3110 }
3111 }
3112 }
3113
3114 impl<'de> serde::de::Deserialize<'de> for MdxProtocolSupport {
3115 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3116 where
3117 D: serde::Deserializer<'de>,
3118 {
3119 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MdxProtocolSupport>::new(
3120 ".google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport",
3121 ))
3122 }
3123 }
3124}
3125
3126/// Ephemeral certificate creation request.
3127#[derive(Clone, Default, PartialEq)]
3128#[non_exhaustive]
3129pub struct GenerateEphemeralCertRequest {
3130 /// Cloud SQL instance ID. This does not include the project ID.
3131 pub instance: std::string::String,
3132
3133 /// Project ID of the project that contains the instance.
3134 pub project: std::string::String,
3135
3136 /// PEM encoded public key to include in the signed certificate.
3137 pub public_key: std::string::String,
3138
3139 /// Optional. Access token to include in the signed certificate.
3140 pub access_token: std::string::String,
3141
3142 /// Optional. Optional snapshot read timestamp to trade freshness for
3143 /// performance.
3144 pub read_time: std::option::Option<wkt::Timestamp>,
3145
3146 /// Optional. If set, it will contain the cert valid duration.
3147 pub valid_duration: std::option::Option<wkt::Duration>,
3148
3149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3150}
3151
3152impl GenerateEphemeralCertRequest {
3153 pub fn new() -> Self {
3154 std::default::Default::default()
3155 }
3156
3157 /// Sets the value of [instance][crate::model::GenerateEphemeralCertRequest::instance].
3158 ///
3159 /// # Example
3160 /// ```ignore,no_run
3161 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3162 /// let x = GenerateEphemeralCertRequest::new().set_instance("example");
3163 /// ```
3164 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3165 self.instance = v.into();
3166 self
3167 }
3168
3169 /// Sets the value of [project][crate::model::GenerateEphemeralCertRequest::project].
3170 ///
3171 /// # Example
3172 /// ```ignore,no_run
3173 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3174 /// let x = GenerateEphemeralCertRequest::new().set_project("example");
3175 /// ```
3176 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3177 self.project = v.into();
3178 self
3179 }
3180
3181 /// Sets the value of [public_key][crate::model::GenerateEphemeralCertRequest::public_key].
3182 ///
3183 /// # Example
3184 /// ```ignore,no_run
3185 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3186 /// let x = GenerateEphemeralCertRequest::new().set_public_key("example");
3187 /// ```
3188 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3189 self.public_key = v.into();
3190 self
3191 }
3192
3193 /// Sets the value of [access_token][crate::model::GenerateEphemeralCertRequest::access_token].
3194 ///
3195 /// # Example
3196 /// ```ignore,no_run
3197 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3198 /// let x = GenerateEphemeralCertRequest::new().set_access_token("example");
3199 /// ```
3200 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3201 self.access_token = v.into();
3202 self
3203 }
3204
3205 /// Sets the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3206 ///
3207 /// # Example
3208 /// ```ignore,no_run
3209 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3210 /// use wkt::Timestamp;
3211 /// let x = GenerateEphemeralCertRequest::new().set_read_time(Timestamp::default()/* use setters */);
3212 /// ```
3213 pub fn set_read_time<T>(mut self, v: T) -> Self
3214 where
3215 T: std::convert::Into<wkt::Timestamp>,
3216 {
3217 self.read_time = std::option::Option::Some(v.into());
3218 self
3219 }
3220
3221 /// Sets or clears the value of [read_time][crate::model::GenerateEphemeralCertRequest::read_time].
3222 ///
3223 /// # Example
3224 /// ```ignore,no_run
3225 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3226 /// use wkt::Timestamp;
3227 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(Some(Timestamp::default()/* use setters */));
3228 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_read_time(None::<Timestamp>);
3229 /// ```
3230 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
3231 where
3232 T: std::convert::Into<wkt::Timestamp>,
3233 {
3234 self.read_time = v.map(|x| x.into());
3235 self
3236 }
3237
3238 /// Sets the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3239 ///
3240 /// # Example
3241 /// ```ignore,no_run
3242 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3243 /// use wkt::Duration;
3244 /// let x = GenerateEphemeralCertRequest::new().set_valid_duration(Duration::default()/* use setters */);
3245 /// ```
3246 pub fn set_valid_duration<T>(mut self, v: T) -> Self
3247 where
3248 T: std::convert::Into<wkt::Duration>,
3249 {
3250 self.valid_duration = std::option::Option::Some(v.into());
3251 self
3252 }
3253
3254 /// Sets or clears the value of [valid_duration][crate::model::GenerateEphemeralCertRequest::valid_duration].
3255 ///
3256 /// # Example
3257 /// ```ignore,no_run
3258 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertRequest;
3259 /// use wkt::Duration;
3260 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(Some(Duration::default()/* use setters */));
3261 /// let x = GenerateEphemeralCertRequest::new().set_or_clear_valid_duration(None::<Duration>);
3262 /// ```
3263 pub fn set_or_clear_valid_duration<T>(mut self, v: std::option::Option<T>) -> Self
3264 where
3265 T: std::convert::Into<wkt::Duration>,
3266 {
3267 self.valid_duration = v.map(|x| x.into());
3268 self
3269 }
3270}
3271
3272impl wkt::message::Message for GenerateEphemeralCertRequest {
3273 fn typename() -> &'static str {
3274 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertRequest"
3275 }
3276}
3277
3278/// Ephemeral certificate creation request.
3279#[derive(Clone, Default, PartialEq)]
3280#[non_exhaustive]
3281pub struct GenerateEphemeralCertResponse {
3282 /// Generated cert
3283 pub ephemeral_cert: std::option::Option<crate::model::SslCert>,
3284
3285 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3286}
3287
3288impl GenerateEphemeralCertResponse {
3289 pub fn new() -> Self {
3290 std::default::Default::default()
3291 }
3292
3293 /// Sets the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3294 ///
3295 /// # Example
3296 /// ```ignore,no_run
3297 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3298 /// use google_cloud_sql_v1::model::SslCert;
3299 /// let x = GenerateEphemeralCertResponse::new().set_ephemeral_cert(SslCert::default()/* use setters */);
3300 /// ```
3301 pub fn set_ephemeral_cert<T>(mut self, v: T) -> Self
3302 where
3303 T: std::convert::Into<crate::model::SslCert>,
3304 {
3305 self.ephemeral_cert = std::option::Option::Some(v.into());
3306 self
3307 }
3308
3309 /// Sets or clears the value of [ephemeral_cert][crate::model::GenerateEphemeralCertResponse::ephemeral_cert].
3310 ///
3311 /// # Example
3312 /// ```ignore,no_run
3313 /// # use google_cloud_sql_v1::model::GenerateEphemeralCertResponse;
3314 /// use google_cloud_sql_v1::model::SslCert;
3315 /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(Some(SslCert::default()/* use setters */));
3316 /// let x = GenerateEphemeralCertResponse::new().set_or_clear_ephemeral_cert(None::<SslCert>);
3317 /// ```
3318 pub fn set_or_clear_ephemeral_cert<T>(mut self, v: std::option::Option<T>) -> Self
3319 where
3320 T: std::convert::Into<crate::model::SslCert>,
3321 {
3322 self.ephemeral_cert = v.map(|x| x.into());
3323 self
3324 }
3325}
3326
3327impl wkt::message::Message for GenerateEphemeralCertResponse {
3328 fn typename() -> &'static str {
3329 "type.googleapis.com/google.cloud.sql.v1.GenerateEphemeralCertResponse"
3330 }
3331}
3332
3333/// Database delete request.
3334#[derive(Clone, Default, PartialEq)]
3335#[non_exhaustive]
3336pub struct SqlDatabasesDeleteRequest {
3337 /// Name of the database to be deleted in the instance.
3338 pub database: std::string::String,
3339
3340 /// Database instance ID. This does not include the project ID.
3341 pub instance: std::string::String,
3342
3343 /// Project ID of the project that contains the instance.
3344 pub project: std::string::String,
3345
3346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3347}
3348
3349impl SqlDatabasesDeleteRequest {
3350 pub fn new() -> Self {
3351 std::default::Default::default()
3352 }
3353
3354 /// Sets the value of [database][crate::model::SqlDatabasesDeleteRequest::database].
3355 ///
3356 /// # Example
3357 /// ```ignore,no_run
3358 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3359 /// let x = SqlDatabasesDeleteRequest::new().set_database("example");
3360 /// ```
3361 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3362 self.database = v.into();
3363 self
3364 }
3365
3366 /// Sets the value of [instance][crate::model::SqlDatabasesDeleteRequest::instance].
3367 ///
3368 /// # Example
3369 /// ```ignore,no_run
3370 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3371 /// let x = SqlDatabasesDeleteRequest::new().set_instance("example");
3372 /// ```
3373 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3374 self.instance = v.into();
3375 self
3376 }
3377
3378 /// Sets the value of [project][crate::model::SqlDatabasesDeleteRequest::project].
3379 ///
3380 /// # Example
3381 /// ```ignore,no_run
3382 /// # use google_cloud_sql_v1::model::SqlDatabasesDeleteRequest;
3383 /// let x = SqlDatabasesDeleteRequest::new().set_project("example");
3384 /// ```
3385 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3386 self.project = v.into();
3387 self
3388 }
3389}
3390
3391impl wkt::message::Message for SqlDatabasesDeleteRequest {
3392 fn typename() -> &'static str {
3393 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesDeleteRequest"
3394 }
3395}
3396
3397/// Database get request.
3398#[derive(Clone, Default, PartialEq)]
3399#[non_exhaustive]
3400pub struct SqlDatabasesGetRequest {
3401 /// Name of the database in the instance.
3402 pub database: std::string::String,
3403
3404 /// Database instance ID. This does not include the project ID.
3405 pub instance: std::string::String,
3406
3407 /// Project ID of the project that contains the instance.
3408 pub project: std::string::String,
3409
3410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3411}
3412
3413impl SqlDatabasesGetRequest {
3414 pub fn new() -> Self {
3415 std::default::Default::default()
3416 }
3417
3418 /// Sets the value of [database][crate::model::SqlDatabasesGetRequest::database].
3419 ///
3420 /// # Example
3421 /// ```ignore,no_run
3422 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3423 /// let x = SqlDatabasesGetRequest::new().set_database("example");
3424 /// ```
3425 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3426 self.database = v.into();
3427 self
3428 }
3429
3430 /// Sets the value of [instance][crate::model::SqlDatabasesGetRequest::instance].
3431 ///
3432 /// # Example
3433 /// ```ignore,no_run
3434 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3435 /// let x = SqlDatabasesGetRequest::new().set_instance("example");
3436 /// ```
3437 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3438 self.instance = v.into();
3439 self
3440 }
3441
3442 /// Sets the value of [project][crate::model::SqlDatabasesGetRequest::project].
3443 ///
3444 /// # Example
3445 /// ```ignore,no_run
3446 /// # use google_cloud_sql_v1::model::SqlDatabasesGetRequest;
3447 /// let x = SqlDatabasesGetRequest::new().set_project("example");
3448 /// ```
3449 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3450 self.project = v.into();
3451 self
3452 }
3453}
3454
3455impl wkt::message::Message for SqlDatabasesGetRequest {
3456 fn typename() -> &'static str {
3457 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesGetRequest"
3458 }
3459}
3460
3461/// Database insert request.
3462#[derive(Clone, Default, PartialEq)]
3463#[non_exhaustive]
3464pub struct SqlDatabasesInsertRequest {
3465 /// Database instance ID. This does not include the project ID.
3466 pub instance: std::string::String,
3467
3468 /// Project ID of the project that contains the instance.
3469 pub project: std::string::String,
3470
3471 pub body: std::option::Option<crate::model::Database>,
3472
3473 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3474}
3475
3476impl SqlDatabasesInsertRequest {
3477 pub fn new() -> Self {
3478 std::default::Default::default()
3479 }
3480
3481 /// Sets the value of [instance][crate::model::SqlDatabasesInsertRequest::instance].
3482 ///
3483 /// # Example
3484 /// ```ignore,no_run
3485 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3486 /// let x = SqlDatabasesInsertRequest::new().set_instance("example");
3487 /// ```
3488 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3489 self.instance = v.into();
3490 self
3491 }
3492
3493 /// Sets the value of [project][crate::model::SqlDatabasesInsertRequest::project].
3494 ///
3495 /// # Example
3496 /// ```ignore,no_run
3497 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3498 /// let x = SqlDatabasesInsertRequest::new().set_project("example");
3499 /// ```
3500 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3501 self.project = v.into();
3502 self
3503 }
3504
3505 /// Sets the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3506 ///
3507 /// # Example
3508 /// ```ignore,no_run
3509 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3510 /// use google_cloud_sql_v1::model::Database;
3511 /// let x = SqlDatabasesInsertRequest::new().set_body(Database::default()/* use setters */);
3512 /// ```
3513 pub fn set_body<T>(mut self, v: T) -> Self
3514 where
3515 T: std::convert::Into<crate::model::Database>,
3516 {
3517 self.body = std::option::Option::Some(v.into());
3518 self
3519 }
3520
3521 /// Sets or clears the value of [body][crate::model::SqlDatabasesInsertRequest::body].
3522 ///
3523 /// # Example
3524 /// ```ignore,no_run
3525 /// # use google_cloud_sql_v1::model::SqlDatabasesInsertRequest;
3526 /// use google_cloud_sql_v1::model::Database;
3527 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3528 /// let x = SqlDatabasesInsertRequest::new().set_or_clear_body(None::<Database>);
3529 /// ```
3530 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3531 where
3532 T: std::convert::Into<crate::model::Database>,
3533 {
3534 self.body = v.map(|x| x.into());
3535 self
3536 }
3537}
3538
3539impl wkt::message::Message for SqlDatabasesInsertRequest {
3540 fn typename() -> &'static str {
3541 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesInsertRequest"
3542 }
3543}
3544
3545/// Database list request.
3546#[derive(Clone, Default, PartialEq)]
3547#[non_exhaustive]
3548pub struct SqlDatabasesListRequest {
3549 /// Cloud SQL instance ID. This does not include the project ID.
3550 pub instance: std::string::String,
3551
3552 /// Project ID of the project that contains the instance.
3553 pub project: std::string::String,
3554
3555 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3556}
3557
3558impl SqlDatabasesListRequest {
3559 pub fn new() -> Self {
3560 std::default::Default::default()
3561 }
3562
3563 /// Sets the value of [instance][crate::model::SqlDatabasesListRequest::instance].
3564 ///
3565 /// # Example
3566 /// ```ignore,no_run
3567 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3568 /// let x = SqlDatabasesListRequest::new().set_instance("example");
3569 /// ```
3570 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3571 self.instance = v.into();
3572 self
3573 }
3574
3575 /// Sets the value of [project][crate::model::SqlDatabasesListRequest::project].
3576 ///
3577 /// # Example
3578 /// ```ignore,no_run
3579 /// # use google_cloud_sql_v1::model::SqlDatabasesListRequest;
3580 /// let x = SqlDatabasesListRequest::new().set_project("example");
3581 /// ```
3582 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3583 self.project = v.into();
3584 self
3585 }
3586}
3587
3588impl wkt::message::Message for SqlDatabasesListRequest {
3589 fn typename() -> &'static str {
3590 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesListRequest"
3591 }
3592}
3593
3594/// Database update request.
3595#[derive(Clone, Default, PartialEq)]
3596#[non_exhaustive]
3597pub struct SqlDatabasesUpdateRequest {
3598 /// Name of the database to be updated in the instance.
3599 pub database: std::string::String,
3600
3601 /// Database instance ID. This does not include the project ID.
3602 pub instance: std::string::String,
3603
3604 /// Project ID of the project that contains the instance.
3605 pub project: std::string::String,
3606
3607 pub body: std::option::Option<crate::model::Database>,
3608
3609 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3610}
3611
3612impl SqlDatabasesUpdateRequest {
3613 pub fn new() -> Self {
3614 std::default::Default::default()
3615 }
3616
3617 /// Sets the value of [database][crate::model::SqlDatabasesUpdateRequest::database].
3618 ///
3619 /// # Example
3620 /// ```ignore,no_run
3621 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3622 /// let x = SqlDatabasesUpdateRequest::new().set_database("example");
3623 /// ```
3624 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3625 self.database = v.into();
3626 self
3627 }
3628
3629 /// Sets the value of [instance][crate::model::SqlDatabasesUpdateRequest::instance].
3630 ///
3631 /// # Example
3632 /// ```ignore,no_run
3633 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3634 /// let x = SqlDatabasesUpdateRequest::new().set_instance("example");
3635 /// ```
3636 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3637 self.instance = v.into();
3638 self
3639 }
3640
3641 /// Sets the value of [project][crate::model::SqlDatabasesUpdateRequest::project].
3642 ///
3643 /// # Example
3644 /// ```ignore,no_run
3645 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3646 /// let x = SqlDatabasesUpdateRequest::new().set_project("example");
3647 /// ```
3648 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3649 self.project = v.into();
3650 self
3651 }
3652
3653 /// Sets the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3654 ///
3655 /// # Example
3656 /// ```ignore,no_run
3657 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3658 /// use google_cloud_sql_v1::model::Database;
3659 /// let x = SqlDatabasesUpdateRequest::new().set_body(Database::default()/* use setters */);
3660 /// ```
3661 pub fn set_body<T>(mut self, v: T) -> Self
3662 where
3663 T: std::convert::Into<crate::model::Database>,
3664 {
3665 self.body = std::option::Option::Some(v.into());
3666 self
3667 }
3668
3669 /// Sets or clears the value of [body][crate::model::SqlDatabasesUpdateRequest::body].
3670 ///
3671 /// # Example
3672 /// ```ignore,no_run
3673 /// # use google_cloud_sql_v1::model::SqlDatabasesUpdateRequest;
3674 /// use google_cloud_sql_v1::model::Database;
3675 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(Some(Database::default()/* use setters */));
3676 /// let x = SqlDatabasesUpdateRequest::new().set_or_clear_body(None::<Database>);
3677 /// ```
3678 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
3679 where
3680 T: std::convert::Into<crate::model::Database>,
3681 {
3682 self.body = v.map(|x| x.into());
3683 self
3684 }
3685}
3686
3687impl wkt::message::Message for SqlDatabasesUpdateRequest {
3688 fn typename() -> &'static str {
3689 "type.googleapis.com/google.cloud.sql.v1.SqlDatabasesUpdateRequest"
3690 }
3691}
3692
3693/// Database list response.
3694#[derive(Clone, Default, PartialEq)]
3695#[non_exhaustive]
3696pub struct DatabasesListResponse {
3697 /// This is always `sql#databasesList`.
3698 pub kind: std::string::String,
3699
3700 /// List of database resources in the instance.
3701 pub items: std::vec::Vec<crate::model::Database>,
3702
3703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3704}
3705
3706impl DatabasesListResponse {
3707 pub fn new() -> Self {
3708 std::default::Default::default()
3709 }
3710
3711 /// Sets the value of [kind][crate::model::DatabasesListResponse::kind].
3712 ///
3713 /// # Example
3714 /// ```ignore,no_run
3715 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3716 /// let x = DatabasesListResponse::new().set_kind("example");
3717 /// ```
3718 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3719 self.kind = v.into();
3720 self
3721 }
3722
3723 /// Sets the value of [items][crate::model::DatabasesListResponse::items].
3724 ///
3725 /// # Example
3726 /// ```ignore,no_run
3727 /// # use google_cloud_sql_v1::model::DatabasesListResponse;
3728 /// use google_cloud_sql_v1::model::Database;
3729 /// let x = DatabasesListResponse::new()
3730 /// .set_items([
3731 /// Database::default()/* use setters */,
3732 /// Database::default()/* use (different) setters */,
3733 /// ]);
3734 /// ```
3735 pub fn set_items<T, V>(mut self, v: T) -> Self
3736 where
3737 T: std::iter::IntoIterator<Item = V>,
3738 V: std::convert::Into<crate::model::Database>,
3739 {
3740 use std::iter::Iterator;
3741 self.items = v.into_iter().map(|i| i.into()).collect();
3742 self
3743 }
3744}
3745
3746impl wkt::message::Message for DatabasesListResponse {
3747 fn typename() -> &'static str {
3748 "type.googleapis.com/google.cloud.sql.v1.DatabasesListResponse"
3749 }
3750}
3751
3752/// Flags list request.
3753#[derive(Clone, Default, PartialEq)]
3754#[non_exhaustive]
3755pub struct SqlFlagsListRequest {
3756 /// Database type and version you want to retrieve flags for. By default, this
3757 /// method returns flags for all database types and versions.
3758 pub database_version: std::string::String,
3759
3760 /// Optional. Specify the scope of flags to be returned by SqlFlagsListService.
3761 /// Return list of database flags if unspecified.
3762 pub flag_scope: std::option::Option<crate::model::SqlFlagScope>,
3763
3764 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3765}
3766
3767impl SqlFlagsListRequest {
3768 pub fn new() -> Self {
3769 std::default::Default::default()
3770 }
3771
3772 /// Sets the value of [database_version][crate::model::SqlFlagsListRequest::database_version].
3773 ///
3774 /// # Example
3775 /// ```ignore,no_run
3776 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3777 /// let x = SqlFlagsListRequest::new().set_database_version("example");
3778 /// ```
3779 pub fn set_database_version<T: std::convert::Into<std::string::String>>(
3780 mut self,
3781 v: T,
3782 ) -> Self {
3783 self.database_version = v.into();
3784 self
3785 }
3786
3787 /// Sets the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3788 ///
3789 /// # Example
3790 /// ```ignore,no_run
3791 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3792 /// use google_cloud_sql_v1::model::SqlFlagScope;
3793 /// let x0 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::Database);
3794 /// let x1 = SqlFlagsListRequest::new().set_flag_scope(SqlFlagScope::ConnectionPool);
3795 /// ```
3796 pub fn set_flag_scope<T>(mut self, v: T) -> Self
3797 where
3798 T: std::convert::Into<crate::model::SqlFlagScope>,
3799 {
3800 self.flag_scope = std::option::Option::Some(v.into());
3801 self
3802 }
3803
3804 /// Sets or clears the value of [flag_scope][crate::model::SqlFlagsListRequest::flag_scope].
3805 ///
3806 /// # Example
3807 /// ```ignore,no_run
3808 /// # use google_cloud_sql_v1::model::SqlFlagsListRequest;
3809 /// use google_cloud_sql_v1::model::SqlFlagScope;
3810 /// let x0 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::Database));
3811 /// let x1 = SqlFlagsListRequest::new().set_or_clear_flag_scope(Some(SqlFlagScope::ConnectionPool));
3812 /// let x_none = SqlFlagsListRequest::new().set_or_clear_flag_scope(None::<SqlFlagScope>);
3813 /// ```
3814 pub fn set_or_clear_flag_scope<T>(mut self, v: std::option::Option<T>) -> Self
3815 where
3816 T: std::convert::Into<crate::model::SqlFlagScope>,
3817 {
3818 self.flag_scope = v.map(|x| x.into());
3819 self
3820 }
3821}
3822
3823impl wkt::message::Message for SqlFlagsListRequest {
3824 fn typename() -> &'static str {
3825 "type.googleapis.com/google.cloud.sql.v1.SqlFlagsListRequest"
3826 }
3827}
3828
3829/// Flags list response.
3830#[derive(Clone, Default, PartialEq)]
3831#[non_exhaustive]
3832pub struct FlagsListResponse {
3833 /// This is always `sql#flagsList`.
3834 pub kind: std::string::String,
3835
3836 /// List of flags.
3837 pub items: std::vec::Vec<crate::model::Flag>,
3838
3839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3840}
3841
3842impl FlagsListResponse {
3843 pub fn new() -> Self {
3844 std::default::Default::default()
3845 }
3846
3847 /// Sets the value of [kind][crate::model::FlagsListResponse::kind].
3848 ///
3849 /// # Example
3850 /// ```ignore,no_run
3851 /// # use google_cloud_sql_v1::model::FlagsListResponse;
3852 /// let x = FlagsListResponse::new().set_kind("example");
3853 /// ```
3854 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3855 self.kind = v.into();
3856 self
3857 }
3858
3859 /// Sets the value of [items][crate::model::FlagsListResponse::items].
3860 ///
3861 /// # Example
3862 /// ```ignore,no_run
3863 /// # use google_cloud_sql_v1::model::FlagsListResponse;
3864 /// use google_cloud_sql_v1::model::Flag;
3865 /// let x = FlagsListResponse::new()
3866 /// .set_items([
3867 /// Flag::default()/* use setters */,
3868 /// Flag::default()/* use (different) setters */,
3869 /// ]);
3870 /// ```
3871 pub fn set_items<T, V>(mut self, v: T) -> Self
3872 where
3873 T: std::iter::IntoIterator<Item = V>,
3874 V: std::convert::Into<crate::model::Flag>,
3875 {
3876 use std::iter::Iterator;
3877 self.items = v.into_iter().map(|i| i.into()).collect();
3878 self
3879 }
3880}
3881
3882impl wkt::message::Message for FlagsListResponse {
3883 fn typename() -> &'static str {
3884 "type.googleapis.com/google.cloud.sql.v1.FlagsListResponse"
3885 }
3886}
3887
3888/// A flag resource.
3889#[derive(Clone, Default, PartialEq)]
3890#[non_exhaustive]
3891pub struct Flag {
3892 /// This is the name of the flag. Flag names always use underscores, not
3893 /// hyphens, for example: `max_allowed_packet`
3894 pub name: std::string::String,
3895
3896 /// The type of the flag. Flags are typed to being `BOOLEAN`, `STRING`,
3897 /// `INTEGER` or `NONE`. `NONE` is used for flags that do not take a
3898 /// value, such as `skip_grant_tables`.
3899 pub r#type: crate::model::SqlFlagType,
3900
3901 /// The database version this flag applies to. Can be
3902 /// MySQL instances: `MYSQL_8_0`, `MYSQL_8_0_18`, `MYSQL_8_0_26`, `MYSQL_5_7`,
3903 /// or `MYSQL_5_6`. PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
3904 /// `POSTGRES_11` or `POSTGRES_12`. SQL Server instances:
3905 /// `SQLSERVER_2017_STANDARD`, `SQLSERVER_2017_ENTERPRISE`,
3906 /// `SQLSERVER_2017_EXPRESS`, `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
3907 /// `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
3908 /// `SQLSERVER_2019_WEB`.
3909 /// See [the complete
3910 /// list](/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).
3911 pub applies_to: std::vec::Vec<crate::model::SqlDatabaseVersion>,
3912
3913 /// For `STRING` flags, a list of strings that the value can be set to.
3914 pub allowed_string_values: std::vec::Vec<std::string::String>,
3915
3916 /// For `INTEGER` flags, the minimum allowed value.
3917 pub min_value: std::option::Option<wkt::Int64Value>,
3918
3919 /// For `INTEGER` flags, the maximum allowed value.
3920 pub max_value: std::option::Option<wkt::Int64Value>,
3921
3922 /// Indicates whether changing this flag will trigger a database restart. Only
3923 /// applicable to Second Generation instances.
3924 pub requires_restart: std::option::Option<wkt::BoolValue>,
3925
3926 /// This is always `sql#flag`.
3927 pub kind: std::string::String,
3928
3929 /// Whether or not the flag is considered in beta.
3930 pub in_beta: std::option::Option<wkt::BoolValue>,
3931
3932 /// Use this field if only certain integers are accepted. Can be combined
3933 /// with min_value and max_value to add additional values.
3934 pub allowed_int_values: std::vec::Vec<i64>,
3935
3936 /// Scope of flag.
3937 pub flag_scope: crate::model::SqlFlagScope,
3938
3939 /// Recommended flag value for UI display.
3940 pub recommended_value: std::option::Option<crate::model::flag::RecommendedValue>,
3941
3942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3943}
3944
3945impl Flag {
3946 pub fn new() -> Self {
3947 std::default::Default::default()
3948 }
3949
3950 /// Sets the value of [name][crate::model::Flag::name].
3951 ///
3952 /// # Example
3953 /// ```ignore,no_run
3954 /// # use google_cloud_sql_v1::model::Flag;
3955 /// let x = Flag::new().set_name("example");
3956 /// ```
3957 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3958 self.name = v.into();
3959 self
3960 }
3961
3962 /// Sets the value of [r#type][crate::model::Flag::type].
3963 ///
3964 /// # Example
3965 /// ```ignore,no_run
3966 /// # use google_cloud_sql_v1::model::Flag;
3967 /// use google_cloud_sql_v1::model::SqlFlagType;
3968 /// let x0 = Flag::new().set_type(SqlFlagType::Boolean);
3969 /// let x1 = Flag::new().set_type(SqlFlagType::String);
3970 /// let x2 = Flag::new().set_type(SqlFlagType::Integer);
3971 /// ```
3972 pub fn set_type<T: std::convert::Into<crate::model::SqlFlagType>>(mut self, v: T) -> Self {
3973 self.r#type = v.into();
3974 self
3975 }
3976
3977 /// Sets the value of [applies_to][crate::model::Flag::applies_to].
3978 ///
3979 /// # Example
3980 /// ```ignore,no_run
3981 /// # use google_cloud_sql_v1::model::Flag;
3982 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
3983 /// let x = Flag::new().set_applies_to([
3984 /// SqlDatabaseVersion::Mysql56,
3985 /// SqlDatabaseVersion::Mysql57,
3986 /// SqlDatabaseVersion::Mysql80,
3987 /// ]);
3988 /// ```
3989 pub fn set_applies_to<T, V>(mut self, v: T) -> Self
3990 where
3991 T: std::iter::IntoIterator<Item = V>,
3992 V: std::convert::Into<crate::model::SqlDatabaseVersion>,
3993 {
3994 use std::iter::Iterator;
3995 self.applies_to = v.into_iter().map(|i| i.into()).collect();
3996 self
3997 }
3998
3999 /// Sets the value of [allowed_string_values][crate::model::Flag::allowed_string_values].
4000 ///
4001 /// # Example
4002 /// ```ignore,no_run
4003 /// # use google_cloud_sql_v1::model::Flag;
4004 /// let x = Flag::new().set_allowed_string_values(["a", "b", "c"]);
4005 /// ```
4006 pub fn set_allowed_string_values<T, V>(mut self, v: T) -> Self
4007 where
4008 T: std::iter::IntoIterator<Item = V>,
4009 V: std::convert::Into<std::string::String>,
4010 {
4011 use std::iter::Iterator;
4012 self.allowed_string_values = v.into_iter().map(|i| i.into()).collect();
4013 self
4014 }
4015
4016 /// Sets the value of [min_value][crate::model::Flag::min_value].
4017 ///
4018 /// # Example
4019 /// ```ignore,no_run
4020 /// # use google_cloud_sql_v1::model::Flag;
4021 /// use wkt::Int64Value;
4022 /// let x = Flag::new().set_min_value(Int64Value::default()/* use setters */);
4023 /// ```
4024 pub fn set_min_value<T>(mut self, v: T) -> Self
4025 where
4026 T: std::convert::Into<wkt::Int64Value>,
4027 {
4028 self.min_value = std::option::Option::Some(v.into());
4029 self
4030 }
4031
4032 /// Sets or clears the value of [min_value][crate::model::Flag::min_value].
4033 ///
4034 /// # Example
4035 /// ```ignore,no_run
4036 /// # use google_cloud_sql_v1::model::Flag;
4037 /// use wkt::Int64Value;
4038 /// let x = Flag::new().set_or_clear_min_value(Some(Int64Value::default()/* use setters */));
4039 /// let x = Flag::new().set_or_clear_min_value(None::<Int64Value>);
4040 /// ```
4041 pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
4042 where
4043 T: std::convert::Into<wkt::Int64Value>,
4044 {
4045 self.min_value = v.map(|x| x.into());
4046 self
4047 }
4048
4049 /// Sets the value of [max_value][crate::model::Flag::max_value].
4050 ///
4051 /// # Example
4052 /// ```ignore,no_run
4053 /// # use google_cloud_sql_v1::model::Flag;
4054 /// use wkt::Int64Value;
4055 /// let x = Flag::new().set_max_value(Int64Value::default()/* use setters */);
4056 /// ```
4057 pub fn set_max_value<T>(mut self, v: T) -> Self
4058 where
4059 T: std::convert::Into<wkt::Int64Value>,
4060 {
4061 self.max_value = std::option::Option::Some(v.into());
4062 self
4063 }
4064
4065 /// Sets or clears the value of [max_value][crate::model::Flag::max_value].
4066 ///
4067 /// # Example
4068 /// ```ignore,no_run
4069 /// # use google_cloud_sql_v1::model::Flag;
4070 /// use wkt::Int64Value;
4071 /// let x = Flag::new().set_or_clear_max_value(Some(Int64Value::default()/* use setters */));
4072 /// let x = Flag::new().set_or_clear_max_value(None::<Int64Value>);
4073 /// ```
4074 pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
4075 where
4076 T: std::convert::Into<wkt::Int64Value>,
4077 {
4078 self.max_value = v.map(|x| x.into());
4079 self
4080 }
4081
4082 /// Sets the value of [requires_restart][crate::model::Flag::requires_restart].
4083 ///
4084 /// # Example
4085 /// ```ignore,no_run
4086 /// # use google_cloud_sql_v1::model::Flag;
4087 /// use wkt::BoolValue;
4088 /// let x = Flag::new().set_requires_restart(BoolValue::default()/* use setters */);
4089 /// ```
4090 pub fn set_requires_restart<T>(mut self, v: T) -> Self
4091 where
4092 T: std::convert::Into<wkt::BoolValue>,
4093 {
4094 self.requires_restart = std::option::Option::Some(v.into());
4095 self
4096 }
4097
4098 /// Sets or clears the value of [requires_restart][crate::model::Flag::requires_restart].
4099 ///
4100 /// # Example
4101 /// ```ignore,no_run
4102 /// # use google_cloud_sql_v1::model::Flag;
4103 /// use wkt::BoolValue;
4104 /// let x = Flag::new().set_or_clear_requires_restart(Some(BoolValue::default()/* use setters */));
4105 /// let x = Flag::new().set_or_clear_requires_restart(None::<BoolValue>);
4106 /// ```
4107 pub fn set_or_clear_requires_restart<T>(mut self, v: std::option::Option<T>) -> Self
4108 where
4109 T: std::convert::Into<wkt::BoolValue>,
4110 {
4111 self.requires_restart = v.map(|x| x.into());
4112 self
4113 }
4114
4115 /// Sets the value of [kind][crate::model::Flag::kind].
4116 ///
4117 /// # Example
4118 /// ```ignore,no_run
4119 /// # use google_cloud_sql_v1::model::Flag;
4120 /// let x = Flag::new().set_kind("example");
4121 /// ```
4122 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4123 self.kind = v.into();
4124 self
4125 }
4126
4127 /// Sets the value of [in_beta][crate::model::Flag::in_beta].
4128 ///
4129 /// # Example
4130 /// ```ignore,no_run
4131 /// # use google_cloud_sql_v1::model::Flag;
4132 /// use wkt::BoolValue;
4133 /// let x = Flag::new().set_in_beta(BoolValue::default()/* use setters */);
4134 /// ```
4135 pub fn set_in_beta<T>(mut self, v: T) -> Self
4136 where
4137 T: std::convert::Into<wkt::BoolValue>,
4138 {
4139 self.in_beta = std::option::Option::Some(v.into());
4140 self
4141 }
4142
4143 /// Sets or clears the value of [in_beta][crate::model::Flag::in_beta].
4144 ///
4145 /// # Example
4146 /// ```ignore,no_run
4147 /// # use google_cloud_sql_v1::model::Flag;
4148 /// use wkt::BoolValue;
4149 /// let x = Flag::new().set_or_clear_in_beta(Some(BoolValue::default()/* use setters */));
4150 /// let x = Flag::new().set_or_clear_in_beta(None::<BoolValue>);
4151 /// ```
4152 pub fn set_or_clear_in_beta<T>(mut self, v: std::option::Option<T>) -> Self
4153 where
4154 T: std::convert::Into<wkt::BoolValue>,
4155 {
4156 self.in_beta = v.map(|x| x.into());
4157 self
4158 }
4159
4160 /// Sets the value of [allowed_int_values][crate::model::Flag::allowed_int_values].
4161 ///
4162 /// # Example
4163 /// ```ignore,no_run
4164 /// # use google_cloud_sql_v1::model::Flag;
4165 /// let x = Flag::new().set_allowed_int_values([1, 2, 3]);
4166 /// ```
4167 pub fn set_allowed_int_values<T, V>(mut self, v: T) -> Self
4168 where
4169 T: std::iter::IntoIterator<Item = V>,
4170 V: std::convert::Into<i64>,
4171 {
4172 use std::iter::Iterator;
4173 self.allowed_int_values = v.into_iter().map(|i| i.into()).collect();
4174 self
4175 }
4176
4177 /// Sets the value of [flag_scope][crate::model::Flag::flag_scope].
4178 ///
4179 /// # Example
4180 /// ```ignore,no_run
4181 /// # use google_cloud_sql_v1::model::Flag;
4182 /// use google_cloud_sql_v1::model::SqlFlagScope;
4183 /// let x0 = Flag::new().set_flag_scope(SqlFlagScope::Database);
4184 /// let x1 = Flag::new().set_flag_scope(SqlFlagScope::ConnectionPool);
4185 /// ```
4186 pub fn set_flag_scope<T: std::convert::Into<crate::model::SqlFlagScope>>(
4187 mut self,
4188 v: T,
4189 ) -> Self {
4190 self.flag_scope = v.into();
4191 self
4192 }
4193
4194 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value].
4195 ///
4196 /// Note that all the setters affecting `recommended_value` are mutually
4197 /// exclusive.
4198 ///
4199 /// # Example
4200 /// ```ignore,no_run
4201 /// # use google_cloud_sql_v1::model::Flag;
4202 /// use google_cloud_sql_v1::model::flag::RecommendedValue;
4203 /// let x = Flag::new().set_recommended_value(Some(RecommendedValue::RecommendedStringValue("example".to_string())));
4204 /// ```
4205 pub fn set_recommended_value<
4206 T: std::convert::Into<std::option::Option<crate::model::flag::RecommendedValue>>,
4207 >(
4208 mut self,
4209 v: T,
4210 ) -> Self {
4211 self.recommended_value = v.into();
4212 self
4213 }
4214
4215 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4216 /// if it holds a `RecommendedStringValue`, `None` if the field is not set or
4217 /// holds a different branch.
4218 pub fn recommended_string_value(&self) -> std::option::Option<&std::string::String> {
4219 #[allow(unreachable_patterns)]
4220 self.recommended_value.as_ref().and_then(|v| match v {
4221 crate::model::flag::RecommendedValue::RecommendedStringValue(v) => {
4222 std::option::Option::Some(v)
4223 }
4224 _ => std::option::Option::None,
4225 })
4226 }
4227
4228 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4229 /// to hold a `RecommendedStringValue`.
4230 ///
4231 /// Note that all the setters affecting `recommended_value` are
4232 /// mutually exclusive.
4233 ///
4234 /// # Example
4235 /// ```ignore,no_run
4236 /// # use google_cloud_sql_v1::model::Flag;
4237 /// let x = Flag::new().set_recommended_string_value("example");
4238 /// assert!(x.recommended_string_value().is_some());
4239 /// assert!(x.recommended_int_value().is_none());
4240 /// ```
4241 pub fn set_recommended_string_value<T: std::convert::Into<std::string::String>>(
4242 mut self,
4243 v: T,
4244 ) -> Self {
4245 self.recommended_value = std::option::Option::Some(
4246 crate::model::flag::RecommendedValue::RecommendedStringValue(v.into()),
4247 );
4248 self
4249 }
4250
4251 /// The value of [recommended_value][crate::model::Flag::recommended_value]
4252 /// if it holds a `RecommendedIntValue`, `None` if the field is not set or
4253 /// holds a different branch.
4254 pub fn recommended_int_value(&self) -> std::option::Option<&std::boxed::Box<wkt::Int64Value>> {
4255 #[allow(unreachable_patterns)]
4256 self.recommended_value.as_ref().and_then(|v| match v {
4257 crate::model::flag::RecommendedValue::RecommendedIntValue(v) => {
4258 std::option::Option::Some(v)
4259 }
4260 _ => std::option::Option::None,
4261 })
4262 }
4263
4264 /// Sets the value of [recommended_value][crate::model::Flag::recommended_value]
4265 /// to hold a `RecommendedIntValue`.
4266 ///
4267 /// Note that all the setters affecting `recommended_value` are
4268 /// mutually exclusive.
4269 ///
4270 /// # Example
4271 /// ```ignore,no_run
4272 /// # use google_cloud_sql_v1::model::Flag;
4273 /// use wkt::Int64Value;
4274 /// let x = Flag::new().set_recommended_int_value(Int64Value::default()/* use setters */);
4275 /// assert!(x.recommended_int_value().is_some());
4276 /// assert!(x.recommended_string_value().is_none());
4277 /// ```
4278 pub fn set_recommended_int_value<T: std::convert::Into<std::boxed::Box<wkt::Int64Value>>>(
4279 mut self,
4280 v: T,
4281 ) -> Self {
4282 self.recommended_value = std::option::Option::Some(
4283 crate::model::flag::RecommendedValue::RecommendedIntValue(v.into()),
4284 );
4285 self
4286 }
4287}
4288
4289impl wkt::message::Message for Flag {
4290 fn typename() -> &'static str {
4291 "type.googleapis.com/google.cloud.sql.v1.Flag"
4292 }
4293}
4294
4295/// Defines additional types related to [Flag].
4296pub mod flag {
4297 #[allow(unused_imports)]
4298 use super::*;
4299
4300 /// Recommended flag value for UI display.
4301 #[derive(Clone, Debug, PartialEq)]
4302 #[non_exhaustive]
4303 pub enum RecommendedValue {
4304 /// Recommended string value in string format for UI display.
4305 RecommendedStringValue(std::string::String),
4306 /// Recommended int value in integer format for UI display.
4307 RecommendedIntValue(std::boxed::Box<wkt::Int64Value>),
4308 }
4309}
4310
4311/// Instance add server CA request.
4312#[derive(Clone, Default, PartialEq)]
4313#[non_exhaustive]
4314pub struct SqlInstancesAddServerCaRequest {
4315 /// Cloud SQL instance ID. This does not include the project ID.
4316 pub instance: std::string::String,
4317
4318 /// Project ID of the project that contains the instance.
4319 pub project: std::string::String,
4320
4321 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4322}
4323
4324impl SqlInstancesAddServerCaRequest {
4325 pub fn new() -> Self {
4326 std::default::Default::default()
4327 }
4328
4329 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCaRequest::instance].
4330 ///
4331 /// # Example
4332 /// ```ignore,no_run
4333 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4334 /// let x = SqlInstancesAddServerCaRequest::new().set_instance("example");
4335 /// ```
4336 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4337 self.instance = v.into();
4338 self
4339 }
4340
4341 /// Sets the value of [project][crate::model::SqlInstancesAddServerCaRequest::project].
4342 ///
4343 /// # Example
4344 /// ```ignore,no_run
4345 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCaRequest;
4346 /// let x = SqlInstancesAddServerCaRequest::new().set_project("example");
4347 /// ```
4348 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4349 self.project = v.into();
4350 self
4351 }
4352}
4353
4354impl wkt::message::Message for SqlInstancesAddServerCaRequest {
4355 fn typename() -> &'static str {
4356 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCaRequest"
4357 }
4358}
4359
4360/// Instance add server certificate request.
4361#[derive(Clone, Default, PartialEq)]
4362#[non_exhaustive]
4363pub struct SqlInstancesAddServerCertificateRequest {
4364 /// Cloud SQL instance ID. This does not include the project ID.
4365 pub instance: std::string::String,
4366
4367 /// Project ID of the project that contains the instance.
4368 pub project: std::string::String,
4369
4370 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4371}
4372
4373impl SqlInstancesAddServerCertificateRequest {
4374 pub fn new() -> Self {
4375 std::default::Default::default()
4376 }
4377
4378 /// Sets the value of [instance][crate::model::SqlInstancesAddServerCertificateRequest::instance].
4379 ///
4380 /// # Example
4381 /// ```ignore,no_run
4382 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4383 /// let x = SqlInstancesAddServerCertificateRequest::new().set_instance("example");
4384 /// ```
4385 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4386 self.instance = v.into();
4387 self
4388 }
4389
4390 /// Sets the value of [project][crate::model::SqlInstancesAddServerCertificateRequest::project].
4391 ///
4392 /// # Example
4393 /// ```ignore,no_run
4394 /// # use google_cloud_sql_v1::model::SqlInstancesAddServerCertificateRequest;
4395 /// let x = SqlInstancesAddServerCertificateRequest::new().set_project("example");
4396 /// ```
4397 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4398 self.project = v.into();
4399 self
4400 }
4401}
4402
4403impl wkt::message::Message for SqlInstancesAddServerCertificateRequest {
4404 fn typename() -> &'static str {
4405 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest"
4406 }
4407}
4408
4409/// Instance add Entra ID certificate request.
4410#[derive(Clone, Default, PartialEq)]
4411#[non_exhaustive]
4412pub struct SqlInstancesAddEntraIdCertificateRequest {
4413 /// Required. Cloud SQL instance ID. This does not include the project ID.
4414 pub instance: std::string::String,
4415
4416 /// Required. Project ID of the project that contains the instance.
4417 pub project: std::string::String,
4418
4419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4420}
4421
4422impl SqlInstancesAddEntraIdCertificateRequest {
4423 pub fn new() -> Self {
4424 std::default::Default::default()
4425 }
4426
4427 /// Sets the value of [instance][crate::model::SqlInstancesAddEntraIdCertificateRequest::instance].
4428 ///
4429 /// # Example
4430 /// ```ignore,no_run
4431 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4432 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_instance("example");
4433 /// ```
4434 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4435 self.instance = v.into();
4436 self
4437 }
4438
4439 /// Sets the value of [project][crate::model::SqlInstancesAddEntraIdCertificateRequest::project].
4440 ///
4441 /// # Example
4442 /// ```ignore,no_run
4443 /// # use google_cloud_sql_v1::model::SqlInstancesAddEntraIdCertificateRequest;
4444 /// let x = SqlInstancesAddEntraIdCertificateRequest::new().set_project("example");
4445 /// ```
4446 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4447 self.project = v.into();
4448 self
4449 }
4450}
4451
4452impl wkt::message::Message for SqlInstancesAddEntraIdCertificateRequest {
4453 fn typename() -> &'static str {
4454 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest"
4455 }
4456}
4457
4458/// Instance clone request.
4459#[derive(Clone, Default, PartialEq)]
4460#[non_exhaustive]
4461pub struct SqlInstancesCloneRequest {
4462 /// Required. The ID of the Cloud SQL instance to be cloned (source). This does
4463 /// not include the project ID.
4464 pub instance: std::string::String,
4465
4466 /// Required. Project ID of the source as well as the clone Cloud SQL instance.
4467 pub project: std::string::String,
4468
4469 pub body: std::option::Option<crate::model::InstancesCloneRequest>,
4470
4471 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4472}
4473
4474impl SqlInstancesCloneRequest {
4475 pub fn new() -> Self {
4476 std::default::Default::default()
4477 }
4478
4479 /// Sets the value of [instance][crate::model::SqlInstancesCloneRequest::instance].
4480 ///
4481 /// # Example
4482 /// ```ignore,no_run
4483 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4484 /// let x = SqlInstancesCloneRequest::new().set_instance("example");
4485 /// ```
4486 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4487 self.instance = v.into();
4488 self
4489 }
4490
4491 /// Sets the value of [project][crate::model::SqlInstancesCloneRequest::project].
4492 ///
4493 /// # Example
4494 /// ```ignore,no_run
4495 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4496 /// let x = SqlInstancesCloneRequest::new().set_project("example");
4497 /// ```
4498 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4499 self.project = v.into();
4500 self
4501 }
4502
4503 /// Sets the value of [body][crate::model::SqlInstancesCloneRequest::body].
4504 ///
4505 /// # Example
4506 /// ```ignore,no_run
4507 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4508 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4509 /// let x = SqlInstancesCloneRequest::new().set_body(InstancesCloneRequest::default()/* use setters */);
4510 /// ```
4511 pub fn set_body<T>(mut self, v: T) -> Self
4512 where
4513 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4514 {
4515 self.body = std::option::Option::Some(v.into());
4516 self
4517 }
4518
4519 /// Sets or clears the value of [body][crate::model::SqlInstancesCloneRequest::body].
4520 ///
4521 /// # Example
4522 /// ```ignore,no_run
4523 /// # use google_cloud_sql_v1::model::SqlInstancesCloneRequest;
4524 /// use google_cloud_sql_v1::model::InstancesCloneRequest;
4525 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(Some(InstancesCloneRequest::default()/* use setters */));
4526 /// let x = SqlInstancesCloneRequest::new().set_or_clear_body(None::<InstancesCloneRequest>);
4527 /// ```
4528 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4529 where
4530 T: std::convert::Into<crate::model::InstancesCloneRequest>,
4531 {
4532 self.body = v.map(|x| x.into());
4533 self
4534 }
4535}
4536
4537impl wkt::message::Message for SqlInstancesCloneRequest {
4538 fn typename() -> &'static str {
4539 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCloneRequest"
4540 }
4541}
4542
4543/// Instance delete request.
4544#[derive(Clone, Default, PartialEq)]
4545#[non_exhaustive]
4546pub struct SqlInstancesDeleteRequest {
4547 /// Cloud SQL instance ID. This does not include the project ID.
4548 pub instance: std::string::String,
4549
4550 /// Project ID of the project that contains the instance to be deleted.
4551 pub project: std::string::String,
4552
4553 /// Flag to opt-in for final backup. By default, it is turned off.
4554 pub enable_final_backup: std::option::Option<bool>,
4555
4556 /// Optional. The description of the final backup.
4557 pub final_backup_description: std::string::String,
4558
4559 pub expiration: std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4560
4561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4562}
4563
4564impl SqlInstancesDeleteRequest {
4565 pub fn new() -> Self {
4566 std::default::Default::default()
4567 }
4568
4569 /// Sets the value of [instance][crate::model::SqlInstancesDeleteRequest::instance].
4570 ///
4571 /// # Example
4572 /// ```ignore,no_run
4573 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4574 /// let x = SqlInstancesDeleteRequest::new().set_instance("example");
4575 /// ```
4576 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4577 self.instance = v.into();
4578 self
4579 }
4580
4581 /// Sets the value of [project][crate::model::SqlInstancesDeleteRequest::project].
4582 ///
4583 /// # Example
4584 /// ```ignore,no_run
4585 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4586 /// let x = SqlInstancesDeleteRequest::new().set_project("example");
4587 /// ```
4588 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4589 self.project = v.into();
4590 self
4591 }
4592
4593 /// Sets the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4594 ///
4595 /// # Example
4596 /// ```ignore,no_run
4597 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4598 /// let x = SqlInstancesDeleteRequest::new().set_enable_final_backup(true);
4599 /// ```
4600 pub fn set_enable_final_backup<T>(mut self, v: T) -> Self
4601 where
4602 T: std::convert::Into<bool>,
4603 {
4604 self.enable_final_backup = std::option::Option::Some(v.into());
4605 self
4606 }
4607
4608 /// Sets or clears the value of [enable_final_backup][crate::model::SqlInstancesDeleteRequest::enable_final_backup].
4609 ///
4610 /// # Example
4611 /// ```ignore,no_run
4612 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4613 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(Some(false));
4614 /// let x = SqlInstancesDeleteRequest::new().set_or_clear_enable_final_backup(None::<bool>);
4615 /// ```
4616 pub fn set_or_clear_enable_final_backup<T>(mut self, v: std::option::Option<T>) -> Self
4617 where
4618 T: std::convert::Into<bool>,
4619 {
4620 self.enable_final_backup = v.map(|x| x.into());
4621 self
4622 }
4623
4624 /// Sets the value of [final_backup_description][crate::model::SqlInstancesDeleteRequest::final_backup_description].
4625 ///
4626 /// # Example
4627 /// ```ignore,no_run
4628 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4629 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_description("example");
4630 /// ```
4631 pub fn set_final_backup_description<T: std::convert::Into<std::string::String>>(
4632 mut self,
4633 v: T,
4634 ) -> Self {
4635 self.final_backup_description = v.into();
4636 self
4637 }
4638
4639 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration].
4640 ///
4641 /// Note that all the setters affecting `expiration` are mutually
4642 /// exclusive.
4643 ///
4644 /// # Example
4645 /// ```ignore,no_run
4646 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4647 /// use google_cloud_sql_v1::model::sql_instances_delete_request::Expiration;
4648 /// let x = SqlInstancesDeleteRequest::new().set_expiration(Some(Expiration::FinalBackupTtlDays(42)));
4649 /// ```
4650 pub fn set_expiration<
4651 T: std::convert::Into<
4652 std::option::Option<crate::model::sql_instances_delete_request::Expiration>,
4653 >,
4654 >(
4655 mut self,
4656 v: T,
4657 ) -> Self {
4658 self.expiration = v.into();
4659 self
4660 }
4661
4662 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4663 /// if it holds a `FinalBackupTtlDays`, `None` if the field is not set or
4664 /// holds a different branch.
4665 pub fn final_backup_ttl_days(&self) -> std::option::Option<&i64> {
4666 #[allow(unreachable_patterns)]
4667 self.expiration.as_ref().and_then(|v| match v {
4668 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v) => {
4669 std::option::Option::Some(v)
4670 }
4671 _ => std::option::Option::None,
4672 })
4673 }
4674
4675 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4676 /// to hold a `FinalBackupTtlDays`.
4677 ///
4678 /// Note that all the setters affecting `expiration` are
4679 /// mutually exclusive.
4680 ///
4681 /// # Example
4682 /// ```ignore,no_run
4683 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4684 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_ttl_days(42);
4685 /// assert!(x.final_backup_ttl_days().is_some());
4686 /// assert!(x.final_backup_expiry_time().is_none());
4687 /// ```
4688 pub fn set_final_backup_ttl_days<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4689 self.expiration = std::option::Option::Some(
4690 crate::model::sql_instances_delete_request::Expiration::FinalBackupTtlDays(v.into()),
4691 );
4692 self
4693 }
4694
4695 /// The value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4696 /// if it holds a `FinalBackupExpiryTime`, `None` if the field is not set or
4697 /// holds a different branch.
4698 pub fn final_backup_expiry_time(
4699 &self,
4700 ) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
4701 #[allow(unreachable_patterns)]
4702 self.expiration.as_ref().and_then(|v| match v {
4703 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v) => {
4704 std::option::Option::Some(v)
4705 }
4706 _ => std::option::Option::None,
4707 })
4708 }
4709
4710 /// Sets the value of [expiration][crate::model::SqlInstancesDeleteRequest::expiration]
4711 /// to hold a `FinalBackupExpiryTime`.
4712 ///
4713 /// Note that all the setters affecting `expiration` are
4714 /// mutually exclusive.
4715 ///
4716 /// # Example
4717 /// ```ignore,no_run
4718 /// # use google_cloud_sql_v1::model::SqlInstancesDeleteRequest;
4719 /// use wkt::Timestamp;
4720 /// let x = SqlInstancesDeleteRequest::new().set_final_backup_expiry_time(Timestamp::default()/* use setters */);
4721 /// assert!(x.final_backup_expiry_time().is_some());
4722 /// assert!(x.final_backup_ttl_days().is_none());
4723 /// ```
4724 pub fn set_final_backup_expiry_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
4725 mut self,
4726 v: T,
4727 ) -> Self {
4728 self.expiration = std::option::Option::Some(
4729 crate::model::sql_instances_delete_request::Expiration::FinalBackupExpiryTime(v.into()),
4730 );
4731 self
4732 }
4733}
4734
4735impl wkt::message::Message for SqlInstancesDeleteRequest {
4736 fn typename() -> &'static str {
4737 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDeleteRequest"
4738 }
4739}
4740
4741/// Defines additional types related to [SqlInstancesDeleteRequest].
4742pub mod sql_instances_delete_request {
4743 #[allow(unused_imports)]
4744 use super::*;
4745
4746 #[derive(Clone, Debug, PartialEq)]
4747 #[non_exhaustive]
4748 pub enum Expiration {
4749 /// Optional. Retention period of the final backup.
4750 FinalBackupTtlDays(i64),
4751 /// Optional. Final Backup expiration time.
4752 /// Timestamp in UTC of when this resource is considered expired.
4753 FinalBackupExpiryTime(std::boxed::Box<wkt::Timestamp>),
4754 }
4755}
4756
4757/// Instance demote master request.
4758#[derive(Clone, Default, PartialEq)]
4759#[non_exhaustive]
4760pub struct SqlInstancesDemoteMasterRequest {
4761 /// Cloud SQL instance name.
4762 pub instance: std::string::String,
4763
4764 /// ID of the project that contains the instance.
4765 pub project: std::string::String,
4766
4767 pub body: std::option::Option<crate::model::InstancesDemoteMasterRequest>,
4768
4769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4770}
4771
4772impl SqlInstancesDemoteMasterRequest {
4773 pub fn new() -> Self {
4774 std::default::Default::default()
4775 }
4776
4777 /// Sets the value of [instance][crate::model::SqlInstancesDemoteMasterRequest::instance].
4778 ///
4779 /// # Example
4780 /// ```ignore,no_run
4781 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4782 /// let x = SqlInstancesDemoteMasterRequest::new().set_instance("example");
4783 /// ```
4784 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4785 self.instance = v.into();
4786 self
4787 }
4788
4789 /// Sets the value of [project][crate::model::SqlInstancesDemoteMasterRequest::project].
4790 ///
4791 /// # Example
4792 /// ```ignore,no_run
4793 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4794 /// let x = SqlInstancesDemoteMasterRequest::new().set_project("example");
4795 /// ```
4796 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4797 self.project = v.into();
4798 self
4799 }
4800
4801 /// Sets the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4802 ///
4803 /// # Example
4804 /// ```ignore,no_run
4805 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4806 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4807 /// let x = SqlInstancesDemoteMasterRequest::new().set_body(InstancesDemoteMasterRequest::default()/* use setters */);
4808 /// ```
4809 pub fn set_body<T>(mut self, v: T) -> Self
4810 where
4811 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4812 {
4813 self.body = std::option::Option::Some(v.into());
4814 self
4815 }
4816
4817 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteMasterRequest::body].
4818 ///
4819 /// # Example
4820 /// ```ignore,no_run
4821 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteMasterRequest;
4822 /// use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
4823 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(Some(InstancesDemoteMasterRequest::default()/* use setters */));
4824 /// let x = SqlInstancesDemoteMasterRequest::new().set_or_clear_body(None::<InstancesDemoteMasterRequest>);
4825 /// ```
4826 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4827 where
4828 T: std::convert::Into<crate::model::InstancesDemoteMasterRequest>,
4829 {
4830 self.body = v.map(|x| x.into());
4831 self
4832 }
4833}
4834
4835impl wkt::message::Message for SqlInstancesDemoteMasterRequest {
4836 fn typename() -> &'static str {
4837 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteMasterRequest"
4838 }
4839}
4840
4841/// Instance demote request.
4842#[derive(Clone, Default, PartialEq)]
4843#[non_exhaustive]
4844pub struct SqlInstancesDemoteRequest {
4845 /// Required. Cloud SQL instance name.
4846 pub instance: std::string::String,
4847
4848 /// Required. ID of the project that contains the instance.
4849 pub project: std::string::String,
4850
4851 /// Required. The request body.
4852 pub body: std::option::Option<crate::model::InstancesDemoteRequest>,
4853
4854 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4855}
4856
4857impl SqlInstancesDemoteRequest {
4858 pub fn new() -> Self {
4859 std::default::Default::default()
4860 }
4861
4862 /// Sets the value of [instance][crate::model::SqlInstancesDemoteRequest::instance].
4863 ///
4864 /// # Example
4865 /// ```ignore,no_run
4866 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4867 /// let x = SqlInstancesDemoteRequest::new().set_instance("example");
4868 /// ```
4869 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4870 self.instance = v.into();
4871 self
4872 }
4873
4874 /// Sets the value of [project][crate::model::SqlInstancesDemoteRequest::project].
4875 ///
4876 /// # Example
4877 /// ```ignore,no_run
4878 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4879 /// let x = SqlInstancesDemoteRequest::new().set_project("example");
4880 /// ```
4881 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4882 self.project = v.into();
4883 self
4884 }
4885
4886 /// Sets the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4887 ///
4888 /// # Example
4889 /// ```ignore,no_run
4890 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4891 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4892 /// let x = SqlInstancesDemoteRequest::new().set_body(InstancesDemoteRequest::default()/* use setters */);
4893 /// ```
4894 pub fn set_body<T>(mut self, v: T) -> Self
4895 where
4896 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4897 {
4898 self.body = std::option::Option::Some(v.into());
4899 self
4900 }
4901
4902 /// Sets or clears the value of [body][crate::model::SqlInstancesDemoteRequest::body].
4903 ///
4904 /// # Example
4905 /// ```ignore,no_run
4906 /// # use google_cloud_sql_v1::model::SqlInstancesDemoteRequest;
4907 /// use google_cloud_sql_v1::model::InstancesDemoteRequest;
4908 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(Some(InstancesDemoteRequest::default()/* use setters */));
4909 /// let x = SqlInstancesDemoteRequest::new().set_or_clear_body(None::<InstancesDemoteRequest>);
4910 /// ```
4911 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4912 where
4913 T: std::convert::Into<crate::model::InstancesDemoteRequest>,
4914 {
4915 self.body = v.map(|x| x.into());
4916 self
4917 }
4918}
4919
4920impl wkt::message::Message for SqlInstancesDemoteRequest {
4921 fn typename() -> &'static str {
4922 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesDemoteRequest"
4923 }
4924}
4925
4926/// Instance export request.
4927#[derive(Clone, Default, PartialEq)]
4928#[non_exhaustive]
4929pub struct SqlInstancesExportRequest {
4930 /// Cloud SQL instance ID. This does not include the project ID.
4931 pub instance: std::string::String,
4932
4933 /// Project ID of the project that contains the instance to be exported.
4934 pub project: std::string::String,
4935
4936 pub body: std::option::Option<crate::model::InstancesExportRequest>,
4937
4938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4939}
4940
4941impl SqlInstancesExportRequest {
4942 pub fn new() -> Self {
4943 std::default::Default::default()
4944 }
4945
4946 /// Sets the value of [instance][crate::model::SqlInstancesExportRequest::instance].
4947 ///
4948 /// # Example
4949 /// ```ignore,no_run
4950 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4951 /// let x = SqlInstancesExportRequest::new().set_instance("example");
4952 /// ```
4953 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4954 self.instance = v.into();
4955 self
4956 }
4957
4958 /// Sets the value of [project][crate::model::SqlInstancesExportRequest::project].
4959 ///
4960 /// # Example
4961 /// ```ignore,no_run
4962 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4963 /// let x = SqlInstancesExportRequest::new().set_project("example");
4964 /// ```
4965 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4966 self.project = v.into();
4967 self
4968 }
4969
4970 /// Sets the value of [body][crate::model::SqlInstancesExportRequest::body].
4971 ///
4972 /// # Example
4973 /// ```ignore,no_run
4974 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4975 /// use google_cloud_sql_v1::model::InstancesExportRequest;
4976 /// let x = SqlInstancesExportRequest::new().set_body(InstancesExportRequest::default()/* use setters */);
4977 /// ```
4978 pub fn set_body<T>(mut self, v: T) -> Self
4979 where
4980 T: std::convert::Into<crate::model::InstancesExportRequest>,
4981 {
4982 self.body = std::option::Option::Some(v.into());
4983 self
4984 }
4985
4986 /// Sets or clears the value of [body][crate::model::SqlInstancesExportRequest::body].
4987 ///
4988 /// # Example
4989 /// ```ignore,no_run
4990 /// # use google_cloud_sql_v1::model::SqlInstancesExportRequest;
4991 /// use google_cloud_sql_v1::model::InstancesExportRequest;
4992 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(Some(InstancesExportRequest::default()/* use setters */));
4993 /// let x = SqlInstancesExportRequest::new().set_or_clear_body(None::<InstancesExportRequest>);
4994 /// ```
4995 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
4996 where
4997 T: std::convert::Into<crate::model::InstancesExportRequest>,
4998 {
4999 self.body = v.map(|x| x.into());
5000 self
5001 }
5002}
5003
5004impl wkt::message::Message for SqlInstancesExportRequest {
5005 fn typename() -> &'static str {
5006 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExportRequest"
5007 }
5008}
5009
5010/// Instance failover request.
5011#[derive(Clone, Default, PartialEq)]
5012#[non_exhaustive]
5013pub struct SqlInstancesFailoverRequest {
5014 /// Cloud SQL instance ID. This does not include the project ID.
5015 pub instance: std::string::String,
5016
5017 /// ID of the project that contains the read replica.
5018 pub project: std::string::String,
5019
5020 pub body: std::option::Option<crate::model::InstancesFailoverRequest>,
5021
5022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5023}
5024
5025impl SqlInstancesFailoverRequest {
5026 pub fn new() -> Self {
5027 std::default::Default::default()
5028 }
5029
5030 /// Sets the value of [instance][crate::model::SqlInstancesFailoverRequest::instance].
5031 ///
5032 /// # Example
5033 /// ```ignore,no_run
5034 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5035 /// let x = SqlInstancesFailoverRequest::new().set_instance("example");
5036 /// ```
5037 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5038 self.instance = v.into();
5039 self
5040 }
5041
5042 /// Sets the value of [project][crate::model::SqlInstancesFailoverRequest::project].
5043 ///
5044 /// # Example
5045 /// ```ignore,no_run
5046 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5047 /// let x = SqlInstancesFailoverRequest::new().set_project("example");
5048 /// ```
5049 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5050 self.project = v.into();
5051 self
5052 }
5053
5054 /// Sets the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5055 ///
5056 /// # Example
5057 /// ```ignore,no_run
5058 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5059 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5060 /// let x = SqlInstancesFailoverRequest::new().set_body(InstancesFailoverRequest::default()/* use setters */);
5061 /// ```
5062 pub fn set_body<T>(mut self, v: T) -> Self
5063 where
5064 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5065 {
5066 self.body = std::option::Option::Some(v.into());
5067 self
5068 }
5069
5070 /// Sets or clears the value of [body][crate::model::SqlInstancesFailoverRequest::body].
5071 ///
5072 /// # Example
5073 /// ```ignore,no_run
5074 /// # use google_cloud_sql_v1::model::SqlInstancesFailoverRequest;
5075 /// use google_cloud_sql_v1::model::InstancesFailoverRequest;
5076 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(Some(InstancesFailoverRequest::default()/* use setters */));
5077 /// let x = SqlInstancesFailoverRequest::new().set_or_clear_body(None::<InstancesFailoverRequest>);
5078 /// ```
5079 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5080 where
5081 T: std::convert::Into<crate::model::InstancesFailoverRequest>,
5082 {
5083 self.body = v.map(|x| x.into());
5084 self
5085 }
5086}
5087
5088impl wkt::message::Message for SqlInstancesFailoverRequest {
5089 fn typename() -> &'static str {
5090 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesFailoverRequest"
5091 }
5092}
5093
5094/// Instance get request.
5095#[derive(Clone, Default, PartialEq)]
5096#[non_exhaustive]
5097pub struct SqlInstancesGetRequest {
5098 /// Required. Database instance ID. This does not include the project ID.
5099 pub instance: std::string::String,
5100
5101 /// Required. Project ID of the project that contains the instance.
5102 pub project: std::string::String,
5103
5104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5105}
5106
5107impl SqlInstancesGetRequest {
5108 pub fn new() -> Self {
5109 std::default::Default::default()
5110 }
5111
5112 /// Sets the value of [instance][crate::model::SqlInstancesGetRequest::instance].
5113 ///
5114 /// # Example
5115 /// ```ignore,no_run
5116 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5117 /// let x = SqlInstancesGetRequest::new().set_instance("example");
5118 /// ```
5119 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5120 self.instance = v.into();
5121 self
5122 }
5123
5124 /// Sets the value of [project][crate::model::SqlInstancesGetRequest::project].
5125 ///
5126 /// # Example
5127 /// ```ignore,no_run
5128 /// # use google_cloud_sql_v1::model::SqlInstancesGetRequest;
5129 /// let x = SqlInstancesGetRequest::new().set_project("example");
5130 /// ```
5131 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5132 self.project = v.into();
5133 self
5134 }
5135}
5136
5137impl wkt::message::Message for SqlInstancesGetRequest {
5138 fn typename() -> &'static str {
5139 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetRequest"
5140 }
5141}
5142
5143/// Instance import request.
5144#[derive(Clone, Default, PartialEq)]
5145#[non_exhaustive]
5146pub struct SqlInstancesImportRequest {
5147 /// Cloud SQL instance ID. This does not include the project ID.
5148 pub instance: std::string::String,
5149
5150 /// Project ID of the project that contains the instance.
5151 pub project: std::string::String,
5152
5153 pub body: std::option::Option<crate::model::InstancesImportRequest>,
5154
5155 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5156}
5157
5158impl SqlInstancesImportRequest {
5159 pub fn new() -> Self {
5160 std::default::Default::default()
5161 }
5162
5163 /// Sets the value of [instance][crate::model::SqlInstancesImportRequest::instance].
5164 ///
5165 /// # Example
5166 /// ```ignore,no_run
5167 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5168 /// let x = SqlInstancesImportRequest::new().set_instance("example");
5169 /// ```
5170 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5171 self.instance = v.into();
5172 self
5173 }
5174
5175 /// Sets the value of [project][crate::model::SqlInstancesImportRequest::project].
5176 ///
5177 /// # Example
5178 /// ```ignore,no_run
5179 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5180 /// let x = SqlInstancesImportRequest::new().set_project("example");
5181 /// ```
5182 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5183 self.project = v.into();
5184 self
5185 }
5186
5187 /// Sets the value of [body][crate::model::SqlInstancesImportRequest::body].
5188 ///
5189 /// # Example
5190 /// ```ignore,no_run
5191 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5192 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5193 /// let x = SqlInstancesImportRequest::new().set_body(InstancesImportRequest::default()/* use setters */);
5194 /// ```
5195 pub fn set_body<T>(mut self, v: T) -> Self
5196 where
5197 T: std::convert::Into<crate::model::InstancesImportRequest>,
5198 {
5199 self.body = std::option::Option::Some(v.into());
5200 self
5201 }
5202
5203 /// Sets or clears the value of [body][crate::model::SqlInstancesImportRequest::body].
5204 ///
5205 /// # Example
5206 /// ```ignore,no_run
5207 /// # use google_cloud_sql_v1::model::SqlInstancesImportRequest;
5208 /// use google_cloud_sql_v1::model::InstancesImportRequest;
5209 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(Some(InstancesImportRequest::default()/* use setters */));
5210 /// let x = SqlInstancesImportRequest::new().set_or_clear_body(None::<InstancesImportRequest>);
5211 /// ```
5212 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5213 where
5214 T: std::convert::Into<crate::model::InstancesImportRequest>,
5215 {
5216 self.body = v.map(|x| x.into());
5217 self
5218 }
5219}
5220
5221impl wkt::message::Message for SqlInstancesImportRequest {
5222 fn typename() -> &'static str {
5223 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesImportRequest"
5224 }
5225}
5226
5227/// Instance insert request.
5228#[derive(Clone, Default, PartialEq)]
5229#[non_exhaustive]
5230pub struct SqlInstancesInsertRequest {
5231 /// Project ID of the project to which the newly created Cloud SQL instances
5232 /// should belong.
5233 pub project: std::string::String,
5234
5235 pub body: std::option::Option<crate::model::DatabaseInstance>,
5236
5237 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5238}
5239
5240impl SqlInstancesInsertRequest {
5241 pub fn new() -> Self {
5242 std::default::Default::default()
5243 }
5244
5245 /// Sets the value of [project][crate::model::SqlInstancesInsertRequest::project].
5246 ///
5247 /// # Example
5248 /// ```ignore,no_run
5249 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5250 /// let x = SqlInstancesInsertRequest::new().set_project("example");
5251 /// ```
5252 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5253 self.project = v.into();
5254 self
5255 }
5256
5257 /// Sets the value of [body][crate::model::SqlInstancesInsertRequest::body].
5258 ///
5259 /// # Example
5260 /// ```ignore,no_run
5261 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5262 /// use google_cloud_sql_v1::model::DatabaseInstance;
5263 /// let x = SqlInstancesInsertRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5264 /// ```
5265 pub fn set_body<T>(mut self, v: T) -> Self
5266 where
5267 T: std::convert::Into<crate::model::DatabaseInstance>,
5268 {
5269 self.body = std::option::Option::Some(v.into());
5270 self
5271 }
5272
5273 /// Sets or clears the value of [body][crate::model::SqlInstancesInsertRequest::body].
5274 ///
5275 /// # Example
5276 /// ```ignore,no_run
5277 /// # use google_cloud_sql_v1::model::SqlInstancesInsertRequest;
5278 /// use google_cloud_sql_v1::model::DatabaseInstance;
5279 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5280 /// let x = SqlInstancesInsertRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5281 /// ```
5282 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5283 where
5284 T: std::convert::Into<crate::model::DatabaseInstance>,
5285 {
5286 self.body = v.map(|x| x.into());
5287 self
5288 }
5289}
5290
5291impl wkt::message::Message for SqlInstancesInsertRequest {
5292 fn typename() -> &'static str {
5293 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesInsertRequest"
5294 }
5295}
5296
5297/// Instance list request.
5298#[derive(Clone, Default, PartialEq)]
5299#[non_exhaustive]
5300pub struct SqlInstancesListRequest {
5301 /// A filter expression that filters resources listed in the response.
5302 /// The expression is in the form of field:value. For example,
5303 /// 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
5304 /// their JSON representation, such as 'settings.userLabels.auto_start:true'.
5305 ///
5306 /// Multiple filter queries are space-separated. For example.
5307 /// 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
5308 /// expression is an AND expression. However, you can include AND and OR
5309 /// expressions explicitly.
5310 pub filter: std::string::String,
5311
5312 /// The maximum number of instances to return. The service may return fewer
5313 /// than this value.
5314 /// If unspecified, at most 500 instances are returned.
5315 /// The maximum value is 1000; values above 1000 are coerced to 1000.
5316 pub max_results: u32,
5317
5318 /// A previously-returned page token representing part of the larger set of
5319 /// results to view.
5320 pub page_token: std::string::String,
5321
5322 /// Project ID of the project for which to list Cloud SQL instances.
5323 pub project: std::string::String,
5324
5325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5326}
5327
5328impl SqlInstancesListRequest {
5329 pub fn new() -> Self {
5330 std::default::Default::default()
5331 }
5332
5333 /// Sets the value of [filter][crate::model::SqlInstancesListRequest::filter].
5334 ///
5335 /// # Example
5336 /// ```ignore,no_run
5337 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5338 /// let x = SqlInstancesListRequest::new().set_filter("example");
5339 /// ```
5340 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5341 self.filter = v.into();
5342 self
5343 }
5344
5345 /// Sets the value of [max_results][crate::model::SqlInstancesListRequest::max_results].
5346 ///
5347 /// # Example
5348 /// ```ignore,no_run
5349 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5350 /// let x = SqlInstancesListRequest::new().set_max_results(42_u32);
5351 /// ```
5352 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
5353 self.max_results = v.into();
5354 self
5355 }
5356
5357 /// Sets the value of [page_token][crate::model::SqlInstancesListRequest::page_token].
5358 ///
5359 /// # Example
5360 /// ```ignore,no_run
5361 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5362 /// let x = SqlInstancesListRequest::new().set_page_token("example");
5363 /// ```
5364 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5365 self.page_token = v.into();
5366 self
5367 }
5368
5369 /// Sets the value of [project][crate::model::SqlInstancesListRequest::project].
5370 ///
5371 /// # Example
5372 /// ```ignore,no_run
5373 /// # use google_cloud_sql_v1::model::SqlInstancesListRequest;
5374 /// let x = SqlInstancesListRequest::new().set_project("example");
5375 /// ```
5376 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5377 self.project = v.into();
5378 self
5379 }
5380}
5381
5382impl wkt::message::Message for SqlInstancesListRequest {
5383 fn typename() -> &'static str {
5384 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListRequest"
5385 }
5386}
5387
5388/// Instance list server CAs request.
5389#[derive(Clone, Default, PartialEq)]
5390#[non_exhaustive]
5391pub struct SqlInstancesListServerCasRequest {
5392 /// Cloud SQL instance ID. This does not include the project ID.
5393 pub instance: std::string::String,
5394
5395 /// Project ID of the project that contains the instance.
5396 pub project: std::string::String,
5397
5398 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5399}
5400
5401impl SqlInstancesListServerCasRequest {
5402 pub fn new() -> Self {
5403 std::default::Default::default()
5404 }
5405
5406 /// Sets the value of [instance][crate::model::SqlInstancesListServerCasRequest::instance].
5407 ///
5408 /// # Example
5409 /// ```ignore,no_run
5410 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5411 /// let x = SqlInstancesListServerCasRequest::new().set_instance("example");
5412 /// ```
5413 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5414 self.instance = v.into();
5415 self
5416 }
5417
5418 /// Sets the value of [project][crate::model::SqlInstancesListServerCasRequest::project].
5419 ///
5420 /// # Example
5421 /// ```ignore,no_run
5422 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCasRequest;
5423 /// let x = SqlInstancesListServerCasRequest::new().set_project("example");
5424 /// ```
5425 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5426 self.project = v.into();
5427 self
5428 }
5429}
5430
5431impl wkt::message::Message for SqlInstancesListServerCasRequest {
5432 fn typename() -> &'static str {
5433 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCasRequest"
5434 }
5435}
5436
5437/// Instance list server certificates request.
5438#[derive(Clone, Default, PartialEq)]
5439#[non_exhaustive]
5440pub struct SqlInstancesListServerCertificatesRequest {
5441 /// Required. Cloud SQL instance ID. This does not include the project ID.
5442 pub instance: std::string::String,
5443
5444 /// Required. Project ID of the project that contains the instance.
5445 pub project: std::string::String,
5446
5447 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5448}
5449
5450impl SqlInstancesListServerCertificatesRequest {
5451 pub fn new() -> Self {
5452 std::default::Default::default()
5453 }
5454
5455 /// Sets the value of [instance][crate::model::SqlInstancesListServerCertificatesRequest::instance].
5456 ///
5457 /// # Example
5458 /// ```ignore,no_run
5459 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5460 /// let x = SqlInstancesListServerCertificatesRequest::new().set_instance("example");
5461 /// ```
5462 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5463 self.instance = v.into();
5464 self
5465 }
5466
5467 /// Sets the value of [project][crate::model::SqlInstancesListServerCertificatesRequest::project].
5468 ///
5469 /// # Example
5470 /// ```ignore,no_run
5471 /// # use google_cloud_sql_v1::model::SqlInstancesListServerCertificatesRequest;
5472 /// let x = SqlInstancesListServerCertificatesRequest::new().set_project("example");
5473 /// ```
5474 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5475 self.project = v.into();
5476 self
5477 }
5478}
5479
5480impl wkt::message::Message for SqlInstancesListServerCertificatesRequest {
5481 fn typename() -> &'static str {
5482 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest"
5483 }
5484}
5485
5486/// Instance list Entra ID certificates request.
5487#[derive(Clone, Default, PartialEq)]
5488#[non_exhaustive]
5489pub struct SqlInstancesListEntraIdCertificatesRequest {
5490 /// Required. Cloud SQL instance ID. This does not include the project ID.
5491 pub instance: std::string::String,
5492
5493 /// Required. Project ID of the project that contains the instance.
5494 pub project: std::string::String,
5495
5496 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5497}
5498
5499impl SqlInstancesListEntraIdCertificatesRequest {
5500 pub fn new() -> Self {
5501 std::default::Default::default()
5502 }
5503
5504 /// Sets the value of [instance][crate::model::SqlInstancesListEntraIdCertificatesRequest::instance].
5505 ///
5506 /// # Example
5507 /// ```ignore,no_run
5508 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5509 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_instance("example");
5510 /// ```
5511 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5512 self.instance = v.into();
5513 self
5514 }
5515
5516 /// Sets the value of [project][crate::model::SqlInstancesListEntraIdCertificatesRequest::project].
5517 ///
5518 /// # Example
5519 /// ```ignore,no_run
5520 /// # use google_cloud_sql_v1::model::SqlInstancesListEntraIdCertificatesRequest;
5521 /// let x = SqlInstancesListEntraIdCertificatesRequest::new().set_project("example");
5522 /// ```
5523 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5524 self.project = v.into();
5525 self
5526 }
5527}
5528
5529impl wkt::message::Message for SqlInstancesListEntraIdCertificatesRequest {
5530 fn typename() -> &'static str {
5531 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest"
5532 }
5533}
5534
5535/// Instance patch request.
5536#[derive(Clone, Default, PartialEq)]
5537#[non_exhaustive]
5538pub struct SqlInstancesPatchRequest {
5539 /// Cloud SQL instance ID. This does not include the project ID.
5540 pub instance: std::string::String,
5541
5542 /// Project ID of the project that contains the instance.
5543 pub project: std::string::String,
5544
5545 pub body: std::option::Option<crate::model::DatabaseInstance>,
5546
5547 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5548}
5549
5550impl SqlInstancesPatchRequest {
5551 pub fn new() -> Self {
5552 std::default::Default::default()
5553 }
5554
5555 /// Sets the value of [instance][crate::model::SqlInstancesPatchRequest::instance].
5556 ///
5557 /// # Example
5558 /// ```ignore,no_run
5559 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5560 /// let x = SqlInstancesPatchRequest::new().set_instance("example");
5561 /// ```
5562 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5563 self.instance = v.into();
5564 self
5565 }
5566
5567 /// Sets the value of [project][crate::model::SqlInstancesPatchRequest::project].
5568 ///
5569 /// # Example
5570 /// ```ignore,no_run
5571 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5572 /// let x = SqlInstancesPatchRequest::new().set_project("example");
5573 /// ```
5574 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5575 self.project = v.into();
5576 self
5577 }
5578
5579 /// Sets the value of [body][crate::model::SqlInstancesPatchRequest::body].
5580 ///
5581 /// # Example
5582 /// ```ignore,no_run
5583 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5584 /// use google_cloud_sql_v1::model::DatabaseInstance;
5585 /// let x = SqlInstancesPatchRequest::new().set_body(DatabaseInstance::default()/* use setters */);
5586 /// ```
5587 pub fn set_body<T>(mut self, v: T) -> Self
5588 where
5589 T: std::convert::Into<crate::model::DatabaseInstance>,
5590 {
5591 self.body = std::option::Option::Some(v.into());
5592 self
5593 }
5594
5595 /// Sets or clears the value of [body][crate::model::SqlInstancesPatchRequest::body].
5596 ///
5597 /// # Example
5598 /// ```ignore,no_run
5599 /// # use google_cloud_sql_v1::model::SqlInstancesPatchRequest;
5600 /// use google_cloud_sql_v1::model::DatabaseInstance;
5601 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
5602 /// let x = SqlInstancesPatchRequest::new().set_or_clear_body(None::<DatabaseInstance>);
5603 /// ```
5604 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
5605 where
5606 T: std::convert::Into<crate::model::DatabaseInstance>,
5607 {
5608 self.body = v.map(|x| x.into());
5609 self
5610 }
5611}
5612
5613impl wkt::message::Message for SqlInstancesPatchRequest {
5614 fn typename() -> &'static str {
5615 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPatchRequest"
5616 }
5617}
5618
5619/// Instance promote replica request.
5620#[derive(Clone, Default, PartialEq)]
5621#[non_exhaustive]
5622pub struct SqlInstancesPromoteReplicaRequest {
5623 /// Cloud SQL read replica instance name.
5624 pub instance: std::string::String,
5625
5626 /// ID of the project that contains the read replica.
5627 pub project: std::string::String,
5628
5629 /// Set to true to invoke a replica failover to the DR
5630 /// replica. As part of replica failover, the promote operation attempts
5631 /// to add the original primary instance as a replica of the promoted
5632 /// DR replica when the original primary instance comes back online.
5633 /// If set to false or not specified, then the original primary
5634 /// instance becomes an independent Cloud SQL primary instance.
5635 pub failover: bool,
5636
5637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5638}
5639
5640impl SqlInstancesPromoteReplicaRequest {
5641 pub fn new() -> Self {
5642 std::default::Default::default()
5643 }
5644
5645 /// Sets the value of [instance][crate::model::SqlInstancesPromoteReplicaRequest::instance].
5646 ///
5647 /// # Example
5648 /// ```ignore,no_run
5649 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5650 /// let x = SqlInstancesPromoteReplicaRequest::new().set_instance("example");
5651 /// ```
5652 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5653 self.instance = v.into();
5654 self
5655 }
5656
5657 /// Sets the value of [project][crate::model::SqlInstancesPromoteReplicaRequest::project].
5658 ///
5659 /// # Example
5660 /// ```ignore,no_run
5661 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5662 /// let x = SqlInstancesPromoteReplicaRequest::new().set_project("example");
5663 /// ```
5664 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5665 self.project = v.into();
5666 self
5667 }
5668
5669 /// Sets the value of [failover][crate::model::SqlInstancesPromoteReplicaRequest::failover].
5670 ///
5671 /// # Example
5672 /// ```ignore,no_run
5673 /// # use google_cloud_sql_v1::model::SqlInstancesPromoteReplicaRequest;
5674 /// let x = SqlInstancesPromoteReplicaRequest::new().set_failover(true);
5675 /// ```
5676 pub fn set_failover<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5677 self.failover = v.into();
5678 self
5679 }
5680}
5681
5682impl wkt::message::Message for SqlInstancesPromoteReplicaRequest {
5683 fn typename() -> &'static str {
5684 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest"
5685 }
5686}
5687
5688/// Instance switchover request.
5689#[derive(Clone, Default, PartialEq)]
5690#[non_exhaustive]
5691pub struct SqlInstancesSwitchoverRequest {
5692 /// Cloud SQL read replica instance name.
5693 pub instance: std::string::String,
5694
5695 /// ID of the project that contains the replica.
5696 pub project: std::string::String,
5697
5698 /// Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
5699 /// timeout, which is a sum of all database operations. Default value is 10
5700 /// minutes and can be modified to a maximum value of 24 hours.
5701 pub db_timeout: std::option::Option<wkt::Duration>,
5702
5703 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5704}
5705
5706impl SqlInstancesSwitchoverRequest {
5707 pub fn new() -> Self {
5708 std::default::Default::default()
5709 }
5710
5711 /// Sets the value of [instance][crate::model::SqlInstancesSwitchoverRequest::instance].
5712 ///
5713 /// # Example
5714 /// ```ignore,no_run
5715 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5716 /// let x = SqlInstancesSwitchoverRequest::new().set_instance("example");
5717 /// ```
5718 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5719 self.instance = v.into();
5720 self
5721 }
5722
5723 /// Sets the value of [project][crate::model::SqlInstancesSwitchoverRequest::project].
5724 ///
5725 /// # Example
5726 /// ```ignore,no_run
5727 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5728 /// let x = SqlInstancesSwitchoverRequest::new().set_project("example");
5729 /// ```
5730 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5731 self.project = v.into();
5732 self
5733 }
5734
5735 /// Sets the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5736 ///
5737 /// # Example
5738 /// ```ignore,no_run
5739 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5740 /// use wkt::Duration;
5741 /// let x = SqlInstancesSwitchoverRequest::new().set_db_timeout(Duration::default()/* use setters */);
5742 /// ```
5743 pub fn set_db_timeout<T>(mut self, v: T) -> Self
5744 where
5745 T: std::convert::Into<wkt::Duration>,
5746 {
5747 self.db_timeout = std::option::Option::Some(v.into());
5748 self
5749 }
5750
5751 /// Sets or clears the value of [db_timeout][crate::model::SqlInstancesSwitchoverRequest::db_timeout].
5752 ///
5753 /// # Example
5754 /// ```ignore,no_run
5755 /// # use google_cloud_sql_v1::model::SqlInstancesSwitchoverRequest;
5756 /// use wkt::Duration;
5757 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(Some(Duration::default()/* use setters */));
5758 /// let x = SqlInstancesSwitchoverRequest::new().set_or_clear_db_timeout(None::<Duration>);
5759 /// ```
5760 pub fn set_or_clear_db_timeout<T>(mut self, v: std::option::Option<T>) -> Self
5761 where
5762 T: std::convert::Into<wkt::Duration>,
5763 {
5764 self.db_timeout = v.map(|x| x.into());
5765 self
5766 }
5767}
5768
5769impl wkt::message::Message for SqlInstancesSwitchoverRequest {
5770 fn typename() -> &'static str {
5771 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesSwitchoverRequest"
5772 }
5773}
5774
5775/// Instance reset SSL config request.
5776#[derive(Clone, Default, PartialEq)]
5777#[non_exhaustive]
5778pub struct SqlInstancesResetSslConfigRequest {
5779 /// Cloud SQL instance ID. This does not include the project ID.
5780 pub instance: std::string::String,
5781
5782 /// Project ID of the project that contains the instance.
5783 pub project: std::string::String,
5784
5785 /// Optional. Reset SSL mode to use.
5786 pub mode: crate::model::sql_instances_reset_ssl_config_request::ResetSslMode,
5787
5788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5789}
5790
5791impl SqlInstancesResetSslConfigRequest {
5792 pub fn new() -> Self {
5793 std::default::Default::default()
5794 }
5795
5796 /// Sets the value of [instance][crate::model::SqlInstancesResetSslConfigRequest::instance].
5797 ///
5798 /// # Example
5799 /// ```ignore,no_run
5800 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5801 /// let x = SqlInstancesResetSslConfigRequest::new().set_instance("example");
5802 /// ```
5803 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5804 self.instance = v.into();
5805 self
5806 }
5807
5808 /// Sets the value of [project][crate::model::SqlInstancesResetSslConfigRequest::project].
5809 ///
5810 /// # Example
5811 /// ```ignore,no_run
5812 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5813 /// let x = SqlInstancesResetSslConfigRequest::new().set_project("example");
5814 /// ```
5815 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5816 self.project = v.into();
5817 self
5818 }
5819
5820 /// Sets the value of [mode][crate::model::SqlInstancesResetSslConfigRequest::mode].
5821 ///
5822 /// # Example
5823 /// ```ignore,no_run
5824 /// # use google_cloud_sql_v1::model::SqlInstancesResetSslConfigRequest;
5825 /// use google_cloud_sql_v1::model::sql_instances_reset_ssl_config_request::ResetSslMode;
5826 /// let x0 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::All);
5827 /// let x1 = SqlInstancesResetSslConfigRequest::new().set_mode(ResetSslMode::SyncFromPrimary);
5828 /// ```
5829 pub fn set_mode<
5830 T: std::convert::Into<crate::model::sql_instances_reset_ssl_config_request::ResetSslMode>,
5831 >(
5832 mut self,
5833 v: T,
5834 ) -> Self {
5835 self.mode = v.into();
5836 self
5837 }
5838}
5839
5840impl wkt::message::Message for SqlInstancesResetSslConfigRequest {
5841 fn typename() -> &'static str {
5842 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetSslConfigRequest"
5843 }
5844}
5845
5846/// Defines additional types related to [SqlInstancesResetSslConfigRequest].
5847pub mod sql_instances_reset_ssl_config_request {
5848 #[allow(unused_imports)]
5849 use super::*;
5850
5851 /// Reset SSL mode to selectively refresh the SSL materials.
5852 ///
5853 /// # Working with unknown values
5854 ///
5855 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5856 /// additional enum variants at any time. Adding new variants is not considered
5857 /// a breaking change. Applications should write their code in anticipation of:
5858 ///
5859 /// - New values appearing in future releases of the client library, **and**
5860 /// - New values received dynamically, without application changes.
5861 ///
5862 /// Please consult the [Working with enums] section in the user guide for some
5863 /// guidelines.
5864 ///
5865 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5866 #[derive(Clone, Debug, PartialEq)]
5867 #[non_exhaustive]
5868 pub enum ResetSslMode {
5869 /// Reset SSL mode is not specified.
5870 Unspecified,
5871 /// Refresh all TLS configs. This is the default behaviour.
5872 All,
5873 /// Refreshes the replication-related TLS configuration settings provided by
5874 /// the primary instance.
5875 /// Not applicable to on-premises replication instances.
5876 SyncFromPrimary,
5877 /// If set, the enum was initialized with an unknown value.
5878 ///
5879 /// Applications can examine the value using [ResetSslMode::value] or
5880 /// [ResetSslMode::name].
5881 UnknownValue(reset_ssl_mode::UnknownValue),
5882 }
5883
5884 #[doc(hidden)]
5885 pub mod reset_ssl_mode {
5886 #[allow(unused_imports)]
5887 use super::*;
5888 #[derive(Clone, Debug, PartialEq)]
5889 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5890 }
5891
5892 impl ResetSslMode {
5893 /// Gets the enum value.
5894 ///
5895 /// Returns `None` if the enum contains an unknown value deserialized from
5896 /// the string representation of enums.
5897 pub fn value(&self) -> std::option::Option<i32> {
5898 match self {
5899 Self::Unspecified => std::option::Option::Some(0),
5900 Self::All => std::option::Option::Some(1),
5901 Self::SyncFromPrimary => std::option::Option::Some(2),
5902 Self::UnknownValue(u) => u.0.value(),
5903 }
5904 }
5905
5906 /// Gets the enum value as a string.
5907 ///
5908 /// Returns `None` if the enum contains an unknown value deserialized from
5909 /// the integer representation of enums.
5910 pub fn name(&self) -> std::option::Option<&str> {
5911 match self {
5912 Self::Unspecified => std::option::Option::Some("RESET_SSL_MODE_UNSPECIFIED"),
5913 Self::All => std::option::Option::Some("ALL"),
5914 Self::SyncFromPrimary => std::option::Option::Some("SYNC_FROM_PRIMARY"),
5915 Self::UnknownValue(u) => u.0.name(),
5916 }
5917 }
5918 }
5919
5920 impl std::default::Default for ResetSslMode {
5921 fn default() -> Self {
5922 use std::convert::From;
5923 Self::from(0)
5924 }
5925 }
5926
5927 impl std::fmt::Display for ResetSslMode {
5928 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5929 wkt::internal::display_enum(f, self.name(), self.value())
5930 }
5931 }
5932
5933 impl std::convert::From<i32> for ResetSslMode {
5934 fn from(value: i32) -> Self {
5935 match value {
5936 0 => Self::Unspecified,
5937 1 => Self::All,
5938 2 => Self::SyncFromPrimary,
5939 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
5940 wkt::internal::UnknownEnumValue::Integer(value),
5941 )),
5942 }
5943 }
5944 }
5945
5946 impl std::convert::From<&str> for ResetSslMode {
5947 fn from(value: &str) -> Self {
5948 use std::string::ToString;
5949 match value {
5950 "RESET_SSL_MODE_UNSPECIFIED" => Self::Unspecified,
5951 "ALL" => Self::All,
5952 "SYNC_FROM_PRIMARY" => Self::SyncFromPrimary,
5953 _ => Self::UnknownValue(reset_ssl_mode::UnknownValue(
5954 wkt::internal::UnknownEnumValue::String(value.to_string()),
5955 )),
5956 }
5957 }
5958 }
5959
5960 impl serde::ser::Serialize for ResetSslMode {
5961 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5962 where
5963 S: serde::Serializer,
5964 {
5965 match self {
5966 Self::Unspecified => serializer.serialize_i32(0),
5967 Self::All => serializer.serialize_i32(1),
5968 Self::SyncFromPrimary => serializer.serialize_i32(2),
5969 Self::UnknownValue(u) => u.0.serialize(serializer),
5970 }
5971 }
5972 }
5973
5974 impl<'de> serde::de::Deserialize<'de> for ResetSslMode {
5975 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5976 where
5977 D: serde::Deserializer<'de>,
5978 {
5979 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResetSslMode>::new(
5980 ".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode",
5981 ))
5982 }
5983 }
5984}
5985
5986/// Instance restart request.
5987#[derive(Clone, Default, PartialEq)]
5988#[non_exhaustive]
5989pub struct SqlInstancesRestartRequest {
5990 /// Cloud SQL instance ID. This does not include the project ID.
5991 pub instance: std::string::String,
5992
5993 /// Project ID of the project that contains the instance to be restarted.
5994 pub project: std::string::String,
5995
5996 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5997}
5998
5999impl SqlInstancesRestartRequest {
6000 pub fn new() -> Self {
6001 std::default::Default::default()
6002 }
6003
6004 /// Sets the value of [instance][crate::model::SqlInstancesRestartRequest::instance].
6005 ///
6006 /// # Example
6007 /// ```ignore,no_run
6008 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6009 /// let x = SqlInstancesRestartRequest::new().set_instance("example");
6010 /// ```
6011 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6012 self.instance = v.into();
6013 self
6014 }
6015
6016 /// Sets the value of [project][crate::model::SqlInstancesRestartRequest::project].
6017 ///
6018 /// # Example
6019 /// ```ignore,no_run
6020 /// # use google_cloud_sql_v1::model::SqlInstancesRestartRequest;
6021 /// let x = SqlInstancesRestartRequest::new().set_project("example");
6022 /// ```
6023 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6024 self.project = v.into();
6025 self
6026 }
6027}
6028
6029impl wkt::message::Message for SqlInstancesRestartRequest {
6030 fn typename() -> &'static str {
6031 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestartRequest"
6032 }
6033}
6034
6035/// Instance restore backup request.
6036#[derive(Clone, Default, PartialEq)]
6037#[non_exhaustive]
6038pub struct SqlInstancesRestoreBackupRequest {
6039 /// Cloud SQL instance ID. This does not include the project ID.
6040 pub instance: std::string::String,
6041
6042 /// Project ID of the project that contains the instance.
6043 pub project: std::string::String,
6044
6045 pub body: std::option::Option<crate::model::InstancesRestoreBackupRequest>,
6046
6047 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6048}
6049
6050impl SqlInstancesRestoreBackupRequest {
6051 pub fn new() -> Self {
6052 std::default::Default::default()
6053 }
6054
6055 /// Sets the value of [instance][crate::model::SqlInstancesRestoreBackupRequest::instance].
6056 ///
6057 /// # Example
6058 /// ```ignore,no_run
6059 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6060 /// let x = SqlInstancesRestoreBackupRequest::new().set_instance("example");
6061 /// ```
6062 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6063 self.instance = v.into();
6064 self
6065 }
6066
6067 /// Sets the value of [project][crate::model::SqlInstancesRestoreBackupRequest::project].
6068 ///
6069 /// # Example
6070 /// ```ignore,no_run
6071 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6072 /// let x = SqlInstancesRestoreBackupRequest::new().set_project("example");
6073 /// ```
6074 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6075 self.project = v.into();
6076 self
6077 }
6078
6079 /// Sets the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6080 ///
6081 /// # Example
6082 /// ```ignore,no_run
6083 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6084 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6085 /// let x = SqlInstancesRestoreBackupRequest::new().set_body(InstancesRestoreBackupRequest::default()/* use setters */);
6086 /// ```
6087 pub fn set_body<T>(mut self, v: T) -> Self
6088 where
6089 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6090 {
6091 self.body = std::option::Option::Some(v.into());
6092 self
6093 }
6094
6095 /// Sets or clears the value of [body][crate::model::SqlInstancesRestoreBackupRequest::body].
6096 ///
6097 /// # Example
6098 /// ```ignore,no_run
6099 /// # use google_cloud_sql_v1::model::SqlInstancesRestoreBackupRequest;
6100 /// use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
6101 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(Some(InstancesRestoreBackupRequest::default()/* use setters */));
6102 /// let x = SqlInstancesRestoreBackupRequest::new().set_or_clear_body(None::<InstancesRestoreBackupRequest>);
6103 /// ```
6104 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6105 where
6106 T: std::convert::Into<crate::model::InstancesRestoreBackupRequest>,
6107 {
6108 self.body = v.map(|x| x.into());
6109 self
6110 }
6111}
6112
6113impl wkt::message::Message for SqlInstancesRestoreBackupRequest {
6114 fn typename() -> &'static str {
6115 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRestoreBackupRequest"
6116 }
6117}
6118
6119/// Instance rotate server CA request.
6120#[derive(Clone, Default, PartialEq)]
6121#[non_exhaustive]
6122pub struct SqlInstancesRotateServerCaRequest {
6123 /// Cloud SQL instance ID. This does not include the project ID.
6124 pub instance: std::string::String,
6125
6126 /// Project ID of the project that contains the instance.
6127 pub project: std::string::String,
6128
6129 pub body: std::option::Option<crate::model::InstancesRotateServerCaRequest>,
6130
6131 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6132}
6133
6134impl SqlInstancesRotateServerCaRequest {
6135 pub fn new() -> Self {
6136 std::default::Default::default()
6137 }
6138
6139 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCaRequest::instance].
6140 ///
6141 /// # Example
6142 /// ```ignore,no_run
6143 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6144 /// let x = SqlInstancesRotateServerCaRequest::new().set_instance("example");
6145 /// ```
6146 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6147 self.instance = v.into();
6148 self
6149 }
6150
6151 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCaRequest::project].
6152 ///
6153 /// # Example
6154 /// ```ignore,no_run
6155 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6156 /// let x = SqlInstancesRotateServerCaRequest::new().set_project("example");
6157 /// ```
6158 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6159 self.project = v.into();
6160 self
6161 }
6162
6163 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6164 ///
6165 /// # Example
6166 /// ```ignore,no_run
6167 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6168 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6169 /// let x = SqlInstancesRotateServerCaRequest::new().set_body(InstancesRotateServerCaRequest::default()/* use setters */);
6170 /// ```
6171 pub fn set_body<T>(mut self, v: T) -> Self
6172 where
6173 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6174 {
6175 self.body = std::option::Option::Some(v.into());
6176 self
6177 }
6178
6179 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCaRequest::body].
6180 ///
6181 /// # Example
6182 /// ```ignore,no_run
6183 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCaRequest;
6184 /// use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
6185 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(Some(InstancesRotateServerCaRequest::default()/* use setters */));
6186 /// let x = SqlInstancesRotateServerCaRequest::new().set_or_clear_body(None::<InstancesRotateServerCaRequest>);
6187 /// ```
6188 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6189 where
6190 T: std::convert::Into<crate::model::InstancesRotateServerCaRequest>,
6191 {
6192 self.body = v.map(|x| x.into());
6193 self
6194 }
6195}
6196
6197impl wkt::message::Message for SqlInstancesRotateServerCaRequest {
6198 fn typename() -> &'static str {
6199 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCaRequest"
6200 }
6201}
6202
6203/// Instance rotate server certificate request.
6204#[derive(Clone, Default, PartialEq)]
6205#[non_exhaustive]
6206pub struct SqlInstancesRotateServerCertificateRequest {
6207 /// Required. Cloud SQL instance ID. This does not include the project ID.
6208 pub instance: std::string::String,
6209
6210 /// Required. Project ID of the project that contains the instance.
6211 pub project: std::string::String,
6212
6213 /// Optional. Rotate server certificate request body.
6214 pub body: std::option::Option<crate::model::InstancesRotateServerCertificateRequest>,
6215
6216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6217}
6218
6219impl SqlInstancesRotateServerCertificateRequest {
6220 pub fn new() -> Self {
6221 std::default::Default::default()
6222 }
6223
6224 /// Sets the value of [instance][crate::model::SqlInstancesRotateServerCertificateRequest::instance].
6225 ///
6226 /// # Example
6227 /// ```ignore,no_run
6228 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6229 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_instance("example");
6230 /// ```
6231 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6232 self.instance = v.into();
6233 self
6234 }
6235
6236 /// Sets the value of [project][crate::model::SqlInstancesRotateServerCertificateRequest::project].
6237 ///
6238 /// # Example
6239 /// ```ignore,no_run
6240 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6241 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_project("example");
6242 /// ```
6243 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6244 self.project = v.into();
6245 self
6246 }
6247
6248 /// Sets the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6249 ///
6250 /// # Example
6251 /// ```ignore,no_run
6252 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6253 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6254 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_body(InstancesRotateServerCertificateRequest::default()/* use setters */);
6255 /// ```
6256 pub fn set_body<T>(mut self, v: T) -> Self
6257 where
6258 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6259 {
6260 self.body = std::option::Option::Some(v.into());
6261 self
6262 }
6263
6264 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateServerCertificateRequest::body].
6265 ///
6266 /// # Example
6267 /// ```ignore,no_run
6268 /// # use google_cloud_sql_v1::model::SqlInstancesRotateServerCertificateRequest;
6269 /// use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
6270 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(Some(InstancesRotateServerCertificateRequest::default()/* use setters */));
6271 /// let x = SqlInstancesRotateServerCertificateRequest::new().set_or_clear_body(None::<InstancesRotateServerCertificateRequest>);
6272 /// ```
6273 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6274 where
6275 T: std::convert::Into<crate::model::InstancesRotateServerCertificateRequest>,
6276 {
6277 self.body = v.map(|x| x.into());
6278 self
6279 }
6280}
6281
6282impl wkt::message::Message for SqlInstancesRotateServerCertificateRequest {
6283 fn typename() -> &'static str {
6284 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest"
6285 }
6286}
6287
6288/// Instance rotate server certificate request.
6289#[derive(Clone, Default, PartialEq)]
6290#[non_exhaustive]
6291pub struct SqlInstancesRotateEntraIdCertificateRequest {
6292 /// Required. Cloud SQL instance ID. This does not include the project ID.
6293 pub instance: std::string::String,
6294
6295 /// Required. Project ID of the project that contains the instance.
6296 pub project: std::string::String,
6297
6298 /// Optional. Rotate Entra ID certificate request body.
6299 pub body: std::option::Option<crate::model::InstancesRotateEntraIdCertificateRequest>,
6300
6301 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6302}
6303
6304impl SqlInstancesRotateEntraIdCertificateRequest {
6305 pub fn new() -> Self {
6306 std::default::Default::default()
6307 }
6308
6309 /// Sets the value of [instance][crate::model::SqlInstancesRotateEntraIdCertificateRequest::instance].
6310 ///
6311 /// # Example
6312 /// ```ignore,no_run
6313 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6314 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_instance("example");
6315 /// ```
6316 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6317 self.instance = v.into();
6318 self
6319 }
6320
6321 /// Sets the value of [project][crate::model::SqlInstancesRotateEntraIdCertificateRequest::project].
6322 ///
6323 /// # Example
6324 /// ```ignore,no_run
6325 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6326 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_project("example");
6327 /// ```
6328 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6329 self.project = v.into();
6330 self
6331 }
6332
6333 /// Sets the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6334 ///
6335 /// # Example
6336 /// ```ignore,no_run
6337 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6338 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6339 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_body(InstancesRotateEntraIdCertificateRequest::default()/* use setters */);
6340 /// ```
6341 pub fn set_body<T>(mut self, v: T) -> Self
6342 where
6343 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6344 {
6345 self.body = std::option::Option::Some(v.into());
6346 self
6347 }
6348
6349 /// Sets or clears the value of [body][crate::model::SqlInstancesRotateEntraIdCertificateRequest::body].
6350 ///
6351 /// # Example
6352 /// ```ignore,no_run
6353 /// # use google_cloud_sql_v1::model::SqlInstancesRotateEntraIdCertificateRequest;
6354 /// use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
6355 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(Some(InstancesRotateEntraIdCertificateRequest::default()/* use setters */));
6356 /// let x = SqlInstancesRotateEntraIdCertificateRequest::new().set_or_clear_body(None::<InstancesRotateEntraIdCertificateRequest>);
6357 /// ```
6358 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6359 where
6360 T: std::convert::Into<crate::model::InstancesRotateEntraIdCertificateRequest>,
6361 {
6362 self.body = v.map(|x| x.into());
6363 self
6364 }
6365}
6366
6367impl wkt::message::Message for SqlInstancesRotateEntraIdCertificateRequest {
6368 fn typename() -> &'static str {
6369 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest"
6370 }
6371}
6372
6373/// Instance start replica request.
6374#[derive(Clone, Default, PartialEq)]
6375#[non_exhaustive]
6376pub struct SqlInstancesStartReplicaRequest {
6377 /// Cloud SQL read replica instance name.
6378 pub instance: std::string::String,
6379
6380 /// ID of the project that contains the read replica.
6381 pub project: std::string::String,
6382
6383 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6384}
6385
6386impl SqlInstancesStartReplicaRequest {
6387 pub fn new() -> Self {
6388 std::default::Default::default()
6389 }
6390
6391 /// Sets the value of [instance][crate::model::SqlInstancesStartReplicaRequest::instance].
6392 ///
6393 /// # Example
6394 /// ```ignore,no_run
6395 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6396 /// let x = SqlInstancesStartReplicaRequest::new().set_instance("example");
6397 /// ```
6398 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6399 self.instance = v.into();
6400 self
6401 }
6402
6403 /// Sets the value of [project][crate::model::SqlInstancesStartReplicaRequest::project].
6404 ///
6405 /// # Example
6406 /// ```ignore,no_run
6407 /// # use google_cloud_sql_v1::model::SqlInstancesStartReplicaRequest;
6408 /// let x = SqlInstancesStartReplicaRequest::new().set_project("example");
6409 /// ```
6410 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6411 self.project = v.into();
6412 self
6413 }
6414}
6415
6416impl wkt::message::Message for SqlInstancesStartReplicaRequest {
6417 fn typename() -> &'static str {
6418 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartReplicaRequest"
6419 }
6420}
6421
6422/// Instance stop replica request.
6423#[derive(Clone, Default, PartialEq)]
6424#[non_exhaustive]
6425pub struct SqlInstancesStopReplicaRequest {
6426 /// Cloud SQL read replica instance name.
6427 pub instance: std::string::String,
6428
6429 /// ID of the project that contains the read replica.
6430 pub project: std::string::String,
6431
6432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6433}
6434
6435impl SqlInstancesStopReplicaRequest {
6436 pub fn new() -> Self {
6437 std::default::Default::default()
6438 }
6439
6440 /// Sets the value of [instance][crate::model::SqlInstancesStopReplicaRequest::instance].
6441 ///
6442 /// # Example
6443 /// ```ignore,no_run
6444 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6445 /// let x = SqlInstancesStopReplicaRequest::new().set_instance("example");
6446 /// ```
6447 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6448 self.instance = v.into();
6449 self
6450 }
6451
6452 /// Sets the value of [project][crate::model::SqlInstancesStopReplicaRequest::project].
6453 ///
6454 /// # Example
6455 /// ```ignore,no_run
6456 /// # use google_cloud_sql_v1::model::SqlInstancesStopReplicaRequest;
6457 /// let x = SqlInstancesStopReplicaRequest::new().set_project("example");
6458 /// ```
6459 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6460 self.project = v.into();
6461 self
6462 }
6463}
6464
6465impl wkt::message::Message for SqlInstancesStopReplicaRequest {
6466 fn typename() -> &'static str {
6467 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStopReplicaRequest"
6468 }
6469}
6470
6471/// Instance truncate log request.
6472#[derive(Clone, Default, PartialEq)]
6473#[non_exhaustive]
6474pub struct SqlInstancesTruncateLogRequest {
6475 /// Cloud SQL instance ID. This does not include the project ID.
6476 pub instance: std::string::String,
6477
6478 /// Project ID of the Cloud SQL project.
6479 pub project: std::string::String,
6480
6481 pub body: std::option::Option<crate::model::InstancesTruncateLogRequest>,
6482
6483 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6484}
6485
6486impl SqlInstancesTruncateLogRequest {
6487 pub fn new() -> Self {
6488 std::default::Default::default()
6489 }
6490
6491 /// Sets the value of [instance][crate::model::SqlInstancesTruncateLogRequest::instance].
6492 ///
6493 /// # Example
6494 /// ```ignore,no_run
6495 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6496 /// let x = SqlInstancesTruncateLogRequest::new().set_instance("example");
6497 /// ```
6498 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6499 self.instance = v.into();
6500 self
6501 }
6502
6503 /// Sets the value of [project][crate::model::SqlInstancesTruncateLogRequest::project].
6504 ///
6505 /// # Example
6506 /// ```ignore,no_run
6507 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6508 /// let x = SqlInstancesTruncateLogRequest::new().set_project("example");
6509 /// ```
6510 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6511 self.project = v.into();
6512 self
6513 }
6514
6515 /// Sets the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6516 ///
6517 /// # Example
6518 /// ```ignore,no_run
6519 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6520 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6521 /// let x = SqlInstancesTruncateLogRequest::new().set_body(InstancesTruncateLogRequest::default()/* use setters */);
6522 /// ```
6523 pub fn set_body<T>(mut self, v: T) -> Self
6524 where
6525 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6526 {
6527 self.body = std::option::Option::Some(v.into());
6528 self
6529 }
6530
6531 /// Sets or clears the value of [body][crate::model::SqlInstancesTruncateLogRequest::body].
6532 ///
6533 /// # Example
6534 /// ```ignore,no_run
6535 /// # use google_cloud_sql_v1::model::SqlInstancesTruncateLogRequest;
6536 /// use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
6537 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(Some(InstancesTruncateLogRequest::default()/* use setters */));
6538 /// let x = SqlInstancesTruncateLogRequest::new().set_or_clear_body(None::<InstancesTruncateLogRequest>);
6539 /// ```
6540 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6541 where
6542 T: std::convert::Into<crate::model::InstancesTruncateLogRequest>,
6543 {
6544 self.body = v.map(|x| x.into());
6545 self
6546 }
6547}
6548
6549impl wkt::message::Message for SqlInstancesTruncateLogRequest {
6550 fn typename() -> &'static str {
6551 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesTruncateLogRequest"
6552 }
6553}
6554
6555/// Instance perform disk shrink request.
6556#[derive(Clone, Default, PartialEq)]
6557#[non_exhaustive]
6558pub struct SqlInstancesPerformDiskShrinkRequest {
6559 /// Cloud SQL instance ID. This does not include the project ID.
6560 pub instance: std::string::String,
6561
6562 /// Project ID of the project that contains the instance.
6563 pub project: std::string::String,
6564
6565 /// Perform disk shrink context.
6566 pub body: std::option::Option<crate::model::PerformDiskShrinkContext>,
6567
6568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6569}
6570
6571impl SqlInstancesPerformDiskShrinkRequest {
6572 pub fn new() -> Self {
6573 std::default::Default::default()
6574 }
6575
6576 /// Sets the value of [instance][crate::model::SqlInstancesPerformDiskShrinkRequest::instance].
6577 ///
6578 /// # Example
6579 /// ```ignore,no_run
6580 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6581 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_instance("example");
6582 /// ```
6583 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6584 self.instance = v.into();
6585 self
6586 }
6587
6588 /// Sets the value of [project][crate::model::SqlInstancesPerformDiskShrinkRequest::project].
6589 ///
6590 /// # Example
6591 /// ```ignore,no_run
6592 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6593 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_project("example");
6594 /// ```
6595 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6596 self.project = v.into();
6597 self
6598 }
6599
6600 /// Sets the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6601 ///
6602 /// # Example
6603 /// ```ignore,no_run
6604 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6605 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6606 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_body(PerformDiskShrinkContext::default()/* use setters */);
6607 /// ```
6608 pub fn set_body<T>(mut self, v: T) -> Self
6609 where
6610 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6611 {
6612 self.body = std::option::Option::Some(v.into());
6613 self
6614 }
6615
6616 /// Sets or clears the value of [body][crate::model::SqlInstancesPerformDiskShrinkRequest::body].
6617 ///
6618 /// # Example
6619 /// ```ignore,no_run
6620 /// # use google_cloud_sql_v1::model::SqlInstancesPerformDiskShrinkRequest;
6621 /// use google_cloud_sql_v1::model::PerformDiskShrinkContext;
6622 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(Some(PerformDiskShrinkContext::default()/* use setters */));
6623 /// let x = SqlInstancesPerformDiskShrinkRequest::new().set_or_clear_body(None::<PerformDiskShrinkContext>);
6624 /// ```
6625 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6626 where
6627 T: std::convert::Into<crate::model::PerformDiskShrinkContext>,
6628 {
6629 self.body = v.map(|x| x.into());
6630 self
6631 }
6632}
6633
6634impl wkt::message::Message for SqlInstancesPerformDiskShrinkRequest {
6635 fn typename() -> &'static str {
6636 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest"
6637 }
6638}
6639
6640/// Instance update request.
6641#[derive(Clone, Default, PartialEq)]
6642#[non_exhaustive]
6643pub struct SqlInstancesUpdateRequest {
6644 /// Cloud SQL instance ID. This does not include the project ID.
6645 pub instance: std::string::String,
6646
6647 /// Project ID of the project that contains the instance.
6648 pub project: std::string::String,
6649
6650 pub body: std::option::Option<crate::model::DatabaseInstance>,
6651
6652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6653}
6654
6655impl SqlInstancesUpdateRequest {
6656 pub fn new() -> Self {
6657 std::default::Default::default()
6658 }
6659
6660 /// Sets the value of [instance][crate::model::SqlInstancesUpdateRequest::instance].
6661 ///
6662 /// # Example
6663 /// ```ignore,no_run
6664 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6665 /// let x = SqlInstancesUpdateRequest::new().set_instance("example");
6666 /// ```
6667 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6668 self.instance = v.into();
6669 self
6670 }
6671
6672 /// Sets the value of [project][crate::model::SqlInstancesUpdateRequest::project].
6673 ///
6674 /// # Example
6675 /// ```ignore,no_run
6676 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6677 /// let x = SqlInstancesUpdateRequest::new().set_project("example");
6678 /// ```
6679 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6680 self.project = v.into();
6681 self
6682 }
6683
6684 /// Sets the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6685 ///
6686 /// # Example
6687 /// ```ignore,no_run
6688 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6689 /// use google_cloud_sql_v1::model::DatabaseInstance;
6690 /// let x = SqlInstancesUpdateRequest::new().set_body(DatabaseInstance::default()/* use setters */);
6691 /// ```
6692 pub fn set_body<T>(mut self, v: T) -> Self
6693 where
6694 T: std::convert::Into<crate::model::DatabaseInstance>,
6695 {
6696 self.body = std::option::Option::Some(v.into());
6697 self
6698 }
6699
6700 /// Sets or clears the value of [body][crate::model::SqlInstancesUpdateRequest::body].
6701 ///
6702 /// # Example
6703 /// ```ignore,no_run
6704 /// # use google_cloud_sql_v1::model::SqlInstancesUpdateRequest;
6705 /// use google_cloud_sql_v1::model::DatabaseInstance;
6706 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(Some(DatabaseInstance::default()/* use setters */));
6707 /// let x = SqlInstancesUpdateRequest::new().set_or_clear_body(None::<DatabaseInstance>);
6708 /// ```
6709 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6710 where
6711 T: std::convert::Into<crate::model::DatabaseInstance>,
6712 {
6713 self.body = v.map(|x| x.into());
6714 self
6715 }
6716}
6717
6718impl wkt::message::Message for SqlInstancesUpdateRequest {
6719 fn typename() -> &'static str {
6720 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesUpdateRequest"
6721 }
6722}
6723
6724/// Instance reschedule maintenance request.
6725#[derive(Clone, Default, PartialEq)]
6726#[non_exhaustive]
6727pub struct SqlInstancesRescheduleMaintenanceRequest {
6728 /// Cloud SQL instance ID. This does not include the project ID.
6729 pub instance: std::string::String,
6730
6731 /// ID of the project that contains the instance.
6732 pub project: std::string::String,
6733
6734 pub body: std::option::Option<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6735
6736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6737}
6738
6739impl SqlInstancesRescheduleMaintenanceRequest {
6740 pub fn new() -> Self {
6741 std::default::Default::default()
6742 }
6743
6744 /// Sets the value of [instance][crate::model::SqlInstancesRescheduleMaintenanceRequest::instance].
6745 ///
6746 /// # Example
6747 /// ```ignore,no_run
6748 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6749 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_instance("example");
6750 /// ```
6751 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6752 self.instance = v.into();
6753 self
6754 }
6755
6756 /// Sets the value of [project][crate::model::SqlInstancesRescheduleMaintenanceRequest::project].
6757 ///
6758 /// # Example
6759 /// ```ignore,no_run
6760 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6761 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_project("example");
6762 /// ```
6763 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6764 self.project = v.into();
6765 self
6766 }
6767
6768 /// Sets the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6769 ///
6770 /// # Example
6771 /// ```ignore,no_run
6772 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6773 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6774 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_body(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */);
6775 /// ```
6776 pub fn set_body<T>(mut self, v: T) -> Self
6777 where
6778 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6779 {
6780 self.body = std::option::Option::Some(v.into());
6781 self
6782 }
6783
6784 /// Sets or clears the value of [body][crate::model::SqlInstancesRescheduleMaintenanceRequest::body].
6785 ///
6786 /// # Example
6787 /// ```ignore,no_run
6788 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequest;
6789 /// use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
6790 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(Some(SqlInstancesRescheduleMaintenanceRequestBody::default()/* use setters */));
6791 /// let x = SqlInstancesRescheduleMaintenanceRequest::new().set_or_clear_body(None::<SqlInstancesRescheduleMaintenanceRequestBody>);
6792 /// ```
6793 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6794 where
6795 T: std::convert::Into<crate::model::SqlInstancesRescheduleMaintenanceRequestBody>,
6796 {
6797 self.body = v.map(|x| x.into());
6798 self
6799 }
6800}
6801
6802impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequest {
6803 fn typename() -> &'static str {
6804 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest"
6805 }
6806}
6807
6808/// Instance reencrypt request.
6809#[derive(Clone, Default, PartialEq)]
6810#[non_exhaustive]
6811pub struct SqlInstancesReencryptRequest {
6812 /// Cloud SQL instance ID. This does not include the project ID.
6813 pub instance: std::string::String,
6814
6815 /// ID of the project that contains the instance.
6816 pub project: std::string::String,
6817
6818 /// Reencrypt body that users request
6819 pub body: std::option::Option<crate::model::InstancesReencryptRequest>,
6820
6821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6822}
6823
6824impl SqlInstancesReencryptRequest {
6825 pub fn new() -> Self {
6826 std::default::Default::default()
6827 }
6828
6829 /// Sets the value of [instance][crate::model::SqlInstancesReencryptRequest::instance].
6830 ///
6831 /// # Example
6832 /// ```ignore,no_run
6833 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6834 /// let x = SqlInstancesReencryptRequest::new().set_instance("example");
6835 /// ```
6836 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6837 self.instance = v.into();
6838 self
6839 }
6840
6841 /// Sets the value of [project][crate::model::SqlInstancesReencryptRequest::project].
6842 ///
6843 /// # Example
6844 /// ```ignore,no_run
6845 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6846 /// let x = SqlInstancesReencryptRequest::new().set_project("example");
6847 /// ```
6848 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6849 self.project = v.into();
6850 self
6851 }
6852
6853 /// Sets the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6854 ///
6855 /// # Example
6856 /// ```ignore,no_run
6857 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6858 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6859 /// let x = SqlInstancesReencryptRequest::new().set_body(InstancesReencryptRequest::default()/* use setters */);
6860 /// ```
6861 pub fn set_body<T>(mut self, v: T) -> Self
6862 where
6863 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6864 {
6865 self.body = std::option::Option::Some(v.into());
6866 self
6867 }
6868
6869 /// Sets or clears the value of [body][crate::model::SqlInstancesReencryptRequest::body].
6870 ///
6871 /// # Example
6872 /// ```ignore,no_run
6873 /// # use google_cloud_sql_v1::model::SqlInstancesReencryptRequest;
6874 /// use google_cloud_sql_v1::model::InstancesReencryptRequest;
6875 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(Some(InstancesReencryptRequest::default()/* use setters */));
6876 /// let x = SqlInstancesReencryptRequest::new().set_or_clear_body(None::<InstancesReencryptRequest>);
6877 /// ```
6878 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6879 where
6880 T: std::convert::Into<crate::model::InstancesReencryptRequest>,
6881 {
6882 self.body = v.map(|x| x.into());
6883 self
6884 }
6885}
6886
6887impl wkt::message::Message for SqlInstancesReencryptRequest {
6888 fn typename() -> &'static str {
6889 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReencryptRequest"
6890 }
6891}
6892
6893/// Database Instance reencrypt request.
6894#[derive(Clone, Default, PartialEq)]
6895#[non_exhaustive]
6896pub struct InstancesReencryptRequest {
6897 /// Configuration specific to backup re-encryption
6898 pub backup_reencryption_config: std::option::Option<crate::model::BackupReencryptionConfig>,
6899
6900 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6901}
6902
6903impl InstancesReencryptRequest {
6904 pub fn new() -> Self {
6905 std::default::Default::default()
6906 }
6907
6908 /// Sets the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6909 ///
6910 /// # Example
6911 /// ```ignore,no_run
6912 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6913 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
6914 /// let x = InstancesReencryptRequest::new().set_backup_reencryption_config(BackupReencryptionConfig::default()/* use setters */);
6915 /// ```
6916 pub fn set_backup_reencryption_config<T>(mut self, v: T) -> Self
6917 where
6918 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
6919 {
6920 self.backup_reencryption_config = std::option::Option::Some(v.into());
6921 self
6922 }
6923
6924 /// Sets or clears the value of [backup_reencryption_config][crate::model::InstancesReencryptRequest::backup_reencryption_config].
6925 ///
6926 /// # Example
6927 /// ```ignore,no_run
6928 /// # use google_cloud_sql_v1::model::InstancesReencryptRequest;
6929 /// use google_cloud_sql_v1::model::BackupReencryptionConfig;
6930 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(Some(BackupReencryptionConfig::default()/* use setters */));
6931 /// let x = InstancesReencryptRequest::new().set_or_clear_backup_reencryption_config(None::<BackupReencryptionConfig>);
6932 /// ```
6933 pub fn set_or_clear_backup_reencryption_config<T>(mut self, v: std::option::Option<T>) -> Self
6934 where
6935 T: std::convert::Into<crate::model::BackupReencryptionConfig>,
6936 {
6937 self.backup_reencryption_config = v.map(|x| x.into());
6938 self
6939 }
6940}
6941
6942impl wkt::message::Message for InstancesReencryptRequest {
6943 fn typename() -> &'static str {
6944 "type.googleapis.com/google.cloud.sql.v1.InstancesReencryptRequest"
6945 }
6946}
6947
6948/// Backup Reencryption Config
6949#[derive(Clone, Default, PartialEq)]
6950#[non_exhaustive]
6951pub struct BackupReencryptionConfig {
6952 /// Backup re-encryption limit
6953 pub backup_limit: std::option::Option<i32>,
6954
6955 /// Type of backups users want to re-encrypt.
6956 pub backup_type: std::option::Option<crate::model::backup_reencryption_config::BackupType>,
6957
6958 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6959}
6960
6961impl BackupReencryptionConfig {
6962 pub fn new() -> Self {
6963 std::default::Default::default()
6964 }
6965
6966 /// Sets the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
6967 ///
6968 /// # Example
6969 /// ```ignore,no_run
6970 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
6971 /// let x = BackupReencryptionConfig::new().set_backup_limit(42);
6972 /// ```
6973 pub fn set_backup_limit<T>(mut self, v: T) -> Self
6974 where
6975 T: std::convert::Into<i32>,
6976 {
6977 self.backup_limit = std::option::Option::Some(v.into());
6978 self
6979 }
6980
6981 /// Sets or clears the value of [backup_limit][crate::model::BackupReencryptionConfig::backup_limit].
6982 ///
6983 /// # Example
6984 /// ```ignore,no_run
6985 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
6986 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(Some(42));
6987 /// let x = BackupReencryptionConfig::new().set_or_clear_backup_limit(None::<i32>);
6988 /// ```
6989 pub fn set_or_clear_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
6990 where
6991 T: std::convert::Into<i32>,
6992 {
6993 self.backup_limit = v.map(|x| x.into());
6994 self
6995 }
6996
6997 /// Sets the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
6998 ///
6999 /// # Example
7000 /// ```ignore,no_run
7001 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7002 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7003 /// let x0 = BackupReencryptionConfig::new().set_backup_type(BackupType::Automated);
7004 /// let x1 = BackupReencryptionConfig::new().set_backup_type(BackupType::OnDemand);
7005 /// ```
7006 pub fn set_backup_type<T>(mut self, v: T) -> Self
7007 where
7008 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7009 {
7010 self.backup_type = std::option::Option::Some(v.into());
7011 self
7012 }
7013
7014 /// Sets or clears the value of [backup_type][crate::model::BackupReencryptionConfig::backup_type].
7015 ///
7016 /// # Example
7017 /// ```ignore,no_run
7018 /// # use google_cloud_sql_v1::model::BackupReencryptionConfig;
7019 /// use google_cloud_sql_v1::model::backup_reencryption_config::BackupType;
7020 /// let x0 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::Automated));
7021 /// let x1 = BackupReencryptionConfig::new().set_or_clear_backup_type(Some(BackupType::OnDemand));
7022 /// let x_none = BackupReencryptionConfig::new().set_or_clear_backup_type(None::<BackupType>);
7023 /// ```
7024 pub fn set_or_clear_backup_type<T>(mut self, v: std::option::Option<T>) -> Self
7025 where
7026 T: std::convert::Into<crate::model::backup_reencryption_config::BackupType>,
7027 {
7028 self.backup_type = v.map(|x| x.into());
7029 self
7030 }
7031}
7032
7033impl wkt::message::Message for BackupReencryptionConfig {
7034 fn typename() -> &'static str {
7035 "type.googleapis.com/google.cloud.sql.v1.BackupReencryptionConfig"
7036 }
7037}
7038
7039/// Defines additional types related to [BackupReencryptionConfig].
7040pub mod backup_reencryption_config {
7041 #[allow(unused_imports)]
7042 use super::*;
7043
7044 /// Backup type for re-encryption
7045 ///
7046 /// # Working with unknown values
7047 ///
7048 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7049 /// additional enum variants at any time. Adding new variants is not considered
7050 /// a breaking change. Applications should write their code in anticipation of:
7051 ///
7052 /// - New values appearing in future releases of the client library, **and**
7053 /// - New values received dynamically, without application changes.
7054 ///
7055 /// Please consult the [Working with enums] section in the user guide for some
7056 /// guidelines.
7057 ///
7058 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7059 #[derive(Clone, Debug, PartialEq)]
7060 #[non_exhaustive]
7061 pub enum BackupType {
7062 /// Unknown backup type, will be defaulted to AUTOMATIC backup type
7063 Unspecified,
7064 /// Reencrypt automatic backups
7065 Automated,
7066 /// Reencrypt on-demand backups
7067 OnDemand,
7068 /// If set, the enum was initialized with an unknown value.
7069 ///
7070 /// Applications can examine the value using [BackupType::value] or
7071 /// [BackupType::name].
7072 UnknownValue(backup_type::UnknownValue),
7073 }
7074
7075 #[doc(hidden)]
7076 pub mod backup_type {
7077 #[allow(unused_imports)]
7078 use super::*;
7079 #[derive(Clone, Debug, PartialEq)]
7080 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7081 }
7082
7083 impl BackupType {
7084 /// Gets the enum value.
7085 ///
7086 /// Returns `None` if the enum contains an unknown value deserialized from
7087 /// the string representation of enums.
7088 pub fn value(&self) -> std::option::Option<i32> {
7089 match self {
7090 Self::Unspecified => std::option::Option::Some(0),
7091 Self::Automated => std::option::Option::Some(1),
7092 Self::OnDemand => std::option::Option::Some(2),
7093 Self::UnknownValue(u) => u.0.value(),
7094 }
7095 }
7096
7097 /// Gets the enum value as a string.
7098 ///
7099 /// Returns `None` if the enum contains an unknown value deserialized from
7100 /// the integer representation of enums.
7101 pub fn name(&self) -> std::option::Option<&str> {
7102 match self {
7103 Self::Unspecified => std::option::Option::Some("BACKUP_TYPE_UNSPECIFIED"),
7104 Self::Automated => std::option::Option::Some("AUTOMATED"),
7105 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
7106 Self::UnknownValue(u) => u.0.name(),
7107 }
7108 }
7109 }
7110
7111 impl std::default::Default for BackupType {
7112 fn default() -> Self {
7113 use std::convert::From;
7114 Self::from(0)
7115 }
7116 }
7117
7118 impl std::fmt::Display for BackupType {
7119 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7120 wkt::internal::display_enum(f, self.name(), self.value())
7121 }
7122 }
7123
7124 impl std::convert::From<i32> for BackupType {
7125 fn from(value: i32) -> Self {
7126 match value {
7127 0 => Self::Unspecified,
7128 1 => Self::Automated,
7129 2 => Self::OnDemand,
7130 _ => Self::UnknownValue(backup_type::UnknownValue(
7131 wkt::internal::UnknownEnumValue::Integer(value),
7132 )),
7133 }
7134 }
7135 }
7136
7137 impl std::convert::From<&str> for BackupType {
7138 fn from(value: &str) -> Self {
7139 use std::string::ToString;
7140 match value {
7141 "BACKUP_TYPE_UNSPECIFIED" => Self::Unspecified,
7142 "AUTOMATED" => Self::Automated,
7143 "ON_DEMAND" => Self::OnDemand,
7144 _ => Self::UnknownValue(backup_type::UnknownValue(
7145 wkt::internal::UnknownEnumValue::String(value.to_string()),
7146 )),
7147 }
7148 }
7149 }
7150
7151 impl serde::ser::Serialize for BackupType {
7152 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7153 where
7154 S: serde::Serializer,
7155 {
7156 match self {
7157 Self::Unspecified => serializer.serialize_i32(0),
7158 Self::Automated => serializer.serialize_i32(1),
7159 Self::OnDemand => serializer.serialize_i32(2),
7160 Self::UnknownValue(u) => u.0.serialize(serializer),
7161 }
7162 }
7163 }
7164
7165 impl<'de> serde::de::Deserialize<'de> for BackupType {
7166 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7167 where
7168 D: serde::Deserializer<'de>,
7169 {
7170 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupType>::new(
7171 ".google.cloud.sql.v1.BackupReencryptionConfig.BackupType",
7172 ))
7173 }
7174 }
7175}
7176
7177/// The selected object that Cloud SQL migrates.
7178#[derive(Clone, Default, PartialEq)]
7179#[non_exhaustive]
7180pub struct ExternalSyncSelectedObject {
7181 /// The name of the database that Cloud SQL migrates.
7182 pub database: std::string::String,
7183
7184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7185}
7186
7187impl ExternalSyncSelectedObject {
7188 pub fn new() -> Self {
7189 std::default::Default::default()
7190 }
7191
7192 /// Sets the value of [database][crate::model::ExternalSyncSelectedObject::database].
7193 ///
7194 /// # Example
7195 /// ```ignore,no_run
7196 /// # use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7197 /// let x = ExternalSyncSelectedObject::new().set_database("example");
7198 /// ```
7199 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7200 self.database = v.into();
7201 self
7202 }
7203}
7204
7205impl wkt::message::Message for ExternalSyncSelectedObject {
7206 fn typename() -> &'static str {
7207 "type.googleapis.com/google.cloud.sql.v1.ExternalSyncSelectedObject"
7208 }
7209}
7210
7211/// Instance get disk shrink config request.
7212#[derive(Clone, Default, PartialEq)]
7213#[non_exhaustive]
7214pub struct SqlInstancesGetDiskShrinkConfigRequest {
7215 /// Cloud SQL instance ID. This does not include the project ID.
7216 pub instance: std::string::String,
7217
7218 /// Project ID of the project that contains the instance.
7219 pub project: std::string::String,
7220
7221 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7222}
7223
7224impl SqlInstancesGetDiskShrinkConfigRequest {
7225 pub fn new() -> Self {
7226 std::default::Default::default()
7227 }
7228
7229 /// Sets the value of [instance][crate::model::SqlInstancesGetDiskShrinkConfigRequest::instance].
7230 ///
7231 /// # Example
7232 /// ```ignore,no_run
7233 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7234 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_instance("example");
7235 /// ```
7236 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7237 self.instance = v.into();
7238 self
7239 }
7240
7241 /// Sets the value of [project][crate::model::SqlInstancesGetDiskShrinkConfigRequest::project].
7242 ///
7243 /// # Example
7244 /// ```ignore,no_run
7245 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigRequest;
7246 /// let x = SqlInstancesGetDiskShrinkConfigRequest::new().set_project("example");
7247 /// ```
7248 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7249 self.project = v.into();
7250 self
7251 }
7252}
7253
7254impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigRequest {
7255 fn typename() -> &'static str {
7256 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest"
7257 }
7258}
7259
7260/// Instance verify external sync settings request.
7261#[derive(Clone, Default, PartialEq)]
7262#[non_exhaustive]
7263pub struct SqlInstancesVerifyExternalSyncSettingsRequest {
7264 /// Cloud SQL instance ID. This does not include the project ID.
7265 pub instance: std::string::String,
7266
7267 /// Project ID of the project that contains the instance.
7268 pub project: std::string::String,
7269
7270 /// Flag to enable verifying connection only
7271 pub verify_connection_only: bool,
7272
7273 /// External sync mode
7274 pub sync_mode:
7275 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7276
7277 /// Optional. Flag to verify settings required by replication setup only
7278 pub verify_replication_only: bool,
7279
7280 /// Optional. MigrationType configures the migration to use physical files or
7281 /// logical dump files. If not set, then the logical dump file configuration is
7282 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7283 pub migration_type:
7284 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7285
7286 /// Optional. Parallel level for initial data sync. Only applicable for
7287 /// PostgreSQL.
7288 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7289
7290 /// Optional. Migrate only the specified objects from the source instance. If
7291 /// this field is empty, then migrate all objects.
7292 pub selected_objects: std::vec::Vec<crate::model::ExternalSyncSelectedObject>,
7293
7294 pub sync_config: std::option::Option<
7295 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7296 >,
7297
7298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7299}
7300
7301impl SqlInstancesVerifyExternalSyncSettingsRequest {
7302 pub fn new() -> Self {
7303 std::default::Default::default()
7304 }
7305
7306 /// Sets the value of [instance][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::instance].
7307 ///
7308 /// # Example
7309 /// ```ignore,no_run
7310 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7311 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_instance("example");
7312 /// ```
7313 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7314 self.instance = v.into();
7315 self
7316 }
7317
7318 /// Sets the value of [project][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::project].
7319 ///
7320 /// # Example
7321 /// ```ignore,no_run
7322 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7323 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_project("example");
7324 /// ```
7325 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7326 self.project = v.into();
7327 self
7328 }
7329
7330 /// Sets the value of [verify_connection_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_connection_only].
7331 ///
7332 /// # Example
7333 /// ```ignore,no_run
7334 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7335 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_connection_only(true);
7336 /// ```
7337 pub fn set_verify_connection_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7338 self.verify_connection_only = v.into();
7339 self
7340 }
7341
7342 /// Sets the value of [sync_mode][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_mode].
7343 ///
7344 /// # Example
7345 /// ```ignore,no_run
7346 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7347 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7348 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Online);
7349 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7350 /// ```
7351 pub fn set_sync_mode<
7352 T: std::convert::Into<
7353 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7354 >,
7355 >(
7356 mut self,
7357 v: T,
7358 ) -> Self {
7359 self.sync_mode = v.into();
7360 self
7361 }
7362
7363 /// Sets the value of [verify_replication_only][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::verify_replication_only].
7364 ///
7365 /// # Example
7366 /// ```ignore,no_run
7367 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7368 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_verify_replication_only(true);
7369 /// ```
7370 pub fn set_verify_replication_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7371 self.verify_replication_only = v.into();
7372 self
7373 }
7374
7375 /// Sets the value of [migration_type][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::migration_type].
7376 ///
7377 /// # Example
7378 /// ```ignore,no_run
7379 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7380 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7381 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Logical);
7382 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_migration_type(MigrationType::Physical);
7383 /// ```
7384 pub fn set_migration_type<
7385 T: std::convert::Into<
7386 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7387 >,
7388 >(
7389 mut self,
7390 v: T,
7391 ) -> Self {
7392 self.migration_type = v.into();
7393 self
7394 }
7395
7396 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_parallel_level].
7397 ///
7398 /// # Example
7399 /// ```ignore,no_run
7400 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7401 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7402 /// let x0 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7403 /// let x1 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7404 /// let x2 = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7405 /// ```
7406 pub fn set_sync_parallel_level<
7407 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7408 >(
7409 mut self,
7410 v: T,
7411 ) -> Self {
7412 self.sync_parallel_level = v.into();
7413 self
7414 }
7415
7416 /// Sets the value of [selected_objects][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::selected_objects].
7417 ///
7418 /// # Example
7419 /// ```ignore,no_run
7420 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7421 /// use google_cloud_sql_v1::model::ExternalSyncSelectedObject;
7422 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new()
7423 /// .set_selected_objects([
7424 /// ExternalSyncSelectedObject::default()/* use setters */,
7425 /// ExternalSyncSelectedObject::default()/* use (different) setters */,
7426 /// ]);
7427 /// ```
7428 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
7429 where
7430 T: std::iter::IntoIterator<Item = V>,
7431 V: std::convert::Into<crate::model::ExternalSyncSelectedObject>,
7432 {
7433 use std::iter::Iterator;
7434 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
7435 self
7436 }
7437
7438 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config].
7439 ///
7440 /// Note that all the setters affecting `sync_config` are mutually
7441 /// exclusive.
7442 ///
7443 /// # Example
7444 /// ```ignore,no_run
7445 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7446 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7447 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_sync_config(Some(
7448 /// google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7449 /// ```
7450 pub fn set_sync_config<
7451 T: std::convert::Into<
7452 std::option::Option<
7453 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig,
7454 >,
7455 >,
7456 >(
7457 mut self,
7458 v: T,
7459 ) -> Self {
7460 self.sync_config = v.into();
7461 self
7462 }
7463
7464 /// The value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7465 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7466 /// holds a different branch.
7467 pub fn mysql_sync_config(
7468 &self,
7469 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7470 #[allow(unreachable_patterns)]
7471 self.sync_config.as_ref().and_then(|v| match v {
7472 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7473 _ => std::option::Option::None,
7474 })
7475 }
7476
7477 /// Sets the value of [sync_config][crate::model::SqlInstancesVerifyExternalSyncSettingsRequest::sync_config]
7478 /// to hold a `MysqlSyncConfig`.
7479 ///
7480 /// Note that all the setters affecting `sync_config` are
7481 /// mutually exclusive.
7482 ///
7483 /// # Example
7484 /// ```ignore,no_run
7485 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsRequest;
7486 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7487 /// let x = SqlInstancesVerifyExternalSyncSettingsRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7488 /// assert!(x.mysql_sync_config().is_some());
7489 /// ```
7490 pub fn set_mysql_sync_config<
7491 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7492 >(
7493 mut self,
7494 v: T,
7495 ) -> Self {
7496 self.sync_config = std::option::Option::Some(
7497 crate::model::sql_instances_verify_external_sync_settings_request::SyncConfig::MysqlSyncConfig(
7498 v.into()
7499 )
7500 );
7501 self
7502 }
7503}
7504
7505impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsRequest {
7506 fn typename() -> &'static str {
7507 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest"
7508 }
7509}
7510
7511/// Defines additional types related to [SqlInstancesVerifyExternalSyncSettingsRequest].
7512pub mod sql_instances_verify_external_sync_settings_request {
7513 #[allow(unused_imports)]
7514 use super::*;
7515
7516 ///
7517 /// # Working with unknown values
7518 ///
7519 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7520 /// additional enum variants at any time. Adding new variants is not considered
7521 /// a breaking change. Applications should write their code in anticipation of:
7522 ///
7523 /// - New values appearing in future releases of the client library, **and**
7524 /// - New values received dynamically, without application changes.
7525 ///
7526 /// Please consult the [Working with enums] section in the user guide for some
7527 /// guidelines.
7528 ///
7529 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7530 #[derive(Clone, Debug, PartialEq)]
7531 #[non_exhaustive]
7532 pub enum ExternalSyncMode {
7533 /// Unknown external sync mode, will be defaulted to ONLINE mode
7534 Unspecified,
7535 /// Online external sync will set up replication after initial data external
7536 /// sync
7537 Online,
7538 /// Offline external sync only dumps and loads a one-time snapshot of
7539 /// the primary instance's data
7540 Offline,
7541 /// If set, the enum was initialized with an unknown value.
7542 ///
7543 /// Applications can examine the value using [ExternalSyncMode::value] or
7544 /// [ExternalSyncMode::name].
7545 UnknownValue(external_sync_mode::UnknownValue),
7546 }
7547
7548 #[doc(hidden)]
7549 pub mod external_sync_mode {
7550 #[allow(unused_imports)]
7551 use super::*;
7552 #[derive(Clone, Debug, PartialEq)]
7553 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7554 }
7555
7556 impl ExternalSyncMode {
7557 /// Gets the enum value.
7558 ///
7559 /// Returns `None` if the enum contains an unknown value deserialized from
7560 /// the string representation of enums.
7561 pub fn value(&self) -> std::option::Option<i32> {
7562 match self {
7563 Self::Unspecified => std::option::Option::Some(0),
7564 Self::Online => std::option::Option::Some(1),
7565 Self::Offline => std::option::Option::Some(2),
7566 Self::UnknownValue(u) => u.0.value(),
7567 }
7568 }
7569
7570 /// Gets the enum value as a string.
7571 ///
7572 /// Returns `None` if the enum contains an unknown value deserialized from
7573 /// the integer representation of enums.
7574 pub fn name(&self) -> std::option::Option<&str> {
7575 match self {
7576 Self::Unspecified => std::option::Option::Some("EXTERNAL_SYNC_MODE_UNSPECIFIED"),
7577 Self::Online => std::option::Option::Some("ONLINE"),
7578 Self::Offline => std::option::Option::Some("OFFLINE"),
7579 Self::UnknownValue(u) => u.0.name(),
7580 }
7581 }
7582 }
7583
7584 impl std::default::Default for ExternalSyncMode {
7585 fn default() -> Self {
7586 use std::convert::From;
7587 Self::from(0)
7588 }
7589 }
7590
7591 impl std::fmt::Display for ExternalSyncMode {
7592 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7593 wkt::internal::display_enum(f, self.name(), self.value())
7594 }
7595 }
7596
7597 impl std::convert::From<i32> for ExternalSyncMode {
7598 fn from(value: i32) -> Self {
7599 match value {
7600 0 => Self::Unspecified,
7601 1 => Self::Online,
7602 2 => Self::Offline,
7603 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7604 wkt::internal::UnknownEnumValue::Integer(value),
7605 )),
7606 }
7607 }
7608 }
7609
7610 impl std::convert::From<&str> for ExternalSyncMode {
7611 fn from(value: &str) -> Self {
7612 use std::string::ToString;
7613 match value {
7614 "EXTERNAL_SYNC_MODE_UNSPECIFIED" => Self::Unspecified,
7615 "ONLINE" => Self::Online,
7616 "OFFLINE" => Self::Offline,
7617 _ => Self::UnknownValue(external_sync_mode::UnknownValue(
7618 wkt::internal::UnknownEnumValue::String(value.to_string()),
7619 )),
7620 }
7621 }
7622 }
7623
7624 impl serde::ser::Serialize for ExternalSyncMode {
7625 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7626 where
7627 S: serde::Serializer,
7628 {
7629 match self {
7630 Self::Unspecified => serializer.serialize_i32(0),
7631 Self::Online => serializer.serialize_i32(1),
7632 Self::Offline => serializer.serialize_i32(2),
7633 Self::UnknownValue(u) => u.0.serialize(serializer),
7634 }
7635 }
7636 }
7637
7638 impl<'de> serde::de::Deserialize<'de> for ExternalSyncMode {
7639 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7640 where
7641 D: serde::Deserializer<'de>,
7642 {
7643 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExternalSyncMode>::new(
7644 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode"))
7645 }
7646 }
7647
7648 /// MigrationType determines whether the migration is a physical file-based
7649 /// migration or a logical dump file-based migration.
7650 ///
7651 /// # Working with unknown values
7652 ///
7653 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7654 /// additional enum variants at any time. Adding new variants is not considered
7655 /// a breaking change. Applications should write their code in anticipation of:
7656 ///
7657 /// - New values appearing in future releases of the client library, **and**
7658 /// - New values received dynamically, without application changes.
7659 ///
7660 /// Please consult the [Working with enums] section in the user guide for some
7661 /// guidelines.
7662 ///
7663 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7664 #[derive(Clone, Debug, PartialEq)]
7665 #[non_exhaustive]
7666 pub enum MigrationType {
7667 /// Default value is a logical dump file-based migration
7668 Unspecified,
7669 /// Logical dump file-based migration
7670 Logical,
7671 /// Physical file-based migration
7672 Physical,
7673 /// If set, the enum was initialized with an unknown value.
7674 ///
7675 /// Applications can examine the value using [MigrationType::value] or
7676 /// [MigrationType::name].
7677 UnknownValue(migration_type::UnknownValue),
7678 }
7679
7680 #[doc(hidden)]
7681 pub mod migration_type {
7682 #[allow(unused_imports)]
7683 use super::*;
7684 #[derive(Clone, Debug, PartialEq)]
7685 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7686 }
7687
7688 impl MigrationType {
7689 /// Gets the enum value.
7690 ///
7691 /// Returns `None` if the enum contains an unknown value deserialized from
7692 /// the string representation of enums.
7693 pub fn value(&self) -> std::option::Option<i32> {
7694 match self {
7695 Self::Unspecified => std::option::Option::Some(0),
7696 Self::Logical => std::option::Option::Some(1),
7697 Self::Physical => std::option::Option::Some(2),
7698 Self::UnknownValue(u) => u.0.value(),
7699 }
7700 }
7701
7702 /// Gets the enum value as a string.
7703 ///
7704 /// Returns `None` if the enum contains an unknown value deserialized from
7705 /// the integer representation of enums.
7706 pub fn name(&self) -> std::option::Option<&str> {
7707 match self {
7708 Self::Unspecified => std::option::Option::Some("MIGRATION_TYPE_UNSPECIFIED"),
7709 Self::Logical => std::option::Option::Some("LOGICAL"),
7710 Self::Physical => std::option::Option::Some("PHYSICAL"),
7711 Self::UnknownValue(u) => u.0.name(),
7712 }
7713 }
7714 }
7715
7716 impl std::default::Default for MigrationType {
7717 fn default() -> Self {
7718 use std::convert::From;
7719 Self::from(0)
7720 }
7721 }
7722
7723 impl std::fmt::Display for MigrationType {
7724 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7725 wkt::internal::display_enum(f, self.name(), self.value())
7726 }
7727 }
7728
7729 impl std::convert::From<i32> for MigrationType {
7730 fn from(value: i32) -> Self {
7731 match value {
7732 0 => Self::Unspecified,
7733 1 => Self::Logical,
7734 2 => Self::Physical,
7735 _ => Self::UnknownValue(migration_type::UnknownValue(
7736 wkt::internal::UnknownEnumValue::Integer(value),
7737 )),
7738 }
7739 }
7740 }
7741
7742 impl std::convert::From<&str> for MigrationType {
7743 fn from(value: &str) -> Self {
7744 use std::string::ToString;
7745 match value {
7746 "MIGRATION_TYPE_UNSPECIFIED" => Self::Unspecified,
7747 "LOGICAL" => Self::Logical,
7748 "PHYSICAL" => Self::Physical,
7749 _ => Self::UnknownValue(migration_type::UnknownValue(
7750 wkt::internal::UnknownEnumValue::String(value.to_string()),
7751 )),
7752 }
7753 }
7754 }
7755
7756 impl serde::ser::Serialize for MigrationType {
7757 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7758 where
7759 S: serde::Serializer,
7760 {
7761 match self {
7762 Self::Unspecified => serializer.serialize_i32(0),
7763 Self::Logical => serializer.serialize_i32(1),
7764 Self::Physical => serializer.serialize_i32(2),
7765 Self::UnknownValue(u) => u.0.serialize(serializer),
7766 }
7767 }
7768 }
7769
7770 impl<'de> serde::de::Deserialize<'de> for MigrationType {
7771 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7772 where
7773 D: serde::Deserializer<'de>,
7774 {
7775 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MigrationType>::new(
7776 ".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType",
7777 ))
7778 }
7779 }
7780
7781 #[derive(Clone, Debug, PartialEq)]
7782 #[non_exhaustive]
7783 pub enum SyncConfig {
7784 /// Optional. MySQL-specific settings for start external sync.
7785 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
7786 }
7787}
7788
7789/// Instance start external sync request.
7790#[derive(Clone, Default, PartialEq)]
7791#[non_exhaustive]
7792pub struct SqlInstancesStartExternalSyncRequest {
7793 /// Cloud SQL instance ID. This does not include the project ID.
7794 pub instance: std::string::String,
7795
7796 /// ID of the project that contains the instance.
7797 pub project: std::string::String,
7798
7799 /// External sync mode.
7800 pub sync_mode:
7801 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7802
7803 /// Whether to skip the verification step (VESS).
7804 pub skip_verification: bool,
7805
7806 /// Optional. Parallel level for initial data sync. Currently only applicable
7807 /// for MySQL.
7808 pub sync_parallel_level: crate::model::ExternalSyncParallelLevel,
7809
7810 /// Optional. MigrationType configures the migration to use physical files or
7811 /// logical dump files. If not set, then the logical dump file configuration is
7812 /// used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
7813 pub migration_type:
7814 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7815
7816 /// Optional. MySQL only. True if end-user has confirmed that this SES call
7817 /// will wipe replica databases overlapping with the proposed selected_objects.
7818 /// If this field is not set and there are both overlapping and additional
7819 /// databases proposed, an error will be returned.
7820 pub replica_overwrite_enabled: bool,
7821
7822 pub sync_config:
7823 std::option::Option<crate::model::sql_instances_start_external_sync_request::SyncConfig>,
7824
7825 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7826}
7827
7828impl SqlInstancesStartExternalSyncRequest {
7829 pub fn new() -> Self {
7830 std::default::Default::default()
7831 }
7832
7833 /// Sets the value of [instance][crate::model::SqlInstancesStartExternalSyncRequest::instance].
7834 ///
7835 /// # Example
7836 /// ```ignore,no_run
7837 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7838 /// let x = SqlInstancesStartExternalSyncRequest::new().set_instance("example");
7839 /// ```
7840 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7841 self.instance = v.into();
7842 self
7843 }
7844
7845 /// Sets the value of [project][crate::model::SqlInstancesStartExternalSyncRequest::project].
7846 ///
7847 /// # Example
7848 /// ```ignore,no_run
7849 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7850 /// let x = SqlInstancesStartExternalSyncRequest::new().set_project("example");
7851 /// ```
7852 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7853 self.project = v.into();
7854 self
7855 }
7856
7857 /// Sets the value of [sync_mode][crate::model::SqlInstancesStartExternalSyncRequest::sync_mode].
7858 ///
7859 /// # Example
7860 /// ```ignore,no_run
7861 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7862 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode;
7863 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Online);
7864 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_mode(ExternalSyncMode::Offline);
7865 /// ```
7866 pub fn set_sync_mode<
7867 T: std::convert::Into<
7868 crate::model::sql_instances_verify_external_sync_settings_request::ExternalSyncMode,
7869 >,
7870 >(
7871 mut self,
7872 v: T,
7873 ) -> Self {
7874 self.sync_mode = v.into();
7875 self
7876 }
7877
7878 /// Sets the value of [skip_verification][crate::model::SqlInstancesStartExternalSyncRequest::skip_verification].
7879 ///
7880 /// # Example
7881 /// ```ignore,no_run
7882 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7883 /// let x = SqlInstancesStartExternalSyncRequest::new().set_skip_verification(true);
7884 /// ```
7885 pub fn set_skip_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7886 self.skip_verification = v.into();
7887 self
7888 }
7889
7890 /// Sets the value of [sync_parallel_level][crate::model::SqlInstancesStartExternalSyncRequest::sync_parallel_level].
7891 ///
7892 /// # Example
7893 /// ```ignore,no_run
7894 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7895 /// use google_cloud_sql_v1::model::ExternalSyncParallelLevel;
7896 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Min);
7897 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Optimal);
7898 /// let x2 = SqlInstancesStartExternalSyncRequest::new().set_sync_parallel_level(ExternalSyncParallelLevel::Max);
7899 /// ```
7900 pub fn set_sync_parallel_level<
7901 T: std::convert::Into<crate::model::ExternalSyncParallelLevel>,
7902 >(
7903 mut self,
7904 v: T,
7905 ) -> Self {
7906 self.sync_parallel_level = v.into();
7907 self
7908 }
7909
7910 /// Sets the value of [migration_type][crate::model::SqlInstancesStartExternalSyncRequest::migration_type].
7911 ///
7912 /// # Example
7913 /// ```ignore,no_run
7914 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7915 /// use google_cloud_sql_v1::model::sql_instances_verify_external_sync_settings_request::MigrationType;
7916 /// let x0 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Logical);
7917 /// let x1 = SqlInstancesStartExternalSyncRequest::new().set_migration_type(MigrationType::Physical);
7918 /// ```
7919 pub fn set_migration_type<
7920 T: std::convert::Into<
7921 crate::model::sql_instances_verify_external_sync_settings_request::MigrationType,
7922 >,
7923 >(
7924 mut self,
7925 v: T,
7926 ) -> Self {
7927 self.migration_type = v.into();
7928 self
7929 }
7930
7931 /// Sets the value of [replica_overwrite_enabled][crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled].
7932 ///
7933 /// # Example
7934 /// ```ignore,no_run
7935 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7936 /// let x = SqlInstancesStartExternalSyncRequest::new().set_replica_overwrite_enabled(true);
7937 /// ```
7938 pub fn set_replica_overwrite_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
7939 self.replica_overwrite_enabled = v.into();
7940 self
7941 }
7942
7943 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config].
7944 ///
7945 /// Note that all the setters affecting `sync_config` are mutually
7946 /// exclusive.
7947 ///
7948 /// # Example
7949 /// ```ignore,no_run
7950 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7951 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7952 /// let x = SqlInstancesStartExternalSyncRequest::new().set_sync_config(Some(
7953 /// google_cloud_sql_v1::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(MySqlSyncConfig::default().into())));
7954 /// ```
7955 pub fn set_sync_config<
7956 T: std::convert::Into<
7957 std::option::Option<
7958 crate::model::sql_instances_start_external_sync_request::SyncConfig,
7959 >,
7960 >,
7961 >(
7962 mut self,
7963 v: T,
7964 ) -> Self {
7965 self.sync_config = v.into();
7966 self
7967 }
7968
7969 /// The value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
7970 /// if it holds a `MysqlSyncConfig`, `None` if the field is not set or
7971 /// holds a different branch.
7972 pub fn mysql_sync_config(
7973 &self,
7974 ) -> std::option::Option<&std::boxed::Box<crate::model::MySqlSyncConfig>> {
7975 #[allow(unreachable_patterns)]
7976 self.sync_config.as_ref().and_then(|v| match v {
7977 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(v) => std::option::Option::Some(v),
7978 _ => std::option::Option::None,
7979 })
7980 }
7981
7982 /// Sets the value of [sync_config][crate::model::SqlInstancesStartExternalSyncRequest::sync_config]
7983 /// to hold a `MysqlSyncConfig`.
7984 ///
7985 /// Note that all the setters affecting `sync_config` are
7986 /// mutually exclusive.
7987 ///
7988 /// # Example
7989 /// ```ignore,no_run
7990 /// # use google_cloud_sql_v1::model::SqlInstancesStartExternalSyncRequest;
7991 /// use google_cloud_sql_v1::model::MySqlSyncConfig;
7992 /// let x = SqlInstancesStartExternalSyncRequest::new().set_mysql_sync_config(MySqlSyncConfig::default()/* use setters */);
7993 /// assert!(x.mysql_sync_config().is_some());
7994 /// ```
7995 pub fn set_mysql_sync_config<
7996 T: std::convert::Into<std::boxed::Box<crate::model::MySqlSyncConfig>>,
7997 >(
7998 mut self,
7999 v: T,
8000 ) -> Self {
8001 self.sync_config = std::option::Option::Some(
8002 crate::model::sql_instances_start_external_sync_request::SyncConfig::MysqlSyncConfig(
8003 v.into(),
8004 ),
8005 );
8006 self
8007 }
8008}
8009
8010impl wkt::message::Message for SqlInstancesStartExternalSyncRequest {
8011 fn typename() -> &'static str {
8012 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest"
8013 }
8014}
8015
8016/// Defines additional types related to [SqlInstancesStartExternalSyncRequest].
8017pub mod sql_instances_start_external_sync_request {
8018 #[allow(unused_imports)]
8019 use super::*;
8020
8021 #[derive(Clone, Debug, PartialEq)]
8022 #[non_exhaustive]
8023 pub enum SyncConfig {
8024 /// MySQL-specific settings for start external sync.
8025 MysqlSyncConfig(std::boxed::Box<crate::model::MySqlSyncConfig>),
8026 }
8027}
8028
8029/// Instance reset replica size request.
8030#[derive(Clone, Default, PartialEq)]
8031#[non_exhaustive]
8032pub struct SqlInstancesResetReplicaSizeRequest {
8033 /// Cloud SQL read replica instance name.
8034 pub instance: std::string::String,
8035
8036 /// ID of the project that contains the read replica.
8037 pub project: std::string::String,
8038
8039 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8040}
8041
8042impl SqlInstancesResetReplicaSizeRequest {
8043 pub fn new() -> Self {
8044 std::default::Default::default()
8045 }
8046
8047 /// Sets the value of [instance][crate::model::SqlInstancesResetReplicaSizeRequest::instance].
8048 ///
8049 /// # Example
8050 /// ```ignore,no_run
8051 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8052 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_instance("example");
8053 /// ```
8054 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8055 self.instance = v.into();
8056 self
8057 }
8058
8059 /// Sets the value of [project][crate::model::SqlInstancesResetReplicaSizeRequest::project].
8060 ///
8061 /// # Example
8062 /// ```ignore,no_run
8063 /// # use google_cloud_sql_v1::model::SqlInstancesResetReplicaSizeRequest;
8064 /// let x = SqlInstancesResetReplicaSizeRequest::new().set_project("example");
8065 /// ```
8066 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8067 self.project = v.into();
8068 self
8069 }
8070}
8071
8072impl wkt::message::Message for SqlInstancesResetReplicaSizeRequest {
8073 fn typename() -> &'static str {
8074 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest"
8075 }
8076}
8077
8078/// Instance create ephemeral certificate request.
8079#[derive(Clone, Default, PartialEq)]
8080#[non_exhaustive]
8081pub struct SqlInstancesCreateEphemeralCertRequest {
8082 /// Cloud SQL instance ID. This does not include the project ID.
8083 pub instance: std::string::String,
8084
8085 /// Project ID of the Cloud SQL project.
8086 pub project: std::string::String,
8087
8088 pub body: std::option::Option<crate::model::SslCertsCreateEphemeralRequest>,
8089
8090 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8091}
8092
8093impl SqlInstancesCreateEphemeralCertRequest {
8094 pub fn new() -> Self {
8095 std::default::Default::default()
8096 }
8097
8098 /// Sets the value of [instance][crate::model::SqlInstancesCreateEphemeralCertRequest::instance].
8099 ///
8100 /// # Example
8101 /// ```ignore,no_run
8102 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8103 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_instance("example");
8104 /// ```
8105 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8106 self.instance = v.into();
8107 self
8108 }
8109
8110 /// Sets the value of [project][crate::model::SqlInstancesCreateEphemeralCertRequest::project].
8111 ///
8112 /// # Example
8113 /// ```ignore,no_run
8114 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8115 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_project("example");
8116 /// ```
8117 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8118 self.project = v.into();
8119 self
8120 }
8121
8122 /// Sets the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8123 ///
8124 /// # Example
8125 /// ```ignore,no_run
8126 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8127 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8128 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_body(SslCertsCreateEphemeralRequest::default()/* use setters */);
8129 /// ```
8130 pub fn set_body<T>(mut self, v: T) -> Self
8131 where
8132 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8133 {
8134 self.body = std::option::Option::Some(v.into());
8135 self
8136 }
8137
8138 /// Sets or clears the value of [body][crate::model::SqlInstancesCreateEphemeralCertRequest::body].
8139 ///
8140 /// # Example
8141 /// ```ignore,no_run
8142 /// # use google_cloud_sql_v1::model::SqlInstancesCreateEphemeralCertRequest;
8143 /// use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8144 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(Some(SslCertsCreateEphemeralRequest::default()/* use setters */));
8145 /// let x = SqlInstancesCreateEphemeralCertRequest::new().set_or_clear_body(None::<SslCertsCreateEphemeralRequest>);
8146 /// ```
8147 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
8148 where
8149 T: std::convert::Into<crate::model::SslCertsCreateEphemeralRequest>,
8150 {
8151 self.body = v.map(|x| x.into());
8152 self
8153 }
8154}
8155
8156impl wkt::message::Message for SqlInstancesCreateEphemeralCertRequest {
8157 fn typename() -> &'static str {
8158 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest"
8159 }
8160}
8161
8162/// Database instance clone request.
8163#[derive(Clone, Default, PartialEq)]
8164#[non_exhaustive]
8165pub struct InstancesCloneRequest {
8166 /// Required. Contains details about the clone operation.
8167 pub clone_context: std::option::Option<crate::model::CloneContext>,
8168
8169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8170}
8171
8172impl InstancesCloneRequest {
8173 pub fn new() -> Self {
8174 std::default::Default::default()
8175 }
8176
8177 /// Sets the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8178 ///
8179 /// # Example
8180 /// ```ignore,no_run
8181 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8182 /// use google_cloud_sql_v1::model::CloneContext;
8183 /// let x = InstancesCloneRequest::new().set_clone_context(CloneContext::default()/* use setters */);
8184 /// ```
8185 pub fn set_clone_context<T>(mut self, v: T) -> Self
8186 where
8187 T: std::convert::Into<crate::model::CloneContext>,
8188 {
8189 self.clone_context = std::option::Option::Some(v.into());
8190 self
8191 }
8192
8193 /// Sets or clears the value of [clone_context][crate::model::InstancesCloneRequest::clone_context].
8194 ///
8195 /// # Example
8196 /// ```ignore,no_run
8197 /// # use google_cloud_sql_v1::model::InstancesCloneRequest;
8198 /// use google_cloud_sql_v1::model::CloneContext;
8199 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(Some(CloneContext::default()/* use setters */));
8200 /// let x = InstancesCloneRequest::new().set_or_clear_clone_context(None::<CloneContext>);
8201 /// ```
8202 pub fn set_or_clear_clone_context<T>(mut self, v: std::option::Option<T>) -> Self
8203 where
8204 T: std::convert::Into<crate::model::CloneContext>,
8205 {
8206 self.clone_context = v.map(|x| x.into());
8207 self
8208 }
8209}
8210
8211impl wkt::message::Message for InstancesCloneRequest {
8212 fn typename() -> &'static str {
8213 "type.googleapis.com/google.cloud.sql.v1.InstancesCloneRequest"
8214 }
8215}
8216
8217/// Database demote primary instance request.
8218#[derive(Clone, Default, PartialEq)]
8219#[non_exhaustive]
8220pub struct InstancesDemoteMasterRequest {
8221 /// Contains details about the demoteMaster operation.
8222 pub demote_master_context: std::option::Option<crate::model::DemoteMasterContext>,
8223
8224 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8225}
8226
8227impl InstancesDemoteMasterRequest {
8228 pub fn new() -> Self {
8229 std::default::Default::default()
8230 }
8231
8232 /// Sets the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8233 ///
8234 /// # Example
8235 /// ```ignore,no_run
8236 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8237 /// use google_cloud_sql_v1::model::DemoteMasterContext;
8238 /// let x = InstancesDemoteMasterRequest::new().set_demote_master_context(DemoteMasterContext::default()/* use setters */);
8239 /// ```
8240 pub fn set_demote_master_context<T>(mut self, v: T) -> Self
8241 where
8242 T: std::convert::Into<crate::model::DemoteMasterContext>,
8243 {
8244 self.demote_master_context = std::option::Option::Some(v.into());
8245 self
8246 }
8247
8248 /// Sets or clears the value of [demote_master_context][crate::model::InstancesDemoteMasterRequest::demote_master_context].
8249 ///
8250 /// # Example
8251 /// ```ignore,no_run
8252 /// # use google_cloud_sql_v1::model::InstancesDemoteMasterRequest;
8253 /// use google_cloud_sql_v1::model::DemoteMasterContext;
8254 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(Some(DemoteMasterContext::default()/* use setters */));
8255 /// let x = InstancesDemoteMasterRequest::new().set_or_clear_demote_master_context(None::<DemoteMasterContext>);
8256 /// ```
8257 pub fn set_or_clear_demote_master_context<T>(mut self, v: std::option::Option<T>) -> Self
8258 where
8259 T: std::convert::Into<crate::model::DemoteMasterContext>,
8260 {
8261 self.demote_master_context = v.map(|x| x.into());
8262 self
8263 }
8264}
8265
8266impl wkt::message::Message for InstancesDemoteMasterRequest {
8267 fn typename() -> &'static str {
8268 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteMasterRequest"
8269 }
8270}
8271
8272/// This request is used to demote an existing standalone instance to be a
8273/// Cloud SQL read replica for an external database server.
8274#[derive(Clone, Default, PartialEq)]
8275#[non_exhaustive]
8276pub struct InstancesDemoteRequest {
8277 /// Required. Contains details about the demote operation.
8278 pub demote_context: std::option::Option<crate::model::DemoteContext>,
8279
8280 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8281}
8282
8283impl InstancesDemoteRequest {
8284 pub fn new() -> Self {
8285 std::default::Default::default()
8286 }
8287
8288 /// Sets the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8289 ///
8290 /// # Example
8291 /// ```ignore,no_run
8292 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8293 /// use google_cloud_sql_v1::model::DemoteContext;
8294 /// let x = InstancesDemoteRequest::new().set_demote_context(DemoteContext::default()/* use setters */);
8295 /// ```
8296 pub fn set_demote_context<T>(mut self, v: T) -> Self
8297 where
8298 T: std::convert::Into<crate::model::DemoteContext>,
8299 {
8300 self.demote_context = std::option::Option::Some(v.into());
8301 self
8302 }
8303
8304 /// Sets or clears the value of [demote_context][crate::model::InstancesDemoteRequest::demote_context].
8305 ///
8306 /// # Example
8307 /// ```ignore,no_run
8308 /// # use google_cloud_sql_v1::model::InstancesDemoteRequest;
8309 /// use google_cloud_sql_v1::model::DemoteContext;
8310 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(Some(DemoteContext::default()/* use setters */));
8311 /// let x = InstancesDemoteRequest::new().set_or_clear_demote_context(None::<DemoteContext>);
8312 /// ```
8313 pub fn set_or_clear_demote_context<T>(mut self, v: std::option::Option<T>) -> Self
8314 where
8315 T: std::convert::Into<crate::model::DemoteContext>,
8316 {
8317 self.demote_context = v.map(|x| x.into());
8318 self
8319 }
8320}
8321
8322impl wkt::message::Message for InstancesDemoteRequest {
8323 fn typename() -> &'static str {
8324 "type.googleapis.com/google.cloud.sql.v1.InstancesDemoteRequest"
8325 }
8326}
8327
8328/// Database instance export request.
8329#[derive(Clone, Default, PartialEq)]
8330#[non_exhaustive]
8331pub struct InstancesExportRequest {
8332 /// Contains details about the export operation.
8333 pub export_context: std::option::Option<crate::model::ExportContext>,
8334
8335 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8336}
8337
8338impl InstancesExportRequest {
8339 pub fn new() -> Self {
8340 std::default::Default::default()
8341 }
8342
8343 /// Sets the value of [export_context][crate::model::InstancesExportRequest::export_context].
8344 ///
8345 /// # Example
8346 /// ```ignore,no_run
8347 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8348 /// use google_cloud_sql_v1::model::ExportContext;
8349 /// let x = InstancesExportRequest::new().set_export_context(ExportContext::default()/* use setters */);
8350 /// ```
8351 pub fn set_export_context<T>(mut self, v: T) -> Self
8352 where
8353 T: std::convert::Into<crate::model::ExportContext>,
8354 {
8355 self.export_context = std::option::Option::Some(v.into());
8356 self
8357 }
8358
8359 /// Sets or clears the value of [export_context][crate::model::InstancesExportRequest::export_context].
8360 ///
8361 /// # Example
8362 /// ```ignore,no_run
8363 /// # use google_cloud_sql_v1::model::InstancesExportRequest;
8364 /// use google_cloud_sql_v1::model::ExportContext;
8365 /// let x = InstancesExportRequest::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
8366 /// let x = InstancesExportRequest::new().set_or_clear_export_context(None::<ExportContext>);
8367 /// ```
8368 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
8369 where
8370 T: std::convert::Into<crate::model::ExportContext>,
8371 {
8372 self.export_context = v.map(|x| x.into());
8373 self
8374 }
8375}
8376
8377impl wkt::message::Message for InstancesExportRequest {
8378 fn typename() -> &'static str {
8379 "type.googleapis.com/google.cloud.sql.v1.InstancesExportRequest"
8380 }
8381}
8382
8383/// Instance failover request.
8384#[derive(Clone, Default, PartialEq)]
8385#[non_exhaustive]
8386pub struct InstancesFailoverRequest {
8387 /// Failover Context.
8388 pub failover_context: std::option::Option<crate::model::FailoverContext>,
8389
8390 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8391}
8392
8393impl InstancesFailoverRequest {
8394 pub fn new() -> Self {
8395 std::default::Default::default()
8396 }
8397
8398 /// Sets the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8399 ///
8400 /// # Example
8401 /// ```ignore,no_run
8402 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8403 /// use google_cloud_sql_v1::model::FailoverContext;
8404 /// let x = InstancesFailoverRequest::new().set_failover_context(FailoverContext::default()/* use setters */);
8405 /// ```
8406 pub fn set_failover_context<T>(mut self, v: T) -> Self
8407 where
8408 T: std::convert::Into<crate::model::FailoverContext>,
8409 {
8410 self.failover_context = std::option::Option::Some(v.into());
8411 self
8412 }
8413
8414 /// Sets or clears the value of [failover_context][crate::model::InstancesFailoverRequest::failover_context].
8415 ///
8416 /// # Example
8417 /// ```ignore,no_run
8418 /// # use google_cloud_sql_v1::model::InstancesFailoverRequest;
8419 /// use google_cloud_sql_v1::model::FailoverContext;
8420 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(Some(FailoverContext::default()/* use setters */));
8421 /// let x = InstancesFailoverRequest::new().set_or_clear_failover_context(None::<FailoverContext>);
8422 /// ```
8423 pub fn set_or_clear_failover_context<T>(mut self, v: std::option::Option<T>) -> Self
8424 where
8425 T: std::convert::Into<crate::model::FailoverContext>,
8426 {
8427 self.failover_context = v.map(|x| x.into());
8428 self
8429 }
8430}
8431
8432impl wkt::message::Message for InstancesFailoverRequest {
8433 fn typename() -> &'static str {
8434 "type.googleapis.com/google.cloud.sql.v1.InstancesFailoverRequest"
8435 }
8436}
8437
8438/// SslCerts create ephemeral certificate request.
8439#[derive(Clone, Default, PartialEq)]
8440#[non_exhaustive]
8441pub struct SslCertsCreateEphemeralRequest {
8442 /// PEM encoded public key to include in the signed certificate.
8443 pub public_key: std::string::String,
8444
8445 /// Access token to include in the signed certificate.
8446 pub access_token: std::string::String,
8447
8448 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8449}
8450
8451impl SslCertsCreateEphemeralRequest {
8452 pub fn new() -> Self {
8453 std::default::Default::default()
8454 }
8455
8456 /// Sets the value of [public_key][crate::model::SslCertsCreateEphemeralRequest::public_key].
8457 ///
8458 /// # Example
8459 /// ```ignore,no_run
8460 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8461 /// let x = SslCertsCreateEphemeralRequest::new().set_public_key("example");
8462 /// ```
8463 pub fn set_public_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8464 self.public_key = v.into();
8465 self
8466 }
8467
8468 /// Sets the value of [access_token][crate::model::SslCertsCreateEphemeralRequest::access_token].
8469 ///
8470 /// # Example
8471 /// ```ignore,no_run
8472 /// # use google_cloud_sql_v1::model::SslCertsCreateEphemeralRequest;
8473 /// let x = SslCertsCreateEphemeralRequest::new().set_access_token("example");
8474 /// ```
8475 pub fn set_access_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8476 self.access_token = v.into();
8477 self
8478 }
8479}
8480
8481impl wkt::message::Message for SslCertsCreateEphemeralRequest {
8482 fn typename() -> &'static str {
8483 "type.googleapis.com/google.cloud.sql.v1.SslCertsCreateEphemeralRequest"
8484 }
8485}
8486
8487/// Database instance import request.
8488#[derive(Clone, Default, PartialEq)]
8489#[non_exhaustive]
8490pub struct InstancesImportRequest {
8491 /// Contains details about the import operation.
8492 pub import_context: std::option::Option<crate::model::ImportContext>,
8493
8494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8495}
8496
8497impl InstancesImportRequest {
8498 pub fn new() -> Self {
8499 std::default::Default::default()
8500 }
8501
8502 /// Sets the value of [import_context][crate::model::InstancesImportRequest::import_context].
8503 ///
8504 /// # Example
8505 /// ```ignore,no_run
8506 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8507 /// use google_cloud_sql_v1::model::ImportContext;
8508 /// let x = InstancesImportRequest::new().set_import_context(ImportContext::default()/* use setters */);
8509 /// ```
8510 pub fn set_import_context<T>(mut self, v: T) -> Self
8511 where
8512 T: std::convert::Into<crate::model::ImportContext>,
8513 {
8514 self.import_context = std::option::Option::Some(v.into());
8515 self
8516 }
8517
8518 /// Sets or clears the value of [import_context][crate::model::InstancesImportRequest::import_context].
8519 ///
8520 /// # Example
8521 /// ```ignore,no_run
8522 /// # use google_cloud_sql_v1::model::InstancesImportRequest;
8523 /// use google_cloud_sql_v1::model::ImportContext;
8524 /// let x = InstancesImportRequest::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
8525 /// let x = InstancesImportRequest::new().set_or_clear_import_context(None::<ImportContext>);
8526 /// ```
8527 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
8528 where
8529 T: std::convert::Into<crate::model::ImportContext>,
8530 {
8531 self.import_context = v.map(|x| x.into());
8532 self
8533 }
8534}
8535
8536impl wkt::message::Message for InstancesImportRequest {
8537 fn typename() -> &'static str {
8538 "type.googleapis.com/google.cloud.sql.v1.InstancesImportRequest"
8539 }
8540}
8541
8542/// Request for Pre-checks for MVU
8543#[derive(Clone, Default, PartialEq)]
8544#[non_exhaustive]
8545pub struct InstancesPreCheckMajorVersionUpgradeRequest {
8546 /// Required. Contains details about the pre-check major version upgrade
8547 /// operation.
8548 pub pre_check_major_version_upgrade_context:
8549 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
8550
8551 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8552}
8553
8554impl InstancesPreCheckMajorVersionUpgradeRequest {
8555 pub fn new() -> Self {
8556 std::default::Default::default()
8557 }
8558
8559 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8560 ///
8561 /// # Example
8562 /// ```ignore,no_run
8563 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8564 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8565 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
8566 /// ```
8567 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
8568 where
8569 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8570 {
8571 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
8572 self
8573 }
8574
8575 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::InstancesPreCheckMajorVersionUpgradeRequest::pre_check_major_version_upgrade_context].
8576 ///
8577 /// # Example
8578 /// ```ignore,no_run
8579 /// # use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
8580 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
8581 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
8582 /// let x = InstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
8583 /// ```
8584 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
8585 mut self,
8586 v: std::option::Option<T>,
8587 ) -> Self
8588 where
8589 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
8590 {
8591 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
8592 self
8593 }
8594}
8595
8596impl wkt::message::Message for InstancesPreCheckMajorVersionUpgradeRequest {
8597 fn typename() -> &'static str {
8598 "type.googleapis.com/google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest"
8599 }
8600}
8601
8602/// Database instances list response.
8603#[derive(Clone, Default, PartialEq)]
8604#[non_exhaustive]
8605pub struct InstancesListResponse {
8606 /// This is always `sql#instancesList`.
8607 pub kind: std::string::String,
8608
8609 /// List of warnings that occurred while handling the request.
8610 pub warnings: std::vec::Vec<crate::model::ApiWarning>,
8611
8612 /// List of database instance resources.
8613 pub items: std::vec::Vec<crate::model::DatabaseInstance>,
8614
8615 /// The continuation token, used to page through large result sets. Provide
8616 /// this value in a subsequent request to return the next page of results.
8617 pub next_page_token: std::string::String,
8618
8619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8620}
8621
8622impl InstancesListResponse {
8623 pub fn new() -> Self {
8624 std::default::Default::default()
8625 }
8626
8627 /// Sets the value of [kind][crate::model::InstancesListResponse::kind].
8628 ///
8629 /// # Example
8630 /// ```ignore,no_run
8631 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8632 /// let x = InstancesListResponse::new().set_kind("example");
8633 /// ```
8634 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8635 self.kind = v.into();
8636 self
8637 }
8638
8639 /// Sets the value of [warnings][crate::model::InstancesListResponse::warnings].
8640 ///
8641 /// # Example
8642 /// ```ignore,no_run
8643 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8644 /// use google_cloud_sql_v1::model::ApiWarning;
8645 /// let x = InstancesListResponse::new()
8646 /// .set_warnings([
8647 /// ApiWarning::default()/* use setters */,
8648 /// ApiWarning::default()/* use (different) setters */,
8649 /// ]);
8650 /// ```
8651 pub fn set_warnings<T, V>(mut self, v: T) -> Self
8652 where
8653 T: std::iter::IntoIterator<Item = V>,
8654 V: std::convert::Into<crate::model::ApiWarning>,
8655 {
8656 use std::iter::Iterator;
8657 self.warnings = v.into_iter().map(|i| i.into()).collect();
8658 self
8659 }
8660
8661 /// Sets the value of [items][crate::model::InstancesListResponse::items].
8662 ///
8663 /// # Example
8664 /// ```ignore,no_run
8665 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8666 /// use google_cloud_sql_v1::model::DatabaseInstance;
8667 /// let x = InstancesListResponse::new()
8668 /// .set_items([
8669 /// DatabaseInstance::default()/* use setters */,
8670 /// DatabaseInstance::default()/* use (different) setters */,
8671 /// ]);
8672 /// ```
8673 pub fn set_items<T, V>(mut self, v: T) -> Self
8674 where
8675 T: std::iter::IntoIterator<Item = V>,
8676 V: std::convert::Into<crate::model::DatabaseInstance>,
8677 {
8678 use std::iter::Iterator;
8679 self.items = v.into_iter().map(|i| i.into()).collect();
8680 self
8681 }
8682
8683 /// Sets the value of [next_page_token][crate::model::InstancesListResponse::next_page_token].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_sql_v1::model::InstancesListResponse;
8688 /// let x = InstancesListResponse::new().set_next_page_token("example");
8689 /// ```
8690 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8691 self.next_page_token = v.into();
8692 self
8693 }
8694}
8695
8696impl wkt::message::Message for InstancesListResponse {
8697 fn typename() -> &'static str {
8698 "type.googleapis.com/google.cloud.sql.v1.InstancesListResponse"
8699 }
8700}
8701
8702#[doc(hidden)]
8703impl google_cloud_gax::paginator::internal::PageableResponse for InstancesListResponse {
8704 type PageItem = crate::model::DatabaseInstance;
8705
8706 fn items(self) -> std::vec::Vec<Self::PageItem> {
8707 self.items
8708 }
8709
8710 fn next_page_token(&self) -> std::string::String {
8711 use std::clone::Clone;
8712 self.next_page_token.clone()
8713 }
8714}
8715
8716/// Instances ListServerCas response.
8717#[derive(Clone, Default, PartialEq)]
8718#[non_exhaustive]
8719pub struct InstancesListServerCasResponse {
8720 /// List of server CA certificates for the instance.
8721 pub certs: std::vec::Vec<crate::model::SslCert>,
8722
8723 pub active_version: std::string::String,
8724
8725 /// This is always `sql#instancesListServerCas`.
8726 pub kind: std::string::String,
8727
8728 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8729}
8730
8731impl InstancesListServerCasResponse {
8732 pub fn new() -> Self {
8733 std::default::Default::default()
8734 }
8735
8736 /// Sets the value of [certs][crate::model::InstancesListServerCasResponse::certs].
8737 ///
8738 /// # Example
8739 /// ```ignore,no_run
8740 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8741 /// use google_cloud_sql_v1::model::SslCert;
8742 /// let x = InstancesListServerCasResponse::new()
8743 /// .set_certs([
8744 /// SslCert::default()/* use setters */,
8745 /// SslCert::default()/* use (different) setters */,
8746 /// ]);
8747 /// ```
8748 pub fn set_certs<T, V>(mut self, v: T) -> Self
8749 where
8750 T: std::iter::IntoIterator<Item = V>,
8751 V: std::convert::Into<crate::model::SslCert>,
8752 {
8753 use std::iter::Iterator;
8754 self.certs = v.into_iter().map(|i| i.into()).collect();
8755 self
8756 }
8757
8758 /// Sets the value of [active_version][crate::model::InstancesListServerCasResponse::active_version].
8759 ///
8760 /// # Example
8761 /// ```ignore,no_run
8762 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8763 /// let x = InstancesListServerCasResponse::new().set_active_version("example");
8764 /// ```
8765 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8766 self.active_version = v.into();
8767 self
8768 }
8769
8770 /// Sets the value of [kind][crate::model::InstancesListServerCasResponse::kind].
8771 ///
8772 /// # Example
8773 /// ```ignore,no_run
8774 /// # use google_cloud_sql_v1::model::InstancesListServerCasResponse;
8775 /// let x = InstancesListServerCasResponse::new().set_kind("example");
8776 /// ```
8777 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8778 self.kind = v.into();
8779 self
8780 }
8781}
8782
8783impl wkt::message::Message for InstancesListServerCasResponse {
8784 fn typename() -> &'static str {
8785 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCasResponse"
8786 }
8787}
8788
8789/// Instances ListServerCertificates response.
8790#[derive(Clone, Default, PartialEq)]
8791#[non_exhaustive]
8792pub struct InstancesListServerCertificatesResponse {
8793 /// List of server CA certificates for the instance.
8794 pub ca_certs: std::vec::Vec<crate::model::SslCert>,
8795
8796 /// List of server certificates for the instance, signed by the corresponding
8797 /// CA from the `ca_certs` list.
8798 pub server_certs: std::vec::Vec<crate::model::SslCert>,
8799
8800 /// The `sha1_fingerprint` of the active certificate from `server_certs`.
8801 pub active_version: std::string::String,
8802
8803 /// This is always `sql#instancesListServerCertificates`.
8804 pub kind: std::string::String,
8805
8806 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8807}
8808
8809impl InstancesListServerCertificatesResponse {
8810 pub fn new() -> Self {
8811 std::default::Default::default()
8812 }
8813
8814 /// Sets the value of [ca_certs][crate::model::InstancesListServerCertificatesResponse::ca_certs].
8815 ///
8816 /// # Example
8817 /// ```ignore,no_run
8818 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8819 /// use google_cloud_sql_v1::model::SslCert;
8820 /// let x = InstancesListServerCertificatesResponse::new()
8821 /// .set_ca_certs([
8822 /// SslCert::default()/* use setters */,
8823 /// SslCert::default()/* use (different) setters */,
8824 /// ]);
8825 /// ```
8826 pub fn set_ca_certs<T, V>(mut self, v: T) -> Self
8827 where
8828 T: std::iter::IntoIterator<Item = V>,
8829 V: std::convert::Into<crate::model::SslCert>,
8830 {
8831 use std::iter::Iterator;
8832 self.ca_certs = v.into_iter().map(|i| i.into()).collect();
8833 self
8834 }
8835
8836 /// Sets the value of [server_certs][crate::model::InstancesListServerCertificatesResponse::server_certs].
8837 ///
8838 /// # Example
8839 /// ```ignore,no_run
8840 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8841 /// use google_cloud_sql_v1::model::SslCert;
8842 /// let x = InstancesListServerCertificatesResponse::new()
8843 /// .set_server_certs([
8844 /// SslCert::default()/* use setters */,
8845 /// SslCert::default()/* use (different) setters */,
8846 /// ]);
8847 /// ```
8848 pub fn set_server_certs<T, V>(mut self, v: T) -> Self
8849 where
8850 T: std::iter::IntoIterator<Item = V>,
8851 V: std::convert::Into<crate::model::SslCert>,
8852 {
8853 use std::iter::Iterator;
8854 self.server_certs = v.into_iter().map(|i| i.into()).collect();
8855 self
8856 }
8857
8858 /// Sets the value of [active_version][crate::model::InstancesListServerCertificatesResponse::active_version].
8859 ///
8860 /// # Example
8861 /// ```ignore,no_run
8862 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8863 /// let x = InstancesListServerCertificatesResponse::new().set_active_version("example");
8864 /// ```
8865 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8866 self.active_version = v.into();
8867 self
8868 }
8869
8870 /// Sets the value of [kind][crate::model::InstancesListServerCertificatesResponse::kind].
8871 ///
8872 /// # Example
8873 /// ```ignore,no_run
8874 /// # use google_cloud_sql_v1::model::InstancesListServerCertificatesResponse;
8875 /// let x = InstancesListServerCertificatesResponse::new().set_kind("example");
8876 /// ```
8877 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8878 self.kind = v.into();
8879 self
8880 }
8881}
8882
8883impl wkt::message::Message for InstancesListServerCertificatesResponse {
8884 fn typename() -> &'static str {
8885 "type.googleapis.com/google.cloud.sql.v1.InstancesListServerCertificatesResponse"
8886 }
8887}
8888
8889/// Instances ListEntraIdCertificates response.
8890#[derive(Clone, Default, PartialEq)]
8891#[non_exhaustive]
8892pub struct InstancesListEntraIdCertificatesResponse {
8893 /// List of Entra ID certificates for the instance.
8894 pub certs: std::vec::Vec<crate::model::SslCert>,
8895
8896 /// The `sha1_fingerprint` of the active certificate from `certs`.
8897 pub active_version: std::string::String,
8898
8899 /// This is always `sql#instancesListEntraIdCertificates`.
8900 pub kind: std::string::String,
8901
8902 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8903}
8904
8905impl InstancesListEntraIdCertificatesResponse {
8906 pub fn new() -> Self {
8907 std::default::Default::default()
8908 }
8909
8910 /// Sets the value of [certs][crate::model::InstancesListEntraIdCertificatesResponse::certs].
8911 ///
8912 /// # Example
8913 /// ```ignore,no_run
8914 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8915 /// use google_cloud_sql_v1::model::SslCert;
8916 /// let x = InstancesListEntraIdCertificatesResponse::new()
8917 /// .set_certs([
8918 /// SslCert::default()/* use setters */,
8919 /// SslCert::default()/* use (different) setters */,
8920 /// ]);
8921 /// ```
8922 pub fn set_certs<T, V>(mut self, v: T) -> Self
8923 where
8924 T: std::iter::IntoIterator<Item = V>,
8925 V: std::convert::Into<crate::model::SslCert>,
8926 {
8927 use std::iter::Iterator;
8928 self.certs = v.into_iter().map(|i| i.into()).collect();
8929 self
8930 }
8931
8932 /// Sets the value of [active_version][crate::model::InstancesListEntraIdCertificatesResponse::active_version].
8933 ///
8934 /// # Example
8935 /// ```ignore,no_run
8936 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8937 /// let x = InstancesListEntraIdCertificatesResponse::new().set_active_version("example");
8938 /// ```
8939 pub fn set_active_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8940 self.active_version = v.into();
8941 self
8942 }
8943
8944 /// Sets the value of [kind][crate::model::InstancesListEntraIdCertificatesResponse::kind].
8945 ///
8946 /// # Example
8947 /// ```ignore,no_run
8948 /// # use google_cloud_sql_v1::model::InstancesListEntraIdCertificatesResponse;
8949 /// let x = InstancesListEntraIdCertificatesResponse::new().set_kind("example");
8950 /// ```
8951 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8952 self.kind = v.into();
8953 self
8954 }
8955}
8956
8957impl wkt::message::Message for InstancesListEntraIdCertificatesResponse {
8958 fn typename() -> &'static str {
8959 "type.googleapis.com/google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse"
8960 }
8961}
8962
8963/// Database instance restore backup request.
8964#[derive(Clone, Default, PartialEq)]
8965#[non_exhaustive]
8966pub struct InstancesRestoreBackupRequest {
8967 /// Parameters required to perform the restore backup operation.
8968 pub restore_backup_context: std::option::Option<crate::model::RestoreBackupContext>,
8969
8970 /// The name of the backup that's used to restore a Cloud SQL instance:
8971 /// Format: projects/{project-id}/backups/{backup-uid}. Only one of
8972 /// restore_backup_context, backup, backupdr_backup can be passed to the input.
8973 pub backup: std::string::String,
8974
8975 /// The name of the backup that's used to restore a Cloud SQL instance:
8976 /// Format:
8977 /// "projects/{project-id}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup-uid}".
8978 /// Only one of restore_backup_context, backup, backupdr_backup can be
8979 /// passed to the input.
8980 pub backupdr_backup: std::string::String,
8981
8982 /// Optional. By using this parameter, Cloud SQL overrides any instance
8983 /// settings stored in the backup you are restoring from. You can't change the
8984 /// instance's major database version and you can only increase the disk size.
8985 /// You can use this field to restore new instances only. This field is not
8986 /// applicable for restore to existing instances.
8987 pub restore_instance_settings: std::option::Option<crate::model::DatabaseInstance>,
8988
8989 /// Optional. This field has the same purpose as restore_instance_settings,
8990 /// changes any instance settings stored in the backup you are restoring from.
8991 /// With the difference that these fields are cleared in the settings.
8992 pub restore_instance_clear_overrides_field_names: std::vec::Vec<std::string::String>,
8993
8994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8995}
8996
8997impl InstancesRestoreBackupRequest {
8998 pub fn new() -> Self {
8999 std::default::Default::default()
9000 }
9001
9002 /// Sets the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9003 ///
9004 /// # Example
9005 /// ```ignore,no_run
9006 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9007 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9008 /// let x = InstancesRestoreBackupRequest::new().set_restore_backup_context(RestoreBackupContext::default()/* use setters */);
9009 /// ```
9010 pub fn set_restore_backup_context<T>(mut self, v: T) -> Self
9011 where
9012 T: std::convert::Into<crate::model::RestoreBackupContext>,
9013 {
9014 self.restore_backup_context = std::option::Option::Some(v.into());
9015 self
9016 }
9017
9018 /// Sets or clears the value of [restore_backup_context][crate::model::InstancesRestoreBackupRequest::restore_backup_context].
9019 ///
9020 /// # Example
9021 /// ```ignore,no_run
9022 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9023 /// use google_cloud_sql_v1::model::RestoreBackupContext;
9024 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(Some(RestoreBackupContext::default()/* use setters */));
9025 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_backup_context(None::<RestoreBackupContext>);
9026 /// ```
9027 pub fn set_or_clear_restore_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
9028 where
9029 T: std::convert::Into<crate::model::RestoreBackupContext>,
9030 {
9031 self.restore_backup_context = v.map(|x| x.into());
9032 self
9033 }
9034
9035 /// Sets the value of [backup][crate::model::InstancesRestoreBackupRequest::backup].
9036 ///
9037 /// # Example
9038 /// ```ignore,no_run
9039 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9040 /// let x = InstancesRestoreBackupRequest::new().set_backup("example");
9041 /// ```
9042 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9043 self.backup = v.into();
9044 self
9045 }
9046
9047 /// Sets the value of [backupdr_backup][crate::model::InstancesRestoreBackupRequest::backupdr_backup].
9048 ///
9049 /// # Example
9050 /// ```ignore,no_run
9051 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9052 /// let x = InstancesRestoreBackupRequest::new().set_backupdr_backup("example");
9053 /// ```
9054 pub fn set_backupdr_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9055 self.backupdr_backup = v.into();
9056 self
9057 }
9058
9059 /// Sets the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9060 ///
9061 /// # Example
9062 /// ```ignore,no_run
9063 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9064 /// use google_cloud_sql_v1::model::DatabaseInstance;
9065 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_settings(DatabaseInstance::default()/* use setters */);
9066 /// ```
9067 pub fn set_restore_instance_settings<T>(mut self, v: T) -> Self
9068 where
9069 T: std::convert::Into<crate::model::DatabaseInstance>,
9070 {
9071 self.restore_instance_settings = std::option::Option::Some(v.into());
9072 self
9073 }
9074
9075 /// Sets or clears the value of [restore_instance_settings][crate::model::InstancesRestoreBackupRequest::restore_instance_settings].
9076 ///
9077 /// # Example
9078 /// ```ignore,no_run
9079 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9080 /// use google_cloud_sql_v1::model::DatabaseInstance;
9081 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(Some(DatabaseInstance::default()/* use setters */));
9082 /// let x = InstancesRestoreBackupRequest::new().set_or_clear_restore_instance_settings(None::<DatabaseInstance>);
9083 /// ```
9084 pub fn set_or_clear_restore_instance_settings<T>(mut self, v: std::option::Option<T>) -> Self
9085 where
9086 T: std::convert::Into<crate::model::DatabaseInstance>,
9087 {
9088 self.restore_instance_settings = v.map(|x| x.into());
9089 self
9090 }
9091
9092 /// Sets the value of [restore_instance_clear_overrides_field_names][crate::model::InstancesRestoreBackupRequest::restore_instance_clear_overrides_field_names].
9093 ///
9094 /// # Example
9095 /// ```ignore,no_run
9096 /// # use google_cloud_sql_v1::model::InstancesRestoreBackupRequest;
9097 /// let x = InstancesRestoreBackupRequest::new().set_restore_instance_clear_overrides_field_names(["a", "b", "c"]);
9098 /// ```
9099 pub fn set_restore_instance_clear_overrides_field_names<T, V>(mut self, v: T) -> Self
9100 where
9101 T: std::iter::IntoIterator<Item = V>,
9102 V: std::convert::Into<std::string::String>,
9103 {
9104 use std::iter::Iterator;
9105 self.restore_instance_clear_overrides_field_names =
9106 v.into_iter().map(|i| i.into()).collect();
9107 self
9108 }
9109}
9110
9111impl wkt::message::Message for InstancesRestoreBackupRequest {
9112 fn typename() -> &'static str {
9113 "type.googleapis.com/google.cloud.sql.v1.InstancesRestoreBackupRequest"
9114 }
9115}
9116
9117/// Rotate server CA request.
9118#[derive(Clone, Default, PartialEq)]
9119#[non_exhaustive]
9120pub struct InstancesRotateServerCaRequest {
9121 /// Contains details about the rotate server CA operation.
9122 pub rotate_server_ca_context: std::option::Option<crate::model::RotateServerCaContext>,
9123
9124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9125}
9126
9127impl InstancesRotateServerCaRequest {
9128 pub fn new() -> Self {
9129 std::default::Default::default()
9130 }
9131
9132 /// Sets the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9133 ///
9134 /// # Example
9135 /// ```ignore,no_run
9136 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9137 /// use google_cloud_sql_v1::model::RotateServerCaContext;
9138 /// let x = InstancesRotateServerCaRequest::new().set_rotate_server_ca_context(RotateServerCaContext::default()/* use setters */);
9139 /// ```
9140 pub fn set_rotate_server_ca_context<T>(mut self, v: T) -> Self
9141 where
9142 T: std::convert::Into<crate::model::RotateServerCaContext>,
9143 {
9144 self.rotate_server_ca_context = std::option::Option::Some(v.into());
9145 self
9146 }
9147
9148 /// Sets or clears the value of [rotate_server_ca_context][crate::model::InstancesRotateServerCaRequest::rotate_server_ca_context].
9149 ///
9150 /// # Example
9151 /// ```ignore,no_run
9152 /// # use google_cloud_sql_v1::model::InstancesRotateServerCaRequest;
9153 /// use google_cloud_sql_v1::model::RotateServerCaContext;
9154 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(Some(RotateServerCaContext::default()/* use setters */));
9155 /// let x = InstancesRotateServerCaRequest::new().set_or_clear_rotate_server_ca_context(None::<RotateServerCaContext>);
9156 /// ```
9157 pub fn set_or_clear_rotate_server_ca_context<T>(mut self, v: std::option::Option<T>) -> Self
9158 where
9159 T: std::convert::Into<crate::model::RotateServerCaContext>,
9160 {
9161 self.rotate_server_ca_context = v.map(|x| x.into());
9162 self
9163 }
9164}
9165
9166impl wkt::message::Message for InstancesRotateServerCaRequest {
9167 fn typename() -> &'static str {
9168 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCaRequest"
9169 }
9170}
9171
9172/// Rotate server certificate request.
9173#[derive(Clone, Default, PartialEq)]
9174#[non_exhaustive]
9175pub struct InstancesRotateServerCertificateRequest {
9176 /// Optional. Contains details about the rotate server certificate operation.
9177 pub rotate_server_certificate_context:
9178 std::option::Option<crate::model::RotateServerCertificateContext>,
9179
9180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9181}
9182
9183impl InstancesRotateServerCertificateRequest {
9184 pub fn new() -> Self {
9185 std::default::Default::default()
9186 }
9187
9188 /// Sets the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9189 ///
9190 /// # Example
9191 /// ```ignore,no_run
9192 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9193 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9194 /// let x = InstancesRotateServerCertificateRequest::new().set_rotate_server_certificate_context(RotateServerCertificateContext::default()/* use setters */);
9195 /// ```
9196 pub fn set_rotate_server_certificate_context<T>(mut self, v: T) -> Self
9197 where
9198 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9199 {
9200 self.rotate_server_certificate_context = std::option::Option::Some(v.into());
9201 self
9202 }
9203
9204 /// Sets or clears the value of [rotate_server_certificate_context][crate::model::InstancesRotateServerCertificateRequest::rotate_server_certificate_context].
9205 ///
9206 /// # Example
9207 /// ```ignore,no_run
9208 /// # use google_cloud_sql_v1::model::InstancesRotateServerCertificateRequest;
9209 /// use google_cloud_sql_v1::model::RotateServerCertificateContext;
9210 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(Some(RotateServerCertificateContext::default()/* use setters */));
9211 /// let x = InstancesRotateServerCertificateRequest::new().set_or_clear_rotate_server_certificate_context(None::<RotateServerCertificateContext>);
9212 /// ```
9213 pub fn set_or_clear_rotate_server_certificate_context<T>(
9214 mut self,
9215 v: std::option::Option<T>,
9216 ) -> Self
9217 where
9218 T: std::convert::Into<crate::model::RotateServerCertificateContext>,
9219 {
9220 self.rotate_server_certificate_context = v.map(|x| x.into());
9221 self
9222 }
9223}
9224
9225impl wkt::message::Message for InstancesRotateServerCertificateRequest {
9226 fn typename() -> &'static str {
9227 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateServerCertificateRequest"
9228 }
9229}
9230
9231/// Rotate Entra ID certificate request.
9232#[derive(Clone, Default, PartialEq)]
9233#[non_exhaustive]
9234pub struct InstancesRotateEntraIdCertificateRequest {
9235 /// Optional. Contains details about the rotate server certificate operation.
9236 pub rotate_entra_id_certificate_context:
9237 std::option::Option<crate::model::RotateEntraIdCertificateContext>,
9238
9239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9240}
9241
9242impl InstancesRotateEntraIdCertificateRequest {
9243 pub fn new() -> Self {
9244 std::default::Default::default()
9245 }
9246
9247 /// Sets the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9248 ///
9249 /// # Example
9250 /// ```ignore,no_run
9251 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9252 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9253 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_rotate_entra_id_certificate_context(RotateEntraIdCertificateContext::default()/* use setters */);
9254 /// ```
9255 pub fn set_rotate_entra_id_certificate_context<T>(mut self, v: T) -> Self
9256 where
9257 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9258 {
9259 self.rotate_entra_id_certificate_context = std::option::Option::Some(v.into());
9260 self
9261 }
9262
9263 /// Sets or clears the value of [rotate_entra_id_certificate_context][crate::model::InstancesRotateEntraIdCertificateRequest::rotate_entra_id_certificate_context].
9264 ///
9265 /// # Example
9266 /// ```ignore,no_run
9267 /// # use google_cloud_sql_v1::model::InstancesRotateEntraIdCertificateRequest;
9268 /// use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
9269 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(Some(RotateEntraIdCertificateContext::default()/* use setters */));
9270 /// let x = InstancesRotateEntraIdCertificateRequest::new().set_or_clear_rotate_entra_id_certificate_context(None::<RotateEntraIdCertificateContext>);
9271 /// ```
9272 pub fn set_or_clear_rotate_entra_id_certificate_context<T>(
9273 mut self,
9274 v: std::option::Option<T>,
9275 ) -> Self
9276 where
9277 T: std::convert::Into<crate::model::RotateEntraIdCertificateContext>,
9278 {
9279 self.rotate_entra_id_certificate_context = v.map(|x| x.into());
9280 self
9281 }
9282}
9283
9284impl wkt::message::Message for InstancesRotateEntraIdCertificateRequest {
9285 fn typename() -> &'static str {
9286 "type.googleapis.com/google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest"
9287 }
9288}
9289
9290/// Instance truncate log request.
9291#[derive(Clone, Default, PartialEq)]
9292#[non_exhaustive]
9293pub struct InstancesTruncateLogRequest {
9294 /// Contains details about the truncate log operation.
9295 pub truncate_log_context: std::option::Option<crate::model::TruncateLogContext>,
9296
9297 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9298}
9299
9300impl InstancesTruncateLogRequest {
9301 pub fn new() -> Self {
9302 std::default::Default::default()
9303 }
9304
9305 /// Sets the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9306 ///
9307 /// # Example
9308 /// ```ignore,no_run
9309 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9310 /// use google_cloud_sql_v1::model::TruncateLogContext;
9311 /// let x = InstancesTruncateLogRequest::new().set_truncate_log_context(TruncateLogContext::default()/* use setters */);
9312 /// ```
9313 pub fn set_truncate_log_context<T>(mut self, v: T) -> Self
9314 where
9315 T: std::convert::Into<crate::model::TruncateLogContext>,
9316 {
9317 self.truncate_log_context = std::option::Option::Some(v.into());
9318 self
9319 }
9320
9321 /// Sets or clears the value of [truncate_log_context][crate::model::InstancesTruncateLogRequest::truncate_log_context].
9322 ///
9323 /// # Example
9324 /// ```ignore,no_run
9325 /// # use google_cloud_sql_v1::model::InstancesTruncateLogRequest;
9326 /// use google_cloud_sql_v1::model::TruncateLogContext;
9327 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(Some(TruncateLogContext::default()/* use setters */));
9328 /// let x = InstancesTruncateLogRequest::new().set_or_clear_truncate_log_context(None::<TruncateLogContext>);
9329 /// ```
9330 pub fn set_or_clear_truncate_log_context<T>(mut self, v: std::option::Option<T>) -> Self
9331 where
9332 T: std::convert::Into<crate::model::TruncateLogContext>,
9333 {
9334 self.truncate_log_context = v.map(|x| x.into());
9335 self
9336 }
9337}
9338
9339impl wkt::message::Message for InstancesTruncateLogRequest {
9340 fn typename() -> &'static str {
9341 "type.googleapis.com/google.cloud.sql.v1.InstancesTruncateLogRequest"
9342 }
9343}
9344
9345/// Request to acquire a lease for SSRS.
9346#[derive(Clone, Default, PartialEq)]
9347#[non_exhaustive]
9348pub struct InstancesAcquireSsrsLeaseRequest {
9349 /// Contains details about the acquire SSRS lease operation.
9350 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
9351
9352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9353}
9354
9355impl InstancesAcquireSsrsLeaseRequest {
9356 pub fn new() -> Self {
9357 std::default::Default::default()
9358 }
9359
9360 /// Sets the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9361 ///
9362 /// # Example
9363 /// ```ignore,no_run
9364 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9365 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9366 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
9367 /// ```
9368 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
9369 where
9370 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9371 {
9372 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
9373 self
9374 }
9375
9376 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::InstancesAcquireSsrsLeaseRequest::acquire_ssrs_lease_context].
9377 ///
9378 /// # Example
9379 /// ```ignore,no_run
9380 /// # use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
9381 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
9382 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
9383 /// let x = InstancesAcquireSsrsLeaseRequest::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
9384 /// ```
9385 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
9386 where
9387 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
9388 {
9389 self.acquire_ssrs_lease_context = v.map(|x| x.into());
9390 self
9391 }
9392}
9393
9394impl wkt::message::Message for InstancesAcquireSsrsLeaseRequest {
9395 fn typename() -> &'static str {
9396 "type.googleapis.com/google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest"
9397 }
9398}
9399
9400/// Request for Pre-checks for MVU
9401#[derive(Clone, Default, PartialEq)]
9402#[non_exhaustive]
9403pub struct SqlInstancesPreCheckMajorVersionUpgradeRequest {
9404 /// Required. Cloud SQL instance ID. This does not include the project ID.
9405 pub instance: std::string::String,
9406
9407 /// Required. Project ID of the project that contains the instance.
9408 pub project: std::string::String,
9409
9410 /// Required. The context for request to perform the pre-check major version
9411 /// upgrade operation.
9412 pub body: std::option::Option<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9413
9414 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9415}
9416
9417impl SqlInstancesPreCheckMajorVersionUpgradeRequest {
9418 pub fn new() -> Self {
9419 std::default::Default::default()
9420 }
9421
9422 /// Sets the value of [instance][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::instance].
9423 ///
9424 /// # Example
9425 /// ```ignore,no_run
9426 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9427 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_instance("example");
9428 /// ```
9429 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9430 self.instance = v.into();
9431 self
9432 }
9433
9434 /// Sets the value of [project][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::project].
9435 ///
9436 /// # Example
9437 /// ```ignore,no_run
9438 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9439 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_project("example");
9440 /// ```
9441 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9442 self.project = v.into();
9443 self
9444 }
9445
9446 /// Sets the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9447 ///
9448 /// # Example
9449 /// ```ignore,no_run
9450 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9451 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9452 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_body(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */);
9453 /// ```
9454 pub fn set_body<T>(mut self, v: T) -> Self
9455 where
9456 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9457 {
9458 self.body = std::option::Option::Some(v.into());
9459 self
9460 }
9461
9462 /// Sets or clears the value of [body][crate::model::SqlInstancesPreCheckMajorVersionUpgradeRequest::body].
9463 ///
9464 /// # Example
9465 /// ```ignore,no_run
9466 /// # use google_cloud_sql_v1::model::SqlInstancesPreCheckMajorVersionUpgradeRequest;
9467 /// use google_cloud_sql_v1::model::InstancesPreCheckMajorVersionUpgradeRequest;
9468 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(Some(InstancesPreCheckMajorVersionUpgradeRequest::default()/* use setters */));
9469 /// let x = SqlInstancesPreCheckMajorVersionUpgradeRequest::new().set_or_clear_body(None::<InstancesPreCheckMajorVersionUpgradeRequest>);
9470 /// ```
9471 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
9472 where
9473 T: std::convert::Into<crate::model::InstancesPreCheckMajorVersionUpgradeRequest>,
9474 {
9475 self.body = v.map(|x| x.into());
9476 self
9477 }
9478}
9479
9480impl wkt::message::Message for SqlInstancesPreCheckMajorVersionUpgradeRequest {
9481 fn typename() -> &'static str {
9482 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest"
9483 }
9484}
9485
9486/// Instance verify external sync settings response.
9487#[derive(Clone, Default, PartialEq)]
9488#[non_exhaustive]
9489pub struct SqlInstancesVerifyExternalSyncSettingsResponse {
9490 /// This is always `sql#migrationSettingErrorList`.
9491 pub kind: std::string::String,
9492
9493 /// List of migration violations.
9494 pub errors: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9495
9496 /// List of migration warnings.
9497 pub warnings: std::vec::Vec<crate::model::SqlExternalSyncSettingError>,
9498
9499 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9500}
9501
9502impl SqlInstancesVerifyExternalSyncSettingsResponse {
9503 pub fn new() -> Self {
9504 std::default::Default::default()
9505 }
9506
9507 /// Sets the value of [kind][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::kind].
9508 ///
9509 /// # Example
9510 /// ```ignore,no_run
9511 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9512 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new().set_kind("example");
9513 /// ```
9514 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9515 self.kind = v.into();
9516 self
9517 }
9518
9519 /// Sets the value of [errors][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::errors].
9520 ///
9521 /// # Example
9522 /// ```ignore,no_run
9523 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9524 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9525 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9526 /// .set_errors([
9527 /// SqlExternalSyncSettingError::default()/* use setters */,
9528 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
9529 /// ]);
9530 /// ```
9531 pub fn set_errors<T, V>(mut self, v: T) -> Self
9532 where
9533 T: std::iter::IntoIterator<Item = V>,
9534 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9535 {
9536 use std::iter::Iterator;
9537 self.errors = v.into_iter().map(|i| i.into()).collect();
9538 self
9539 }
9540
9541 /// Sets the value of [warnings][crate::model::SqlInstancesVerifyExternalSyncSettingsResponse::warnings].
9542 ///
9543 /// # Example
9544 /// ```ignore,no_run
9545 /// # use google_cloud_sql_v1::model::SqlInstancesVerifyExternalSyncSettingsResponse;
9546 /// use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
9547 /// let x = SqlInstancesVerifyExternalSyncSettingsResponse::new()
9548 /// .set_warnings([
9549 /// SqlExternalSyncSettingError::default()/* use setters */,
9550 /// SqlExternalSyncSettingError::default()/* use (different) setters */,
9551 /// ]);
9552 /// ```
9553 pub fn set_warnings<T, V>(mut self, v: T) -> Self
9554 where
9555 T: std::iter::IntoIterator<Item = V>,
9556 V: std::convert::Into<crate::model::SqlExternalSyncSettingError>,
9557 {
9558 use std::iter::Iterator;
9559 self.warnings = v.into_iter().map(|i| i.into()).collect();
9560 self
9561 }
9562}
9563
9564impl wkt::message::Message for SqlInstancesVerifyExternalSyncSettingsResponse {
9565 fn typename() -> &'static str {
9566 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse"
9567 }
9568}
9569
9570/// Instance get disk shrink config response.
9571#[derive(Clone, Default, PartialEq)]
9572#[non_exhaustive]
9573pub struct SqlInstancesGetDiskShrinkConfigResponse {
9574 /// This is always `sql#getDiskShrinkConfig`.
9575 pub kind: std::string::String,
9576
9577 /// The minimum size to which a disk can be shrunk in GigaBytes.
9578 pub minimal_target_size_gb: i64,
9579
9580 /// Additional message to customers.
9581 pub message: std::string::String,
9582
9583 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9584}
9585
9586impl SqlInstancesGetDiskShrinkConfigResponse {
9587 pub fn new() -> Self {
9588 std::default::Default::default()
9589 }
9590
9591 /// Sets the value of [kind][crate::model::SqlInstancesGetDiskShrinkConfigResponse::kind].
9592 ///
9593 /// # Example
9594 /// ```ignore,no_run
9595 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9596 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_kind("example");
9597 /// ```
9598 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9599 self.kind = v.into();
9600 self
9601 }
9602
9603 /// Sets the value of [minimal_target_size_gb][crate::model::SqlInstancesGetDiskShrinkConfigResponse::minimal_target_size_gb].
9604 ///
9605 /// # Example
9606 /// ```ignore,no_run
9607 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9608 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_minimal_target_size_gb(42);
9609 /// ```
9610 pub fn set_minimal_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9611 self.minimal_target_size_gb = v.into();
9612 self
9613 }
9614
9615 /// Sets the value of [message][crate::model::SqlInstancesGetDiskShrinkConfigResponse::message].
9616 ///
9617 /// # Example
9618 /// ```ignore,no_run
9619 /// # use google_cloud_sql_v1::model::SqlInstancesGetDiskShrinkConfigResponse;
9620 /// let x = SqlInstancesGetDiskShrinkConfigResponse::new().set_message("example");
9621 /// ```
9622 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9623 self.message = v.into();
9624 self
9625 }
9626}
9627
9628impl wkt::message::Message for SqlInstancesGetDiskShrinkConfigResponse {
9629 fn typename() -> &'static str {
9630 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse"
9631 }
9632}
9633
9634/// Instance get latest recovery time request.
9635#[derive(Clone, Default, PartialEq)]
9636#[non_exhaustive]
9637pub struct SqlInstancesGetLatestRecoveryTimeRequest {
9638 /// Cloud SQL instance ID. This does not include the project ID.
9639 pub instance: std::string::String,
9640
9641 /// Project ID of the project that contains the instance.
9642 pub project: std::string::String,
9643
9644 /// The timestamp used to identify the time when the source instance is
9645 /// deleted. If this instance is deleted, then you must set the timestamp.
9646 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9647
9648 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9649}
9650
9651impl SqlInstancesGetLatestRecoveryTimeRequest {
9652 pub fn new() -> Self {
9653 std::default::Default::default()
9654 }
9655
9656 /// Sets the value of [instance][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::instance].
9657 ///
9658 /// # Example
9659 /// ```ignore,no_run
9660 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9661 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_instance("example");
9662 /// ```
9663 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9664 self.instance = v.into();
9665 self
9666 }
9667
9668 /// Sets the value of [project][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::project].
9669 ///
9670 /// # Example
9671 /// ```ignore,no_run
9672 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9673 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_project("example");
9674 /// ```
9675 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9676 self.project = v.into();
9677 self
9678 }
9679
9680 /// Sets the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9681 ///
9682 /// # Example
9683 /// ```ignore,no_run
9684 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9685 /// use wkt::Timestamp;
9686 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
9687 /// ```
9688 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
9689 where
9690 T: std::convert::Into<wkt::Timestamp>,
9691 {
9692 self.source_instance_deletion_time = std::option::Option::Some(v.into());
9693 self
9694 }
9695
9696 /// Sets or clears the value of [source_instance_deletion_time][crate::model::SqlInstancesGetLatestRecoveryTimeRequest::source_instance_deletion_time].
9697 ///
9698 /// # Example
9699 /// ```ignore,no_run
9700 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeRequest;
9701 /// use wkt::Timestamp;
9702 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
9703 /// let x = SqlInstancesGetLatestRecoveryTimeRequest::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
9704 /// ```
9705 pub fn set_or_clear_source_instance_deletion_time<T>(
9706 mut self,
9707 v: std::option::Option<T>,
9708 ) -> Self
9709 where
9710 T: std::convert::Into<wkt::Timestamp>,
9711 {
9712 self.source_instance_deletion_time = v.map(|x| x.into());
9713 self
9714 }
9715}
9716
9717impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeRequest {
9718 fn typename() -> &'static str {
9719 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest"
9720 }
9721}
9722
9723/// Instance get latest recovery time response.
9724#[derive(Clone, Default, PartialEq)]
9725#[non_exhaustive]
9726pub struct SqlInstancesGetLatestRecoveryTimeResponse {
9727 /// This is always `sql#getLatestRecoveryTime`.
9728 pub kind: std::string::String,
9729
9730 /// Timestamp, identifies the latest recovery time of the source instance.
9731 pub latest_recovery_time: std::option::Option<wkt::Timestamp>,
9732
9733 /// Timestamp, identifies the earliest recovery time of the source instance.
9734 pub earliest_recovery_time: std::option::Option<wkt::Timestamp>,
9735
9736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9737}
9738
9739impl SqlInstancesGetLatestRecoveryTimeResponse {
9740 pub fn new() -> Self {
9741 std::default::Default::default()
9742 }
9743
9744 /// Sets the value of [kind][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::kind].
9745 ///
9746 /// # Example
9747 /// ```ignore,no_run
9748 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9749 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_kind("example");
9750 /// ```
9751 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9752 self.kind = v.into();
9753 self
9754 }
9755
9756 /// Sets the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9757 ///
9758 /// # Example
9759 /// ```ignore,no_run
9760 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9761 /// use wkt::Timestamp;
9762 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_latest_recovery_time(Timestamp::default()/* use setters */);
9763 /// ```
9764 pub fn set_latest_recovery_time<T>(mut self, v: T) -> Self
9765 where
9766 T: std::convert::Into<wkt::Timestamp>,
9767 {
9768 self.latest_recovery_time = std::option::Option::Some(v.into());
9769 self
9770 }
9771
9772 /// Sets or clears the value of [latest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::latest_recovery_time].
9773 ///
9774 /// # Example
9775 /// ```ignore,no_run
9776 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9777 /// use wkt::Timestamp;
9778 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(Some(Timestamp::default()/* use setters */));
9779 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_latest_recovery_time(None::<Timestamp>);
9780 /// ```
9781 pub fn set_or_clear_latest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9782 where
9783 T: std::convert::Into<wkt::Timestamp>,
9784 {
9785 self.latest_recovery_time = v.map(|x| x.into());
9786 self
9787 }
9788
9789 /// Sets the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9790 ///
9791 /// # Example
9792 /// ```ignore,no_run
9793 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9794 /// use wkt::Timestamp;
9795 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_earliest_recovery_time(Timestamp::default()/* use setters */);
9796 /// ```
9797 pub fn set_earliest_recovery_time<T>(mut self, v: T) -> Self
9798 where
9799 T: std::convert::Into<wkt::Timestamp>,
9800 {
9801 self.earliest_recovery_time = std::option::Option::Some(v.into());
9802 self
9803 }
9804
9805 /// Sets or clears the value of [earliest_recovery_time][crate::model::SqlInstancesGetLatestRecoveryTimeResponse::earliest_recovery_time].
9806 ///
9807 /// # Example
9808 /// ```ignore,no_run
9809 /// # use google_cloud_sql_v1::model::SqlInstancesGetLatestRecoveryTimeResponse;
9810 /// use wkt::Timestamp;
9811 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(Some(Timestamp::default()/* use setters */));
9812 /// let x = SqlInstancesGetLatestRecoveryTimeResponse::new().set_or_clear_earliest_recovery_time(None::<Timestamp>);
9813 /// ```
9814 pub fn set_or_clear_earliest_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
9815 where
9816 T: std::convert::Into<wkt::Timestamp>,
9817 {
9818 self.earliest_recovery_time = v.map(|x| x.into());
9819 self
9820 }
9821}
9822
9823impl wkt::message::Message for SqlInstancesGetLatestRecoveryTimeResponse {
9824 fn typename() -> &'static str {
9825 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse"
9826 }
9827}
9828
9829/// Database instance clone context.
9830#[derive(Clone, Default, PartialEq)]
9831#[non_exhaustive]
9832pub struct CloneContext {
9833 /// This is always `sql#cloneContext`.
9834 pub kind: std::string::String,
9835
9836 /// Reserved for future use.
9837 pub pitr_timestamp_ms: i64,
9838
9839 /// Required. Name of the Cloud SQL instance to be created as a clone.
9840 pub destination_instance_name: std::string::String,
9841
9842 /// Binary log coordinates, if specified, identify the position up to which the
9843 /// source instance is cloned. If not specified, the source instance is
9844 /// cloned up to the most recent binary log coordinates.
9845 pub bin_log_coordinates: std::option::Option<crate::model::BinLogCoordinates>,
9846
9847 /// Timestamp, if specified, identifies the time to which the source instance
9848 /// is cloned.
9849 pub point_in_time: std::option::Option<wkt::Timestamp>,
9850
9851 /// The name of the allocated ip range for the private ip Cloud SQL instance.
9852 /// For example: "google-managed-services-default". If set, the cloned instance
9853 /// ip will be created in the allocated range. The range name must comply with
9854 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
9855 /// must be 1-63 characters long and match the regular expression
9856 /// [a-z]([-a-z0-9]*[a-z0-9])?.
9857 /// Reserved for future use.
9858 pub allocated_ip_range: std::string::String,
9859
9860 /// (SQL Server only) Clone only the specified databases from the source
9861 /// instance. Clone all databases if empty.
9862 pub database_names: std::vec::Vec<std::string::String>,
9863
9864 /// Optional. Copy clone and point-in-time recovery clone of an instance to the
9865 /// specified zone. If no zone is specified, clone to the same primary zone as
9866 /// the source instance. This field applies to all DB types.
9867 pub preferred_zone: std::option::Option<std::string::String>,
9868
9869 /// Optional. Copy clone and point-in-time recovery clone of a regional
9870 /// instance in the specified zones. If not specified, clone to the same
9871 /// secondary zone as the source instance. This value cannot be the same as the
9872 /// preferred_zone field. This field applies to all DB types.
9873 pub preferred_secondary_zone: std::option::Option<std::string::String>,
9874
9875 /// The timestamp used to identify the time when the source instance is
9876 /// deleted. If this instance is deleted, then you must set the timestamp.
9877 pub source_instance_deletion_time: std::option::Option<wkt::Timestamp>,
9878
9879 /// Optional. The project ID of the destination project where the cloned
9880 /// instance will be created. To perform a cross-project clone, this field is
9881 /// required. If not specified, the clone is created in the same project
9882 /// as the source instance.
9883 pub destination_project: std::option::Option<std::string::String>,
9884
9885 /// Optional. The fully qualified URI of the VPC network to which the cloned
9886 /// instance will be connected via Private Services Access for private IP. For
9887 /// example:`projects/my-network-project/global/networks/my-network`. This
9888 /// field is only required for cross-project cloning.
9889 pub destination_network: std::option::Option<std::string::String>,
9890
9891 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9892}
9893
9894impl CloneContext {
9895 pub fn new() -> Self {
9896 std::default::Default::default()
9897 }
9898
9899 /// Sets the value of [kind][crate::model::CloneContext::kind].
9900 ///
9901 /// # Example
9902 /// ```ignore,no_run
9903 /// # use google_cloud_sql_v1::model::CloneContext;
9904 /// let x = CloneContext::new().set_kind("example");
9905 /// ```
9906 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9907 self.kind = v.into();
9908 self
9909 }
9910
9911 /// Sets the value of [pitr_timestamp_ms][crate::model::CloneContext::pitr_timestamp_ms].
9912 ///
9913 /// # Example
9914 /// ```ignore,no_run
9915 /// # use google_cloud_sql_v1::model::CloneContext;
9916 /// let x = CloneContext::new().set_pitr_timestamp_ms(42);
9917 /// ```
9918 pub fn set_pitr_timestamp_ms<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9919 self.pitr_timestamp_ms = v.into();
9920 self
9921 }
9922
9923 /// Sets the value of [destination_instance_name][crate::model::CloneContext::destination_instance_name].
9924 ///
9925 /// # Example
9926 /// ```ignore,no_run
9927 /// # use google_cloud_sql_v1::model::CloneContext;
9928 /// let x = CloneContext::new().set_destination_instance_name("example");
9929 /// ```
9930 pub fn set_destination_instance_name<T: std::convert::Into<std::string::String>>(
9931 mut self,
9932 v: T,
9933 ) -> Self {
9934 self.destination_instance_name = v.into();
9935 self
9936 }
9937
9938 /// Sets the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
9939 ///
9940 /// # Example
9941 /// ```ignore,no_run
9942 /// # use google_cloud_sql_v1::model::CloneContext;
9943 /// use google_cloud_sql_v1::model::BinLogCoordinates;
9944 /// let x = CloneContext::new().set_bin_log_coordinates(BinLogCoordinates::default()/* use setters */);
9945 /// ```
9946 pub fn set_bin_log_coordinates<T>(mut self, v: T) -> Self
9947 where
9948 T: std::convert::Into<crate::model::BinLogCoordinates>,
9949 {
9950 self.bin_log_coordinates = std::option::Option::Some(v.into());
9951 self
9952 }
9953
9954 /// Sets or clears the value of [bin_log_coordinates][crate::model::CloneContext::bin_log_coordinates].
9955 ///
9956 /// # Example
9957 /// ```ignore,no_run
9958 /// # use google_cloud_sql_v1::model::CloneContext;
9959 /// use google_cloud_sql_v1::model::BinLogCoordinates;
9960 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(Some(BinLogCoordinates::default()/* use setters */));
9961 /// let x = CloneContext::new().set_or_clear_bin_log_coordinates(None::<BinLogCoordinates>);
9962 /// ```
9963 pub fn set_or_clear_bin_log_coordinates<T>(mut self, v: std::option::Option<T>) -> Self
9964 where
9965 T: std::convert::Into<crate::model::BinLogCoordinates>,
9966 {
9967 self.bin_log_coordinates = v.map(|x| x.into());
9968 self
9969 }
9970
9971 /// Sets the value of [point_in_time][crate::model::CloneContext::point_in_time].
9972 ///
9973 /// # Example
9974 /// ```ignore,no_run
9975 /// # use google_cloud_sql_v1::model::CloneContext;
9976 /// use wkt::Timestamp;
9977 /// let x = CloneContext::new().set_point_in_time(Timestamp::default()/* use setters */);
9978 /// ```
9979 pub fn set_point_in_time<T>(mut self, v: T) -> Self
9980 where
9981 T: std::convert::Into<wkt::Timestamp>,
9982 {
9983 self.point_in_time = std::option::Option::Some(v.into());
9984 self
9985 }
9986
9987 /// Sets or clears the value of [point_in_time][crate::model::CloneContext::point_in_time].
9988 ///
9989 /// # Example
9990 /// ```ignore,no_run
9991 /// # use google_cloud_sql_v1::model::CloneContext;
9992 /// use wkt::Timestamp;
9993 /// let x = CloneContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
9994 /// let x = CloneContext::new().set_or_clear_point_in_time(None::<Timestamp>);
9995 /// ```
9996 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
9997 where
9998 T: std::convert::Into<wkt::Timestamp>,
9999 {
10000 self.point_in_time = v.map(|x| x.into());
10001 self
10002 }
10003
10004 /// Sets the value of [allocated_ip_range][crate::model::CloneContext::allocated_ip_range].
10005 ///
10006 /// # Example
10007 /// ```ignore,no_run
10008 /// # use google_cloud_sql_v1::model::CloneContext;
10009 /// let x = CloneContext::new().set_allocated_ip_range("example");
10010 /// ```
10011 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
10012 mut self,
10013 v: T,
10014 ) -> Self {
10015 self.allocated_ip_range = v.into();
10016 self
10017 }
10018
10019 /// Sets the value of [database_names][crate::model::CloneContext::database_names].
10020 ///
10021 /// # Example
10022 /// ```ignore,no_run
10023 /// # use google_cloud_sql_v1::model::CloneContext;
10024 /// let x = CloneContext::new().set_database_names(["a", "b", "c"]);
10025 /// ```
10026 pub fn set_database_names<T, V>(mut self, v: T) -> Self
10027 where
10028 T: std::iter::IntoIterator<Item = V>,
10029 V: std::convert::Into<std::string::String>,
10030 {
10031 use std::iter::Iterator;
10032 self.database_names = v.into_iter().map(|i| i.into()).collect();
10033 self
10034 }
10035
10036 /// Sets the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10037 ///
10038 /// # Example
10039 /// ```ignore,no_run
10040 /// # use google_cloud_sql_v1::model::CloneContext;
10041 /// let x = CloneContext::new().set_preferred_zone("example");
10042 /// ```
10043 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10044 where
10045 T: std::convert::Into<std::string::String>,
10046 {
10047 self.preferred_zone = std::option::Option::Some(v.into());
10048 self
10049 }
10050
10051 /// Sets or clears the value of [preferred_zone][crate::model::CloneContext::preferred_zone].
10052 ///
10053 /// # Example
10054 /// ```ignore,no_run
10055 /// # use google_cloud_sql_v1::model::CloneContext;
10056 /// let x = CloneContext::new().set_or_clear_preferred_zone(Some("example"));
10057 /// let x = CloneContext::new().set_or_clear_preferred_zone(None::<String>);
10058 /// ```
10059 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10060 where
10061 T: std::convert::Into<std::string::String>,
10062 {
10063 self.preferred_zone = v.map(|x| x.into());
10064 self
10065 }
10066
10067 /// Sets the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10068 ///
10069 /// # Example
10070 /// ```ignore,no_run
10071 /// # use google_cloud_sql_v1::model::CloneContext;
10072 /// let x = CloneContext::new().set_preferred_secondary_zone("example");
10073 /// ```
10074 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10075 where
10076 T: std::convert::Into<std::string::String>,
10077 {
10078 self.preferred_secondary_zone = std::option::Option::Some(v.into());
10079 self
10080 }
10081
10082 /// Sets or clears the value of [preferred_secondary_zone][crate::model::CloneContext::preferred_secondary_zone].
10083 ///
10084 /// # Example
10085 /// ```ignore,no_run
10086 /// # use google_cloud_sql_v1::model::CloneContext;
10087 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10088 /// let x = CloneContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10089 /// ```
10090 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10091 where
10092 T: std::convert::Into<std::string::String>,
10093 {
10094 self.preferred_secondary_zone = v.map(|x| x.into());
10095 self
10096 }
10097
10098 /// Sets the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10099 ///
10100 /// # Example
10101 /// ```ignore,no_run
10102 /// # use google_cloud_sql_v1::model::CloneContext;
10103 /// use wkt::Timestamp;
10104 /// let x = CloneContext::new().set_source_instance_deletion_time(Timestamp::default()/* use setters */);
10105 /// ```
10106 pub fn set_source_instance_deletion_time<T>(mut self, v: T) -> Self
10107 where
10108 T: std::convert::Into<wkt::Timestamp>,
10109 {
10110 self.source_instance_deletion_time = std::option::Option::Some(v.into());
10111 self
10112 }
10113
10114 /// Sets or clears the value of [source_instance_deletion_time][crate::model::CloneContext::source_instance_deletion_time].
10115 ///
10116 /// # Example
10117 /// ```ignore,no_run
10118 /// # use google_cloud_sql_v1::model::CloneContext;
10119 /// use wkt::Timestamp;
10120 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(Some(Timestamp::default()/* use setters */));
10121 /// let x = CloneContext::new().set_or_clear_source_instance_deletion_time(None::<Timestamp>);
10122 /// ```
10123 pub fn set_or_clear_source_instance_deletion_time<T>(
10124 mut self,
10125 v: std::option::Option<T>,
10126 ) -> Self
10127 where
10128 T: std::convert::Into<wkt::Timestamp>,
10129 {
10130 self.source_instance_deletion_time = v.map(|x| x.into());
10131 self
10132 }
10133
10134 /// Sets the value of [destination_project][crate::model::CloneContext::destination_project].
10135 ///
10136 /// # Example
10137 /// ```ignore,no_run
10138 /// # use google_cloud_sql_v1::model::CloneContext;
10139 /// let x = CloneContext::new().set_destination_project("example");
10140 /// ```
10141 pub fn set_destination_project<T>(mut self, v: T) -> Self
10142 where
10143 T: std::convert::Into<std::string::String>,
10144 {
10145 self.destination_project = std::option::Option::Some(v.into());
10146 self
10147 }
10148
10149 /// Sets or clears the value of [destination_project][crate::model::CloneContext::destination_project].
10150 ///
10151 /// # Example
10152 /// ```ignore,no_run
10153 /// # use google_cloud_sql_v1::model::CloneContext;
10154 /// let x = CloneContext::new().set_or_clear_destination_project(Some("example"));
10155 /// let x = CloneContext::new().set_or_clear_destination_project(None::<String>);
10156 /// ```
10157 pub fn set_or_clear_destination_project<T>(mut self, v: std::option::Option<T>) -> Self
10158 where
10159 T: std::convert::Into<std::string::String>,
10160 {
10161 self.destination_project = v.map(|x| x.into());
10162 self
10163 }
10164
10165 /// Sets the value of [destination_network][crate::model::CloneContext::destination_network].
10166 ///
10167 /// # Example
10168 /// ```ignore,no_run
10169 /// # use google_cloud_sql_v1::model::CloneContext;
10170 /// let x = CloneContext::new().set_destination_network("example");
10171 /// ```
10172 pub fn set_destination_network<T>(mut self, v: T) -> Self
10173 where
10174 T: std::convert::Into<std::string::String>,
10175 {
10176 self.destination_network = std::option::Option::Some(v.into());
10177 self
10178 }
10179
10180 /// Sets or clears the value of [destination_network][crate::model::CloneContext::destination_network].
10181 ///
10182 /// # Example
10183 /// ```ignore,no_run
10184 /// # use google_cloud_sql_v1::model::CloneContext;
10185 /// let x = CloneContext::new().set_or_clear_destination_network(Some("example"));
10186 /// let x = CloneContext::new().set_or_clear_destination_network(None::<String>);
10187 /// ```
10188 pub fn set_or_clear_destination_network<T>(mut self, v: std::option::Option<T>) -> Self
10189 where
10190 T: std::convert::Into<std::string::String>,
10191 {
10192 self.destination_network = v.map(|x| x.into());
10193 self
10194 }
10195}
10196
10197impl wkt::message::Message for CloneContext {
10198 fn typename() -> &'static str {
10199 "type.googleapis.com/google.cloud.sql.v1.CloneContext"
10200 }
10201}
10202
10203/// The context to perform a point-in-time recovery of an instance managed by
10204/// Backup and Disaster Recovery (DR) Service.
10205#[derive(Clone, Default, PartialEq)]
10206#[non_exhaustive]
10207pub struct PointInTimeRestoreContext {
10208 /// The Backup and Disaster Recovery (DR) Service Datasource URI.
10209 /// Format:
10210 /// projects/{project}/locations/{region}/backupVaults/{backupvault}/dataSources/{datasource}.
10211 pub datasource: std::option::Option<std::string::String>,
10212
10213 /// Required. The date and time to which you want to restore the instance.
10214 pub point_in_time: std::option::Option<wkt::Timestamp>,
10215
10216 /// Target instance name.
10217 pub target_instance: std::option::Option<std::string::String>,
10218
10219 /// Optional. The resource link for the VPC network from which the Cloud SQL
10220 /// instance is accessible for private IP. For example,
10221 /// `/projects/myProject/global/networks/default`.
10222 pub private_network: std::option::Option<std::string::String>,
10223
10224 /// Optional. The name of the allocated IP range for the internal IP Cloud SQL
10225 /// instance. For example: "google-managed-services-default". If you set this,
10226 /// then Cloud SQL creates the IP address for the cloned instance in the
10227 /// allocated range. This range must comply with [RFC
10228 /// 1035](https://tools.ietf.org/html/rfc1035) standards. Specifically, the
10229 /// name must be 1-63 characters long and match the regular expression
10230 /// [a-z]([-a-z0-9]*[a-z0-9])?. Reserved for future use.
10231 pub allocated_ip_range: std::option::Option<std::string::String>,
10232
10233 /// Optional. Point-in-time recovery of an instance to the specified zone. If
10234 /// no zone is specified, then clone to the same primary zone as the source
10235 /// instance.
10236 pub preferred_zone: std::option::Option<std::string::String>,
10237
10238 /// Optional. Point-in-time recovery of a regional instance in the specified
10239 /// zones. If not specified, clone to the same secondary zone as the source
10240 /// instance. This value cannot be the same as the preferred_zone field.
10241 pub preferred_secondary_zone: std::option::Option<std::string::String>,
10242
10243 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10244}
10245
10246impl PointInTimeRestoreContext {
10247 pub fn new() -> Self {
10248 std::default::Default::default()
10249 }
10250
10251 /// Sets the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10252 ///
10253 /// # Example
10254 /// ```ignore,no_run
10255 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10256 /// let x = PointInTimeRestoreContext::new().set_datasource("example");
10257 /// ```
10258 pub fn set_datasource<T>(mut self, v: T) -> Self
10259 where
10260 T: std::convert::Into<std::string::String>,
10261 {
10262 self.datasource = std::option::Option::Some(v.into());
10263 self
10264 }
10265
10266 /// Sets or clears the value of [datasource][crate::model::PointInTimeRestoreContext::datasource].
10267 ///
10268 /// # Example
10269 /// ```ignore,no_run
10270 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10271 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(Some("example"));
10272 /// let x = PointInTimeRestoreContext::new().set_or_clear_datasource(None::<String>);
10273 /// ```
10274 pub fn set_or_clear_datasource<T>(mut self, v: std::option::Option<T>) -> Self
10275 where
10276 T: std::convert::Into<std::string::String>,
10277 {
10278 self.datasource = v.map(|x| x.into());
10279 self
10280 }
10281
10282 /// Sets the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10283 ///
10284 /// # Example
10285 /// ```ignore,no_run
10286 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10287 /// use wkt::Timestamp;
10288 /// let x = PointInTimeRestoreContext::new().set_point_in_time(Timestamp::default()/* use setters */);
10289 /// ```
10290 pub fn set_point_in_time<T>(mut self, v: T) -> Self
10291 where
10292 T: std::convert::Into<wkt::Timestamp>,
10293 {
10294 self.point_in_time = std::option::Option::Some(v.into());
10295 self
10296 }
10297
10298 /// Sets or clears the value of [point_in_time][crate::model::PointInTimeRestoreContext::point_in_time].
10299 ///
10300 /// # Example
10301 /// ```ignore,no_run
10302 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10303 /// use wkt::Timestamp;
10304 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(Some(Timestamp::default()/* use setters */));
10305 /// let x = PointInTimeRestoreContext::new().set_or_clear_point_in_time(None::<Timestamp>);
10306 /// ```
10307 pub fn set_or_clear_point_in_time<T>(mut self, v: std::option::Option<T>) -> Self
10308 where
10309 T: std::convert::Into<wkt::Timestamp>,
10310 {
10311 self.point_in_time = v.map(|x| x.into());
10312 self
10313 }
10314
10315 /// Sets the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10316 ///
10317 /// # Example
10318 /// ```ignore,no_run
10319 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10320 /// let x = PointInTimeRestoreContext::new().set_target_instance("example");
10321 /// ```
10322 pub fn set_target_instance<T>(mut self, v: T) -> Self
10323 where
10324 T: std::convert::Into<std::string::String>,
10325 {
10326 self.target_instance = std::option::Option::Some(v.into());
10327 self
10328 }
10329
10330 /// Sets or clears the value of [target_instance][crate::model::PointInTimeRestoreContext::target_instance].
10331 ///
10332 /// # Example
10333 /// ```ignore,no_run
10334 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10335 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(Some("example"));
10336 /// let x = PointInTimeRestoreContext::new().set_or_clear_target_instance(None::<String>);
10337 /// ```
10338 pub fn set_or_clear_target_instance<T>(mut self, v: std::option::Option<T>) -> Self
10339 where
10340 T: std::convert::Into<std::string::String>,
10341 {
10342 self.target_instance = v.map(|x| x.into());
10343 self
10344 }
10345
10346 /// Sets the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10347 ///
10348 /// # Example
10349 /// ```ignore,no_run
10350 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10351 /// let x = PointInTimeRestoreContext::new().set_private_network("example");
10352 /// ```
10353 pub fn set_private_network<T>(mut self, v: T) -> Self
10354 where
10355 T: std::convert::Into<std::string::String>,
10356 {
10357 self.private_network = std::option::Option::Some(v.into());
10358 self
10359 }
10360
10361 /// Sets or clears the value of [private_network][crate::model::PointInTimeRestoreContext::private_network].
10362 ///
10363 /// # Example
10364 /// ```ignore,no_run
10365 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10366 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(Some("example"));
10367 /// let x = PointInTimeRestoreContext::new().set_or_clear_private_network(None::<String>);
10368 /// ```
10369 pub fn set_or_clear_private_network<T>(mut self, v: std::option::Option<T>) -> Self
10370 where
10371 T: std::convert::Into<std::string::String>,
10372 {
10373 self.private_network = v.map(|x| x.into());
10374 self
10375 }
10376
10377 /// Sets the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10378 ///
10379 /// # Example
10380 /// ```ignore,no_run
10381 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10382 /// let x = PointInTimeRestoreContext::new().set_allocated_ip_range("example");
10383 /// ```
10384 pub fn set_allocated_ip_range<T>(mut self, v: T) -> Self
10385 where
10386 T: std::convert::Into<std::string::String>,
10387 {
10388 self.allocated_ip_range = std::option::Option::Some(v.into());
10389 self
10390 }
10391
10392 /// Sets or clears the value of [allocated_ip_range][crate::model::PointInTimeRestoreContext::allocated_ip_range].
10393 ///
10394 /// # Example
10395 /// ```ignore,no_run
10396 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10397 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(Some("example"));
10398 /// let x = PointInTimeRestoreContext::new().set_or_clear_allocated_ip_range(None::<String>);
10399 /// ```
10400 pub fn set_or_clear_allocated_ip_range<T>(mut self, v: std::option::Option<T>) -> Self
10401 where
10402 T: std::convert::Into<std::string::String>,
10403 {
10404 self.allocated_ip_range = v.map(|x| x.into());
10405 self
10406 }
10407
10408 /// Sets the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10409 ///
10410 /// # Example
10411 /// ```ignore,no_run
10412 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10413 /// let x = PointInTimeRestoreContext::new().set_preferred_zone("example");
10414 /// ```
10415 pub fn set_preferred_zone<T>(mut self, v: T) -> Self
10416 where
10417 T: std::convert::Into<std::string::String>,
10418 {
10419 self.preferred_zone = std::option::Option::Some(v.into());
10420 self
10421 }
10422
10423 /// Sets or clears the value of [preferred_zone][crate::model::PointInTimeRestoreContext::preferred_zone].
10424 ///
10425 /// # Example
10426 /// ```ignore,no_run
10427 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10428 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(Some("example"));
10429 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_zone(None::<String>);
10430 /// ```
10431 pub fn set_or_clear_preferred_zone<T>(mut self, v: std::option::Option<T>) -> Self
10432 where
10433 T: std::convert::Into<std::string::String>,
10434 {
10435 self.preferred_zone = v.map(|x| x.into());
10436 self
10437 }
10438
10439 /// Sets the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10440 ///
10441 /// # Example
10442 /// ```ignore,no_run
10443 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10444 /// let x = PointInTimeRestoreContext::new().set_preferred_secondary_zone("example");
10445 /// ```
10446 pub fn set_preferred_secondary_zone<T>(mut self, v: T) -> Self
10447 where
10448 T: std::convert::Into<std::string::String>,
10449 {
10450 self.preferred_secondary_zone = std::option::Option::Some(v.into());
10451 self
10452 }
10453
10454 /// Sets or clears the value of [preferred_secondary_zone][crate::model::PointInTimeRestoreContext::preferred_secondary_zone].
10455 ///
10456 /// # Example
10457 /// ```ignore,no_run
10458 /// # use google_cloud_sql_v1::model::PointInTimeRestoreContext;
10459 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(Some("example"));
10460 /// let x = PointInTimeRestoreContext::new().set_or_clear_preferred_secondary_zone(None::<String>);
10461 /// ```
10462 pub fn set_or_clear_preferred_secondary_zone<T>(mut self, v: std::option::Option<T>) -> Self
10463 where
10464 T: std::convert::Into<std::string::String>,
10465 {
10466 self.preferred_secondary_zone = v.map(|x| x.into());
10467 self
10468 }
10469}
10470
10471impl wkt::message::Message for PointInTimeRestoreContext {
10472 fn typename() -> &'static str {
10473 "type.googleapis.com/google.cloud.sql.v1.PointInTimeRestoreContext"
10474 }
10475}
10476
10477/// Binary log coordinates.
10478#[derive(Clone, Default, PartialEq)]
10479#[non_exhaustive]
10480pub struct BinLogCoordinates {
10481 /// Name of the binary log file for a Cloud SQL instance.
10482 pub bin_log_file_name: std::string::String,
10483
10484 /// Position (offset) within the binary log file.
10485 pub bin_log_position: i64,
10486
10487 /// This is always `sql#binLogCoordinates`.
10488 pub kind: std::string::String,
10489
10490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10491}
10492
10493impl BinLogCoordinates {
10494 pub fn new() -> Self {
10495 std::default::Default::default()
10496 }
10497
10498 /// Sets the value of [bin_log_file_name][crate::model::BinLogCoordinates::bin_log_file_name].
10499 ///
10500 /// # Example
10501 /// ```ignore,no_run
10502 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10503 /// let x = BinLogCoordinates::new().set_bin_log_file_name("example");
10504 /// ```
10505 pub fn set_bin_log_file_name<T: std::convert::Into<std::string::String>>(
10506 mut self,
10507 v: T,
10508 ) -> Self {
10509 self.bin_log_file_name = v.into();
10510 self
10511 }
10512
10513 /// Sets the value of [bin_log_position][crate::model::BinLogCoordinates::bin_log_position].
10514 ///
10515 /// # Example
10516 /// ```ignore,no_run
10517 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10518 /// let x = BinLogCoordinates::new().set_bin_log_position(42);
10519 /// ```
10520 pub fn set_bin_log_position<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10521 self.bin_log_position = v.into();
10522 self
10523 }
10524
10525 /// Sets the value of [kind][crate::model::BinLogCoordinates::kind].
10526 ///
10527 /// # Example
10528 /// ```ignore,no_run
10529 /// # use google_cloud_sql_v1::model::BinLogCoordinates;
10530 /// let x = BinLogCoordinates::new().set_kind("example");
10531 /// ```
10532 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10533 self.kind = v.into();
10534 self
10535 }
10536}
10537
10538impl wkt::message::Message for BinLogCoordinates {
10539 fn typename() -> &'static str {
10540 "type.googleapis.com/google.cloud.sql.v1.BinLogCoordinates"
10541 }
10542}
10543
10544/// A Cloud SQL instance resource.
10545#[derive(Clone, Default, PartialEq)]
10546#[non_exhaustive]
10547pub struct DatabaseInstance {
10548 /// This is always `sql#instance`.
10549 pub kind: std::string::String,
10550
10551 /// The current serving state of the Cloud SQL instance.
10552 pub state: crate::model::database_instance::SqlInstanceState,
10553
10554 /// The database engine type and version. The `databaseVersion` field cannot
10555 /// be changed after instance creation.
10556 pub database_version: crate::model::SqlDatabaseVersion,
10557
10558 /// The user settings.
10559 pub settings: std::option::Option<crate::model::Settings>,
10560
10561 /// This field is deprecated and will be removed from a future version of the
10562 /// API. Use the `settings.settingsVersion` field instead.
10563 pub etag: std::string::String,
10564
10565 /// The name and status of the failover replica.
10566 pub failover_replica: std::option::Option<crate::model::database_instance::SqlFailoverReplica>,
10567
10568 /// The name of the instance which will act as primary in the replication
10569 /// setup.
10570 pub master_instance_name: std::string::String,
10571
10572 /// The replicas of the instance.
10573 pub replica_names: std::vec::Vec<std::string::String>,
10574
10575 /// The maximum disk size of the instance in bytes.
10576 #[deprecated]
10577 pub max_disk_size: std::option::Option<wkt::Int64Value>,
10578
10579 /// The current disk usage of the instance in bytes. This property has been
10580 /// deprecated. Use the
10581 /// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
10582 /// Monitoring API instead. Please see [this
10583 /// announcement](https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ)
10584 /// for details.
10585 #[deprecated]
10586 pub current_disk_size: std::option::Option<wkt::Int64Value>,
10587
10588 /// The assigned IP addresses for the instance.
10589 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
10590
10591 /// SSL configuration.
10592 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
10593
10594 /// The instance type.
10595 pub instance_type: crate::model::SqlInstanceType,
10596
10597 /// The project ID of the project containing the Cloud SQL instance. The Google
10598 /// apps domain is prefixed if applicable.
10599 pub project: std::string::String,
10600
10601 /// The IPv6 address assigned to the instance.
10602 /// (Deprecated) This property was applicable only
10603 /// to First Generation instances.
10604 #[deprecated]
10605 pub ipv6_address: std::string::String,
10606
10607 /// The service account email address assigned to the instance.\This
10608 /// property is read-only.
10609 pub service_account_email_address: std::string::String,
10610
10611 /// Configuration specific to on-premises instances.
10612 pub on_premises_configuration: std::option::Option<crate::model::OnPremisesConfiguration>,
10613
10614 /// Configuration specific to failover replicas and read replicas.
10615 pub replica_configuration: std::option::Option<crate::model::ReplicaConfiguration>,
10616
10617 /// The backend type.
10618 /// `SECOND_GEN`: Cloud SQL database instance.
10619 /// `EXTERNAL`: A database server that is not managed by Google.
10620 ///
10621 /// This property is read-only; use the `tier` property in the `settings`
10622 /// object to determine the database type.
10623 pub backend_type: crate::model::SqlBackendType,
10624
10625 /// The URI of this resource.
10626 pub self_link: std::string::String,
10627
10628 /// If the instance state is SUSPENDED, the reason for the suspension.
10629 pub suspension_reason: std::vec::Vec<crate::model::SqlSuspensionReason>,
10630
10631 /// Connection name of the Cloud SQL instance used in connection strings.
10632 pub connection_name: std::string::String,
10633
10634 /// Name of the Cloud SQL instance. This does not include the project ID.
10635 pub name: std::string::String,
10636
10637 /// The geographical region of the Cloud SQL instance.
10638 ///
10639 /// It can be one of the
10640 /// [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r)
10641 /// where Cloud SQL operates:
10642 ///
10643 /// For example, `asia-east1`, `europe-west1`, and `us-central1`.
10644 /// The default value is `us-central1`.
10645 pub region: std::string::String,
10646
10647 /// The Compute Engine zone that the instance is currently serving from. This
10648 /// value could be different from the zone that was specified when the instance
10649 /// was created if the instance has failed over to its secondary zone. WARNING:
10650 /// Changing this might restart the instance.
10651 pub gce_zone: std::string::String,
10652
10653 /// The Compute Engine zone that the failover instance is currently serving
10654 /// from for a regional instance. This value could be different
10655 /// from the zone that was specified when the instance
10656 /// was created if the instance has failed over to its secondary/failover zone.
10657 pub secondary_gce_zone: std::string::String,
10658
10659 /// Disk encryption configuration specific to an instance.
10660 pub disk_encryption_configuration:
10661 std::option::Option<crate::model::DiskEncryptionConfiguration>,
10662
10663 /// Disk encryption status specific to an instance.
10664 pub disk_encryption_status: std::option::Option<crate::model::DiskEncryptionStatus>,
10665
10666 /// Initial root password. Use only on creation. You must set root passwords
10667 /// before you can connect to PostgreSQL instances.
10668 pub root_password: std::string::String,
10669
10670 /// The start time of any upcoming scheduled maintenance for this instance.
10671 pub scheduled_maintenance:
10672 std::option::Option<crate::model::database_instance::SqlScheduledMaintenance>,
10673
10674 /// This status indicates whether the instance satisfies PZS.
10675 ///
10676 /// The status is reserved for future use.
10677 pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
10678
10679 /// Output only. Stores the current database version running on the instance
10680 /// including minor version such as `MYSQL_8_0_18`.
10681 pub database_installed_version: std::string::String,
10682
10683 /// This field represents the report generated by the proactive database
10684 /// wellness job for OutOfDisk issues.
10685 ///
10686 /// * Writers:
10687 /// * the proactive database wellness job for OOD.
10688 /// * Readers:
10689 /// * the proactive database wellness job
10690 pub out_of_disk_report:
10691 std::option::Option<crate::model::database_instance::SqlOutOfDiskReport>,
10692
10693 /// Output only. The time when the instance was created in
10694 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
10695 /// `2012-11-15T16:19:00.094Z`.
10696 pub create_time: std::option::Option<wkt::Timestamp>,
10697
10698 /// Output only. List all maintenance versions applicable on the instance
10699 pub available_maintenance_versions: std::vec::Vec<std::string::String>,
10700
10701 /// The current software version on the instance.
10702 pub maintenance_version: std::string::String,
10703
10704 /// Output only. All database versions that are available for upgrade.
10705 pub upgradable_database_versions: std::vec::Vec<crate::model::AvailableDatabaseVersion>,
10706
10707 pub sql_network_architecture:
10708 std::option::Option<crate::model::database_instance::SqlNetworkArchitecture>,
10709
10710 /// Output only. The link to service attachment of PSC instance.
10711 pub psc_service_attachment_link: std::option::Option<std::string::String>,
10712
10713 /// Output only. The dns name of the instance.
10714 pub dns_name: std::option::Option<std::string::String>,
10715
10716 /// Output only. DEPRECATED: please use write_endpoint instead.
10717 #[deprecated]
10718 pub primary_dns_name: std::option::Option<std::string::String>,
10719
10720 /// Output only. The dns name of the primary instance in a replication group.
10721 pub write_endpoint: std::option::Option<std::string::String>,
10722
10723 /// Optional. A primary instance and disaster recovery (DR) replica pair.
10724 /// A DR replica is a cross-region replica that you designate
10725 /// for failover in the event that the primary instance
10726 /// experiences regional failure.
10727 /// Applicable to MySQL and PostgreSQL.
10728 pub replication_cluster: std::option::Option<crate::model::ReplicationCluster>,
10729
10730 /// Gemini instance configuration.
10731 pub gemini_config: std::option::Option<crate::model::GeminiInstanceConfig>,
10732
10733 /// Output only. This status indicates whether the instance satisfies PZI.
10734 ///
10735 /// The status is reserved for future use.
10736 pub satisfies_pzi: std::option::Option<wkt::BoolValue>,
10737
10738 /// Input only. Whether Cloud SQL is enabled to switch storing point-in-time
10739 /// recovery log files from a data disk to Cloud Storage.
10740 pub switch_transaction_logs_to_cloud_storage_enabled: std::option::Option<wkt::BoolValue>,
10741
10742 /// Input only. Determines whether an in-place major version upgrade of
10743 /// replicas happens when an in-place major version upgrade of a primary
10744 /// instance is initiated.
10745 pub include_replicas_for_major_version_upgrade: std::option::Option<wkt::BoolValue>,
10746
10747 /// Optional. Input only. Immutable. Tag keys and tag values that are bound to
10748 /// this instance. You must represent each item in the map as:
10749 /// `"<tag-key-namespaced-name>" : "<tag-value-short-name>"`.
10750 ///
10751 /// For example, a single resource can have the following tags:
10752 ///
10753 /// ```norust
10754 /// "123/environment": "production",
10755 /// "123/costCenter": "marketing",
10756 /// ```
10757 ///
10758 /// For more information on tag creation and management, see
10759 /// <https://cloud.google.com/resource-manager/docs/tags/tags-overview>.
10760 pub tags: std::collections::HashMap<std::string::String, std::string::String>,
10761
10762 /// The number of read pool nodes in a read pool.
10763 pub node_count: std::option::Option<i32>,
10764
10765 /// Output only. Entries containing information about each read pool node of
10766 /// the read pool.
10767 pub nodes: std::vec::Vec<crate::model::database_instance::PoolNodeConfig>,
10768
10769 /// Output only. The list of DNS names used by this instance.
10770 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
10771
10772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10773}
10774
10775impl DatabaseInstance {
10776 pub fn new() -> Self {
10777 std::default::Default::default()
10778 }
10779
10780 /// Sets the value of [kind][crate::model::DatabaseInstance::kind].
10781 ///
10782 /// # Example
10783 /// ```ignore,no_run
10784 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10785 /// let x = DatabaseInstance::new().set_kind("example");
10786 /// ```
10787 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10788 self.kind = v.into();
10789 self
10790 }
10791
10792 /// Sets the value of [state][crate::model::DatabaseInstance::state].
10793 ///
10794 /// # Example
10795 /// ```ignore,no_run
10796 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10797 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
10798 /// let x0 = DatabaseInstance::new().set_state(SqlInstanceState::Runnable);
10799 /// let x1 = DatabaseInstance::new().set_state(SqlInstanceState::Suspended);
10800 /// let x2 = DatabaseInstance::new().set_state(SqlInstanceState::PendingDelete);
10801 /// ```
10802 pub fn set_state<T: std::convert::Into<crate::model::database_instance::SqlInstanceState>>(
10803 mut self,
10804 v: T,
10805 ) -> Self {
10806 self.state = v.into();
10807 self
10808 }
10809
10810 /// Sets the value of [database_version][crate::model::DatabaseInstance::database_version].
10811 ///
10812 /// # Example
10813 /// ```ignore,no_run
10814 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10815 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
10816 /// let x0 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql56);
10817 /// let x1 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql57);
10818 /// let x2 = DatabaseInstance::new().set_database_version(SqlDatabaseVersion::Mysql80);
10819 /// ```
10820 pub fn set_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
10821 mut self,
10822 v: T,
10823 ) -> Self {
10824 self.database_version = v.into();
10825 self
10826 }
10827
10828 /// Sets the value of [settings][crate::model::DatabaseInstance::settings].
10829 ///
10830 /// # Example
10831 /// ```ignore,no_run
10832 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10833 /// use google_cloud_sql_v1::model::Settings;
10834 /// let x = DatabaseInstance::new().set_settings(Settings::default()/* use setters */);
10835 /// ```
10836 pub fn set_settings<T>(mut self, v: T) -> Self
10837 where
10838 T: std::convert::Into<crate::model::Settings>,
10839 {
10840 self.settings = std::option::Option::Some(v.into());
10841 self
10842 }
10843
10844 /// Sets or clears the value of [settings][crate::model::DatabaseInstance::settings].
10845 ///
10846 /// # Example
10847 /// ```ignore,no_run
10848 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10849 /// use google_cloud_sql_v1::model::Settings;
10850 /// let x = DatabaseInstance::new().set_or_clear_settings(Some(Settings::default()/* use setters */));
10851 /// let x = DatabaseInstance::new().set_or_clear_settings(None::<Settings>);
10852 /// ```
10853 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
10854 where
10855 T: std::convert::Into<crate::model::Settings>,
10856 {
10857 self.settings = v.map(|x| x.into());
10858 self
10859 }
10860
10861 /// Sets the value of [etag][crate::model::DatabaseInstance::etag].
10862 ///
10863 /// # Example
10864 /// ```ignore,no_run
10865 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10866 /// let x = DatabaseInstance::new().set_etag("example");
10867 /// ```
10868 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10869 self.etag = v.into();
10870 self
10871 }
10872
10873 /// Sets the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
10874 ///
10875 /// # Example
10876 /// ```ignore,no_run
10877 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10878 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
10879 /// let x = DatabaseInstance::new().set_failover_replica(SqlFailoverReplica::default()/* use setters */);
10880 /// ```
10881 pub fn set_failover_replica<T>(mut self, v: T) -> Self
10882 where
10883 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
10884 {
10885 self.failover_replica = std::option::Option::Some(v.into());
10886 self
10887 }
10888
10889 /// Sets or clears the value of [failover_replica][crate::model::DatabaseInstance::failover_replica].
10890 ///
10891 /// # Example
10892 /// ```ignore,no_run
10893 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10894 /// use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
10895 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(Some(SqlFailoverReplica::default()/* use setters */));
10896 /// let x = DatabaseInstance::new().set_or_clear_failover_replica(None::<SqlFailoverReplica>);
10897 /// ```
10898 pub fn set_or_clear_failover_replica<T>(mut self, v: std::option::Option<T>) -> Self
10899 where
10900 T: std::convert::Into<crate::model::database_instance::SqlFailoverReplica>,
10901 {
10902 self.failover_replica = v.map(|x| x.into());
10903 self
10904 }
10905
10906 /// Sets the value of [master_instance_name][crate::model::DatabaseInstance::master_instance_name].
10907 ///
10908 /// # Example
10909 /// ```ignore,no_run
10910 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10911 /// let x = DatabaseInstance::new().set_master_instance_name("example");
10912 /// ```
10913 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
10914 mut self,
10915 v: T,
10916 ) -> Self {
10917 self.master_instance_name = v.into();
10918 self
10919 }
10920
10921 /// Sets the value of [replica_names][crate::model::DatabaseInstance::replica_names].
10922 ///
10923 /// # Example
10924 /// ```ignore,no_run
10925 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10926 /// let x = DatabaseInstance::new().set_replica_names(["a", "b", "c"]);
10927 /// ```
10928 pub fn set_replica_names<T, V>(mut self, v: T) -> Self
10929 where
10930 T: std::iter::IntoIterator<Item = V>,
10931 V: std::convert::Into<std::string::String>,
10932 {
10933 use std::iter::Iterator;
10934 self.replica_names = v.into_iter().map(|i| i.into()).collect();
10935 self
10936 }
10937
10938 /// Sets the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
10939 ///
10940 /// # Example
10941 /// ```ignore,no_run
10942 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10943 /// use wkt::Int64Value;
10944 /// let x = DatabaseInstance::new().set_max_disk_size(Int64Value::default()/* use setters */);
10945 /// ```
10946 #[deprecated]
10947 pub fn set_max_disk_size<T>(mut self, v: T) -> Self
10948 where
10949 T: std::convert::Into<wkt::Int64Value>,
10950 {
10951 self.max_disk_size = std::option::Option::Some(v.into());
10952 self
10953 }
10954
10955 /// Sets or clears the value of [max_disk_size][crate::model::DatabaseInstance::max_disk_size].
10956 ///
10957 /// # Example
10958 /// ```ignore,no_run
10959 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10960 /// use wkt::Int64Value;
10961 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(Some(Int64Value::default()/* use setters */));
10962 /// let x = DatabaseInstance::new().set_or_clear_max_disk_size(None::<Int64Value>);
10963 /// ```
10964 #[deprecated]
10965 pub fn set_or_clear_max_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
10966 where
10967 T: std::convert::Into<wkt::Int64Value>,
10968 {
10969 self.max_disk_size = v.map(|x| x.into());
10970 self
10971 }
10972
10973 /// Sets the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
10974 ///
10975 /// # Example
10976 /// ```ignore,no_run
10977 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10978 /// use wkt::Int64Value;
10979 /// let x = DatabaseInstance::new().set_current_disk_size(Int64Value::default()/* use setters */);
10980 /// ```
10981 #[deprecated]
10982 pub fn set_current_disk_size<T>(mut self, v: T) -> Self
10983 where
10984 T: std::convert::Into<wkt::Int64Value>,
10985 {
10986 self.current_disk_size = std::option::Option::Some(v.into());
10987 self
10988 }
10989
10990 /// Sets or clears the value of [current_disk_size][crate::model::DatabaseInstance::current_disk_size].
10991 ///
10992 /// # Example
10993 /// ```ignore,no_run
10994 /// # use google_cloud_sql_v1::model::DatabaseInstance;
10995 /// use wkt::Int64Value;
10996 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(Some(Int64Value::default()/* use setters */));
10997 /// let x = DatabaseInstance::new().set_or_clear_current_disk_size(None::<Int64Value>);
10998 /// ```
10999 #[deprecated]
11000 pub fn set_or_clear_current_disk_size<T>(mut self, v: std::option::Option<T>) -> Self
11001 where
11002 T: std::convert::Into<wkt::Int64Value>,
11003 {
11004 self.current_disk_size = v.map(|x| x.into());
11005 self
11006 }
11007
11008 /// Sets the value of [ip_addresses][crate::model::DatabaseInstance::ip_addresses].
11009 ///
11010 /// # Example
11011 /// ```ignore,no_run
11012 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11013 /// use google_cloud_sql_v1::model::IpMapping;
11014 /// let x = DatabaseInstance::new()
11015 /// .set_ip_addresses([
11016 /// IpMapping::default()/* use setters */,
11017 /// IpMapping::default()/* use (different) setters */,
11018 /// ]);
11019 /// ```
11020 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
11021 where
11022 T: std::iter::IntoIterator<Item = V>,
11023 V: std::convert::Into<crate::model::IpMapping>,
11024 {
11025 use std::iter::Iterator;
11026 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
11027 self
11028 }
11029
11030 /// Sets the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11031 ///
11032 /// # Example
11033 /// ```ignore,no_run
11034 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11035 /// use google_cloud_sql_v1::model::SslCert;
11036 /// let x = DatabaseInstance::new().set_server_ca_cert(SslCert::default()/* use setters */);
11037 /// ```
11038 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
11039 where
11040 T: std::convert::Into<crate::model::SslCert>,
11041 {
11042 self.server_ca_cert = std::option::Option::Some(v.into());
11043 self
11044 }
11045
11046 /// Sets or clears the value of [server_ca_cert][crate::model::DatabaseInstance::server_ca_cert].
11047 ///
11048 /// # Example
11049 /// ```ignore,no_run
11050 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11051 /// use google_cloud_sql_v1::model::SslCert;
11052 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
11053 /// let x = DatabaseInstance::new().set_or_clear_server_ca_cert(None::<SslCert>);
11054 /// ```
11055 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
11056 where
11057 T: std::convert::Into<crate::model::SslCert>,
11058 {
11059 self.server_ca_cert = v.map(|x| x.into());
11060 self
11061 }
11062
11063 /// Sets the value of [instance_type][crate::model::DatabaseInstance::instance_type].
11064 ///
11065 /// # Example
11066 /// ```ignore,no_run
11067 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11068 /// use google_cloud_sql_v1::model::SqlInstanceType;
11069 /// let x0 = DatabaseInstance::new().set_instance_type(SqlInstanceType::CloudSqlInstance);
11070 /// let x1 = DatabaseInstance::new().set_instance_type(SqlInstanceType::OnPremisesInstance);
11071 /// let x2 = DatabaseInstance::new().set_instance_type(SqlInstanceType::ReadReplicaInstance);
11072 /// ```
11073 pub fn set_instance_type<T: std::convert::Into<crate::model::SqlInstanceType>>(
11074 mut self,
11075 v: T,
11076 ) -> Self {
11077 self.instance_type = v.into();
11078 self
11079 }
11080
11081 /// Sets the value of [project][crate::model::DatabaseInstance::project].
11082 ///
11083 /// # Example
11084 /// ```ignore,no_run
11085 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11086 /// let x = DatabaseInstance::new().set_project("example");
11087 /// ```
11088 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11089 self.project = v.into();
11090 self
11091 }
11092
11093 /// Sets the value of [ipv6_address][crate::model::DatabaseInstance::ipv6_address].
11094 ///
11095 /// # Example
11096 /// ```ignore,no_run
11097 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11098 /// let x = DatabaseInstance::new().set_ipv6_address("example");
11099 /// ```
11100 #[deprecated]
11101 pub fn set_ipv6_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11102 self.ipv6_address = v.into();
11103 self
11104 }
11105
11106 /// Sets the value of [service_account_email_address][crate::model::DatabaseInstance::service_account_email_address].
11107 ///
11108 /// # Example
11109 /// ```ignore,no_run
11110 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11111 /// let x = DatabaseInstance::new().set_service_account_email_address("example");
11112 /// ```
11113 pub fn set_service_account_email_address<T: std::convert::Into<std::string::String>>(
11114 mut self,
11115 v: T,
11116 ) -> Self {
11117 self.service_account_email_address = v.into();
11118 self
11119 }
11120
11121 /// Sets the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11122 ///
11123 /// # Example
11124 /// ```ignore,no_run
11125 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11126 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11127 /// let x = DatabaseInstance::new().set_on_premises_configuration(OnPremisesConfiguration::default()/* use setters */);
11128 /// ```
11129 pub fn set_on_premises_configuration<T>(mut self, v: T) -> Self
11130 where
11131 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11132 {
11133 self.on_premises_configuration = std::option::Option::Some(v.into());
11134 self
11135 }
11136
11137 /// Sets or clears the value of [on_premises_configuration][crate::model::DatabaseInstance::on_premises_configuration].
11138 ///
11139 /// # Example
11140 /// ```ignore,no_run
11141 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11142 /// use google_cloud_sql_v1::model::OnPremisesConfiguration;
11143 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(Some(OnPremisesConfiguration::default()/* use setters */));
11144 /// let x = DatabaseInstance::new().set_or_clear_on_premises_configuration(None::<OnPremisesConfiguration>);
11145 /// ```
11146 pub fn set_or_clear_on_premises_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11147 where
11148 T: std::convert::Into<crate::model::OnPremisesConfiguration>,
11149 {
11150 self.on_premises_configuration = v.map(|x| x.into());
11151 self
11152 }
11153
11154 /// Sets the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11155 ///
11156 /// # Example
11157 /// ```ignore,no_run
11158 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11159 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11160 /// let x = DatabaseInstance::new().set_replica_configuration(ReplicaConfiguration::default()/* use setters */);
11161 /// ```
11162 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
11163 where
11164 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11165 {
11166 self.replica_configuration = std::option::Option::Some(v.into());
11167 self
11168 }
11169
11170 /// Sets or clears the value of [replica_configuration][crate::model::DatabaseInstance::replica_configuration].
11171 ///
11172 /// # Example
11173 /// ```ignore,no_run
11174 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11175 /// use google_cloud_sql_v1::model::ReplicaConfiguration;
11176 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(Some(ReplicaConfiguration::default()/* use setters */));
11177 /// let x = DatabaseInstance::new().set_or_clear_replica_configuration(None::<ReplicaConfiguration>);
11178 /// ```
11179 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
11180 where
11181 T: std::convert::Into<crate::model::ReplicaConfiguration>,
11182 {
11183 self.replica_configuration = v.map(|x| x.into());
11184 self
11185 }
11186
11187 /// Sets the value of [backend_type][crate::model::DatabaseInstance::backend_type].
11188 ///
11189 /// # Example
11190 /// ```ignore,no_run
11191 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11192 /// use google_cloud_sql_v1::model::SqlBackendType;
11193 /// let x0 = DatabaseInstance::new().set_backend_type(SqlBackendType::SecondGen);
11194 /// let x1 = DatabaseInstance::new().set_backend_type(SqlBackendType::External);
11195 /// ```
11196 pub fn set_backend_type<T: std::convert::Into<crate::model::SqlBackendType>>(
11197 mut self,
11198 v: T,
11199 ) -> Self {
11200 self.backend_type = v.into();
11201 self
11202 }
11203
11204 /// Sets the value of [self_link][crate::model::DatabaseInstance::self_link].
11205 ///
11206 /// # Example
11207 /// ```ignore,no_run
11208 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11209 /// let x = DatabaseInstance::new().set_self_link("example");
11210 /// ```
11211 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11212 self.self_link = v.into();
11213 self
11214 }
11215
11216 /// Sets the value of [suspension_reason][crate::model::DatabaseInstance::suspension_reason].
11217 ///
11218 /// # Example
11219 /// ```ignore,no_run
11220 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11221 /// use google_cloud_sql_v1::model::SqlSuspensionReason;
11222 /// let x = DatabaseInstance::new().set_suspension_reason([
11223 /// SqlSuspensionReason::BillingIssue,
11224 /// SqlSuspensionReason::LegalIssue,
11225 /// SqlSuspensionReason::OperationalIssue,
11226 /// ]);
11227 /// ```
11228 pub fn set_suspension_reason<T, V>(mut self, v: T) -> Self
11229 where
11230 T: std::iter::IntoIterator<Item = V>,
11231 V: std::convert::Into<crate::model::SqlSuspensionReason>,
11232 {
11233 use std::iter::Iterator;
11234 self.suspension_reason = v.into_iter().map(|i| i.into()).collect();
11235 self
11236 }
11237
11238 /// Sets the value of [connection_name][crate::model::DatabaseInstance::connection_name].
11239 ///
11240 /// # Example
11241 /// ```ignore,no_run
11242 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11243 /// let x = DatabaseInstance::new().set_connection_name("example");
11244 /// ```
11245 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11246 self.connection_name = v.into();
11247 self
11248 }
11249
11250 /// Sets the value of [name][crate::model::DatabaseInstance::name].
11251 ///
11252 /// # Example
11253 /// ```ignore,no_run
11254 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11255 /// let x = DatabaseInstance::new().set_name("example");
11256 /// ```
11257 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11258 self.name = v.into();
11259 self
11260 }
11261
11262 /// Sets the value of [region][crate::model::DatabaseInstance::region].
11263 ///
11264 /// # Example
11265 /// ```ignore,no_run
11266 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11267 /// let x = DatabaseInstance::new().set_region("example");
11268 /// ```
11269 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11270 self.region = v.into();
11271 self
11272 }
11273
11274 /// Sets the value of [gce_zone][crate::model::DatabaseInstance::gce_zone].
11275 ///
11276 /// # Example
11277 /// ```ignore,no_run
11278 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11279 /// let x = DatabaseInstance::new().set_gce_zone("example");
11280 /// ```
11281 pub fn set_gce_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11282 self.gce_zone = v.into();
11283 self
11284 }
11285
11286 /// Sets the value of [secondary_gce_zone][crate::model::DatabaseInstance::secondary_gce_zone].
11287 ///
11288 /// # Example
11289 /// ```ignore,no_run
11290 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11291 /// let x = DatabaseInstance::new().set_secondary_gce_zone("example");
11292 /// ```
11293 pub fn set_secondary_gce_zone<T: std::convert::Into<std::string::String>>(
11294 mut self,
11295 v: T,
11296 ) -> Self {
11297 self.secondary_gce_zone = v.into();
11298 self
11299 }
11300
11301 /// Sets the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11302 ///
11303 /// # Example
11304 /// ```ignore,no_run
11305 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11306 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11307 /// let x = DatabaseInstance::new().set_disk_encryption_configuration(DiskEncryptionConfiguration::default()/* use setters */);
11308 /// ```
11309 pub fn set_disk_encryption_configuration<T>(mut self, v: T) -> Self
11310 where
11311 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11312 {
11313 self.disk_encryption_configuration = std::option::Option::Some(v.into());
11314 self
11315 }
11316
11317 /// Sets or clears the value of [disk_encryption_configuration][crate::model::DatabaseInstance::disk_encryption_configuration].
11318 ///
11319 /// # Example
11320 /// ```ignore,no_run
11321 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11322 /// use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
11323 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(Some(DiskEncryptionConfiguration::default()/* use setters */));
11324 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_configuration(None::<DiskEncryptionConfiguration>);
11325 /// ```
11326 pub fn set_or_clear_disk_encryption_configuration<T>(
11327 mut self,
11328 v: std::option::Option<T>,
11329 ) -> Self
11330 where
11331 T: std::convert::Into<crate::model::DiskEncryptionConfiguration>,
11332 {
11333 self.disk_encryption_configuration = v.map(|x| x.into());
11334 self
11335 }
11336
11337 /// Sets the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11338 ///
11339 /// # Example
11340 /// ```ignore,no_run
11341 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11342 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11343 /// let x = DatabaseInstance::new().set_disk_encryption_status(DiskEncryptionStatus::default()/* use setters */);
11344 /// ```
11345 pub fn set_disk_encryption_status<T>(mut self, v: T) -> Self
11346 where
11347 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11348 {
11349 self.disk_encryption_status = std::option::Option::Some(v.into());
11350 self
11351 }
11352
11353 /// Sets or clears the value of [disk_encryption_status][crate::model::DatabaseInstance::disk_encryption_status].
11354 ///
11355 /// # Example
11356 /// ```ignore,no_run
11357 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11358 /// use google_cloud_sql_v1::model::DiskEncryptionStatus;
11359 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(Some(DiskEncryptionStatus::default()/* use setters */));
11360 /// let x = DatabaseInstance::new().set_or_clear_disk_encryption_status(None::<DiskEncryptionStatus>);
11361 /// ```
11362 pub fn set_or_clear_disk_encryption_status<T>(mut self, v: std::option::Option<T>) -> Self
11363 where
11364 T: std::convert::Into<crate::model::DiskEncryptionStatus>,
11365 {
11366 self.disk_encryption_status = v.map(|x| x.into());
11367 self
11368 }
11369
11370 /// Sets the value of [root_password][crate::model::DatabaseInstance::root_password].
11371 ///
11372 /// # Example
11373 /// ```ignore,no_run
11374 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11375 /// let x = DatabaseInstance::new().set_root_password("example");
11376 /// ```
11377 pub fn set_root_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11378 self.root_password = v.into();
11379 self
11380 }
11381
11382 /// Sets the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11383 ///
11384 /// # Example
11385 /// ```ignore,no_run
11386 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11387 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11388 /// let x = DatabaseInstance::new().set_scheduled_maintenance(SqlScheduledMaintenance::default()/* use setters */);
11389 /// ```
11390 pub fn set_scheduled_maintenance<T>(mut self, v: T) -> Self
11391 where
11392 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11393 {
11394 self.scheduled_maintenance = std::option::Option::Some(v.into());
11395 self
11396 }
11397
11398 /// Sets or clears the value of [scheduled_maintenance][crate::model::DatabaseInstance::scheduled_maintenance].
11399 ///
11400 /// # Example
11401 /// ```ignore,no_run
11402 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11403 /// use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
11404 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(Some(SqlScheduledMaintenance::default()/* use setters */));
11405 /// let x = DatabaseInstance::new().set_or_clear_scheduled_maintenance(None::<SqlScheduledMaintenance>);
11406 /// ```
11407 pub fn set_or_clear_scheduled_maintenance<T>(mut self, v: std::option::Option<T>) -> Self
11408 where
11409 T: std::convert::Into<crate::model::database_instance::SqlScheduledMaintenance>,
11410 {
11411 self.scheduled_maintenance = v.map(|x| x.into());
11412 self
11413 }
11414
11415 /// Sets the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11416 ///
11417 /// # Example
11418 /// ```ignore,no_run
11419 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11420 /// use wkt::BoolValue;
11421 /// let x = DatabaseInstance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
11422 /// ```
11423 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
11424 where
11425 T: std::convert::Into<wkt::BoolValue>,
11426 {
11427 self.satisfies_pzs = std::option::Option::Some(v.into());
11428 self
11429 }
11430
11431 /// Sets or clears the value of [satisfies_pzs][crate::model::DatabaseInstance::satisfies_pzs].
11432 ///
11433 /// # Example
11434 /// ```ignore,no_run
11435 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11436 /// use wkt::BoolValue;
11437 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
11438 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
11439 /// ```
11440 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
11441 where
11442 T: std::convert::Into<wkt::BoolValue>,
11443 {
11444 self.satisfies_pzs = v.map(|x| x.into());
11445 self
11446 }
11447
11448 /// Sets the value of [database_installed_version][crate::model::DatabaseInstance::database_installed_version].
11449 ///
11450 /// # Example
11451 /// ```ignore,no_run
11452 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11453 /// let x = DatabaseInstance::new().set_database_installed_version("example");
11454 /// ```
11455 pub fn set_database_installed_version<T: std::convert::Into<std::string::String>>(
11456 mut self,
11457 v: T,
11458 ) -> Self {
11459 self.database_installed_version = v.into();
11460 self
11461 }
11462
11463 /// Sets the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11464 ///
11465 /// # Example
11466 /// ```ignore,no_run
11467 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11468 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11469 /// let x = DatabaseInstance::new().set_out_of_disk_report(SqlOutOfDiskReport::default()/* use setters */);
11470 /// ```
11471 pub fn set_out_of_disk_report<T>(mut self, v: T) -> Self
11472 where
11473 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11474 {
11475 self.out_of_disk_report = std::option::Option::Some(v.into());
11476 self
11477 }
11478
11479 /// Sets or clears the value of [out_of_disk_report][crate::model::DatabaseInstance::out_of_disk_report].
11480 ///
11481 /// # Example
11482 /// ```ignore,no_run
11483 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11484 /// use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
11485 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(Some(SqlOutOfDiskReport::default()/* use setters */));
11486 /// let x = DatabaseInstance::new().set_or_clear_out_of_disk_report(None::<SqlOutOfDiskReport>);
11487 /// ```
11488 pub fn set_or_clear_out_of_disk_report<T>(mut self, v: std::option::Option<T>) -> Self
11489 where
11490 T: std::convert::Into<crate::model::database_instance::SqlOutOfDiskReport>,
11491 {
11492 self.out_of_disk_report = v.map(|x| x.into());
11493 self
11494 }
11495
11496 /// Sets the value of [create_time][crate::model::DatabaseInstance::create_time].
11497 ///
11498 /// # Example
11499 /// ```ignore,no_run
11500 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11501 /// use wkt::Timestamp;
11502 /// let x = DatabaseInstance::new().set_create_time(Timestamp::default()/* use setters */);
11503 /// ```
11504 pub fn set_create_time<T>(mut self, v: T) -> Self
11505 where
11506 T: std::convert::Into<wkt::Timestamp>,
11507 {
11508 self.create_time = std::option::Option::Some(v.into());
11509 self
11510 }
11511
11512 /// Sets or clears the value of [create_time][crate::model::DatabaseInstance::create_time].
11513 ///
11514 /// # Example
11515 /// ```ignore,no_run
11516 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11517 /// use wkt::Timestamp;
11518 /// let x = DatabaseInstance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11519 /// let x = DatabaseInstance::new().set_or_clear_create_time(None::<Timestamp>);
11520 /// ```
11521 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11522 where
11523 T: std::convert::Into<wkt::Timestamp>,
11524 {
11525 self.create_time = v.map(|x| x.into());
11526 self
11527 }
11528
11529 /// Sets the value of [available_maintenance_versions][crate::model::DatabaseInstance::available_maintenance_versions].
11530 ///
11531 /// # Example
11532 /// ```ignore,no_run
11533 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11534 /// let x = DatabaseInstance::new().set_available_maintenance_versions(["a", "b", "c"]);
11535 /// ```
11536 pub fn set_available_maintenance_versions<T, V>(mut self, v: T) -> Self
11537 where
11538 T: std::iter::IntoIterator<Item = V>,
11539 V: std::convert::Into<std::string::String>,
11540 {
11541 use std::iter::Iterator;
11542 self.available_maintenance_versions = v.into_iter().map(|i| i.into()).collect();
11543 self
11544 }
11545
11546 /// Sets the value of [maintenance_version][crate::model::DatabaseInstance::maintenance_version].
11547 ///
11548 /// # Example
11549 /// ```ignore,no_run
11550 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11551 /// let x = DatabaseInstance::new().set_maintenance_version("example");
11552 /// ```
11553 pub fn set_maintenance_version<T: std::convert::Into<std::string::String>>(
11554 mut self,
11555 v: T,
11556 ) -> Self {
11557 self.maintenance_version = v.into();
11558 self
11559 }
11560
11561 /// Sets the value of [upgradable_database_versions][crate::model::DatabaseInstance::upgradable_database_versions].
11562 ///
11563 /// # Example
11564 /// ```ignore,no_run
11565 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11566 /// use google_cloud_sql_v1::model::AvailableDatabaseVersion;
11567 /// let x = DatabaseInstance::new()
11568 /// .set_upgradable_database_versions([
11569 /// AvailableDatabaseVersion::default()/* use setters */,
11570 /// AvailableDatabaseVersion::default()/* use (different) setters */,
11571 /// ]);
11572 /// ```
11573 pub fn set_upgradable_database_versions<T, V>(mut self, v: T) -> Self
11574 where
11575 T: std::iter::IntoIterator<Item = V>,
11576 V: std::convert::Into<crate::model::AvailableDatabaseVersion>,
11577 {
11578 use std::iter::Iterator;
11579 self.upgradable_database_versions = v.into_iter().map(|i| i.into()).collect();
11580 self
11581 }
11582
11583 /// Sets the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11584 ///
11585 /// # Example
11586 /// ```ignore,no_run
11587 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11588 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11589 /// let x0 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::NewNetworkArchitecture);
11590 /// let x1 = DatabaseInstance::new().set_sql_network_architecture(SqlNetworkArchitecture::OldNetworkArchitecture);
11591 /// ```
11592 pub fn set_sql_network_architecture<T>(mut self, v: T) -> Self
11593 where
11594 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11595 {
11596 self.sql_network_architecture = std::option::Option::Some(v.into());
11597 self
11598 }
11599
11600 /// Sets or clears the value of [sql_network_architecture][crate::model::DatabaseInstance::sql_network_architecture].
11601 ///
11602 /// # Example
11603 /// ```ignore,no_run
11604 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11605 /// use google_cloud_sql_v1::model::database_instance::SqlNetworkArchitecture;
11606 /// let x0 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::NewNetworkArchitecture));
11607 /// let x1 = DatabaseInstance::new().set_or_clear_sql_network_architecture(Some(SqlNetworkArchitecture::OldNetworkArchitecture));
11608 /// let x_none = DatabaseInstance::new().set_or_clear_sql_network_architecture(None::<SqlNetworkArchitecture>);
11609 /// ```
11610 pub fn set_or_clear_sql_network_architecture<T>(mut self, v: std::option::Option<T>) -> Self
11611 where
11612 T: std::convert::Into<crate::model::database_instance::SqlNetworkArchitecture>,
11613 {
11614 self.sql_network_architecture = v.map(|x| x.into());
11615 self
11616 }
11617
11618 /// Sets the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11619 ///
11620 /// # Example
11621 /// ```ignore,no_run
11622 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11623 /// let x = DatabaseInstance::new().set_psc_service_attachment_link("example");
11624 /// ```
11625 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
11626 where
11627 T: std::convert::Into<std::string::String>,
11628 {
11629 self.psc_service_attachment_link = std::option::Option::Some(v.into());
11630 self
11631 }
11632
11633 /// Sets or clears the value of [psc_service_attachment_link][crate::model::DatabaseInstance::psc_service_attachment_link].
11634 ///
11635 /// # Example
11636 /// ```ignore,no_run
11637 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11638 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(Some("example"));
11639 /// let x = DatabaseInstance::new().set_or_clear_psc_service_attachment_link(None::<String>);
11640 /// ```
11641 pub fn set_or_clear_psc_service_attachment_link<T>(mut self, v: std::option::Option<T>) -> Self
11642 where
11643 T: std::convert::Into<std::string::String>,
11644 {
11645 self.psc_service_attachment_link = v.map(|x| x.into());
11646 self
11647 }
11648
11649 /// Sets the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11650 ///
11651 /// # Example
11652 /// ```ignore,no_run
11653 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11654 /// let x = DatabaseInstance::new().set_dns_name("example");
11655 /// ```
11656 pub fn set_dns_name<T>(mut self, v: T) -> Self
11657 where
11658 T: std::convert::Into<std::string::String>,
11659 {
11660 self.dns_name = std::option::Option::Some(v.into());
11661 self
11662 }
11663
11664 /// Sets or clears the value of [dns_name][crate::model::DatabaseInstance::dns_name].
11665 ///
11666 /// # Example
11667 /// ```ignore,no_run
11668 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11669 /// let x = DatabaseInstance::new().set_or_clear_dns_name(Some("example"));
11670 /// let x = DatabaseInstance::new().set_or_clear_dns_name(None::<String>);
11671 /// ```
11672 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11673 where
11674 T: std::convert::Into<std::string::String>,
11675 {
11676 self.dns_name = v.map(|x| x.into());
11677 self
11678 }
11679
11680 /// Sets the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11681 ///
11682 /// # Example
11683 /// ```ignore,no_run
11684 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11685 /// let x = DatabaseInstance::new().set_primary_dns_name("example");
11686 /// ```
11687 #[deprecated]
11688 pub fn set_primary_dns_name<T>(mut self, v: T) -> Self
11689 where
11690 T: std::convert::Into<std::string::String>,
11691 {
11692 self.primary_dns_name = std::option::Option::Some(v.into());
11693 self
11694 }
11695
11696 /// Sets or clears the value of [primary_dns_name][crate::model::DatabaseInstance::primary_dns_name].
11697 ///
11698 /// # Example
11699 /// ```ignore,no_run
11700 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11701 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(Some("example"));
11702 /// let x = DatabaseInstance::new().set_or_clear_primary_dns_name(None::<String>);
11703 /// ```
11704 #[deprecated]
11705 pub fn set_or_clear_primary_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
11706 where
11707 T: std::convert::Into<std::string::String>,
11708 {
11709 self.primary_dns_name = v.map(|x| x.into());
11710 self
11711 }
11712
11713 /// Sets the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11714 ///
11715 /// # Example
11716 /// ```ignore,no_run
11717 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11718 /// let x = DatabaseInstance::new().set_write_endpoint("example");
11719 /// ```
11720 pub fn set_write_endpoint<T>(mut self, v: T) -> Self
11721 where
11722 T: std::convert::Into<std::string::String>,
11723 {
11724 self.write_endpoint = std::option::Option::Some(v.into());
11725 self
11726 }
11727
11728 /// Sets or clears the value of [write_endpoint][crate::model::DatabaseInstance::write_endpoint].
11729 ///
11730 /// # Example
11731 /// ```ignore,no_run
11732 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11733 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(Some("example"));
11734 /// let x = DatabaseInstance::new().set_or_clear_write_endpoint(None::<String>);
11735 /// ```
11736 pub fn set_or_clear_write_endpoint<T>(mut self, v: std::option::Option<T>) -> Self
11737 where
11738 T: std::convert::Into<std::string::String>,
11739 {
11740 self.write_endpoint = v.map(|x| x.into());
11741 self
11742 }
11743
11744 /// Sets the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11745 ///
11746 /// # Example
11747 /// ```ignore,no_run
11748 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11749 /// use google_cloud_sql_v1::model::ReplicationCluster;
11750 /// let x = DatabaseInstance::new().set_replication_cluster(ReplicationCluster::default()/* use setters */);
11751 /// ```
11752 pub fn set_replication_cluster<T>(mut self, v: T) -> Self
11753 where
11754 T: std::convert::Into<crate::model::ReplicationCluster>,
11755 {
11756 self.replication_cluster = std::option::Option::Some(v.into());
11757 self
11758 }
11759
11760 /// Sets or clears the value of [replication_cluster][crate::model::DatabaseInstance::replication_cluster].
11761 ///
11762 /// # Example
11763 /// ```ignore,no_run
11764 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11765 /// use google_cloud_sql_v1::model::ReplicationCluster;
11766 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(Some(ReplicationCluster::default()/* use setters */));
11767 /// let x = DatabaseInstance::new().set_or_clear_replication_cluster(None::<ReplicationCluster>);
11768 /// ```
11769 pub fn set_or_clear_replication_cluster<T>(mut self, v: std::option::Option<T>) -> Self
11770 where
11771 T: std::convert::Into<crate::model::ReplicationCluster>,
11772 {
11773 self.replication_cluster = v.map(|x| x.into());
11774 self
11775 }
11776
11777 /// Sets the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11778 ///
11779 /// # Example
11780 /// ```ignore,no_run
11781 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11782 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11783 /// let x = DatabaseInstance::new().set_gemini_config(GeminiInstanceConfig::default()/* use setters */);
11784 /// ```
11785 pub fn set_gemini_config<T>(mut self, v: T) -> Self
11786 where
11787 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11788 {
11789 self.gemini_config = std::option::Option::Some(v.into());
11790 self
11791 }
11792
11793 /// Sets or clears the value of [gemini_config][crate::model::DatabaseInstance::gemini_config].
11794 ///
11795 /// # Example
11796 /// ```ignore,no_run
11797 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11798 /// use google_cloud_sql_v1::model::GeminiInstanceConfig;
11799 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(Some(GeminiInstanceConfig::default()/* use setters */));
11800 /// let x = DatabaseInstance::new().set_or_clear_gemini_config(None::<GeminiInstanceConfig>);
11801 /// ```
11802 pub fn set_or_clear_gemini_config<T>(mut self, v: std::option::Option<T>) -> Self
11803 where
11804 T: std::convert::Into<crate::model::GeminiInstanceConfig>,
11805 {
11806 self.gemini_config = v.map(|x| x.into());
11807 self
11808 }
11809
11810 /// Sets the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11811 ///
11812 /// # Example
11813 /// ```ignore,no_run
11814 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11815 /// use wkt::BoolValue;
11816 /// let x = DatabaseInstance::new().set_satisfies_pzi(BoolValue::default()/* use setters */);
11817 /// ```
11818 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
11819 where
11820 T: std::convert::Into<wkt::BoolValue>,
11821 {
11822 self.satisfies_pzi = std::option::Option::Some(v.into());
11823 self
11824 }
11825
11826 /// Sets or clears the value of [satisfies_pzi][crate::model::DatabaseInstance::satisfies_pzi].
11827 ///
11828 /// # Example
11829 /// ```ignore,no_run
11830 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11831 /// use wkt::BoolValue;
11832 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(Some(BoolValue::default()/* use setters */));
11833 /// let x = DatabaseInstance::new().set_or_clear_satisfies_pzi(None::<BoolValue>);
11834 /// ```
11835 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
11836 where
11837 T: std::convert::Into<wkt::BoolValue>,
11838 {
11839 self.satisfies_pzi = v.map(|x| x.into());
11840 self
11841 }
11842
11843 /// Sets the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11844 ///
11845 /// # Example
11846 /// ```ignore,no_run
11847 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11848 /// use wkt::BoolValue;
11849 /// let x = DatabaseInstance::new().set_switch_transaction_logs_to_cloud_storage_enabled(BoolValue::default()/* use setters */);
11850 /// ```
11851 pub fn set_switch_transaction_logs_to_cloud_storage_enabled<T>(mut self, v: T) -> Self
11852 where
11853 T: std::convert::Into<wkt::BoolValue>,
11854 {
11855 self.switch_transaction_logs_to_cloud_storage_enabled = std::option::Option::Some(v.into());
11856 self
11857 }
11858
11859 /// Sets or clears the value of [switch_transaction_logs_to_cloud_storage_enabled][crate::model::DatabaseInstance::switch_transaction_logs_to_cloud_storage_enabled].
11860 ///
11861 /// # Example
11862 /// ```ignore,no_run
11863 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11864 /// use wkt::BoolValue;
11865 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(Some(BoolValue::default()/* use setters */));
11866 /// let x = DatabaseInstance::new().set_or_clear_switch_transaction_logs_to_cloud_storage_enabled(None::<BoolValue>);
11867 /// ```
11868 pub fn set_or_clear_switch_transaction_logs_to_cloud_storage_enabled<T>(
11869 mut self,
11870 v: std::option::Option<T>,
11871 ) -> Self
11872 where
11873 T: std::convert::Into<wkt::BoolValue>,
11874 {
11875 self.switch_transaction_logs_to_cloud_storage_enabled = v.map(|x| x.into());
11876 self
11877 }
11878
11879 /// Sets the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
11880 ///
11881 /// # Example
11882 /// ```ignore,no_run
11883 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11884 /// use wkt::BoolValue;
11885 /// let x = DatabaseInstance::new().set_include_replicas_for_major_version_upgrade(BoolValue::default()/* use setters */);
11886 /// ```
11887 pub fn set_include_replicas_for_major_version_upgrade<T>(mut self, v: T) -> Self
11888 where
11889 T: std::convert::Into<wkt::BoolValue>,
11890 {
11891 self.include_replicas_for_major_version_upgrade = std::option::Option::Some(v.into());
11892 self
11893 }
11894
11895 /// Sets or clears the value of [include_replicas_for_major_version_upgrade][crate::model::DatabaseInstance::include_replicas_for_major_version_upgrade].
11896 ///
11897 /// # Example
11898 /// ```ignore,no_run
11899 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11900 /// use wkt::BoolValue;
11901 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(Some(BoolValue::default()/* use setters */));
11902 /// let x = DatabaseInstance::new().set_or_clear_include_replicas_for_major_version_upgrade(None::<BoolValue>);
11903 /// ```
11904 pub fn set_or_clear_include_replicas_for_major_version_upgrade<T>(
11905 mut self,
11906 v: std::option::Option<T>,
11907 ) -> Self
11908 where
11909 T: std::convert::Into<wkt::BoolValue>,
11910 {
11911 self.include_replicas_for_major_version_upgrade = v.map(|x| x.into());
11912 self
11913 }
11914
11915 /// Sets the value of [tags][crate::model::DatabaseInstance::tags].
11916 ///
11917 /// # Example
11918 /// ```ignore,no_run
11919 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11920 /// let x = DatabaseInstance::new().set_tags([
11921 /// ("key0", "abc"),
11922 /// ("key1", "xyz"),
11923 /// ]);
11924 /// ```
11925 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
11926 where
11927 T: std::iter::IntoIterator<Item = (K, V)>,
11928 K: std::convert::Into<std::string::String>,
11929 V: std::convert::Into<std::string::String>,
11930 {
11931 use std::iter::Iterator;
11932 self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11933 self
11934 }
11935
11936 /// Sets the value of [node_count][crate::model::DatabaseInstance::node_count].
11937 ///
11938 /// # Example
11939 /// ```ignore,no_run
11940 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11941 /// let x = DatabaseInstance::new().set_node_count(42);
11942 /// ```
11943 pub fn set_node_count<T>(mut self, v: T) -> Self
11944 where
11945 T: std::convert::Into<i32>,
11946 {
11947 self.node_count = std::option::Option::Some(v.into());
11948 self
11949 }
11950
11951 /// Sets or clears the value of [node_count][crate::model::DatabaseInstance::node_count].
11952 ///
11953 /// # Example
11954 /// ```ignore,no_run
11955 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11956 /// let x = DatabaseInstance::new().set_or_clear_node_count(Some(42));
11957 /// let x = DatabaseInstance::new().set_or_clear_node_count(None::<i32>);
11958 /// ```
11959 pub fn set_or_clear_node_count<T>(mut self, v: std::option::Option<T>) -> Self
11960 where
11961 T: std::convert::Into<i32>,
11962 {
11963 self.node_count = v.map(|x| x.into());
11964 self
11965 }
11966
11967 /// Sets the value of [nodes][crate::model::DatabaseInstance::nodes].
11968 ///
11969 /// # Example
11970 /// ```ignore,no_run
11971 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11972 /// use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
11973 /// let x = DatabaseInstance::new()
11974 /// .set_nodes([
11975 /// PoolNodeConfig::default()/* use setters */,
11976 /// PoolNodeConfig::default()/* use (different) setters */,
11977 /// ]);
11978 /// ```
11979 pub fn set_nodes<T, V>(mut self, v: T) -> Self
11980 where
11981 T: std::iter::IntoIterator<Item = V>,
11982 V: std::convert::Into<crate::model::database_instance::PoolNodeConfig>,
11983 {
11984 use std::iter::Iterator;
11985 self.nodes = v.into_iter().map(|i| i.into()).collect();
11986 self
11987 }
11988
11989 /// Sets the value of [dns_names][crate::model::DatabaseInstance::dns_names].
11990 ///
11991 /// # Example
11992 /// ```ignore,no_run
11993 /// # use google_cloud_sql_v1::model::DatabaseInstance;
11994 /// use google_cloud_sql_v1::model::DnsNameMapping;
11995 /// let x = DatabaseInstance::new()
11996 /// .set_dns_names([
11997 /// DnsNameMapping::default()/* use setters */,
11998 /// DnsNameMapping::default()/* use (different) setters */,
11999 /// ]);
12000 /// ```
12001 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12002 where
12003 T: std::iter::IntoIterator<Item = V>,
12004 V: std::convert::Into<crate::model::DnsNameMapping>,
12005 {
12006 use std::iter::Iterator;
12007 self.dns_names = v.into_iter().map(|i| i.into()).collect();
12008 self
12009 }
12010}
12011
12012impl wkt::message::Message for DatabaseInstance {
12013 fn typename() -> &'static str {
12014 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance"
12015 }
12016}
12017
12018/// Defines additional types related to [DatabaseInstance].
12019pub mod database_instance {
12020 #[allow(unused_imports)]
12021 use super::*;
12022
12023 #[derive(Clone, Default, PartialEq)]
12024 #[non_exhaustive]
12025 pub struct SqlFailoverReplica {
12026 /// The name of the failover replica. If specified at instance creation, a
12027 /// failover replica is created for the instance. The name
12028 /// doesn't include the project ID.
12029 pub name: std::string::String,
12030
12031 /// The availability status of the failover replica. A false status indicates
12032 /// that the failover replica is out of sync. The primary instance can only
12033 /// failover to the failover replica when the status is true.
12034 pub available: std::option::Option<wkt::BoolValue>,
12035
12036 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12037 }
12038
12039 impl SqlFailoverReplica {
12040 pub fn new() -> Self {
12041 std::default::Default::default()
12042 }
12043
12044 /// Sets the value of [name][crate::model::database_instance::SqlFailoverReplica::name].
12045 ///
12046 /// # Example
12047 /// ```ignore,no_run
12048 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12049 /// let x = SqlFailoverReplica::new().set_name("example");
12050 /// ```
12051 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12052 self.name = v.into();
12053 self
12054 }
12055
12056 /// Sets the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12057 ///
12058 /// # Example
12059 /// ```ignore,no_run
12060 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12061 /// use wkt::BoolValue;
12062 /// let x = SqlFailoverReplica::new().set_available(BoolValue::default()/* use setters */);
12063 /// ```
12064 pub fn set_available<T>(mut self, v: T) -> Self
12065 where
12066 T: std::convert::Into<wkt::BoolValue>,
12067 {
12068 self.available = std::option::Option::Some(v.into());
12069 self
12070 }
12071
12072 /// Sets or clears the value of [available][crate::model::database_instance::SqlFailoverReplica::available].
12073 ///
12074 /// # Example
12075 /// ```ignore,no_run
12076 /// # use google_cloud_sql_v1::model::database_instance::SqlFailoverReplica;
12077 /// use wkt::BoolValue;
12078 /// let x = SqlFailoverReplica::new().set_or_clear_available(Some(BoolValue::default()/* use setters */));
12079 /// let x = SqlFailoverReplica::new().set_or_clear_available(None::<BoolValue>);
12080 /// ```
12081 pub fn set_or_clear_available<T>(mut self, v: std::option::Option<T>) -> Self
12082 where
12083 T: std::convert::Into<wkt::BoolValue>,
12084 {
12085 self.available = v.map(|x| x.into());
12086 self
12087 }
12088 }
12089
12090 impl wkt::message::Message for SqlFailoverReplica {
12091 fn typename() -> &'static str {
12092 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica"
12093 }
12094 }
12095
12096 /// Any scheduled maintenance for this instance.
12097 #[derive(Clone, Default, PartialEq)]
12098 #[non_exhaustive]
12099 pub struct SqlScheduledMaintenance {
12100 /// The start time of any upcoming scheduled maintenance for this instance.
12101 pub start_time: std::option::Option<wkt::Timestamp>,
12102
12103 #[deprecated]
12104 pub can_defer: bool,
12105
12106 /// If the scheduled maintenance can be rescheduled.
12107 pub can_reschedule: bool,
12108
12109 /// Maintenance cannot be rescheduled to start beyond this deadline.
12110 pub schedule_deadline_time: std::option::Option<wkt::Timestamp>,
12111
12112 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12113 }
12114
12115 impl SqlScheduledMaintenance {
12116 pub fn new() -> Self {
12117 std::default::Default::default()
12118 }
12119
12120 /// Sets the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12121 ///
12122 /// # Example
12123 /// ```ignore,no_run
12124 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12125 /// use wkt::Timestamp;
12126 /// let x = SqlScheduledMaintenance::new().set_start_time(Timestamp::default()/* use setters */);
12127 /// ```
12128 pub fn set_start_time<T>(mut self, v: T) -> Self
12129 where
12130 T: std::convert::Into<wkt::Timestamp>,
12131 {
12132 self.start_time = std::option::Option::Some(v.into());
12133 self
12134 }
12135
12136 /// Sets or clears the value of [start_time][crate::model::database_instance::SqlScheduledMaintenance::start_time].
12137 ///
12138 /// # Example
12139 /// ```ignore,no_run
12140 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12141 /// use wkt::Timestamp;
12142 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
12143 /// let x = SqlScheduledMaintenance::new().set_or_clear_start_time(None::<Timestamp>);
12144 /// ```
12145 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
12146 where
12147 T: std::convert::Into<wkt::Timestamp>,
12148 {
12149 self.start_time = v.map(|x| x.into());
12150 self
12151 }
12152
12153 /// Sets the value of [can_defer][crate::model::database_instance::SqlScheduledMaintenance::can_defer].
12154 ///
12155 /// # Example
12156 /// ```ignore,no_run
12157 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12158 /// let x = SqlScheduledMaintenance::new().set_can_defer(true);
12159 /// ```
12160 #[deprecated]
12161 pub fn set_can_defer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12162 self.can_defer = v.into();
12163 self
12164 }
12165
12166 /// Sets the value of [can_reschedule][crate::model::database_instance::SqlScheduledMaintenance::can_reschedule].
12167 ///
12168 /// # Example
12169 /// ```ignore,no_run
12170 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12171 /// let x = SqlScheduledMaintenance::new().set_can_reschedule(true);
12172 /// ```
12173 pub fn set_can_reschedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12174 self.can_reschedule = v.into();
12175 self
12176 }
12177
12178 /// Sets the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12179 ///
12180 /// # Example
12181 /// ```ignore,no_run
12182 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12183 /// use wkt::Timestamp;
12184 /// let x = SqlScheduledMaintenance::new().set_schedule_deadline_time(Timestamp::default()/* use setters */);
12185 /// ```
12186 pub fn set_schedule_deadline_time<T>(mut self, v: T) -> Self
12187 where
12188 T: std::convert::Into<wkt::Timestamp>,
12189 {
12190 self.schedule_deadline_time = std::option::Option::Some(v.into());
12191 self
12192 }
12193
12194 /// Sets or clears the value of [schedule_deadline_time][crate::model::database_instance::SqlScheduledMaintenance::schedule_deadline_time].
12195 ///
12196 /// # Example
12197 /// ```ignore,no_run
12198 /// # use google_cloud_sql_v1::model::database_instance::SqlScheduledMaintenance;
12199 /// use wkt::Timestamp;
12200 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(Some(Timestamp::default()/* use setters */));
12201 /// let x = SqlScheduledMaintenance::new().set_or_clear_schedule_deadline_time(None::<Timestamp>);
12202 /// ```
12203 pub fn set_or_clear_schedule_deadline_time<T>(mut self, v: std::option::Option<T>) -> Self
12204 where
12205 T: std::convert::Into<wkt::Timestamp>,
12206 {
12207 self.schedule_deadline_time = v.map(|x| x.into());
12208 self
12209 }
12210 }
12211
12212 impl wkt::message::Message for SqlScheduledMaintenance {
12213 fn typename() -> &'static str {
12214 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance"
12215 }
12216 }
12217
12218 /// This message wraps up the information written by out-of-disk detection job.
12219 #[derive(Clone, Default, PartialEq)]
12220 #[non_exhaustive]
12221 pub struct SqlOutOfDiskReport {
12222 /// This field represents the state generated by the proactive database
12223 /// wellness job for OutOfDisk issues.
12224 ///
12225 /// * Writers:
12226 /// * the proactive database wellness job for OOD.
12227 /// * Readers:
12228 /// * the proactive database wellness job
12229 pub sql_out_of_disk_state: std::option::Option<
12230 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12231 >,
12232
12233 /// The minimum recommended increase size in GigaBytes
12234 /// This field is consumed by the frontend
12235 ///
12236 /// * Writers:
12237 /// * the proactive database wellness job for OOD.
12238 /// * Readers:
12239 pub sql_min_recommended_increase_size_gb: std::option::Option<i32>,
12240
12241 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12242 }
12243
12244 impl SqlOutOfDiskReport {
12245 pub fn new() -> Self {
12246 std::default::Default::default()
12247 }
12248
12249 /// Sets the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12250 ///
12251 /// # Example
12252 /// ```ignore,no_run
12253 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12254 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12255 /// let x0 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::Normal);
12256 /// let x1 = SqlOutOfDiskReport::new().set_sql_out_of_disk_state(SqlOutOfDiskState::SoftShutdown);
12257 /// ```
12258 pub fn set_sql_out_of_disk_state<T>(mut self, v: T) -> Self
12259 where
12260 T: std::convert::Into<
12261 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12262 >,
12263 {
12264 self.sql_out_of_disk_state = std::option::Option::Some(v.into());
12265 self
12266 }
12267
12268 /// Sets or clears the value of [sql_out_of_disk_state][crate::model::database_instance::SqlOutOfDiskReport::sql_out_of_disk_state].
12269 ///
12270 /// # Example
12271 /// ```ignore,no_run
12272 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12273 /// use google_cloud_sql_v1::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState;
12274 /// let x0 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::Normal));
12275 /// let x1 = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(Some(SqlOutOfDiskState::SoftShutdown));
12276 /// let x_none = SqlOutOfDiskReport::new().set_or_clear_sql_out_of_disk_state(None::<SqlOutOfDiskState>);
12277 /// ```
12278 pub fn set_or_clear_sql_out_of_disk_state<T>(mut self, v: std::option::Option<T>) -> Self
12279 where
12280 T: std::convert::Into<
12281 crate::model::database_instance::sql_out_of_disk_report::SqlOutOfDiskState,
12282 >,
12283 {
12284 self.sql_out_of_disk_state = v.map(|x| x.into());
12285 self
12286 }
12287
12288 /// Sets the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12289 ///
12290 /// # Example
12291 /// ```ignore,no_run
12292 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12293 /// let x = SqlOutOfDiskReport::new().set_sql_min_recommended_increase_size_gb(42);
12294 /// ```
12295 pub fn set_sql_min_recommended_increase_size_gb<T>(mut self, v: T) -> Self
12296 where
12297 T: std::convert::Into<i32>,
12298 {
12299 self.sql_min_recommended_increase_size_gb = std::option::Option::Some(v.into());
12300 self
12301 }
12302
12303 /// Sets or clears the value of [sql_min_recommended_increase_size_gb][crate::model::database_instance::SqlOutOfDiskReport::sql_min_recommended_increase_size_gb].
12304 ///
12305 /// # Example
12306 /// ```ignore,no_run
12307 /// # use google_cloud_sql_v1::model::database_instance::SqlOutOfDiskReport;
12308 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(Some(42));
12309 /// let x = SqlOutOfDiskReport::new().set_or_clear_sql_min_recommended_increase_size_gb(None::<i32>);
12310 /// ```
12311 pub fn set_or_clear_sql_min_recommended_increase_size_gb<T>(
12312 mut self,
12313 v: std::option::Option<T>,
12314 ) -> Self
12315 where
12316 T: std::convert::Into<i32>,
12317 {
12318 self.sql_min_recommended_increase_size_gb = v.map(|x| x.into());
12319 self
12320 }
12321 }
12322
12323 impl wkt::message::Message for SqlOutOfDiskReport {
12324 fn typename() -> &'static str {
12325 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport"
12326 }
12327 }
12328
12329 /// Defines additional types related to [SqlOutOfDiskReport].
12330 pub mod sql_out_of_disk_report {
12331 #[allow(unused_imports)]
12332 use super::*;
12333
12334 /// This enum lists all possible states regarding out-of-disk issues.
12335 ///
12336 /// # Working with unknown values
12337 ///
12338 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12339 /// additional enum variants at any time. Adding new variants is not considered
12340 /// a breaking change. Applications should write their code in anticipation of:
12341 ///
12342 /// - New values appearing in future releases of the client library, **and**
12343 /// - New values received dynamically, without application changes.
12344 ///
12345 /// Please consult the [Working with enums] section in the user guide for some
12346 /// guidelines.
12347 ///
12348 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12349 #[derive(Clone, Debug, PartialEq)]
12350 #[non_exhaustive]
12351 pub enum SqlOutOfDiskState {
12352 /// Unspecified state
12353 Unspecified,
12354 /// The instance has plenty space on data disk
12355 Normal,
12356 /// Data disk is almost used up. It is shutdown to prevent data
12357 /// corruption.
12358 SoftShutdown,
12359 /// If set, the enum was initialized with an unknown value.
12360 ///
12361 /// Applications can examine the value using [SqlOutOfDiskState::value] or
12362 /// [SqlOutOfDiskState::name].
12363 UnknownValue(sql_out_of_disk_state::UnknownValue),
12364 }
12365
12366 #[doc(hidden)]
12367 pub mod sql_out_of_disk_state {
12368 #[allow(unused_imports)]
12369 use super::*;
12370 #[derive(Clone, Debug, PartialEq)]
12371 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12372 }
12373
12374 impl SqlOutOfDiskState {
12375 /// Gets the enum value.
12376 ///
12377 /// Returns `None` if the enum contains an unknown value deserialized from
12378 /// the string representation of enums.
12379 pub fn value(&self) -> std::option::Option<i32> {
12380 match self {
12381 Self::Unspecified => std::option::Option::Some(0),
12382 Self::Normal => std::option::Option::Some(1),
12383 Self::SoftShutdown => std::option::Option::Some(2),
12384 Self::UnknownValue(u) => u.0.value(),
12385 }
12386 }
12387
12388 /// Gets the enum value as a string.
12389 ///
12390 /// Returns `None` if the enum contains an unknown value deserialized from
12391 /// the integer representation of enums.
12392 pub fn name(&self) -> std::option::Option<&str> {
12393 match self {
12394 Self::Unspecified => {
12395 std::option::Option::Some("SQL_OUT_OF_DISK_STATE_UNSPECIFIED")
12396 }
12397 Self::Normal => std::option::Option::Some("NORMAL"),
12398 Self::SoftShutdown => std::option::Option::Some("SOFT_SHUTDOWN"),
12399 Self::UnknownValue(u) => u.0.name(),
12400 }
12401 }
12402 }
12403
12404 impl std::default::Default for SqlOutOfDiskState {
12405 fn default() -> Self {
12406 use std::convert::From;
12407 Self::from(0)
12408 }
12409 }
12410
12411 impl std::fmt::Display for SqlOutOfDiskState {
12412 fn fmt(
12413 &self,
12414 f: &mut std::fmt::Formatter<'_>,
12415 ) -> std::result::Result<(), std::fmt::Error> {
12416 wkt::internal::display_enum(f, self.name(), self.value())
12417 }
12418 }
12419
12420 impl std::convert::From<i32> for SqlOutOfDiskState {
12421 fn from(value: i32) -> Self {
12422 match value {
12423 0 => Self::Unspecified,
12424 1 => Self::Normal,
12425 2 => Self::SoftShutdown,
12426 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12427 wkt::internal::UnknownEnumValue::Integer(value),
12428 )),
12429 }
12430 }
12431 }
12432
12433 impl std::convert::From<&str> for SqlOutOfDiskState {
12434 fn from(value: &str) -> Self {
12435 use std::string::ToString;
12436 match value {
12437 "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" => Self::Unspecified,
12438 "NORMAL" => Self::Normal,
12439 "SOFT_SHUTDOWN" => Self::SoftShutdown,
12440 _ => Self::UnknownValue(sql_out_of_disk_state::UnknownValue(
12441 wkt::internal::UnknownEnumValue::String(value.to_string()),
12442 )),
12443 }
12444 }
12445 }
12446
12447 impl serde::ser::Serialize for SqlOutOfDiskState {
12448 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12449 where
12450 S: serde::Serializer,
12451 {
12452 match self {
12453 Self::Unspecified => serializer.serialize_i32(0),
12454 Self::Normal => serializer.serialize_i32(1),
12455 Self::SoftShutdown => serializer.serialize_i32(2),
12456 Self::UnknownValue(u) => u.0.serialize(serializer),
12457 }
12458 }
12459 }
12460
12461 impl<'de> serde::de::Deserialize<'de> for SqlOutOfDiskState {
12462 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12463 where
12464 D: serde::Deserializer<'de>,
12465 {
12466 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOutOfDiskState>::new(
12467 ".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState",
12468 ))
12469 }
12470 }
12471 }
12472
12473 /// Details of a single read pool node of a read pool.
12474 #[derive(Clone, Default, PartialEq)]
12475 #[non_exhaustive]
12476 pub struct PoolNodeConfig {
12477 /// Output only. The name of the read pool node, to be used for retrieving
12478 /// metrics and logs.
12479 pub name: std::option::Option<std::string::String>,
12480
12481 /// Output only. The zone of the read pool node.
12482 pub gce_zone: std::option::Option<std::string::String>,
12483
12484 /// Output only. Mappings containing IP addresses that can be used to connect
12485 /// to the read pool node.
12486 pub ip_addresses: std::vec::Vec<crate::model::IpMapping>,
12487
12488 /// Output only. The DNS name of the read pool node.
12489 pub dns_name: std::option::Option<std::string::String>,
12490
12491 /// Output only. The current state of the read pool node.
12492 pub state: std::option::Option<crate::model::database_instance::SqlInstanceState>,
12493
12494 /// Output only. The list of DNS names used by this read pool node.
12495 pub dns_names: std::vec::Vec<crate::model::DnsNameMapping>,
12496
12497 /// Output only. The Private Service Connect (PSC) service attachment of the
12498 /// read pool node.
12499 pub psc_service_attachment_link: std::option::Option<std::string::String>,
12500
12501 /// Output only. The list of settings for requested automatically-setup
12502 /// Private Service Connect (PSC) consumer endpoints that can be used to
12503 /// connect to this read pool node.
12504 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
12505
12506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12507 }
12508
12509 impl PoolNodeConfig {
12510 pub fn new() -> Self {
12511 std::default::Default::default()
12512 }
12513
12514 /// Sets the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12515 ///
12516 /// # Example
12517 /// ```ignore,no_run
12518 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12519 /// let x = PoolNodeConfig::new().set_name("example");
12520 /// ```
12521 pub fn set_name<T>(mut self, v: T) -> Self
12522 where
12523 T: std::convert::Into<std::string::String>,
12524 {
12525 self.name = std::option::Option::Some(v.into());
12526 self
12527 }
12528
12529 /// Sets or clears the value of [name][crate::model::database_instance::PoolNodeConfig::name].
12530 ///
12531 /// # Example
12532 /// ```ignore,no_run
12533 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12534 /// let x = PoolNodeConfig::new().set_or_clear_name(Some("example"));
12535 /// let x = PoolNodeConfig::new().set_or_clear_name(None::<String>);
12536 /// ```
12537 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
12538 where
12539 T: std::convert::Into<std::string::String>,
12540 {
12541 self.name = v.map(|x| x.into());
12542 self
12543 }
12544
12545 /// Sets the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12546 ///
12547 /// # Example
12548 /// ```ignore,no_run
12549 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12550 /// let x = PoolNodeConfig::new().set_gce_zone("example");
12551 /// ```
12552 pub fn set_gce_zone<T>(mut self, v: T) -> Self
12553 where
12554 T: std::convert::Into<std::string::String>,
12555 {
12556 self.gce_zone = std::option::Option::Some(v.into());
12557 self
12558 }
12559
12560 /// Sets or clears the value of [gce_zone][crate::model::database_instance::PoolNodeConfig::gce_zone].
12561 ///
12562 /// # Example
12563 /// ```ignore,no_run
12564 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12565 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(Some("example"));
12566 /// let x = PoolNodeConfig::new().set_or_clear_gce_zone(None::<String>);
12567 /// ```
12568 pub fn set_or_clear_gce_zone<T>(mut self, v: std::option::Option<T>) -> Self
12569 where
12570 T: std::convert::Into<std::string::String>,
12571 {
12572 self.gce_zone = v.map(|x| x.into());
12573 self
12574 }
12575
12576 /// Sets the value of [ip_addresses][crate::model::database_instance::PoolNodeConfig::ip_addresses].
12577 ///
12578 /// # Example
12579 /// ```ignore,no_run
12580 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12581 /// use google_cloud_sql_v1::model::IpMapping;
12582 /// let x = PoolNodeConfig::new()
12583 /// .set_ip_addresses([
12584 /// IpMapping::default()/* use setters */,
12585 /// IpMapping::default()/* use (different) setters */,
12586 /// ]);
12587 /// ```
12588 pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
12589 where
12590 T: std::iter::IntoIterator<Item = V>,
12591 V: std::convert::Into<crate::model::IpMapping>,
12592 {
12593 use std::iter::Iterator;
12594 self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
12595 self
12596 }
12597
12598 /// Sets the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12599 ///
12600 /// # Example
12601 /// ```ignore,no_run
12602 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12603 /// let x = PoolNodeConfig::new().set_dns_name("example");
12604 /// ```
12605 pub fn set_dns_name<T>(mut self, v: T) -> Self
12606 where
12607 T: std::convert::Into<std::string::String>,
12608 {
12609 self.dns_name = std::option::Option::Some(v.into());
12610 self
12611 }
12612
12613 /// Sets or clears the value of [dns_name][crate::model::database_instance::PoolNodeConfig::dns_name].
12614 ///
12615 /// # Example
12616 /// ```ignore,no_run
12617 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12618 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(Some("example"));
12619 /// let x = PoolNodeConfig::new().set_or_clear_dns_name(None::<String>);
12620 /// ```
12621 pub fn set_or_clear_dns_name<T>(mut self, v: std::option::Option<T>) -> Self
12622 where
12623 T: std::convert::Into<std::string::String>,
12624 {
12625 self.dns_name = v.map(|x| x.into());
12626 self
12627 }
12628
12629 /// Sets the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12630 ///
12631 /// # Example
12632 /// ```ignore,no_run
12633 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12634 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12635 /// let x0 = PoolNodeConfig::new().set_state(SqlInstanceState::Runnable);
12636 /// let x1 = PoolNodeConfig::new().set_state(SqlInstanceState::Suspended);
12637 /// let x2 = PoolNodeConfig::new().set_state(SqlInstanceState::PendingDelete);
12638 /// ```
12639 pub fn set_state<T>(mut self, v: T) -> Self
12640 where
12641 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12642 {
12643 self.state = std::option::Option::Some(v.into());
12644 self
12645 }
12646
12647 /// Sets or clears the value of [state][crate::model::database_instance::PoolNodeConfig::state].
12648 ///
12649 /// # Example
12650 /// ```ignore,no_run
12651 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12652 /// use google_cloud_sql_v1::model::database_instance::SqlInstanceState;
12653 /// let x0 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Runnable));
12654 /// let x1 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::Suspended));
12655 /// let x2 = PoolNodeConfig::new().set_or_clear_state(Some(SqlInstanceState::PendingDelete));
12656 /// let x_none = PoolNodeConfig::new().set_or_clear_state(None::<SqlInstanceState>);
12657 /// ```
12658 pub fn set_or_clear_state<T>(mut self, v: std::option::Option<T>) -> Self
12659 where
12660 T: std::convert::Into<crate::model::database_instance::SqlInstanceState>,
12661 {
12662 self.state = v.map(|x| x.into());
12663 self
12664 }
12665
12666 /// Sets the value of [dns_names][crate::model::database_instance::PoolNodeConfig::dns_names].
12667 ///
12668 /// # Example
12669 /// ```ignore,no_run
12670 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12671 /// use google_cloud_sql_v1::model::DnsNameMapping;
12672 /// let x = PoolNodeConfig::new()
12673 /// .set_dns_names([
12674 /// DnsNameMapping::default()/* use setters */,
12675 /// DnsNameMapping::default()/* use (different) setters */,
12676 /// ]);
12677 /// ```
12678 pub fn set_dns_names<T, V>(mut self, v: T) -> Self
12679 where
12680 T: std::iter::IntoIterator<Item = V>,
12681 V: std::convert::Into<crate::model::DnsNameMapping>,
12682 {
12683 use std::iter::Iterator;
12684 self.dns_names = v.into_iter().map(|i| i.into()).collect();
12685 self
12686 }
12687
12688 /// Sets the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12689 ///
12690 /// # Example
12691 /// ```ignore,no_run
12692 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12693 /// let x = PoolNodeConfig::new().set_psc_service_attachment_link("example");
12694 /// ```
12695 pub fn set_psc_service_attachment_link<T>(mut self, v: T) -> Self
12696 where
12697 T: std::convert::Into<std::string::String>,
12698 {
12699 self.psc_service_attachment_link = std::option::Option::Some(v.into());
12700 self
12701 }
12702
12703 /// Sets or clears the value of [psc_service_attachment_link][crate::model::database_instance::PoolNodeConfig::psc_service_attachment_link].
12704 ///
12705 /// # Example
12706 /// ```ignore,no_run
12707 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12708 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(Some("example"));
12709 /// let x = PoolNodeConfig::new().set_or_clear_psc_service_attachment_link(None::<String>);
12710 /// ```
12711 pub fn set_or_clear_psc_service_attachment_link<T>(
12712 mut self,
12713 v: std::option::Option<T>,
12714 ) -> Self
12715 where
12716 T: std::convert::Into<std::string::String>,
12717 {
12718 self.psc_service_attachment_link = v.map(|x| x.into());
12719 self
12720 }
12721
12722 /// Sets the value of [psc_auto_connections][crate::model::database_instance::PoolNodeConfig::psc_auto_connections].
12723 ///
12724 /// # Example
12725 /// ```ignore,no_run
12726 /// # use google_cloud_sql_v1::model::database_instance::PoolNodeConfig;
12727 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
12728 /// let x = PoolNodeConfig::new()
12729 /// .set_psc_auto_connections([
12730 /// PscAutoConnectionConfig::default()/* use setters */,
12731 /// PscAutoConnectionConfig::default()/* use (different) setters */,
12732 /// ]);
12733 /// ```
12734 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
12735 where
12736 T: std::iter::IntoIterator<Item = V>,
12737 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
12738 {
12739 use std::iter::Iterator;
12740 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
12741 self
12742 }
12743 }
12744
12745 impl wkt::message::Message for PoolNodeConfig {
12746 fn typename() -> &'static str {
12747 "type.googleapis.com/google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig"
12748 }
12749 }
12750
12751 /// The current serving state of the database instance.
12752 ///
12753 /// # Working with unknown values
12754 ///
12755 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12756 /// additional enum variants at any time. Adding new variants is not considered
12757 /// a breaking change. Applications should write their code in anticipation of:
12758 ///
12759 /// - New values appearing in future releases of the client library, **and**
12760 /// - New values received dynamically, without application changes.
12761 ///
12762 /// Please consult the [Working with enums] section in the user guide for some
12763 /// guidelines.
12764 ///
12765 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12766 #[derive(Clone, Debug, PartialEq)]
12767 #[non_exhaustive]
12768 pub enum SqlInstanceState {
12769 /// The state of the instance is unknown.
12770 Unspecified,
12771 /// The instance is running, or has been stopped by owner.
12772 Runnable,
12773 /// The instance is not available, for example due to problems with billing.
12774 Suspended,
12775 /// The instance is being deleted.
12776 PendingDelete,
12777 /// The instance is being created.
12778 PendingCreate,
12779 /// The instance is down for maintenance.
12780 Maintenance,
12781 /// The creation of the instance failed or a fatal error occurred during
12782 /// maintenance.
12783 Failed,
12784 /// Deprecated
12785 #[deprecated]
12786 OnlineMaintenance,
12787 /// (Applicable to read pool nodes only.) The read pool node needs to be
12788 /// repaired. The database might be unavailable.
12789 Repairing,
12790 /// If set, the enum was initialized with an unknown value.
12791 ///
12792 /// Applications can examine the value using [SqlInstanceState::value] or
12793 /// [SqlInstanceState::name].
12794 UnknownValue(sql_instance_state::UnknownValue),
12795 }
12796
12797 #[doc(hidden)]
12798 pub mod sql_instance_state {
12799 #[allow(unused_imports)]
12800 use super::*;
12801 #[derive(Clone, Debug, PartialEq)]
12802 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12803 }
12804
12805 impl SqlInstanceState {
12806 /// Gets the enum value.
12807 ///
12808 /// Returns `None` if the enum contains an unknown value deserialized from
12809 /// the string representation of enums.
12810 pub fn value(&self) -> std::option::Option<i32> {
12811 match self {
12812 Self::Unspecified => std::option::Option::Some(0),
12813 Self::Runnable => std::option::Option::Some(1),
12814 Self::Suspended => std::option::Option::Some(2),
12815 Self::PendingDelete => std::option::Option::Some(3),
12816 Self::PendingCreate => std::option::Option::Some(4),
12817 Self::Maintenance => std::option::Option::Some(5),
12818 Self::Failed => std::option::Option::Some(6),
12819 Self::OnlineMaintenance => std::option::Option::Some(7),
12820 Self::Repairing => std::option::Option::Some(8),
12821 Self::UnknownValue(u) => u.0.value(),
12822 }
12823 }
12824
12825 /// Gets the enum value as a string.
12826 ///
12827 /// Returns `None` if the enum contains an unknown value deserialized from
12828 /// the integer representation of enums.
12829 pub fn name(&self) -> std::option::Option<&str> {
12830 match self {
12831 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_STATE_UNSPECIFIED"),
12832 Self::Runnable => std::option::Option::Some("RUNNABLE"),
12833 Self::Suspended => std::option::Option::Some("SUSPENDED"),
12834 Self::PendingDelete => std::option::Option::Some("PENDING_DELETE"),
12835 Self::PendingCreate => std::option::Option::Some("PENDING_CREATE"),
12836 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
12837 Self::Failed => std::option::Option::Some("FAILED"),
12838 Self::OnlineMaintenance => std::option::Option::Some("ONLINE_MAINTENANCE"),
12839 Self::Repairing => std::option::Option::Some("REPAIRING"),
12840 Self::UnknownValue(u) => u.0.name(),
12841 }
12842 }
12843 }
12844
12845 impl std::default::Default for SqlInstanceState {
12846 fn default() -> Self {
12847 use std::convert::From;
12848 Self::from(0)
12849 }
12850 }
12851
12852 impl std::fmt::Display for SqlInstanceState {
12853 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12854 wkt::internal::display_enum(f, self.name(), self.value())
12855 }
12856 }
12857
12858 impl std::convert::From<i32> for SqlInstanceState {
12859 fn from(value: i32) -> Self {
12860 match value {
12861 0 => Self::Unspecified,
12862 1 => Self::Runnable,
12863 2 => Self::Suspended,
12864 3 => Self::PendingDelete,
12865 4 => Self::PendingCreate,
12866 5 => Self::Maintenance,
12867 6 => Self::Failed,
12868 7 => Self::OnlineMaintenance,
12869 8 => Self::Repairing,
12870 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
12871 wkt::internal::UnknownEnumValue::Integer(value),
12872 )),
12873 }
12874 }
12875 }
12876
12877 impl std::convert::From<&str> for SqlInstanceState {
12878 fn from(value: &str) -> Self {
12879 use std::string::ToString;
12880 match value {
12881 "SQL_INSTANCE_STATE_UNSPECIFIED" => Self::Unspecified,
12882 "RUNNABLE" => Self::Runnable,
12883 "SUSPENDED" => Self::Suspended,
12884 "PENDING_DELETE" => Self::PendingDelete,
12885 "PENDING_CREATE" => Self::PendingCreate,
12886 "MAINTENANCE" => Self::Maintenance,
12887 "FAILED" => Self::Failed,
12888 "ONLINE_MAINTENANCE" => Self::OnlineMaintenance,
12889 "REPAIRING" => Self::Repairing,
12890 _ => Self::UnknownValue(sql_instance_state::UnknownValue(
12891 wkt::internal::UnknownEnumValue::String(value.to_string()),
12892 )),
12893 }
12894 }
12895 }
12896
12897 impl serde::ser::Serialize for SqlInstanceState {
12898 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12899 where
12900 S: serde::Serializer,
12901 {
12902 match self {
12903 Self::Unspecified => serializer.serialize_i32(0),
12904 Self::Runnable => serializer.serialize_i32(1),
12905 Self::Suspended => serializer.serialize_i32(2),
12906 Self::PendingDelete => serializer.serialize_i32(3),
12907 Self::PendingCreate => serializer.serialize_i32(4),
12908 Self::Maintenance => serializer.serialize_i32(5),
12909 Self::Failed => serializer.serialize_i32(6),
12910 Self::OnlineMaintenance => serializer.serialize_i32(7),
12911 Self::Repairing => serializer.serialize_i32(8),
12912 Self::UnknownValue(u) => u.0.serialize(serializer),
12913 }
12914 }
12915 }
12916
12917 impl<'de> serde::de::Deserialize<'de> for SqlInstanceState {
12918 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12919 where
12920 D: serde::Deserializer<'de>,
12921 {
12922 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceState>::new(
12923 ".google.cloud.sql.v1.DatabaseInstance.SqlInstanceState",
12924 ))
12925 }
12926 }
12927
12928 /// The SQL network architecture for the instance.
12929 ///
12930 /// # Working with unknown values
12931 ///
12932 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12933 /// additional enum variants at any time. Adding new variants is not considered
12934 /// a breaking change. Applications should write their code in anticipation of:
12935 ///
12936 /// - New values appearing in future releases of the client library, **and**
12937 /// - New values received dynamically, without application changes.
12938 ///
12939 /// Please consult the [Working with enums] section in the user guide for some
12940 /// guidelines.
12941 ///
12942 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12943 #[derive(Clone, Debug, PartialEq)]
12944 #[non_exhaustive]
12945 pub enum SqlNetworkArchitecture {
12946 Unspecified,
12947 /// The instance uses the new network architecture.
12948 NewNetworkArchitecture,
12949 /// The instance uses the old network architecture.
12950 OldNetworkArchitecture,
12951 /// If set, the enum was initialized with an unknown value.
12952 ///
12953 /// Applications can examine the value using [SqlNetworkArchitecture::value] or
12954 /// [SqlNetworkArchitecture::name].
12955 UnknownValue(sql_network_architecture::UnknownValue),
12956 }
12957
12958 #[doc(hidden)]
12959 pub mod sql_network_architecture {
12960 #[allow(unused_imports)]
12961 use super::*;
12962 #[derive(Clone, Debug, PartialEq)]
12963 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12964 }
12965
12966 impl SqlNetworkArchitecture {
12967 /// Gets the enum value.
12968 ///
12969 /// Returns `None` if the enum contains an unknown value deserialized from
12970 /// the string representation of enums.
12971 pub fn value(&self) -> std::option::Option<i32> {
12972 match self {
12973 Self::Unspecified => std::option::Option::Some(0),
12974 Self::NewNetworkArchitecture => std::option::Option::Some(1),
12975 Self::OldNetworkArchitecture => std::option::Option::Some(2),
12976 Self::UnknownValue(u) => u.0.value(),
12977 }
12978 }
12979
12980 /// Gets the enum value as a string.
12981 ///
12982 /// Returns `None` if the enum contains an unknown value deserialized from
12983 /// the integer representation of enums.
12984 pub fn name(&self) -> std::option::Option<&str> {
12985 match self {
12986 Self::Unspecified => {
12987 std::option::Option::Some("SQL_NETWORK_ARCHITECTURE_UNSPECIFIED")
12988 }
12989 Self::NewNetworkArchitecture => {
12990 std::option::Option::Some("NEW_NETWORK_ARCHITECTURE")
12991 }
12992 Self::OldNetworkArchitecture => {
12993 std::option::Option::Some("OLD_NETWORK_ARCHITECTURE")
12994 }
12995 Self::UnknownValue(u) => u.0.name(),
12996 }
12997 }
12998 }
12999
13000 impl std::default::Default for SqlNetworkArchitecture {
13001 fn default() -> Self {
13002 use std::convert::From;
13003 Self::from(0)
13004 }
13005 }
13006
13007 impl std::fmt::Display for SqlNetworkArchitecture {
13008 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13009 wkt::internal::display_enum(f, self.name(), self.value())
13010 }
13011 }
13012
13013 impl std::convert::From<i32> for SqlNetworkArchitecture {
13014 fn from(value: i32) -> Self {
13015 match value {
13016 0 => Self::Unspecified,
13017 1 => Self::NewNetworkArchitecture,
13018 2 => Self::OldNetworkArchitecture,
13019 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13020 wkt::internal::UnknownEnumValue::Integer(value),
13021 )),
13022 }
13023 }
13024 }
13025
13026 impl std::convert::From<&str> for SqlNetworkArchitecture {
13027 fn from(value: &str) -> Self {
13028 use std::string::ToString;
13029 match value {
13030 "SQL_NETWORK_ARCHITECTURE_UNSPECIFIED" => Self::Unspecified,
13031 "NEW_NETWORK_ARCHITECTURE" => Self::NewNetworkArchitecture,
13032 "OLD_NETWORK_ARCHITECTURE" => Self::OldNetworkArchitecture,
13033 _ => Self::UnknownValue(sql_network_architecture::UnknownValue(
13034 wkt::internal::UnknownEnumValue::String(value.to_string()),
13035 )),
13036 }
13037 }
13038 }
13039
13040 impl serde::ser::Serialize for SqlNetworkArchitecture {
13041 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13042 where
13043 S: serde::Serializer,
13044 {
13045 match self {
13046 Self::Unspecified => serializer.serialize_i32(0),
13047 Self::NewNetworkArchitecture => serializer.serialize_i32(1),
13048 Self::OldNetworkArchitecture => serializer.serialize_i32(2),
13049 Self::UnknownValue(u) => u.0.serialize(serializer),
13050 }
13051 }
13052 }
13053
13054 impl<'de> serde::de::Deserialize<'de> for SqlNetworkArchitecture {
13055 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13056 where
13057 D: serde::Deserializer<'de>,
13058 {
13059 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlNetworkArchitecture>::new(
13060 ".google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture",
13061 ))
13062 }
13063 }
13064}
13065
13066/// Gemini instance configuration.
13067#[derive(Clone, Default, PartialEq)]
13068#[non_exhaustive]
13069pub struct GeminiInstanceConfig {
13070 /// Output only. Whether Gemini is enabled.
13071 pub entitled: std::option::Option<bool>,
13072
13073 /// Output only. Whether the vacuum management is enabled.
13074 pub google_vacuum_mgmt_enabled: std::option::Option<bool>,
13075
13076 /// Output only. Whether canceling the out-of-memory (OOM) session is enabled.
13077 pub oom_session_cancel_enabled: std::option::Option<bool>,
13078
13079 /// Output only. Whether the active query is enabled.
13080 pub active_query_enabled: std::option::Option<bool>,
13081
13082 /// Output only. Whether the index advisor is enabled.
13083 pub index_advisor_enabled: std::option::Option<bool>,
13084
13085 /// Output only. Whether the flag recommender is enabled.
13086 pub flag_recommender_enabled: std::option::Option<bool>,
13087
13088 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13089}
13090
13091impl GeminiInstanceConfig {
13092 pub fn new() -> Self {
13093 std::default::Default::default()
13094 }
13095
13096 /// Sets the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13097 ///
13098 /// # Example
13099 /// ```ignore,no_run
13100 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13101 /// let x = GeminiInstanceConfig::new().set_entitled(true);
13102 /// ```
13103 pub fn set_entitled<T>(mut self, v: T) -> Self
13104 where
13105 T: std::convert::Into<bool>,
13106 {
13107 self.entitled = std::option::Option::Some(v.into());
13108 self
13109 }
13110
13111 /// Sets or clears the value of [entitled][crate::model::GeminiInstanceConfig::entitled].
13112 ///
13113 /// # Example
13114 /// ```ignore,no_run
13115 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13116 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(Some(false));
13117 /// let x = GeminiInstanceConfig::new().set_or_clear_entitled(None::<bool>);
13118 /// ```
13119 pub fn set_or_clear_entitled<T>(mut self, v: std::option::Option<T>) -> Self
13120 where
13121 T: std::convert::Into<bool>,
13122 {
13123 self.entitled = v.map(|x| x.into());
13124 self
13125 }
13126
13127 /// Sets the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13128 ///
13129 /// # Example
13130 /// ```ignore,no_run
13131 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13132 /// let x = GeminiInstanceConfig::new().set_google_vacuum_mgmt_enabled(true);
13133 /// ```
13134 pub fn set_google_vacuum_mgmt_enabled<T>(mut self, v: T) -> Self
13135 where
13136 T: std::convert::Into<bool>,
13137 {
13138 self.google_vacuum_mgmt_enabled = std::option::Option::Some(v.into());
13139 self
13140 }
13141
13142 /// Sets or clears the value of [google_vacuum_mgmt_enabled][crate::model::GeminiInstanceConfig::google_vacuum_mgmt_enabled].
13143 ///
13144 /// # Example
13145 /// ```ignore,no_run
13146 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13147 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(Some(false));
13148 /// let x = GeminiInstanceConfig::new().set_or_clear_google_vacuum_mgmt_enabled(None::<bool>);
13149 /// ```
13150 pub fn set_or_clear_google_vacuum_mgmt_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13151 where
13152 T: std::convert::Into<bool>,
13153 {
13154 self.google_vacuum_mgmt_enabled = v.map(|x| x.into());
13155 self
13156 }
13157
13158 /// Sets the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13159 ///
13160 /// # Example
13161 /// ```ignore,no_run
13162 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13163 /// let x = GeminiInstanceConfig::new().set_oom_session_cancel_enabled(true);
13164 /// ```
13165 pub fn set_oom_session_cancel_enabled<T>(mut self, v: T) -> Self
13166 where
13167 T: std::convert::Into<bool>,
13168 {
13169 self.oom_session_cancel_enabled = std::option::Option::Some(v.into());
13170 self
13171 }
13172
13173 /// Sets or clears the value of [oom_session_cancel_enabled][crate::model::GeminiInstanceConfig::oom_session_cancel_enabled].
13174 ///
13175 /// # Example
13176 /// ```ignore,no_run
13177 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13178 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(Some(false));
13179 /// let x = GeminiInstanceConfig::new().set_or_clear_oom_session_cancel_enabled(None::<bool>);
13180 /// ```
13181 pub fn set_or_clear_oom_session_cancel_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13182 where
13183 T: std::convert::Into<bool>,
13184 {
13185 self.oom_session_cancel_enabled = v.map(|x| x.into());
13186 self
13187 }
13188
13189 /// Sets the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13190 ///
13191 /// # Example
13192 /// ```ignore,no_run
13193 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13194 /// let x = GeminiInstanceConfig::new().set_active_query_enabled(true);
13195 /// ```
13196 pub fn set_active_query_enabled<T>(mut self, v: T) -> Self
13197 where
13198 T: std::convert::Into<bool>,
13199 {
13200 self.active_query_enabled = std::option::Option::Some(v.into());
13201 self
13202 }
13203
13204 /// Sets or clears the value of [active_query_enabled][crate::model::GeminiInstanceConfig::active_query_enabled].
13205 ///
13206 /// # Example
13207 /// ```ignore,no_run
13208 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13209 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(Some(false));
13210 /// let x = GeminiInstanceConfig::new().set_or_clear_active_query_enabled(None::<bool>);
13211 /// ```
13212 pub fn set_or_clear_active_query_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13213 where
13214 T: std::convert::Into<bool>,
13215 {
13216 self.active_query_enabled = v.map(|x| x.into());
13217 self
13218 }
13219
13220 /// Sets the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13221 ///
13222 /// # Example
13223 /// ```ignore,no_run
13224 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13225 /// let x = GeminiInstanceConfig::new().set_index_advisor_enabled(true);
13226 /// ```
13227 pub fn set_index_advisor_enabled<T>(mut self, v: T) -> Self
13228 where
13229 T: std::convert::Into<bool>,
13230 {
13231 self.index_advisor_enabled = std::option::Option::Some(v.into());
13232 self
13233 }
13234
13235 /// Sets or clears the value of [index_advisor_enabled][crate::model::GeminiInstanceConfig::index_advisor_enabled].
13236 ///
13237 /// # Example
13238 /// ```ignore,no_run
13239 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13240 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(Some(false));
13241 /// let x = GeminiInstanceConfig::new().set_or_clear_index_advisor_enabled(None::<bool>);
13242 /// ```
13243 pub fn set_or_clear_index_advisor_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13244 where
13245 T: std::convert::Into<bool>,
13246 {
13247 self.index_advisor_enabled = v.map(|x| x.into());
13248 self
13249 }
13250
13251 /// Sets the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13252 ///
13253 /// # Example
13254 /// ```ignore,no_run
13255 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13256 /// let x = GeminiInstanceConfig::new().set_flag_recommender_enabled(true);
13257 /// ```
13258 pub fn set_flag_recommender_enabled<T>(mut self, v: T) -> Self
13259 where
13260 T: std::convert::Into<bool>,
13261 {
13262 self.flag_recommender_enabled = std::option::Option::Some(v.into());
13263 self
13264 }
13265
13266 /// Sets or clears the value of [flag_recommender_enabled][crate::model::GeminiInstanceConfig::flag_recommender_enabled].
13267 ///
13268 /// # Example
13269 /// ```ignore,no_run
13270 /// # use google_cloud_sql_v1::model::GeminiInstanceConfig;
13271 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(Some(false));
13272 /// let x = GeminiInstanceConfig::new().set_or_clear_flag_recommender_enabled(None::<bool>);
13273 /// ```
13274 pub fn set_or_clear_flag_recommender_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13275 where
13276 T: std::convert::Into<bool>,
13277 {
13278 self.flag_recommender_enabled = v.map(|x| x.into());
13279 self
13280 }
13281}
13282
13283impl wkt::message::Message for GeminiInstanceConfig {
13284 fn typename() -> &'static str {
13285 "type.googleapis.com/google.cloud.sql.v1.GeminiInstanceConfig"
13286 }
13287}
13288
13289/// A primary instance and disaster recovery (DR) replica pair.
13290/// A DR replica is a cross-region replica that you designate for failover in
13291/// the event that the primary instance experiences regional failure.
13292/// Applicable to MySQL and PostgreSQL.
13293#[derive(Clone, Default, PartialEq)]
13294#[non_exhaustive]
13295pub struct ReplicationCluster {
13296 /// Output only. If set, this field indicates this instance has a private
13297 /// service access (PSA) DNS endpoint that is pointing to the primary instance
13298 /// of the cluster. If this instance is the primary, then the DNS endpoint
13299 /// points to this instance. After a switchover or replica failover operation,
13300 /// this DNS endpoint points to the promoted instance. This is a read-only
13301 /// field, returned to the user as information. This field can exist even if a
13302 /// standalone instance doesn't have a DR replica yet or the DR replica is
13303 /// deleted.
13304 pub psa_write_endpoint: std::string::String,
13305
13306 /// Optional. If the instance is a primary instance, then this field identifies
13307 /// the disaster recovery (DR) replica. A DR replica is an optional
13308 /// configuration for Enterprise Plus edition instances. If the instance is a
13309 /// read replica, then the field is not set. Set this field to a replica name
13310 /// to designate a DR replica for a primary instance. Remove the replica name
13311 /// to remove the DR replica designation.
13312 pub failover_dr_replica_name: std::string::String,
13313
13314 /// Output only. Read-only field that indicates whether the replica is a DR
13315 /// replica. This field is not set if the instance is a primary instance.
13316 pub dr_replica: bool,
13317
13318 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13319}
13320
13321impl ReplicationCluster {
13322 pub fn new() -> Self {
13323 std::default::Default::default()
13324 }
13325
13326 /// Sets the value of [psa_write_endpoint][crate::model::ReplicationCluster::psa_write_endpoint].
13327 ///
13328 /// # Example
13329 /// ```ignore,no_run
13330 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13331 /// let x = ReplicationCluster::new().set_psa_write_endpoint("example");
13332 /// ```
13333 pub fn set_psa_write_endpoint<T: std::convert::Into<std::string::String>>(
13334 mut self,
13335 v: T,
13336 ) -> Self {
13337 self.psa_write_endpoint = v.into();
13338 self
13339 }
13340
13341 /// Sets the value of [failover_dr_replica_name][crate::model::ReplicationCluster::failover_dr_replica_name].
13342 ///
13343 /// # Example
13344 /// ```ignore,no_run
13345 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13346 /// let x = ReplicationCluster::new().set_failover_dr_replica_name("example");
13347 /// ```
13348 pub fn set_failover_dr_replica_name<T: std::convert::Into<std::string::String>>(
13349 mut self,
13350 v: T,
13351 ) -> Self {
13352 self.failover_dr_replica_name = v.into();
13353 self
13354 }
13355
13356 /// Sets the value of [dr_replica][crate::model::ReplicationCluster::dr_replica].
13357 ///
13358 /// # Example
13359 /// ```ignore,no_run
13360 /// # use google_cloud_sql_v1::model::ReplicationCluster;
13361 /// let x = ReplicationCluster::new().set_dr_replica(true);
13362 /// ```
13363 pub fn set_dr_replica<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13364 self.dr_replica = v.into();
13365 self
13366 }
13367}
13368
13369impl wkt::message::Message for ReplicationCluster {
13370 fn typename() -> &'static str {
13371 "type.googleapis.com/google.cloud.sql.v1.ReplicationCluster"
13372 }
13373}
13374
13375/// An available database version. It can be a major or a minor version.
13376#[derive(Clone, Default, PartialEq)]
13377#[non_exhaustive]
13378pub struct AvailableDatabaseVersion {
13379 /// The version's major version name.
13380 pub major_version: std::option::Option<std::string::String>,
13381
13382 /// The database version name. For MySQL 8.0, this string provides the database
13383 /// major and minor version.
13384 pub name: std::option::Option<std::string::String>,
13385
13386 /// The database version's display name.
13387 pub display_name: std::option::Option<std::string::String>,
13388
13389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13390}
13391
13392impl AvailableDatabaseVersion {
13393 pub fn new() -> Self {
13394 std::default::Default::default()
13395 }
13396
13397 /// Sets the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13398 ///
13399 /// # Example
13400 /// ```ignore,no_run
13401 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13402 /// let x = AvailableDatabaseVersion::new().set_major_version("example");
13403 /// ```
13404 pub fn set_major_version<T>(mut self, v: T) -> Self
13405 where
13406 T: std::convert::Into<std::string::String>,
13407 {
13408 self.major_version = std::option::Option::Some(v.into());
13409 self
13410 }
13411
13412 /// Sets or clears the value of [major_version][crate::model::AvailableDatabaseVersion::major_version].
13413 ///
13414 /// # Example
13415 /// ```ignore,no_run
13416 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13417 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(Some("example"));
13418 /// let x = AvailableDatabaseVersion::new().set_or_clear_major_version(None::<String>);
13419 /// ```
13420 pub fn set_or_clear_major_version<T>(mut self, v: std::option::Option<T>) -> Self
13421 where
13422 T: std::convert::Into<std::string::String>,
13423 {
13424 self.major_version = v.map(|x| x.into());
13425 self
13426 }
13427
13428 /// Sets the value of [name][crate::model::AvailableDatabaseVersion::name].
13429 ///
13430 /// # Example
13431 /// ```ignore,no_run
13432 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13433 /// let x = AvailableDatabaseVersion::new().set_name("example");
13434 /// ```
13435 pub fn set_name<T>(mut self, v: T) -> Self
13436 where
13437 T: std::convert::Into<std::string::String>,
13438 {
13439 self.name = std::option::Option::Some(v.into());
13440 self
13441 }
13442
13443 /// Sets or clears the value of [name][crate::model::AvailableDatabaseVersion::name].
13444 ///
13445 /// # Example
13446 /// ```ignore,no_run
13447 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13448 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(Some("example"));
13449 /// let x = AvailableDatabaseVersion::new().set_or_clear_name(None::<String>);
13450 /// ```
13451 pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
13452 where
13453 T: std::convert::Into<std::string::String>,
13454 {
13455 self.name = v.map(|x| x.into());
13456 self
13457 }
13458
13459 /// Sets the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13460 ///
13461 /// # Example
13462 /// ```ignore,no_run
13463 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13464 /// let x = AvailableDatabaseVersion::new().set_display_name("example");
13465 /// ```
13466 pub fn set_display_name<T>(mut self, v: T) -> Self
13467 where
13468 T: std::convert::Into<std::string::String>,
13469 {
13470 self.display_name = std::option::Option::Some(v.into());
13471 self
13472 }
13473
13474 /// Sets or clears the value of [display_name][crate::model::AvailableDatabaseVersion::display_name].
13475 ///
13476 /// # Example
13477 /// ```ignore,no_run
13478 /// # use google_cloud_sql_v1::model::AvailableDatabaseVersion;
13479 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(Some("example"));
13480 /// let x = AvailableDatabaseVersion::new().set_or_clear_display_name(None::<String>);
13481 /// ```
13482 pub fn set_or_clear_display_name<T>(mut self, v: std::option::Option<T>) -> Self
13483 where
13484 T: std::convert::Into<std::string::String>,
13485 {
13486 self.display_name = v.map(|x| x.into());
13487 self
13488 }
13489}
13490
13491impl wkt::message::Message for AvailableDatabaseVersion {
13492 fn typename() -> &'static str {
13493 "type.googleapis.com/google.cloud.sql.v1.AvailableDatabaseVersion"
13494 }
13495}
13496
13497/// Reschedule options for maintenance windows.
13498#[derive(Clone, Default, PartialEq)]
13499#[non_exhaustive]
13500pub struct SqlInstancesRescheduleMaintenanceRequestBody {
13501 /// Required. The type of the reschedule the user wants.
13502 pub reschedule: std::option::Option<
13503 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13504 >,
13505
13506 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13507}
13508
13509impl SqlInstancesRescheduleMaintenanceRequestBody {
13510 pub fn new() -> Self {
13511 std::default::Default::default()
13512 }
13513
13514 /// Sets the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13515 ///
13516 /// # Example
13517 /// ```ignore,no_run
13518 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13519 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13520 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_reschedule(Reschedule::default()/* use setters */);
13521 /// ```
13522 pub fn set_reschedule<T>(mut self, v: T) -> Self
13523 where
13524 T: std::convert::Into<
13525 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13526 >,
13527 {
13528 self.reschedule = std::option::Option::Some(v.into());
13529 self
13530 }
13531
13532 /// Sets or clears the value of [reschedule][crate::model::SqlInstancesRescheduleMaintenanceRequestBody::reschedule].
13533 ///
13534 /// # Example
13535 /// ```ignore,no_run
13536 /// # use google_cloud_sql_v1::model::SqlInstancesRescheduleMaintenanceRequestBody;
13537 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13538 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(Some(Reschedule::default()/* use setters */));
13539 /// let x = SqlInstancesRescheduleMaintenanceRequestBody::new().set_or_clear_reschedule(None::<Reschedule>);
13540 /// ```
13541 pub fn set_or_clear_reschedule<T>(mut self, v: std::option::Option<T>) -> Self
13542 where
13543 T: std::convert::Into<
13544 crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule,
13545 >,
13546 {
13547 self.reschedule = v.map(|x| x.into());
13548 self
13549 }
13550}
13551
13552impl wkt::message::Message for SqlInstancesRescheduleMaintenanceRequestBody {
13553 fn typename() -> &'static str {
13554 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody"
13555 }
13556}
13557
13558/// Defines additional types related to [SqlInstancesRescheduleMaintenanceRequestBody].
13559pub mod sql_instances_reschedule_maintenance_request_body {
13560 #[allow(unused_imports)]
13561 use super::*;
13562
13563 #[derive(Clone, Default, PartialEq)]
13564 #[non_exhaustive]
13565 pub struct Reschedule {
13566 /// Required. The type of the reschedule.
13567 pub reschedule_type:
13568 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13569
13570 /// Optional. Timestamp when the maintenance shall be rescheduled to if
13571 /// reschedule_type=SPECIFIC_TIME, in
13572 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
13573 /// `2012-11-15T16:19:00.094Z`.
13574 pub schedule_time: std::option::Option<wkt::Timestamp>,
13575
13576 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13577 }
13578
13579 impl Reschedule {
13580 pub fn new() -> Self {
13581 std::default::Default::default()
13582 }
13583
13584 /// Sets the value of [reschedule_type][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::reschedule_type].
13585 ///
13586 /// # Example
13587 /// ```ignore,no_run
13588 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13589 /// use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::RescheduleType;
13590 /// let x0 = Reschedule::new().set_reschedule_type(RescheduleType::Immediate);
13591 /// let x1 = Reschedule::new().set_reschedule_type(RescheduleType::NextAvailableWindow);
13592 /// let x2 = Reschedule::new().set_reschedule_type(RescheduleType::SpecificTime);
13593 /// ```
13594 pub fn set_reschedule_type<
13595 T: std::convert::Into<
13596 crate::model::sql_instances_reschedule_maintenance_request_body::RescheduleType,
13597 >,
13598 >(
13599 mut self,
13600 v: T,
13601 ) -> Self {
13602 self.reschedule_type = v.into();
13603 self
13604 }
13605
13606 /// Sets the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13607 ///
13608 /// # Example
13609 /// ```ignore,no_run
13610 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13611 /// use wkt::Timestamp;
13612 /// let x = Reschedule::new().set_schedule_time(Timestamp::default()/* use setters */);
13613 /// ```
13614 pub fn set_schedule_time<T>(mut self, v: T) -> Self
13615 where
13616 T: std::convert::Into<wkt::Timestamp>,
13617 {
13618 self.schedule_time = std::option::Option::Some(v.into());
13619 self
13620 }
13621
13622 /// Sets or clears the value of [schedule_time][crate::model::sql_instances_reschedule_maintenance_request_body::Reschedule::schedule_time].
13623 ///
13624 /// # Example
13625 /// ```ignore,no_run
13626 /// # use google_cloud_sql_v1::model::sql_instances_reschedule_maintenance_request_body::Reschedule;
13627 /// use wkt::Timestamp;
13628 /// let x = Reschedule::new().set_or_clear_schedule_time(Some(Timestamp::default()/* use setters */));
13629 /// let x = Reschedule::new().set_or_clear_schedule_time(None::<Timestamp>);
13630 /// ```
13631 pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
13632 where
13633 T: std::convert::Into<wkt::Timestamp>,
13634 {
13635 self.schedule_time = v.map(|x| x.into());
13636 self
13637 }
13638 }
13639
13640 impl wkt::message::Message for Reschedule {
13641 fn typename() -> &'static str {
13642 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule"
13643 }
13644 }
13645
13646 ///
13647 /// # Working with unknown values
13648 ///
13649 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13650 /// additional enum variants at any time. Adding new variants is not considered
13651 /// a breaking change. Applications should write their code in anticipation of:
13652 ///
13653 /// - New values appearing in future releases of the client library, **and**
13654 /// - New values received dynamically, without application changes.
13655 ///
13656 /// Please consult the [Working with enums] section in the user guide for some
13657 /// guidelines.
13658 ///
13659 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13660 #[derive(Clone, Debug, PartialEq)]
13661 #[non_exhaustive]
13662 pub enum RescheduleType {
13663 Unspecified,
13664 /// Reschedules maintenance to happen now (within 5 minutes).
13665 Immediate,
13666 /// Reschedules maintenance to occur within one week from the originally
13667 /// scheduled day and time.
13668 NextAvailableWindow,
13669 /// Reschedules maintenance to a specific time and day.
13670 SpecificTime,
13671 /// If set, the enum was initialized with an unknown value.
13672 ///
13673 /// Applications can examine the value using [RescheduleType::value] or
13674 /// [RescheduleType::name].
13675 UnknownValue(reschedule_type::UnknownValue),
13676 }
13677
13678 #[doc(hidden)]
13679 pub mod reschedule_type {
13680 #[allow(unused_imports)]
13681 use super::*;
13682 #[derive(Clone, Debug, PartialEq)]
13683 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13684 }
13685
13686 impl RescheduleType {
13687 /// Gets the enum value.
13688 ///
13689 /// Returns `None` if the enum contains an unknown value deserialized from
13690 /// the string representation of enums.
13691 pub fn value(&self) -> std::option::Option<i32> {
13692 match self {
13693 Self::Unspecified => std::option::Option::Some(0),
13694 Self::Immediate => std::option::Option::Some(1),
13695 Self::NextAvailableWindow => std::option::Option::Some(2),
13696 Self::SpecificTime => std::option::Option::Some(3),
13697 Self::UnknownValue(u) => u.0.value(),
13698 }
13699 }
13700
13701 /// Gets the enum value as a string.
13702 ///
13703 /// Returns `None` if the enum contains an unknown value deserialized from
13704 /// the integer representation of enums.
13705 pub fn name(&self) -> std::option::Option<&str> {
13706 match self {
13707 Self::Unspecified => std::option::Option::Some("RESCHEDULE_TYPE_UNSPECIFIED"),
13708 Self::Immediate => std::option::Option::Some("IMMEDIATE"),
13709 Self::NextAvailableWindow => std::option::Option::Some("NEXT_AVAILABLE_WINDOW"),
13710 Self::SpecificTime => std::option::Option::Some("SPECIFIC_TIME"),
13711 Self::UnknownValue(u) => u.0.name(),
13712 }
13713 }
13714 }
13715
13716 impl std::default::Default for RescheduleType {
13717 fn default() -> Self {
13718 use std::convert::From;
13719 Self::from(0)
13720 }
13721 }
13722
13723 impl std::fmt::Display for RescheduleType {
13724 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13725 wkt::internal::display_enum(f, self.name(), self.value())
13726 }
13727 }
13728
13729 impl std::convert::From<i32> for RescheduleType {
13730 fn from(value: i32) -> Self {
13731 match value {
13732 0 => Self::Unspecified,
13733 1 => Self::Immediate,
13734 2 => Self::NextAvailableWindow,
13735 3 => Self::SpecificTime,
13736 _ => Self::UnknownValue(reschedule_type::UnknownValue(
13737 wkt::internal::UnknownEnumValue::Integer(value),
13738 )),
13739 }
13740 }
13741 }
13742
13743 impl std::convert::From<&str> for RescheduleType {
13744 fn from(value: &str) -> Self {
13745 use std::string::ToString;
13746 match value {
13747 "RESCHEDULE_TYPE_UNSPECIFIED" => Self::Unspecified,
13748 "IMMEDIATE" => Self::Immediate,
13749 "NEXT_AVAILABLE_WINDOW" => Self::NextAvailableWindow,
13750 "SPECIFIC_TIME" => Self::SpecificTime,
13751 _ => Self::UnknownValue(reschedule_type::UnknownValue(
13752 wkt::internal::UnknownEnumValue::String(value.to_string()),
13753 )),
13754 }
13755 }
13756 }
13757
13758 impl serde::ser::Serialize for RescheduleType {
13759 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13760 where
13761 S: serde::Serializer,
13762 {
13763 match self {
13764 Self::Unspecified => serializer.serialize_i32(0),
13765 Self::Immediate => serializer.serialize_i32(1),
13766 Self::NextAvailableWindow => serializer.serialize_i32(2),
13767 Self::SpecificTime => serializer.serialize_i32(3),
13768 Self::UnknownValue(u) => u.0.serialize(serializer),
13769 }
13770 }
13771 }
13772
13773 impl<'de> serde::de::Deserialize<'de> for RescheduleType {
13774 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13775 where
13776 D: serde::Deserializer<'de>,
13777 {
13778 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RescheduleType>::new(
13779 ".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType",
13780 ))
13781 }
13782 }
13783}
13784
13785/// Database instance demote primary instance context.
13786#[derive(Clone, Default, PartialEq)]
13787#[non_exhaustive]
13788pub struct DemoteMasterContext {
13789 /// This is always `sql#demoteMasterContext`.
13790 pub kind: std::string::String,
13791
13792 /// Verify the GTID consistency for demote operation. Default value:
13793 /// `True`. Setting this flag to `false` enables you to bypass the GTID
13794 /// consistency check between on-premises primary instance and Cloud SQL
13795 /// instance during the demotion operation but also exposes you to the risk of
13796 /// future replication failures. Change the value only if you know the reason
13797 /// for the GTID divergence and are confident that doing so will not cause any
13798 /// replication issues.
13799 pub verify_gtid_consistency: std::option::Option<wkt::BoolValue>,
13800
13801 /// The name of the instance which will act as on-premises primary instance
13802 /// in the replication setup.
13803 pub master_instance_name: std::string::String,
13804
13805 /// Configuration specific to read-replicas replicating from the on-premises
13806 /// primary instance.
13807 pub replica_configuration: std::option::Option<crate::model::DemoteMasterConfiguration>,
13808
13809 /// Flag to skip replication setup on the instance.
13810 pub skip_replication_setup: bool,
13811
13812 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13813}
13814
13815impl DemoteMasterContext {
13816 pub fn new() -> Self {
13817 std::default::Default::default()
13818 }
13819
13820 /// Sets the value of [kind][crate::model::DemoteMasterContext::kind].
13821 ///
13822 /// # Example
13823 /// ```ignore,no_run
13824 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13825 /// let x = DemoteMasterContext::new().set_kind("example");
13826 /// ```
13827 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13828 self.kind = v.into();
13829 self
13830 }
13831
13832 /// Sets the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13833 ///
13834 /// # Example
13835 /// ```ignore,no_run
13836 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13837 /// use wkt::BoolValue;
13838 /// let x = DemoteMasterContext::new().set_verify_gtid_consistency(BoolValue::default()/* use setters */);
13839 /// ```
13840 pub fn set_verify_gtid_consistency<T>(mut self, v: T) -> Self
13841 where
13842 T: std::convert::Into<wkt::BoolValue>,
13843 {
13844 self.verify_gtid_consistency = std::option::Option::Some(v.into());
13845 self
13846 }
13847
13848 /// Sets or clears the value of [verify_gtid_consistency][crate::model::DemoteMasterContext::verify_gtid_consistency].
13849 ///
13850 /// # Example
13851 /// ```ignore,no_run
13852 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13853 /// use wkt::BoolValue;
13854 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(Some(BoolValue::default()/* use setters */));
13855 /// let x = DemoteMasterContext::new().set_or_clear_verify_gtid_consistency(None::<BoolValue>);
13856 /// ```
13857 pub fn set_or_clear_verify_gtid_consistency<T>(mut self, v: std::option::Option<T>) -> Self
13858 where
13859 T: std::convert::Into<wkt::BoolValue>,
13860 {
13861 self.verify_gtid_consistency = v.map(|x| x.into());
13862 self
13863 }
13864
13865 /// Sets the value of [master_instance_name][crate::model::DemoteMasterContext::master_instance_name].
13866 ///
13867 /// # Example
13868 /// ```ignore,no_run
13869 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13870 /// let x = DemoteMasterContext::new().set_master_instance_name("example");
13871 /// ```
13872 pub fn set_master_instance_name<T: std::convert::Into<std::string::String>>(
13873 mut self,
13874 v: T,
13875 ) -> Self {
13876 self.master_instance_name = v.into();
13877 self
13878 }
13879
13880 /// Sets the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
13881 ///
13882 /// # Example
13883 /// ```ignore,no_run
13884 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13885 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13886 /// let x = DemoteMasterContext::new().set_replica_configuration(DemoteMasterConfiguration::default()/* use setters */);
13887 /// ```
13888 pub fn set_replica_configuration<T>(mut self, v: T) -> Self
13889 where
13890 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
13891 {
13892 self.replica_configuration = std::option::Option::Some(v.into());
13893 self
13894 }
13895
13896 /// Sets or clears the value of [replica_configuration][crate::model::DemoteMasterContext::replica_configuration].
13897 ///
13898 /// # Example
13899 /// ```ignore,no_run
13900 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13901 /// use google_cloud_sql_v1::model::DemoteMasterConfiguration;
13902 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(Some(DemoteMasterConfiguration::default()/* use setters */));
13903 /// let x = DemoteMasterContext::new().set_or_clear_replica_configuration(None::<DemoteMasterConfiguration>);
13904 /// ```
13905 pub fn set_or_clear_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
13906 where
13907 T: std::convert::Into<crate::model::DemoteMasterConfiguration>,
13908 {
13909 self.replica_configuration = v.map(|x| x.into());
13910 self
13911 }
13912
13913 /// Sets the value of [skip_replication_setup][crate::model::DemoteMasterContext::skip_replication_setup].
13914 ///
13915 /// # Example
13916 /// ```ignore,no_run
13917 /// # use google_cloud_sql_v1::model::DemoteMasterContext;
13918 /// let x = DemoteMasterContext::new().set_skip_replication_setup(true);
13919 /// ```
13920 pub fn set_skip_replication_setup<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13921 self.skip_replication_setup = v.into();
13922 self
13923 }
13924}
13925
13926impl wkt::message::Message for DemoteMasterContext {
13927 fn typename() -> &'static str {
13928 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterContext"
13929 }
13930}
13931
13932/// This context is used to demote an existing standalone instance to be
13933/// a Cloud SQL read replica for an external database server.
13934#[derive(Clone, Default, PartialEq)]
13935#[non_exhaustive]
13936pub struct DemoteContext {
13937 /// This is always `sql#demoteContext`.
13938 pub kind: std::string::String,
13939
13940 /// Required. The name of the instance which acts as the on-premises primary
13941 /// instance in the replication setup.
13942 pub source_representative_instance_name: std::string::String,
13943
13944 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13945}
13946
13947impl DemoteContext {
13948 pub fn new() -> Self {
13949 std::default::Default::default()
13950 }
13951
13952 /// Sets the value of [kind][crate::model::DemoteContext::kind].
13953 ///
13954 /// # Example
13955 /// ```ignore,no_run
13956 /// # use google_cloud_sql_v1::model::DemoteContext;
13957 /// let x = DemoteContext::new().set_kind("example");
13958 /// ```
13959 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13960 self.kind = v.into();
13961 self
13962 }
13963
13964 /// Sets the value of [source_representative_instance_name][crate::model::DemoteContext::source_representative_instance_name].
13965 ///
13966 /// # Example
13967 /// ```ignore,no_run
13968 /// # use google_cloud_sql_v1::model::DemoteContext;
13969 /// let x = DemoteContext::new().set_source_representative_instance_name("example");
13970 /// ```
13971 pub fn set_source_representative_instance_name<T: std::convert::Into<std::string::String>>(
13972 mut self,
13973 v: T,
13974 ) -> Self {
13975 self.source_representative_instance_name = v.into();
13976 self
13977 }
13978}
13979
13980impl wkt::message::Message for DemoteContext {
13981 fn typename() -> &'static str {
13982 "type.googleapis.com/google.cloud.sql.v1.DemoteContext"
13983 }
13984}
13985
13986/// Database instance failover context.
13987#[derive(Clone, Default, PartialEq)]
13988#[non_exhaustive]
13989pub struct FailoverContext {
13990 /// The current settings version of this instance. Request will be rejected if
13991 /// this version doesn't match the current settings version.
13992 pub settings_version: i64,
13993
13994 /// This is always `sql#failoverContext`.
13995 pub kind: std::string::String,
13996
13997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13998}
13999
14000impl FailoverContext {
14001 pub fn new() -> Self {
14002 std::default::Default::default()
14003 }
14004
14005 /// Sets the value of [settings_version][crate::model::FailoverContext::settings_version].
14006 ///
14007 /// # Example
14008 /// ```ignore,no_run
14009 /// # use google_cloud_sql_v1::model::FailoverContext;
14010 /// let x = FailoverContext::new().set_settings_version(42);
14011 /// ```
14012 pub fn set_settings_version<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14013 self.settings_version = v.into();
14014 self
14015 }
14016
14017 /// Sets the value of [kind][crate::model::FailoverContext::kind].
14018 ///
14019 /// # Example
14020 /// ```ignore,no_run
14021 /// # use google_cloud_sql_v1::model::FailoverContext;
14022 /// let x = FailoverContext::new().set_kind("example");
14023 /// ```
14024 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14025 self.kind = v.into();
14026 self
14027 }
14028}
14029
14030impl wkt::message::Message for FailoverContext {
14031 fn typename() -> &'static str {
14032 "type.googleapis.com/google.cloud.sql.v1.FailoverContext"
14033 }
14034}
14035
14036/// Database instance restore from backup context.
14037/// Backup context contains source instance id and project id.
14038#[derive(Clone, Default, PartialEq)]
14039#[non_exhaustive]
14040pub struct RestoreBackupContext {
14041 /// This is always `sql#restoreBackupContext`.
14042 pub kind: std::string::String,
14043
14044 /// The ID of the backup run to restore from.
14045 pub backup_run_id: i64,
14046
14047 /// The ID of the instance that the backup was taken from.
14048 pub instance_id: std::string::String,
14049
14050 /// The full project ID of the source instance.
14051 pub project: std::string::String,
14052
14053 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14054}
14055
14056impl RestoreBackupContext {
14057 pub fn new() -> Self {
14058 std::default::Default::default()
14059 }
14060
14061 /// Sets the value of [kind][crate::model::RestoreBackupContext::kind].
14062 ///
14063 /// # Example
14064 /// ```ignore,no_run
14065 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14066 /// let x = RestoreBackupContext::new().set_kind("example");
14067 /// ```
14068 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14069 self.kind = v.into();
14070 self
14071 }
14072
14073 /// Sets the value of [backup_run_id][crate::model::RestoreBackupContext::backup_run_id].
14074 ///
14075 /// # Example
14076 /// ```ignore,no_run
14077 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14078 /// let x = RestoreBackupContext::new().set_backup_run_id(42);
14079 /// ```
14080 pub fn set_backup_run_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14081 self.backup_run_id = v.into();
14082 self
14083 }
14084
14085 /// Sets the value of [instance_id][crate::model::RestoreBackupContext::instance_id].
14086 ///
14087 /// # Example
14088 /// ```ignore,no_run
14089 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14090 /// let x = RestoreBackupContext::new().set_instance_id("example");
14091 /// ```
14092 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14093 self.instance_id = v.into();
14094 self
14095 }
14096
14097 /// Sets the value of [project][crate::model::RestoreBackupContext::project].
14098 ///
14099 /// # Example
14100 /// ```ignore,no_run
14101 /// # use google_cloud_sql_v1::model::RestoreBackupContext;
14102 /// let x = RestoreBackupContext::new().set_project("example");
14103 /// ```
14104 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14105 self.project = v.into();
14106 self
14107 }
14108}
14109
14110impl wkt::message::Message for RestoreBackupContext {
14111 fn typename() -> &'static str {
14112 "type.googleapis.com/google.cloud.sql.v1.RestoreBackupContext"
14113 }
14114}
14115
14116/// Instance rotate server CA context.
14117#[derive(Clone, Default, PartialEq)]
14118#[non_exhaustive]
14119pub struct RotateServerCaContext {
14120 /// This is always `sql#rotateServerCaContext`.
14121 pub kind: std::string::String,
14122
14123 /// The fingerprint of the next version to be rotated to. If left unspecified,
14124 /// will be rotated to the most recently added server CA version.
14125 pub next_version: std::string::String,
14126
14127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14128}
14129
14130impl RotateServerCaContext {
14131 pub fn new() -> Self {
14132 std::default::Default::default()
14133 }
14134
14135 /// Sets the value of [kind][crate::model::RotateServerCaContext::kind].
14136 ///
14137 /// # Example
14138 /// ```ignore,no_run
14139 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14140 /// let x = RotateServerCaContext::new().set_kind("example");
14141 /// ```
14142 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14143 self.kind = v.into();
14144 self
14145 }
14146
14147 /// Sets the value of [next_version][crate::model::RotateServerCaContext::next_version].
14148 ///
14149 /// # Example
14150 /// ```ignore,no_run
14151 /// # use google_cloud_sql_v1::model::RotateServerCaContext;
14152 /// let x = RotateServerCaContext::new().set_next_version("example");
14153 /// ```
14154 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14155 self.next_version = v.into();
14156 self
14157 }
14158}
14159
14160impl wkt::message::Message for RotateServerCaContext {
14161 fn typename() -> &'static str {
14162 "type.googleapis.com/google.cloud.sql.v1.RotateServerCaContext"
14163 }
14164}
14165
14166/// Instance rotate server certificate context.
14167#[derive(Clone, Default, PartialEq)]
14168#[non_exhaustive]
14169pub struct RotateServerCertificateContext {
14170 /// Optional. This is always `sql#rotateServerCertificateContext`.
14171 pub kind: std::string::String,
14172
14173 /// The fingerprint of the next version to be rotated to. If left unspecified,
14174 /// will be rotated to the most recently added server certificate version.
14175 pub next_version: std::string::String,
14176
14177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14178}
14179
14180impl RotateServerCertificateContext {
14181 pub fn new() -> Self {
14182 std::default::Default::default()
14183 }
14184
14185 /// Sets the value of [kind][crate::model::RotateServerCertificateContext::kind].
14186 ///
14187 /// # Example
14188 /// ```ignore,no_run
14189 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14190 /// let x = RotateServerCertificateContext::new().set_kind("example");
14191 /// ```
14192 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14193 self.kind = v.into();
14194 self
14195 }
14196
14197 /// Sets the value of [next_version][crate::model::RotateServerCertificateContext::next_version].
14198 ///
14199 /// # Example
14200 /// ```ignore,no_run
14201 /// # use google_cloud_sql_v1::model::RotateServerCertificateContext;
14202 /// let x = RotateServerCertificateContext::new().set_next_version("example");
14203 /// ```
14204 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14205 self.next_version = v.into();
14206 self
14207 }
14208}
14209
14210impl wkt::message::Message for RotateServerCertificateContext {
14211 fn typename() -> &'static str {
14212 "type.googleapis.com/google.cloud.sql.v1.RotateServerCertificateContext"
14213 }
14214}
14215
14216/// Instance rotate Entra ID certificate context.
14217#[derive(Clone, Default, PartialEq)]
14218#[non_exhaustive]
14219pub struct RotateEntraIdCertificateContext {
14220 /// Optional. This is always `sql#rotateEntraIdCertificateContext`.
14221 pub kind: std::string::String,
14222
14223 /// Optional. The fingerprint of the next version to be rotated to. If left
14224 /// unspecified, will be rotated to the most recently added server certificate
14225 /// version.
14226 pub next_version: std::string::String,
14227
14228 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14229}
14230
14231impl RotateEntraIdCertificateContext {
14232 pub fn new() -> Self {
14233 std::default::Default::default()
14234 }
14235
14236 /// Sets the value of [kind][crate::model::RotateEntraIdCertificateContext::kind].
14237 ///
14238 /// # Example
14239 /// ```ignore,no_run
14240 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14241 /// let x = RotateEntraIdCertificateContext::new().set_kind("example");
14242 /// ```
14243 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14244 self.kind = v.into();
14245 self
14246 }
14247
14248 /// Sets the value of [next_version][crate::model::RotateEntraIdCertificateContext::next_version].
14249 ///
14250 /// # Example
14251 /// ```ignore,no_run
14252 /// # use google_cloud_sql_v1::model::RotateEntraIdCertificateContext;
14253 /// let x = RotateEntraIdCertificateContext::new().set_next_version("example");
14254 /// ```
14255 pub fn set_next_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14256 self.next_version = v.into();
14257 self
14258 }
14259}
14260
14261impl wkt::message::Message for RotateEntraIdCertificateContext {
14262 fn typename() -> &'static str {
14263 "type.googleapis.com/google.cloud.sql.v1.RotateEntraIdCertificateContext"
14264 }
14265}
14266
14267/// Database Instance truncate log context.
14268#[derive(Clone, Default, PartialEq)]
14269#[non_exhaustive]
14270pub struct TruncateLogContext {
14271 /// This is always `sql#truncateLogContext`.
14272 pub kind: std::string::String,
14273
14274 /// The type of log to truncate. Valid values are `MYSQL_GENERAL_TABLE` and
14275 /// `MYSQL_SLOW_TABLE`.
14276 pub log_type: std::string::String,
14277
14278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14279}
14280
14281impl TruncateLogContext {
14282 pub fn new() -> Self {
14283 std::default::Default::default()
14284 }
14285
14286 /// Sets the value of [kind][crate::model::TruncateLogContext::kind].
14287 ///
14288 /// # Example
14289 /// ```ignore,no_run
14290 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14291 /// let x = TruncateLogContext::new().set_kind("example");
14292 /// ```
14293 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14294 self.kind = v.into();
14295 self
14296 }
14297
14298 /// Sets the value of [log_type][crate::model::TruncateLogContext::log_type].
14299 ///
14300 /// # Example
14301 /// ```ignore,no_run
14302 /// # use google_cloud_sql_v1::model::TruncateLogContext;
14303 /// let x = TruncateLogContext::new().set_log_type("example");
14304 /// ```
14305 pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14306 self.log_type = v.into();
14307 self
14308 }
14309}
14310
14311impl wkt::message::Message for TruncateLogContext {
14312 fn typename() -> &'static str {
14313 "type.googleapis.com/google.cloud.sql.v1.TruncateLogContext"
14314 }
14315}
14316
14317/// External primary instance migration setting error/warning.
14318#[derive(Clone, Default, PartialEq)]
14319#[non_exhaustive]
14320pub struct SqlExternalSyncSettingError {
14321 /// Can be `sql#externalSyncSettingError` or
14322 /// `sql#externalSyncSettingWarning`.
14323 pub kind: std::string::String,
14324
14325 /// Identifies the specific error that occurred.
14326 pub r#type: crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14327
14328 /// Additional information about the error encountered.
14329 pub detail: std::string::String,
14330
14331 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14332}
14333
14334impl SqlExternalSyncSettingError {
14335 pub fn new() -> Self {
14336 std::default::Default::default()
14337 }
14338
14339 /// Sets the value of [kind][crate::model::SqlExternalSyncSettingError::kind].
14340 ///
14341 /// # Example
14342 /// ```ignore,no_run
14343 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14344 /// let x = SqlExternalSyncSettingError::new().set_kind("example");
14345 /// ```
14346 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14347 self.kind = v.into();
14348 self
14349 }
14350
14351 /// Sets the value of [r#type][crate::model::SqlExternalSyncSettingError::type].
14352 ///
14353 /// # Example
14354 /// ```ignore,no_run
14355 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14356 /// use google_cloud_sql_v1::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType;
14357 /// let x0 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::ConnectionFailure);
14358 /// let x1 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::BinlogNotEnabled);
14359 /// let x2 = SqlExternalSyncSettingError::new().set_type(SqlExternalSyncSettingErrorType::IncompatibleDatabaseVersion);
14360 /// ```
14361 pub fn set_type<
14362 T: std::convert::Into<
14363 crate::model::sql_external_sync_setting_error::SqlExternalSyncSettingErrorType,
14364 >,
14365 >(
14366 mut self,
14367 v: T,
14368 ) -> Self {
14369 self.r#type = v.into();
14370 self
14371 }
14372
14373 /// Sets the value of [detail][crate::model::SqlExternalSyncSettingError::detail].
14374 ///
14375 /// # Example
14376 /// ```ignore,no_run
14377 /// # use google_cloud_sql_v1::model::SqlExternalSyncSettingError;
14378 /// let x = SqlExternalSyncSettingError::new().set_detail("example");
14379 /// ```
14380 pub fn set_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14381 self.detail = v.into();
14382 self
14383 }
14384}
14385
14386impl wkt::message::Message for SqlExternalSyncSettingError {
14387 fn typename() -> &'static str {
14388 "type.googleapis.com/google.cloud.sql.v1.SqlExternalSyncSettingError"
14389 }
14390}
14391
14392/// Defines additional types related to [SqlExternalSyncSettingError].
14393pub mod sql_external_sync_setting_error {
14394 #[allow(unused_imports)]
14395 use super::*;
14396
14397 ///
14398 /// # Working with unknown values
14399 ///
14400 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14401 /// additional enum variants at any time. Adding new variants is not considered
14402 /// a breaking change. Applications should write their code in anticipation of:
14403 ///
14404 /// - New values appearing in future releases of the client library, **and**
14405 /// - New values received dynamically, without application changes.
14406 ///
14407 /// Please consult the [Working with enums] section in the user guide for some
14408 /// guidelines.
14409 ///
14410 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14411 #[derive(Clone, Debug, PartialEq)]
14412 #[non_exhaustive]
14413 pub enum SqlExternalSyncSettingErrorType {
14414 Unspecified,
14415 ConnectionFailure,
14416 BinlogNotEnabled,
14417 IncompatibleDatabaseVersion,
14418 ReplicaAlreadySetup,
14419 /// The replication user is missing privileges that are required.
14420 InsufficientPrivilege,
14421 /// Unsupported migration type.
14422 UnsupportedMigrationType,
14423 /// No pglogical extension installed on databases, applicable for postgres.
14424 NoPglogicalInstalled,
14425 /// pglogical node already exists on databases, applicable for postgres.
14426 PglogicalNodeAlreadyExists,
14427 /// The value of parameter wal_level is not set to logical.
14428 InvalidWalLevel,
14429 /// The value of parameter shared_preload_libraries does not include
14430 /// pglogical.
14431 InvalidSharedPreloadLibrary,
14432 /// The value of parameter max_replication_slots is not sufficient.
14433 InsufficientMaxReplicationSlots,
14434 /// The value of parameter max_wal_senders is not sufficient.
14435 InsufficientMaxWalSenders,
14436 /// The value of parameter max_worker_processes is not sufficient.
14437 InsufficientMaxWorkerProcesses,
14438 /// Extensions installed are either not supported or having unsupported
14439 /// versions.
14440 UnsupportedExtensions,
14441 /// The value of parameter rds.logical_replication is not set to 1.
14442 InvalidRdsLogicalReplication,
14443 /// The primary instance logging setup doesn't allow EM sync.
14444 InvalidLoggingSetup,
14445 /// The primary instance database parameter setup doesn't allow EM sync.
14446 InvalidDbParam,
14447 /// The gtid_mode is not supported, applicable for MySQL.
14448 UnsupportedGtidMode,
14449 /// SQL Server Agent is not running.
14450 SqlserverAgentNotRunning,
14451 /// The table definition is not support due to missing primary key or replica
14452 /// identity, applicable for postgres. Note that this is a warning and won't
14453 /// block the migration.
14454 UnsupportedTableDefinition,
14455 /// The customer has a definer that will break EM setup.
14456 UnsupportedDefiner,
14457 /// SQL Server @@SERVERNAME does not match actual host name.
14458 SqlserverServernameMismatch,
14459 /// The primary instance has been setup and will fail the setup.
14460 PrimaryAlreadySetup,
14461 /// The primary instance has unsupported binary log format.
14462 UnsupportedBinlogFormat,
14463 /// The primary instance's binary log retention setting.
14464 BinlogRetentionSetting,
14465 /// The primary instance has tables with unsupported storage engine.
14466 UnsupportedStorageEngine,
14467 /// Source has tables with limited support
14468 /// eg: PostgreSQL tables without primary keys.
14469 LimitedSupportTables,
14470 /// The replica instance contains existing data.
14471 ExistingDataInReplica,
14472 /// The replication user is missing privileges that are optional.
14473 MissingOptionalPrivileges,
14474 /// Additional BACKUP_ADMIN privilege is granted to the replication user
14475 /// which may lock source MySQL 8 instance for DDLs during initial sync.
14476 RiskyBackupAdminPrivilege,
14477 /// The Cloud Storage bucket is missing necessary permissions.
14478 InsufficientGcsPermissions,
14479 /// The Cloud Storage bucket has an error in the file or contains invalid
14480 /// file information.
14481 InvalidFileInfo,
14482 /// The source instance has unsupported database settings for migration.
14483 UnsupportedDatabaseSettings,
14484 /// The replication user is missing parallel import specific privileges.
14485 /// (e.g. LOCK TABLES) for MySQL.
14486 MysqlParallelImportInsufficientPrivilege,
14487 /// The global variable local_infile is off on external server replica.
14488 LocalInfileOff,
14489 /// This code instructs customers to turn on point-in-time recovery manually
14490 /// for the instance after promoting the Cloud SQL for PostgreSQL instance.
14491 TurnOnPitrAfterPromote,
14492 /// The minor version of replica database is incompatible with the source.
14493 IncompatibleDatabaseMinorVersion,
14494 /// This warning message indicates that Cloud SQL uses the maximum number of
14495 /// subscriptions to migrate data from the source to the destination.
14496 SourceMaxSubscriptions,
14497 /// Unable to verify definers on the source for MySQL.
14498 UnableToVerifyDefiners,
14499 /// If a time out occurs while the subscription counts are calculated, then
14500 /// this value is set to 1. Otherwise, this value is set to 2.
14501 SubscriptionCalculationStatus,
14502 /// Count of subscriptions needed to sync source data for PostgreSQL
14503 /// database.
14504 PgSubscriptionCount,
14505 /// Final parallel level that is used to do migration.
14506 PgSyncParallelLevel,
14507 /// The disk size of the replica instance is smaller than the data size of
14508 /// the source instance.
14509 InsufficientDiskSize,
14510 /// The data size of the source instance is greater than 1 TB, the number of
14511 /// cores of the replica instance is less than 8, and the memory of the
14512 /// replica is less than 32 GB.
14513 InsufficientMachineTier,
14514 /// The warning message indicates the unsupported extensions will not be
14515 /// migrated to the destination.
14516 UnsupportedExtensionsNotMigrated,
14517 /// The warning message indicates the pg_cron extension and settings will not
14518 /// be migrated to the destination.
14519 ExtensionsNotMigrated,
14520 /// The error message indicates that pg_cron flags are enabled on the
14521 /// destination which is not supported during the migration.
14522 PgCronFlagEnabledInReplica,
14523 /// This error message indicates that the specified extensions are not
14524 /// enabled on destination instance. For example, before you can migrate
14525 /// data to the destination instance, you must enable the PGAudit extension
14526 /// on the instance.
14527 ExtensionsNotEnabledInReplica,
14528 /// The source database has generated columns that can't be migrated. Please
14529 /// change them to regular columns before migration.
14530 UnsupportedColumns,
14531 /// The source database has users that aren't created in the replica.
14532 /// First, create all users, which are in the pg_user_mappings table
14533 /// of the source database, in the destination instance. Then, perform the
14534 /// migration.
14535 UsersNotCreatedInReplica,
14536 /// The selected objects include system objects that aren't supported for
14537 /// migration.
14538 UnsupportedSystemObjects,
14539 /// The source database has tables with the FULL or NOTHING replica identity.
14540 /// Before starting your migration, either remove the identity or change it
14541 /// to DEFAULT. Note that this is an error and will block the migration.
14542 UnsupportedTablesWithReplicaIdentity,
14543 /// The selected objects don't exist on the source instance.
14544 SelectedObjectsNotExistOnSource,
14545 /// PSC only destination instance does not have a network attachment URI.
14546 PscOnlyInstanceWithNoNetworkAttachmentUri,
14547 /// Selected objects reference unselected objects. Based on their object type
14548 /// (foreign key constraint or view), selected objects will fail during
14549 /// migration.
14550 SelectedObjectsReferenceUnselectedObjects,
14551 /// The migration will delete existing data in the replica; set
14552 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14553 /// in the request to acknowledge this. This is an error. MySQL only.
14554 ///
14555 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14556 PromptDeleteExisting,
14557 /// The migration will delete existing data in the replica;
14558 /// [replica_overwrite_enabled][google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]
14559 /// was set in the request acknowledging this. This is a warning rather than
14560 /// an error. MySQL only.
14561 ///
14562 /// [google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.replica_overwrite_enabled]: crate::model::SqlInstancesStartExternalSyncRequest::replica_overwrite_enabled
14563 WillDeleteExisting,
14564 /// The replication user is missing specific privileges to setup DDL
14565 /// replication. (e.g. CREATE EVENT TRIGGER, CREATE SCHEMA) for PostgreSQL.
14566 PgDdlReplicationInsufficientPrivilege,
14567 /// If set, the enum was initialized with an unknown value.
14568 ///
14569 /// Applications can examine the value using [SqlExternalSyncSettingErrorType::value] or
14570 /// [SqlExternalSyncSettingErrorType::name].
14571 UnknownValue(sql_external_sync_setting_error_type::UnknownValue),
14572 }
14573
14574 #[doc(hidden)]
14575 pub mod sql_external_sync_setting_error_type {
14576 #[allow(unused_imports)]
14577 use super::*;
14578 #[derive(Clone, Debug, PartialEq)]
14579 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14580 }
14581
14582 impl SqlExternalSyncSettingErrorType {
14583 /// Gets the enum value.
14584 ///
14585 /// Returns `None` if the enum contains an unknown value deserialized from
14586 /// the string representation of enums.
14587 pub fn value(&self) -> std::option::Option<i32> {
14588 match self {
14589 Self::Unspecified => std::option::Option::Some(0),
14590 Self::ConnectionFailure => std::option::Option::Some(1),
14591 Self::BinlogNotEnabled => std::option::Option::Some(2),
14592 Self::IncompatibleDatabaseVersion => std::option::Option::Some(3),
14593 Self::ReplicaAlreadySetup => std::option::Option::Some(4),
14594 Self::InsufficientPrivilege => std::option::Option::Some(5),
14595 Self::UnsupportedMigrationType => std::option::Option::Some(6),
14596 Self::NoPglogicalInstalled => std::option::Option::Some(7),
14597 Self::PglogicalNodeAlreadyExists => std::option::Option::Some(8),
14598 Self::InvalidWalLevel => std::option::Option::Some(9),
14599 Self::InvalidSharedPreloadLibrary => std::option::Option::Some(10),
14600 Self::InsufficientMaxReplicationSlots => std::option::Option::Some(11),
14601 Self::InsufficientMaxWalSenders => std::option::Option::Some(12),
14602 Self::InsufficientMaxWorkerProcesses => std::option::Option::Some(13),
14603 Self::UnsupportedExtensions => std::option::Option::Some(14),
14604 Self::InvalidRdsLogicalReplication => std::option::Option::Some(15),
14605 Self::InvalidLoggingSetup => std::option::Option::Some(16),
14606 Self::InvalidDbParam => std::option::Option::Some(17),
14607 Self::UnsupportedGtidMode => std::option::Option::Some(18),
14608 Self::SqlserverAgentNotRunning => std::option::Option::Some(19),
14609 Self::UnsupportedTableDefinition => std::option::Option::Some(20),
14610 Self::UnsupportedDefiner => std::option::Option::Some(21),
14611 Self::SqlserverServernameMismatch => std::option::Option::Some(22),
14612 Self::PrimaryAlreadySetup => std::option::Option::Some(23),
14613 Self::UnsupportedBinlogFormat => std::option::Option::Some(24),
14614 Self::BinlogRetentionSetting => std::option::Option::Some(25),
14615 Self::UnsupportedStorageEngine => std::option::Option::Some(26),
14616 Self::LimitedSupportTables => std::option::Option::Some(27),
14617 Self::ExistingDataInReplica => std::option::Option::Some(28),
14618 Self::MissingOptionalPrivileges => std::option::Option::Some(29),
14619 Self::RiskyBackupAdminPrivilege => std::option::Option::Some(30),
14620 Self::InsufficientGcsPermissions => std::option::Option::Some(31),
14621 Self::InvalidFileInfo => std::option::Option::Some(32),
14622 Self::UnsupportedDatabaseSettings => std::option::Option::Some(33),
14623 Self::MysqlParallelImportInsufficientPrivilege => std::option::Option::Some(34),
14624 Self::LocalInfileOff => std::option::Option::Some(35),
14625 Self::TurnOnPitrAfterPromote => std::option::Option::Some(36),
14626 Self::IncompatibleDatabaseMinorVersion => std::option::Option::Some(37),
14627 Self::SourceMaxSubscriptions => std::option::Option::Some(38),
14628 Self::UnableToVerifyDefiners => std::option::Option::Some(39),
14629 Self::SubscriptionCalculationStatus => std::option::Option::Some(40),
14630 Self::PgSubscriptionCount => std::option::Option::Some(41),
14631 Self::PgSyncParallelLevel => std::option::Option::Some(42),
14632 Self::InsufficientDiskSize => std::option::Option::Some(43),
14633 Self::InsufficientMachineTier => std::option::Option::Some(44),
14634 Self::UnsupportedExtensionsNotMigrated => std::option::Option::Some(45),
14635 Self::ExtensionsNotMigrated => std::option::Option::Some(46),
14636 Self::PgCronFlagEnabledInReplica => std::option::Option::Some(47),
14637 Self::ExtensionsNotEnabledInReplica => std::option::Option::Some(48),
14638 Self::UnsupportedColumns => std::option::Option::Some(49),
14639 Self::UsersNotCreatedInReplica => std::option::Option::Some(50),
14640 Self::UnsupportedSystemObjects => std::option::Option::Some(51),
14641 Self::UnsupportedTablesWithReplicaIdentity => std::option::Option::Some(52),
14642 Self::SelectedObjectsNotExistOnSource => std::option::Option::Some(53),
14643 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => std::option::Option::Some(54),
14644 Self::SelectedObjectsReferenceUnselectedObjects => std::option::Option::Some(55),
14645 Self::PromptDeleteExisting => std::option::Option::Some(56),
14646 Self::WillDeleteExisting => std::option::Option::Some(57),
14647 Self::PgDdlReplicationInsufficientPrivilege => std::option::Option::Some(58),
14648 Self::UnknownValue(u) => u.0.value(),
14649 }
14650 }
14651
14652 /// Gets the enum value as a string.
14653 ///
14654 /// Returns `None` if the enum contains an unknown value deserialized from
14655 /// the integer representation of enums.
14656 pub fn name(&self) -> std::option::Option<&str> {
14657 match self {
14658 Self::Unspecified => {
14659 std::option::Option::Some("SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED")
14660 }
14661 Self::ConnectionFailure => std::option::Option::Some("CONNECTION_FAILURE"),
14662 Self::BinlogNotEnabled => std::option::Option::Some("BINLOG_NOT_ENABLED"),
14663 Self::IncompatibleDatabaseVersion => {
14664 std::option::Option::Some("INCOMPATIBLE_DATABASE_VERSION")
14665 }
14666 Self::ReplicaAlreadySetup => std::option::Option::Some("REPLICA_ALREADY_SETUP"),
14667 Self::InsufficientPrivilege => std::option::Option::Some("INSUFFICIENT_PRIVILEGE"),
14668 Self::UnsupportedMigrationType => {
14669 std::option::Option::Some("UNSUPPORTED_MIGRATION_TYPE")
14670 }
14671 Self::NoPglogicalInstalled => std::option::Option::Some("NO_PGLOGICAL_INSTALLED"),
14672 Self::PglogicalNodeAlreadyExists => {
14673 std::option::Option::Some("PGLOGICAL_NODE_ALREADY_EXISTS")
14674 }
14675 Self::InvalidWalLevel => std::option::Option::Some("INVALID_WAL_LEVEL"),
14676 Self::InvalidSharedPreloadLibrary => {
14677 std::option::Option::Some("INVALID_SHARED_PRELOAD_LIBRARY")
14678 }
14679 Self::InsufficientMaxReplicationSlots => {
14680 std::option::Option::Some("INSUFFICIENT_MAX_REPLICATION_SLOTS")
14681 }
14682 Self::InsufficientMaxWalSenders => {
14683 std::option::Option::Some("INSUFFICIENT_MAX_WAL_SENDERS")
14684 }
14685 Self::InsufficientMaxWorkerProcesses => {
14686 std::option::Option::Some("INSUFFICIENT_MAX_WORKER_PROCESSES")
14687 }
14688 Self::UnsupportedExtensions => std::option::Option::Some("UNSUPPORTED_EXTENSIONS"),
14689 Self::InvalidRdsLogicalReplication => {
14690 std::option::Option::Some("INVALID_RDS_LOGICAL_REPLICATION")
14691 }
14692 Self::InvalidLoggingSetup => std::option::Option::Some("INVALID_LOGGING_SETUP"),
14693 Self::InvalidDbParam => std::option::Option::Some("INVALID_DB_PARAM"),
14694 Self::UnsupportedGtidMode => std::option::Option::Some("UNSUPPORTED_GTID_MODE"),
14695 Self::SqlserverAgentNotRunning => {
14696 std::option::Option::Some("SQLSERVER_AGENT_NOT_RUNNING")
14697 }
14698 Self::UnsupportedTableDefinition => {
14699 std::option::Option::Some("UNSUPPORTED_TABLE_DEFINITION")
14700 }
14701 Self::UnsupportedDefiner => std::option::Option::Some("UNSUPPORTED_DEFINER"),
14702 Self::SqlserverServernameMismatch => {
14703 std::option::Option::Some("SQLSERVER_SERVERNAME_MISMATCH")
14704 }
14705 Self::PrimaryAlreadySetup => std::option::Option::Some("PRIMARY_ALREADY_SETUP"),
14706 Self::UnsupportedBinlogFormat => {
14707 std::option::Option::Some("UNSUPPORTED_BINLOG_FORMAT")
14708 }
14709 Self::BinlogRetentionSetting => {
14710 std::option::Option::Some("BINLOG_RETENTION_SETTING")
14711 }
14712 Self::UnsupportedStorageEngine => {
14713 std::option::Option::Some("UNSUPPORTED_STORAGE_ENGINE")
14714 }
14715 Self::LimitedSupportTables => std::option::Option::Some("LIMITED_SUPPORT_TABLES"),
14716 Self::ExistingDataInReplica => {
14717 std::option::Option::Some("EXISTING_DATA_IN_REPLICA")
14718 }
14719 Self::MissingOptionalPrivileges => {
14720 std::option::Option::Some("MISSING_OPTIONAL_PRIVILEGES")
14721 }
14722 Self::RiskyBackupAdminPrivilege => {
14723 std::option::Option::Some("RISKY_BACKUP_ADMIN_PRIVILEGE")
14724 }
14725 Self::InsufficientGcsPermissions => {
14726 std::option::Option::Some("INSUFFICIENT_GCS_PERMISSIONS")
14727 }
14728 Self::InvalidFileInfo => std::option::Option::Some("INVALID_FILE_INFO"),
14729 Self::UnsupportedDatabaseSettings => {
14730 std::option::Option::Some("UNSUPPORTED_DATABASE_SETTINGS")
14731 }
14732 Self::MysqlParallelImportInsufficientPrivilege => {
14733 std::option::Option::Some("MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE")
14734 }
14735 Self::LocalInfileOff => std::option::Option::Some("LOCAL_INFILE_OFF"),
14736 Self::TurnOnPitrAfterPromote => {
14737 std::option::Option::Some("TURN_ON_PITR_AFTER_PROMOTE")
14738 }
14739 Self::IncompatibleDatabaseMinorVersion => {
14740 std::option::Option::Some("INCOMPATIBLE_DATABASE_MINOR_VERSION")
14741 }
14742 Self::SourceMaxSubscriptions => {
14743 std::option::Option::Some("SOURCE_MAX_SUBSCRIPTIONS")
14744 }
14745 Self::UnableToVerifyDefiners => {
14746 std::option::Option::Some("UNABLE_TO_VERIFY_DEFINERS")
14747 }
14748 Self::SubscriptionCalculationStatus => {
14749 std::option::Option::Some("SUBSCRIPTION_CALCULATION_STATUS")
14750 }
14751 Self::PgSubscriptionCount => std::option::Option::Some("PG_SUBSCRIPTION_COUNT"),
14752 Self::PgSyncParallelLevel => std::option::Option::Some("PG_SYNC_PARALLEL_LEVEL"),
14753 Self::InsufficientDiskSize => std::option::Option::Some("INSUFFICIENT_DISK_SIZE"),
14754 Self::InsufficientMachineTier => {
14755 std::option::Option::Some("INSUFFICIENT_MACHINE_TIER")
14756 }
14757 Self::UnsupportedExtensionsNotMigrated => {
14758 std::option::Option::Some("UNSUPPORTED_EXTENSIONS_NOT_MIGRATED")
14759 }
14760 Self::ExtensionsNotMigrated => std::option::Option::Some("EXTENSIONS_NOT_MIGRATED"),
14761 Self::PgCronFlagEnabledInReplica => {
14762 std::option::Option::Some("PG_CRON_FLAG_ENABLED_IN_REPLICA")
14763 }
14764 Self::ExtensionsNotEnabledInReplica => {
14765 std::option::Option::Some("EXTENSIONS_NOT_ENABLED_IN_REPLICA")
14766 }
14767 Self::UnsupportedColumns => std::option::Option::Some("UNSUPPORTED_COLUMNS"),
14768 Self::UsersNotCreatedInReplica => {
14769 std::option::Option::Some("USERS_NOT_CREATED_IN_REPLICA")
14770 }
14771 Self::UnsupportedSystemObjects => {
14772 std::option::Option::Some("UNSUPPORTED_SYSTEM_OBJECTS")
14773 }
14774 Self::UnsupportedTablesWithReplicaIdentity => {
14775 std::option::Option::Some("UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY")
14776 }
14777 Self::SelectedObjectsNotExistOnSource => {
14778 std::option::Option::Some("SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE")
14779 }
14780 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => {
14781 std::option::Option::Some("PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI")
14782 }
14783 Self::SelectedObjectsReferenceUnselectedObjects => {
14784 std::option::Option::Some("SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS")
14785 }
14786 Self::PromptDeleteExisting => std::option::Option::Some("PROMPT_DELETE_EXISTING"),
14787 Self::WillDeleteExisting => std::option::Option::Some("WILL_DELETE_EXISTING"),
14788 Self::PgDdlReplicationInsufficientPrivilege => {
14789 std::option::Option::Some("PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE")
14790 }
14791 Self::UnknownValue(u) => u.0.name(),
14792 }
14793 }
14794 }
14795
14796 impl std::default::Default for SqlExternalSyncSettingErrorType {
14797 fn default() -> Self {
14798 use std::convert::From;
14799 Self::from(0)
14800 }
14801 }
14802
14803 impl std::fmt::Display for SqlExternalSyncSettingErrorType {
14804 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14805 wkt::internal::display_enum(f, self.name(), self.value())
14806 }
14807 }
14808
14809 impl std::convert::From<i32> for SqlExternalSyncSettingErrorType {
14810 fn from(value: i32) -> Self {
14811 match value {
14812 0 => Self::Unspecified,
14813 1 => Self::ConnectionFailure,
14814 2 => Self::BinlogNotEnabled,
14815 3 => Self::IncompatibleDatabaseVersion,
14816 4 => Self::ReplicaAlreadySetup,
14817 5 => Self::InsufficientPrivilege,
14818 6 => Self::UnsupportedMigrationType,
14819 7 => Self::NoPglogicalInstalled,
14820 8 => Self::PglogicalNodeAlreadyExists,
14821 9 => Self::InvalidWalLevel,
14822 10 => Self::InvalidSharedPreloadLibrary,
14823 11 => Self::InsufficientMaxReplicationSlots,
14824 12 => Self::InsufficientMaxWalSenders,
14825 13 => Self::InsufficientMaxWorkerProcesses,
14826 14 => Self::UnsupportedExtensions,
14827 15 => Self::InvalidRdsLogicalReplication,
14828 16 => Self::InvalidLoggingSetup,
14829 17 => Self::InvalidDbParam,
14830 18 => Self::UnsupportedGtidMode,
14831 19 => Self::SqlserverAgentNotRunning,
14832 20 => Self::UnsupportedTableDefinition,
14833 21 => Self::UnsupportedDefiner,
14834 22 => Self::SqlserverServernameMismatch,
14835 23 => Self::PrimaryAlreadySetup,
14836 24 => Self::UnsupportedBinlogFormat,
14837 25 => Self::BinlogRetentionSetting,
14838 26 => Self::UnsupportedStorageEngine,
14839 27 => Self::LimitedSupportTables,
14840 28 => Self::ExistingDataInReplica,
14841 29 => Self::MissingOptionalPrivileges,
14842 30 => Self::RiskyBackupAdminPrivilege,
14843 31 => Self::InsufficientGcsPermissions,
14844 32 => Self::InvalidFileInfo,
14845 33 => Self::UnsupportedDatabaseSettings,
14846 34 => Self::MysqlParallelImportInsufficientPrivilege,
14847 35 => Self::LocalInfileOff,
14848 36 => Self::TurnOnPitrAfterPromote,
14849 37 => Self::IncompatibleDatabaseMinorVersion,
14850 38 => Self::SourceMaxSubscriptions,
14851 39 => Self::UnableToVerifyDefiners,
14852 40 => Self::SubscriptionCalculationStatus,
14853 41 => Self::PgSubscriptionCount,
14854 42 => Self::PgSyncParallelLevel,
14855 43 => Self::InsufficientDiskSize,
14856 44 => Self::InsufficientMachineTier,
14857 45 => Self::UnsupportedExtensionsNotMigrated,
14858 46 => Self::ExtensionsNotMigrated,
14859 47 => Self::PgCronFlagEnabledInReplica,
14860 48 => Self::ExtensionsNotEnabledInReplica,
14861 49 => Self::UnsupportedColumns,
14862 50 => Self::UsersNotCreatedInReplica,
14863 51 => Self::UnsupportedSystemObjects,
14864 52 => Self::UnsupportedTablesWithReplicaIdentity,
14865 53 => Self::SelectedObjectsNotExistOnSource,
14866 54 => Self::PscOnlyInstanceWithNoNetworkAttachmentUri,
14867 55 => Self::SelectedObjectsReferenceUnselectedObjects,
14868 56 => Self::PromptDeleteExisting,
14869 57 => Self::WillDeleteExisting,
14870 58 => Self::PgDdlReplicationInsufficientPrivilege,
14871 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
14872 wkt::internal::UnknownEnumValue::Integer(value),
14873 )),
14874 }
14875 }
14876 }
14877
14878 impl std::convert::From<&str> for SqlExternalSyncSettingErrorType {
14879 fn from(value: &str) -> Self {
14880 use std::string::ToString;
14881 match value {
14882 "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
14883 "CONNECTION_FAILURE" => Self::ConnectionFailure,
14884 "BINLOG_NOT_ENABLED" => Self::BinlogNotEnabled,
14885 "INCOMPATIBLE_DATABASE_VERSION" => Self::IncompatibleDatabaseVersion,
14886 "REPLICA_ALREADY_SETUP" => Self::ReplicaAlreadySetup,
14887 "INSUFFICIENT_PRIVILEGE" => Self::InsufficientPrivilege,
14888 "UNSUPPORTED_MIGRATION_TYPE" => Self::UnsupportedMigrationType,
14889 "NO_PGLOGICAL_INSTALLED" => Self::NoPglogicalInstalled,
14890 "PGLOGICAL_NODE_ALREADY_EXISTS" => Self::PglogicalNodeAlreadyExists,
14891 "INVALID_WAL_LEVEL" => Self::InvalidWalLevel,
14892 "INVALID_SHARED_PRELOAD_LIBRARY" => Self::InvalidSharedPreloadLibrary,
14893 "INSUFFICIENT_MAX_REPLICATION_SLOTS" => Self::InsufficientMaxReplicationSlots,
14894 "INSUFFICIENT_MAX_WAL_SENDERS" => Self::InsufficientMaxWalSenders,
14895 "INSUFFICIENT_MAX_WORKER_PROCESSES" => Self::InsufficientMaxWorkerProcesses,
14896 "UNSUPPORTED_EXTENSIONS" => Self::UnsupportedExtensions,
14897 "INVALID_RDS_LOGICAL_REPLICATION" => Self::InvalidRdsLogicalReplication,
14898 "INVALID_LOGGING_SETUP" => Self::InvalidLoggingSetup,
14899 "INVALID_DB_PARAM" => Self::InvalidDbParam,
14900 "UNSUPPORTED_GTID_MODE" => Self::UnsupportedGtidMode,
14901 "SQLSERVER_AGENT_NOT_RUNNING" => Self::SqlserverAgentNotRunning,
14902 "UNSUPPORTED_TABLE_DEFINITION" => Self::UnsupportedTableDefinition,
14903 "UNSUPPORTED_DEFINER" => Self::UnsupportedDefiner,
14904 "SQLSERVER_SERVERNAME_MISMATCH" => Self::SqlserverServernameMismatch,
14905 "PRIMARY_ALREADY_SETUP" => Self::PrimaryAlreadySetup,
14906 "UNSUPPORTED_BINLOG_FORMAT" => Self::UnsupportedBinlogFormat,
14907 "BINLOG_RETENTION_SETTING" => Self::BinlogRetentionSetting,
14908 "UNSUPPORTED_STORAGE_ENGINE" => Self::UnsupportedStorageEngine,
14909 "LIMITED_SUPPORT_TABLES" => Self::LimitedSupportTables,
14910 "EXISTING_DATA_IN_REPLICA" => Self::ExistingDataInReplica,
14911 "MISSING_OPTIONAL_PRIVILEGES" => Self::MissingOptionalPrivileges,
14912 "RISKY_BACKUP_ADMIN_PRIVILEGE" => Self::RiskyBackupAdminPrivilege,
14913 "INSUFFICIENT_GCS_PERMISSIONS" => Self::InsufficientGcsPermissions,
14914 "INVALID_FILE_INFO" => Self::InvalidFileInfo,
14915 "UNSUPPORTED_DATABASE_SETTINGS" => Self::UnsupportedDatabaseSettings,
14916 "MYSQL_PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE" => {
14917 Self::MysqlParallelImportInsufficientPrivilege
14918 }
14919 "LOCAL_INFILE_OFF" => Self::LocalInfileOff,
14920 "TURN_ON_PITR_AFTER_PROMOTE" => Self::TurnOnPitrAfterPromote,
14921 "INCOMPATIBLE_DATABASE_MINOR_VERSION" => Self::IncompatibleDatabaseMinorVersion,
14922 "SOURCE_MAX_SUBSCRIPTIONS" => Self::SourceMaxSubscriptions,
14923 "UNABLE_TO_VERIFY_DEFINERS" => Self::UnableToVerifyDefiners,
14924 "SUBSCRIPTION_CALCULATION_STATUS" => Self::SubscriptionCalculationStatus,
14925 "PG_SUBSCRIPTION_COUNT" => Self::PgSubscriptionCount,
14926 "PG_SYNC_PARALLEL_LEVEL" => Self::PgSyncParallelLevel,
14927 "INSUFFICIENT_DISK_SIZE" => Self::InsufficientDiskSize,
14928 "INSUFFICIENT_MACHINE_TIER" => Self::InsufficientMachineTier,
14929 "UNSUPPORTED_EXTENSIONS_NOT_MIGRATED" => Self::UnsupportedExtensionsNotMigrated,
14930 "EXTENSIONS_NOT_MIGRATED" => Self::ExtensionsNotMigrated,
14931 "PG_CRON_FLAG_ENABLED_IN_REPLICA" => Self::PgCronFlagEnabledInReplica,
14932 "EXTENSIONS_NOT_ENABLED_IN_REPLICA" => Self::ExtensionsNotEnabledInReplica,
14933 "UNSUPPORTED_COLUMNS" => Self::UnsupportedColumns,
14934 "USERS_NOT_CREATED_IN_REPLICA" => Self::UsersNotCreatedInReplica,
14935 "UNSUPPORTED_SYSTEM_OBJECTS" => Self::UnsupportedSystemObjects,
14936 "UNSUPPORTED_TABLES_WITH_REPLICA_IDENTITY" => {
14937 Self::UnsupportedTablesWithReplicaIdentity
14938 }
14939 "SELECTED_OBJECTS_NOT_EXIST_ON_SOURCE" => Self::SelectedObjectsNotExistOnSource,
14940 "PSC_ONLY_INSTANCE_WITH_NO_NETWORK_ATTACHMENT_URI" => {
14941 Self::PscOnlyInstanceWithNoNetworkAttachmentUri
14942 }
14943 "SELECTED_OBJECTS_REFERENCE_UNSELECTED_OBJECTS" => {
14944 Self::SelectedObjectsReferenceUnselectedObjects
14945 }
14946 "PROMPT_DELETE_EXISTING" => Self::PromptDeleteExisting,
14947 "WILL_DELETE_EXISTING" => Self::WillDeleteExisting,
14948 "PG_DDL_REPLICATION_INSUFFICIENT_PRIVILEGE" => {
14949 Self::PgDdlReplicationInsufficientPrivilege
14950 }
14951 _ => Self::UnknownValue(sql_external_sync_setting_error_type::UnknownValue(
14952 wkt::internal::UnknownEnumValue::String(value.to_string()),
14953 )),
14954 }
14955 }
14956 }
14957
14958 impl serde::ser::Serialize for SqlExternalSyncSettingErrorType {
14959 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14960 where
14961 S: serde::Serializer,
14962 {
14963 match self {
14964 Self::Unspecified => serializer.serialize_i32(0),
14965 Self::ConnectionFailure => serializer.serialize_i32(1),
14966 Self::BinlogNotEnabled => serializer.serialize_i32(2),
14967 Self::IncompatibleDatabaseVersion => serializer.serialize_i32(3),
14968 Self::ReplicaAlreadySetup => serializer.serialize_i32(4),
14969 Self::InsufficientPrivilege => serializer.serialize_i32(5),
14970 Self::UnsupportedMigrationType => serializer.serialize_i32(6),
14971 Self::NoPglogicalInstalled => serializer.serialize_i32(7),
14972 Self::PglogicalNodeAlreadyExists => serializer.serialize_i32(8),
14973 Self::InvalidWalLevel => serializer.serialize_i32(9),
14974 Self::InvalidSharedPreloadLibrary => serializer.serialize_i32(10),
14975 Self::InsufficientMaxReplicationSlots => serializer.serialize_i32(11),
14976 Self::InsufficientMaxWalSenders => serializer.serialize_i32(12),
14977 Self::InsufficientMaxWorkerProcesses => serializer.serialize_i32(13),
14978 Self::UnsupportedExtensions => serializer.serialize_i32(14),
14979 Self::InvalidRdsLogicalReplication => serializer.serialize_i32(15),
14980 Self::InvalidLoggingSetup => serializer.serialize_i32(16),
14981 Self::InvalidDbParam => serializer.serialize_i32(17),
14982 Self::UnsupportedGtidMode => serializer.serialize_i32(18),
14983 Self::SqlserverAgentNotRunning => serializer.serialize_i32(19),
14984 Self::UnsupportedTableDefinition => serializer.serialize_i32(20),
14985 Self::UnsupportedDefiner => serializer.serialize_i32(21),
14986 Self::SqlserverServernameMismatch => serializer.serialize_i32(22),
14987 Self::PrimaryAlreadySetup => serializer.serialize_i32(23),
14988 Self::UnsupportedBinlogFormat => serializer.serialize_i32(24),
14989 Self::BinlogRetentionSetting => serializer.serialize_i32(25),
14990 Self::UnsupportedStorageEngine => serializer.serialize_i32(26),
14991 Self::LimitedSupportTables => serializer.serialize_i32(27),
14992 Self::ExistingDataInReplica => serializer.serialize_i32(28),
14993 Self::MissingOptionalPrivileges => serializer.serialize_i32(29),
14994 Self::RiskyBackupAdminPrivilege => serializer.serialize_i32(30),
14995 Self::InsufficientGcsPermissions => serializer.serialize_i32(31),
14996 Self::InvalidFileInfo => serializer.serialize_i32(32),
14997 Self::UnsupportedDatabaseSettings => serializer.serialize_i32(33),
14998 Self::MysqlParallelImportInsufficientPrivilege => serializer.serialize_i32(34),
14999 Self::LocalInfileOff => serializer.serialize_i32(35),
15000 Self::TurnOnPitrAfterPromote => serializer.serialize_i32(36),
15001 Self::IncompatibleDatabaseMinorVersion => serializer.serialize_i32(37),
15002 Self::SourceMaxSubscriptions => serializer.serialize_i32(38),
15003 Self::UnableToVerifyDefiners => serializer.serialize_i32(39),
15004 Self::SubscriptionCalculationStatus => serializer.serialize_i32(40),
15005 Self::PgSubscriptionCount => serializer.serialize_i32(41),
15006 Self::PgSyncParallelLevel => serializer.serialize_i32(42),
15007 Self::InsufficientDiskSize => serializer.serialize_i32(43),
15008 Self::InsufficientMachineTier => serializer.serialize_i32(44),
15009 Self::UnsupportedExtensionsNotMigrated => serializer.serialize_i32(45),
15010 Self::ExtensionsNotMigrated => serializer.serialize_i32(46),
15011 Self::PgCronFlagEnabledInReplica => serializer.serialize_i32(47),
15012 Self::ExtensionsNotEnabledInReplica => serializer.serialize_i32(48),
15013 Self::UnsupportedColumns => serializer.serialize_i32(49),
15014 Self::UsersNotCreatedInReplica => serializer.serialize_i32(50),
15015 Self::UnsupportedSystemObjects => serializer.serialize_i32(51),
15016 Self::UnsupportedTablesWithReplicaIdentity => serializer.serialize_i32(52),
15017 Self::SelectedObjectsNotExistOnSource => serializer.serialize_i32(53),
15018 Self::PscOnlyInstanceWithNoNetworkAttachmentUri => serializer.serialize_i32(54),
15019 Self::SelectedObjectsReferenceUnselectedObjects => serializer.serialize_i32(55),
15020 Self::PromptDeleteExisting => serializer.serialize_i32(56),
15021 Self::WillDeleteExisting => serializer.serialize_i32(57),
15022 Self::PgDdlReplicationInsufficientPrivilege => serializer.serialize_i32(58),
15023 Self::UnknownValue(u) => u.0.serialize(serializer),
15024 }
15025 }
15026 }
15027
15028 impl<'de> serde::de::Deserialize<'de> for SqlExternalSyncSettingErrorType {
15029 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15030 where
15031 D: serde::Deserializer<'de>,
15032 {
15033 deserializer.deserialize_any(wkt::internal::EnumVisitor::<
15034 SqlExternalSyncSettingErrorType,
15035 >::new(
15036 ".google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType",
15037 ))
15038 }
15039 }
15040}
15041
15042/// A list of objects that the user selects for replication from an external
15043/// source instance.
15044#[derive(Clone, Default, PartialEq)]
15045#[non_exhaustive]
15046pub struct SelectedObjects {
15047 /// Required. The name of the database to migrate.
15048 pub database: std::string::String,
15049
15050 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15051}
15052
15053impl SelectedObjects {
15054 pub fn new() -> Self {
15055 std::default::Default::default()
15056 }
15057
15058 /// Sets the value of [database][crate::model::SelectedObjects::database].
15059 ///
15060 /// # Example
15061 /// ```ignore,no_run
15062 /// # use google_cloud_sql_v1::model::SelectedObjects;
15063 /// let x = SelectedObjects::new().set_database("example");
15064 /// ```
15065 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15066 self.database = v.into();
15067 self
15068 }
15069}
15070
15071impl wkt::message::Message for SelectedObjects {
15072 fn typename() -> &'static str {
15073 "type.googleapis.com/google.cloud.sql.v1.SelectedObjects"
15074 }
15075}
15076
15077/// On-premises instance configuration.
15078#[derive(Clone, Default, PartialEq)]
15079#[non_exhaustive]
15080pub struct OnPremisesConfiguration {
15081 /// The host and port of the on-premises instance in host:port format
15082 pub host_port: std::string::String,
15083
15084 /// This is always `sql#onPremisesConfiguration`.
15085 pub kind: std::string::String,
15086
15087 /// The username for connecting to on-premises instance.
15088 pub username: std::string::String,
15089
15090 /// The password for connecting to on-premises instance.
15091 pub password: std::string::String,
15092
15093 /// PEM representation of the trusted CA's x509 certificate.
15094 pub ca_certificate: std::string::String,
15095
15096 /// PEM representation of the replica's x509 certificate.
15097 pub client_certificate: std::string::String,
15098
15099 /// PEM representation of the replica's private key. The corresponding public
15100 /// key is encoded in the client's certificate.
15101 pub client_key: std::string::String,
15102
15103 /// The dump file to create the Cloud SQL replica.
15104 pub dump_file_path: std::string::String,
15105
15106 /// The reference to Cloud SQL instance if the source is Cloud SQL.
15107 pub source_instance: std::option::Option<crate::model::InstanceReference>,
15108
15109 /// Optional. A list of objects that the user selects for replication from an
15110 /// external source instance.
15111 pub selected_objects: std::vec::Vec<crate::model::SelectedObjects>,
15112
15113 /// Optional. SSL option for replica connection to the on-premises source.
15114 pub ssl_option: crate::model::on_premises_configuration::SslOption,
15115
15116 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15117}
15118
15119impl OnPremisesConfiguration {
15120 pub fn new() -> Self {
15121 std::default::Default::default()
15122 }
15123
15124 /// Sets the value of [host_port][crate::model::OnPremisesConfiguration::host_port].
15125 ///
15126 /// # Example
15127 /// ```ignore,no_run
15128 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15129 /// let x = OnPremisesConfiguration::new().set_host_port("example");
15130 /// ```
15131 pub fn set_host_port<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15132 self.host_port = v.into();
15133 self
15134 }
15135
15136 /// Sets the value of [kind][crate::model::OnPremisesConfiguration::kind].
15137 ///
15138 /// # Example
15139 /// ```ignore,no_run
15140 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15141 /// let x = OnPremisesConfiguration::new().set_kind("example");
15142 /// ```
15143 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15144 self.kind = v.into();
15145 self
15146 }
15147
15148 /// Sets the value of [username][crate::model::OnPremisesConfiguration::username].
15149 ///
15150 /// # Example
15151 /// ```ignore,no_run
15152 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15153 /// let x = OnPremisesConfiguration::new().set_username("example");
15154 /// ```
15155 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15156 self.username = v.into();
15157 self
15158 }
15159
15160 /// Sets the value of [password][crate::model::OnPremisesConfiguration::password].
15161 ///
15162 /// # Example
15163 /// ```ignore,no_run
15164 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15165 /// let x = OnPremisesConfiguration::new().set_password("example");
15166 /// ```
15167 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15168 self.password = v.into();
15169 self
15170 }
15171
15172 /// Sets the value of [ca_certificate][crate::model::OnPremisesConfiguration::ca_certificate].
15173 ///
15174 /// # Example
15175 /// ```ignore,no_run
15176 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15177 /// let x = OnPremisesConfiguration::new().set_ca_certificate("example");
15178 /// ```
15179 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15180 self.ca_certificate = v.into();
15181 self
15182 }
15183
15184 /// Sets the value of [client_certificate][crate::model::OnPremisesConfiguration::client_certificate].
15185 ///
15186 /// # Example
15187 /// ```ignore,no_run
15188 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15189 /// let x = OnPremisesConfiguration::new().set_client_certificate("example");
15190 /// ```
15191 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
15192 mut self,
15193 v: T,
15194 ) -> Self {
15195 self.client_certificate = v.into();
15196 self
15197 }
15198
15199 /// Sets the value of [client_key][crate::model::OnPremisesConfiguration::client_key].
15200 ///
15201 /// # Example
15202 /// ```ignore,no_run
15203 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15204 /// let x = OnPremisesConfiguration::new().set_client_key("example");
15205 /// ```
15206 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15207 self.client_key = v.into();
15208 self
15209 }
15210
15211 /// Sets the value of [dump_file_path][crate::model::OnPremisesConfiguration::dump_file_path].
15212 ///
15213 /// # Example
15214 /// ```ignore,no_run
15215 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15216 /// let x = OnPremisesConfiguration::new().set_dump_file_path("example");
15217 /// ```
15218 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15219 self.dump_file_path = v.into();
15220 self
15221 }
15222
15223 /// Sets the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15224 ///
15225 /// # Example
15226 /// ```ignore,no_run
15227 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15228 /// use google_cloud_sql_v1::model::InstanceReference;
15229 /// let x = OnPremisesConfiguration::new().set_source_instance(InstanceReference::default()/* use setters */);
15230 /// ```
15231 pub fn set_source_instance<T>(mut self, v: T) -> Self
15232 where
15233 T: std::convert::Into<crate::model::InstanceReference>,
15234 {
15235 self.source_instance = std::option::Option::Some(v.into());
15236 self
15237 }
15238
15239 /// Sets or clears the value of [source_instance][crate::model::OnPremisesConfiguration::source_instance].
15240 ///
15241 /// # Example
15242 /// ```ignore,no_run
15243 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15244 /// use google_cloud_sql_v1::model::InstanceReference;
15245 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(Some(InstanceReference::default()/* use setters */));
15246 /// let x = OnPremisesConfiguration::new().set_or_clear_source_instance(None::<InstanceReference>);
15247 /// ```
15248 pub fn set_or_clear_source_instance<T>(mut self, v: std::option::Option<T>) -> Self
15249 where
15250 T: std::convert::Into<crate::model::InstanceReference>,
15251 {
15252 self.source_instance = v.map(|x| x.into());
15253 self
15254 }
15255
15256 /// Sets the value of [selected_objects][crate::model::OnPremisesConfiguration::selected_objects].
15257 ///
15258 /// # Example
15259 /// ```ignore,no_run
15260 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15261 /// use google_cloud_sql_v1::model::SelectedObjects;
15262 /// let x = OnPremisesConfiguration::new()
15263 /// .set_selected_objects([
15264 /// SelectedObjects::default()/* use setters */,
15265 /// SelectedObjects::default()/* use (different) setters */,
15266 /// ]);
15267 /// ```
15268 pub fn set_selected_objects<T, V>(mut self, v: T) -> Self
15269 where
15270 T: std::iter::IntoIterator<Item = V>,
15271 V: std::convert::Into<crate::model::SelectedObjects>,
15272 {
15273 use std::iter::Iterator;
15274 self.selected_objects = v.into_iter().map(|i| i.into()).collect();
15275 self
15276 }
15277
15278 /// Sets the value of [ssl_option][crate::model::OnPremisesConfiguration::ssl_option].
15279 ///
15280 /// # Example
15281 /// ```ignore,no_run
15282 /// # use google_cloud_sql_v1::model::OnPremisesConfiguration;
15283 /// use google_cloud_sql_v1::model::on_premises_configuration::SslOption;
15284 /// let x0 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Disable);
15285 /// let x1 = OnPremisesConfiguration::new().set_ssl_option(SslOption::Require);
15286 /// let x2 = OnPremisesConfiguration::new().set_ssl_option(SslOption::VerifyCa);
15287 /// ```
15288 pub fn set_ssl_option<
15289 T: std::convert::Into<crate::model::on_premises_configuration::SslOption>,
15290 >(
15291 mut self,
15292 v: T,
15293 ) -> Self {
15294 self.ssl_option = v.into();
15295 self
15296 }
15297}
15298
15299impl wkt::message::Message for OnPremisesConfiguration {
15300 fn typename() -> &'static str {
15301 "type.googleapis.com/google.cloud.sql.v1.OnPremisesConfiguration"
15302 }
15303}
15304
15305/// Defines additional types related to [OnPremisesConfiguration].
15306pub mod on_premises_configuration {
15307 #[allow(unused_imports)]
15308 use super::*;
15309
15310 /// SslOption defines the SSL mode to be used for replica connection to the
15311 /// on-premises source.
15312 ///
15313 /// # Working with unknown values
15314 ///
15315 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15316 /// additional enum variants at any time. Adding new variants is not considered
15317 /// a breaking change. Applications should write their code in anticipation of:
15318 ///
15319 /// - New values appearing in future releases of the client library, **and**
15320 /// - New values received dynamically, without application changes.
15321 ///
15322 /// Please consult the [Working with enums] section in the user guide for some
15323 /// guidelines.
15324 ///
15325 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15326 #[derive(Clone, Debug, PartialEq)]
15327 #[non_exhaustive]
15328 pub enum SslOption {
15329 /// Unknown SSL option i.e. SSL option not specified by user.
15330 Unspecified,
15331 /// SSL is not used for replica connection to the on-premises source.
15332 Disable,
15333 /// SSL is required for replica connection to the on-premises source.
15334 Require,
15335 /// Verify CA is required for replica connection to the on-premises source.
15336 VerifyCa,
15337 /// If set, the enum was initialized with an unknown value.
15338 ///
15339 /// Applications can examine the value using [SslOption::value] or
15340 /// [SslOption::name].
15341 UnknownValue(ssl_option::UnknownValue),
15342 }
15343
15344 #[doc(hidden)]
15345 pub mod ssl_option {
15346 #[allow(unused_imports)]
15347 use super::*;
15348 #[derive(Clone, Debug, PartialEq)]
15349 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15350 }
15351
15352 impl SslOption {
15353 /// Gets the enum value.
15354 ///
15355 /// Returns `None` if the enum contains an unknown value deserialized from
15356 /// the string representation of enums.
15357 pub fn value(&self) -> std::option::Option<i32> {
15358 match self {
15359 Self::Unspecified => std::option::Option::Some(0),
15360 Self::Disable => std::option::Option::Some(1),
15361 Self::Require => std::option::Option::Some(2),
15362 Self::VerifyCa => std::option::Option::Some(3),
15363 Self::UnknownValue(u) => u.0.value(),
15364 }
15365 }
15366
15367 /// Gets the enum value as a string.
15368 ///
15369 /// Returns `None` if the enum contains an unknown value deserialized from
15370 /// the integer representation of enums.
15371 pub fn name(&self) -> std::option::Option<&str> {
15372 match self {
15373 Self::Unspecified => std::option::Option::Some("SSL_OPTION_UNSPECIFIED"),
15374 Self::Disable => std::option::Option::Some("DISABLE"),
15375 Self::Require => std::option::Option::Some("REQUIRE"),
15376 Self::VerifyCa => std::option::Option::Some("VERIFY_CA"),
15377 Self::UnknownValue(u) => u.0.name(),
15378 }
15379 }
15380 }
15381
15382 impl std::default::Default for SslOption {
15383 fn default() -> Self {
15384 use std::convert::From;
15385 Self::from(0)
15386 }
15387 }
15388
15389 impl std::fmt::Display for SslOption {
15390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15391 wkt::internal::display_enum(f, self.name(), self.value())
15392 }
15393 }
15394
15395 impl std::convert::From<i32> for SslOption {
15396 fn from(value: i32) -> Self {
15397 match value {
15398 0 => Self::Unspecified,
15399 1 => Self::Disable,
15400 2 => Self::Require,
15401 3 => Self::VerifyCa,
15402 _ => Self::UnknownValue(ssl_option::UnknownValue(
15403 wkt::internal::UnknownEnumValue::Integer(value),
15404 )),
15405 }
15406 }
15407 }
15408
15409 impl std::convert::From<&str> for SslOption {
15410 fn from(value: &str) -> Self {
15411 use std::string::ToString;
15412 match value {
15413 "SSL_OPTION_UNSPECIFIED" => Self::Unspecified,
15414 "DISABLE" => Self::Disable,
15415 "REQUIRE" => Self::Require,
15416 "VERIFY_CA" => Self::VerifyCa,
15417 _ => Self::UnknownValue(ssl_option::UnknownValue(
15418 wkt::internal::UnknownEnumValue::String(value.to_string()),
15419 )),
15420 }
15421 }
15422 }
15423
15424 impl serde::ser::Serialize for SslOption {
15425 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15426 where
15427 S: serde::Serializer,
15428 {
15429 match self {
15430 Self::Unspecified => serializer.serialize_i32(0),
15431 Self::Disable => serializer.serialize_i32(1),
15432 Self::Require => serializer.serialize_i32(2),
15433 Self::VerifyCa => serializer.serialize_i32(3),
15434 Self::UnknownValue(u) => u.0.serialize(serializer),
15435 }
15436 }
15437 }
15438
15439 impl<'de> serde::de::Deserialize<'de> for SslOption {
15440 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15441 where
15442 D: serde::Deserializer<'de>,
15443 {
15444 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslOption>::new(
15445 ".google.cloud.sql.v1.OnPremisesConfiguration.SslOption",
15446 ))
15447 }
15448 }
15449}
15450
15451/// Read-replica configuration for connecting to the primary instance.
15452#[derive(Clone, Default, PartialEq)]
15453#[non_exhaustive]
15454pub struct ReplicaConfiguration {
15455 /// This is always `sql#replicaConfiguration`.
15456 pub kind: std::string::String,
15457
15458 /// MySQL specific configuration when replicating from a MySQL on-premises
15459 /// primary instance. Replication configuration information such as the
15460 /// username, password, certificates, and keys are not stored in the instance
15461 /// metadata. The configuration information is used only to set up the
15462 /// replication connection and is stored by MySQL in a file named
15463 /// `master.info` in the data directory.
15464 pub mysql_replica_configuration: std::option::Option<crate::model::MySqlReplicaConfiguration>,
15465
15466 /// Specifies if the replica is the failover target. If the field is set to
15467 /// `true`, the replica will be designated as a failover replica. In case the
15468 /// primary instance fails, the replica instance will be promoted as the new
15469 /// primary instance. Only one replica can be specified as failover target, and
15470 /// the replica has to be in different zone with the primary instance.
15471 pub failover_target: std::option::Option<wkt::BoolValue>,
15472
15473 /// Optional. Specifies if a SQL Server replica is a cascadable replica. A
15474 /// cascadable replica is a SQL Server cross region replica that supports
15475 /// replica(s) under it.
15476 pub cascadable_replica: std::option::Option<wkt::BoolValue>,
15477
15478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15479}
15480
15481impl ReplicaConfiguration {
15482 pub fn new() -> Self {
15483 std::default::Default::default()
15484 }
15485
15486 /// Sets the value of [kind][crate::model::ReplicaConfiguration::kind].
15487 ///
15488 /// # Example
15489 /// ```ignore,no_run
15490 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15491 /// let x = ReplicaConfiguration::new().set_kind("example");
15492 /// ```
15493 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15494 self.kind = v.into();
15495 self
15496 }
15497
15498 /// Sets the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15499 ///
15500 /// # Example
15501 /// ```ignore,no_run
15502 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15503 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15504 /// let x = ReplicaConfiguration::new().set_mysql_replica_configuration(MySqlReplicaConfiguration::default()/* use setters */);
15505 /// ```
15506 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
15507 where
15508 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15509 {
15510 self.mysql_replica_configuration = std::option::Option::Some(v.into());
15511 self
15512 }
15513
15514 /// Sets or clears the value of [mysql_replica_configuration][crate::model::ReplicaConfiguration::mysql_replica_configuration].
15515 ///
15516 /// # Example
15517 /// ```ignore,no_run
15518 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15519 /// use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
15520 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(Some(MySqlReplicaConfiguration::default()/* use setters */));
15521 /// let x = ReplicaConfiguration::new().set_or_clear_mysql_replica_configuration(None::<MySqlReplicaConfiguration>);
15522 /// ```
15523 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
15524 where
15525 T: std::convert::Into<crate::model::MySqlReplicaConfiguration>,
15526 {
15527 self.mysql_replica_configuration = v.map(|x| x.into());
15528 self
15529 }
15530
15531 /// Sets the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15532 ///
15533 /// # Example
15534 /// ```ignore,no_run
15535 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15536 /// use wkt::BoolValue;
15537 /// let x = ReplicaConfiguration::new().set_failover_target(BoolValue::default()/* use setters */);
15538 /// ```
15539 pub fn set_failover_target<T>(mut self, v: T) -> Self
15540 where
15541 T: std::convert::Into<wkt::BoolValue>,
15542 {
15543 self.failover_target = std::option::Option::Some(v.into());
15544 self
15545 }
15546
15547 /// Sets or clears the value of [failover_target][crate::model::ReplicaConfiguration::failover_target].
15548 ///
15549 /// # Example
15550 /// ```ignore,no_run
15551 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15552 /// use wkt::BoolValue;
15553 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(Some(BoolValue::default()/* use setters */));
15554 /// let x = ReplicaConfiguration::new().set_or_clear_failover_target(None::<BoolValue>);
15555 /// ```
15556 pub fn set_or_clear_failover_target<T>(mut self, v: std::option::Option<T>) -> Self
15557 where
15558 T: std::convert::Into<wkt::BoolValue>,
15559 {
15560 self.failover_target = v.map(|x| x.into());
15561 self
15562 }
15563
15564 /// Sets the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15565 ///
15566 /// # Example
15567 /// ```ignore,no_run
15568 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15569 /// use wkt::BoolValue;
15570 /// let x = ReplicaConfiguration::new().set_cascadable_replica(BoolValue::default()/* use setters */);
15571 /// ```
15572 pub fn set_cascadable_replica<T>(mut self, v: T) -> Self
15573 where
15574 T: std::convert::Into<wkt::BoolValue>,
15575 {
15576 self.cascadable_replica = std::option::Option::Some(v.into());
15577 self
15578 }
15579
15580 /// Sets or clears the value of [cascadable_replica][crate::model::ReplicaConfiguration::cascadable_replica].
15581 ///
15582 /// # Example
15583 /// ```ignore,no_run
15584 /// # use google_cloud_sql_v1::model::ReplicaConfiguration;
15585 /// use wkt::BoolValue;
15586 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(Some(BoolValue::default()/* use setters */));
15587 /// let x = ReplicaConfiguration::new().set_or_clear_cascadable_replica(None::<BoolValue>);
15588 /// ```
15589 pub fn set_or_clear_cascadable_replica<T>(mut self, v: std::option::Option<T>) -> Self
15590 where
15591 T: std::convert::Into<wkt::BoolValue>,
15592 {
15593 self.cascadable_replica = v.map(|x| x.into());
15594 self
15595 }
15596}
15597
15598impl wkt::message::Message for ReplicaConfiguration {
15599 fn typename() -> &'static str {
15600 "type.googleapis.com/google.cloud.sql.v1.ReplicaConfiguration"
15601 }
15602}
15603
15604/// Execute SQL statements request.
15605#[derive(Clone, Default, PartialEq)]
15606#[non_exhaustive]
15607pub struct SqlInstancesExecuteSqlRequest {
15608 /// Required. Database instance ID. This does not include the project ID.
15609 pub instance: std::string::String,
15610
15611 /// Required. Project ID of the project that contains the instance.
15612 pub project: std::string::String,
15613
15614 /// The request body.
15615 pub body: std::option::Option<crate::model::ExecuteSqlPayload>,
15616
15617 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15618}
15619
15620impl SqlInstancesExecuteSqlRequest {
15621 pub fn new() -> Self {
15622 std::default::Default::default()
15623 }
15624
15625 /// Sets the value of [instance][crate::model::SqlInstancesExecuteSqlRequest::instance].
15626 ///
15627 /// # Example
15628 /// ```ignore,no_run
15629 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15630 /// let x = SqlInstancesExecuteSqlRequest::new().set_instance("example");
15631 /// ```
15632 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15633 self.instance = v.into();
15634 self
15635 }
15636
15637 /// Sets the value of [project][crate::model::SqlInstancesExecuteSqlRequest::project].
15638 ///
15639 /// # Example
15640 /// ```ignore,no_run
15641 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15642 /// let x = SqlInstancesExecuteSqlRequest::new().set_project("example");
15643 /// ```
15644 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15645 self.project = v.into();
15646 self
15647 }
15648
15649 /// Sets the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15650 ///
15651 /// # Example
15652 /// ```ignore,no_run
15653 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15654 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15655 /// let x = SqlInstancesExecuteSqlRequest::new().set_body(ExecuteSqlPayload::default()/* use setters */);
15656 /// ```
15657 pub fn set_body<T>(mut self, v: T) -> Self
15658 where
15659 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15660 {
15661 self.body = std::option::Option::Some(v.into());
15662 self
15663 }
15664
15665 /// Sets or clears the value of [body][crate::model::SqlInstancesExecuteSqlRequest::body].
15666 ///
15667 /// # Example
15668 /// ```ignore,no_run
15669 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlRequest;
15670 /// use google_cloud_sql_v1::model::ExecuteSqlPayload;
15671 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(Some(ExecuteSqlPayload::default()/* use setters */));
15672 /// let x = SqlInstancesExecuteSqlRequest::new().set_or_clear_body(None::<ExecuteSqlPayload>);
15673 /// ```
15674 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
15675 where
15676 T: std::convert::Into<crate::model::ExecuteSqlPayload>,
15677 {
15678 self.body = v.map(|x| x.into());
15679 self
15680 }
15681}
15682
15683impl wkt::message::Message for SqlInstancesExecuteSqlRequest {
15684 fn typename() -> &'static str {
15685 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlRequest"
15686 }
15687}
15688
15689/// The request payload used to execute SQL statements.
15690#[derive(Clone, Default, PartialEq)]
15691#[non_exhaustive]
15692pub struct ExecuteSqlPayload {
15693 /// Optional. The name of an existing database user to connect to the database.
15694 /// When `auto_iam_authn` is set to true, this field is ignored and the API
15695 /// caller's IAM user is used.
15696 pub user: std::string::String,
15697
15698 /// Required. SQL statements to run on the database. It can be a single
15699 /// statement or a sequence of statements separated by semicolons.
15700 pub sql_statement: std::string::String,
15701
15702 /// Optional. Name of the database on which the statement will be executed.
15703 pub database: std::string::String,
15704
15705 /// Optional. The maximum number of rows returned per SQL statement.
15706 pub row_limit: i64,
15707
15708 /// Optional. Controls how the API should respond when the SQL execution result
15709 /// is incomplete due to the size limit or another error. The default mode is
15710 /// to throw an error.
15711 pub partial_result_mode: crate::model::execute_sql_payload::PartialResultMode,
15712
15713 /// Optional. Specifies the name of the application that is making the request.
15714 /// This field is used for telemetry. Only alphanumeric characters, dashes, and
15715 /// underscores are allowed. The maximum length is 32 characters.
15716 pub application: std::string::String,
15717
15718 /// Credentials for the database connection.
15719 pub user_password: std::option::Option<crate::model::execute_sql_payload::UserPassword>,
15720
15721 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15722}
15723
15724impl ExecuteSqlPayload {
15725 pub fn new() -> Self {
15726 std::default::Default::default()
15727 }
15728
15729 /// Sets the value of [user][crate::model::ExecuteSqlPayload::user].
15730 ///
15731 /// # Example
15732 /// ```ignore,no_run
15733 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15734 /// let x = ExecuteSqlPayload::new().set_user("example");
15735 /// ```
15736 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15737 self.user = v.into();
15738 self
15739 }
15740
15741 /// Sets the value of [sql_statement][crate::model::ExecuteSqlPayload::sql_statement].
15742 ///
15743 /// # Example
15744 /// ```ignore,no_run
15745 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15746 /// let x = ExecuteSqlPayload::new().set_sql_statement("example");
15747 /// ```
15748 pub fn set_sql_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15749 self.sql_statement = v.into();
15750 self
15751 }
15752
15753 /// Sets the value of [database][crate::model::ExecuteSqlPayload::database].
15754 ///
15755 /// # Example
15756 /// ```ignore,no_run
15757 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15758 /// let x = ExecuteSqlPayload::new().set_database("example");
15759 /// ```
15760 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15761 self.database = v.into();
15762 self
15763 }
15764
15765 /// Sets the value of [row_limit][crate::model::ExecuteSqlPayload::row_limit].
15766 ///
15767 /// # Example
15768 /// ```ignore,no_run
15769 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15770 /// let x = ExecuteSqlPayload::new().set_row_limit(42);
15771 /// ```
15772 pub fn set_row_limit<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
15773 self.row_limit = v.into();
15774 self
15775 }
15776
15777 /// Sets the value of [partial_result_mode][crate::model::ExecuteSqlPayload::partial_result_mode].
15778 ///
15779 /// # Example
15780 /// ```ignore,no_run
15781 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15782 /// use google_cloud_sql_v1::model::execute_sql_payload::PartialResultMode;
15783 /// let x0 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::FailPartialResult);
15784 /// let x1 = ExecuteSqlPayload::new().set_partial_result_mode(PartialResultMode::AllowPartialResult);
15785 /// ```
15786 pub fn set_partial_result_mode<
15787 T: std::convert::Into<crate::model::execute_sql_payload::PartialResultMode>,
15788 >(
15789 mut self,
15790 v: T,
15791 ) -> Self {
15792 self.partial_result_mode = v.into();
15793 self
15794 }
15795
15796 /// Sets the value of [application][crate::model::ExecuteSqlPayload::application].
15797 ///
15798 /// # Example
15799 /// ```ignore,no_run
15800 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15801 /// let x = ExecuteSqlPayload::new().set_application("example");
15802 /// ```
15803 pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15804 self.application = v.into();
15805 self
15806 }
15807
15808 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password].
15809 ///
15810 /// Note that all the setters affecting `user_password` are mutually
15811 /// exclusive.
15812 ///
15813 /// # Example
15814 /// ```ignore,no_run
15815 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15816 /// use google_cloud_sql_v1::model::execute_sql_payload::UserPassword;
15817 /// let x = ExecuteSqlPayload::new().set_user_password(Some(UserPassword::AutoIamAuthn(true)));
15818 /// ```
15819 pub fn set_user_password<
15820 T: std::convert::Into<std::option::Option<crate::model::execute_sql_payload::UserPassword>>,
15821 >(
15822 mut self,
15823 v: T,
15824 ) -> Self {
15825 self.user_password = v.into();
15826 self
15827 }
15828
15829 /// The value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15830 /// if it holds a `AutoIamAuthn`, `None` if the field is not set or
15831 /// holds a different branch.
15832 pub fn auto_iam_authn(&self) -> std::option::Option<&bool> {
15833 #[allow(unreachable_patterns)]
15834 self.user_password.as_ref().and_then(|v| match v {
15835 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v) => {
15836 std::option::Option::Some(v)
15837 }
15838 _ => std::option::Option::None,
15839 })
15840 }
15841
15842 /// Sets the value of [user_password][crate::model::ExecuteSqlPayload::user_password]
15843 /// to hold a `AutoIamAuthn`.
15844 ///
15845 /// Note that all the setters affecting `user_password` are
15846 /// mutually exclusive.
15847 ///
15848 /// # Example
15849 /// ```ignore,no_run
15850 /// # use google_cloud_sql_v1::model::ExecuteSqlPayload;
15851 /// let x = ExecuteSqlPayload::new().set_auto_iam_authn(true);
15852 /// assert!(x.auto_iam_authn().is_some());
15853 /// ```
15854 pub fn set_auto_iam_authn<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
15855 self.user_password = std::option::Option::Some(
15856 crate::model::execute_sql_payload::UserPassword::AutoIamAuthn(v.into()),
15857 );
15858 self
15859 }
15860}
15861
15862impl wkt::message::Message for ExecuteSqlPayload {
15863 fn typename() -> &'static str {
15864 "type.googleapis.com/google.cloud.sql.v1.ExecuteSqlPayload"
15865 }
15866}
15867
15868/// Defines additional types related to [ExecuteSqlPayload].
15869pub mod execute_sql_payload {
15870 #[allow(unused_imports)]
15871 use super::*;
15872
15873 /// Controls how the API should respond when the SQL execution result exceeds
15874 /// 10 MB.
15875 ///
15876 /// # Working with unknown values
15877 ///
15878 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15879 /// additional enum variants at any time. Adding new variants is not considered
15880 /// a breaking change. Applications should write their code in anticipation of:
15881 ///
15882 /// - New values appearing in future releases of the client library, **and**
15883 /// - New values received dynamically, without application changes.
15884 ///
15885 /// Please consult the [Working with enums] section in the user guide for some
15886 /// guidelines.
15887 ///
15888 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15889 #[derive(Clone, Debug, PartialEq)]
15890 #[non_exhaustive]
15891 pub enum PartialResultMode {
15892 /// Unspecified mode, effectively the same as `FAIL_PARTIAL_RESULT`.
15893 Unspecified,
15894 /// Throw an error if the result exceeds 10 MB or if only a partial result
15895 /// can be retrieved. Don't return the result.
15896 FailPartialResult,
15897 /// Return a truncated result and set `partial_result` to true if the result
15898 /// exceeds 10 MB or if only a partial result can be retrieved due to error.
15899 /// Don't throw an error.
15900 AllowPartialResult,
15901 /// If set, the enum was initialized with an unknown value.
15902 ///
15903 /// Applications can examine the value using [PartialResultMode::value] or
15904 /// [PartialResultMode::name].
15905 UnknownValue(partial_result_mode::UnknownValue),
15906 }
15907
15908 #[doc(hidden)]
15909 pub mod partial_result_mode {
15910 #[allow(unused_imports)]
15911 use super::*;
15912 #[derive(Clone, Debug, PartialEq)]
15913 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15914 }
15915
15916 impl PartialResultMode {
15917 /// Gets the enum value.
15918 ///
15919 /// Returns `None` if the enum contains an unknown value deserialized from
15920 /// the string representation of enums.
15921 pub fn value(&self) -> std::option::Option<i32> {
15922 match self {
15923 Self::Unspecified => std::option::Option::Some(0),
15924 Self::FailPartialResult => std::option::Option::Some(1),
15925 Self::AllowPartialResult => std::option::Option::Some(2),
15926 Self::UnknownValue(u) => u.0.value(),
15927 }
15928 }
15929
15930 /// Gets the enum value as a string.
15931 ///
15932 /// Returns `None` if the enum contains an unknown value deserialized from
15933 /// the integer representation of enums.
15934 pub fn name(&self) -> std::option::Option<&str> {
15935 match self {
15936 Self::Unspecified => std::option::Option::Some("PARTIAL_RESULT_MODE_UNSPECIFIED"),
15937 Self::FailPartialResult => std::option::Option::Some("FAIL_PARTIAL_RESULT"),
15938 Self::AllowPartialResult => std::option::Option::Some("ALLOW_PARTIAL_RESULT"),
15939 Self::UnknownValue(u) => u.0.name(),
15940 }
15941 }
15942 }
15943
15944 impl std::default::Default for PartialResultMode {
15945 fn default() -> Self {
15946 use std::convert::From;
15947 Self::from(0)
15948 }
15949 }
15950
15951 impl std::fmt::Display for PartialResultMode {
15952 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15953 wkt::internal::display_enum(f, self.name(), self.value())
15954 }
15955 }
15956
15957 impl std::convert::From<i32> for PartialResultMode {
15958 fn from(value: i32) -> Self {
15959 match value {
15960 0 => Self::Unspecified,
15961 1 => Self::FailPartialResult,
15962 2 => Self::AllowPartialResult,
15963 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
15964 wkt::internal::UnknownEnumValue::Integer(value),
15965 )),
15966 }
15967 }
15968 }
15969
15970 impl std::convert::From<&str> for PartialResultMode {
15971 fn from(value: &str) -> Self {
15972 use std::string::ToString;
15973 match value {
15974 "PARTIAL_RESULT_MODE_UNSPECIFIED" => Self::Unspecified,
15975 "FAIL_PARTIAL_RESULT" => Self::FailPartialResult,
15976 "ALLOW_PARTIAL_RESULT" => Self::AllowPartialResult,
15977 _ => Self::UnknownValue(partial_result_mode::UnknownValue(
15978 wkt::internal::UnknownEnumValue::String(value.to_string()),
15979 )),
15980 }
15981 }
15982 }
15983
15984 impl serde::ser::Serialize for PartialResultMode {
15985 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15986 where
15987 S: serde::Serializer,
15988 {
15989 match self {
15990 Self::Unspecified => serializer.serialize_i32(0),
15991 Self::FailPartialResult => serializer.serialize_i32(1),
15992 Self::AllowPartialResult => serializer.serialize_i32(2),
15993 Self::UnknownValue(u) => u.0.serialize(serializer),
15994 }
15995 }
15996 }
15997
15998 impl<'de> serde::de::Deserialize<'de> for PartialResultMode {
15999 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16000 where
16001 D: serde::Deserializer<'de>,
16002 {
16003 deserializer.deserialize_any(wkt::internal::EnumVisitor::<PartialResultMode>::new(
16004 ".google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode",
16005 ))
16006 }
16007 }
16008
16009 /// Credentials for the database connection.
16010 #[derive(Clone, Debug, PartialEq)]
16011 #[non_exhaustive]
16012 pub enum UserPassword {
16013 /// Optional. When set to true, the API caller identity associated with the
16014 /// request is used for database authentication. The API caller must be an
16015 /// IAM user in the database.
16016 AutoIamAuthn(bool),
16017 }
16018}
16019
16020/// Execute SQL statements response.
16021#[derive(Clone, Default, PartialEq)]
16022#[non_exhaustive]
16023pub struct SqlInstancesExecuteSqlResponse {
16024 /// A list of notices and warnings generated during query execution.
16025 /// For PostgreSQL, this includes all notices and warnings.
16026 /// For MySQL, this includes warnings generated by the last executed statement.
16027 /// To retrieve all warnings for a multi-statement query, `SHOW WARNINGS` must
16028 /// be executed after each statement.
16029 pub messages: std::vec::Vec<crate::model::sql_instances_execute_sql_response::Message>,
16030
16031 /// The additional metadata information regarding the execution of the SQL
16032 /// statements.
16033 pub metadata: std::option::Option<crate::model::Metadata>,
16034
16035 /// The list of results after executing all the SQL statements.
16036 pub results: std::vec::Vec<crate::model::QueryResult>,
16037
16038 /// Contains the error from the database if the SQL execution failed.
16039 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16040
16041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16042}
16043
16044impl SqlInstancesExecuteSqlResponse {
16045 pub fn new() -> Self {
16046 std::default::Default::default()
16047 }
16048
16049 /// Sets the value of [messages][crate::model::SqlInstancesExecuteSqlResponse::messages].
16050 ///
16051 /// # Example
16052 /// ```ignore,no_run
16053 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16054 /// use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16055 /// let x = SqlInstancesExecuteSqlResponse::new()
16056 /// .set_messages([
16057 /// Message::default()/* use setters */,
16058 /// Message::default()/* use (different) setters */,
16059 /// ]);
16060 /// ```
16061 pub fn set_messages<T, V>(mut self, v: T) -> Self
16062 where
16063 T: std::iter::IntoIterator<Item = V>,
16064 V: std::convert::Into<crate::model::sql_instances_execute_sql_response::Message>,
16065 {
16066 use std::iter::Iterator;
16067 self.messages = v.into_iter().map(|i| i.into()).collect();
16068 self
16069 }
16070
16071 /// Sets the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16072 ///
16073 /// # Example
16074 /// ```ignore,no_run
16075 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16076 /// use google_cloud_sql_v1::model::Metadata;
16077 /// let x = SqlInstancesExecuteSqlResponse::new().set_metadata(Metadata::default()/* use setters */);
16078 /// ```
16079 pub fn set_metadata<T>(mut self, v: T) -> Self
16080 where
16081 T: std::convert::Into<crate::model::Metadata>,
16082 {
16083 self.metadata = std::option::Option::Some(v.into());
16084 self
16085 }
16086
16087 /// Sets or clears the value of [metadata][crate::model::SqlInstancesExecuteSqlResponse::metadata].
16088 ///
16089 /// # Example
16090 /// ```ignore,no_run
16091 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16092 /// use google_cloud_sql_v1::model::Metadata;
16093 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(Some(Metadata::default()/* use setters */));
16094 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_metadata(None::<Metadata>);
16095 /// ```
16096 pub fn set_or_clear_metadata<T>(mut self, v: std::option::Option<T>) -> Self
16097 where
16098 T: std::convert::Into<crate::model::Metadata>,
16099 {
16100 self.metadata = v.map(|x| x.into());
16101 self
16102 }
16103
16104 /// Sets the value of [results][crate::model::SqlInstancesExecuteSqlResponse::results].
16105 ///
16106 /// # Example
16107 /// ```ignore,no_run
16108 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16109 /// use google_cloud_sql_v1::model::QueryResult;
16110 /// let x = SqlInstancesExecuteSqlResponse::new()
16111 /// .set_results([
16112 /// QueryResult::default()/* use setters */,
16113 /// QueryResult::default()/* use (different) setters */,
16114 /// ]);
16115 /// ```
16116 pub fn set_results<T, V>(mut self, v: T) -> Self
16117 where
16118 T: std::iter::IntoIterator<Item = V>,
16119 V: std::convert::Into<crate::model::QueryResult>,
16120 {
16121 use std::iter::Iterator;
16122 self.results = v.into_iter().map(|i| i.into()).collect();
16123 self
16124 }
16125
16126 /// Sets the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16127 ///
16128 /// # Example
16129 /// ```ignore,no_run
16130 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16131 /// use google_cloud_rpc::model::Status;
16132 /// let x = SqlInstancesExecuteSqlResponse::new().set_status(Status::default()/* use setters */);
16133 /// ```
16134 pub fn set_status<T>(mut self, v: T) -> Self
16135 where
16136 T: std::convert::Into<google_cloud_rpc::model::Status>,
16137 {
16138 self.status = std::option::Option::Some(v.into());
16139 self
16140 }
16141
16142 /// Sets or clears the value of [status][crate::model::SqlInstancesExecuteSqlResponse::status].
16143 ///
16144 /// # Example
16145 /// ```ignore,no_run
16146 /// # use google_cloud_sql_v1::model::SqlInstancesExecuteSqlResponse;
16147 /// use google_cloud_rpc::model::Status;
16148 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(Some(Status::default()/* use setters */));
16149 /// let x = SqlInstancesExecuteSqlResponse::new().set_or_clear_status(None::<Status>);
16150 /// ```
16151 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16152 where
16153 T: std::convert::Into<google_cloud_rpc::model::Status>,
16154 {
16155 self.status = v.map(|x| x.into());
16156 self
16157 }
16158}
16159
16160impl wkt::message::Message for SqlInstancesExecuteSqlResponse {
16161 fn typename() -> &'static str {
16162 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse"
16163 }
16164}
16165
16166/// Defines additional types related to [SqlInstancesExecuteSqlResponse].
16167pub mod sql_instances_execute_sql_response {
16168 #[allow(unused_imports)]
16169 use super::*;
16170
16171 /// Represents a notice or warning message from the database.
16172 #[derive(Clone, Default, PartialEq)]
16173 #[non_exhaustive]
16174 pub struct Message {
16175 /// The full message string.
16176 /// For PostgreSQL, this is a formatted string that may include severity,
16177 /// code, and the notice/warning message.
16178 /// For MySQL, this contains the warning message.
16179 pub message: std::option::Option<std::string::String>,
16180
16181 /// The severity of the message (e.g., "NOTICE" for PostgreSQL, "WARNING" for
16182 /// MySQL).
16183 pub severity: std::option::Option<std::string::String>,
16184
16185 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16186 }
16187
16188 impl Message {
16189 pub fn new() -> Self {
16190 std::default::Default::default()
16191 }
16192
16193 /// Sets the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16194 ///
16195 /// # Example
16196 /// ```ignore,no_run
16197 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16198 /// let x = Message::new().set_message("example");
16199 /// ```
16200 pub fn set_message<T>(mut self, v: T) -> Self
16201 where
16202 T: std::convert::Into<std::string::String>,
16203 {
16204 self.message = std::option::Option::Some(v.into());
16205 self
16206 }
16207
16208 /// Sets or clears the value of [message][crate::model::sql_instances_execute_sql_response::Message::message].
16209 ///
16210 /// # Example
16211 /// ```ignore,no_run
16212 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16213 /// let x = Message::new().set_or_clear_message(Some("example"));
16214 /// let x = Message::new().set_or_clear_message(None::<String>);
16215 /// ```
16216 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
16217 where
16218 T: std::convert::Into<std::string::String>,
16219 {
16220 self.message = v.map(|x| x.into());
16221 self
16222 }
16223
16224 /// Sets the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16225 ///
16226 /// # Example
16227 /// ```ignore,no_run
16228 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16229 /// let x = Message::new().set_severity("example");
16230 /// ```
16231 pub fn set_severity<T>(mut self, v: T) -> Self
16232 where
16233 T: std::convert::Into<std::string::String>,
16234 {
16235 self.severity = std::option::Option::Some(v.into());
16236 self
16237 }
16238
16239 /// Sets or clears the value of [severity][crate::model::sql_instances_execute_sql_response::Message::severity].
16240 ///
16241 /// # Example
16242 /// ```ignore,no_run
16243 /// # use google_cloud_sql_v1::model::sql_instances_execute_sql_response::Message;
16244 /// let x = Message::new().set_or_clear_severity(Some("example"));
16245 /// let x = Message::new().set_or_clear_severity(None::<String>);
16246 /// ```
16247 pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
16248 where
16249 T: std::convert::Into<std::string::String>,
16250 {
16251 self.severity = v.map(|x| x.into());
16252 self
16253 }
16254 }
16255
16256 impl wkt::message::Message for Message {
16257 fn typename() -> &'static str {
16258 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message"
16259 }
16260 }
16261}
16262
16263/// QueryResult contains the result of executing a single SQL statement.
16264#[derive(Clone, Default, PartialEq)]
16265#[non_exhaustive]
16266pub struct QueryResult {
16267 /// List of columns included in the result. This also includes the data type
16268 /// of the column.
16269 pub columns: std::vec::Vec<crate::model::Column>,
16270
16271 /// Rows returned by the SQL statement.
16272 pub rows: std::vec::Vec<crate::model::Row>,
16273
16274 /// Message related to the SQL execution result.
16275 pub message: std::string::String,
16276
16277 /// Set to true if the SQL execution's result is truncated due to size limits
16278 /// or an error retrieving results.
16279 pub partial_result: bool,
16280
16281 /// If results were truncated due to an error, details of that error.
16282 pub status: std::option::Option<google_cloud_rpc::model::Status>,
16283
16284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16285}
16286
16287impl QueryResult {
16288 pub fn new() -> Self {
16289 std::default::Default::default()
16290 }
16291
16292 /// Sets the value of [columns][crate::model::QueryResult::columns].
16293 ///
16294 /// # Example
16295 /// ```ignore,no_run
16296 /// # use google_cloud_sql_v1::model::QueryResult;
16297 /// use google_cloud_sql_v1::model::Column;
16298 /// let x = QueryResult::new()
16299 /// .set_columns([
16300 /// Column::default()/* use setters */,
16301 /// Column::default()/* use (different) setters */,
16302 /// ]);
16303 /// ```
16304 pub fn set_columns<T, V>(mut self, v: T) -> Self
16305 where
16306 T: std::iter::IntoIterator<Item = V>,
16307 V: std::convert::Into<crate::model::Column>,
16308 {
16309 use std::iter::Iterator;
16310 self.columns = v.into_iter().map(|i| i.into()).collect();
16311 self
16312 }
16313
16314 /// Sets the value of [rows][crate::model::QueryResult::rows].
16315 ///
16316 /// # Example
16317 /// ```ignore,no_run
16318 /// # use google_cloud_sql_v1::model::QueryResult;
16319 /// use google_cloud_sql_v1::model::Row;
16320 /// let x = QueryResult::new()
16321 /// .set_rows([
16322 /// Row::default()/* use setters */,
16323 /// Row::default()/* use (different) setters */,
16324 /// ]);
16325 /// ```
16326 pub fn set_rows<T, V>(mut self, v: T) -> Self
16327 where
16328 T: std::iter::IntoIterator<Item = V>,
16329 V: std::convert::Into<crate::model::Row>,
16330 {
16331 use std::iter::Iterator;
16332 self.rows = v.into_iter().map(|i| i.into()).collect();
16333 self
16334 }
16335
16336 /// Sets the value of [message][crate::model::QueryResult::message].
16337 ///
16338 /// # Example
16339 /// ```ignore,no_run
16340 /// # use google_cloud_sql_v1::model::QueryResult;
16341 /// let x = QueryResult::new().set_message("example");
16342 /// ```
16343 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16344 self.message = v.into();
16345 self
16346 }
16347
16348 /// Sets the value of [partial_result][crate::model::QueryResult::partial_result].
16349 ///
16350 /// # Example
16351 /// ```ignore,no_run
16352 /// # use google_cloud_sql_v1::model::QueryResult;
16353 /// let x = QueryResult::new().set_partial_result(true);
16354 /// ```
16355 pub fn set_partial_result<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16356 self.partial_result = v.into();
16357 self
16358 }
16359
16360 /// Sets the value of [status][crate::model::QueryResult::status].
16361 ///
16362 /// # Example
16363 /// ```ignore,no_run
16364 /// # use google_cloud_sql_v1::model::QueryResult;
16365 /// use google_cloud_rpc::model::Status;
16366 /// let x = QueryResult::new().set_status(Status::default()/* use setters */);
16367 /// ```
16368 pub fn set_status<T>(mut self, v: T) -> Self
16369 where
16370 T: std::convert::Into<google_cloud_rpc::model::Status>,
16371 {
16372 self.status = std::option::Option::Some(v.into());
16373 self
16374 }
16375
16376 /// Sets or clears the value of [status][crate::model::QueryResult::status].
16377 ///
16378 /// # Example
16379 /// ```ignore,no_run
16380 /// # use google_cloud_sql_v1::model::QueryResult;
16381 /// use google_cloud_rpc::model::Status;
16382 /// let x = QueryResult::new().set_or_clear_status(Some(Status::default()/* use setters */));
16383 /// let x = QueryResult::new().set_or_clear_status(None::<Status>);
16384 /// ```
16385 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
16386 where
16387 T: std::convert::Into<google_cloud_rpc::model::Status>,
16388 {
16389 self.status = v.map(|x| x.into());
16390 self
16391 }
16392}
16393
16394impl wkt::message::Message for QueryResult {
16395 fn typename() -> &'static str {
16396 "type.googleapis.com/google.cloud.sql.v1.QueryResult"
16397 }
16398}
16399
16400/// Contains the name and datatype of a column.
16401#[derive(Clone, Default, PartialEq)]
16402#[non_exhaustive]
16403pub struct Column {
16404 /// Name of the column.
16405 pub name: std::string::String,
16406
16407 /// Datatype of the column.
16408 pub r#type: std::string::String,
16409
16410 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16411}
16412
16413impl Column {
16414 pub fn new() -> Self {
16415 std::default::Default::default()
16416 }
16417
16418 /// Sets the value of [name][crate::model::Column::name].
16419 ///
16420 /// # Example
16421 /// ```ignore,no_run
16422 /// # use google_cloud_sql_v1::model::Column;
16423 /// let x = Column::new().set_name("example");
16424 /// ```
16425 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16426 self.name = v.into();
16427 self
16428 }
16429
16430 /// Sets the value of [r#type][crate::model::Column::type].
16431 ///
16432 /// # Example
16433 /// ```ignore,no_run
16434 /// # use google_cloud_sql_v1::model::Column;
16435 /// let x = Column::new().set_type("example");
16436 /// ```
16437 pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16438 self.r#type = v.into();
16439 self
16440 }
16441}
16442
16443impl wkt::message::Message for Column {
16444 fn typename() -> &'static str {
16445 "type.googleapis.com/google.cloud.sql.v1.Column"
16446 }
16447}
16448
16449/// Contains the values for a row.
16450#[derive(Clone, Default, PartialEq)]
16451#[non_exhaustive]
16452pub struct Row {
16453 /// The values for the row.
16454 pub values: std::vec::Vec<crate::model::Value>,
16455
16456 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16457}
16458
16459impl Row {
16460 pub fn new() -> Self {
16461 std::default::Default::default()
16462 }
16463
16464 /// Sets the value of [values][crate::model::Row::values].
16465 ///
16466 /// # Example
16467 /// ```ignore,no_run
16468 /// # use google_cloud_sql_v1::model::Row;
16469 /// use google_cloud_sql_v1::model::Value;
16470 /// let x = Row::new()
16471 /// .set_values([
16472 /// Value::default()/* use setters */,
16473 /// Value::default()/* use (different) setters */,
16474 /// ]);
16475 /// ```
16476 pub fn set_values<T, V>(mut self, v: T) -> Self
16477 where
16478 T: std::iter::IntoIterator<Item = V>,
16479 V: std::convert::Into<crate::model::Value>,
16480 {
16481 use std::iter::Iterator;
16482 self.values = v.into_iter().map(|i| i.into()).collect();
16483 self
16484 }
16485}
16486
16487impl wkt::message::Message for Row {
16488 fn typename() -> &'static str {
16489 "type.googleapis.com/google.cloud.sql.v1.Row"
16490 }
16491}
16492
16493/// The cell value of the table.
16494#[derive(Clone, Default, PartialEq)]
16495#[non_exhaustive]
16496pub struct Value {
16497 /// The cell value in string format.
16498 pub value: std::string::String,
16499
16500 /// If cell value is null, then this flag will be set to true.
16501 pub null_value: bool,
16502
16503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16504}
16505
16506impl Value {
16507 pub fn new() -> Self {
16508 std::default::Default::default()
16509 }
16510
16511 /// Sets the value of [value][crate::model::Value::value].
16512 ///
16513 /// # Example
16514 /// ```ignore,no_run
16515 /// # use google_cloud_sql_v1::model::Value;
16516 /// let x = Value::new().set_value("example");
16517 /// ```
16518 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16519 self.value = v.into();
16520 self
16521 }
16522
16523 /// Sets the value of [null_value][crate::model::Value::null_value].
16524 ///
16525 /// # Example
16526 /// ```ignore,no_run
16527 /// # use google_cloud_sql_v1::model::Value;
16528 /// let x = Value::new().set_null_value(true);
16529 /// ```
16530 pub fn set_null_value<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
16531 self.null_value = v.into();
16532 self
16533 }
16534}
16535
16536impl wkt::message::Message for Value {
16537 fn typename() -> &'static str {
16538 "type.googleapis.com/google.cloud.sql.v1.Value"
16539 }
16540}
16541
16542/// The additional metadata information regarding the execution of the SQL
16543/// statements.
16544#[derive(Clone, Default, PartialEq)]
16545#[non_exhaustive]
16546pub struct Metadata {
16547 /// The time taken to execute the SQL statements.
16548 pub sql_statement_execution_time: std::option::Option<wkt::Duration>,
16549
16550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16551}
16552
16553impl Metadata {
16554 pub fn new() -> Self {
16555 std::default::Default::default()
16556 }
16557
16558 /// Sets the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16559 ///
16560 /// # Example
16561 /// ```ignore,no_run
16562 /// # use google_cloud_sql_v1::model::Metadata;
16563 /// use wkt::Duration;
16564 /// let x = Metadata::new().set_sql_statement_execution_time(Duration::default()/* use setters */);
16565 /// ```
16566 pub fn set_sql_statement_execution_time<T>(mut self, v: T) -> Self
16567 where
16568 T: std::convert::Into<wkt::Duration>,
16569 {
16570 self.sql_statement_execution_time = std::option::Option::Some(v.into());
16571 self
16572 }
16573
16574 /// Sets or clears the value of [sql_statement_execution_time][crate::model::Metadata::sql_statement_execution_time].
16575 ///
16576 /// # Example
16577 /// ```ignore,no_run
16578 /// # use google_cloud_sql_v1::model::Metadata;
16579 /// use wkt::Duration;
16580 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(Some(Duration::default()/* use setters */));
16581 /// let x = Metadata::new().set_or_clear_sql_statement_execution_time(None::<Duration>);
16582 /// ```
16583 pub fn set_or_clear_sql_statement_execution_time<T>(mut self, v: std::option::Option<T>) -> Self
16584 where
16585 T: std::convert::Into<wkt::Duration>,
16586 {
16587 self.sql_statement_execution_time = v.map(|x| x.into());
16588 self
16589 }
16590}
16591
16592impl wkt::message::Message for Metadata {
16593 fn typename() -> &'static str {
16594 "type.googleapis.com/google.cloud.sql.v1.Metadata"
16595 }
16596}
16597
16598/// Request to acquire a lease for SSRS.
16599#[derive(Clone, Default, PartialEq)]
16600#[non_exhaustive]
16601pub struct SqlInstancesAcquireSsrsLeaseRequest {
16602 /// Required. Cloud SQL instance ID. This doesn't include the project ID. It's
16603 /// composed of lowercase letters, numbers, and hyphens, and it must start with
16604 /// a letter. The total length must be 98 characters or less (Example:
16605 /// instance-id).
16606 pub instance: std::string::String,
16607
16608 /// Required. Project ID of the project that contains the instance (Example:
16609 /// project-id).
16610 pub project: std::string::String,
16611
16612 /// Required. The request body.
16613 pub body: std::option::Option<crate::model::InstancesAcquireSsrsLeaseRequest>,
16614
16615 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16616}
16617
16618impl SqlInstancesAcquireSsrsLeaseRequest {
16619 pub fn new() -> Self {
16620 std::default::Default::default()
16621 }
16622
16623 /// Sets the value of [instance][crate::model::SqlInstancesAcquireSsrsLeaseRequest::instance].
16624 ///
16625 /// # Example
16626 /// ```ignore,no_run
16627 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16628 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_instance("example");
16629 /// ```
16630 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16631 self.instance = v.into();
16632 self
16633 }
16634
16635 /// Sets the value of [project][crate::model::SqlInstancesAcquireSsrsLeaseRequest::project].
16636 ///
16637 /// # Example
16638 /// ```ignore,no_run
16639 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16640 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_project("example");
16641 /// ```
16642 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16643 self.project = v.into();
16644 self
16645 }
16646
16647 /// Sets the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16648 ///
16649 /// # Example
16650 /// ```ignore,no_run
16651 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16652 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16653 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_body(InstancesAcquireSsrsLeaseRequest::default()/* use setters */);
16654 /// ```
16655 pub fn set_body<T>(mut self, v: T) -> Self
16656 where
16657 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16658 {
16659 self.body = std::option::Option::Some(v.into());
16660 self
16661 }
16662
16663 /// Sets or clears the value of [body][crate::model::SqlInstancesAcquireSsrsLeaseRequest::body].
16664 ///
16665 /// # Example
16666 /// ```ignore,no_run
16667 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseRequest;
16668 /// use google_cloud_sql_v1::model::InstancesAcquireSsrsLeaseRequest;
16669 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(Some(InstancesAcquireSsrsLeaseRequest::default()/* use setters */));
16670 /// let x = SqlInstancesAcquireSsrsLeaseRequest::new().set_or_clear_body(None::<InstancesAcquireSsrsLeaseRequest>);
16671 /// ```
16672 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
16673 where
16674 T: std::convert::Into<crate::model::InstancesAcquireSsrsLeaseRequest>,
16675 {
16676 self.body = v.map(|x| x.into());
16677 self
16678 }
16679}
16680
16681impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseRequest {
16682 fn typename() -> &'static str {
16683 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest"
16684 }
16685}
16686
16687/// Response for the acquire SSRS lease request.
16688#[derive(Clone, Default, PartialEq)]
16689#[non_exhaustive]
16690pub struct SqlInstancesAcquireSsrsLeaseResponse {
16691 /// The unique identifier for this operation.
16692 pub operation_id: std::string::String,
16693
16694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16695}
16696
16697impl SqlInstancesAcquireSsrsLeaseResponse {
16698 pub fn new() -> Self {
16699 std::default::Default::default()
16700 }
16701
16702 /// Sets the value of [operation_id][crate::model::SqlInstancesAcquireSsrsLeaseResponse::operation_id].
16703 ///
16704 /// # Example
16705 /// ```ignore,no_run
16706 /// # use google_cloud_sql_v1::model::SqlInstancesAcquireSsrsLeaseResponse;
16707 /// let x = SqlInstancesAcquireSsrsLeaseResponse::new().set_operation_id("example");
16708 /// ```
16709 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16710 self.operation_id = v.into();
16711 self
16712 }
16713}
16714
16715impl wkt::message::Message for SqlInstancesAcquireSsrsLeaseResponse {
16716 fn typename() -> &'static str {
16717 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse"
16718 }
16719}
16720
16721/// Request to release a lease for SSRS.
16722#[derive(Clone, Default, PartialEq)]
16723#[non_exhaustive]
16724pub struct SqlInstancesReleaseSsrsLeaseRequest {
16725 /// Required. The Cloud SQL instance ID. This doesn't include the project ID.
16726 /// The instance ID contains lowercase letters, numbers, and hyphens, and it
16727 /// must start with a letter. This ID can have a maximum length of 98
16728 /// characters.
16729 pub instance: std::string::String,
16730
16731 /// Required. The project ID that contains the instance.
16732 pub project: std::string::String,
16733
16734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16735}
16736
16737impl SqlInstancesReleaseSsrsLeaseRequest {
16738 pub fn new() -> Self {
16739 std::default::Default::default()
16740 }
16741
16742 /// Sets the value of [instance][crate::model::SqlInstancesReleaseSsrsLeaseRequest::instance].
16743 ///
16744 /// # Example
16745 /// ```ignore,no_run
16746 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16747 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_instance("example");
16748 /// ```
16749 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16750 self.instance = v.into();
16751 self
16752 }
16753
16754 /// Sets the value of [project][crate::model::SqlInstancesReleaseSsrsLeaseRequest::project].
16755 ///
16756 /// # Example
16757 /// ```ignore,no_run
16758 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseRequest;
16759 /// let x = SqlInstancesReleaseSsrsLeaseRequest::new().set_project("example");
16760 /// ```
16761 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16762 self.project = v.into();
16763 self
16764 }
16765}
16766
16767impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseRequest {
16768 fn typename() -> &'static str {
16769 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest"
16770 }
16771}
16772
16773/// Response for the release SSRS lease request.
16774#[derive(Clone, Default, PartialEq)]
16775#[non_exhaustive]
16776pub struct SqlInstancesReleaseSsrsLeaseResponse {
16777 /// The unique identifier for this operation.
16778 pub operation_id: std::string::String,
16779
16780 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16781}
16782
16783impl SqlInstancesReleaseSsrsLeaseResponse {
16784 pub fn new() -> Self {
16785 std::default::Default::default()
16786 }
16787
16788 /// Sets the value of [operation_id][crate::model::SqlInstancesReleaseSsrsLeaseResponse::operation_id].
16789 ///
16790 /// # Example
16791 /// ```ignore,no_run
16792 /// # use google_cloud_sql_v1::model::SqlInstancesReleaseSsrsLeaseResponse;
16793 /// let x = SqlInstancesReleaseSsrsLeaseResponse::new().set_operation_id("example");
16794 /// ```
16795 pub fn set_operation_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16796 self.operation_id = v.into();
16797 self
16798 }
16799}
16800
16801impl wkt::message::Message for SqlInstancesReleaseSsrsLeaseResponse {
16802 fn typename() -> &'static str {
16803 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse"
16804 }
16805}
16806
16807/// Request to perform a point in time restore on a Google Cloud Backup and
16808/// Disaster Recovery managed instance.
16809#[derive(Clone, Default, PartialEq)]
16810#[non_exhaustive]
16811pub struct SqlInstancesPointInTimeRestoreRequest {
16812 /// Required. The parent resource where you created this instance.
16813 /// Format: projects/{project}
16814 pub parent: std::string::String,
16815
16816 /// Required. The context for request to perform a PITR on a Google Cloud
16817 /// Backup and Disaster Recovery managed instance.
16818 pub context: std::option::Option<crate::model::PointInTimeRestoreContext>,
16819
16820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16821}
16822
16823impl SqlInstancesPointInTimeRestoreRequest {
16824 pub fn new() -> Self {
16825 std::default::Default::default()
16826 }
16827
16828 /// Sets the value of [parent][crate::model::SqlInstancesPointInTimeRestoreRequest::parent].
16829 ///
16830 /// # Example
16831 /// ```ignore,no_run
16832 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16833 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_parent("example");
16834 /// ```
16835 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16836 self.parent = v.into();
16837 self
16838 }
16839
16840 /// Sets the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
16841 ///
16842 /// # Example
16843 /// ```ignore,no_run
16844 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16845 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
16846 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_context(PointInTimeRestoreContext::default()/* use setters */);
16847 /// ```
16848 pub fn set_context<T>(mut self, v: T) -> Self
16849 where
16850 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
16851 {
16852 self.context = std::option::Option::Some(v.into());
16853 self
16854 }
16855
16856 /// Sets or clears the value of [context][crate::model::SqlInstancesPointInTimeRestoreRequest::context].
16857 ///
16858 /// # Example
16859 /// ```ignore,no_run
16860 /// # use google_cloud_sql_v1::model::SqlInstancesPointInTimeRestoreRequest;
16861 /// use google_cloud_sql_v1::model::PointInTimeRestoreContext;
16862 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(Some(PointInTimeRestoreContext::default()/* use setters */));
16863 /// let x = SqlInstancesPointInTimeRestoreRequest::new().set_or_clear_context(None::<PointInTimeRestoreContext>);
16864 /// ```
16865 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
16866 where
16867 T: std::convert::Into<crate::model::PointInTimeRestoreContext>,
16868 {
16869 self.context = v.map(|x| x.into());
16870 self
16871 }
16872}
16873
16874impl wkt::message::Message for SqlInstancesPointInTimeRestoreRequest {
16875 fn typename() -> &'static str {
16876 "type.googleapis.com/google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest"
16877 }
16878}
16879
16880/// Operations get request.
16881#[derive(Clone, Default, PartialEq)]
16882#[non_exhaustive]
16883pub struct SqlOperationsGetRequest {
16884 /// Required. Instance operation ID.
16885 pub operation: std::string::String,
16886
16887 /// Required. Project ID of the project that contains the instance.
16888 pub project: std::string::String,
16889
16890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16891}
16892
16893impl SqlOperationsGetRequest {
16894 pub fn new() -> Self {
16895 std::default::Default::default()
16896 }
16897
16898 /// Sets the value of [operation][crate::model::SqlOperationsGetRequest::operation].
16899 ///
16900 /// # Example
16901 /// ```ignore,no_run
16902 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
16903 /// let x = SqlOperationsGetRequest::new().set_operation("example");
16904 /// ```
16905 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16906 self.operation = v.into();
16907 self
16908 }
16909
16910 /// Sets the value of [project][crate::model::SqlOperationsGetRequest::project].
16911 ///
16912 /// # Example
16913 /// ```ignore,no_run
16914 /// # use google_cloud_sql_v1::model::SqlOperationsGetRequest;
16915 /// let x = SqlOperationsGetRequest::new().set_project("example");
16916 /// ```
16917 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16918 self.project = v.into();
16919 self
16920 }
16921}
16922
16923impl wkt::message::Message for SqlOperationsGetRequest {
16924 fn typename() -> &'static str {
16925 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsGetRequest"
16926 }
16927}
16928
16929/// Operations list request.
16930#[derive(Clone, Default, PartialEq)]
16931#[non_exhaustive]
16932pub struct SqlOperationsListRequest {
16933 /// Cloud SQL instance ID. This does not include the project ID.
16934 pub instance: std::string::String,
16935
16936 /// Maximum number of operations per response.
16937 pub max_results: u32,
16938
16939 /// A previously-returned page token representing part of the larger set of
16940 /// results to view.
16941 pub page_token: std::string::String,
16942
16943 /// Project ID of the project that contains the instance.
16944 pub project: std::string::String,
16945
16946 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16947}
16948
16949impl SqlOperationsListRequest {
16950 pub fn new() -> Self {
16951 std::default::Default::default()
16952 }
16953
16954 /// Sets the value of [instance][crate::model::SqlOperationsListRequest::instance].
16955 ///
16956 /// # Example
16957 /// ```ignore,no_run
16958 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16959 /// let x = SqlOperationsListRequest::new().set_instance("example");
16960 /// ```
16961 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16962 self.instance = v.into();
16963 self
16964 }
16965
16966 /// Sets the value of [max_results][crate::model::SqlOperationsListRequest::max_results].
16967 ///
16968 /// # Example
16969 /// ```ignore,no_run
16970 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16971 /// let x = SqlOperationsListRequest::new().set_max_results(42_u32);
16972 /// ```
16973 pub fn set_max_results<T: std::convert::Into<u32>>(mut self, v: T) -> Self {
16974 self.max_results = v.into();
16975 self
16976 }
16977
16978 /// Sets the value of [page_token][crate::model::SqlOperationsListRequest::page_token].
16979 ///
16980 /// # Example
16981 /// ```ignore,no_run
16982 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16983 /// let x = SqlOperationsListRequest::new().set_page_token("example");
16984 /// ```
16985 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16986 self.page_token = v.into();
16987 self
16988 }
16989
16990 /// Sets the value of [project][crate::model::SqlOperationsListRequest::project].
16991 ///
16992 /// # Example
16993 /// ```ignore,no_run
16994 /// # use google_cloud_sql_v1::model::SqlOperationsListRequest;
16995 /// let x = SqlOperationsListRequest::new().set_project("example");
16996 /// ```
16997 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16998 self.project = v.into();
16999 self
17000 }
17001}
17002
17003impl wkt::message::Message for SqlOperationsListRequest {
17004 fn typename() -> &'static str {
17005 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsListRequest"
17006 }
17007}
17008
17009/// Operations list response.
17010#[derive(Clone, Default, PartialEq)]
17011#[non_exhaustive]
17012pub struct OperationsListResponse {
17013 /// This is always `sql#operationsList`.
17014 pub kind: std::string::String,
17015
17016 /// List of operation resources.
17017 pub items: std::vec::Vec<crate::model::Operation>,
17018
17019 /// The continuation token, used to page through large result sets. Provide
17020 /// this value in a subsequent request to return the next page of results.
17021 pub next_page_token: std::string::String,
17022
17023 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17024}
17025
17026impl OperationsListResponse {
17027 pub fn new() -> Self {
17028 std::default::Default::default()
17029 }
17030
17031 /// Sets the value of [kind][crate::model::OperationsListResponse::kind].
17032 ///
17033 /// # Example
17034 /// ```ignore,no_run
17035 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17036 /// let x = OperationsListResponse::new().set_kind("example");
17037 /// ```
17038 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17039 self.kind = v.into();
17040 self
17041 }
17042
17043 /// Sets the value of [items][crate::model::OperationsListResponse::items].
17044 ///
17045 /// # Example
17046 /// ```ignore,no_run
17047 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17048 /// use google_cloud_sql_v1::model::Operation;
17049 /// let x = OperationsListResponse::new()
17050 /// .set_items([
17051 /// Operation::default()/* use setters */,
17052 /// Operation::default()/* use (different) setters */,
17053 /// ]);
17054 /// ```
17055 pub fn set_items<T, V>(mut self, v: T) -> Self
17056 where
17057 T: std::iter::IntoIterator<Item = V>,
17058 V: std::convert::Into<crate::model::Operation>,
17059 {
17060 use std::iter::Iterator;
17061 self.items = v.into_iter().map(|i| i.into()).collect();
17062 self
17063 }
17064
17065 /// Sets the value of [next_page_token][crate::model::OperationsListResponse::next_page_token].
17066 ///
17067 /// # Example
17068 /// ```ignore,no_run
17069 /// # use google_cloud_sql_v1::model::OperationsListResponse;
17070 /// let x = OperationsListResponse::new().set_next_page_token("example");
17071 /// ```
17072 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17073 self.next_page_token = v.into();
17074 self
17075 }
17076}
17077
17078impl wkt::message::Message for OperationsListResponse {
17079 fn typename() -> &'static str {
17080 "type.googleapis.com/google.cloud.sql.v1.OperationsListResponse"
17081 }
17082}
17083
17084#[doc(hidden)]
17085impl google_cloud_gax::paginator::internal::PageableResponse for OperationsListResponse {
17086 type PageItem = crate::model::Operation;
17087
17088 fn items(self) -> std::vec::Vec<Self::PageItem> {
17089 self.items
17090 }
17091
17092 fn next_page_token(&self) -> std::string::String {
17093 use std::clone::Clone;
17094 self.next_page_token.clone()
17095 }
17096}
17097
17098/// Operations cancel request.
17099#[derive(Clone, Default, PartialEq)]
17100#[non_exhaustive]
17101pub struct SqlOperationsCancelRequest {
17102 /// Instance operation ID.
17103 pub operation: std::string::String,
17104
17105 /// Project ID of the project that contains the instance.
17106 pub project: std::string::String,
17107
17108 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17109}
17110
17111impl SqlOperationsCancelRequest {
17112 pub fn new() -> Self {
17113 std::default::Default::default()
17114 }
17115
17116 /// Sets the value of [operation][crate::model::SqlOperationsCancelRequest::operation].
17117 ///
17118 /// # Example
17119 /// ```ignore,no_run
17120 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17121 /// let x = SqlOperationsCancelRequest::new().set_operation("example");
17122 /// ```
17123 pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17124 self.operation = v.into();
17125 self
17126 }
17127
17128 /// Sets the value of [project][crate::model::SqlOperationsCancelRequest::project].
17129 ///
17130 /// # Example
17131 /// ```ignore,no_run
17132 /// # use google_cloud_sql_v1::model::SqlOperationsCancelRequest;
17133 /// let x = SqlOperationsCancelRequest::new().set_project("example");
17134 /// ```
17135 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17136 self.project = v.into();
17137 self
17138 }
17139}
17140
17141impl wkt::message::Message for SqlOperationsCancelRequest {
17142 fn typename() -> &'static str {
17143 "type.googleapis.com/google.cloud.sql.v1.SqlOperationsCancelRequest"
17144 }
17145}
17146
17147/// An entry for an Access Control list.
17148#[derive(Clone, Default, PartialEq)]
17149#[non_exhaustive]
17150pub struct AclEntry {
17151 /// The allowlisted value for the access control list.
17152 pub value: std::string::String,
17153
17154 /// The time when this access control entry expires in
17155 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
17156 /// `2012-11-15T16:19:00.094Z`.
17157 pub expiration_time: std::option::Option<wkt::Timestamp>,
17158
17159 /// Optional. A label to identify this entry.
17160 pub name: std::string::String,
17161
17162 /// This is always `sql#aclEntry`.
17163 pub kind: std::string::String,
17164
17165 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17166}
17167
17168impl AclEntry {
17169 pub fn new() -> Self {
17170 std::default::Default::default()
17171 }
17172
17173 /// Sets the value of [value][crate::model::AclEntry::value].
17174 ///
17175 /// # Example
17176 /// ```ignore,no_run
17177 /// # use google_cloud_sql_v1::model::AclEntry;
17178 /// let x = AclEntry::new().set_value("example");
17179 /// ```
17180 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17181 self.value = v.into();
17182 self
17183 }
17184
17185 /// Sets the value of [expiration_time][crate::model::AclEntry::expiration_time].
17186 ///
17187 /// # Example
17188 /// ```ignore,no_run
17189 /// # use google_cloud_sql_v1::model::AclEntry;
17190 /// use wkt::Timestamp;
17191 /// let x = AclEntry::new().set_expiration_time(Timestamp::default()/* use setters */);
17192 /// ```
17193 pub fn set_expiration_time<T>(mut self, v: T) -> Self
17194 where
17195 T: std::convert::Into<wkt::Timestamp>,
17196 {
17197 self.expiration_time = std::option::Option::Some(v.into());
17198 self
17199 }
17200
17201 /// Sets or clears the value of [expiration_time][crate::model::AclEntry::expiration_time].
17202 ///
17203 /// # Example
17204 /// ```ignore,no_run
17205 /// # use google_cloud_sql_v1::model::AclEntry;
17206 /// use wkt::Timestamp;
17207 /// let x = AclEntry::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
17208 /// let x = AclEntry::new().set_or_clear_expiration_time(None::<Timestamp>);
17209 /// ```
17210 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
17211 where
17212 T: std::convert::Into<wkt::Timestamp>,
17213 {
17214 self.expiration_time = v.map(|x| x.into());
17215 self
17216 }
17217
17218 /// Sets the value of [name][crate::model::AclEntry::name].
17219 ///
17220 /// # Example
17221 /// ```ignore,no_run
17222 /// # use google_cloud_sql_v1::model::AclEntry;
17223 /// let x = AclEntry::new().set_name("example");
17224 /// ```
17225 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17226 self.name = v.into();
17227 self
17228 }
17229
17230 /// Sets the value of [kind][crate::model::AclEntry::kind].
17231 ///
17232 /// # Example
17233 /// ```ignore,no_run
17234 /// # use google_cloud_sql_v1::model::AclEntry;
17235 /// let x = AclEntry::new().set_kind("example");
17236 /// ```
17237 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17238 self.kind = v.into();
17239 self
17240 }
17241}
17242
17243impl wkt::message::Message for AclEntry {
17244 fn typename() -> &'static str {
17245 "type.googleapis.com/google.cloud.sql.v1.AclEntry"
17246 }
17247}
17248
17249/// An Admin API warning message.
17250#[derive(Clone, Default, PartialEq)]
17251#[non_exhaustive]
17252pub struct ApiWarning {
17253 /// Code to uniquely identify the warning type.
17254 pub code: crate::model::api_warning::SqlApiWarningCode,
17255
17256 /// The warning message.
17257 pub message: std::string::String,
17258
17259 /// The region name for REGION_UNREACHABLE warning.
17260 pub region: std::string::String,
17261
17262 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17263}
17264
17265impl ApiWarning {
17266 pub fn new() -> Self {
17267 std::default::Default::default()
17268 }
17269
17270 /// Sets the value of [code][crate::model::ApiWarning::code].
17271 ///
17272 /// # Example
17273 /// ```ignore,no_run
17274 /// # use google_cloud_sql_v1::model::ApiWarning;
17275 /// use google_cloud_sql_v1::model::api_warning::SqlApiWarningCode;
17276 /// let x0 = ApiWarning::new().set_code(SqlApiWarningCode::RegionUnreachable);
17277 /// let x1 = ApiWarning::new().set_code(SqlApiWarningCode::MaxResultsExceedsLimit);
17278 /// let x2 = ApiWarning::new().set_code(SqlApiWarningCode::CompromisedCredentials);
17279 /// ```
17280 pub fn set_code<T: std::convert::Into<crate::model::api_warning::SqlApiWarningCode>>(
17281 mut self,
17282 v: T,
17283 ) -> Self {
17284 self.code = v.into();
17285 self
17286 }
17287
17288 /// Sets the value of [message][crate::model::ApiWarning::message].
17289 ///
17290 /// # Example
17291 /// ```ignore,no_run
17292 /// # use google_cloud_sql_v1::model::ApiWarning;
17293 /// let x = ApiWarning::new().set_message("example");
17294 /// ```
17295 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17296 self.message = v.into();
17297 self
17298 }
17299
17300 /// Sets the value of [region][crate::model::ApiWarning::region].
17301 ///
17302 /// # Example
17303 /// ```ignore,no_run
17304 /// # use google_cloud_sql_v1::model::ApiWarning;
17305 /// let x = ApiWarning::new().set_region("example");
17306 /// ```
17307 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17308 self.region = v.into();
17309 self
17310 }
17311}
17312
17313impl wkt::message::Message for ApiWarning {
17314 fn typename() -> &'static str {
17315 "type.googleapis.com/google.cloud.sql.v1.ApiWarning"
17316 }
17317}
17318
17319/// Defines additional types related to [ApiWarning].
17320pub mod api_warning {
17321 #[allow(unused_imports)]
17322 use super::*;
17323
17324 ///
17325 /// # Working with unknown values
17326 ///
17327 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17328 /// additional enum variants at any time. Adding new variants is not considered
17329 /// a breaking change. Applications should write their code in anticipation of:
17330 ///
17331 /// - New values appearing in future releases of the client library, **and**
17332 /// - New values received dynamically, without application changes.
17333 ///
17334 /// Please consult the [Working with enums] section in the user guide for some
17335 /// guidelines.
17336 ///
17337 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17338 #[derive(Clone, Debug, PartialEq)]
17339 #[non_exhaustive]
17340 pub enum SqlApiWarningCode {
17341 /// An unknown or unset warning type from Cloud SQL API.
17342 Unspecified,
17343 /// Warning when one or more regions are not reachable. The returned result
17344 /// set may be incomplete.
17345 RegionUnreachable,
17346 /// Warning when user provided maxResults parameter exceeds the limit. The
17347 /// returned result set may be incomplete.
17348 MaxResultsExceedsLimit,
17349 /// Warning when user tries to create/update a user with credentials that
17350 /// have previously been compromised by a public data breach.
17351 CompromisedCredentials,
17352 /// Warning when the operation succeeds but some non-critical workflow state
17353 /// failed.
17354 InternalStateFailure,
17355 /// If set, the enum was initialized with an unknown value.
17356 ///
17357 /// Applications can examine the value using [SqlApiWarningCode::value] or
17358 /// [SqlApiWarningCode::name].
17359 UnknownValue(sql_api_warning_code::UnknownValue),
17360 }
17361
17362 #[doc(hidden)]
17363 pub mod sql_api_warning_code {
17364 #[allow(unused_imports)]
17365 use super::*;
17366 #[derive(Clone, Debug, PartialEq)]
17367 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17368 }
17369
17370 impl SqlApiWarningCode {
17371 /// Gets the enum value.
17372 ///
17373 /// Returns `None` if the enum contains an unknown value deserialized from
17374 /// the string representation of enums.
17375 pub fn value(&self) -> std::option::Option<i32> {
17376 match self {
17377 Self::Unspecified => std::option::Option::Some(0),
17378 Self::RegionUnreachable => std::option::Option::Some(1),
17379 Self::MaxResultsExceedsLimit => std::option::Option::Some(2),
17380 Self::CompromisedCredentials => std::option::Option::Some(3),
17381 Self::InternalStateFailure => std::option::Option::Some(4),
17382 Self::UnknownValue(u) => u.0.value(),
17383 }
17384 }
17385
17386 /// Gets the enum value as a string.
17387 ///
17388 /// Returns `None` if the enum contains an unknown value deserialized from
17389 /// the integer representation of enums.
17390 pub fn name(&self) -> std::option::Option<&str> {
17391 match self {
17392 Self::Unspecified => std::option::Option::Some("SQL_API_WARNING_CODE_UNSPECIFIED"),
17393 Self::RegionUnreachable => std::option::Option::Some("REGION_UNREACHABLE"),
17394 Self::MaxResultsExceedsLimit => {
17395 std::option::Option::Some("MAX_RESULTS_EXCEEDS_LIMIT")
17396 }
17397 Self::CompromisedCredentials => {
17398 std::option::Option::Some("COMPROMISED_CREDENTIALS")
17399 }
17400 Self::InternalStateFailure => std::option::Option::Some("INTERNAL_STATE_FAILURE"),
17401 Self::UnknownValue(u) => u.0.name(),
17402 }
17403 }
17404 }
17405
17406 impl std::default::Default for SqlApiWarningCode {
17407 fn default() -> Self {
17408 use std::convert::From;
17409 Self::from(0)
17410 }
17411 }
17412
17413 impl std::fmt::Display for SqlApiWarningCode {
17414 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17415 wkt::internal::display_enum(f, self.name(), self.value())
17416 }
17417 }
17418
17419 impl std::convert::From<i32> for SqlApiWarningCode {
17420 fn from(value: i32) -> Self {
17421 match value {
17422 0 => Self::Unspecified,
17423 1 => Self::RegionUnreachable,
17424 2 => Self::MaxResultsExceedsLimit,
17425 3 => Self::CompromisedCredentials,
17426 4 => Self::InternalStateFailure,
17427 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17428 wkt::internal::UnknownEnumValue::Integer(value),
17429 )),
17430 }
17431 }
17432 }
17433
17434 impl std::convert::From<&str> for SqlApiWarningCode {
17435 fn from(value: &str) -> Self {
17436 use std::string::ToString;
17437 match value {
17438 "SQL_API_WARNING_CODE_UNSPECIFIED" => Self::Unspecified,
17439 "REGION_UNREACHABLE" => Self::RegionUnreachable,
17440 "MAX_RESULTS_EXCEEDS_LIMIT" => Self::MaxResultsExceedsLimit,
17441 "COMPROMISED_CREDENTIALS" => Self::CompromisedCredentials,
17442 "INTERNAL_STATE_FAILURE" => Self::InternalStateFailure,
17443 _ => Self::UnknownValue(sql_api_warning_code::UnknownValue(
17444 wkt::internal::UnknownEnumValue::String(value.to_string()),
17445 )),
17446 }
17447 }
17448 }
17449
17450 impl serde::ser::Serialize for SqlApiWarningCode {
17451 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17452 where
17453 S: serde::Serializer,
17454 {
17455 match self {
17456 Self::Unspecified => serializer.serialize_i32(0),
17457 Self::RegionUnreachable => serializer.serialize_i32(1),
17458 Self::MaxResultsExceedsLimit => serializer.serialize_i32(2),
17459 Self::CompromisedCredentials => serializer.serialize_i32(3),
17460 Self::InternalStateFailure => serializer.serialize_i32(4),
17461 Self::UnknownValue(u) => u.0.serialize(serializer),
17462 }
17463 }
17464 }
17465
17466 impl<'de> serde::de::Deserialize<'de> for SqlApiWarningCode {
17467 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17468 where
17469 D: serde::Deserializer<'de>,
17470 {
17471 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlApiWarningCode>::new(
17472 ".google.cloud.sql.v1.ApiWarning.SqlApiWarningCode",
17473 ))
17474 }
17475 }
17476}
17477
17478/// We currently only support backup retention by specifying the number
17479/// of backups we will retain.
17480#[derive(Clone, Default, PartialEq)]
17481#[non_exhaustive]
17482pub struct BackupRetentionSettings {
17483 /// The unit that 'retained_backups' represents.
17484 pub retention_unit: crate::model::backup_retention_settings::RetentionUnit,
17485
17486 /// Depending on the value of retention_unit, this is used to determine
17487 /// if a backup needs to be deleted. If retention_unit is 'COUNT', we will
17488 /// retain this many backups.
17489 pub retained_backups: std::option::Option<wkt::Int32Value>,
17490
17491 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17492}
17493
17494impl BackupRetentionSettings {
17495 pub fn new() -> Self {
17496 std::default::Default::default()
17497 }
17498
17499 /// Sets the value of [retention_unit][crate::model::BackupRetentionSettings::retention_unit].
17500 ///
17501 /// # Example
17502 /// ```ignore,no_run
17503 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17504 /// use google_cloud_sql_v1::model::backup_retention_settings::RetentionUnit;
17505 /// let x0 = BackupRetentionSettings::new().set_retention_unit(RetentionUnit::Count);
17506 /// ```
17507 pub fn set_retention_unit<
17508 T: std::convert::Into<crate::model::backup_retention_settings::RetentionUnit>,
17509 >(
17510 mut self,
17511 v: T,
17512 ) -> Self {
17513 self.retention_unit = v.into();
17514 self
17515 }
17516
17517 /// Sets the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17518 ///
17519 /// # Example
17520 /// ```ignore,no_run
17521 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17522 /// use wkt::Int32Value;
17523 /// let x = BackupRetentionSettings::new().set_retained_backups(Int32Value::default()/* use setters */);
17524 /// ```
17525 pub fn set_retained_backups<T>(mut self, v: T) -> Self
17526 where
17527 T: std::convert::Into<wkt::Int32Value>,
17528 {
17529 self.retained_backups = std::option::Option::Some(v.into());
17530 self
17531 }
17532
17533 /// Sets or clears the value of [retained_backups][crate::model::BackupRetentionSettings::retained_backups].
17534 ///
17535 /// # Example
17536 /// ```ignore,no_run
17537 /// # use google_cloud_sql_v1::model::BackupRetentionSettings;
17538 /// use wkt::Int32Value;
17539 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(Some(Int32Value::default()/* use setters */));
17540 /// let x = BackupRetentionSettings::new().set_or_clear_retained_backups(None::<Int32Value>);
17541 /// ```
17542 pub fn set_or_clear_retained_backups<T>(mut self, v: std::option::Option<T>) -> Self
17543 where
17544 T: std::convert::Into<wkt::Int32Value>,
17545 {
17546 self.retained_backups = v.map(|x| x.into());
17547 self
17548 }
17549}
17550
17551impl wkt::message::Message for BackupRetentionSettings {
17552 fn typename() -> &'static str {
17553 "type.googleapis.com/google.cloud.sql.v1.BackupRetentionSettings"
17554 }
17555}
17556
17557/// Defines additional types related to [BackupRetentionSettings].
17558pub mod backup_retention_settings {
17559 #[allow(unused_imports)]
17560 use super::*;
17561
17562 /// The units that retained_backups specifies, we only support COUNT.
17563 ///
17564 /// # Working with unknown values
17565 ///
17566 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17567 /// additional enum variants at any time. Adding new variants is not considered
17568 /// a breaking change. Applications should write their code in anticipation of:
17569 ///
17570 /// - New values appearing in future releases of the client library, **and**
17571 /// - New values received dynamically, without application changes.
17572 ///
17573 /// Please consult the [Working with enums] section in the user guide for some
17574 /// guidelines.
17575 ///
17576 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17577 #[derive(Clone, Debug, PartialEq)]
17578 #[non_exhaustive]
17579 pub enum RetentionUnit {
17580 /// Backup retention unit is unspecified, will be treated as COUNT.
17581 Unspecified,
17582 /// Retention will be by count, eg. "retain the most recent 7 backups".
17583 Count,
17584 /// If set, the enum was initialized with an unknown value.
17585 ///
17586 /// Applications can examine the value using [RetentionUnit::value] or
17587 /// [RetentionUnit::name].
17588 UnknownValue(retention_unit::UnknownValue),
17589 }
17590
17591 #[doc(hidden)]
17592 pub mod retention_unit {
17593 #[allow(unused_imports)]
17594 use super::*;
17595 #[derive(Clone, Debug, PartialEq)]
17596 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17597 }
17598
17599 impl RetentionUnit {
17600 /// Gets the enum value.
17601 ///
17602 /// Returns `None` if the enum contains an unknown value deserialized from
17603 /// the string representation of enums.
17604 pub fn value(&self) -> std::option::Option<i32> {
17605 match self {
17606 Self::Unspecified => std::option::Option::Some(0),
17607 Self::Count => std::option::Option::Some(1),
17608 Self::UnknownValue(u) => u.0.value(),
17609 }
17610 }
17611
17612 /// Gets the enum value as a string.
17613 ///
17614 /// Returns `None` if the enum contains an unknown value deserialized from
17615 /// the integer representation of enums.
17616 pub fn name(&self) -> std::option::Option<&str> {
17617 match self {
17618 Self::Unspecified => std::option::Option::Some("RETENTION_UNIT_UNSPECIFIED"),
17619 Self::Count => std::option::Option::Some("COUNT"),
17620 Self::UnknownValue(u) => u.0.name(),
17621 }
17622 }
17623 }
17624
17625 impl std::default::Default for RetentionUnit {
17626 fn default() -> Self {
17627 use std::convert::From;
17628 Self::from(0)
17629 }
17630 }
17631
17632 impl std::fmt::Display for RetentionUnit {
17633 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17634 wkt::internal::display_enum(f, self.name(), self.value())
17635 }
17636 }
17637
17638 impl std::convert::From<i32> for RetentionUnit {
17639 fn from(value: i32) -> Self {
17640 match value {
17641 0 => Self::Unspecified,
17642 1 => Self::Count,
17643 _ => Self::UnknownValue(retention_unit::UnknownValue(
17644 wkt::internal::UnknownEnumValue::Integer(value),
17645 )),
17646 }
17647 }
17648 }
17649
17650 impl std::convert::From<&str> for RetentionUnit {
17651 fn from(value: &str) -> Self {
17652 use std::string::ToString;
17653 match value {
17654 "RETENTION_UNIT_UNSPECIFIED" => Self::Unspecified,
17655 "COUNT" => Self::Count,
17656 _ => Self::UnknownValue(retention_unit::UnknownValue(
17657 wkt::internal::UnknownEnumValue::String(value.to_string()),
17658 )),
17659 }
17660 }
17661 }
17662
17663 impl serde::ser::Serialize for RetentionUnit {
17664 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17665 where
17666 S: serde::Serializer,
17667 {
17668 match self {
17669 Self::Unspecified => serializer.serialize_i32(0),
17670 Self::Count => serializer.serialize_i32(1),
17671 Self::UnknownValue(u) => u.0.serialize(serializer),
17672 }
17673 }
17674 }
17675
17676 impl<'de> serde::de::Deserialize<'de> for RetentionUnit {
17677 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17678 where
17679 D: serde::Deserializer<'de>,
17680 {
17681 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RetentionUnit>::new(
17682 ".google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit",
17683 ))
17684 }
17685 }
17686}
17687
17688/// Database instance backup configuration.
17689#[derive(Clone, Default, PartialEq)]
17690#[non_exhaustive]
17691pub struct BackupConfiguration {
17692 /// Start time for the daily backup configuration in UTC timezone in the 24
17693 /// hour format - `HH:MM`.
17694 pub start_time: std::string::String,
17695
17696 /// Whether this configuration is enabled.
17697 pub enabled: std::option::Option<wkt::BoolValue>,
17698
17699 /// This is always `sql#backupConfiguration`.
17700 pub kind: std::string::String,
17701
17702 /// (MySQL only) Whether binary log is enabled. If backup configuration is
17703 /// disabled, binarylog must be disabled as well.
17704 pub binary_log_enabled: std::option::Option<wkt::BoolValue>,
17705
17706 /// Reserved for future use.
17707 pub replication_log_archiving_enabled: std::option::Option<wkt::BoolValue>,
17708
17709 /// Location of the backup
17710 pub location: std::string::String,
17711
17712 /// Whether point in time recovery is enabled.
17713 pub point_in_time_recovery_enabled: std::option::Option<wkt::BoolValue>,
17714
17715 /// Backup retention settings.
17716 pub backup_retention_settings: std::option::Option<crate::model::BackupRetentionSettings>,
17717
17718 /// The number of days of transaction logs we retain for point in time
17719 /// restore, from 1-7.
17720 pub transaction_log_retention_days: std::option::Option<wkt::Int32Value>,
17721
17722 /// Output only. This value contains the storage location of transactional logs
17723 /// used to perform point-in-time recovery (PITR) for the database.
17724 pub transactional_log_storage_state:
17725 std::option::Option<crate::model::backup_configuration::TransactionalLogStorageState>,
17726
17727 /// Output only. Backup tier that manages the backups for the instance.
17728 pub backup_tier: std::option::Option<crate::model::backup_configuration::BackupTier>,
17729
17730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17731}
17732
17733impl BackupConfiguration {
17734 pub fn new() -> Self {
17735 std::default::Default::default()
17736 }
17737
17738 /// Sets the value of [start_time][crate::model::BackupConfiguration::start_time].
17739 ///
17740 /// # Example
17741 /// ```ignore,no_run
17742 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17743 /// let x = BackupConfiguration::new().set_start_time("example");
17744 /// ```
17745 pub fn set_start_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17746 self.start_time = v.into();
17747 self
17748 }
17749
17750 /// Sets the value of [enabled][crate::model::BackupConfiguration::enabled].
17751 ///
17752 /// # Example
17753 /// ```ignore,no_run
17754 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17755 /// use wkt::BoolValue;
17756 /// let x = BackupConfiguration::new().set_enabled(BoolValue::default()/* use setters */);
17757 /// ```
17758 pub fn set_enabled<T>(mut self, v: T) -> Self
17759 where
17760 T: std::convert::Into<wkt::BoolValue>,
17761 {
17762 self.enabled = std::option::Option::Some(v.into());
17763 self
17764 }
17765
17766 /// Sets or clears the value of [enabled][crate::model::BackupConfiguration::enabled].
17767 ///
17768 /// # Example
17769 /// ```ignore,no_run
17770 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17771 /// use wkt::BoolValue;
17772 /// let x = BackupConfiguration::new().set_or_clear_enabled(Some(BoolValue::default()/* use setters */));
17773 /// let x = BackupConfiguration::new().set_or_clear_enabled(None::<BoolValue>);
17774 /// ```
17775 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17776 where
17777 T: std::convert::Into<wkt::BoolValue>,
17778 {
17779 self.enabled = v.map(|x| x.into());
17780 self
17781 }
17782
17783 /// Sets the value of [kind][crate::model::BackupConfiguration::kind].
17784 ///
17785 /// # Example
17786 /// ```ignore,no_run
17787 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17788 /// let x = BackupConfiguration::new().set_kind("example");
17789 /// ```
17790 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17791 self.kind = v.into();
17792 self
17793 }
17794
17795 /// Sets the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17796 ///
17797 /// # Example
17798 /// ```ignore,no_run
17799 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17800 /// use wkt::BoolValue;
17801 /// let x = BackupConfiguration::new().set_binary_log_enabled(BoolValue::default()/* use setters */);
17802 /// ```
17803 pub fn set_binary_log_enabled<T>(mut self, v: T) -> Self
17804 where
17805 T: std::convert::Into<wkt::BoolValue>,
17806 {
17807 self.binary_log_enabled = std::option::Option::Some(v.into());
17808 self
17809 }
17810
17811 /// Sets or clears the value of [binary_log_enabled][crate::model::BackupConfiguration::binary_log_enabled].
17812 ///
17813 /// # Example
17814 /// ```ignore,no_run
17815 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17816 /// use wkt::BoolValue;
17817 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(Some(BoolValue::default()/* use setters */));
17818 /// let x = BackupConfiguration::new().set_or_clear_binary_log_enabled(None::<BoolValue>);
17819 /// ```
17820 pub fn set_or_clear_binary_log_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17821 where
17822 T: std::convert::Into<wkt::BoolValue>,
17823 {
17824 self.binary_log_enabled = v.map(|x| x.into());
17825 self
17826 }
17827
17828 /// Sets the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
17829 ///
17830 /// # Example
17831 /// ```ignore,no_run
17832 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17833 /// use wkt::BoolValue;
17834 /// let x = BackupConfiguration::new().set_replication_log_archiving_enabled(BoolValue::default()/* use setters */);
17835 /// ```
17836 pub fn set_replication_log_archiving_enabled<T>(mut self, v: T) -> Self
17837 where
17838 T: std::convert::Into<wkt::BoolValue>,
17839 {
17840 self.replication_log_archiving_enabled = std::option::Option::Some(v.into());
17841 self
17842 }
17843
17844 /// Sets or clears the value of [replication_log_archiving_enabled][crate::model::BackupConfiguration::replication_log_archiving_enabled].
17845 ///
17846 /// # Example
17847 /// ```ignore,no_run
17848 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17849 /// use wkt::BoolValue;
17850 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(Some(BoolValue::default()/* use setters */));
17851 /// let x = BackupConfiguration::new().set_or_clear_replication_log_archiving_enabled(None::<BoolValue>);
17852 /// ```
17853 pub fn set_or_clear_replication_log_archiving_enabled<T>(
17854 mut self,
17855 v: std::option::Option<T>,
17856 ) -> Self
17857 where
17858 T: std::convert::Into<wkt::BoolValue>,
17859 {
17860 self.replication_log_archiving_enabled = v.map(|x| x.into());
17861 self
17862 }
17863
17864 /// Sets the value of [location][crate::model::BackupConfiguration::location].
17865 ///
17866 /// # Example
17867 /// ```ignore,no_run
17868 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17869 /// let x = BackupConfiguration::new().set_location("example");
17870 /// ```
17871 pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17872 self.location = v.into();
17873 self
17874 }
17875
17876 /// Sets the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
17877 ///
17878 /// # Example
17879 /// ```ignore,no_run
17880 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17881 /// use wkt::BoolValue;
17882 /// let x = BackupConfiguration::new().set_point_in_time_recovery_enabled(BoolValue::default()/* use setters */);
17883 /// ```
17884 pub fn set_point_in_time_recovery_enabled<T>(mut self, v: T) -> Self
17885 where
17886 T: std::convert::Into<wkt::BoolValue>,
17887 {
17888 self.point_in_time_recovery_enabled = std::option::Option::Some(v.into());
17889 self
17890 }
17891
17892 /// Sets or clears the value of [point_in_time_recovery_enabled][crate::model::BackupConfiguration::point_in_time_recovery_enabled].
17893 ///
17894 /// # Example
17895 /// ```ignore,no_run
17896 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17897 /// use wkt::BoolValue;
17898 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(Some(BoolValue::default()/* use setters */));
17899 /// let x = BackupConfiguration::new().set_or_clear_point_in_time_recovery_enabled(None::<BoolValue>);
17900 /// ```
17901 pub fn set_or_clear_point_in_time_recovery_enabled<T>(
17902 mut self,
17903 v: std::option::Option<T>,
17904 ) -> Self
17905 where
17906 T: std::convert::Into<wkt::BoolValue>,
17907 {
17908 self.point_in_time_recovery_enabled = v.map(|x| x.into());
17909 self
17910 }
17911
17912 /// Sets the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
17913 ///
17914 /// # Example
17915 /// ```ignore,no_run
17916 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17917 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
17918 /// let x = BackupConfiguration::new().set_backup_retention_settings(BackupRetentionSettings::default()/* use setters */);
17919 /// ```
17920 pub fn set_backup_retention_settings<T>(mut self, v: T) -> Self
17921 where
17922 T: std::convert::Into<crate::model::BackupRetentionSettings>,
17923 {
17924 self.backup_retention_settings = std::option::Option::Some(v.into());
17925 self
17926 }
17927
17928 /// Sets or clears the value of [backup_retention_settings][crate::model::BackupConfiguration::backup_retention_settings].
17929 ///
17930 /// # Example
17931 /// ```ignore,no_run
17932 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17933 /// use google_cloud_sql_v1::model::BackupRetentionSettings;
17934 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(Some(BackupRetentionSettings::default()/* use setters */));
17935 /// let x = BackupConfiguration::new().set_or_clear_backup_retention_settings(None::<BackupRetentionSettings>);
17936 /// ```
17937 pub fn set_or_clear_backup_retention_settings<T>(mut self, v: std::option::Option<T>) -> Self
17938 where
17939 T: std::convert::Into<crate::model::BackupRetentionSettings>,
17940 {
17941 self.backup_retention_settings = v.map(|x| x.into());
17942 self
17943 }
17944
17945 /// Sets the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
17946 ///
17947 /// # Example
17948 /// ```ignore,no_run
17949 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17950 /// use wkt::Int32Value;
17951 /// let x = BackupConfiguration::new().set_transaction_log_retention_days(Int32Value::default()/* use setters */);
17952 /// ```
17953 pub fn set_transaction_log_retention_days<T>(mut self, v: T) -> Self
17954 where
17955 T: std::convert::Into<wkt::Int32Value>,
17956 {
17957 self.transaction_log_retention_days = std::option::Option::Some(v.into());
17958 self
17959 }
17960
17961 /// Sets or clears the value of [transaction_log_retention_days][crate::model::BackupConfiguration::transaction_log_retention_days].
17962 ///
17963 /// # Example
17964 /// ```ignore,no_run
17965 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17966 /// use wkt::Int32Value;
17967 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(Some(Int32Value::default()/* use setters */));
17968 /// let x = BackupConfiguration::new().set_or_clear_transaction_log_retention_days(None::<Int32Value>);
17969 /// ```
17970 pub fn set_or_clear_transaction_log_retention_days<T>(
17971 mut self,
17972 v: std::option::Option<T>,
17973 ) -> Self
17974 where
17975 T: std::convert::Into<wkt::Int32Value>,
17976 {
17977 self.transaction_log_retention_days = v.map(|x| x.into());
17978 self
17979 }
17980
17981 /// Sets the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
17982 ///
17983 /// # Example
17984 /// ```ignore,no_run
17985 /// # use google_cloud_sql_v1::model::BackupConfiguration;
17986 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
17987 /// let x0 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::Disk);
17988 /// let x1 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchingToCloudStorage);
17989 /// let x2 = BackupConfiguration::new().set_transactional_log_storage_state(TransactionalLogStorageState::SwitchedToCloudStorage);
17990 /// ```
17991 pub fn set_transactional_log_storage_state<T>(mut self, v: T) -> Self
17992 where
17993 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
17994 {
17995 self.transactional_log_storage_state = std::option::Option::Some(v.into());
17996 self
17997 }
17998
17999 /// Sets or clears the value of [transactional_log_storage_state][crate::model::BackupConfiguration::transactional_log_storage_state].
18000 ///
18001 /// # Example
18002 /// ```ignore,no_run
18003 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18004 /// use google_cloud_sql_v1::model::backup_configuration::TransactionalLogStorageState;
18005 /// let x0 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::Disk));
18006 /// let x1 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchingToCloudStorage));
18007 /// let x2 = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(Some(TransactionalLogStorageState::SwitchedToCloudStorage));
18008 /// let x_none = BackupConfiguration::new().set_or_clear_transactional_log_storage_state(None::<TransactionalLogStorageState>);
18009 /// ```
18010 pub fn set_or_clear_transactional_log_storage_state<T>(
18011 mut self,
18012 v: std::option::Option<T>,
18013 ) -> Self
18014 where
18015 T: std::convert::Into<crate::model::backup_configuration::TransactionalLogStorageState>,
18016 {
18017 self.transactional_log_storage_state = v.map(|x| x.into());
18018 self
18019 }
18020
18021 /// Sets the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18022 ///
18023 /// # Example
18024 /// ```ignore,no_run
18025 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18026 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18027 /// let x0 = BackupConfiguration::new().set_backup_tier(BackupTier::Standard);
18028 /// let x1 = BackupConfiguration::new().set_backup_tier(BackupTier::Enhanced);
18029 /// ```
18030 pub fn set_backup_tier<T>(mut self, v: T) -> Self
18031 where
18032 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18033 {
18034 self.backup_tier = std::option::Option::Some(v.into());
18035 self
18036 }
18037
18038 /// Sets or clears the value of [backup_tier][crate::model::BackupConfiguration::backup_tier].
18039 ///
18040 /// # Example
18041 /// ```ignore,no_run
18042 /// # use google_cloud_sql_v1::model::BackupConfiguration;
18043 /// use google_cloud_sql_v1::model::backup_configuration::BackupTier;
18044 /// let x0 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Standard));
18045 /// let x1 = BackupConfiguration::new().set_or_clear_backup_tier(Some(BackupTier::Enhanced));
18046 /// let x_none = BackupConfiguration::new().set_or_clear_backup_tier(None::<BackupTier>);
18047 /// ```
18048 pub fn set_or_clear_backup_tier<T>(mut self, v: std::option::Option<T>) -> Self
18049 where
18050 T: std::convert::Into<crate::model::backup_configuration::BackupTier>,
18051 {
18052 self.backup_tier = v.map(|x| x.into());
18053 self
18054 }
18055}
18056
18057impl wkt::message::Message for BackupConfiguration {
18058 fn typename() -> &'static str {
18059 "type.googleapis.com/google.cloud.sql.v1.BackupConfiguration"
18060 }
18061}
18062
18063/// Defines additional types related to [BackupConfiguration].
18064pub mod backup_configuration {
18065 #[allow(unused_imports)]
18066 use super::*;
18067
18068 /// This value contains the storage location of the transactional logs
18069 /// used to perform point-in-time recovery (PITR) for the database.
18070 ///
18071 /// # Working with unknown values
18072 ///
18073 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18074 /// additional enum variants at any time. Adding new variants is not considered
18075 /// a breaking change. Applications should write their code in anticipation of:
18076 ///
18077 /// - New values appearing in future releases of the client library, **and**
18078 /// - New values received dynamically, without application changes.
18079 ///
18080 /// Please consult the [Working with enums] section in the user guide for some
18081 /// guidelines.
18082 ///
18083 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18084 #[derive(Clone, Debug, PartialEq)]
18085 #[non_exhaustive]
18086 pub enum TransactionalLogStorageState {
18087 /// Unspecified.
18088 Unspecified,
18089 /// The transaction logs used for PITR for the instance are stored
18090 /// on a data disk.
18091 Disk,
18092 /// The transaction logs used for PITR for the instance are switching from
18093 /// being stored on a data disk to being stored in Cloud Storage.
18094 /// Only applicable to MySQL.
18095 SwitchingToCloudStorage,
18096 /// The transaction logs used for PITR for the instance are now stored
18097 /// in Cloud Storage. Previously, they were stored on a data disk.
18098 /// Only applicable to MySQL.
18099 SwitchedToCloudStorage,
18100 /// The transaction logs used for PITR for the instance are stored in
18101 /// Cloud Storage. Only applicable to MySQL and PostgreSQL.
18102 CloudStorage,
18103 /// If set, the enum was initialized with an unknown value.
18104 ///
18105 /// Applications can examine the value using [TransactionalLogStorageState::value] or
18106 /// [TransactionalLogStorageState::name].
18107 UnknownValue(transactional_log_storage_state::UnknownValue),
18108 }
18109
18110 #[doc(hidden)]
18111 pub mod transactional_log_storage_state {
18112 #[allow(unused_imports)]
18113 use super::*;
18114 #[derive(Clone, Debug, PartialEq)]
18115 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18116 }
18117
18118 impl TransactionalLogStorageState {
18119 /// Gets the enum value.
18120 ///
18121 /// Returns `None` if the enum contains an unknown value deserialized from
18122 /// the string representation of enums.
18123 pub fn value(&self) -> std::option::Option<i32> {
18124 match self {
18125 Self::Unspecified => std::option::Option::Some(0),
18126 Self::Disk => std::option::Option::Some(1),
18127 Self::SwitchingToCloudStorage => std::option::Option::Some(2),
18128 Self::SwitchedToCloudStorage => std::option::Option::Some(3),
18129 Self::CloudStorage => std::option::Option::Some(4),
18130 Self::UnknownValue(u) => u.0.value(),
18131 }
18132 }
18133
18134 /// Gets the enum value as a string.
18135 ///
18136 /// Returns `None` if the enum contains an unknown value deserialized from
18137 /// the integer representation of enums.
18138 pub fn name(&self) -> std::option::Option<&str> {
18139 match self {
18140 Self::Unspecified => {
18141 std::option::Option::Some("TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED")
18142 }
18143 Self::Disk => std::option::Option::Some("DISK"),
18144 Self::SwitchingToCloudStorage => {
18145 std::option::Option::Some("SWITCHING_TO_CLOUD_STORAGE")
18146 }
18147 Self::SwitchedToCloudStorage => {
18148 std::option::Option::Some("SWITCHED_TO_CLOUD_STORAGE")
18149 }
18150 Self::CloudStorage => std::option::Option::Some("CLOUD_STORAGE"),
18151 Self::UnknownValue(u) => u.0.name(),
18152 }
18153 }
18154 }
18155
18156 impl std::default::Default for TransactionalLogStorageState {
18157 fn default() -> Self {
18158 use std::convert::From;
18159 Self::from(0)
18160 }
18161 }
18162
18163 impl std::fmt::Display for TransactionalLogStorageState {
18164 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18165 wkt::internal::display_enum(f, self.name(), self.value())
18166 }
18167 }
18168
18169 impl std::convert::From<i32> for TransactionalLogStorageState {
18170 fn from(value: i32) -> Self {
18171 match value {
18172 0 => Self::Unspecified,
18173 1 => Self::Disk,
18174 2 => Self::SwitchingToCloudStorage,
18175 3 => Self::SwitchedToCloudStorage,
18176 4 => Self::CloudStorage,
18177 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18178 wkt::internal::UnknownEnumValue::Integer(value),
18179 )),
18180 }
18181 }
18182 }
18183
18184 impl std::convert::From<&str> for TransactionalLogStorageState {
18185 fn from(value: &str) -> Self {
18186 use std::string::ToString;
18187 match value {
18188 "TRANSACTIONAL_LOG_STORAGE_STATE_UNSPECIFIED" => Self::Unspecified,
18189 "DISK" => Self::Disk,
18190 "SWITCHING_TO_CLOUD_STORAGE" => Self::SwitchingToCloudStorage,
18191 "SWITCHED_TO_CLOUD_STORAGE" => Self::SwitchedToCloudStorage,
18192 "CLOUD_STORAGE" => Self::CloudStorage,
18193 _ => Self::UnknownValue(transactional_log_storage_state::UnknownValue(
18194 wkt::internal::UnknownEnumValue::String(value.to_string()),
18195 )),
18196 }
18197 }
18198 }
18199
18200 impl serde::ser::Serialize for TransactionalLogStorageState {
18201 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18202 where
18203 S: serde::Serializer,
18204 {
18205 match self {
18206 Self::Unspecified => serializer.serialize_i32(0),
18207 Self::Disk => serializer.serialize_i32(1),
18208 Self::SwitchingToCloudStorage => serializer.serialize_i32(2),
18209 Self::SwitchedToCloudStorage => serializer.serialize_i32(3),
18210 Self::CloudStorage => serializer.serialize_i32(4),
18211 Self::UnknownValue(u) => u.0.serialize(serializer),
18212 }
18213 }
18214 }
18215
18216 impl<'de> serde::de::Deserialize<'de> for TransactionalLogStorageState {
18217 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18218 where
18219 D: serde::Deserializer<'de>,
18220 {
18221 deserializer.deserialize_any(
18222 wkt::internal::EnumVisitor::<TransactionalLogStorageState>::new(
18223 ".google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState",
18224 ),
18225 )
18226 }
18227 }
18228
18229 /// Backup tier that manages the backups for the instance.
18230 ///
18231 /// # Working with unknown values
18232 ///
18233 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18234 /// additional enum variants at any time. Adding new variants is not considered
18235 /// a breaking change. Applications should write their code in anticipation of:
18236 ///
18237 /// - New values appearing in future releases of the client library, **and**
18238 /// - New values received dynamically, without application changes.
18239 ///
18240 /// Please consult the [Working with enums] section in the user guide for some
18241 /// guidelines.
18242 ///
18243 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18244 #[derive(Clone, Debug, PartialEq)]
18245 #[non_exhaustive]
18246 pub enum BackupTier {
18247 /// Unspecified.
18248 Unspecified,
18249 /// Instance is managed by Cloud SQL.
18250 Standard,
18251 /// Deprecated: ADVANCED is deprecated. Please use ENHANCED instead.
18252 #[deprecated]
18253 Advanced,
18254 /// Instance is managed by Google Cloud Backup and DR Service.
18255 Enhanced,
18256 /// If set, the enum was initialized with an unknown value.
18257 ///
18258 /// Applications can examine the value using [BackupTier::value] or
18259 /// [BackupTier::name].
18260 UnknownValue(backup_tier::UnknownValue),
18261 }
18262
18263 #[doc(hidden)]
18264 pub mod backup_tier {
18265 #[allow(unused_imports)]
18266 use super::*;
18267 #[derive(Clone, Debug, PartialEq)]
18268 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18269 }
18270
18271 impl BackupTier {
18272 /// Gets the enum value.
18273 ///
18274 /// Returns `None` if the enum contains an unknown value deserialized from
18275 /// the string representation of enums.
18276 pub fn value(&self) -> std::option::Option<i32> {
18277 match self {
18278 Self::Unspecified => std::option::Option::Some(0),
18279 Self::Standard => std::option::Option::Some(1),
18280 Self::Advanced => std::option::Option::Some(2),
18281 Self::Enhanced => std::option::Option::Some(3),
18282 Self::UnknownValue(u) => u.0.value(),
18283 }
18284 }
18285
18286 /// Gets the enum value as a string.
18287 ///
18288 /// Returns `None` if the enum contains an unknown value deserialized from
18289 /// the integer representation of enums.
18290 pub fn name(&self) -> std::option::Option<&str> {
18291 match self {
18292 Self::Unspecified => std::option::Option::Some("BACKUP_TIER_UNSPECIFIED"),
18293 Self::Standard => std::option::Option::Some("STANDARD"),
18294 Self::Advanced => std::option::Option::Some("ADVANCED"),
18295 Self::Enhanced => std::option::Option::Some("ENHANCED"),
18296 Self::UnknownValue(u) => u.0.name(),
18297 }
18298 }
18299 }
18300
18301 impl std::default::Default for BackupTier {
18302 fn default() -> Self {
18303 use std::convert::From;
18304 Self::from(0)
18305 }
18306 }
18307
18308 impl std::fmt::Display for BackupTier {
18309 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18310 wkt::internal::display_enum(f, self.name(), self.value())
18311 }
18312 }
18313
18314 impl std::convert::From<i32> for BackupTier {
18315 fn from(value: i32) -> Self {
18316 match value {
18317 0 => Self::Unspecified,
18318 1 => Self::Standard,
18319 2 => Self::Advanced,
18320 3 => Self::Enhanced,
18321 _ => Self::UnknownValue(backup_tier::UnknownValue(
18322 wkt::internal::UnknownEnumValue::Integer(value),
18323 )),
18324 }
18325 }
18326 }
18327
18328 impl std::convert::From<&str> for BackupTier {
18329 fn from(value: &str) -> Self {
18330 use std::string::ToString;
18331 match value {
18332 "BACKUP_TIER_UNSPECIFIED" => Self::Unspecified,
18333 "STANDARD" => Self::Standard,
18334 "ADVANCED" => Self::Advanced,
18335 "ENHANCED" => Self::Enhanced,
18336 _ => Self::UnknownValue(backup_tier::UnknownValue(
18337 wkt::internal::UnknownEnumValue::String(value.to_string()),
18338 )),
18339 }
18340 }
18341 }
18342
18343 impl serde::ser::Serialize for BackupTier {
18344 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18345 where
18346 S: serde::Serializer,
18347 {
18348 match self {
18349 Self::Unspecified => serializer.serialize_i32(0),
18350 Self::Standard => serializer.serialize_i32(1),
18351 Self::Advanced => serializer.serialize_i32(2),
18352 Self::Enhanced => serializer.serialize_i32(3),
18353 Self::UnknownValue(u) => u.0.serialize(serializer),
18354 }
18355 }
18356 }
18357
18358 impl<'de> serde::de::Deserialize<'de> for BackupTier {
18359 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18360 where
18361 D: serde::Deserializer<'de>,
18362 {
18363 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupTier>::new(
18364 ".google.cloud.sql.v1.BackupConfiguration.BackupTier",
18365 ))
18366 }
18367 }
18368}
18369
18370/// Perform disk shrink context.
18371#[derive(Clone, Default, PartialEq)]
18372#[non_exhaustive]
18373pub struct PerformDiskShrinkContext {
18374 /// The target disk shrink size in GigaBytes.
18375 pub target_size_gb: i64,
18376
18377 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18378}
18379
18380impl PerformDiskShrinkContext {
18381 pub fn new() -> Self {
18382 std::default::Default::default()
18383 }
18384
18385 /// Sets the value of [target_size_gb][crate::model::PerformDiskShrinkContext::target_size_gb].
18386 ///
18387 /// # Example
18388 /// ```ignore,no_run
18389 /// # use google_cloud_sql_v1::model::PerformDiskShrinkContext;
18390 /// let x = PerformDiskShrinkContext::new().set_target_size_gb(42);
18391 /// ```
18392 pub fn set_target_size_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18393 self.target_size_gb = v.into();
18394 self
18395 }
18396}
18397
18398impl wkt::message::Message for PerformDiskShrinkContext {
18399 fn typename() -> &'static str {
18400 "type.googleapis.com/google.cloud.sql.v1.PerformDiskShrinkContext"
18401 }
18402}
18403
18404/// Structured PreCheckResponse containing message, type, and required
18405/// actions.
18406#[derive(Clone, Default, PartialEq)]
18407#[non_exhaustive]
18408pub struct PreCheckResponse {
18409 /// The message to be displayed to the user.
18410 pub message: std::option::Option<std::string::String>,
18411
18412 /// The type of message whether it is an info, warning, or error.
18413 pub message_type: std::option::Option<crate::model::pre_check_response::MessageType>,
18414
18415 /// The actions that the user needs to take. Use repeated for multiple
18416 /// actions.
18417 pub actions_required: std::vec::Vec<std::string::String>,
18418
18419 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18420}
18421
18422impl PreCheckResponse {
18423 pub fn new() -> Self {
18424 std::default::Default::default()
18425 }
18426
18427 /// Sets the value of [message][crate::model::PreCheckResponse::message].
18428 ///
18429 /// # Example
18430 /// ```ignore,no_run
18431 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18432 /// let x = PreCheckResponse::new().set_message("example");
18433 /// ```
18434 pub fn set_message<T>(mut self, v: T) -> Self
18435 where
18436 T: std::convert::Into<std::string::String>,
18437 {
18438 self.message = std::option::Option::Some(v.into());
18439 self
18440 }
18441
18442 /// Sets or clears the value of [message][crate::model::PreCheckResponse::message].
18443 ///
18444 /// # Example
18445 /// ```ignore,no_run
18446 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18447 /// let x = PreCheckResponse::new().set_or_clear_message(Some("example"));
18448 /// let x = PreCheckResponse::new().set_or_clear_message(None::<String>);
18449 /// ```
18450 pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
18451 where
18452 T: std::convert::Into<std::string::String>,
18453 {
18454 self.message = v.map(|x| x.into());
18455 self
18456 }
18457
18458 /// Sets the value of [message_type][crate::model::PreCheckResponse::message_type].
18459 ///
18460 /// # Example
18461 /// ```ignore,no_run
18462 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18463 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18464 /// let x0 = PreCheckResponse::new().set_message_type(MessageType::Info);
18465 /// let x1 = PreCheckResponse::new().set_message_type(MessageType::Warning);
18466 /// let x2 = PreCheckResponse::new().set_message_type(MessageType::Error);
18467 /// ```
18468 pub fn set_message_type<T>(mut self, v: T) -> Self
18469 where
18470 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18471 {
18472 self.message_type = std::option::Option::Some(v.into());
18473 self
18474 }
18475
18476 /// Sets or clears the value of [message_type][crate::model::PreCheckResponse::message_type].
18477 ///
18478 /// # Example
18479 /// ```ignore,no_run
18480 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18481 /// use google_cloud_sql_v1::model::pre_check_response::MessageType;
18482 /// let x0 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Info));
18483 /// let x1 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Warning));
18484 /// let x2 = PreCheckResponse::new().set_or_clear_message_type(Some(MessageType::Error));
18485 /// let x_none = PreCheckResponse::new().set_or_clear_message_type(None::<MessageType>);
18486 /// ```
18487 pub fn set_or_clear_message_type<T>(mut self, v: std::option::Option<T>) -> Self
18488 where
18489 T: std::convert::Into<crate::model::pre_check_response::MessageType>,
18490 {
18491 self.message_type = v.map(|x| x.into());
18492 self
18493 }
18494
18495 /// Sets the value of [actions_required][crate::model::PreCheckResponse::actions_required].
18496 ///
18497 /// # Example
18498 /// ```ignore,no_run
18499 /// # use google_cloud_sql_v1::model::PreCheckResponse;
18500 /// let x = PreCheckResponse::new().set_actions_required(["a", "b", "c"]);
18501 /// ```
18502 pub fn set_actions_required<T, V>(mut self, v: T) -> Self
18503 where
18504 T: std::iter::IntoIterator<Item = V>,
18505 V: std::convert::Into<std::string::String>,
18506 {
18507 use std::iter::Iterator;
18508 self.actions_required = v.into_iter().map(|i| i.into()).collect();
18509 self
18510 }
18511}
18512
18513impl wkt::message::Message for PreCheckResponse {
18514 fn typename() -> &'static str {
18515 "type.googleapis.com/google.cloud.sql.v1.PreCheckResponse"
18516 }
18517}
18518
18519/// Defines additional types related to [PreCheckResponse].
18520pub mod pre_check_response {
18521 #[allow(unused_imports)]
18522 use super::*;
18523
18524 /// The type of message which can be an info, a warning, or an error that
18525 /// requires user intervention.
18526 ///
18527 /// # Working with unknown values
18528 ///
18529 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18530 /// additional enum variants at any time. Adding new variants is not considered
18531 /// a breaking change. Applications should write their code in anticipation of:
18532 ///
18533 /// - New values appearing in future releases of the client library, **and**
18534 /// - New values received dynamically, without application changes.
18535 ///
18536 /// Please consult the [Working with enums] section in the user guide for some
18537 /// guidelines.
18538 ///
18539 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18540 #[derive(Clone, Debug, PartialEq)]
18541 #[non_exhaustive]
18542 pub enum MessageType {
18543 /// Default unspecified value to prevent unintended behavior changes.
18544 Unspecified,
18545 /// General informational messages that don't require action.
18546 Info,
18547 /// Warnings that might impact the upgrade but don't block it.
18548 Warning,
18549 /// Errors that a user must resolve before proceeding with the upgrade.
18550 Error,
18551 /// If set, the enum was initialized with an unknown value.
18552 ///
18553 /// Applications can examine the value using [MessageType::value] or
18554 /// [MessageType::name].
18555 UnknownValue(message_type::UnknownValue),
18556 }
18557
18558 #[doc(hidden)]
18559 pub mod message_type {
18560 #[allow(unused_imports)]
18561 use super::*;
18562 #[derive(Clone, Debug, PartialEq)]
18563 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18564 }
18565
18566 impl MessageType {
18567 /// Gets the enum value.
18568 ///
18569 /// Returns `None` if the enum contains an unknown value deserialized from
18570 /// the string representation of enums.
18571 pub fn value(&self) -> std::option::Option<i32> {
18572 match self {
18573 Self::Unspecified => std::option::Option::Some(0),
18574 Self::Info => std::option::Option::Some(1),
18575 Self::Warning => std::option::Option::Some(2),
18576 Self::Error => std::option::Option::Some(3),
18577 Self::UnknownValue(u) => u.0.value(),
18578 }
18579 }
18580
18581 /// Gets the enum value as a string.
18582 ///
18583 /// Returns `None` if the enum contains an unknown value deserialized from
18584 /// the integer representation of enums.
18585 pub fn name(&self) -> std::option::Option<&str> {
18586 match self {
18587 Self::Unspecified => std::option::Option::Some("MESSAGE_TYPE_UNSPECIFIED"),
18588 Self::Info => std::option::Option::Some("INFO"),
18589 Self::Warning => std::option::Option::Some("WARNING"),
18590 Self::Error => std::option::Option::Some("ERROR"),
18591 Self::UnknownValue(u) => u.0.name(),
18592 }
18593 }
18594 }
18595
18596 impl std::default::Default for MessageType {
18597 fn default() -> Self {
18598 use std::convert::From;
18599 Self::from(0)
18600 }
18601 }
18602
18603 impl std::fmt::Display for MessageType {
18604 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18605 wkt::internal::display_enum(f, self.name(), self.value())
18606 }
18607 }
18608
18609 impl std::convert::From<i32> for MessageType {
18610 fn from(value: i32) -> Self {
18611 match value {
18612 0 => Self::Unspecified,
18613 1 => Self::Info,
18614 2 => Self::Warning,
18615 3 => Self::Error,
18616 _ => Self::UnknownValue(message_type::UnknownValue(
18617 wkt::internal::UnknownEnumValue::Integer(value),
18618 )),
18619 }
18620 }
18621 }
18622
18623 impl std::convert::From<&str> for MessageType {
18624 fn from(value: &str) -> Self {
18625 use std::string::ToString;
18626 match value {
18627 "MESSAGE_TYPE_UNSPECIFIED" => Self::Unspecified,
18628 "INFO" => Self::Info,
18629 "WARNING" => Self::Warning,
18630 "ERROR" => Self::Error,
18631 _ => Self::UnknownValue(message_type::UnknownValue(
18632 wkt::internal::UnknownEnumValue::String(value.to_string()),
18633 )),
18634 }
18635 }
18636 }
18637
18638 impl serde::ser::Serialize for MessageType {
18639 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18640 where
18641 S: serde::Serializer,
18642 {
18643 match self {
18644 Self::Unspecified => serializer.serialize_i32(0),
18645 Self::Info => serializer.serialize_i32(1),
18646 Self::Warning => serializer.serialize_i32(2),
18647 Self::Error => serializer.serialize_i32(3),
18648 Self::UnknownValue(u) => u.0.serialize(serializer),
18649 }
18650 }
18651 }
18652
18653 impl<'de> serde::de::Deserialize<'de> for MessageType {
18654 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18655 where
18656 D: serde::Deserializer<'de>,
18657 {
18658 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageType>::new(
18659 ".google.cloud.sql.v1.PreCheckResponse.MessageType",
18660 ))
18661 }
18662 }
18663}
18664
18665/// Pre-check major version upgrade context.
18666#[derive(Clone, Default, PartialEq)]
18667#[non_exhaustive]
18668pub struct PreCheckMajorVersionUpgradeContext {
18669 /// Required. The target database version to upgrade to.
18670 pub target_database_version: crate::model::SqlDatabaseVersion,
18671
18672 /// Output only. The responses from the precheck operation.
18673 pub pre_check_response: std::vec::Vec<crate::model::PreCheckResponse>,
18674
18675 /// Optional. This is always `sql#preCheckMajorVersionUpgradeContext`.
18676 pub kind: std::string::String,
18677
18678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18679}
18680
18681impl PreCheckMajorVersionUpgradeContext {
18682 pub fn new() -> Self {
18683 std::default::Default::default()
18684 }
18685
18686 /// Sets the value of [target_database_version][crate::model::PreCheckMajorVersionUpgradeContext::target_database_version].
18687 ///
18688 /// # Example
18689 /// ```ignore,no_run
18690 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18691 /// use google_cloud_sql_v1::model::SqlDatabaseVersion;
18692 /// let x0 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql56);
18693 /// let x1 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql57);
18694 /// let x2 = PreCheckMajorVersionUpgradeContext::new().set_target_database_version(SqlDatabaseVersion::Mysql80);
18695 /// ```
18696 pub fn set_target_database_version<T: std::convert::Into<crate::model::SqlDatabaseVersion>>(
18697 mut self,
18698 v: T,
18699 ) -> Self {
18700 self.target_database_version = v.into();
18701 self
18702 }
18703
18704 /// Sets the value of [pre_check_response][crate::model::PreCheckMajorVersionUpgradeContext::pre_check_response].
18705 ///
18706 /// # Example
18707 /// ```ignore,no_run
18708 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18709 /// use google_cloud_sql_v1::model::PreCheckResponse;
18710 /// let x = PreCheckMajorVersionUpgradeContext::new()
18711 /// .set_pre_check_response([
18712 /// PreCheckResponse::default()/* use setters */,
18713 /// PreCheckResponse::default()/* use (different) setters */,
18714 /// ]);
18715 /// ```
18716 pub fn set_pre_check_response<T, V>(mut self, v: T) -> Self
18717 where
18718 T: std::iter::IntoIterator<Item = V>,
18719 V: std::convert::Into<crate::model::PreCheckResponse>,
18720 {
18721 use std::iter::Iterator;
18722 self.pre_check_response = v.into_iter().map(|i| i.into()).collect();
18723 self
18724 }
18725
18726 /// Sets the value of [kind][crate::model::PreCheckMajorVersionUpgradeContext::kind].
18727 ///
18728 /// # Example
18729 /// ```ignore,no_run
18730 /// # use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
18731 /// let x = PreCheckMajorVersionUpgradeContext::new().set_kind("example");
18732 /// ```
18733 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18734 self.kind = v.into();
18735 self
18736 }
18737}
18738
18739impl wkt::message::Message for PreCheckMajorVersionUpgradeContext {
18740 fn typename() -> &'static str {
18741 "type.googleapis.com/google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext"
18742 }
18743}
18744
18745/// Backup context.
18746#[derive(Clone, Default, PartialEq)]
18747#[non_exhaustive]
18748pub struct BackupContext {
18749 /// The identifier of the backup.
18750 pub backup_id: i64,
18751
18752 /// This is always `sql#backupContext`.
18753 pub kind: std::string::String,
18754
18755 /// The name of the backup.
18756 /// Format: projects/{project}/backups/{backup}
18757 pub name: std::string::String,
18758
18759 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18760}
18761
18762impl BackupContext {
18763 pub fn new() -> Self {
18764 std::default::Default::default()
18765 }
18766
18767 /// Sets the value of [backup_id][crate::model::BackupContext::backup_id].
18768 ///
18769 /// # Example
18770 /// ```ignore,no_run
18771 /// # use google_cloud_sql_v1::model::BackupContext;
18772 /// let x = BackupContext::new().set_backup_id(42);
18773 /// ```
18774 pub fn set_backup_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
18775 self.backup_id = v.into();
18776 self
18777 }
18778
18779 /// Sets the value of [kind][crate::model::BackupContext::kind].
18780 ///
18781 /// # Example
18782 /// ```ignore,no_run
18783 /// # use google_cloud_sql_v1::model::BackupContext;
18784 /// let x = BackupContext::new().set_kind("example");
18785 /// ```
18786 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18787 self.kind = v.into();
18788 self
18789 }
18790
18791 /// Sets the value of [name][crate::model::BackupContext::name].
18792 ///
18793 /// # Example
18794 /// ```ignore,no_run
18795 /// # use google_cloud_sql_v1::model::BackupContext;
18796 /// let x = BackupContext::new().set_name("example");
18797 /// ```
18798 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18799 self.name = v.into();
18800 self
18801 }
18802}
18803
18804impl wkt::message::Message for BackupContext {
18805 fn typename() -> &'static str {
18806 "type.googleapis.com/google.cloud.sql.v1.BackupContext"
18807 }
18808}
18809
18810/// Represents a SQL database on the Cloud SQL instance.
18811#[derive(Clone, Default, PartialEq)]
18812#[non_exhaustive]
18813pub struct Database {
18814 /// This is always `sql#database`.
18815 pub kind: std::string::String,
18816
18817 /// The Cloud SQL charset value.
18818 pub charset: std::string::String,
18819
18820 /// The Cloud SQL collation value.
18821 pub collation: std::string::String,
18822
18823 /// This field is deprecated and will be removed from a future version of the
18824 /// API.
18825 pub etag: std::string::String,
18826
18827 /// The name of the database in the Cloud SQL instance. This does not include
18828 /// the project ID or instance name.
18829 pub name: std::string::String,
18830
18831 /// The name of the Cloud SQL instance. This does not include the project ID.
18832 pub instance: std::string::String,
18833
18834 /// The URI of this resource.
18835 pub self_link: std::string::String,
18836
18837 /// The project ID of the project containing the Cloud SQL database. The Google
18838 /// apps domain is prefixed if applicable.
18839 pub project: std::string::String,
18840
18841 pub database_details: std::option::Option<crate::model::database::DatabaseDetails>,
18842
18843 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18844}
18845
18846impl Database {
18847 pub fn new() -> Self {
18848 std::default::Default::default()
18849 }
18850
18851 /// Sets the value of [kind][crate::model::Database::kind].
18852 ///
18853 /// # Example
18854 /// ```ignore,no_run
18855 /// # use google_cloud_sql_v1::model::Database;
18856 /// let x = Database::new().set_kind("example");
18857 /// ```
18858 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18859 self.kind = v.into();
18860 self
18861 }
18862
18863 /// Sets the value of [charset][crate::model::Database::charset].
18864 ///
18865 /// # Example
18866 /// ```ignore,no_run
18867 /// # use google_cloud_sql_v1::model::Database;
18868 /// let x = Database::new().set_charset("example");
18869 /// ```
18870 pub fn set_charset<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18871 self.charset = v.into();
18872 self
18873 }
18874
18875 /// Sets the value of [collation][crate::model::Database::collation].
18876 ///
18877 /// # Example
18878 /// ```ignore,no_run
18879 /// # use google_cloud_sql_v1::model::Database;
18880 /// let x = Database::new().set_collation("example");
18881 /// ```
18882 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18883 self.collation = v.into();
18884 self
18885 }
18886
18887 /// Sets the value of [etag][crate::model::Database::etag].
18888 ///
18889 /// # Example
18890 /// ```ignore,no_run
18891 /// # use google_cloud_sql_v1::model::Database;
18892 /// let x = Database::new().set_etag("example");
18893 /// ```
18894 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18895 self.etag = v.into();
18896 self
18897 }
18898
18899 /// Sets the value of [name][crate::model::Database::name].
18900 ///
18901 /// # Example
18902 /// ```ignore,no_run
18903 /// # use google_cloud_sql_v1::model::Database;
18904 /// let x = Database::new().set_name("example");
18905 /// ```
18906 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18907 self.name = v.into();
18908 self
18909 }
18910
18911 /// Sets the value of [instance][crate::model::Database::instance].
18912 ///
18913 /// # Example
18914 /// ```ignore,no_run
18915 /// # use google_cloud_sql_v1::model::Database;
18916 /// let x = Database::new().set_instance("example");
18917 /// ```
18918 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18919 self.instance = v.into();
18920 self
18921 }
18922
18923 /// Sets the value of [self_link][crate::model::Database::self_link].
18924 ///
18925 /// # Example
18926 /// ```ignore,no_run
18927 /// # use google_cloud_sql_v1::model::Database;
18928 /// let x = Database::new().set_self_link("example");
18929 /// ```
18930 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18931 self.self_link = v.into();
18932 self
18933 }
18934
18935 /// Sets the value of [project][crate::model::Database::project].
18936 ///
18937 /// # Example
18938 /// ```ignore,no_run
18939 /// # use google_cloud_sql_v1::model::Database;
18940 /// let x = Database::new().set_project("example");
18941 /// ```
18942 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18943 self.project = v.into();
18944 self
18945 }
18946
18947 /// Sets the value of [database_details][crate::model::Database::database_details].
18948 ///
18949 /// Note that all the setters affecting `database_details` are mutually
18950 /// exclusive.
18951 ///
18952 /// # Example
18953 /// ```ignore,no_run
18954 /// # use google_cloud_sql_v1::model::Database;
18955 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18956 /// let x = Database::new().set_database_details(Some(
18957 /// google_cloud_sql_v1::model::database::DatabaseDetails::SqlserverDatabaseDetails(SqlServerDatabaseDetails::default().into())));
18958 /// ```
18959 pub fn set_database_details<
18960 T: std::convert::Into<std::option::Option<crate::model::database::DatabaseDetails>>,
18961 >(
18962 mut self,
18963 v: T,
18964 ) -> Self {
18965 self.database_details = v.into();
18966 self
18967 }
18968
18969 /// The value of [database_details][crate::model::Database::database_details]
18970 /// if it holds a `SqlserverDatabaseDetails`, `None` if the field is not set or
18971 /// holds a different branch.
18972 pub fn sqlserver_database_details(
18973 &self,
18974 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerDatabaseDetails>> {
18975 #[allow(unreachable_patterns)]
18976 self.database_details.as_ref().and_then(|v| match v {
18977 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v) => {
18978 std::option::Option::Some(v)
18979 }
18980 _ => std::option::Option::None,
18981 })
18982 }
18983
18984 /// Sets the value of [database_details][crate::model::Database::database_details]
18985 /// to hold a `SqlserverDatabaseDetails`.
18986 ///
18987 /// Note that all the setters affecting `database_details` are
18988 /// mutually exclusive.
18989 ///
18990 /// # Example
18991 /// ```ignore,no_run
18992 /// # use google_cloud_sql_v1::model::Database;
18993 /// use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
18994 /// let x = Database::new().set_sqlserver_database_details(SqlServerDatabaseDetails::default()/* use setters */);
18995 /// assert!(x.sqlserver_database_details().is_some());
18996 /// ```
18997 pub fn set_sqlserver_database_details<
18998 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerDatabaseDetails>>,
18999 >(
19000 mut self,
19001 v: T,
19002 ) -> Self {
19003 self.database_details = std::option::Option::Some(
19004 crate::model::database::DatabaseDetails::SqlserverDatabaseDetails(v.into()),
19005 );
19006 self
19007 }
19008}
19009
19010impl wkt::message::Message for Database {
19011 fn typename() -> &'static str {
19012 "type.googleapis.com/google.cloud.sql.v1.Database"
19013 }
19014}
19015
19016/// Defines additional types related to [Database].
19017pub mod database {
19018 #[allow(unused_imports)]
19019 use super::*;
19020
19021 #[derive(Clone, Debug, PartialEq)]
19022 #[non_exhaustive]
19023 pub enum DatabaseDetails {
19024 SqlserverDatabaseDetails(std::boxed::Box<crate::model::SqlServerDatabaseDetails>),
19025 }
19026}
19027
19028/// Represents a Sql Server database on the Cloud SQL instance.
19029#[derive(Clone, Default, PartialEq)]
19030#[non_exhaustive]
19031pub struct SqlServerDatabaseDetails {
19032 /// The version of SQL Server with which the database is to be made compatible
19033 pub compatibility_level: i32,
19034
19035 /// The recovery model of a SQL Server database
19036 pub recovery_model: std::string::String,
19037
19038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19039}
19040
19041impl SqlServerDatabaseDetails {
19042 pub fn new() -> Self {
19043 std::default::Default::default()
19044 }
19045
19046 /// Sets the value of [compatibility_level][crate::model::SqlServerDatabaseDetails::compatibility_level].
19047 ///
19048 /// # Example
19049 /// ```ignore,no_run
19050 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19051 /// let x = SqlServerDatabaseDetails::new().set_compatibility_level(42);
19052 /// ```
19053 pub fn set_compatibility_level<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
19054 self.compatibility_level = v.into();
19055 self
19056 }
19057
19058 /// Sets the value of [recovery_model][crate::model::SqlServerDatabaseDetails::recovery_model].
19059 ///
19060 /// # Example
19061 /// ```ignore,no_run
19062 /// # use google_cloud_sql_v1::model::SqlServerDatabaseDetails;
19063 /// let x = SqlServerDatabaseDetails::new().set_recovery_model("example");
19064 /// ```
19065 pub fn set_recovery_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19066 self.recovery_model = v.into();
19067 self
19068 }
19069}
19070
19071impl wkt::message::Message for SqlServerDatabaseDetails {
19072 fn typename() -> &'static str {
19073 "type.googleapis.com/google.cloud.sql.v1.SqlServerDatabaseDetails"
19074 }
19075}
19076
19077/// Database flags for Cloud SQL instances.
19078#[derive(Clone, Default, PartialEq)]
19079#[non_exhaustive]
19080pub struct DatabaseFlags {
19081 /// The name of the flag. These flags are passed at instance startup, so
19082 /// include both server options and system variables. Flags are
19083 /// specified with underscores, not hyphens. For more information, see
19084 /// [Configuring Database Flags](https://cloud.google.com/sql/docs/mysql/flags)
19085 /// in the Cloud SQL documentation.
19086 pub name: std::string::String,
19087
19088 /// The value of the flag. Boolean flags are set to `on` for true
19089 /// and `off` for false. This field must be omitted if the flag
19090 /// doesn't take a value.
19091 pub value: std::string::String,
19092
19093 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19094}
19095
19096impl DatabaseFlags {
19097 pub fn new() -> Self {
19098 std::default::Default::default()
19099 }
19100
19101 /// Sets the value of [name][crate::model::DatabaseFlags::name].
19102 ///
19103 /// # Example
19104 /// ```ignore,no_run
19105 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19106 /// let x = DatabaseFlags::new().set_name("example");
19107 /// ```
19108 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19109 self.name = v.into();
19110 self
19111 }
19112
19113 /// Sets the value of [value][crate::model::DatabaseFlags::value].
19114 ///
19115 /// # Example
19116 /// ```ignore,no_run
19117 /// # use google_cloud_sql_v1::model::DatabaseFlags;
19118 /// let x = DatabaseFlags::new().set_value("example");
19119 /// ```
19120 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19121 self.value = v.into();
19122 self
19123 }
19124}
19125
19126impl wkt::message::Message for DatabaseFlags {
19127 fn typename() -> &'static str {
19128 "type.googleapis.com/google.cloud.sql.v1.DatabaseFlags"
19129 }
19130}
19131
19132/// MySQL-specific external server sync settings.
19133#[derive(Clone, Default, PartialEq)]
19134#[non_exhaustive]
19135pub struct MySqlSyncConfig {
19136 /// Flags to use for the initial dump.
19137 pub initial_sync_flags: std::vec::Vec<crate::model::SyncFlags>,
19138
19139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19140}
19141
19142impl MySqlSyncConfig {
19143 pub fn new() -> Self {
19144 std::default::Default::default()
19145 }
19146
19147 /// Sets the value of [initial_sync_flags][crate::model::MySqlSyncConfig::initial_sync_flags].
19148 ///
19149 /// # Example
19150 /// ```ignore,no_run
19151 /// # use google_cloud_sql_v1::model::MySqlSyncConfig;
19152 /// use google_cloud_sql_v1::model::SyncFlags;
19153 /// let x = MySqlSyncConfig::new()
19154 /// .set_initial_sync_flags([
19155 /// SyncFlags::default()/* use setters */,
19156 /// SyncFlags::default()/* use (different) setters */,
19157 /// ]);
19158 /// ```
19159 pub fn set_initial_sync_flags<T, V>(mut self, v: T) -> Self
19160 where
19161 T: std::iter::IntoIterator<Item = V>,
19162 V: std::convert::Into<crate::model::SyncFlags>,
19163 {
19164 use std::iter::Iterator;
19165 self.initial_sync_flags = v.into_iter().map(|i| i.into()).collect();
19166 self
19167 }
19168}
19169
19170impl wkt::message::Message for MySqlSyncConfig {
19171 fn typename() -> &'static str {
19172 "type.googleapis.com/google.cloud.sql.v1.MySqlSyncConfig"
19173 }
19174}
19175
19176/// Initial sync flags for certain Cloud SQL APIs.
19177/// Currently used for the MySQL external server initial dump.
19178#[derive(Clone, Default, PartialEq)]
19179#[non_exhaustive]
19180pub struct SyncFlags {
19181 /// The name of the flag.
19182 pub name: std::string::String,
19183
19184 /// The value of the flag. This field must be omitted if the flag
19185 /// doesn't take a value.
19186 pub value: std::string::String,
19187
19188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19189}
19190
19191impl SyncFlags {
19192 pub fn new() -> Self {
19193 std::default::Default::default()
19194 }
19195
19196 /// Sets the value of [name][crate::model::SyncFlags::name].
19197 ///
19198 /// # Example
19199 /// ```ignore,no_run
19200 /// # use google_cloud_sql_v1::model::SyncFlags;
19201 /// let x = SyncFlags::new().set_name("example");
19202 /// ```
19203 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19204 self.name = v.into();
19205 self
19206 }
19207
19208 /// Sets the value of [value][crate::model::SyncFlags::value].
19209 ///
19210 /// # Example
19211 /// ```ignore,no_run
19212 /// # use google_cloud_sql_v1::model::SyncFlags;
19213 /// let x = SyncFlags::new().set_value("example");
19214 /// ```
19215 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19216 self.value = v.into();
19217 self
19218 }
19219}
19220
19221impl wkt::message::Message for SyncFlags {
19222 fn typename() -> &'static str {
19223 "type.googleapis.com/google.cloud.sql.v1.SyncFlags"
19224 }
19225}
19226
19227/// Reference to another Cloud SQL instance.
19228#[derive(Clone, Default, PartialEq)]
19229#[non_exhaustive]
19230pub struct InstanceReference {
19231 /// The name of the Cloud SQL instance being referenced.
19232 /// This does not include the project ID.
19233 pub name: std::string::String,
19234
19235 /// The region of the Cloud SQL instance being referenced.
19236 pub region: std::string::String,
19237
19238 /// The project ID of the Cloud SQL instance being referenced.
19239 /// The default is the same project ID as the instance references it.
19240 pub project: std::string::String,
19241
19242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19243}
19244
19245impl InstanceReference {
19246 pub fn new() -> Self {
19247 std::default::Default::default()
19248 }
19249
19250 /// Sets the value of [name][crate::model::InstanceReference::name].
19251 ///
19252 /// # Example
19253 /// ```ignore,no_run
19254 /// # use google_cloud_sql_v1::model::InstanceReference;
19255 /// let x = InstanceReference::new().set_name("example");
19256 /// ```
19257 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19258 self.name = v.into();
19259 self
19260 }
19261
19262 /// Sets the value of [region][crate::model::InstanceReference::region].
19263 ///
19264 /// # Example
19265 /// ```ignore,no_run
19266 /// # use google_cloud_sql_v1::model::InstanceReference;
19267 /// let x = InstanceReference::new().set_region("example");
19268 /// ```
19269 pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19270 self.region = v.into();
19271 self
19272 }
19273
19274 /// Sets the value of [project][crate::model::InstanceReference::project].
19275 ///
19276 /// # Example
19277 /// ```ignore,no_run
19278 /// # use google_cloud_sql_v1::model::InstanceReference;
19279 /// let x = InstanceReference::new().set_project("example");
19280 /// ```
19281 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19282 self.project = v.into();
19283 self
19284 }
19285}
19286
19287impl wkt::message::Message for InstanceReference {
19288 fn typename() -> &'static str {
19289 "type.googleapis.com/google.cloud.sql.v1.InstanceReference"
19290 }
19291}
19292
19293/// Read-replica configuration for connecting to the on-premises primary
19294/// instance.
19295#[derive(Clone, Default, PartialEq)]
19296#[non_exhaustive]
19297pub struct DemoteMasterConfiguration {
19298 /// This is always `sql#demoteMasterConfiguration`.
19299 pub kind: std::string::String,
19300
19301 /// MySQL specific configuration when replicating from a MySQL on-premises
19302 /// primary instance. Replication configuration information such as the
19303 /// username, password, certificates, and keys are not stored in the instance
19304 /// metadata. The configuration information is used only to set up the
19305 /// replication connection and is stored by MySQL in a file named
19306 /// `master.info` in the data directory.
19307 pub mysql_replica_configuration:
19308 std::option::Option<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19309
19310 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19311}
19312
19313impl DemoteMasterConfiguration {
19314 pub fn new() -> Self {
19315 std::default::Default::default()
19316 }
19317
19318 /// Sets the value of [kind][crate::model::DemoteMasterConfiguration::kind].
19319 ///
19320 /// # Example
19321 /// ```ignore,no_run
19322 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19323 /// let x = DemoteMasterConfiguration::new().set_kind("example");
19324 /// ```
19325 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19326 self.kind = v.into();
19327 self
19328 }
19329
19330 /// Sets the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19331 ///
19332 /// # Example
19333 /// ```ignore,no_run
19334 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19335 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19336 /// let x = DemoteMasterConfiguration::new().set_mysql_replica_configuration(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */);
19337 /// ```
19338 pub fn set_mysql_replica_configuration<T>(mut self, v: T) -> Self
19339 where
19340 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19341 {
19342 self.mysql_replica_configuration = std::option::Option::Some(v.into());
19343 self
19344 }
19345
19346 /// Sets or clears the value of [mysql_replica_configuration][crate::model::DemoteMasterConfiguration::mysql_replica_configuration].
19347 ///
19348 /// # Example
19349 /// ```ignore,no_run
19350 /// # use google_cloud_sql_v1::model::DemoteMasterConfiguration;
19351 /// use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19352 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(Some(DemoteMasterMySqlReplicaConfiguration::default()/* use setters */));
19353 /// let x = DemoteMasterConfiguration::new().set_or_clear_mysql_replica_configuration(None::<DemoteMasterMySqlReplicaConfiguration>);
19354 /// ```
19355 pub fn set_or_clear_mysql_replica_configuration<T>(mut self, v: std::option::Option<T>) -> Self
19356 where
19357 T: std::convert::Into<crate::model::DemoteMasterMySqlReplicaConfiguration>,
19358 {
19359 self.mysql_replica_configuration = v.map(|x| x.into());
19360 self
19361 }
19362}
19363
19364impl wkt::message::Message for DemoteMasterConfiguration {
19365 fn typename() -> &'static str {
19366 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterConfiguration"
19367 }
19368}
19369
19370/// Read-replica configuration specific to MySQL databases.
19371#[derive(Clone, Default, PartialEq)]
19372#[non_exhaustive]
19373pub struct DemoteMasterMySqlReplicaConfiguration {
19374 /// This is always `sql#demoteMasterMysqlReplicaConfiguration`.
19375 pub kind: std::string::String,
19376
19377 /// The username for the replication connection.
19378 pub username: std::string::String,
19379
19380 /// The password for the replication connection.
19381 pub password: std::string::String,
19382
19383 /// PEM representation of the replica's private key. The corresponding public
19384 /// key is encoded in the client's certificate. The format of the replica's
19385 /// private key can be either PKCS #1 or PKCS #8.
19386 pub client_key: std::string::String,
19387
19388 /// PEM representation of the replica's x509 certificate.
19389 pub client_certificate: std::string::String,
19390
19391 /// PEM representation of the trusted CA's x509 certificate.
19392 pub ca_certificate: std::string::String,
19393
19394 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19395}
19396
19397impl DemoteMasterMySqlReplicaConfiguration {
19398 pub fn new() -> Self {
19399 std::default::Default::default()
19400 }
19401
19402 /// Sets the value of [kind][crate::model::DemoteMasterMySqlReplicaConfiguration::kind].
19403 ///
19404 /// # Example
19405 /// ```ignore,no_run
19406 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19407 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_kind("example");
19408 /// ```
19409 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19410 self.kind = v.into();
19411 self
19412 }
19413
19414 /// Sets the value of [username][crate::model::DemoteMasterMySqlReplicaConfiguration::username].
19415 ///
19416 /// # Example
19417 /// ```ignore,no_run
19418 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19419 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_username("example");
19420 /// ```
19421 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19422 self.username = v.into();
19423 self
19424 }
19425
19426 /// Sets the value of [password][crate::model::DemoteMasterMySqlReplicaConfiguration::password].
19427 ///
19428 /// # Example
19429 /// ```ignore,no_run
19430 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19431 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_password("example");
19432 /// ```
19433 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19434 self.password = v.into();
19435 self
19436 }
19437
19438 /// Sets the value of [client_key][crate::model::DemoteMasterMySqlReplicaConfiguration::client_key].
19439 ///
19440 /// # Example
19441 /// ```ignore,no_run
19442 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19443 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_key("example");
19444 /// ```
19445 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19446 self.client_key = v.into();
19447 self
19448 }
19449
19450 /// Sets the value of [client_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::client_certificate].
19451 ///
19452 /// # Example
19453 /// ```ignore,no_run
19454 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19455 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_client_certificate("example");
19456 /// ```
19457 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
19458 mut self,
19459 v: T,
19460 ) -> Self {
19461 self.client_certificate = v.into();
19462 self
19463 }
19464
19465 /// Sets the value of [ca_certificate][crate::model::DemoteMasterMySqlReplicaConfiguration::ca_certificate].
19466 ///
19467 /// # Example
19468 /// ```ignore,no_run
19469 /// # use google_cloud_sql_v1::model::DemoteMasterMySqlReplicaConfiguration;
19470 /// let x = DemoteMasterMySqlReplicaConfiguration::new().set_ca_certificate("example");
19471 /// ```
19472 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19473 self.ca_certificate = v.into();
19474 self
19475 }
19476}
19477
19478impl wkt::message::Message for DemoteMasterMySqlReplicaConfiguration {
19479 fn typename() -> &'static str {
19480 "type.googleapis.com/google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration"
19481 }
19482}
19483
19484/// Database instance export context.
19485#[derive(Clone, Default, PartialEq)]
19486#[non_exhaustive]
19487pub struct ExportContext {
19488 /// The path to the file in Google Cloud Storage where the export will be
19489 /// stored. The URI is in the form `gs://bucketName/fileName`. If the file
19490 /// already exists, the request succeeds, but the operation fails. If
19491 /// `fileType` is `SQL` and the filename ends with .gz,
19492 /// the contents are compressed.
19493 pub uri: std::string::String,
19494
19495 /// Databases to be exported. <br /> `MySQL instances:` If
19496 /// `fileType` is `SQL` and no database is specified, all
19497 /// databases are exported, except for the `mysql` system database.
19498 /// If `fileType` is `CSV`, you can specify one database,
19499 /// either by using this property or by using the
19500 /// `csvExportOptions.selectQuery` property, which takes precedence
19501 /// over this property. <br /> `PostgreSQL instances:` If you don't specify a
19502 /// database by name, all user databases in the instance are exported.
19503 /// This excludes system databases and Cloud SQL databases used to manage
19504 /// internal operations. Exporting all user databases is only available for
19505 /// directory-formatted parallel export. If `fileType` is `CSV`,
19506 /// this database must match the one specified in the
19507 /// `csvExportOptions.selectQuery` property. <br /> `SQL Server
19508 /// instances:` You must specify one database to be exported, and the
19509 /// `fileType` must be `BAK`.
19510 pub databases: std::vec::Vec<std::string::String>,
19511
19512 /// This is always `sql#exportContext`.
19513 pub kind: std::string::String,
19514
19515 /// Options for exporting data as SQL statements.
19516 pub sql_export_options: std::option::Option<crate::model::export_context::SqlExportOptions>,
19517
19518 /// Options for exporting data as CSV. `MySQL` and `PostgreSQL`
19519 /// instances only.
19520 pub csv_export_options: std::option::Option<crate::model::export_context::SqlCsvExportOptions>,
19521
19522 /// The file type for the specified uri.
19523 pub file_type: crate::model::SqlFileType,
19524
19525 /// Whether to perform a serverless export.
19526 pub offload: std::option::Option<wkt::BoolValue>,
19527
19528 /// Options for exporting data as BAK files.
19529 pub bak_export_options: std::option::Option<crate::model::export_context::SqlBakExportOptions>,
19530
19531 /// Optional. Export parameters specific to SQL Server TDE certificates
19532 pub tde_export_options: std::option::Option<crate::model::export_context::SqlTdeExportOptions>,
19533
19534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19535}
19536
19537impl ExportContext {
19538 pub fn new() -> Self {
19539 std::default::Default::default()
19540 }
19541
19542 /// Sets the value of [uri][crate::model::ExportContext::uri].
19543 ///
19544 /// # Example
19545 /// ```ignore,no_run
19546 /// # use google_cloud_sql_v1::model::ExportContext;
19547 /// let x = ExportContext::new().set_uri("example");
19548 /// ```
19549 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19550 self.uri = v.into();
19551 self
19552 }
19553
19554 /// Sets the value of [databases][crate::model::ExportContext::databases].
19555 ///
19556 /// # Example
19557 /// ```ignore,no_run
19558 /// # use google_cloud_sql_v1::model::ExportContext;
19559 /// let x = ExportContext::new().set_databases(["a", "b", "c"]);
19560 /// ```
19561 pub fn set_databases<T, V>(mut self, v: T) -> Self
19562 where
19563 T: std::iter::IntoIterator<Item = V>,
19564 V: std::convert::Into<std::string::String>,
19565 {
19566 use std::iter::Iterator;
19567 self.databases = v.into_iter().map(|i| i.into()).collect();
19568 self
19569 }
19570
19571 /// Sets the value of [kind][crate::model::ExportContext::kind].
19572 ///
19573 /// # Example
19574 /// ```ignore,no_run
19575 /// # use google_cloud_sql_v1::model::ExportContext;
19576 /// let x = ExportContext::new().set_kind("example");
19577 /// ```
19578 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
19579 self.kind = v.into();
19580 self
19581 }
19582
19583 /// Sets the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19584 ///
19585 /// # Example
19586 /// ```ignore,no_run
19587 /// # use google_cloud_sql_v1::model::ExportContext;
19588 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19589 /// let x = ExportContext::new().set_sql_export_options(SqlExportOptions::default()/* use setters */);
19590 /// ```
19591 pub fn set_sql_export_options<T>(mut self, v: T) -> Self
19592 where
19593 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19594 {
19595 self.sql_export_options = std::option::Option::Some(v.into());
19596 self
19597 }
19598
19599 /// Sets or clears the value of [sql_export_options][crate::model::ExportContext::sql_export_options].
19600 ///
19601 /// # Example
19602 /// ```ignore,no_run
19603 /// # use google_cloud_sql_v1::model::ExportContext;
19604 /// use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19605 /// let x = ExportContext::new().set_or_clear_sql_export_options(Some(SqlExportOptions::default()/* use setters */));
19606 /// let x = ExportContext::new().set_or_clear_sql_export_options(None::<SqlExportOptions>);
19607 /// ```
19608 pub fn set_or_clear_sql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19609 where
19610 T: std::convert::Into<crate::model::export_context::SqlExportOptions>,
19611 {
19612 self.sql_export_options = v.map(|x| x.into());
19613 self
19614 }
19615
19616 /// Sets the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19617 ///
19618 /// # Example
19619 /// ```ignore,no_run
19620 /// # use google_cloud_sql_v1::model::ExportContext;
19621 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19622 /// let x = ExportContext::new().set_csv_export_options(SqlCsvExportOptions::default()/* use setters */);
19623 /// ```
19624 pub fn set_csv_export_options<T>(mut self, v: T) -> Self
19625 where
19626 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19627 {
19628 self.csv_export_options = std::option::Option::Some(v.into());
19629 self
19630 }
19631
19632 /// Sets or clears the value of [csv_export_options][crate::model::ExportContext::csv_export_options].
19633 ///
19634 /// # Example
19635 /// ```ignore,no_run
19636 /// # use google_cloud_sql_v1::model::ExportContext;
19637 /// use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19638 /// let x = ExportContext::new().set_or_clear_csv_export_options(Some(SqlCsvExportOptions::default()/* use setters */));
19639 /// let x = ExportContext::new().set_or_clear_csv_export_options(None::<SqlCsvExportOptions>);
19640 /// ```
19641 pub fn set_or_clear_csv_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19642 where
19643 T: std::convert::Into<crate::model::export_context::SqlCsvExportOptions>,
19644 {
19645 self.csv_export_options = v.map(|x| x.into());
19646 self
19647 }
19648
19649 /// Sets the value of [file_type][crate::model::ExportContext::file_type].
19650 ///
19651 /// # Example
19652 /// ```ignore,no_run
19653 /// # use google_cloud_sql_v1::model::ExportContext;
19654 /// use google_cloud_sql_v1::model::SqlFileType;
19655 /// let x0 = ExportContext::new().set_file_type(SqlFileType::Sql);
19656 /// let x1 = ExportContext::new().set_file_type(SqlFileType::Csv);
19657 /// let x2 = ExportContext::new().set_file_type(SqlFileType::Bak);
19658 /// ```
19659 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
19660 self.file_type = v.into();
19661 self
19662 }
19663
19664 /// Sets the value of [offload][crate::model::ExportContext::offload].
19665 ///
19666 /// # Example
19667 /// ```ignore,no_run
19668 /// # use google_cloud_sql_v1::model::ExportContext;
19669 /// use wkt::BoolValue;
19670 /// let x = ExportContext::new().set_offload(BoolValue::default()/* use setters */);
19671 /// ```
19672 pub fn set_offload<T>(mut self, v: T) -> Self
19673 where
19674 T: std::convert::Into<wkt::BoolValue>,
19675 {
19676 self.offload = std::option::Option::Some(v.into());
19677 self
19678 }
19679
19680 /// Sets or clears the value of [offload][crate::model::ExportContext::offload].
19681 ///
19682 /// # Example
19683 /// ```ignore,no_run
19684 /// # use google_cloud_sql_v1::model::ExportContext;
19685 /// use wkt::BoolValue;
19686 /// let x = ExportContext::new().set_or_clear_offload(Some(BoolValue::default()/* use setters */));
19687 /// let x = ExportContext::new().set_or_clear_offload(None::<BoolValue>);
19688 /// ```
19689 pub fn set_or_clear_offload<T>(mut self, v: std::option::Option<T>) -> Self
19690 where
19691 T: std::convert::Into<wkt::BoolValue>,
19692 {
19693 self.offload = v.map(|x| x.into());
19694 self
19695 }
19696
19697 /// Sets the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19698 ///
19699 /// # Example
19700 /// ```ignore,no_run
19701 /// # use google_cloud_sql_v1::model::ExportContext;
19702 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19703 /// let x = ExportContext::new().set_bak_export_options(SqlBakExportOptions::default()/* use setters */);
19704 /// ```
19705 pub fn set_bak_export_options<T>(mut self, v: T) -> Self
19706 where
19707 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19708 {
19709 self.bak_export_options = std::option::Option::Some(v.into());
19710 self
19711 }
19712
19713 /// Sets or clears the value of [bak_export_options][crate::model::ExportContext::bak_export_options].
19714 ///
19715 /// # Example
19716 /// ```ignore,no_run
19717 /// # use google_cloud_sql_v1::model::ExportContext;
19718 /// use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
19719 /// let x = ExportContext::new().set_or_clear_bak_export_options(Some(SqlBakExportOptions::default()/* use setters */));
19720 /// let x = ExportContext::new().set_or_clear_bak_export_options(None::<SqlBakExportOptions>);
19721 /// ```
19722 pub fn set_or_clear_bak_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19723 where
19724 T: std::convert::Into<crate::model::export_context::SqlBakExportOptions>,
19725 {
19726 self.bak_export_options = v.map(|x| x.into());
19727 self
19728 }
19729
19730 /// Sets the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19731 ///
19732 /// # Example
19733 /// ```ignore,no_run
19734 /// # use google_cloud_sql_v1::model::ExportContext;
19735 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19736 /// let x = ExportContext::new().set_tde_export_options(SqlTdeExportOptions::default()/* use setters */);
19737 /// ```
19738 pub fn set_tde_export_options<T>(mut self, v: T) -> Self
19739 where
19740 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19741 {
19742 self.tde_export_options = std::option::Option::Some(v.into());
19743 self
19744 }
19745
19746 /// Sets or clears the value of [tde_export_options][crate::model::ExportContext::tde_export_options].
19747 ///
19748 /// # Example
19749 /// ```ignore,no_run
19750 /// # use google_cloud_sql_v1::model::ExportContext;
19751 /// use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
19752 /// let x = ExportContext::new().set_or_clear_tde_export_options(Some(SqlTdeExportOptions::default()/* use setters */));
19753 /// let x = ExportContext::new().set_or_clear_tde_export_options(None::<SqlTdeExportOptions>);
19754 /// ```
19755 pub fn set_or_clear_tde_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19756 where
19757 T: std::convert::Into<crate::model::export_context::SqlTdeExportOptions>,
19758 {
19759 self.tde_export_options = v.map(|x| x.into());
19760 self
19761 }
19762}
19763
19764impl wkt::message::Message for ExportContext {
19765 fn typename() -> &'static str {
19766 "type.googleapis.com/google.cloud.sql.v1.ExportContext"
19767 }
19768}
19769
19770/// Defines additional types related to [ExportContext].
19771pub mod export_context {
19772 #[allow(unused_imports)]
19773 use super::*;
19774
19775 #[derive(Clone, Default, PartialEq)]
19776 #[non_exhaustive]
19777 pub struct SqlCsvExportOptions {
19778 /// The select query used to extract the data.
19779 pub select_query: std::string::String,
19780
19781 /// Specifies the character that should appear before a data character that
19782 /// needs to be escaped.
19783 pub escape_character: std::string::String,
19784
19785 /// Specifies the quoting character to be used when a data value is quoted.
19786 pub quote_character: std::string::String,
19787
19788 /// Specifies the character that separates columns within each row (line) of
19789 /// the file.
19790 pub fields_terminated_by: std::string::String,
19791
19792 /// This is used to separate lines. If a line does not contain all fields,
19793 /// the rest of the columns are set to their default values.
19794 pub lines_terminated_by: std::string::String,
19795
19796 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19797 }
19798
19799 impl SqlCsvExportOptions {
19800 pub fn new() -> Self {
19801 std::default::Default::default()
19802 }
19803
19804 /// Sets the value of [select_query][crate::model::export_context::SqlCsvExportOptions::select_query].
19805 ///
19806 /// # Example
19807 /// ```ignore,no_run
19808 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19809 /// let x = SqlCsvExportOptions::new().set_select_query("example");
19810 /// ```
19811 pub fn set_select_query<T: std::convert::Into<std::string::String>>(
19812 mut self,
19813 v: T,
19814 ) -> Self {
19815 self.select_query = v.into();
19816 self
19817 }
19818
19819 /// Sets the value of [escape_character][crate::model::export_context::SqlCsvExportOptions::escape_character].
19820 ///
19821 /// # Example
19822 /// ```ignore,no_run
19823 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19824 /// let x = SqlCsvExportOptions::new().set_escape_character("example");
19825 /// ```
19826 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
19827 mut self,
19828 v: T,
19829 ) -> Self {
19830 self.escape_character = v.into();
19831 self
19832 }
19833
19834 /// Sets the value of [quote_character][crate::model::export_context::SqlCsvExportOptions::quote_character].
19835 ///
19836 /// # Example
19837 /// ```ignore,no_run
19838 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19839 /// let x = SqlCsvExportOptions::new().set_quote_character("example");
19840 /// ```
19841 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
19842 mut self,
19843 v: T,
19844 ) -> Self {
19845 self.quote_character = v.into();
19846 self
19847 }
19848
19849 /// Sets the value of [fields_terminated_by][crate::model::export_context::SqlCsvExportOptions::fields_terminated_by].
19850 ///
19851 /// # Example
19852 /// ```ignore,no_run
19853 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19854 /// let x = SqlCsvExportOptions::new().set_fields_terminated_by("example");
19855 /// ```
19856 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
19857 mut self,
19858 v: T,
19859 ) -> Self {
19860 self.fields_terminated_by = v.into();
19861 self
19862 }
19863
19864 /// Sets the value of [lines_terminated_by][crate::model::export_context::SqlCsvExportOptions::lines_terminated_by].
19865 ///
19866 /// # Example
19867 /// ```ignore,no_run
19868 /// # use google_cloud_sql_v1::model::export_context::SqlCsvExportOptions;
19869 /// let x = SqlCsvExportOptions::new().set_lines_terminated_by("example");
19870 /// ```
19871 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
19872 mut self,
19873 v: T,
19874 ) -> Self {
19875 self.lines_terminated_by = v.into();
19876 self
19877 }
19878 }
19879
19880 impl wkt::message::Message for SqlCsvExportOptions {
19881 fn typename() -> &'static str {
19882 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlCsvExportOptions"
19883 }
19884 }
19885
19886 #[derive(Clone, Default, PartialEq)]
19887 #[non_exhaustive]
19888 pub struct SqlExportOptions {
19889 /// Tables to export, or that were exported, from the specified database. If
19890 /// you specify tables, specify one and only one database. For PostgreSQL
19891 /// instances, you can specify only one table.
19892 pub tables: std::vec::Vec<std::string::String>,
19893
19894 /// Export only schemas.
19895 pub schema_only: std::option::Option<wkt::BoolValue>,
19896
19897 pub mysql_export_options: std::option::Option<
19898 crate::model::export_context::sql_export_options::MysqlExportOptions,
19899 >,
19900
19901 /// Optional. The number of threads to use for parallel export.
19902 pub threads: std::option::Option<wkt::Int32Value>,
19903
19904 /// Optional. Whether or not the export should be parallel.
19905 pub parallel: std::option::Option<wkt::BoolValue>,
19906
19907 /// Optional. Options for exporting from a Cloud SQL for PostgreSQL instance.
19908 pub postgres_export_options: std::option::Option<
19909 crate::model::export_context::sql_export_options::PostgresExportOptions,
19910 >,
19911
19912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
19913 }
19914
19915 impl SqlExportOptions {
19916 pub fn new() -> Self {
19917 std::default::Default::default()
19918 }
19919
19920 /// Sets the value of [tables][crate::model::export_context::SqlExportOptions::tables].
19921 ///
19922 /// # Example
19923 /// ```ignore,no_run
19924 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19925 /// let x = SqlExportOptions::new().set_tables(["a", "b", "c"]);
19926 /// ```
19927 pub fn set_tables<T, V>(mut self, v: T) -> Self
19928 where
19929 T: std::iter::IntoIterator<Item = V>,
19930 V: std::convert::Into<std::string::String>,
19931 {
19932 use std::iter::Iterator;
19933 self.tables = v.into_iter().map(|i| i.into()).collect();
19934 self
19935 }
19936
19937 /// Sets the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
19938 ///
19939 /// # Example
19940 /// ```ignore,no_run
19941 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19942 /// use wkt::BoolValue;
19943 /// let x = SqlExportOptions::new().set_schema_only(BoolValue::default()/* use setters */);
19944 /// ```
19945 pub fn set_schema_only<T>(mut self, v: T) -> Self
19946 where
19947 T: std::convert::Into<wkt::BoolValue>,
19948 {
19949 self.schema_only = std::option::Option::Some(v.into());
19950 self
19951 }
19952
19953 /// Sets or clears the value of [schema_only][crate::model::export_context::SqlExportOptions::schema_only].
19954 ///
19955 /// # Example
19956 /// ```ignore,no_run
19957 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19958 /// use wkt::BoolValue;
19959 /// let x = SqlExportOptions::new().set_or_clear_schema_only(Some(BoolValue::default()/* use setters */));
19960 /// let x = SqlExportOptions::new().set_or_clear_schema_only(None::<BoolValue>);
19961 /// ```
19962 pub fn set_or_clear_schema_only<T>(mut self, v: std::option::Option<T>) -> Self
19963 where
19964 T: std::convert::Into<wkt::BoolValue>,
19965 {
19966 self.schema_only = v.map(|x| x.into());
19967 self
19968 }
19969
19970 /// Sets the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
19971 ///
19972 /// # Example
19973 /// ```ignore,no_run
19974 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19975 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
19976 /// let x = SqlExportOptions::new().set_mysql_export_options(MysqlExportOptions::default()/* use setters */);
19977 /// ```
19978 pub fn set_mysql_export_options<T>(mut self, v: T) -> Self
19979 where
19980 T: std::convert::Into<
19981 crate::model::export_context::sql_export_options::MysqlExportOptions,
19982 >,
19983 {
19984 self.mysql_export_options = std::option::Option::Some(v.into());
19985 self
19986 }
19987
19988 /// Sets or clears the value of [mysql_export_options][crate::model::export_context::SqlExportOptions::mysql_export_options].
19989 ///
19990 /// # Example
19991 /// ```ignore,no_run
19992 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
19993 /// use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
19994 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(Some(MysqlExportOptions::default()/* use setters */));
19995 /// let x = SqlExportOptions::new().set_or_clear_mysql_export_options(None::<MysqlExportOptions>);
19996 /// ```
19997 pub fn set_or_clear_mysql_export_options<T>(mut self, v: std::option::Option<T>) -> Self
19998 where
19999 T: std::convert::Into<
20000 crate::model::export_context::sql_export_options::MysqlExportOptions,
20001 >,
20002 {
20003 self.mysql_export_options = v.map(|x| x.into());
20004 self
20005 }
20006
20007 /// Sets the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20008 ///
20009 /// # Example
20010 /// ```ignore,no_run
20011 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20012 /// use wkt::Int32Value;
20013 /// let x = SqlExportOptions::new().set_threads(Int32Value::default()/* use setters */);
20014 /// ```
20015 pub fn set_threads<T>(mut self, v: T) -> Self
20016 where
20017 T: std::convert::Into<wkt::Int32Value>,
20018 {
20019 self.threads = std::option::Option::Some(v.into());
20020 self
20021 }
20022
20023 /// Sets or clears the value of [threads][crate::model::export_context::SqlExportOptions::threads].
20024 ///
20025 /// # Example
20026 /// ```ignore,no_run
20027 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20028 /// use wkt::Int32Value;
20029 /// let x = SqlExportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20030 /// let x = SqlExportOptions::new().set_or_clear_threads(None::<Int32Value>);
20031 /// ```
20032 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20033 where
20034 T: std::convert::Into<wkt::Int32Value>,
20035 {
20036 self.threads = v.map(|x| x.into());
20037 self
20038 }
20039
20040 /// Sets the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20041 ///
20042 /// # Example
20043 /// ```ignore,no_run
20044 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20045 /// use wkt::BoolValue;
20046 /// let x = SqlExportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20047 /// ```
20048 pub fn set_parallel<T>(mut self, v: T) -> Self
20049 where
20050 T: std::convert::Into<wkt::BoolValue>,
20051 {
20052 self.parallel = std::option::Option::Some(v.into());
20053 self
20054 }
20055
20056 /// Sets or clears the value of [parallel][crate::model::export_context::SqlExportOptions::parallel].
20057 ///
20058 /// # Example
20059 /// ```ignore,no_run
20060 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20061 /// use wkt::BoolValue;
20062 /// let x = SqlExportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20063 /// let x = SqlExportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20064 /// ```
20065 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20066 where
20067 T: std::convert::Into<wkt::BoolValue>,
20068 {
20069 self.parallel = v.map(|x| x.into());
20070 self
20071 }
20072
20073 /// Sets the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20074 ///
20075 /// # Example
20076 /// ```ignore,no_run
20077 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20078 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20079 /// let x = SqlExportOptions::new().set_postgres_export_options(PostgresExportOptions::default()/* use setters */);
20080 /// ```
20081 pub fn set_postgres_export_options<T>(mut self, v: T) -> Self
20082 where
20083 T: std::convert::Into<
20084 crate::model::export_context::sql_export_options::PostgresExportOptions,
20085 >,
20086 {
20087 self.postgres_export_options = std::option::Option::Some(v.into());
20088 self
20089 }
20090
20091 /// Sets or clears the value of [postgres_export_options][crate::model::export_context::SqlExportOptions::postgres_export_options].
20092 ///
20093 /// # Example
20094 /// ```ignore,no_run
20095 /// # use google_cloud_sql_v1::model::export_context::SqlExportOptions;
20096 /// use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20097 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(Some(PostgresExportOptions::default()/* use setters */));
20098 /// let x = SqlExportOptions::new().set_or_clear_postgres_export_options(None::<PostgresExportOptions>);
20099 /// ```
20100 pub fn set_or_clear_postgres_export_options<T>(mut self, v: std::option::Option<T>) -> Self
20101 where
20102 T: std::convert::Into<
20103 crate::model::export_context::sql_export_options::PostgresExportOptions,
20104 >,
20105 {
20106 self.postgres_export_options = v.map(|x| x.into());
20107 self
20108 }
20109 }
20110
20111 impl wkt::message::Message for SqlExportOptions {
20112 fn typename() -> &'static str {
20113 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions"
20114 }
20115 }
20116
20117 /// Defines additional types related to [SqlExportOptions].
20118 pub mod sql_export_options {
20119 #[allow(unused_imports)]
20120 use super::*;
20121
20122 /// Options for exporting from MySQL.
20123 #[derive(Clone, Default, PartialEq)]
20124 #[non_exhaustive]
20125 pub struct MysqlExportOptions {
20126 /// Option to include SQL statement required to set up replication. If set
20127 /// to `1`, the dump file includes a CHANGE MASTER TO statement with the
20128 /// binary log coordinates, and --set-gtid-purged is set to ON. If set to
20129 /// `2`, the CHANGE MASTER TO statement is written as a SQL comment and
20130 /// has no effect. If set to any value other than `1`, --set-gtid-purged
20131 /// is set to OFF.
20132 pub master_data: std::option::Option<wkt::Int32Value>,
20133
20134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20135 }
20136
20137 impl MysqlExportOptions {
20138 pub fn new() -> Self {
20139 std::default::Default::default()
20140 }
20141
20142 /// Sets the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20143 ///
20144 /// # Example
20145 /// ```ignore,no_run
20146 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20147 /// use wkt::Int32Value;
20148 /// let x = MysqlExportOptions::new().set_master_data(Int32Value::default()/* use setters */);
20149 /// ```
20150 pub fn set_master_data<T>(mut self, v: T) -> Self
20151 where
20152 T: std::convert::Into<wkt::Int32Value>,
20153 {
20154 self.master_data = std::option::Option::Some(v.into());
20155 self
20156 }
20157
20158 /// Sets or clears the value of [master_data][crate::model::export_context::sql_export_options::MysqlExportOptions::master_data].
20159 ///
20160 /// # Example
20161 /// ```ignore,no_run
20162 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::MysqlExportOptions;
20163 /// use wkt::Int32Value;
20164 /// let x = MysqlExportOptions::new().set_or_clear_master_data(Some(Int32Value::default()/* use setters */));
20165 /// let x = MysqlExportOptions::new().set_or_clear_master_data(None::<Int32Value>);
20166 /// ```
20167 pub fn set_or_clear_master_data<T>(mut self, v: std::option::Option<T>) -> Self
20168 where
20169 T: std::convert::Into<wkt::Int32Value>,
20170 {
20171 self.master_data = v.map(|x| x.into());
20172 self
20173 }
20174 }
20175
20176 impl wkt::message::Message for MysqlExportOptions {
20177 fn typename() -> &'static str {
20178 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions"
20179 }
20180 }
20181
20182 /// Options for exporting from a Cloud SQL for PostgreSQL instance.
20183 #[derive(Clone, Default, PartialEq)]
20184 #[non_exhaustive]
20185 pub struct PostgresExportOptions {
20186 /// Optional. Use this option to include DROP \<code\><object>\</code\>
20187 /// SQL statements. Use these statements to delete database objects before
20188 /// running the import operation.
20189 pub clean: std::option::Option<wkt::BoolValue>,
20190
20191 /// Optional. Option to include an IF EXISTS SQL statement with each DROP
20192 /// statement produced by clean.
20193 pub if_exists: std::option::Option<wkt::BoolValue>,
20194
20195 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20196 }
20197
20198 impl PostgresExportOptions {
20199 pub fn new() -> Self {
20200 std::default::Default::default()
20201 }
20202
20203 /// Sets the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20204 ///
20205 /// # Example
20206 /// ```ignore,no_run
20207 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20208 /// use wkt::BoolValue;
20209 /// let x = PostgresExportOptions::new().set_clean(BoolValue::default()/* use setters */);
20210 /// ```
20211 pub fn set_clean<T>(mut self, v: T) -> Self
20212 where
20213 T: std::convert::Into<wkt::BoolValue>,
20214 {
20215 self.clean = std::option::Option::Some(v.into());
20216 self
20217 }
20218
20219 /// Sets or clears the value of [clean][crate::model::export_context::sql_export_options::PostgresExportOptions::clean].
20220 ///
20221 /// # Example
20222 /// ```ignore,no_run
20223 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20224 /// use wkt::BoolValue;
20225 /// let x = PostgresExportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
20226 /// let x = PostgresExportOptions::new().set_or_clear_clean(None::<BoolValue>);
20227 /// ```
20228 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
20229 where
20230 T: std::convert::Into<wkt::BoolValue>,
20231 {
20232 self.clean = v.map(|x| x.into());
20233 self
20234 }
20235
20236 /// Sets the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20237 ///
20238 /// # Example
20239 /// ```ignore,no_run
20240 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20241 /// use wkt::BoolValue;
20242 /// let x = PostgresExportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
20243 /// ```
20244 pub fn set_if_exists<T>(mut self, v: T) -> Self
20245 where
20246 T: std::convert::Into<wkt::BoolValue>,
20247 {
20248 self.if_exists = std::option::Option::Some(v.into());
20249 self
20250 }
20251
20252 /// Sets or clears the value of [if_exists][crate::model::export_context::sql_export_options::PostgresExportOptions::if_exists].
20253 ///
20254 /// # Example
20255 /// ```ignore,no_run
20256 /// # use google_cloud_sql_v1::model::export_context::sql_export_options::PostgresExportOptions;
20257 /// use wkt::BoolValue;
20258 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
20259 /// let x = PostgresExportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
20260 /// ```
20261 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
20262 where
20263 T: std::convert::Into<wkt::BoolValue>,
20264 {
20265 self.if_exists = v.map(|x| x.into());
20266 self
20267 }
20268 }
20269
20270 impl wkt::message::Message for PostgresExportOptions {
20271 fn typename() -> &'static str {
20272 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions"
20273 }
20274 }
20275 }
20276
20277 /// Options for exporting BAK files (SQL Server-only)
20278 #[derive(Clone, Default, PartialEq)]
20279 #[non_exhaustive]
20280 pub struct SqlBakExportOptions {
20281 /// Whether or not the export should be striped.
20282 pub striped: std::option::Option<wkt::BoolValue>,
20283
20284 /// Option for specifying how many stripes to use for the export.
20285 /// If blank, and the value of the striped field is true,
20286 /// the number of stripes is automatically chosen.
20287 pub stripe_count: std::option::Option<wkt::Int32Value>,
20288
20289 /// Type of this bak file will be export, FULL or DIFF, SQL Server only
20290 pub bak_type: crate::model::BakType,
20291
20292 /// Deprecated: copy_only is deprecated. Use differential_base instead
20293 #[deprecated]
20294 pub copy_only: std::option::Option<wkt::BoolValue>,
20295
20296 /// Whether or not the backup can be used as a differential base
20297 /// copy_only backup can not be served as differential base
20298 pub differential_base: std::option::Option<wkt::BoolValue>,
20299
20300 /// Optional. The begin timestamp when transaction log will be included in
20301 /// the export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339)
20302 /// format (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20303 /// available logs from the beginning of retention period will be included.
20304 /// Only applied to Cloud SQL for SQL Server.
20305 pub export_log_start_time: std::option::Option<wkt::Timestamp>,
20306
20307 /// Optional. The end timestamp when transaction log will be included in the
20308 /// export operation. [RFC 3339](https://tools.ietf.org/html/rfc3339) format
20309 /// (for example, `2023-10-01T16:19:00.094`) in UTC. When omitted, all
20310 /// available logs until current time will be included. Only applied to Cloud
20311 /// SQL for SQL Server.
20312 pub export_log_end_time: std::option::Option<wkt::Timestamp>,
20313
20314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20315 }
20316
20317 impl SqlBakExportOptions {
20318 pub fn new() -> Self {
20319 std::default::Default::default()
20320 }
20321
20322 /// Sets the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20323 ///
20324 /// # Example
20325 /// ```ignore,no_run
20326 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20327 /// use wkt::BoolValue;
20328 /// let x = SqlBakExportOptions::new().set_striped(BoolValue::default()/* use setters */);
20329 /// ```
20330 pub fn set_striped<T>(mut self, v: T) -> Self
20331 where
20332 T: std::convert::Into<wkt::BoolValue>,
20333 {
20334 self.striped = std::option::Option::Some(v.into());
20335 self
20336 }
20337
20338 /// Sets or clears the value of [striped][crate::model::export_context::SqlBakExportOptions::striped].
20339 ///
20340 /// # Example
20341 /// ```ignore,no_run
20342 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20343 /// use wkt::BoolValue;
20344 /// let x = SqlBakExportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
20345 /// let x = SqlBakExportOptions::new().set_or_clear_striped(None::<BoolValue>);
20346 /// ```
20347 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
20348 where
20349 T: std::convert::Into<wkt::BoolValue>,
20350 {
20351 self.striped = v.map(|x| x.into());
20352 self
20353 }
20354
20355 /// Sets the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20356 ///
20357 /// # Example
20358 /// ```ignore,no_run
20359 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20360 /// use wkt::Int32Value;
20361 /// let x = SqlBakExportOptions::new().set_stripe_count(Int32Value::default()/* use setters */);
20362 /// ```
20363 pub fn set_stripe_count<T>(mut self, v: T) -> Self
20364 where
20365 T: std::convert::Into<wkt::Int32Value>,
20366 {
20367 self.stripe_count = std::option::Option::Some(v.into());
20368 self
20369 }
20370
20371 /// Sets or clears the value of [stripe_count][crate::model::export_context::SqlBakExportOptions::stripe_count].
20372 ///
20373 /// # Example
20374 /// ```ignore,no_run
20375 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20376 /// use wkt::Int32Value;
20377 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(Some(Int32Value::default()/* use setters */));
20378 /// let x = SqlBakExportOptions::new().set_or_clear_stripe_count(None::<Int32Value>);
20379 /// ```
20380 pub fn set_or_clear_stripe_count<T>(mut self, v: std::option::Option<T>) -> Self
20381 where
20382 T: std::convert::Into<wkt::Int32Value>,
20383 {
20384 self.stripe_count = v.map(|x| x.into());
20385 self
20386 }
20387
20388 /// Sets the value of [bak_type][crate::model::export_context::SqlBakExportOptions::bak_type].
20389 ///
20390 /// # Example
20391 /// ```ignore,no_run
20392 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20393 /// use google_cloud_sql_v1::model::BakType;
20394 /// let x0 = SqlBakExportOptions::new().set_bak_type(BakType::Full);
20395 /// let x1 = SqlBakExportOptions::new().set_bak_type(BakType::Diff);
20396 /// let x2 = SqlBakExportOptions::new().set_bak_type(BakType::Tlog);
20397 /// ```
20398 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
20399 self.bak_type = v.into();
20400 self
20401 }
20402
20403 /// Sets the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20404 ///
20405 /// # Example
20406 /// ```ignore,no_run
20407 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20408 /// use wkt::BoolValue;
20409 /// let x = SqlBakExportOptions::new().set_copy_only(BoolValue::default()/* use setters */);
20410 /// ```
20411 #[deprecated]
20412 pub fn set_copy_only<T>(mut self, v: T) -> Self
20413 where
20414 T: std::convert::Into<wkt::BoolValue>,
20415 {
20416 self.copy_only = std::option::Option::Some(v.into());
20417 self
20418 }
20419
20420 /// Sets or clears the value of [copy_only][crate::model::export_context::SqlBakExportOptions::copy_only].
20421 ///
20422 /// # Example
20423 /// ```ignore,no_run
20424 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20425 /// use wkt::BoolValue;
20426 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(Some(BoolValue::default()/* use setters */));
20427 /// let x = SqlBakExportOptions::new().set_or_clear_copy_only(None::<BoolValue>);
20428 /// ```
20429 #[deprecated]
20430 pub fn set_or_clear_copy_only<T>(mut self, v: std::option::Option<T>) -> Self
20431 where
20432 T: std::convert::Into<wkt::BoolValue>,
20433 {
20434 self.copy_only = v.map(|x| x.into());
20435 self
20436 }
20437
20438 /// Sets the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20439 ///
20440 /// # Example
20441 /// ```ignore,no_run
20442 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20443 /// use wkt::BoolValue;
20444 /// let x = SqlBakExportOptions::new().set_differential_base(BoolValue::default()/* use setters */);
20445 /// ```
20446 pub fn set_differential_base<T>(mut self, v: T) -> Self
20447 where
20448 T: std::convert::Into<wkt::BoolValue>,
20449 {
20450 self.differential_base = std::option::Option::Some(v.into());
20451 self
20452 }
20453
20454 /// Sets or clears the value of [differential_base][crate::model::export_context::SqlBakExportOptions::differential_base].
20455 ///
20456 /// # Example
20457 /// ```ignore,no_run
20458 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20459 /// use wkt::BoolValue;
20460 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(Some(BoolValue::default()/* use setters */));
20461 /// let x = SqlBakExportOptions::new().set_or_clear_differential_base(None::<BoolValue>);
20462 /// ```
20463 pub fn set_or_clear_differential_base<T>(mut self, v: std::option::Option<T>) -> Self
20464 where
20465 T: std::convert::Into<wkt::BoolValue>,
20466 {
20467 self.differential_base = v.map(|x| x.into());
20468 self
20469 }
20470
20471 /// Sets the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20472 ///
20473 /// # Example
20474 /// ```ignore,no_run
20475 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20476 /// use wkt::Timestamp;
20477 /// let x = SqlBakExportOptions::new().set_export_log_start_time(Timestamp::default()/* use setters */);
20478 /// ```
20479 pub fn set_export_log_start_time<T>(mut self, v: T) -> Self
20480 where
20481 T: std::convert::Into<wkt::Timestamp>,
20482 {
20483 self.export_log_start_time = std::option::Option::Some(v.into());
20484 self
20485 }
20486
20487 /// Sets or clears the value of [export_log_start_time][crate::model::export_context::SqlBakExportOptions::export_log_start_time].
20488 ///
20489 /// # Example
20490 /// ```ignore,no_run
20491 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20492 /// use wkt::Timestamp;
20493 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(Some(Timestamp::default()/* use setters */));
20494 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_start_time(None::<Timestamp>);
20495 /// ```
20496 pub fn set_or_clear_export_log_start_time<T>(mut self, v: std::option::Option<T>) -> Self
20497 where
20498 T: std::convert::Into<wkt::Timestamp>,
20499 {
20500 self.export_log_start_time = v.map(|x| x.into());
20501 self
20502 }
20503
20504 /// Sets the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20505 ///
20506 /// # Example
20507 /// ```ignore,no_run
20508 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20509 /// use wkt::Timestamp;
20510 /// let x = SqlBakExportOptions::new().set_export_log_end_time(Timestamp::default()/* use setters */);
20511 /// ```
20512 pub fn set_export_log_end_time<T>(mut self, v: T) -> Self
20513 where
20514 T: std::convert::Into<wkt::Timestamp>,
20515 {
20516 self.export_log_end_time = std::option::Option::Some(v.into());
20517 self
20518 }
20519
20520 /// Sets or clears the value of [export_log_end_time][crate::model::export_context::SqlBakExportOptions::export_log_end_time].
20521 ///
20522 /// # Example
20523 /// ```ignore,no_run
20524 /// # use google_cloud_sql_v1::model::export_context::SqlBakExportOptions;
20525 /// use wkt::Timestamp;
20526 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(Some(Timestamp::default()/* use setters */));
20527 /// let x = SqlBakExportOptions::new().set_or_clear_export_log_end_time(None::<Timestamp>);
20528 /// ```
20529 pub fn set_or_clear_export_log_end_time<T>(mut self, v: std::option::Option<T>) -> Self
20530 where
20531 T: std::convert::Into<wkt::Timestamp>,
20532 {
20533 self.export_log_end_time = v.map(|x| x.into());
20534 self
20535 }
20536 }
20537
20538 impl wkt::message::Message for SqlBakExportOptions {
20539 fn typename() -> &'static str {
20540 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlBakExportOptions"
20541 }
20542 }
20543
20544 #[derive(Clone, Default, PartialEq)]
20545 #[non_exhaustive]
20546 pub struct SqlTdeExportOptions {
20547 /// Required. Path to the TDE certificate public key
20548 /// in the form gs://bucketName/fileName.
20549 /// The instance must have write access to the bucket.
20550 /// Applicable only for SQL Server instances.
20551 pub certificate_path: std::string::String,
20552
20553 /// Required. Path to the TDE certificate private key
20554 /// in the form gs://bucketName/fileName.
20555 /// The instance must have write access to the location.
20556 /// Applicable only for SQL Server instances.
20557 pub private_key_path: std::string::String,
20558
20559 /// Required. Password that encrypts the private key.
20560 pub private_key_password: std::string::String,
20561
20562 /// Required. Certificate name.
20563 /// Applicable only for SQL Server instances.
20564 pub name: std::string::String,
20565
20566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20567 }
20568
20569 impl SqlTdeExportOptions {
20570 pub fn new() -> Self {
20571 std::default::Default::default()
20572 }
20573
20574 /// Sets the value of [certificate_path][crate::model::export_context::SqlTdeExportOptions::certificate_path].
20575 ///
20576 /// # Example
20577 /// ```ignore,no_run
20578 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20579 /// let x = SqlTdeExportOptions::new().set_certificate_path("example");
20580 /// ```
20581 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
20582 mut self,
20583 v: T,
20584 ) -> Self {
20585 self.certificate_path = v.into();
20586 self
20587 }
20588
20589 /// Sets the value of [private_key_path][crate::model::export_context::SqlTdeExportOptions::private_key_path].
20590 ///
20591 /// # Example
20592 /// ```ignore,no_run
20593 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20594 /// let x = SqlTdeExportOptions::new().set_private_key_path("example");
20595 /// ```
20596 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
20597 mut self,
20598 v: T,
20599 ) -> Self {
20600 self.private_key_path = v.into();
20601 self
20602 }
20603
20604 /// Sets the value of [private_key_password][crate::model::export_context::SqlTdeExportOptions::private_key_password].
20605 ///
20606 /// # Example
20607 /// ```ignore,no_run
20608 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20609 /// let x = SqlTdeExportOptions::new().set_private_key_password("example");
20610 /// ```
20611 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
20612 mut self,
20613 v: T,
20614 ) -> Self {
20615 self.private_key_password = v.into();
20616 self
20617 }
20618
20619 /// Sets the value of [name][crate::model::export_context::SqlTdeExportOptions::name].
20620 ///
20621 /// # Example
20622 /// ```ignore,no_run
20623 /// # use google_cloud_sql_v1::model::export_context::SqlTdeExportOptions;
20624 /// let x = SqlTdeExportOptions::new().set_name("example");
20625 /// ```
20626 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20627 self.name = v.into();
20628 self
20629 }
20630 }
20631
20632 impl wkt::message::Message for SqlTdeExportOptions {
20633 fn typename() -> &'static str {
20634 "type.googleapis.com/google.cloud.sql.v1.ExportContext.SqlTdeExportOptions"
20635 }
20636 }
20637}
20638
20639/// Database instance import context.
20640#[derive(Clone, Default, PartialEq)]
20641#[non_exhaustive]
20642pub struct ImportContext {
20643 /// Path to the import file in Cloud Storage, in the form
20644 /// `gs://bucketName/fileName`. Compressed gzip files (.gz) are supported
20645 /// when `fileType` is `SQL`. The instance must have
20646 /// write permissions to the bucket and read access to the file.
20647 pub uri: std::string::String,
20648
20649 /// The target database for the import. If `fileType` is `SQL`, this field
20650 /// is required only if the import file does not specify a database, and is
20651 /// overridden by any database specification in the import file. For entire
20652 /// instance parallel import operations, the database is overridden by the
20653 /// database name stored in subdirectory name. If
20654 /// `fileType` is `CSV`, one database must be specified.
20655 pub database: std::string::String,
20656
20657 /// This is always `sql#importContext`.
20658 pub kind: std::string::String,
20659
20660 /// The file type for the specified uri.\`SQL`: The file
20661 /// contains SQL statements. \`CSV`: The file contains CSV data.
20662 pub file_type: crate::model::SqlFileType,
20663
20664 /// Options for importing data as CSV.
20665 pub csv_import_options: std::option::Option<crate::model::import_context::SqlCsvImportOptions>,
20666
20667 /// The PostgreSQL user for this import operation. PostgreSQL instances only.
20668 pub import_user: std::string::String,
20669
20670 /// Import parameters specific to SQL Server .BAK files
20671 pub bak_import_options: std::option::Option<crate::model::import_context::SqlBakImportOptions>,
20672
20673 /// Optional. Options for importing data from SQL statements.
20674 pub sql_import_options: std::option::Option<crate::model::import_context::SqlImportOptions>,
20675
20676 /// Optional. Import parameters specific to SQL Server TDE certificates
20677 pub tde_import_options: std::option::Option<crate::model::import_context::SqlTdeImportOptions>,
20678
20679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20680}
20681
20682impl ImportContext {
20683 pub fn new() -> Self {
20684 std::default::Default::default()
20685 }
20686
20687 /// Sets the value of [uri][crate::model::ImportContext::uri].
20688 ///
20689 /// # Example
20690 /// ```ignore,no_run
20691 /// # use google_cloud_sql_v1::model::ImportContext;
20692 /// let x = ImportContext::new().set_uri("example");
20693 /// ```
20694 pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20695 self.uri = v.into();
20696 self
20697 }
20698
20699 /// Sets the value of [database][crate::model::ImportContext::database].
20700 ///
20701 /// # Example
20702 /// ```ignore,no_run
20703 /// # use google_cloud_sql_v1::model::ImportContext;
20704 /// let x = ImportContext::new().set_database("example");
20705 /// ```
20706 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20707 self.database = v.into();
20708 self
20709 }
20710
20711 /// Sets the value of [kind][crate::model::ImportContext::kind].
20712 ///
20713 /// # Example
20714 /// ```ignore,no_run
20715 /// # use google_cloud_sql_v1::model::ImportContext;
20716 /// let x = ImportContext::new().set_kind("example");
20717 /// ```
20718 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20719 self.kind = v.into();
20720 self
20721 }
20722
20723 /// Sets the value of [file_type][crate::model::ImportContext::file_type].
20724 ///
20725 /// # Example
20726 /// ```ignore,no_run
20727 /// # use google_cloud_sql_v1::model::ImportContext;
20728 /// use google_cloud_sql_v1::model::SqlFileType;
20729 /// let x0 = ImportContext::new().set_file_type(SqlFileType::Sql);
20730 /// let x1 = ImportContext::new().set_file_type(SqlFileType::Csv);
20731 /// let x2 = ImportContext::new().set_file_type(SqlFileType::Bak);
20732 /// ```
20733 pub fn set_file_type<T: std::convert::Into<crate::model::SqlFileType>>(mut self, v: T) -> Self {
20734 self.file_type = v.into();
20735 self
20736 }
20737
20738 /// Sets the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20739 ///
20740 /// # Example
20741 /// ```ignore,no_run
20742 /// # use google_cloud_sql_v1::model::ImportContext;
20743 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20744 /// let x = ImportContext::new().set_csv_import_options(SqlCsvImportOptions::default()/* use setters */);
20745 /// ```
20746 pub fn set_csv_import_options<T>(mut self, v: T) -> Self
20747 where
20748 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20749 {
20750 self.csv_import_options = std::option::Option::Some(v.into());
20751 self
20752 }
20753
20754 /// Sets or clears the value of [csv_import_options][crate::model::ImportContext::csv_import_options].
20755 ///
20756 /// # Example
20757 /// ```ignore,no_run
20758 /// # use google_cloud_sql_v1::model::ImportContext;
20759 /// use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
20760 /// let x = ImportContext::new().set_or_clear_csv_import_options(Some(SqlCsvImportOptions::default()/* use setters */));
20761 /// let x = ImportContext::new().set_or_clear_csv_import_options(None::<SqlCsvImportOptions>);
20762 /// ```
20763 pub fn set_or_clear_csv_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20764 where
20765 T: std::convert::Into<crate::model::import_context::SqlCsvImportOptions>,
20766 {
20767 self.csv_import_options = v.map(|x| x.into());
20768 self
20769 }
20770
20771 /// Sets the value of [import_user][crate::model::ImportContext::import_user].
20772 ///
20773 /// # Example
20774 /// ```ignore,no_run
20775 /// # use google_cloud_sql_v1::model::ImportContext;
20776 /// let x = ImportContext::new().set_import_user("example");
20777 /// ```
20778 pub fn set_import_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
20779 self.import_user = v.into();
20780 self
20781 }
20782
20783 /// Sets the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
20784 ///
20785 /// # Example
20786 /// ```ignore,no_run
20787 /// # use google_cloud_sql_v1::model::ImportContext;
20788 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
20789 /// let x = ImportContext::new().set_bak_import_options(SqlBakImportOptions::default()/* use setters */);
20790 /// ```
20791 pub fn set_bak_import_options<T>(mut self, v: T) -> Self
20792 where
20793 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
20794 {
20795 self.bak_import_options = std::option::Option::Some(v.into());
20796 self
20797 }
20798
20799 /// Sets or clears the value of [bak_import_options][crate::model::ImportContext::bak_import_options].
20800 ///
20801 /// # Example
20802 /// ```ignore,no_run
20803 /// # use google_cloud_sql_v1::model::ImportContext;
20804 /// use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
20805 /// let x = ImportContext::new().set_or_clear_bak_import_options(Some(SqlBakImportOptions::default()/* use setters */));
20806 /// let x = ImportContext::new().set_or_clear_bak_import_options(None::<SqlBakImportOptions>);
20807 /// ```
20808 pub fn set_or_clear_bak_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20809 where
20810 T: std::convert::Into<crate::model::import_context::SqlBakImportOptions>,
20811 {
20812 self.bak_import_options = v.map(|x| x.into());
20813 self
20814 }
20815
20816 /// Sets the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
20817 ///
20818 /// # Example
20819 /// ```ignore,no_run
20820 /// # use google_cloud_sql_v1::model::ImportContext;
20821 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20822 /// let x = ImportContext::new().set_sql_import_options(SqlImportOptions::default()/* use setters */);
20823 /// ```
20824 pub fn set_sql_import_options<T>(mut self, v: T) -> Self
20825 where
20826 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
20827 {
20828 self.sql_import_options = std::option::Option::Some(v.into());
20829 self
20830 }
20831
20832 /// Sets or clears the value of [sql_import_options][crate::model::ImportContext::sql_import_options].
20833 ///
20834 /// # Example
20835 /// ```ignore,no_run
20836 /// # use google_cloud_sql_v1::model::ImportContext;
20837 /// use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20838 /// let x = ImportContext::new().set_or_clear_sql_import_options(Some(SqlImportOptions::default()/* use setters */));
20839 /// let x = ImportContext::new().set_or_clear_sql_import_options(None::<SqlImportOptions>);
20840 /// ```
20841 pub fn set_or_clear_sql_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20842 where
20843 T: std::convert::Into<crate::model::import_context::SqlImportOptions>,
20844 {
20845 self.sql_import_options = v.map(|x| x.into());
20846 self
20847 }
20848
20849 /// Sets the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
20850 ///
20851 /// # Example
20852 /// ```ignore,no_run
20853 /// # use google_cloud_sql_v1::model::ImportContext;
20854 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
20855 /// let x = ImportContext::new().set_tde_import_options(SqlTdeImportOptions::default()/* use setters */);
20856 /// ```
20857 pub fn set_tde_import_options<T>(mut self, v: T) -> Self
20858 where
20859 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
20860 {
20861 self.tde_import_options = std::option::Option::Some(v.into());
20862 self
20863 }
20864
20865 /// Sets or clears the value of [tde_import_options][crate::model::ImportContext::tde_import_options].
20866 ///
20867 /// # Example
20868 /// ```ignore,no_run
20869 /// # use google_cloud_sql_v1::model::ImportContext;
20870 /// use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
20871 /// let x = ImportContext::new().set_or_clear_tde_import_options(Some(SqlTdeImportOptions::default()/* use setters */));
20872 /// let x = ImportContext::new().set_or_clear_tde_import_options(None::<SqlTdeImportOptions>);
20873 /// ```
20874 pub fn set_or_clear_tde_import_options<T>(mut self, v: std::option::Option<T>) -> Self
20875 where
20876 T: std::convert::Into<crate::model::import_context::SqlTdeImportOptions>,
20877 {
20878 self.tde_import_options = v.map(|x| x.into());
20879 self
20880 }
20881}
20882
20883impl wkt::message::Message for ImportContext {
20884 fn typename() -> &'static str {
20885 "type.googleapis.com/google.cloud.sql.v1.ImportContext"
20886 }
20887}
20888
20889/// Defines additional types related to [ImportContext].
20890pub mod import_context {
20891 #[allow(unused_imports)]
20892 use super::*;
20893
20894 #[derive(Clone, Default, PartialEq)]
20895 #[non_exhaustive]
20896 pub struct SqlImportOptions {
20897 /// Optional. The number of threads to use for parallel import.
20898 pub threads: std::option::Option<wkt::Int32Value>,
20899
20900 /// Optional. Whether or not the import should be parallel.
20901 pub parallel: std::option::Option<wkt::BoolValue>,
20902
20903 /// Optional. Options for importing from a Cloud SQL for PostgreSQL instance.
20904 pub postgres_import_options: std::option::Option<
20905 crate::model::import_context::sql_import_options::PostgresImportOptions,
20906 >,
20907
20908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
20909 }
20910
20911 impl SqlImportOptions {
20912 pub fn new() -> Self {
20913 std::default::Default::default()
20914 }
20915
20916 /// Sets the value of [threads][crate::model::import_context::SqlImportOptions::threads].
20917 ///
20918 /// # Example
20919 /// ```ignore,no_run
20920 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20921 /// use wkt::Int32Value;
20922 /// let x = SqlImportOptions::new().set_threads(Int32Value::default()/* use setters */);
20923 /// ```
20924 pub fn set_threads<T>(mut self, v: T) -> Self
20925 where
20926 T: std::convert::Into<wkt::Int32Value>,
20927 {
20928 self.threads = std::option::Option::Some(v.into());
20929 self
20930 }
20931
20932 /// Sets or clears the value of [threads][crate::model::import_context::SqlImportOptions::threads].
20933 ///
20934 /// # Example
20935 /// ```ignore,no_run
20936 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20937 /// use wkt::Int32Value;
20938 /// let x = SqlImportOptions::new().set_or_clear_threads(Some(Int32Value::default()/* use setters */));
20939 /// let x = SqlImportOptions::new().set_or_clear_threads(None::<Int32Value>);
20940 /// ```
20941 pub fn set_or_clear_threads<T>(mut self, v: std::option::Option<T>) -> Self
20942 where
20943 T: std::convert::Into<wkt::Int32Value>,
20944 {
20945 self.threads = v.map(|x| x.into());
20946 self
20947 }
20948
20949 /// Sets the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
20950 ///
20951 /// # Example
20952 /// ```ignore,no_run
20953 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20954 /// use wkt::BoolValue;
20955 /// let x = SqlImportOptions::new().set_parallel(BoolValue::default()/* use setters */);
20956 /// ```
20957 pub fn set_parallel<T>(mut self, v: T) -> Self
20958 where
20959 T: std::convert::Into<wkt::BoolValue>,
20960 {
20961 self.parallel = std::option::Option::Some(v.into());
20962 self
20963 }
20964
20965 /// Sets or clears the value of [parallel][crate::model::import_context::SqlImportOptions::parallel].
20966 ///
20967 /// # Example
20968 /// ```ignore,no_run
20969 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20970 /// use wkt::BoolValue;
20971 /// let x = SqlImportOptions::new().set_or_clear_parallel(Some(BoolValue::default()/* use setters */));
20972 /// let x = SqlImportOptions::new().set_or_clear_parallel(None::<BoolValue>);
20973 /// ```
20974 pub fn set_or_clear_parallel<T>(mut self, v: std::option::Option<T>) -> Self
20975 where
20976 T: std::convert::Into<wkt::BoolValue>,
20977 {
20978 self.parallel = v.map(|x| x.into());
20979 self
20980 }
20981
20982 /// Sets the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
20983 ///
20984 /// # Example
20985 /// ```ignore,no_run
20986 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
20987 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
20988 /// let x = SqlImportOptions::new().set_postgres_import_options(PostgresImportOptions::default()/* use setters */);
20989 /// ```
20990 pub fn set_postgres_import_options<T>(mut self, v: T) -> Self
20991 where
20992 T: std::convert::Into<
20993 crate::model::import_context::sql_import_options::PostgresImportOptions,
20994 >,
20995 {
20996 self.postgres_import_options = std::option::Option::Some(v.into());
20997 self
20998 }
20999
21000 /// Sets or clears the value of [postgres_import_options][crate::model::import_context::SqlImportOptions::postgres_import_options].
21001 ///
21002 /// # Example
21003 /// ```ignore,no_run
21004 /// # use google_cloud_sql_v1::model::import_context::SqlImportOptions;
21005 /// use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21006 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(Some(PostgresImportOptions::default()/* use setters */));
21007 /// let x = SqlImportOptions::new().set_or_clear_postgres_import_options(None::<PostgresImportOptions>);
21008 /// ```
21009 pub fn set_or_clear_postgres_import_options<T>(mut self, v: std::option::Option<T>) -> Self
21010 where
21011 T: std::convert::Into<
21012 crate::model::import_context::sql_import_options::PostgresImportOptions,
21013 >,
21014 {
21015 self.postgres_import_options = v.map(|x| x.into());
21016 self
21017 }
21018 }
21019
21020 impl wkt::message::Message for SqlImportOptions {
21021 fn typename() -> &'static str {
21022 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions"
21023 }
21024 }
21025
21026 /// Defines additional types related to [SqlImportOptions].
21027 pub mod sql_import_options {
21028 #[allow(unused_imports)]
21029 use super::*;
21030
21031 #[derive(Clone, Default, PartialEq)]
21032 #[non_exhaustive]
21033 pub struct PostgresImportOptions {
21034 /// Optional. The --clean flag for the pg_restore utility. This flag
21035 /// applies only if you enabled Cloud SQL to import files in parallel.
21036 pub clean: std::option::Option<wkt::BoolValue>,
21037
21038 /// Optional. The --if-exists flag for the pg_restore utility. This flag
21039 /// applies only if you enabled Cloud SQL to import files in parallel.
21040 pub if_exists: std::option::Option<wkt::BoolValue>,
21041
21042 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21043 }
21044
21045 impl PostgresImportOptions {
21046 pub fn new() -> Self {
21047 std::default::Default::default()
21048 }
21049
21050 /// Sets the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21051 ///
21052 /// # Example
21053 /// ```ignore,no_run
21054 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21055 /// use wkt::BoolValue;
21056 /// let x = PostgresImportOptions::new().set_clean(BoolValue::default()/* use setters */);
21057 /// ```
21058 pub fn set_clean<T>(mut self, v: T) -> Self
21059 where
21060 T: std::convert::Into<wkt::BoolValue>,
21061 {
21062 self.clean = std::option::Option::Some(v.into());
21063 self
21064 }
21065
21066 /// Sets or clears the value of [clean][crate::model::import_context::sql_import_options::PostgresImportOptions::clean].
21067 ///
21068 /// # Example
21069 /// ```ignore,no_run
21070 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21071 /// use wkt::BoolValue;
21072 /// let x = PostgresImportOptions::new().set_or_clear_clean(Some(BoolValue::default()/* use setters */));
21073 /// let x = PostgresImportOptions::new().set_or_clear_clean(None::<BoolValue>);
21074 /// ```
21075 pub fn set_or_clear_clean<T>(mut self, v: std::option::Option<T>) -> Self
21076 where
21077 T: std::convert::Into<wkt::BoolValue>,
21078 {
21079 self.clean = v.map(|x| x.into());
21080 self
21081 }
21082
21083 /// Sets the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21084 ///
21085 /// # Example
21086 /// ```ignore,no_run
21087 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21088 /// use wkt::BoolValue;
21089 /// let x = PostgresImportOptions::new().set_if_exists(BoolValue::default()/* use setters */);
21090 /// ```
21091 pub fn set_if_exists<T>(mut self, v: T) -> Self
21092 where
21093 T: std::convert::Into<wkt::BoolValue>,
21094 {
21095 self.if_exists = std::option::Option::Some(v.into());
21096 self
21097 }
21098
21099 /// Sets or clears the value of [if_exists][crate::model::import_context::sql_import_options::PostgresImportOptions::if_exists].
21100 ///
21101 /// # Example
21102 /// ```ignore,no_run
21103 /// # use google_cloud_sql_v1::model::import_context::sql_import_options::PostgresImportOptions;
21104 /// use wkt::BoolValue;
21105 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(Some(BoolValue::default()/* use setters */));
21106 /// let x = PostgresImportOptions::new().set_or_clear_if_exists(None::<BoolValue>);
21107 /// ```
21108 pub fn set_or_clear_if_exists<T>(mut self, v: std::option::Option<T>) -> Self
21109 where
21110 T: std::convert::Into<wkt::BoolValue>,
21111 {
21112 self.if_exists = v.map(|x| x.into());
21113 self
21114 }
21115 }
21116
21117 impl wkt::message::Message for PostgresImportOptions {
21118 fn typename() -> &'static str {
21119 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions"
21120 }
21121 }
21122 }
21123
21124 #[derive(Clone, Default, PartialEq)]
21125 #[non_exhaustive]
21126 pub struct SqlCsvImportOptions {
21127 /// The table to which CSV data is imported.
21128 pub table: std::string::String,
21129
21130 /// The columns to which CSV data is imported. If not specified, all columns
21131 /// of the database table are loaded with CSV data.
21132 pub columns: std::vec::Vec<std::string::String>,
21133
21134 /// Specifies the character that should appear before a data character that
21135 /// needs to be escaped.
21136 pub escape_character: std::string::String,
21137
21138 /// Specifies the quoting character to be used when a data value is quoted.
21139 pub quote_character: std::string::String,
21140
21141 /// Specifies the character that separates columns within each row (line) of
21142 /// the file.
21143 pub fields_terminated_by: std::string::String,
21144
21145 /// This is used to separate lines. If a line does not contain all fields,
21146 /// the rest of the columns are set to their default values.
21147 pub lines_terminated_by: std::string::String,
21148
21149 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21150 }
21151
21152 impl SqlCsvImportOptions {
21153 pub fn new() -> Self {
21154 std::default::Default::default()
21155 }
21156
21157 /// Sets the value of [table][crate::model::import_context::SqlCsvImportOptions::table].
21158 ///
21159 /// # Example
21160 /// ```ignore,no_run
21161 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21162 /// let x = SqlCsvImportOptions::new().set_table("example");
21163 /// ```
21164 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21165 self.table = v.into();
21166 self
21167 }
21168
21169 /// Sets the value of [columns][crate::model::import_context::SqlCsvImportOptions::columns].
21170 ///
21171 /// # Example
21172 /// ```ignore,no_run
21173 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21174 /// let x = SqlCsvImportOptions::new().set_columns(["a", "b", "c"]);
21175 /// ```
21176 pub fn set_columns<T, V>(mut self, v: T) -> Self
21177 where
21178 T: std::iter::IntoIterator<Item = V>,
21179 V: std::convert::Into<std::string::String>,
21180 {
21181 use std::iter::Iterator;
21182 self.columns = v.into_iter().map(|i| i.into()).collect();
21183 self
21184 }
21185
21186 /// Sets the value of [escape_character][crate::model::import_context::SqlCsvImportOptions::escape_character].
21187 ///
21188 /// # Example
21189 /// ```ignore,no_run
21190 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21191 /// let x = SqlCsvImportOptions::new().set_escape_character("example");
21192 /// ```
21193 pub fn set_escape_character<T: std::convert::Into<std::string::String>>(
21194 mut self,
21195 v: T,
21196 ) -> Self {
21197 self.escape_character = v.into();
21198 self
21199 }
21200
21201 /// Sets the value of [quote_character][crate::model::import_context::SqlCsvImportOptions::quote_character].
21202 ///
21203 /// # Example
21204 /// ```ignore,no_run
21205 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21206 /// let x = SqlCsvImportOptions::new().set_quote_character("example");
21207 /// ```
21208 pub fn set_quote_character<T: std::convert::Into<std::string::String>>(
21209 mut self,
21210 v: T,
21211 ) -> Self {
21212 self.quote_character = v.into();
21213 self
21214 }
21215
21216 /// Sets the value of [fields_terminated_by][crate::model::import_context::SqlCsvImportOptions::fields_terminated_by].
21217 ///
21218 /// # Example
21219 /// ```ignore,no_run
21220 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21221 /// let x = SqlCsvImportOptions::new().set_fields_terminated_by("example");
21222 /// ```
21223 pub fn set_fields_terminated_by<T: std::convert::Into<std::string::String>>(
21224 mut self,
21225 v: T,
21226 ) -> Self {
21227 self.fields_terminated_by = v.into();
21228 self
21229 }
21230
21231 /// Sets the value of [lines_terminated_by][crate::model::import_context::SqlCsvImportOptions::lines_terminated_by].
21232 ///
21233 /// # Example
21234 /// ```ignore,no_run
21235 /// # use google_cloud_sql_v1::model::import_context::SqlCsvImportOptions;
21236 /// let x = SqlCsvImportOptions::new().set_lines_terminated_by("example");
21237 /// ```
21238 pub fn set_lines_terminated_by<T: std::convert::Into<std::string::String>>(
21239 mut self,
21240 v: T,
21241 ) -> Self {
21242 self.lines_terminated_by = v.into();
21243 self
21244 }
21245 }
21246
21247 impl wkt::message::Message for SqlCsvImportOptions {
21248 fn typename() -> &'static str {
21249 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlCsvImportOptions"
21250 }
21251 }
21252
21253 #[derive(Clone, Default, PartialEq)]
21254 #[non_exhaustive]
21255 pub struct SqlBakImportOptions {
21256 pub encryption_options: std::option::Option<
21257 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21258 >,
21259
21260 /// Whether or not the backup set being restored is striped.
21261 /// Applies only to Cloud SQL for SQL Server.
21262 pub striped: std::option::Option<wkt::BoolValue>,
21263
21264 /// Whether or not the backup importing will restore database
21265 /// with NORECOVERY option.
21266 /// Applies only to Cloud SQL for SQL Server.
21267 pub no_recovery: std::option::Option<wkt::BoolValue>,
21268
21269 /// Whether or not the backup importing request will just bring database
21270 /// online without downloading Bak content only one of "no_recovery" and
21271 /// "recovery_only" can be true otherwise error will return. Applies only to
21272 /// Cloud SQL for SQL Server.
21273 pub recovery_only: std::option::Option<wkt::BoolValue>,
21274
21275 /// Type of the bak content, FULL or DIFF
21276 pub bak_type: crate::model::BakType,
21277
21278 /// Optional. The timestamp when the import should stop. This timestamp is in
21279 /// the [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example,
21280 /// `2023-10-01T16:19:00.094`). This field is equivalent to the STOPAT
21281 /// keyword and applies to Cloud SQL for SQL Server only.
21282 pub stop_at: std::option::Option<wkt::Timestamp>,
21283
21284 /// Optional. The marked transaction where the import should stop. This field
21285 /// is equivalent to the STOPATMARK keyword and applies to Cloud SQL for SQL
21286 /// Server only.
21287 pub stop_at_mark: std::string::String,
21288
21289 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21290 }
21291
21292 impl SqlBakImportOptions {
21293 pub fn new() -> Self {
21294 std::default::Default::default()
21295 }
21296
21297 /// Sets the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21298 ///
21299 /// # Example
21300 /// ```ignore,no_run
21301 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21302 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21303 /// let x = SqlBakImportOptions::new().set_encryption_options(EncryptionOptions::default()/* use setters */);
21304 /// ```
21305 pub fn set_encryption_options<T>(mut self, v: T) -> Self
21306 where
21307 T: std::convert::Into<
21308 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21309 >,
21310 {
21311 self.encryption_options = std::option::Option::Some(v.into());
21312 self
21313 }
21314
21315 /// Sets or clears the value of [encryption_options][crate::model::import_context::SqlBakImportOptions::encryption_options].
21316 ///
21317 /// # Example
21318 /// ```ignore,no_run
21319 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21320 /// use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21321 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(Some(EncryptionOptions::default()/* use setters */));
21322 /// let x = SqlBakImportOptions::new().set_or_clear_encryption_options(None::<EncryptionOptions>);
21323 /// ```
21324 pub fn set_or_clear_encryption_options<T>(mut self, v: std::option::Option<T>) -> Self
21325 where
21326 T: std::convert::Into<
21327 crate::model::import_context::sql_bak_import_options::EncryptionOptions,
21328 >,
21329 {
21330 self.encryption_options = v.map(|x| x.into());
21331 self
21332 }
21333
21334 /// Sets the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21335 ///
21336 /// # Example
21337 /// ```ignore,no_run
21338 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21339 /// use wkt::BoolValue;
21340 /// let x = SqlBakImportOptions::new().set_striped(BoolValue::default()/* use setters */);
21341 /// ```
21342 pub fn set_striped<T>(mut self, v: T) -> Self
21343 where
21344 T: std::convert::Into<wkt::BoolValue>,
21345 {
21346 self.striped = std::option::Option::Some(v.into());
21347 self
21348 }
21349
21350 /// Sets or clears the value of [striped][crate::model::import_context::SqlBakImportOptions::striped].
21351 ///
21352 /// # Example
21353 /// ```ignore,no_run
21354 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21355 /// use wkt::BoolValue;
21356 /// let x = SqlBakImportOptions::new().set_or_clear_striped(Some(BoolValue::default()/* use setters */));
21357 /// let x = SqlBakImportOptions::new().set_or_clear_striped(None::<BoolValue>);
21358 /// ```
21359 pub fn set_or_clear_striped<T>(mut self, v: std::option::Option<T>) -> Self
21360 where
21361 T: std::convert::Into<wkt::BoolValue>,
21362 {
21363 self.striped = v.map(|x| x.into());
21364 self
21365 }
21366
21367 /// Sets the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21368 ///
21369 /// # Example
21370 /// ```ignore,no_run
21371 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21372 /// use wkt::BoolValue;
21373 /// let x = SqlBakImportOptions::new().set_no_recovery(BoolValue::default()/* use setters */);
21374 /// ```
21375 pub fn set_no_recovery<T>(mut self, v: T) -> Self
21376 where
21377 T: std::convert::Into<wkt::BoolValue>,
21378 {
21379 self.no_recovery = std::option::Option::Some(v.into());
21380 self
21381 }
21382
21383 /// Sets or clears the value of [no_recovery][crate::model::import_context::SqlBakImportOptions::no_recovery].
21384 ///
21385 /// # Example
21386 /// ```ignore,no_run
21387 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21388 /// use wkt::BoolValue;
21389 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(Some(BoolValue::default()/* use setters */));
21390 /// let x = SqlBakImportOptions::new().set_or_clear_no_recovery(None::<BoolValue>);
21391 /// ```
21392 pub fn set_or_clear_no_recovery<T>(mut self, v: std::option::Option<T>) -> Self
21393 where
21394 T: std::convert::Into<wkt::BoolValue>,
21395 {
21396 self.no_recovery = v.map(|x| x.into());
21397 self
21398 }
21399
21400 /// Sets the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21401 ///
21402 /// # Example
21403 /// ```ignore,no_run
21404 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21405 /// use wkt::BoolValue;
21406 /// let x = SqlBakImportOptions::new().set_recovery_only(BoolValue::default()/* use setters */);
21407 /// ```
21408 pub fn set_recovery_only<T>(mut self, v: T) -> Self
21409 where
21410 T: std::convert::Into<wkt::BoolValue>,
21411 {
21412 self.recovery_only = std::option::Option::Some(v.into());
21413 self
21414 }
21415
21416 /// Sets or clears the value of [recovery_only][crate::model::import_context::SqlBakImportOptions::recovery_only].
21417 ///
21418 /// # Example
21419 /// ```ignore,no_run
21420 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21421 /// use wkt::BoolValue;
21422 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(Some(BoolValue::default()/* use setters */));
21423 /// let x = SqlBakImportOptions::new().set_or_clear_recovery_only(None::<BoolValue>);
21424 /// ```
21425 pub fn set_or_clear_recovery_only<T>(mut self, v: std::option::Option<T>) -> Self
21426 where
21427 T: std::convert::Into<wkt::BoolValue>,
21428 {
21429 self.recovery_only = v.map(|x| x.into());
21430 self
21431 }
21432
21433 /// Sets the value of [bak_type][crate::model::import_context::SqlBakImportOptions::bak_type].
21434 ///
21435 /// # Example
21436 /// ```ignore,no_run
21437 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21438 /// use google_cloud_sql_v1::model::BakType;
21439 /// let x0 = SqlBakImportOptions::new().set_bak_type(BakType::Full);
21440 /// let x1 = SqlBakImportOptions::new().set_bak_type(BakType::Diff);
21441 /// let x2 = SqlBakImportOptions::new().set_bak_type(BakType::Tlog);
21442 /// ```
21443 pub fn set_bak_type<T: std::convert::Into<crate::model::BakType>>(mut self, v: T) -> Self {
21444 self.bak_type = v.into();
21445 self
21446 }
21447
21448 /// Sets the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21449 ///
21450 /// # Example
21451 /// ```ignore,no_run
21452 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21453 /// use wkt::Timestamp;
21454 /// let x = SqlBakImportOptions::new().set_stop_at(Timestamp::default()/* use setters */);
21455 /// ```
21456 pub fn set_stop_at<T>(mut self, v: T) -> Self
21457 where
21458 T: std::convert::Into<wkt::Timestamp>,
21459 {
21460 self.stop_at = std::option::Option::Some(v.into());
21461 self
21462 }
21463
21464 /// Sets or clears the value of [stop_at][crate::model::import_context::SqlBakImportOptions::stop_at].
21465 ///
21466 /// # Example
21467 /// ```ignore,no_run
21468 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21469 /// use wkt::Timestamp;
21470 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(Some(Timestamp::default()/* use setters */));
21471 /// let x = SqlBakImportOptions::new().set_or_clear_stop_at(None::<Timestamp>);
21472 /// ```
21473 pub fn set_or_clear_stop_at<T>(mut self, v: std::option::Option<T>) -> Self
21474 where
21475 T: std::convert::Into<wkt::Timestamp>,
21476 {
21477 self.stop_at = v.map(|x| x.into());
21478 self
21479 }
21480
21481 /// Sets the value of [stop_at_mark][crate::model::import_context::SqlBakImportOptions::stop_at_mark].
21482 ///
21483 /// # Example
21484 /// ```ignore,no_run
21485 /// # use google_cloud_sql_v1::model::import_context::SqlBakImportOptions;
21486 /// let x = SqlBakImportOptions::new().set_stop_at_mark("example");
21487 /// ```
21488 pub fn set_stop_at_mark<T: std::convert::Into<std::string::String>>(
21489 mut self,
21490 v: T,
21491 ) -> Self {
21492 self.stop_at_mark = v.into();
21493 self
21494 }
21495 }
21496
21497 impl wkt::message::Message for SqlBakImportOptions {
21498 fn typename() -> &'static str {
21499 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions"
21500 }
21501 }
21502
21503 /// Defines additional types related to [SqlBakImportOptions].
21504 pub mod sql_bak_import_options {
21505 #[allow(unused_imports)]
21506 use super::*;
21507
21508 #[derive(Clone, Default, PartialEq)]
21509 #[non_exhaustive]
21510 pub struct EncryptionOptions {
21511 /// Path to the Certificate (.cer) in Cloud Storage, in the form
21512 /// `gs://bucketName/fileName`. The instance must have
21513 /// write permissions to the bucket and read access to the file.
21514 pub cert_path: std::string::String,
21515
21516 /// Path to the Certificate Private Key (.pvk) in Cloud Storage, in the
21517 /// form `gs://bucketName/fileName`. The instance must have
21518 /// write permissions to the bucket and read access to the file.
21519 pub pvk_path: std::string::String,
21520
21521 /// Password that encrypts the private key
21522 pub pvk_password: std::string::String,
21523
21524 /// Optional. Whether the imported file remains encrypted.
21525 pub keep_encrypted: std::option::Option<wkt::BoolValue>,
21526
21527 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21528 }
21529
21530 impl EncryptionOptions {
21531 pub fn new() -> Self {
21532 std::default::Default::default()
21533 }
21534
21535 /// Sets the value of [cert_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::cert_path].
21536 ///
21537 /// # Example
21538 /// ```ignore,no_run
21539 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21540 /// let x = EncryptionOptions::new().set_cert_path("example");
21541 /// ```
21542 pub fn set_cert_path<T: std::convert::Into<std::string::String>>(
21543 mut self,
21544 v: T,
21545 ) -> Self {
21546 self.cert_path = v.into();
21547 self
21548 }
21549
21550 /// Sets the value of [pvk_path][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_path].
21551 ///
21552 /// # Example
21553 /// ```ignore,no_run
21554 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21555 /// let x = EncryptionOptions::new().set_pvk_path("example");
21556 /// ```
21557 pub fn set_pvk_path<T: std::convert::Into<std::string::String>>(
21558 mut self,
21559 v: T,
21560 ) -> Self {
21561 self.pvk_path = v.into();
21562 self
21563 }
21564
21565 /// Sets the value of [pvk_password][crate::model::import_context::sql_bak_import_options::EncryptionOptions::pvk_password].
21566 ///
21567 /// # Example
21568 /// ```ignore,no_run
21569 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21570 /// let x = EncryptionOptions::new().set_pvk_password("example");
21571 /// ```
21572 pub fn set_pvk_password<T: std::convert::Into<std::string::String>>(
21573 mut self,
21574 v: T,
21575 ) -> Self {
21576 self.pvk_password = v.into();
21577 self
21578 }
21579
21580 /// Sets the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21581 ///
21582 /// # Example
21583 /// ```ignore,no_run
21584 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21585 /// use wkt::BoolValue;
21586 /// let x = EncryptionOptions::new().set_keep_encrypted(BoolValue::default()/* use setters */);
21587 /// ```
21588 pub fn set_keep_encrypted<T>(mut self, v: T) -> Self
21589 where
21590 T: std::convert::Into<wkt::BoolValue>,
21591 {
21592 self.keep_encrypted = std::option::Option::Some(v.into());
21593 self
21594 }
21595
21596 /// Sets or clears the value of [keep_encrypted][crate::model::import_context::sql_bak_import_options::EncryptionOptions::keep_encrypted].
21597 ///
21598 /// # Example
21599 /// ```ignore,no_run
21600 /// # use google_cloud_sql_v1::model::import_context::sql_bak_import_options::EncryptionOptions;
21601 /// use wkt::BoolValue;
21602 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(Some(BoolValue::default()/* use setters */));
21603 /// let x = EncryptionOptions::new().set_or_clear_keep_encrypted(None::<BoolValue>);
21604 /// ```
21605 pub fn set_or_clear_keep_encrypted<T>(mut self, v: std::option::Option<T>) -> Self
21606 where
21607 T: std::convert::Into<wkt::BoolValue>,
21608 {
21609 self.keep_encrypted = v.map(|x| x.into());
21610 self
21611 }
21612 }
21613
21614 impl wkt::message::Message for EncryptionOptions {
21615 fn typename() -> &'static str {
21616 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions"
21617 }
21618 }
21619 }
21620
21621 #[derive(Clone, Default, PartialEq)]
21622 #[non_exhaustive]
21623 pub struct SqlTdeImportOptions {
21624 /// Required. Path to the TDE certificate public key
21625 /// in the form gs://bucketName/fileName.
21626 /// The instance must have read access to the file.
21627 /// Applicable only for SQL Server instances.
21628 pub certificate_path: std::string::String,
21629
21630 /// Required. Path to the TDE certificate private key
21631 /// in the form gs://bucketName/fileName.
21632 /// The instance must have read access to the file.
21633 /// Applicable only for SQL Server instances.
21634 pub private_key_path: std::string::String,
21635
21636 /// Required. Password that encrypts the private key.
21637 pub private_key_password: std::string::String,
21638
21639 /// Required. Certificate name.
21640 /// Applicable only for SQL Server instances.
21641 pub name: std::string::String,
21642
21643 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21644 }
21645
21646 impl SqlTdeImportOptions {
21647 pub fn new() -> Self {
21648 std::default::Default::default()
21649 }
21650
21651 /// Sets the value of [certificate_path][crate::model::import_context::SqlTdeImportOptions::certificate_path].
21652 ///
21653 /// # Example
21654 /// ```ignore,no_run
21655 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21656 /// let x = SqlTdeImportOptions::new().set_certificate_path("example");
21657 /// ```
21658 pub fn set_certificate_path<T: std::convert::Into<std::string::String>>(
21659 mut self,
21660 v: T,
21661 ) -> Self {
21662 self.certificate_path = v.into();
21663 self
21664 }
21665
21666 /// Sets the value of [private_key_path][crate::model::import_context::SqlTdeImportOptions::private_key_path].
21667 ///
21668 /// # Example
21669 /// ```ignore,no_run
21670 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21671 /// let x = SqlTdeImportOptions::new().set_private_key_path("example");
21672 /// ```
21673 pub fn set_private_key_path<T: std::convert::Into<std::string::String>>(
21674 mut self,
21675 v: T,
21676 ) -> Self {
21677 self.private_key_path = v.into();
21678 self
21679 }
21680
21681 /// Sets the value of [private_key_password][crate::model::import_context::SqlTdeImportOptions::private_key_password].
21682 ///
21683 /// # Example
21684 /// ```ignore,no_run
21685 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21686 /// let x = SqlTdeImportOptions::new().set_private_key_password("example");
21687 /// ```
21688 pub fn set_private_key_password<T: std::convert::Into<std::string::String>>(
21689 mut self,
21690 v: T,
21691 ) -> Self {
21692 self.private_key_password = v.into();
21693 self
21694 }
21695
21696 /// Sets the value of [name][crate::model::import_context::SqlTdeImportOptions::name].
21697 ///
21698 /// # Example
21699 /// ```ignore,no_run
21700 /// # use google_cloud_sql_v1::model::import_context::SqlTdeImportOptions;
21701 /// let x = SqlTdeImportOptions::new().set_name("example");
21702 /// ```
21703 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21704 self.name = v.into();
21705 self
21706 }
21707 }
21708
21709 impl wkt::message::Message for SqlTdeImportOptions {
21710 fn typename() -> &'static str {
21711 "type.googleapis.com/google.cloud.sql.v1.ImportContext.SqlTdeImportOptions"
21712 }
21713 }
21714}
21715
21716/// IP Management configuration.
21717#[derive(Clone, Default, PartialEq)]
21718#[non_exhaustive]
21719pub struct IpConfiguration {
21720 /// Whether the instance is assigned a public IP address or not.
21721 pub ipv4_enabled: std::option::Option<wkt::BoolValue>,
21722
21723 /// The resource link for the VPC network from which the Cloud SQL instance is
21724 /// accessible for private IP. For example,
21725 /// `/projects/myProject/global/networks/default`. This setting can
21726 /// be updated, but it cannot be removed after it is set.
21727 pub private_network: std::string::String,
21728
21729 /// Use `ssl_mode` instead.
21730 ///
21731 /// Whether SSL/TLS connections over IP are enforced.
21732 /// If set to false, then allow both non-SSL/non-TLS and SSL/TLS connections.
21733 /// For SSL/TLS connections, the client certificate won't be verified. If
21734 /// set to true, then only allow connections encrypted with SSL/TLS and with
21735 /// valid client certificates. If you want to enforce SSL/TLS without enforcing
21736 /// the requirement for valid client certificates, then use the `ssl_mode` flag
21737 /// instead of the `require_ssl` flag.
21738 pub require_ssl: std::option::Option<wkt::BoolValue>,
21739
21740 /// The list of external networks that are allowed to connect to the instance
21741 /// using the IP. In 'CIDR' notation, also known as 'slash' notation (for
21742 /// example: `157.197.200.0/24`).
21743 pub authorized_networks: std::vec::Vec<crate::model::AclEntry>,
21744
21745 /// The name of the allocated ip range for the private ip Cloud SQL instance.
21746 /// For example: "google-managed-services-default". If set, the instance ip
21747 /// will be created in the allocated range. The range name must comply with
21748 /// [RFC 1035](https://tools.ietf.org/html/rfc1035). Specifically, the name
21749 /// must be 1-63 characters long and match the regular expression
21750 /// `[a-z]([-a-z0-9]*[a-z0-9])?.`
21751 pub allocated_ip_range: std::string::String,
21752
21753 /// Controls connectivity to private IP instances from Google services,
21754 /// such as BigQuery.
21755 pub enable_private_path_for_google_cloud_services: std::option::Option<wkt::BoolValue>,
21756
21757 /// Specify how SSL/TLS is enforced in database connections. If you must use
21758 /// the `require_ssl` flag for backward compatibility, then only the following
21759 /// value pairs are valid:
21760 ///
21761 /// For PostgreSQL and MySQL:
21762 ///
21763 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21764 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=false`
21765 /// * `ssl_mode=TRUSTED_CLIENT_CERTIFICATE_REQUIRED` and `require_ssl=true`
21766 ///
21767 /// For SQL Server:
21768 ///
21769 /// * `ssl_mode=ALLOW_UNENCRYPTED_AND_ENCRYPTED` and `require_ssl=false`
21770 /// * `ssl_mode=ENCRYPTED_ONLY` and `require_ssl=true`
21771 ///
21772 /// The value of `ssl_mode` has priority over the value of `require_ssl`.
21773 ///
21774 /// For example, for the pair `ssl_mode=ENCRYPTED_ONLY` and
21775 /// `require_ssl=false`, `ssl_mode=ENCRYPTED_ONLY` means accept only SSL
21776 /// connections, while `require_ssl=false` means accept both non-SSL
21777 /// and SSL connections. In this case, MySQL and PostgreSQL databases respect
21778 /// `ssl_mode` and accepts only SSL connections.
21779 pub ssl_mode: crate::model::ip_configuration::SslMode,
21780
21781 /// PSC settings for this instance.
21782 pub psc_config: std::option::Option<crate::model::PscConfig>,
21783
21784 /// Specify what type of CA is used for the server certificate.
21785 pub server_ca_mode: std::option::Option<crate::model::ip_configuration::CaMode>,
21786
21787 /// Optional. Custom Subject Alternative Name(SAN)s for a Cloud SQL instance.
21788 pub custom_subject_alternative_names: std::vec::Vec<std::string::String>,
21789
21790 /// Optional. The resource name of the server CA pool for an instance with
21791 /// `CUSTOMER_MANAGED_CAS_CA` as the `server_ca_mode`.
21792 /// Format: projects/{PROJECT}/locations/{REGION}/caPools/{CA_POOL_ID}
21793 pub server_ca_pool: std::option::Option<std::string::String>,
21794
21795 /// Optional. Controls the automatic server certificate rotation feature. This
21796 /// feature is disabled by default. When enabled, the server certificate will
21797 /// be automatically rotated during Cloud SQL scheduled maintenance or
21798 /// self-service maintenance updates up to six months before it expires. This
21799 /// setting can only be set if server_ca_mode is either GOOGLE_MANAGED_CAS_CA
21800 /// or CUSTOMER_MANAGED_CAS_CA.
21801 pub server_certificate_rotation_mode:
21802 std::option::Option<crate::model::ip_configuration::ServerCertificateRotationMode>,
21803
21804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
21805}
21806
21807impl IpConfiguration {
21808 pub fn new() -> Self {
21809 std::default::Default::default()
21810 }
21811
21812 /// Sets the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
21813 ///
21814 /// # Example
21815 /// ```ignore,no_run
21816 /// # use google_cloud_sql_v1::model::IpConfiguration;
21817 /// use wkt::BoolValue;
21818 /// let x = IpConfiguration::new().set_ipv4_enabled(BoolValue::default()/* use setters */);
21819 /// ```
21820 pub fn set_ipv4_enabled<T>(mut self, v: T) -> Self
21821 where
21822 T: std::convert::Into<wkt::BoolValue>,
21823 {
21824 self.ipv4_enabled = std::option::Option::Some(v.into());
21825 self
21826 }
21827
21828 /// Sets or clears the value of [ipv4_enabled][crate::model::IpConfiguration::ipv4_enabled].
21829 ///
21830 /// # Example
21831 /// ```ignore,no_run
21832 /// # use google_cloud_sql_v1::model::IpConfiguration;
21833 /// use wkt::BoolValue;
21834 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(Some(BoolValue::default()/* use setters */));
21835 /// let x = IpConfiguration::new().set_or_clear_ipv4_enabled(None::<BoolValue>);
21836 /// ```
21837 pub fn set_or_clear_ipv4_enabled<T>(mut self, v: std::option::Option<T>) -> Self
21838 where
21839 T: std::convert::Into<wkt::BoolValue>,
21840 {
21841 self.ipv4_enabled = v.map(|x| x.into());
21842 self
21843 }
21844
21845 /// Sets the value of [private_network][crate::model::IpConfiguration::private_network].
21846 ///
21847 /// # Example
21848 /// ```ignore,no_run
21849 /// # use google_cloud_sql_v1::model::IpConfiguration;
21850 /// let x = IpConfiguration::new().set_private_network("example");
21851 /// ```
21852 pub fn set_private_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
21853 self.private_network = v.into();
21854 self
21855 }
21856
21857 /// Sets the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
21858 ///
21859 /// # Example
21860 /// ```ignore,no_run
21861 /// # use google_cloud_sql_v1::model::IpConfiguration;
21862 /// use wkt::BoolValue;
21863 /// let x = IpConfiguration::new().set_require_ssl(BoolValue::default()/* use setters */);
21864 /// ```
21865 pub fn set_require_ssl<T>(mut self, v: T) -> Self
21866 where
21867 T: std::convert::Into<wkt::BoolValue>,
21868 {
21869 self.require_ssl = std::option::Option::Some(v.into());
21870 self
21871 }
21872
21873 /// Sets or clears the value of [require_ssl][crate::model::IpConfiguration::require_ssl].
21874 ///
21875 /// # Example
21876 /// ```ignore,no_run
21877 /// # use google_cloud_sql_v1::model::IpConfiguration;
21878 /// use wkt::BoolValue;
21879 /// let x = IpConfiguration::new().set_or_clear_require_ssl(Some(BoolValue::default()/* use setters */));
21880 /// let x = IpConfiguration::new().set_or_clear_require_ssl(None::<BoolValue>);
21881 /// ```
21882 pub fn set_or_clear_require_ssl<T>(mut self, v: std::option::Option<T>) -> Self
21883 where
21884 T: std::convert::Into<wkt::BoolValue>,
21885 {
21886 self.require_ssl = v.map(|x| x.into());
21887 self
21888 }
21889
21890 /// Sets the value of [authorized_networks][crate::model::IpConfiguration::authorized_networks].
21891 ///
21892 /// # Example
21893 /// ```ignore,no_run
21894 /// # use google_cloud_sql_v1::model::IpConfiguration;
21895 /// use google_cloud_sql_v1::model::AclEntry;
21896 /// let x = IpConfiguration::new()
21897 /// .set_authorized_networks([
21898 /// AclEntry::default()/* use setters */,
21899 /// AclEntry::default()/* use (different) setters */,
21900 /// ]);
21901 /// ```
21902 pub fn set_authorized_networks<T, V>(mut self, v: T) -> Self
21903 where
21904 T: std::iter::IntoIterator<Item = V>,
21905 V: std::convert::Into<crate::model::AclEntry>,
21906 {
21907 use std::iter::Iterator;
21908 self.authorized_networks = v.into_iter().map(|i| i.into()).collect();
21909 self
21910 }
21911
21912 /// Sets the value of [allocated_ip_range][crate::model::IpConfiguration::allocated_ip_range].
21913 ///
21914 /// # Example
21915 /// ```ignore,no_run
21916 /// # use google_cloud_sql_v1::model::IpConfiguration;
21917 /// let x = IpConfiguration::new().set_allocated_ip_range("example");
21918 /// ```
21919 pub fn set_allocated_ip_range<T: std::convert::Into<std::string::String>>(
21920 mut self,
21921 v: T,
21922 ) -> Self {
21923 self.allocated_ip_range = v.into();
21924 self
21925 }
21926
21927 /// Sets the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
21928 ///
21929 /// # Example
21930 /// ```ignore,no_run
21931 /// # use google_cloud_sql_v1::model::IpConfiguration;
21932 /// use wkt::BoolValue;
21933 /// let x = IpConfiguration::new().set_enable_private_path_for_google_cloud_services(BoolValue::default()/* use setters */);
21934 /// ```
21935 pub fn set_enable_private_path_for_google_cloud_services<T>(mut self, v: T) -> Self
21936 where
21937 T: std::convert::Into<wkt::BoolValue>,
21938 {
21939 self.enable_private_path_for_google_cloud_services = std::option::Option::Some(v.into());
21940 self
21941 }
21942
21943 /// Sets or clears the value of [enable_private_path_for_google_cloud_services][crate::model::IpConfiguration::enable_private_path_for_google_cloud_services].
21944 ///
21945 /// # Example
21946 /// ```ignore,no_run
21947 /// # use google_cloud_sql_v1::model::IpConfiguration;
21948 /// use wkt::BoolValue;
21949 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(Some(BoolValue::default()/* use setters */));
21950 /// let x = IpConfiguration::new().set_or_clear_enable_private_path_for_google_cloud_services(None::<BoolValue>);
21951 /// ```
21952 pub fn set_or_clear_enable_private_path_for_google_cloud_services<T>(
21953 mut self,
21954 v: std::option::Option<T>,
21955 ) -> Self
21956 where
21957 T: std::convert::Into<wkt::BoolValue>,
21958 {
21959 self.enable_private_path_for_google_cloud_services = v.map(|x| x.into());
21960 self
21961 }
21962
21963 /// Sets the value of [ssl_mode][crate::model::IpConfiguration::ssl_mode].
21964 ///
21965 /// # Example
21966 /// ```ignore,no_run
21967 /// # use google_cloud_sql_v1::model::IpConfiguration;
21968 /// use google_cloud_sql_v1::model::ip_configuration::SslMode;
21969 /// let x0 = IpConfiguration::new().set_ssl_mode(SslMode::AllowUnencryptedAndEncrypted);
21970 /// let x1 = IpConfiguration::new().set_ssl_mode(SslMode::EncryptedOnly);
21971 /// let x2 = IpConfiguration::new().set_ssl_mode(SslMode::TrustedClientCertificateRequired);
21972 /// ```
21973 pub fn set_ssl_mode<T: std::convert::Into<crate::model::ip_configuration::SslMode>>(
21974 mut self,
21975 v: T,
21976 ) -> Self {
21977 self.ssl_mode = v.into();
21978 self
21979 }
21980
21981 /// Sets the value of [psc_config][crate::model::IpConfiguration::psc_config].
21982 ///
21983 /// # Example
21984 /// ```ignore,no_run
21985 /// # use google_cloud_sql_v1::model::IpConfiguration;
21986 /// use google_cloud_sql_v1::model::PscConfig;
21987 /// let x = IpConfiguration::new().set_psc_config(PscConfig::default()/* use setters */);
21988 /// ```
21989 pub fn set_psc_config<T>(mut self, v: T) -> Self
21990 where
21991 T: std::convert::Into<crate::model::PscConfig>,
21992 {
21993 self.psc_config = std::option::Option::Some(v.into());
21994 self
21995 }
21996
21997 /// Sets or clears the value of [psc_config][crate::model::IpConfiguration::psc_config].
21998 ///
21999 /// # Example
22000 /// ```ignore,no_run
22001 /// # use google_cloud_sql_v1::model::IpConfiguration;
22002 /// use google_cloud_sql_v1::model::PscConfig;
22003 /// let x = IpConfiguration::new().set_or_clear_psc_config(Some(PscConfig::default()/* use setters */));
22004 /// let x = IpConfiguration::new().set_or_clear_psc_config(None::<PscConfig>);
22005 /// ```
22006 pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
22007 where
22008 T: std::convert::Into<crate::model::PscConfig>,
22009 {
22010 self.psc_config = v.map(|x| x.into());
22011 self
22012 }
22013
22014 /// Sets the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22015 ///
22016 /// # Example
22017 /// ```ignore,no_run
22018 /// # use google_cloud_sql_v1::model::IpConfiguration;
22019 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22020 /// let x0 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedInternalCa);
22021 /// let x1 = IpConfiguration::new().set_server_ca_mode(CaMode::GoogleManagedCasCa);
22022 /// let x2 = IpConfiguration::new().set_server_ca_mode(CaMode::CustomerManagedCasCa);
22023 /// ```
22024 pub fn set_server_ca_mode<T>(mut self, v: T) -> Self
22025 where
22026 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22027 {
22028 self.server_ca_mode = std::option::Option::Some(v.into());
22029 self
22030 }
22031
22032 /// Sets or clears the value of [server_ca_mode][crate::model::IpConfiguration::server_ca_mode].
22033 ///
22034 /// # Example
22035 /// ```ignore,no_run
22036 /// # use google_cloud_sql_v1::model::IpConfiguration;
22037 /// use google_cloud_sql_v1::model::ip_configuration::CaMode;
22038 /// let x0 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedInternalCa));
22039 /// let x1 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::GoogleManagedCasCa));
22040 /// let x2 = IpConfiguration::new().set_or_clear_server_ca_mode(Some(CaMode::CustomerManagedCasCa));
22041 /// let x_none = IpConfiguration::new().set_or_clear_server_ca_mode(None::<CaMode>);
22042 /// ```
22043 pub fn set_or_clear_server_ca_mode<T>(mut self, v: std::option::Option<T>) -> Self
22044 where
22045 T: std::convert::Into<crate::model::ip_configuration::CaMode>,
22046 {
22047 self.server_ca_mode = v.map(|x| x.into());
22048 self
22049 }
22050
22051 /// Sets the value of [custom_subject_alternative_names][crate::model::IpConfiguration::custom_subject_alternative_names].
22052 ///
22053 /// # Example
22054 /// ```ignore,no_run
22055 /// # use google_cloud_sql_v1::model::IpConfiguration;
22056 /// let x = IpConfiguration::new().set_custom_subject_alternative_names(["a", "b", "c"]);
22057 /// ```
22058 pub fn set_custom_subject_alternative_names<T, V>(mut self, v: T) -> Self
22059 where
22060 T: std::iter::IntoIterator<Item = V>,
22061 V: std::convert::Into<std::string::String>,
22062 {
22063 use std::iter::Iterator;
22064 self.custom_subject_alternative_names = v.into_iter().map(|i| i.into()).collect();
22065 self
22066 }
22067
22068 /// Sets the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22069 ///
22070 /// # Example
22071 /// ```ignore,no_run
22072 /// # use google_cloud_sql_v1::model::IpConfiguration;
22073 /// let x = IpConfiguration::new().set_server_ca_pool("example");
22074 /// ```
22075 pub fn set_server_ca_pool<T>(mut self, v: T) -> Self
22076 where
22077 T: std::convert::Into<std::string::String>,
22078 {
22079 self.server_ca_pool = std::option::Option::Some(v.into());
22080 self
22081 }
22082
22083 /// Sets or clears the value of [server_ca_pool][crate::model::IpConfiguration::server_ca_pool].
22084 ///
22085 /// # Example
22086 /// ```ignore,no_run
22087 /// # use google_cloud_sql_v1::model::IpConfiguration;
22088 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(Some("example"));
22089 /// let x = IpConfiguration::new().set_or_clear_server_ca_pool(None::<String>);
22090 /// ```
22091 pub fn set_or_clear_server_ca_pool<T>(mut self, v: std::option::Option<T>) -> Self
22092 where
22093 T: std::convert::Into<std::string::String>,
22094 {
22095 self.server_ca_pool = v.map(|x| x.into());
22096 self
22097 }
22098
22099 /// Sets the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22100 ///
22101 /// # Example
22102 /// ```ignore,no_run
22103 /// # use google_cloud_sql_v1::model::IpConfiguration;
22104 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22105 /// let x0 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::NoAutomaticRotation);
22106 /// let x1 = IpConfiguration::new().set_server_certificate_rotation_mode(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance);
22107 /// ```
22108 pub fn set_server_certificate_rotation_mode<T>(mut self, v: T) -> Self
22109 where
22110 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22111 {
22112 self.server_certificate_rotation_mode = std::option::Option::Some(v.into());
22113 self
22114 }
22115
22116 /// Sets or clears the value of [server_certificate_rotation_mode][crate::model::IpConfiguration::server_certificate_rotation_mode].
22117 ///
22118 /// # Example
22119 /// ```ignore,no_run
22120 /// # use google_cloud_sql_v1::model::IpConfiguration;
22121 /// use google_cloud_sql_v1::model::ip_configuration::ServerCertificateRotationMode;
22122 /// let x0 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::NoAutomaticRotation));
22123 /// let x1 = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(Some(ServerCertificateRotationMode::AutomaticRotationDuringMaintenance));
22124 /// let x_none = IpConfiguration::new().set_or_clear_server_certificate_rotation_mode(None::<ServerCertificateRotationMode>);
22125 /// ```
22126 pub fn set_or_clear_server_certificate_rotation_mode<T>(
22127 mut self,
22128 v: std::option::Option<T>,
22129 ) -> Self
22130 where
22131 T: std::convert::Into<crate::model::ip_configuration::ServerCertificateRotationMode>,
22132 {
22133 self.server_certificate_rotation_mode = v.map(|x| x.into());
22134 self
22135 }
22136}
22137
22138impl wkt::message::Message for IpConfiguration {
22139 fn typename() -> &'static str {
22140 "type.googleapis.com/google.cloud.sql.v1.IpConfiguration"
22141 }
22142}
22143
22144/// Defines additional types related to [IpConfiguration].
22145pub mod ip_configuration {
22146 #[allow(unused_imports)]
22147 use super::*;
22148
22149 /// The SSL options for database connections.
22150 ///
22151 /// # Working with unknown values
22152 ///
22153 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22154 /// additional enum variants at any time. Adding new variants is not considered
22155 /// a breaking change. Applications should write their code in anticipation of:
22156 ///
22157 /// - New values appearing in future releases of the client library, **and**
22158 /// - New values received dynamically, without application changes.
22159 ///
22160 /// Please consult the [Working with enums] section in the user guide for some
22161 /// guidelines.
22162 ///
22163 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22164 #[derive(Clone, Debug, PartialEq)]
22165 #[non_exhaustive]
22166 pub enum SslMode {
22167 /// The SSL mode is unknown.
22168 Unspecified,
22169 /// Allow non-SSL/non-TLS and SSL/TLS connections.
22170 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22171 /// isn't verified.
22172 ///
22173 /// When this value is used, the legacy `require_ssl` flag must be false or
22174 /// cleared to avoid a conflict between the values of the two flags.
22175 AllowUnencryptedAndEncrypted,
22176 /// Only allow connections encrypted with SSL/TLS.
22177 /// For SSL connections to MySQL and PostgreSQL, the client certificate
22178 /// isn't verified.
22179 ///
22180 /// When this value is used, the legacy `require_ssl` flag must be false or
22181 /// cleared to avoid a conflict between the values of the two flags.
22182 EncryptedOnly,
22183 /// Only allow connections encrypted with SSL/TLS and with valid
22184 /// client certificates.
22185 ///
22186 /// When this value is used, the legacy `require_ssl` flag must be true or
22187 /// cleared to avoid the conflict between values of two flags.
22188 /// PostgreSQL clients or users that connect using IAM database
22189 /// authentication must use either the
22190 /// [Cloud SQL Auth
22191 /// Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or
22192 /// [Cloud SQL
22193 /// Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors)
22194 /// to enforce client identity verification.
22195 ///
22196 /// Only applicable to MySQL and PostgreSQL. Not applicable to SQL Server.
22197 TrustedClientCertificateRequired,
22198 /// If set, the enum was initialized with an unknown value.
22199 ///
22200 /// Applications can examine the value using [SslMode::value] or
22201 /// [SslMode::name].
22202 UnknownValue(ssl_mode::UnknownValue),
22203 }
22204
22205 #[doc(hidden)]
22206 pub mod ssl_mode {
22207 #[allow(unused_imports)]
22208 use super::*;
22209 #[derive(Clone, Debug, PartialEq)]
22210 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22211 }
22212
22213 impl SslMode {
22214 /// Gets the enum value.
22215 ///
22216 /// Returns `None` if the enum contains an unknown value deserialized from
22217 /// the string representation of enums.
22218 pub fn value(&self) -> std::option::Option<i32> {
22219 match self {
22220 Self::Unspecified => std::option::Option::Some(0),
22221 Self::AllowUnencryptedAndEncrypted => std::option::Option::Some(1),
22222 Self::EncryptedOnly => std::option::Option::Some(2),
22223 Self::TrustedClientCertificateRequired => std::option::Option::Some(3),
22224 Self::UnknownValue(u) => u.0.value(),
22225 }
22226 }
22227
22228 /// Gets the enum value as a string.
22229 ///
22230 /// Returns `None` if the enum contains an unknown value deserialized from
22231 /// the integer representation of enums.
22232 pub fn name(&self) -> std::option::Option<&str> {
22233 match self {
22234 Self::Unspecified => std::option::Option::Some("SSL_MODE_UNSPECIFIED"),
22235 Self::AllowUnencryptedAndEncrypted => {
22236 std::option::Option::Some("ALLOW_UNENCRYPTED_AND_ENCRYPTED")
22237 }
22238 Self::EncryptedOnly => std::option::Option::Some("ENCRYPTED_ONLY"),
22239 Self::TrustedClientCertificateRequired => {
22240 std::option::Option::Some("TRUSTED_CLIENT_CERTIFICATE_REQUIRED")
22241 }
22242 Self::UnknownValue(u) => u.0.name(),
22243 }
22244 }
22245 }
22246
22247 impl std::default::Default for SslMode {
22248 fn default() -> Self {
22249 use std::convert::From;
22250 Self::from(0)
22251 }
22252 }
22253
22254 impl std::fmt::Display for SslMode {
22255 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22256 wkt::internal::display_enum(f, self.name(), self.value())
22257 }
22258 }
22259
22260 impl std::convert::From<i32> for SslMode {
22261 fn from(value: i32) -> Self {
22262 match value {
22263 0 => Self::Unspecified,
22264 1 => Self::AllowUnencryptedAndEncrypted,
22265 2 => Self::EncryptedOnly,
22266 3 => Self::TrustedClientCertificateRequired,
22267 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22268 wkt::internal::UnknownEnumValue::Integer(value),
22269 )),
22270 }
22271 }
22272 }
22273
22274 impl std::convert::From<&str> for SslMode {
22275 fn from(value: &str) -> Self {
22276 use std::string::ToString;
22277 match value {
22278 "SSL_MODE_UNSPECIFIED" => Self::Unspecified,
22279 "ALLOW_UNENCRYPTED_AND_ENCRYPTED" => Self::AllowUnencryptedAndEncrypted,
22280 "ENCRYPTED_ONLY" => Self::EncryptedOnly,
22281 "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" => Self::TrustedClientCertificateRequired,
22282 _ => Self::UnknownValue(ssl_mode::UnknownValue(
22283 wkt::internal::UnknownEnumValue::String(value.to_string()),
22284 )),
22285 }
22286 }
22287 }
22288
22289 impl serde::ser::Serialize for SslMode {
22290 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22291 where
22292 S: serde::Serializer,
22293 {
22294 match self {
22295 Self::Unspecified => serializer.serialize_i32(0),
22296 Self::AllowUnencryptedAndEncrypted => serializer.serialize_i32(1),
22297 Self::EncryptedOnly => serializer.serialize_i32(2),
22298 Self::TrustedClientCertificateRequired => serializer.serialize_i32(3),
22299 Self::UnknownValue(u) => u.0.serialize(serializer),
22300 }
22301 }
22302 }
22303
22304 impl<'de> serde::de::Deserialize<'de> for SslMode {
22305 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22306 where
22307 D: serde::Deserializer<'de>,
22308 {
22309 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SslMode>::new(
22310 ".google.cloud.sql.v1.IpConfiguration.SslMode",
22311 ))
22312 }
22313 }
22314
22315 /// Various Certificate Authority (CA) modes for certificate signing.
22316 ///
22317 /// # Working with unknown values
22318 ///
22319 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22320 /// additional enum variants at any time. Adding new variants is not considered
22321 /// a breaking change. Applications should write their code in anticipation of:
22322 ///
22323 /// - New values appearing in future releases of the client library, **and**
22324 /// - New values received dynamically, without application changes.
22325 ///
22326 /// Please consult the [Working with enums] section in the user guide for some
22327 /// guidelines.
22328 ///
22329 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22330 #[derive(Clone, Debug, PartialEq)]
22331 #[non_exhaustive]
22332 pub enum CaMode {
22333 /// CA mode is unspecified. It is effectively the same as
22334 /// `GOOGLE_MANAGED_INTERNAL_CA`.
22335 Unspecified,
22336 /// Google-managed self-signed internal CA.
22337 GoogleManagedInternalCa,
22338 /// Google-managed regional CA part of root CA hierarchy hosted on Google
22339 /// Cloud's Certificate Authority Service (CAS).
22340 GoogleManagedCasCa,
22341 /// Customer-managed CA hosted on Google Cloud's Certificate Authority
22342 /// Service (CAS).
22343 CustomerManagedCasCa,
22344 /// If set, the enum was initialized with an unknown value.
22345 ///
22346 /// Applications can examine the value using [CaMode::value] or
22347 /// [CaMode::name].
22348 UnknownValue(ca_mode::UnknownValue),
22349 }
22350
22351 #[doc(hidden)]
22352 pub mod ca_mode {
22353 #[allow(unused_imports)]
22354 use super::*;
22355 #[derive(Clone, Debug, PartialEq)]
22356 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22357 }
22358
22359 impl CaMode {
22360 /// Gets the enum value.
22361 ///
22362 /// Returns `None` if the enum contains an unknown value deserialized from
22363 /// the string representation of enums.
22364 pub fn value(&self) -> std::option::Option<i32> {
22365 match self {
22366 Self::Unspecified => std::option::Option::Some(0),
22367 Self::GoogleManagedInternalCa => std::option::Option::Some(1),
22368 Self::GoogleManagedCasCa => std::option::Option::Some(2),
22369 Self::CustomerManagedCasCa => std::option::Option::Some(3),
22370 Self::UnknownValue(u) => u.0.value(),
22371 }
22372 }
22373
22374 /// Gets the enum value as a string.
22375 ///
22376 /// Returns `None` if the enum contains an unknown value deserialized from
22377 /// the integer representation of enums.
22378 pub fn name(&self) -> std::option::Option<&str> {
22379 match self {
22380 Self::Unspecified => std::option::Option::Some("CA_MODE_UNSPECIFIED"),
22381 Self::GoogleManagedInternalCa => {
22382 std::option::Option::Some("GOOGLE_MANAGED_INTERNAL_CA")
22383 }
22384 Self::GoogleManagedCasCa => std::option::Option::Some("GOOGLE_MANAGED_CAS_CA"),
22385 Self::CustomerManagedCasCa => std::option::Option::Some("CUSTOMER_MANAGED_CAS_CA"),
22386 Self::UnknownValue(u) => u.0.name(),
22387 }
22388 }
22389 }
22390
22391 impl std::default::Default for CaMode {
22392 fn default() -> Self {
22393 use std::convert::From;
22394 Self::from(0)
22395 }
22396 }
22397
22398 impl std::fmt::Display for CaMode {
22399 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22400 wkt::internal::display_enum(f, self.name(), self.value())
22401 }
22402 }
22403
22404 impl std::convert::From<i32> for CaMode {
22405 fn from(value: i32) -> Self {
22406 match value {
22407 0 => Self::Unspecified,
22408 1 => Self::GoogleManagedInternalCa,
22409 2 => Self::GoogleManagedCasCa,
22410 3 => Self::CustomerManagedCasCa,
22411 _ => Self::UnknownValue(ca_mode::UnknownValue(
22412 wkt::internal::UnknownEnumValue::Integer(value),
22413 )),
22414 }
22415 }
22416 }
22417
22418 impl std::convert::From<&str> for CaMode {
22419 fn from(value: &str) -> Self {
22420 use std::string::ToString;
22421 match value {
22422 "CA_MODE_UNSPECIFIED" => Self::Unspecified,
22423 "GOOGLE_MANAGED_INTERNAL_CA" => Self::GoogleManagedInternalCa,
22424 "GOOGLE_MANAGED_CAS_CA" => Self::GoogleManagedCasCa,
22425 "CUSTOMER_MANAGED_CAS_CA" => Self::CustomerManagedCasCa,
22426 _ => Self::UnknownValue(ca_mode::UnknownValue(
22427 wkt::internal::UnknownEnumValue::String(value.to_string()),
22428 )),
22429 }
22430 }
22431 }
22432
22433 impl serde::ser::Serialize for CaMode {
22434 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22435 where
22436 S: serde::Serializer,
22437 {
22438 match self {
22439 Self::Unspecified => serializer.serialize_i32(0),
22440 Self::GoogleManagedInternalCa => serializer.serialize_i32(1),
22441 Self::GoogleManagedCasCa => serializer.serialize_i32(2),
22442 Self::CustomerManagedCasCa => serializer.serialize_i32(3),
22443 Self::UnknownValue(u) => u.0.serialize(serializer),
22444 }
22445 }
22446 }
22447
22448 impl<'de> serde::de::Deserialize<'de> for CaMode {
22449 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22450 where
22451 D: serde::Deserializer<'de>,
22452 {
22453 deserializer.deserialize_any(wkt::internal::EnumVisitor::<CaMode>::new(
22454 ".google.cloud.sql.v1.IpConfiguration.CaMode",
22455 ))
22456 }
22457 }
22458
22459 /// Settings for automatic server certificate rotation.
22460 ///
22461 /// # Working with unknown values
22462 ///
22463 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
22464 /// additional enum variants at any time. Adding new variants is not considered
22465 /// a breaking change. Applications should write their code in anticipation of:
22466 ///
22467 /// - New values appearing in future releases of the client library, **and**
22468 /// - New values received dynamically, without application changes.
22469 ///
22470 /// Please consult the [Working with enums] section in the user guide for some
22471 /// guidelines.
22472 ///
22473 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
22474 #[derive(Clone, Debug, PartialEq)]
22475 #[non_exhaustive]
22476 pub enum ServerCertificateRotationMode {
22477 /// Unspecified: no automatic server certificate rotation.
22478 Unspecified,
22479 /// No automatic server certificate rotation. The user must [manage server
22480 /// certificate
22481 /// rotation](/sql/docs/mysql/manage-ssl-instance#rotate-server-certificate-cas)
22482 /// on their side.
22483 NoAutomaticRotation,
22484 /// Automatic server certificate rotation during Cloud SQL scheduled
22485 /// maintenance or self-service maintenance updates. Requires
22486 /// `server_ca_mode` to be `GOOGLE_MANAGED_CAS_CA` or
22487 /// `CUSTOMER_MANAGED_CAS_CA`.
22488 AutomaticRotationDuringMaintenance,
22489 /// If set, the enum was initialized with an unknown value.
22490 ///
22491 /// Applications can examine the value using [ServerCertificateRotationMode::value] or
22492 /// [ServerCertificateRotationMode::name].
22493 UnknownValue(server_certificate_rotation_mode::UnknownValue),
22494 }
22495
22496 #[doc(hidden)]
22497 pub mod server_certificate_rotation_mode {
22498 #[allow(unused_imports)]
22499 use super::*;
22500 #[derive(Clone, Debug, PartialEq)]
22501 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
22502 }
22503
22504 impl ServerCertificateRotationMode {
22505 /// Gets the enum value.
22506 ///
22507 /// Returns `None` if the enum contains an unknown value deserialized from
22508 /// the string representation of enums.
22509 pub fn value(&self) -> std::option::Option<i32> {
22510 match self {
22511 Self::Unspecified => std::option::Option::Some(0),
22512 Self::NoAutomaticRotation => std::option::Option::Some(1),
22513 Self::AutomaticRotationDuringMaintenance => std::option::Option::Some(2),
22514 Self::UnknownValue(u) => u.0.value(),
22515 }
22516 }
22517
22518 /// Gets the enum value as a string.
22519 ///
22520 /// Returns `None` if the enum contains an unknown value deserialized from
22521 /// the integer representation of enums.
22522 pub fn name(&self) -> std::option::Option<&str> {
22523 match self {
22524 Self::Unspecified => {
22525 std::option::Option::Some("SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED")
22526 }
22527 Self::NoAutomaticRotation => std::option::Option::Some("NO_AUTOMATIC_ROTATION"),
22528 Self::AutomaticRotationDuringMaintenance => {
22529 std::option::Option::Some("AUTOMATIC_ROTATION_DURING_MAINTENANCE")
22530 }
22531 Self::UnknownValue(u) => u.0.name(),
22532 }
22533 }
22534 }
22535
22536 impl std::default::Default for ServerCertificateRotationMode {
22537 fn default() -> Self {
22538 use std::convert::From;
22539 Self::from(0)
22540 }
22541 }
22542
22543 impl std::fmt::Display for ServerCertificateRotationMode {
22544 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
22545 wkt::internal::display_enum(f, self.name(), self.value())
22546 }
22547 }
22548
22549 impl std::convert::From<i32> for ServerCertificateRotationMode {
22550 fn from(value: i32) -> Self {
22551 match value {
22552 0 => Self::Unspecified,
22553 1 => Self::NoAutomaticRotation,
22554 2 => Self::AutomaticRotationDuringMaintenance,
22555 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22556 wkt::internal::UnknownEnumValue::Integer(value),
22557 )),
22558 }
22559 }
22560 }
22561
22562 impl std::convert::From<&str> for ServerCertificateRotationMode {
22563 fn from(value: &str) -> Self {
22564 use std::string::ToString;
22565 match value {
22566 "SERVER_CERTIFICATE_ROTATION_MODE_UNSPECIFIED" => Self::Unspecified,
22567 "NO_AUTOMATIC_ROTATION" => Self::NoAutomaticRotation,
22568 "AUTOMATIC_ROTATION_DURING_MAINTENANCE" => Self::AutomaticRotationDuringMaintenance,
22569 _ => Self::UnknownValue(server_certificate_rotation_mode::UnknownValue(
22570 wkt::internal::UnknownEnumValue::String(value.to_string()),
22571 )),
22572 }
22573 }
22574 }
22575
22576 impl serde::ser::Serialize for ServerCertificateRotationMode {
22577 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
22578 where
22579 S: serde::Serializer,
22580 {
22581 match self {
22582 Self::Unspecified => serializer.serialize_i32(0),
22583 Self::NoAutomaticRotation => serializer.serialize_i32(1),
22584 Self::AutomaticRotationDuringMaintenance => serializer.serialize_i32(2),
22585 Self::UnknownValue(u) => u.0.serialize(serializer),
22586 }
22587 }
22588 }
22589
22590 impl<'de> serde::de::Deserialize<'de> for ServerCertificateRotationMode {
22591 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
22592 where
22593 D: serde::Deserializer<'de>,
22594 {
22595 deserializer.deserialize_any(
22596 wkt::internal::EnumVisitor::<ServerCertificateRotationMode>::new(
22597 ".google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode",
22598 ),
22599 )
22600 }
22601 }
22602}
22603
22604/// PSC settings for a Cloud SQL instance.
22605#[derive(Clone, Default, PartialEq)]
22606#[non_exhaustive]
22607pub struct PscConfig {
22608 /// Whether PSC connectivity is enabled for this instance.
22609 pub psc_enabled: std::option::Option<bool>,
22610
22611 /// Optional. The list of consumer projects that are allow-listed for PSC
22612 /// connections to this instance. This instance can be connected to with PSC
22613 /// from any network in these projects.
22614 ///
22615 /// Each consumer project in this list may be represented by a project number
22616 /// (numeric) or by a project id (alphanumeric).
22617 pub allowed_consumer_projects: std::vec::Vec<std::string::String>,
22618
22619 /// Optional. The list of settings for requested Private Service Connect
22620 /// consumer endpoints that can be used to connect to this Cloud SQL instance.
22621 pub psc_auto_connections: std::vec::Vec<crate::model::PscAutoConnectionConfig>,
22622
22623 /// Optional. The network attachment of the consumer network that the
22624 /// Private Service Connect enabled Cloud SQL instance is
22625 /// authorized to connect via PSC interface.
22626 /// format: projects/PROJECT/regions/REGION/networkAttachments/ID
22627 pub network_attachment_uri: std::string::String,
22628
22629 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22630}
22631
22632impl PscConfig {
22633 pub fn new() -> Self {
22634 std::default::Default::default()
22635 }
22636
22637 /// Sets the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22638 ///
22639 /// # Example
22640 /// ```ignore,no_run
22641 /// # use google_cloud_sql_v1::model::PscConfig;
22642 /// let x = PscConfig::new().set_psc_enabled(true);
22643 /// ```
22644 pub fn set_psc_enabled<T>(mut self, v: T) -> Self
22645 where
22646 T: std::convert::Into<bool>,
22647 {
22648 self.psc_enabled = std::option::Option::Some(v.into());
22649 self
22650 }
22651
22652 /// Sets or clears the value of [psc_enabled][crate::model::PscConfig::psc_enabled].
22653 ///
22654 /// # Example
22655 /// ```ignore,no_run
22656 /// # use google_cloud_sql_v1::model::PscConfig;
22657 /// let x = PscConfig::new().set_or_clear_psc_enabled(Some(false));
22658 /// let x = PscConfig::new().set_or_clear_psc_enabled(None::<bool>);
22659 /// ```
22660 pub fn set_or_clear_psc_enabled<T>(mut self, v: std::option::Option<T>) -> Self
22661 where
22662 T: std::convert::Into<bool>,
22663 {
22664 self.psc_enabled = v.map(|x| x.into());
22665 self
22666 }
22667
22668 /// Sets the value of [allowed_consumer_projects][crate::model::PscConfig::allowed_consumer_projects].
22669 ///
22670 /// # Example
22671 /// ```ignore,no_run
22672 /// # use google_cloud_sql_v1::model::PscConfig;
22673 /// let x = PscConfig::new().set_allowed_consumer_projects(["a", "b", "c"]);
22674 /// ```
22675 pub fn set_allowed_consumer_projects<T, V>(mut self, v: T) -> Self
22676 where
22677 T: std::iter::IntoIterator<Item = V>,
22678 V: std::convert::Into<std::string::String>,
22679 {
22680 use std::iter::Iterator;
22681 self.allowed_consumer_projects = v.into_iter().map(|i| i.into()).collect();
22682 self
22683 }
22684
22685 /// Sets the value of [psc_auto_connections][crate::model::PscConfig::psc_auto_connections].
22686 ///
22687 /// # Example
22688 /// ```ignore,no_run
22689 /// # use google_cloud_sql_v1::model::PscConfig;
22690 /// use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22691 /// let x = PscConfig::new()
22692 /// .set_psc_auto_connections([
22693 /// PscAutoConnectionConfig::default()/* use setters */,
22694 /// PscAutoConnectionConfig::default()/* use (different) setters */,
22695 /// ]);
22696 /// ```
22697 pub fn set_psc_auto_connections<T, V>(mut self, v: T) -> Self
22698 where
22699 T: std::iter::IntoIterator<Item = V>,
22700 V: std::convert::Into<crate::model::PscAutoConnectionConfig>,
22701 {
22702 use std::iter::Iterator;
22703 self.psc_auto_connections = v.into_iter().map(|i| i.into()).collect();
22704 self
22705 }
22706
22707 /// Sets the value of [network_attachment_uri][crate::model::PscConfig::network_attachment_uri].
22708 ///
22709 /// # Example
22710 /// ```ignore,no_run
22711 /// # use google_cloud_sql_v1::model::PscConfig;
22712 /// let x = PscConfig::new().set_network_attachment_uri("example");
22713 /// ```
22714 pub fn set_network_attachment_uri<T: std::convert::Into<std::string::String>>(
22715 mut self,
22716 v: T,
22717 ) -> Self {
22718 self.network_attachment_uri = v.into();
22719 self
22720 }
22721}
22722
22723impl wkt::message::Message for PscConfig {
22724 fn typename() -> &'static str {
22725 "type.googleapis.com/google.cloud.sql.v1.PscConfig"
22726 }
22727}
22728
22729/// Settings for an automatically-setup Private Service Connect consumer endpoint
22730/// that is used to connect to a Cloud SQL instance.
22731#[derive(Clone, Default, PartialEq)]
22732#[non_exhaustive]
22733pub struct PscAutoConnectionConfig {
22734 /// Optional. This is the project ID of consumer service project of this
22735 /// consumer endpoint.
22736 ///
22737 /// Optional. This is only applicable if consumer_network is a shared vpc
22738 /// network.
22739 pub consumer_project: std::string::String,
22740
22741 /// Optional. The consumer network of this consumer endpoint. This must be a
22742 /// resource path that includes both the host project and the network name.
22743 ///
22744 /// For example, `projects/project1/global/networks/network1`.
22745 ///
22746 /// The consumer host project of this network might be different from the
22747 /// consumer service project.
22748 pub consumer_network: std::string::String,
22749
22750 /// The IP address of the consumer endpoint.
22751 pub ip_address: std::option::Option<std::string::String>,
22752
22753 /// The connection status of the consumer endpoint.
22754 pub status: std::option::Option<std::string::String>,
22755
22756 /// The connection policy status of the consumer network.
22757 pub consumer_network_status: std::option::Option<std::string::String>,
22758
22759 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22760}
22761
22762impl PscAutoConnectionConfig {
22763 pub fn new() -> Self {
22764 std::default::Default::default()
22765 }
22766
22767 /// Sets the value of [consumer_project][crate::model::PscAutoConnectionConfig::consumer_project].
22768 ///
22769 /// # Example
22770 /// ```ignore,no_run
22771 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22772 /// let x = PscAutoConnectionConfig::new().set_consumer_project("example");
22773 /// ```
22774 pub fn set_consumer_project<T: std::convert::Into<std::string::String>>(
22775 mut self,
22776 v: T,
22777 ) -> Self {
22778 self.consumer_project = v.into();
22779 self
22780 }
22781
22782 /// Sets the value of [consumer_network][crate::model::PscAutoConnectionConfig::consumer_network].
22783 ///
22784 /// # Example
22785 /// ```ignore,no_run
22786 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22787 /// let x = PscAutoConnectionConfig::new().set_consumer_network("example");
22788 /// ```
22789 pub fn set_consumer_network<T: std::convert::Into<std::string::String>>(
22790 mut self,
22791 v: T,
22792 ) -> Self {
22793 self.consumer_network = v.into();
22794 self
22795 }
22796
22797 /// Sets the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
22798 ///
22799 /// # Example
22800 /// ```ignore,no_run
22801 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22802 /// let x = PscAutoConnectionConfig::new().set_ip_address("example");
22803 /// ```
22804 pub fn set_ip_address<T>(mut self, v: T) -> Self
22805 where
22806 T: std::convert::Into<std::string::String>,
22807 {
22808 self.ip_address = std::option::Option::Some(v.into());
22809 self
22810 }
22811
22812 /// Sets or clears the value of [ip_address][crate::model::PscAutoConnectionConfig::ip_address].
22813 ///
22814 /// # Example
22815 /// ```ignore,no_run
22816 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22817 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(Some("example"));
22818 /// let x = PscAutoConnectionConfig::new().set_or_clear_ip_address(None::<String>);
22819 /// ```
22820 pub fn set_or_clear_ip_address<T>(mut self, v: std::option::Option<T>) -> Self
22821 where
22822 T: std::convert::Into<std::string::String>,
22823 {
22824 self.ip_address = v.map(|x| x.into());
22825 self
22826 }
22827
22828 /// Sets the value of [status][crate::model::PscAutoConnectionConfig::status].
22829 ///
22830 /// # Example
22831 /// ```ignore,no_run
22832 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22833 /// let x = PscAutoConnectionConfig::new().set_status("example");
22834 /// ```
22835 pub fn set_status<T>(mut self, v: T) -> Self
22836 where
22837 T: std::convert::Into<std::string::String>,
22838 {
22839 self.status = std::option::Option::Some(v.into());
22840 self
22841 }
22842
22843 /// Sets or clears the value of [status][crate::model::PscAutoConnectionConfig::status].
22844 ///
22845 /// # Example
22846 /// ```ignore,no_run
22847 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22848 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(Some("example"));
22849 /// let x = PscAutoConnectionConfig::new().set_or_clear_status(None::<String>);
22850 /// ```
22851 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
22852 where
22853 T: std::convert::Into<std::string::String>,
22854 {
22855 self.status = v.map(|x| x.into());
22856 self
22857 }
22858
22859 /// Sets the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
22860 ///
22861 /// # Example
22862 /// ```ignore,no_run
22863 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22864 /// let x = PscAutoConnectionConfig::new().set_consumer_network_status("example");
22865 /// ```
22866 pub fn set_consumer_network_status<T>(mut self, v: T) -> Self
22867 where
22868 T: std::convert::Into<std::string::String>,
22869 {
22870 self.consumer_network_status = std::option::Option::Some(v.into());
22871 self
22872 }
22873
22874 /// Sets or clears the value of [consumer_network_status][crate::model::PscAutoConnectionConfig::consumer_network_status].
22875 ///
22876 /// # Example
22877 /// ```ignore,no_run
22878 /// # use google_cloud_sql_v1::model::PscAutoConnectionConfig;
22879 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(Some("example"));
22880 /// let x = PscAutoConnectionConfig::new().set_or_clear_consumer_network_status(None::<String>);
22881 /// ```
22882 pub fn set_or_clear_consumer_network_status<T>(mut self, v: std::option::Option<T>) -> Self
22883 where
22884 T: std::convert::Into<std::string::String>,
22885 {
22886 self.consumer_network_status = v.map(|x| x.into());
22887 self
22888 }
22889}
22890
22891impl wkt::message::Message for PscAutoConnectionConfig {
22892 fn typename() -> &'static str {
22893 "type.googleapis.com/google.cloud.sql.v1.PscAutoConnectionConfig"
22894 }
22895}
22896
22897/// Preferred location. This specifies where a Cloud SQL instance is located.
22898/// Note that if the preferred location is not available, the instance will be
22899/// located as close as possible within the region. Only one location may be
22900/// specified.
22901#[derive(Clone, Default, PartialEq)]
22902#[non_exhaustive]
22903pub struct LocationPreference {
22904 /// The App Engine application to follow, it must be in the same region as the
22905 /// Cloud SQL instance. WARNING: Changing this might restart the instance.
22906 #[deprecated]
22907 pub follow_gae_application: std::string::String,
22908
22909 /// The preferred Compute Engine zone (for example: us-central1-a,
22910 /// us-central1-b, etc.). WARNING: Changing this might restart the instance.
22911 pub zone: std::string::String,
22912
22913 /// The preferred Compute Engine zone for the secondary/failover
22914 /// (for example: us-central1-a, us-central1-b, etc.).
22915 /// To disable this field, set it to 'no_secondary_zone'.
22916 pub secondary_zone: std::string::String,
22917
22918 /// This is always `sql#locationPreference`.
22919 pub kind: std::string::String,
22920
22921 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
22922}
22923
22924impl LocationPreference {
22925 pub fn new() -> Self {
22926 std::default::Default::default()
22927 }
22928
22929 /// Sets the value of [follow_gae_application][crate::model::LocationPreference::follow_gae_application].
22930 ///
22931 /// # Example
22932 /// ```ignore,no_run
22933 /// # use google_cloud_sql_v1::model::LocationPreference;
22934 /// let x = LocationPreference::new().set_follow_gae_application("example");
22935 /// ```
22936 #[deprecated]
22937 pub fn set_follow_gae_application<T: std::convert::Into<std::string::String>>(
22938 mut self,
22939 v: T,
22940 ) -> Self {
22941 self.follow_gae_application = v.into();
22942 self
22943 }
22944
22945 /// Sets the value of [zone][crate::model::LocationPreference::zone].
22946 ///
22947 /// # Example
22948 /// ```ignore,no_run
22949 /// # use google_cloud_sql_v1::model::LocationPreference;
22950 /// let x = LocationPreference::new().set_zone("example");
22951 /// ```
22952 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22953 self.zone = v.into();
22954 self
22955 }
22956
22957 /// Sets the value of [secondary_zone][crate::model::LocationPreference::secondary_zone].
22958 ///
22959 /// # Example
22960 /// ```ignore,no_run
22961 /// # use google_cloud_sql_v1::model::LocationPreference;
22962 /// let x = LocationPreference::new().set_secondary_zone("example");
22963 /// ```
22964 pub fn set_secondary_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22965 self.secondary_zone = v.into();
22966 self
22967 }
22968
22969 /// Sets the value of [kind][crate::model::LocationPreference::kind].
22970 ///
22971 /// # Example
22972 /// ```ignore,no_run
22973 /// # use google_cloud_sql_v1::model::LocationPreference;
22974 /// let x = LocationPreference::new().set_kind("example");
22975 /// ```
22976 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
22977 self.kind = v.into();
22978 self
22979 }
22980}
22981
22982impl wkt::message::Message for LocationPreference {
22983 fn typename() -> &'static str {
22984 "type.googleapis.com/google.cloud.sql.v1.LocationPreference"
22985 }
22986}
22987
22988/// Maintenance window. This specifies when a Cloud SQL instance is
22989/// restarted for system maintenance purposes.
22990#[derive(Clone, Default, PartialEq)]
22991#[non_exhaustive]
22992pub struct MaintenanceWindow {
22993 /// Hour of day - 0 to 23. Specify in the UTC time zone.
22994 pub hour: std::option::Option<wkt::Int32Value>,
22995
22996 /// Day of week - `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`,
22997 /// `SATURDAY`, or `SUNDAY`. Specify in the UTC time zone.
22998 /// Returned in output as an integer, 1 to 7, where `1` equals Monday.
22999 pub day: std::option::Option<wkt::Int32Value>,
23000
23001 /// Maintenance timing settings: `canary`, `stable`, or `week5`.
23002 /// For more information, see [About maintenance on Cloud SQL
23003 /// instances](https://cloud.google.com/sql/docs/mysql/maintenance).
23004 pub update_track: crate::model::SqlUpdateTrack,
23005
23006 /// This is always `sql#maintenanceWindow`.
23007 pub kind: std::string::String,
23008
23009 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23010}
23011
23012impl MaintenanceWindow {
23013 pub fn new() -> Self {
23014 std::default::Default::default()
23015 }
23016
23017 /// Sets the value of [hour][crate::model::MaintenanceWindow::hour].
23018 ///
23019 /// # Example
23020 /// ```ignore,no_run
23021 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23022 /// use wkt::Int32Value;
23023 /// let x = MaintenanceWindow::new().set_hour(Int32Value::default()/* use setters */);
23024 /// ```
23025 pub fn set_hour<T>(mut self, v: T) -> Self
23026 where
23027 T: std::convert::Into<wkt::Int32Value>,
23028 {
23029 self.hour = std::option::Option::Some(v.into());
23030 self
23031 }
23032
23033 /// Sets or clears the value of [hour][crate::model::MaintenanceWindow::hour].
23034 ///
23035 /// # Example
23036 /// ```ignore,no_run
23037 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23038 /// use wkt::Int32Value;
23039 /// let x = MaintenanceWindow::new().set_or_clear_hour(Some(Int32Value::default()/* use setters */));
23040 /// let x = MaintenanceWindow::new().set_or_clear_hour(None::<Int32Value>);
23041 /// ```
23042 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
23043 where
23044 T: std::convert::Into<wkt::Int32Value>,
23045 {
23046 self.hour = v.map(|x| x.into());
23047 self
23048 }
23049
23050 /// Sets the value of [day][crate::model::MaintenanceWindow::day].
23051 ///
23052 /// # Example
23053 /// ```ignore,no_run
23054 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23055 /// use wkt::Int32Value;
23056 /// let x = MaintenanceWindow::new().set_day(Int32Value::default()/* use setters */);
23057 /// ```
23058 pub fn set_day<T>(mut self, v: T) -> Self
23059 where
23060 T: std::convert::Into<wkt::Int32Value>,
23061 {
23062 self.day = std::option::Option::Some(v.into());
23063 self
23064 }
23065
23066 /// Sets or clears the value of [day][crate::model::MaintenanceWindow::day].
23067 ///
23068 /// # Example
23069 /// ```ignore,no_run
23070 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23071 /// use wkt::Int32Value;
23072 /// let x = MaintenanceWindow::new().set_or_clear_day(Some(Int32Value::default()/* use setters */));
23073 /// let x = MaintenanceWindow::new().set_or_clear_day(None::<Int32Value>);
23074 /// ```
23075 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
23076 where
23077 T: std::convert::Into<wkt::Int32Value>,
23078 {
23079 self.day = v.map(|x| x.into());
23080 self
23081 }
23082
23083 /// Sets the value of [update_track][crate::model::MaintenanceWindow::update_track].
23084 ///
23085 /// # Example
23086 /// ```ignore,no_run
23087 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23088 /// use google_cloud_sql_v1::model::SqlUpdateTrack;
23089 /// let x0 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Canary);
23090 /// let x1 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Stable);
23091 /// let x2 = MaintenanceWindow::new().set_update_track(SqlUpdateTrack::Week5);
23092 /// ```
23093 pub fn set_update_track<T: std::convert::Into<crate::model::SqlUpdateTrack>>(
23094 mut self,
23095 v: T,
23096 ) -> Self {
23097 self.update_track = v.into();
23098 self
23099 }
23100
23101 /// Sets the value of [kind][crate::model::MaintenanceWindow::kind].
23102 ///
23103 /// # Example
23104 /// ```ignore,no_run
23105 /// # use google_cloud_sql_v1::model::MaintenanceWindow;
23106 /// let x = MaintenanceWindow::new().set_kind("example");
23107 /// ```
23108 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23109 self.kind = v.into();
23110 self
23111 }
23112}
23113
23114impl wkt::message::Message for MaintenanceWindow {
23115 fn typename() -> &'static str {
23116 "type.googleapis.com/google.cloud.sql.v1.MaintenanceWindow"
23117 }
23118}
23119
23120/// Deny maintenance Periods. This specifies a date range during when all CSA
23121/// rollout will be denied.
23122#[derive(Clone, Default, PartialEq)]
23123#[non_exhaustive]
23124pub struct DenyMaintenancePeriod {
23125 /// "deny maintenance period" start date. If the year of the start date is
23126 /// empty, the year of the end date also must be empty. In this case, it means
23127 /// the deny maintenance period recurs every year. The date is in format
23128 /// yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01
23129 pub start_date: std::string::String,
23130
23131 /// "deny maintenance period" end date. If the year of the end date is empty,
23132 /// the year of the start date also must be empty. In this case, it means the
23133 /// no maintenance interval recurs every year. The date is in format yyyy-mm-dd
23134 /// i.e., 2020-11-01, or mm-dd, i.e., 11-01
23135 pub end_date: std::string::String,
23136
23137 /// Time in UTC when the "deny maintenance period" starts on start_date and
23138 /// ends on end_date. The time is in format: HH:mm:SS, i.e., 00:00:00
23139 pub time: std::string::String,
23140
23141 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23142}
23143
23144impl DenyMaintenancePeriod {
23145 pub fn new() -> Self {
23146 std::default::Default::default()
23147 }
23148
23149 /// Sets the value of [start_date][crate::model::DenyMaintenancePeriod::start_date].
23150 ///
23151 /// # Example
23152 /// ```ignore,no_run
23153 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23154 /// let x = DenyMaintenancePeriod::new().set_start_date("example");
23155 /// ```
23156 pub fn set_start_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23157 self.start_date = v.into();
23158 self
23159 }
23160
23161 /// Sets the value of [end_date][crate::model::DenyMaintenancePeriod::end_date].
23162 ///
23163 /// # Example
23164 /// ```ignore,no_run
23165 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23166 /// let x = DenyMaintenancePeriod::new().set_end_date("example");
23167 /// ```
23168 pub fn set_end_date<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23169 self.end_date = v.into();
23170 self
23171 }
23172
23173 /// Sets the value of [time][crate::model::DenyMaintenancePeriod::time].
23174 ///
23175 /// # Example
23176 /// ```ignore,no_run
23177 /// # use google_cloud_sql_v1::model::DenyMaintenancePeriod;
23178 /// let x = DenyMaintenancePeriod::new().set_time("example");
23179 /// ```
23180 pub fn set_time<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23181 self.time = v.into();
23182 self
23183 }
23184}
23185
23186impl wkt::message::Message for DenyMaintenancePeriod {
23187 fn typename() -> &'static str {
23188 "type.googleapis.com/google.cloud.sql.v1.DenyMaintenancePeriod"
23189 }
23190}
23191
23192/// Insights configuration. This specifies when Cloud SQL Insights feature is
23193/// enabled and optional configuration.
23194#[derive(Clone, Default, PartialEq)]
23195#[non_exhaustive]
23196pub struct InsightsConfig {
23197 /// Whether Query Insights feature is enabled.
23198 pub query_insights_enabled: bool,
23199
23200 /// Whether Query Insights will record client address when enabled.
23201 pub record_client_address: bool,
23202
23203 /// Whether Query Insights will record application tags from query when
23204 /// enabled.
23205 pub record_application_tags: bool,
23206
23207 /// Maximum query length stored in bytes. Default value: 1024 bytes.
23208 /// Range: 256-4500 bytes. Query lengths greater than this field value will be
23209 /// truncated to this value. When unset, query length will be the default
23210 /// value. Changing query length will restart the database.
23211 pub query_string_length: std::option::Option<wkt::Int32Value>,
23212
23213 /// Number of query execution plans captured by Insights per minute
23214 /// for all queries combined. Default is 5.
23215 pub query_plans_per_minute: std::option::Option<wkt::Int32Value>,
23216
23217 /// Optional. Whether enhanced query insights feature is enabled.
23218 pub enhanced_query_insights_enabled: std::option::Option<wkt::BoolValue>,
23219
23220 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23221}
23222
23223impl InsightsConfig {
23224 pub fn new() -> Self {
23225 std::default::Default::default()
23226 }
23227
23228 /// Sets the value of [query_insights_enabled][crate::model::InsightsConfig::query_insights_enabled].
23229 ///
23230 /// # Example
23231 /// ```ignore,no_run
23232 /// # use google_cloud_sql_v1::model::InsightsConfig;
23233 /// let x = InsightsConfig::new().set_query_insights_enabled(true);
23234 /// ```
23235 pub fn set_query_insights_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23236 self.query_insights_enabled = v.into();
23237 self
23238 }
23239
23240 /// Sets the value of [record_client_address][crate::model::InsightsConfig::record_client_address].
23241 ///
23242 /// # Example
23243 /// ```ignore,no_run
23244 /// # use google_cloud_sql_v1::model::InsightsConfig;
23245 /// let x = InsightsConfig::new().set_record_client_address(true);
23246 /// ```
23247 pub fn set_record_client_address<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23248 self.record_client_address = v.into();
23249 self
23250 }
23251
23252 /// Sets the value of [record_application_tags][crate::model::InsightsConfig::record_application_tags].
23253 ///
23254 /// # Example
23255 /// ```ignore,no_run
23256 /// # use google_cloud_sql_v1::model::InsightsConfig;
23257 /// let x = InsightsConfig::new().set_record_application_tags(true);
23258 /// ```
23259 pub fn set_record_application_tags<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
23260 self.record_application_tags = v.into();
23261 self
23262 }
23263
23264 /// Sets the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23265 ///
23266 /// # Example
23267 /// ```ignore,no_run
23268 /// # use google_cloud_sql_v1::model::InsightsConfig;
23269 /// use wkt::Int32Value;
23270 /// let x = InsightsConfig::new().set_query_string_length(Int32Value::default()/* use setters */);
23271 /// ```
23272 pub fn set_query_string_length<T>(mut self, v: T) -> Self
23273 where
23274 T: std::convert::Into<wkt::Int32Value>,
23275 {
23276 self.query_string_length = std::option::Option::Some(v.into());
23277 self
23278 }
23279
23280 /// Sets or clears the value of [query_string_length][crate::model::InsightsConfig::query_string_length].
23281 ///
23282 /// # Example
23283 /// ```ignore,no_run
23284 /// # use google_cloud_sql_v1::model::InsightsConfig;
23285 /// use wkt::Int32Value;
23286 /// let x = InsightsConfig::new().set_or_clear_query_string_length(Some(Int32Value::default()/* use setters */));
23287 /// let x = InsightsConfig::new().set_or_clear_query_string_length(None::<Int32Value>);
23288 /// ```
23289 pub fn set_or_clear_query_string_length<T>(mut self, v: std::option::Option<T>) -> Self
23290 where
23291 T: std::convert::Into<wkt::Int32Value>,
23292 {
23293 self.query_string_length = v.map(|x| x.into());
23294 self
23295 }
23296
23297 /// Sets the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23298 ///
23299 /// # Example
23300 /// ```ignore,no_run
23301 /// # use google_cloud_sql_v1::model::InsightsConfig;
23302 /// use wkt::Int32Value;
23303 /// let x = InsightsConfig::new().set_query_plans_per_minute(Int32Value::default()/* use setters */);
23304 /// ```
23305 pub fn set_query_plans_per_minute<T>(mut self, v: T) -> Self
23306 where
23307 T: std::convert::Into<wkt::Int32Value>,
23308 {
23309 self.query_plans_per_minute = std::option::Option::Some(v.into());
23310 self
23311 }
23312
23313 /// Sets or clears the value of [query_plans_per_minute][crate::model::InsightsConfig::query_plans_per_minute].
23314 ///
23315 /// # Example
23316 /// ```ignore,no_run
23317 /// # use google_cloud_sql_v1::model::InsightsConfig;
23318 /// use wkt::Int32Value;
23319 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(Some(Int32Value::default()/* use setters */));
23320 /// let x = InsightsConfig::new().set_or_clear_query_plans_per_minute(None::<Int32Value>);
23321 /// ```
23322 pub fn set_or_clear_query_plans_per_minute<T>(mut self, v: std::option::Option<T>) -> Self
23323 where
23324 T: std::convert::Into<wkt::Int32Value>,
23325 {
23326 self.query_plans_per_minute = v.map(|x| x.into());
23327 self
23328 }
23329
23330 /// Sets the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23331 ///
23332 /// # Example
23333 /// ```ignore,no_run
23334 /// # use google_cloud_sql_v1::model::InsightsConfig;
23335 /// use wkt::BoolValue;
23336 /// let x = InsightsConfig::new().set_enhanced_query_insights_enabled(BoolValue::default()/* use setters */);
23337 /// ```
23338 pub fn set_enhanced_query_insights_enabled<T>(mut self, v: T) -> Self
23339 where
23340 T: std::convert::Into<wkt::BoolValue>,
23341 {
23342 self.enhanced_query_insights_enabled = std::option::Option::Some(v.into());
23343 self
23344 }
23345
23346 /// Sets or clears the value of [enhanced_query_insights_enabled][crate::model::InsightsConfig::enhanced_query_insights_enabled].
23347 ///
23348 /// # Example
23349 /// ```ignore,no_run
23350 /// # use google_cloud_sql_v1::model::InsightsConfig;
23351 /// use wkt::BoolValue;
23352 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(Some(BoolValue::default()/* use setters */));
23353 /// let x = InsightsConfig::new().set_or_clear_enhanced_query_insights_enabled(None::<BoolValue>);
23354 /// ```
23355 pub fn set_or_clear_enhanced_query_insights_enabled<T>(
23356 mut self,
23357 v: std::option::Option<T>,
23358 ) -> Self
23359 where
23360 T: std::convert::Into<wkt::BoolValue>,
23361 {
23362 self.enhanced_query_insights_enabled = v.map(|x| x.into());
23363 self
23364 }
23365}
23366
23367impl wkt::message::Message for InsightsConfig {
23368 fn typename() -> &'static str {
23369 "type.googleapis.com/google.cloud.sql.v1.InsightsConfig"
23370 }
23371}
23372
23373/// Read-replica configuration specific to MySQL databases.
23374#[derive(Clone, Default, PartialEq)]
23375#[non_exhaustive]
23376pub struct MySqlReplicaConfiguration {
23377 /// Path to a SQL dump file in Google Cloud Storage from which the replica
23378 /// instance is to be created. The URI is in the form gs://bucketName/fileName.
23379 /// Compressed gzip files (.gz) are also supported.
23380 /// Dumps have the binlog co-ordinates from which replication
23381 /// begins. This can be accomplished by setting --master-data to 1 when using
23382 /// mysqldump.
23383 pub dump_file_path: std::string::String,
23384
23385 /// The username for the replication connection.
23386 pub username: std::string::String,
23387
23388 /// The password for the replication connection.
23389 pub password: std::string::String,
23390
23391 /// Seconds to wait between connect retries. MySQL's default is 60 seconds.
23392 pub connect_retry_interval: std::option::Option<wkt::Int32Value>,
23393
23394 /// Interval in milliseconds between replication heartbeats.
23395 pub master_heartbeat_period: std::option::Option<wkt::Int64Value>,
23396
23397 /// PEM representation of the trusted CA's x509 certificate.
23398 pub ca_certificate: std::string::String,
23399
23400 /// PEM representation of the replica's x509 certificate.
23401 pub client_certificate: std::string::String,
23402
23403 /// PEM representation of the replica's private key. The corresponding public
23404 /// key is encoded in the client's certificate.
23405 pub client_key: std::string::String,
23406
23407 /// A list of permissible ciphers to use for SSL encryption.
23408 pub ssl_cipher: std::string::String,
23409
23410 /// Whether or not to check the primary instance's Common Name value in the
23411 /// certificate that it sends during the SSL handshake.
23412 pub verify_server_certificate: std::option::Option<wkt::BoolValue>,
23413
23414 /// This is always `sql#mysqlReplicaConfiguration`.
23415 pub kind: std::string::String,
23416
23417 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23418}
23419
23420impl MySqlReplicaConfiguration {
23421 pub fn new() -> Self {
23422 std::default::Default::default()
23423 }
23424
23425 /// Sets the value of [dump_file_path][crate::model::MySqlReplicaConfiguration::dump_file_path].
23426 ///
23427 /// # Example
23428 /// ```ignore,no_run
23429 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23430 /// let x = MySqlReplicaConfiguration::new().set_dump_file_path("example");
23431 /// ```
23432 pub fn set_dump_file_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23433 self.dump_file_path = v.into();
23434 self
23435 }
23436
23437 /// Sets the value of [username][crate::model::MySqlReplicaConfiguration::username].
23438 ///
23439 /// # Example
23440 /// ```ignore,no_run
23441 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23442 /// let x = MySqlReplicaConfiguration::new().set_username("example");
23443 /// ```
23444 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23445 self.username = v.into();
23446 self
23447 }
23448
23449 /// Sets the value of [password][crate::model::MySqlReplicaConfiguration::password].
23450 ///
23451 /// # Example
23452 /// ```ignore,no_run
23453 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23454 /// let x = MySqlReplicaConfiguration::new().set_password("example");
23455 /// ```
23456 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23457 self.password = v.into();
23458 self
23459 }
23460
23461 /// Sets the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23462 ///
23463 /// # Example
23464 /// ```ignore,no_run
23465 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23466 /// use wkt::Int32Value;
23467 /// let x = MySqlReplicaConfiguration::new().set_connect_retry_interval(Int32Value::default()/* use setters */);
23468 /// ```
23469 pub fn set_connect_retry_interval<T>(mut self, v: T) -> Self
23470 where
23471 T: std::convert::Into<wkt::Int32Value>,
23472 {
23473 self.connect_retry_interval = std::option::Option::Some(v.into());
23474 self
23475 }
23476
23477 /// Sets or clears the value of [connect_retry_interval][crate::model::MySqlReplicaConfiguration::connect_retry_interval].
23478 ///
23479 /// # Example
23480 /// ```ignore,no_run
23481 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23482 /// use wkt::Int32Value;
23483 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(Some(Int32Value::default()/* use setters */));
23484 /// let x = MySqlReplicaConfiguration::new().set_or_clear_connect_retry_interval(None::<Int32Value>);
23485 /// ```
23486 pub fn set_or_clear_connect_retry_interval<T>(mut self, v: std::option::Option<T>) -> Self
23487 where
23488 T: std::convert::Into<wkt::Int32Value>,
23489 {
23490 self.connect_retry_interval = v.map(|x| x.into());
23491 self
23492 }
23493
23494 /// Sets the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23495 ///
23496 /// # Example
23497 /// ```ignore,no_run
23498 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23499 /// use wkt::Int64Value;
23500 /// let x = MySqlReplicaConfiguration::new().set_master_heartbeat_period(Int64Value::default()/* use setters */);
23501 /// ```
23502 pub fn set_master_heartbeat_period<T>(mut self, v: T) -> Self
23503 where
23504 T: std::convert::Into<wkt::Int64Value>,
23505 {
23506 self.master_heartbeat_period = std::option::Option::Some(v.into());
23507 self
23508 }
23509
23510 /// Sets or clears the value of [master_heartbeat_period][crate::model::MySqlReplicaConfiguration::master_heartbeat_period].
23511 ///
23512 /// # Example
23513 /// ```ignore,no_run
23514 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23515 /// use wkt::Int64Value;
23516 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(Some(Int64Value::default()/* use setters */));
23517 /// let x = MySqlReplicaConfiguration::new().set_or_clear_master_heartbeat_period(None::<Int64Value>);
23518 /// ```
23519 pub fn set_or_clear_master_heartbeat_period<T>(mut self, v: std::option::Option<T>) -> Self
23520 where
23521 T: std::convert::Into<wkt::Int64Value>,
23522 {
23523 self.master_heartbeat_period = v.map(|x| x.into());
23524 self
23525 }
23526
23527 /// Sets the value of [ca_certificate][crate::model::MySqlReplicaConfiguration::ca_certificate].
23528 ///
23529 /// # Example
23530 /// ```ignore,no_run
23531 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23532 /// let x = MySqlReplicaConfiguration::new().set_ca_certificate("example");
23533 /// ```
23534 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23535 self.ca_certificate = v.into();
23536 self
23537 }
23538
23539 /// Sets the value of [client_certificate][crate::model::MySqlReplicaConfiguration::client_certificate].
23540 ///
23541 /// # Example
23542 /// ```ignore,no_run
23543 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23544 /// let x = MySqlReplicaConfiguration::new().set_client_certificate("example");
23545 /// ```
23546 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
23547 mut self,
23548 v: T,
23549 ) -> Self {
23550 self.client_certificate = v.into();
23551 self
23552 }
23553
23554 /// Sets the value of [client_key][crate::model::MySqlReplicaConfiguration::client_key].
23555 ///
23556 /// # Example
23557 /// ```ignore,no_run
23558 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23559 /// let x = MySqlReplicaConfiguration::new().set_client_key("example");
23560 /// ```
23561 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23562 self.client_key = v.into();
23563 self
23564 }
23565
23566 /// Sets the value of [ssl_cipher][crate::model::MySqlReplicaConfiguration::ssl_cipher].
23567 ///
23568 /// # Example
23569 /// ```ignore,no_run
23570 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23571 /// let x = MySqlReplicaConfiguration::new().set_ssl_cipher("example");
23572 /// ```
23573 pub fn set_ssl_cipher<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23574 self.ssl_cipher = v.into();
23575 self
23576 }
23577
23578 /// Sets the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23579 ///
23580 /// # Example
23581 /// ```ignore,no_run
23582 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23583 /// use wkt::BoolValue;
23584 /// let x = MySqlReplicaConfiguration::new().set_verify_server_certificate(BoolValue::default()/* use setters */);
23585 /// ```
23586 pub fn set_verify_server_certificate<T>(mut self, v: T) -> Self
23587 where
23588 T: std::convert::Into<wkt::BoolValue>,
23589 {
23590 self.verify_server_certificate = std::option::Option::Some(v.into());
23591 self
23592 }
23593
23594 /// Sets or clears the value of [verify_server_certificate][crate::model::MySqlReplicaConfiguration::verify_server_certificate].
23595 ///
23596 /// # Example
23597 /// ```ignore,no_run
23598 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23599 /// use wkt::BoolValue;
23600 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(Some(BoolValue::default()/* use setters */));
23601 /// let x = MySqlReplicaConfiguration::new().set_or_clear_verify_server_certificate(None::<BoolValue>);
23602 /// ```
23603 pub fn set_or_clear_verify_server_certificate<T>(mut self, v: std::option::Option<T>) -> Self
23604 where
23605 T: std::convert::Into<wkt::BoolValue>,
23606 {
23607 self.verify_server_certificate = v.map(|x| x.into());
23608 self
23609 }
23610
23611 /// Sets the value of [kind][crate::model::MySqlReplicaConfiguration::kind].
23612 ///
23613 /// # Example
23614 /// ```ignore,no_run
23615 /// # use google_cloud_sql_v1::model::MySqlReplicaConfiguration;
23616 /// let x = MySqlReplicaConfiguration::new().set_kind("example");
23617 /// ```
23618 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23619 self.kind = v.into();
23620 self
23621 }
23622}
23623
23624impl wkt::message::Message for MySqlReplicaConfiguration {
23625 fn typename() -> &'static str {
23626 "type.googleapis.com/google.cloud.sql.v1.MySqlReplicaConfiguration"
23627 }
23628}
23629
23630/// Disk encryption configuration for an instance.
23631#[derive(Clone, Default, PartialEq)]
23632#[non_exhaustive]
23633pub struct DiskEncryptionConfiguration {
23634 /// Resource name of KMS key for disk encryption
23635 pub kms_key_name: std::string::String,
23636
23637 /// This is always `sql#diskEncryptionConfiguration`.
23638 pub kind: std::string::String,
23639
23640 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23641}
23642
23643impl DiskEncryptionConfiguration {
23644 pub fn new() -> Self {
23645 std::default::Default::default()
23646 }
23647
23648 /// Sets the value of [kms_key_name][crate::model::DiskEncryptionConfiguration::kms_key_name].
23649 ///
23650 /// # Example
23651 /// ```ignore,no_run
23652 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23653 /// let x = DiskEncryptionConfiguration::new().set_kms_key_name("example");
23654 /// ```
23655 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23656 self.kms_key_name = v.into();
23657 self
23658 }
23659
23660 /// Sets the value of [kind][crate::model::DiskEncryptionConfiguration::kind].
23661 ///
23662 /// # Example
23663 /// ```ignore,no_run
23664 /// # use google_cloud_sql_v1::model::DiskEncryptionConfiguration;
23665 /// let x = DiskEncryptionConfiguration::new().set_kind("example");
23666 /// ```
23667 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23668 self.kind = v.into();
23669 self
23670 }
23671}
23672
23673impl wkt::message::Message for DiskEncryptionConfiguration {
23674 fn typename() -> &'static str {
23675 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionConfiguration"
23676 }
23677}
23678
23679/// Disk encryption status for an instance.
23680#[derive(Clone, Default, PartialEq)]
23681#[non_exhaustive]
23682pub struct DiskEncryptionStatus {
23683 /// KMS key version used to encrypt the Cloud SQL instance resource
23684 pub kms_key_version_name: std::string::String,
23685
23686 /// This is always `sql#diskEncryptionStatus`.
23687 pub kind: std::string::String,
23688
23689 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23690}
23691
23692impl DiskEncryptionStatus {
23693 pub fn new() -> Self {
23694 std::default::Default::default()
23695 }
23696
23697 /// Sets the value of [kms_key_version_name][crate::model::DiskEncryptionStatus::kms_key_version_name].
23698 ///
23699 /// # Example
23700 /// ```ignore,no_run
23701 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23702 /// let x = DiskEncryptionStatus::new().set_kms_key_version_name("example");
23703 /// ```
23704 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
23705 mut self,
23706 v: T,
23707 ) -> Self {
23708 self.kms_key_version_name = v.into();
23709 self
23710 }
23711
23712 /// Sets the value of [kind][crate::model::DiskEncryptionStatus::kind].
23713 ///
23714 /// # Example
23715 /// ```ignore,no_run
23716 /// # use google_cloud_sql_v1::model::DiskEncryptionStatus;
23717 /// let x = DiskEncryptionStatus::new().set_kind("example");
23718 /// ```
23719 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23720 self.kind = v.into();
23721 self
23722 }
23723}
23724
23725impl wkt::message::Message for DiskEncryptionStatus {
23726 fn typename() -> &'static str {
23727 "type.googleapis.com/google.cloud.sql.v1.DiskEncryptionStatus"
23728 }
23729}
23730
23731/// Database instance IP mapping
23732#[derive(Clone, Default, PartialEq)]
23733#[non_exhaustive]
23734pub struct IpMapping {
23735 /// The type of this IP address. A `PRIMARY` address is a public address that
23736 /// can accept incoming connections. A `PRIVATE` address is a private address
23737 /// that can accept incoming connections. An `OUTGOING` address is the source
23738 /// address of connections originating from the instance, if supported.
23739 pub r#type: crate::model::SqlIpAddressType,
23740
23741 /// The IP address assigned.
23742 pub ip_address: std::string::String,
23743
23744 /// The due time for this IP to be retired in
23745 /// [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example
23746 /// `2012-11-15T16:19:00.094Z`. This field is only available when
23747 /// the IP is scheduled to be retired.
23748 pub time_to_retire: std::option::Option<wkt::Timestamp>,
23749
23750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23751}
23752
23753impl IpMapping {
23754 pub fn new() -> Self {
23755 std::default::Default::default()
23756 }
23757
23758 /// Sets the value of [r#type][crate::model::IpMapping::type].
23759 ///
23760 /// # Example
23761 /// ```ignore,no_run
23762 /// # use google_cloud_sql_v1::model::IpMapping;
23763 /// use google_cloud_sql_v1::model::SqlIpAddressType;
23764 /// let x0 = IpMapping::new().set_type(SqlIpAddressType::Primary);
23765 /// let x1 = IpMapping::new().set_type(SqlIpAddressType::Outgoing);
23766 /// let x2 = IpMapping::new().set_type(SqlIpAddressType::Private);
23767 /// ```
23768 pub fn set_type<T: std::convert::Into<crate::model::SqlIpAddressType>>(mut self, v: T) -> Self {
23769 self.r#type = v.into();
23770 self
23771 }
23772
23773 /// Sets the value of [ip_address][crate::model::IpMapping::ip_address].
23774 ///
23775 /// # Example
23776 /// ```ignore,no_run
23777 /// # use google_cloud_sql_v1::model::IpMapping;
23778 /// let x = IpMapping::new().set_ip_address("example");
23779 /// ```
23780 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
23781 self.ip_address = v.into();
23782 self
23783 }
23784
23785 /// Sets the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
23786 ///
23787 /// # Example
23788 /// ```ignore,no_run
23789 /// # use google_cloud_sql_v1::model::IpMapping;
23790 /// use wkt::Timestamp;
23791 /// let x = IpMapping::new().set_time_to_retire(Timestamp::default()/* use setters */);
23792 /// ```
23793 pub fn set_time_to_retire<T>(mut self, v: T) -> Self
23794 where
23795 T: std::convert::Into<wkt::Timestamp>,
23796 {
23797 self.time_to_retire = std::option::Option::Some(v.into());
23798 self
23799 }
23800
23801 /// Sets or clears the value of [time_to_retire][crate::model::IpMapping::time_to_retire].
23802 ///
23803 /// # Example
23804 /// ```ignore,no_run
23805 /// # use google_cloud_sql_v1::model::IpMapping;
23806 /// use wkt::Timestamp;
23807 /// let x = IpMapping::new().set_or_clear_time_to_retire(Some(Timestamp::default()/* use setters */));
23808 /// let x = IpMapping::new().set_or_clear_time_to_retire(None::<Timestamp>);
23809 /// ```
23810 pub fn set_or_clear_time_to_retire<T>(mut self, v: std::option::Option<T>) -> Self
23811 where
23812 T: std::convert::Into<wkt::Timestamp>,
23813 {
23814 self.time_to_retire = v.map(|x| x.into());
23815 self
23816 }
23817}
23818
23819impl wkt::message::Message for IpMapping {
23820 fn typename() -> &'static str {
23821 "type.googleapis.com/google.cloud.sql.v1.IpMapping"
23822 }
23823}
23824
23825/// The sub operation type based on the operation type.
23826#[derive(Clone, Default, PartialEq)]
23827#[non_exhaustive]
23828pub struct SqlSubOperationType {
23829 /// Sub operation details corresponding to the operation type.
23830 pub sub_operation_details:
23831 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
23832
23833 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
23834}
23835
23836impl SqlSubOperationType {
23837 pub fn new() -> Self {
23838 std::default::Default::default()
23839 }
23840
23841 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details].
23842 ///
23843 /// Note that all the setters affecting `sub_operation_details` are mutually
23844 /// exclusive.
23845 ///
23846 /// # Example
23847 /// ```ignore,no_run
23848 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
23849 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
23850 /// let x0 = SqlSubOperationType::new().set_sub_operation_details(Some(
23851 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceMaintenance)));
23852 /// let x1 = SqlSubOperationType::new().set_sub_operation_details(Some(
23853 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::ReplicaIncludedMaintenance)));
23854 /// let x2 = SqlSubOperationType::new().set_sub_operation_details(Some(
23855 /// google_cloud_sql_v1::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(SqlMaintenanceType::InstanceSelfServiceMaintenance)));
23856 /// ```
23857 pub fn set_sub_operation_details<
23858 T: std::convert::Into<
23859 std::option::Option<crate::model::sql_sub_operation_type::SubOperationDetails>,
23860 >,
23861 >(
23862 mut self,
23863 v: T,
23864 ) -> Self {
23865 self.sub_operation_details = v.into();
23866 self
23867 }
23868
23869 /// The value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
23870 /// if it holds a `MaintenanceType`, `None` if the field is not set or
23871 /// holds a different branch.
23872 pub fn maintenance_type(&self) -> std::option::Option<&crate::model::SqlMaintenanceType> {
23873 #[allow(unreachable_patterns)]
23874 self.sub_operation_details.as_ref().and_then(|v| match v {
23875 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v) => {
23876 std::option::Option::Some(v)
23877 }
23878 _ => std::option::Option::None,
23879 })
23880 }
23881
23882 /// Sets the value of [sub_operation_details][crate::model::SqlSubOperationType::sub_operation_details]
23883 /// to hold a `MaintenanceType`.
23884 ///
23885 /// Note that all the setters affecting `sub_operation_details` are
23886 /// mutually exclusive.
23887 ///
23888 /// # Example
23889 /// ```ignore,no_run
23890 /// # use google_cloud_sql_v1::model::SqlSubOperationType;
23891 /// use google_cloud_sql_v1::model::SqlMaintenanceType;
23892 /// let x0 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceMaintenance);
23893 /// let x1 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::ReplicaIncludedMaintenance);
23894 /// let x2 = SqlSubOperationType::new().set_maintenance_type(SqlMaintenanceType::InstanceSelfServiceMaintenance);
23895 /// assert!(x0.maintenance_type().is_some());
23896 /// assert!(x1.maintenance_type().is_some());
23897 /// assert!(x2.maintenance_type().is_some());
23898 /// ```
23899 pub fn set_maintenance_type<T: std::convert::Into<crate::model::SqlMaintenanceType>>(
23900 mut self,
23901 v: T,
23902 ) -> Self {
23903 self.sub_operation_details = std::option::Option::Some(
23904 crate::model::sql_sub_operation_type::SubOperationDetails::MaintenanceType(v.into()),
23905 );
23906 self
23907 }
23908}
23909
23910impl wkt::message::Message for SqlSubOperationType {
23911 fn typename() -> &'static str {
23912 "type.googleapis.com/google.cloud.sql.v1.SqlSubOperationType"
23913 }
23914}
23915
23916/// Defines additional types related to [SqlSubOperationType].
23917pub mod sql_sub_operation_type {
23918 #[allow(unused_imports)]
23919 use super::*;
23920
23921 /// Sub operation details corresponding to the operation type.
23922 #[derive(Clone, Debug, PartialEq)]
23923 #[non_exhaustive]
23924 pub enum SubOperationDetails {
23925 /// The type of maintenance to be performed on the instance.
23926 MaintenanceType(crate::model::SqlMaintenanceType),
23927 }
23928}
23929
23930/// An Operation resource. For successful operations that return an
23931/// Operation resource, only the fields relevant to the operation are populated
23932/// in the resource.
23933#[derive(Clone, Default, PartialEq)]
23934#[non_exhaustive]
23935pub struct Operation {
23936 /// This is always `sql#operation`.
23937 pub kind: std::string::String,
23938
23939 pub target_link: std::string::String,
23940
23941 /// The status of an operation.
23942 pub status: crate::model::operation::SqlOperationStatus,
23943
23944 /// The email address of the user who initiated this operation.
23945 pub user: std::string::String,
23946
23947 /// The time this operation was enqueued in UTC timezone in [RFC
23948 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23949 /// `2012-11-15T16:19:00.094Z`.
23950 pub insert_time: std::option::Option<wkt::Timestamp>,
23951
23952 /// The time this operation actually started in UTC timezone in [RFC
23953 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23954 /// `2012-11-15T16:19:00.094Z`.
23955 pub start_time: std::option::Option<wkt::Timestamp>,
23956
23957 /// The time this operation finished in UTC timezone in [RFC
23958 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
23959 /// `2012-11-15T16:19:00.094Z`.
23960 pub end_time: std::option::Option<wkt::Timestamp>,
23961
23962 /// If errors occurred during processing of this operation, this field will be
23963 /// populated.
23964 pub error: std::option::Option<crate::model::OperationErrors>,
23965
23966 /// An Admin API warning message.
23967 pub api_warning: std::option::Option<crate::model::ApiWarning>,
23968
23969 /// The type of the operation. Valid values are:
23970 ///
23971 /// * `CREATE`
23972 /// * `DELETE`
23973 /// * `UPDATE`
23974 /// * `RESTART`
23975 /// * `IMPORT`
23976 /// * `EXPORT`
23977 /// * `BACKUP_VOLUME`
23978 /// * `RESTORE_VOLUME`
23979 /// * `CREATE_USER`
23980 /// * `DELETE_USER`
23981 /// * `CREATE_DATABASE`
23982 /// * `DELETE_DATABASE`
23983 pub operation_type: crate::model::operation::SqlOperationType,
23984
23985 /// The context for import operation, if applicable.
23986 pub import_context: std::option::Option<crate::model::ImportContext>,
23987
23988 /// The context for export operation, if applicable.
23989 pub export_context: std::option::Option<crate::model::ExportContext>,
23990
23991 /// The context for backup operation, if applicable.
23992 pub backup_context: std::option::Option<crate::model::BackupContext>,
23993
23994 /// This field is only populated when the operation_type is
23995 /// PRE_CHECK_MAJOR_VERSION_UPGRADE.
23996 /// The PreCheckMajorVersionUpgradeContext message itself contains the details
23997 /// for that pre-check, such as the target database version for the upgrade
23998 /// and the results of the check (including any warnings or errors found).
23999 pub pre_check_major_version_upgrade_context:
24000 std::option::Option<crate::model::PreCheckMajorVersionUpgradeContext>,
24001
24002 /// An identifier that uniquely identifies the operation. You can use this
24003 /// identifier to retrieve the Operations resource that has information about
24004 /// the operation.
24005 pub name: std::string::String,
24006
24007 /// Name of the resource on which this operation runs.
24008 pub target_id: std::string::String,
24009
24010 /// The URI of this resource.
24011 pub self_link: std::string::String,
24012
24013 /// The project ID of the target instance related to this operation.
24014 pub target_project: std::string::String,
24015
24016 /// The context for acquire SSRS lease operation, if applicable.
24017 pub acquire_ssrs_lease_context: std::option::Option<crate::model::AcquireSsrsLeaseContext>,
24018
24019 /// Optional. The sub operation based on the operation type.
24020 pub sub_operation_type: std::option::Option<crate::model::SqlSubOperationType>,
24021
24022 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
24023}
24024
24025impl Operation {
24026 pub fn new() -> Self {
24027 std::default::Default::default()
24028 }
24029
24030 /// Sets the value of [kind][crate::model::Operation::kind].
24031 ///
24032 /// # Example
24033 /// ```ignore,no_run
24034 /// # use google_cloud_sql_v1::model::Operation;
24035 /// let x = Operation::new().set_kind("example");
24036 /// ```
24037 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24038 self.kind = v.into();
24039 self
24040 }
24041
24042 /// Sets the value of [target_link][crate::model::Operation::target_link].
24043 ///
24044 /// # Example
24045 /// ```ignore,no_run
24046 /// # use google_cloud_sql_v1::model::Operation;
24047 /// let x = Operation::new().set_target_link("example");
24048 /// ```
24049 pub fn set_target_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24050 self.target_link = v.into();
24051 self
24052 }
24053
24054 /// Sets the value of [status][crate::model::Operation::status].
24055 ///
24056 /// # Example
24057 /// ```ignore,no_run
24058 /// # use google_cloud_sql_v1::model::Operation;
24059 /// use google_cloud_sql_v1::model::operation::SqlOperationStatus;
24060 /// let x0 = Operation::new().set_status(SqlOperationStatus::Pending);
24061 /// let x1 = Operation::new().set_status(SqlOperationStatus::Running);
24062 /// let x2 = Operation::new().set_status(SqlOperationStatus::Done);
24063 /// ```
24064 pub fn set_status<T: std::convert::Into<crate::model::operation::SqlOperationStatus>>(
24065 mut self,
24066 v: T,
24067 ) -> Self {
24068 self.status = v.into();
24069 self
24070 }
24071
24072 /// Sets the value of [user][crate::model::Operation::user].
24073 ///
24074 /// # Example
24075 /// ```ignore,no_run
24076 /// # use google_cloud_sql_v1::model::Operation;
24077 /// let x = Operation::new().set_user("example");
24078 /// ```
24079 pub fn set_user<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24080 self.user = v.into();
24081 self
24082 }
24083
24084 /// Sets the value of [insert_time][crate::model::Operation::insert_time].
24085 ///
24086 /// # Example
24087 /// ```ignore,no_run
24088 /// # use google_cloud_sql_v1::model::Operation;
24089 /// use wkt::Timestamp;
24090 /// let x = Operation::new().set_insert_time(Timestamp::default()/* use setters */);
24091 /// ```
24092 pub fn set_insert_time<T>(mut self, v: T) -> Self
24093 where
24094 T: std::convert::Into<wkt::Timestamp>,
24095 {
24096 self.insert_time = std::option::Option::Some(v.into());
24097 self
24098 }
24099
24100 /// Sets or clears the value of [insert_time][crate::model::Operation::insert_time].
24101 ///
24102 /// # Example
24103 /// ```ignore,no_run
24104 /// # use google_cloud_sql_v1::model::Operation;
24105 /// use wkt::Timestamp;
24106 /// let x = Operation::new().set_or_clear_insert_time(Some(Timestamp::default()/* use setters */));
24107 /// let x = Operation::new().set_or_clear_insert_time(None::<Timestamp>);
24108 /// ```
24109 pub fn set_or_clear_insert_time<T>(mut self, v: std::option::Option<T>) -> Self
24110 where
24111 T: std::convert::Into<wkt::Timestamp>,
24112 {
24113 self.insert_time = v.map(|x| x.into());
24114 self
24115 }
24116
24117 /// Sets the value of [start_time][crate::model::Operation::start_time].
24118 ///
24119 /// # Example
24120 /// ```ignore,no_run
24121 /// # use google_cloud_sql_v1::model::Operation;
24122 /// use wkt::Timestamp;
24123 /// let x = Operation::new().set_start_time(Timestamp::default()/* use setters */);
24124 /// ```
24125 pub fn set_start_time<T>(mut self, v: T) -> Self
24126 where
24127 T: std::convert::Into<wkt::Timestamp>,
24128 {
24129 self.start_time = std::option::Option::Some(v.into());
24130 self
24131 }
24132
24133 /// Sets or clears the value of [start_time][crate::model::Operation::start_time].
24134 ///
24135 /// # Example
24136 /// ```ignore,no_run
24137 /// # use google_cloud_sql_v1::model::Operation;
24138 /// use wkt::Timestamp;
24139 /// let x = Operation::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
24140 /// let x = Operation::new().set_or_clear_start_time(None::<Timestamp>);
24141 /// ```
24142 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
24143 where
24144 T: std::convert::Into<wkt::Timestamp>,
24145 {
24146 self.start_time = v.map(|x| x.into());
24147 self
24148 }
24149
24150 /// Sets the value of [end_time][crate::model::Operation::end_time].
24151 ///
24152 /// # Example
24153 /// ```ignore,no_run
24154 /// # use google_cloud_sql_v1::model::Operation;
24155 /// use wkt::Timestamp;
24156 /// let x = Operation::new().set_end_time(Timestamp::default()/* use setters */);
24157 /// ```
24158 pub fn set_end_time<T>(mut self, v: T) -> Self
24159 where
24160 T: std::convert::Into<wkt::Timestamp>,
24161 {
24162 self.end_time = std::option::Option::Some(v.into());
24163 self
24164 }
24165
24166 /// Sets or clears the value of [end_time][crate::model::Operation::end_time].
24167 ///
24168 /// # Example
24169 /// ```ignore,no_run
24170 /// # use google_cloud_sql_v1::model::Operation;
24171 /// use wkt::Timestamp;
24172 /// let x = Operation::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
24173 /// let x = Operation::new().set_or_clear_end_time(None::<Timestamp>);
24174 /// ```
24175 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
24176 where
24177 T: std::convert::Into<wkt::Timestamp>,
24178 {
24179 self.end_time = v.map(|x| x.into());
24180 self
24181 }
24182
24183 /// Sets the value of [error][crate::model::Operation::error].
24184 ///
24185 /// # Example
24186 /// ```ignore,no_run
24187 /// # use google_cloud_sql_v1::model::Operation;
24188 /// use google_cloud_sql_v1::model::OperationErrors;
24189 /// let x = Operation::new().set_error(OperationErrors::default()/* use setters */);
24190 /// ```
24191 pub fn set_error<T>(mut self, v: T) -> Self
24192 where
24193 T: std::convert::Into<crate::model::OperationErrors>,
24194 {
24195 self.error = std::option::Option::Some(v.into());
24196 self
24197 }
24198
24199 /// Sets or clears the value of [error][crate::model::Operation::error].
24200 ///
24201 /// # Example
24202 /// ```ignore,no_run
24203 /// # use google_cloud_sql_v1::model::Operation;
24204 /// use google_cloud_sql_v1::model::OperationErrors;
24205 /// let x = Operation::new().set_or_clear_error(Some(OperationErrors::default()/* use setters */));
24206 /// let x = Operation::new().set_or_clear_error(None::<OperationErrors>);
24207 /// ```
24208 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
24209 where
24210 T: std::convert::Into<crate::model::OperationErrors>,
24211 {
24212 self.error = v.map(|x| x.into());
24213 self
24214 }
24215
24216 /// Sets the value of [api_warning][crate::model::Operation::api_warning].
24217 ///
24218 /// # Example
24219 /// ```ignore,no_run
24220 /// # use google_cloud_sql_v1::model::Operation;
24221 /// use google_cloud_sql_v1::model::ApiWarning;
24222 /// let x = Operation::new().set_api_warning(ApiWarning::default()/* use setters */);
24223 /// ```
24224 pub fn set_api_warning<T>(mut self, v: T) -> Self
24225 where
24226 T: std::convert::Into<crate::model::ApiWarning>,
24227 {
24228 self.api_warning = std::option::Option::Some(v.into());
24229 self
24230 }
24231
24232 /// Sets or clears the value of [api_warning][crate::model::Operation::api_warning].
24233 ///
24234 /// # Example
24235 /// ```ignore,no_run
24236 /// # use google_cloud_sql_v1::model::Operation;
24237 /// use google_cloud_sql_v1::model::ApiWarning;
24238 /// let x = Operation::new().set_or_clear_api_warning(Some(ApiWarning::default()/* use setters */));
24239 /// let x = Operation::new().set_or_clear_api_warning(None::<ApiWarning>);
24240 /// ```
24241 pub fn set_or_clear_api_warning<T>(mut self, v: std::option::Option<T>) -> Self
24242 where
24243 T: std::convert::Into<crate::model::ApiWarning>,
24244 {
24245 self.api_warning = v.map(|x| x.into());
24246 self
24247 }
24248
24249 /// Sets the value of [operation_type][crate::model::Operation::operation_type].
24250 ///
24251 /// # Example
24252 /// ```ignore,no_run
24253 /// # use google_cloud_sql_v1::model::Operation;
24254 /// use google_cloud_sql_v1::model::operation::SqlOperationType;
24255 /// let x0 = Operation::new().set_operation_type(SqlOperationType::Import);
24256 /// let x1 = Operation::new().set_operation_type(SqlOperationType::Export);
24257 /// let x2 = Operation::new().set_operation_type(SqlOperationType::Create);
24258 /// ```
24259 pub fn set_operation_type<T: std::convert::Into<crate::model::operation::SqlOperationType>>(
24260 mut self,
24261 v: T,
24262 ) -> Self {
24263 self.operation_type = v.into();
24264 self
24265 }
24266
24267 /// Sets the value of [import_context][crate::model::Operation::import_context].
24268 ///
24269 /// # Example
24270 /// ```ignore,no_run
24271 /// # use google_cloud_sql_v1::model::Operation;
24272 /// use google_cloud_sql_v1::model::ImportContext;
24273 /// let x = Operation::new().set_import_context(ImportContext::default()/* use setters */);
24274 /// ```
24275 pub fn set_import_context<T>(mut self, v: T) -> Self
24276 where
24277 T: std::convert::Into<crate::model::ImportContext>,
24278 {
24279 self.import_context = std::option::Option::Some(v.into());
24280 self
24281 }
24282
24283 /// Sets or clears the value of [import_context][crate::model::Operation::import_context].
24284 ///
24285 /// # Example
24286 /// ```ignore,no_run
24287 /// # use google_cloud_sql_v1::model::Operation;
24288 /// use google_cloud_sql_v1::model::ImportContext;
24289 /// let x = Operation::new().set_or_clear_import_context(Some(ImportContext::default()/* use setters */));
24290 /// let x = Operation::new().set_or_clear_import_context(None::<ImportContext>);
24291 /// ```
24292 pub fn set_or_clear_import_context<T>(mut self, v: std::option::Option<T>) -> Self
24293 where
24294 T: std::convert::Into<crate::model::ImportContext>,
24295 {
24296 self.import_context = v.map(|x| x.into());
24297 self
24298 }
24299
24300 /// Sets the value of [export_context][crate::model::Operation::export_context].
24301 ///
24302 /// # Example
24303 /// ```ignore,no_run
24304 /// # use google_cloud_sql_v1::model::Operation;
24305 /// use google_cloud_sql_v1::model::ExportContext;
24306 /// let x = Operation::new().set_export_context(ExportContext::default()/* use setters */);
24307 /// ```
24308 pub fn set_export_context<T>(mut self, v: T) -> Self
24309 where
24310 T: std::convert::Into<crate::model::ExportContext>,
24311 {
24312 self.export_context = std::option::Option::Some(v.into());
24313 self
24314 }
24315
24316 /// Sets or clears the value of [export_context][crate::model::Operation::export_context].
24317 ///
24318 /// # Example
24319 /// ```ignore,no_run
24320 /// # use google_cloud_sql_v1::model::Operation;
24321 /// use google_cloud_sql_v1::model::ExportContext;
24322 /// let x = Operation::new().set_or_clear_export_context(Some(ExportContext::default()/* use setters */));
24323 /// let x = Operation::new().set_or_clear_export_context(None::<ExportContext>);
24324 /// ```
24325 pub fn set_or_clear_export_context<T>(mut self, v: std::option::Option<T>) -> Self
24326 where
24327 T: std::convert::Into<crate::model::ExportContext>,
24328 {
24329 self.export_context = v.map(|x| x.into());
24330 self
24331 }
24332
24333 /// Sets the value of [backup_context][crate::model::Operation::backup_context].
24334 ///
24335 /// # Example
24336 /// ```ignore,no_run
24337 /// # use google_cloud_sql_v1::model::Operation;
24338 /// use google_cloud_sql_v1::model::BackupContext;
24339 /// let x = Operation::new().set_backup_context(BackupContext::default()/* use setters */);
24340 /// ```
24341 pub fn set_backup_context<T>(mut self, v: T) -> Self
24342 where
24343 T: std::convert::Into<crate::model::BackupContext>,
24344 {
24345 self.backup_context = std::option::Option::Some(v.into());
24346 self
24347 }
24348
24349 /// Sets or clears the value of [backup_context][crate::model::Operation::backup_context].
24350 ///
24351 /// # Example
24352 /// ```ignore,no_run
24353 /// # use google_cloud_sql_v1::model::Operation;
24354 /// use google_cloud_sql_v1::model::BackupContext;
24355 /// let x = Operation::new().set_or_clear_backup_context(Some(BackupContext::default()/* use setters */));
24356 /// let x = Operation::new().set_or_clear_backup_context(None::<BackupContext>);
24357 /// ```
24358 pub fn set_or_clear_backup_context<T>(mut self, v: std::option::Option<T>) -> Self
24359 where
24360 T: std::convert::Into<crate::model::BackupContext>,
24361 {
24362 self.backup_context = v.map(|x| x.into());
24363 self
24364 }
24365
24366 /// Sets the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24367 ///
24368 /// # Example
24369 /// ```ignore,no_run
24370 /// # use google_cloud_sql_v1::model::Operation;
24371 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24372 /// let x = Operation::new().set_pre_check_major_version_upgrade_context(PreCheckMajorVersionUpgradeContext::default()/* use setters */);
24373 /// ```
24374 pub fn set_pre_check_major_version_upgrade_context<T>(mut self, v: T) -> Self
24375 where
24376 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24377 {
24378 self.pre_check_major_version_upgrade_context = std::option::Option::Some(v.into());
24379 self
24380 }
24381
24382 /// Sets or clears the value of [pre_check_major_version_upgrade_context][crate::model::Operation::pre_check_major_version_upgrade_context].
24383 ///
24384 /// # Example
24385 /// ```ignore,no_run
24386 /// # use google_cloud_sql_v1::model::Operation;
24387 /// use google_cloud_sql_v1::model::PreCheckMajorVersionUpgradeContext;
24388 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(Some(PreCheckMajorVersionUpgradeContext::default()/* use setters */));
24389 /// let x = Operation::new().set_or_clear_pre_check_major_version_upgrade_context(None::<PreCheckMajorVersionUpgradeContext>);
24390 /// ```
24391 pub fn set_or_clear_pre_check_major_version_upgrade_context<T>(
24392 mut self,
24393 v: std::option::Option<T>,
24394 ) -> Self
24395 where
24396 T: std::convert::Into<crate::model::PreCheckMajorVersionUpgradeContext>,
24397 {
24398 self.pre_check_major_version_upgrade_context = v.map(|x| x.into());
24399 self
24400 }
24401
24402 /// Sets the value of [name][crate::model::Operation::name].
24403 ///
24404 /// # Example
24405 /// ```ignore,no_run
24406 /// # use google_cloud_sql_v1::model::Operation;
24407 /// let x = Operation::new().set_name("example");
24408 /// ```
24409 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24410 self.name = v.into();
24411 self
24412 }
24413
24414 /// Sets the value of [target_id][crate::model::Operation::target_id].
24415 ///
24416 /// # Example
24417 /// ```ignore,no_run
24418 /// # use google_cloud_sql_v1::model::Operation;
24419 /// let x = Operation::new().set_target_id("example");
24420 /// ```
24421 pub fn set_target_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24422 self.target_id = v.into();
24423 self
24424 }
24425
24426 /// Sets the value of [self_link][crate::model::Operation::self_link].
24427 ///
24428 /// # Example
24429 /// ```ignore,no_run
24430 /// # use google_cloud_sql_v1::model::Operation;
24431 /// let x = Operation::new().set_self_link("example");
24432 /// ```
24433 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24434 self.self_link = v.into();
24435 self
24436 }
24437
24438 /// Sets the value of [target_project][crate::model::Operation::target_project].
24439 ///
24440 /// # Example
24441 /// ```ignore,no_run
24442 /// # use google_cloud_sql_v1::model::Operation;
24443 /// let x = Operation::new().set_target_project("example");
24444 /// ```
24445 pub fn set_target_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
24446 self.target_project = v.into();
24447 self
24448 }
24449
24450 /// Sets the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24451 ///
24452 /// # Example
24453 /// ```ignore,no_run
24454 /// # use google_cloud_sql_v1::model::Operation;
24455 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24456 /// let x = Operation::new().set_acquire_ssrs_lease_context(AcquireSsrsLeaseContext::default()/* use setters */);
24457 /// ```
24458 pub fn set_acquire_ssrs_lease_context<T>(mut self, v: T) -> Self
24459 where
24460 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24461 {
24462 self.acquire_ssrs_lease_context = std::option::Option::Some(v.into());
24463 self
24464 }
24465
24466 /// Sets or clears the value of [acquire_ssrs_lease_context][crate::model::Operation::acquire_ssrs_lease_context].
24467 ///
24468 /// # Example
24469 /// ```ignore,no_run
24470 /// # use google_cloud_sql_v1::model::Operation;
24471 /// use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
24472 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(Some(AcquireSsrsLeaseContext::default()/* use setters */));
24473 /// let x = Operation::new().set_or_clear_acquire_ssrs_lease_context(None::<AcquireSsrsLeaseContext>);
24474 /// ```
24475 pub fn set_or_clear_acquire_ssrs_lease_context<T>(mut self, v: std::option::Option<T>) -> Self
24476 where
24477 T: std::convert::Into<crate::model::AcquireSsrsLeaseContext>,
24478 {
24479 self.acquire_ssrs_lease_context = v.map(|x| x.into());
24480 self
24481 }
24482
24483 /// Sets the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24484 ///
24485 /// # Example
24486 /// ```ignore,no_run
24487 /// # use google_cloud_sql_v1::model::Operation;
24488 /// use google_cloud_sql_v1::model::SqlSubOperationType;
24489 /// let x = Operation::new().set_sub_operation_type(SqlSubOperationType::default()/* use setters */);
24490 /// ```
24491 pub fn set_sub_operation_type<T>(mut self, v: T) -> Self
24492 where
24493 T: std::convert::Into<crate::model::SqlSubOperationType>,
24494 {
24495 self.sub_operation_type = std::option::Option::Some(v.into());
24496 self
24497 }
24498
24499 /// Sets or clears the value of [sub_operation_type][crate::model::Operation::sub_operation_type].
24500 ///
24501 /// # Example
24502 /// ```ignore,no_run
24503 /// # use google_cloud_sql_v1::model::Operation;
24504 /// use google_cloud_sql_v1::model::SqlSubOperationType;
24505 /// let x = Operation::new().set_or_clear_sub_operation_type(Some(SqlSubOperationType::default()/* use setters */));
24506 /// let x = Operation::new().set_or_clear_sub_operation_type(None::<SqlSubOperationType>);
24507 /// ```
24508 pub fn set_or_clear_sub_operation_type<T>(mut self, v: std::option::Option<T>) -> Self
24509 where
24510 T: std::convert::Into<crate::model::SqlSubOperationType>,
24511 {
24512 self.sub_operation_type = v.map(|x| x.into());
24513 self
24514 }
24515}
24516
24517impl wkt::message::Message for Operation {
24518 fn typename() -> &'static str {
24519 "type.googleapis.com/google.cloud.sql.v1.Operation"
24520 }
24521}
24522
24523/// Defines additional types related to [Operation].
24524pub mod operation {
24525 #[allow(unused_imports)]
24526 use super::*;
24527
24528 /// The type of Cloud SQL operation.
24529 ///
24530 /// # Working with unknown values
24531 ///
24532 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
24533 /// additional enum variants at any time. Adding new variants is not considered
24534 /// a breaking change. Applications should write their code in anticipation of:
24535 ///
24536 /// - New values appearing in future releases of the client library, **and**
24537 /// - New values received dynamically, without application changes.
24538 ///
24539 /// Please consult the [Working with enums] section in the user guide for some
24540 /// guidelines.
24541 ///
24542 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
24543 #[derive(Clone, Debug, PartialEq)]
24544 #[non_exhaustive]
24545 pub enum SqlOperationType {
24546 /// Unknown operation type.
24547 Unspecified,
24548 /// Imports data into a Cloud SQL instance.
24549 Import,
24550 /// Exports data from a Cloud SQL instance to a Cloud Storage
24551 /// bucket.
24552 Export,
24553 /// Creates a new Cloud SQL instance.
24554 Create,
24555 /// Updates the settings of a Cloud SQL instance.
24556 Update,
24557 /// Deletes a Cloud SQL instance.
24558 Delete,
24559 /// Restarts the Cloud SQL instance.
24560 Restart,
24561 #[deprecated]
24562 Backup,
24563 #[deprecated]
24564 Snapshot,
24565 /// Performs instance backup.
24566 BackupVolume,
24567 /// Deletes an instance backup.
24568 DeleteVolume,
24569 /// Restores an instance backup.
24570 RestoreVolume,
24571 /// Injects a privileged user in mysql for MOB instances.
24572 InjectUser,
24573 /// Clones a Cloud SQL instance.
24574 Clone,
24575 /// Stops replication on a Cloud SQL read replica instance.
24576 StopReplica,
24577 /// Starts replication on a Cloud SQL read replica instance.
24578 StartReplica,
24579 /// Promotes a Cloud SQL replica instance.
24580 PromoteReplica,
24581 /// Creates a Cloud SQL replica instance.
24582 CreateReplica,
24583 /// Creates a new user in a Cloud SQL instance.
24584 CreateUser,
24585 /// Deletes a user from a Cloud SQL instance.
24586 DeleteUser,
24587 /// Updates an existing user in a Cloud SQL instance. If a user with the
24588 /// specified username doesn't exist, a new user is created.
24589 UpdateUser,
24590 /// Creates a database in the Cloud SQL instance.
24591 CreateDatabase,
24592 /// Deletes a database in the Cloud SQL instance.
24593 DeleteDatabase,
24594 /// Updates a database in the Cloud SQL instance.
24595 UpdateDatabase,
24596 /// Performs failover of an HA-enabled Cloud SQL
24597 /// failover replica.
24598 Failover,
24599 /// Deletes the backup taken by a backup run.
24600 DeleteBackup,
24601 RecreateReplica,
24602 /// Truncates a general or slow log table in MySQL.
24603 TruncateLog,
24604 /// Demotes the stand-alone instance to be a Cloud SQL
24605 /// read replica for an external database server.
24606 DemoteMaster,
24607 /// Indicates that the instance is currently in maintenance. Maintenance
24608 /// typically causes the instance to be unavailable for 1-3 minutes.
24609 Maintenance,
24610 /// This field is deprecated, and will be removed in future version of API.
24611 #[deprecated]
24612 EnablePrivateIp,
24613 #[deprecated]
24614 DeferMaintenance,
24615 /// Creates clone instance.
24616 #[deprecated]
24617 CreateClone,
24618 /// Reschedule maintenance to another time.
24619 RescheduleMaintenance,
24620 /// Starts external sync of a Cloud SQL EM replica to an external primary
24621 /// instance.
24622 StartExternalSync,
24623 /// Recovers logs from an instance's old data disk.
24624 LogCleanup,
24625 /// Performs auto-restart of an HA-enabled Cloud SQL database for auto
24626 /// recovery.
24627 AutoRestart,
24628 /// Re-encrypts CMEK instances with latest key version.
24629 Reencrypt,
24630 /// Switches the roles of the primary and replica pair. The target instance
24631 /// should be the replica.
24632 Switchover,
24633 /// Update a backup.
24634 UpdateBackup,
24635 /// Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
24636 AcquireSsrsLease,
24637 /// Release a lease for the setup of SQL Server Reporting Services (SSRS).
24638 ReleaseSsrsLease,
24639 /// Reconfigures old primary after a promote replica operation. Effect of a
24640 /// promote operation to the old primary is executed in this operation,
24641 /// asynchronously from the promote replica operation executed to the
24642 /// replica.
24643 ReconfigureOldPrimary,
24644 /// Indicates that the instance, its read replicas, and its cascading
24645 /// replicas are in maintenance. Maintenance typically gets initiated on
24646 /// groups of replicas first, followed by the primary instance. For each
24647 /// instance, maintenance typically causes the instance to be unavailable for
24648 /// 1-3 minutes.
24649 #[deprecated]
24650 ClusterMaintenance,
24651 /// Indicates that the instance (and any of its replicas) are currently in
24652 /// maintenance. This is initiated as a self-service request by using SSM.
24653 /// Maintenance typically causes the instance to be unavailable for 1-3
24654 /// minutes.
24655 #[deprecated]
24656 SelfServiceMaintenance,
24657 /// Switches a primary instance to a replica. This operation runs as part of
24658 /// a switchover operation to the original primary instance.
24659 SwitchoverToReplica,
24660 /// Updates the major version of a Cloud SQL instance.
24661 MajorVersionUpgrade,
24662 /// Deprecated: ADVANCED_BACKUP is deprecated. Use ENHANCED_BACKUP instead.
24663 #[deprecated]
24664 AdvancedBackup,
24665 /// Changes the BackupTier of a Cloud SQL instance.
24666 ManageBackup,
24667 /// Creates a backup for an Enhanced BackupTier Cloud SQL instance.
24668 EnhancedBackup,
24669 /// Repairs entire read pool or specified read pool nodes in the read pool.
24670 RepairReadPool,
24671 /// Creates a Cloud SQL read pool instance.
24672 CreateReadPool,
24673 /// If set, the enum was initialized with an unknown value.
24674 ///
24675 /// Applications can examine the value using [SqlOperationType::value] or
24676 /// [SqlOperationType::name].
24677 UnknownValue(sql_operation_type::UnknownValue),
24678 }
24679
24680 #[doc(hidden)]
24681 pub mod sql_operation_type {
24682 #[allow(unused_imports)]
24683 use super::*;
24684 #[derive(Clone, Debug, PartialEq)]
24685 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
24686 }
24687
24688 impl SqlOperationType {
24689 /// Gets the enum value.
24690 ///
24691 /// Returns `None` if the enum contains an unknown value deserialized from
24692 /// the string representation of enums.
24693 pub fn value(&self) -> std::option::Option<i32> {
24694 match self {
24695 Self::Unspecified => std::option::Option::Some(0),
24696 Self::Import => std::option::Option::Some(1),
24697 Self::Export => std::option::Option::Some(2),
24698 Self::Create => std::option::Option::Some(3),
24699 Self::Update => std::option::Option::Some(4),
24700 Self::Delete => std::option::Option::Some(5),
24701 Self::Restart => std::option::Option::Some(6),
24702 Self::Backup => std::option::Option::Some(7),
24703 Self::Snapshot => std::option::Option::Some(8),
24704 Self::BackupVolume => std::option::Option::Some(9),
24705 Self::DeleteVolume => std::option::Option::Some(10),
24706 Self::RestoreVolume => std::option::Option::Some(11),
24707 Self::InjectUser => std::option::Option::Some(12),
24708 Self::Clone => std::option::Option::Some(14),
24709 Self::StopReplica => std::option::Option::Some(15),
24710 Self::StartReplica => std::option::Option::Some(16),
24711 Self::PromoteReplica => std::option::Option::Some(17),
24712 Self::CreateReplica => std::option::Option::Some(18),
24713 Self::CreateUser => std::option::Option::Some(19),
24714 Self::DeleteUser => std::option::Option::Some(20),
24715 Self::UpdateUser => std::option::Option::Some(21),
24716 Self::CreateDatabase => std::option::Option::Some(22),
24717 Self::DeleteDatabase => std::option::Option::Some(23),
24718 Self::UpdateDatabase => std::option::Option::Some(24),
24719 Self::Failover => std::option::Option::Some(25),
24720 Self::DeleteBackup => std::option::Option::Some(26),
24721 Self::RecreateReplica => std::option::Option::Some(27),
24722 Self::TruncateLog => std::option::Option::Some(28),
24723 Self::DemoteMaster => std::option::Option::Some(29),
24724 Self::Maintenance => std::option::Option::Some(30),
24725 Self::EnablePrivateIp => std::option::Option::Some(31),
24726 Self::DeferMaintenance => std::option::Option::Some(32),
24727 Self::CreateClone => std::option::Option::Some(33),
24728 Self::RescheduleMaintenance => std::option::Option::Some(34),
24729 Self::StartExternalSync => std::option::Option::Some(35),
24730 Self::LogCleanup => std::option::Option::Some(36),
24731 Self::AutoRestart => std::option::Option::Some(37),
24732 Self::Reencrypt => std::option::Option::Some(38),
24733 Self::Switchover => std::option::Option::Some(39),
24734 Self::UpdateBackup => std::option::Option::Some(40),
24735 Self::AcquireSsrsLease => std::option::Option::Some(42),
24736 Self::ReleaseSsrsLease => std::option::Option::Some(43),
24737 Self::ReconfigureOldPrimary => std::option::Option::Some(44),
24738 Self::ClusterMaintenance => std::option::Option::Some(45),
24739 Self::SelfServiceMaintenance => std::option::Option::Some(46),
24740 Self::SwitchoverToReplica => std::option::Option::Some(47),
24741 Self::MajorVersionUpgrade => std::option::Option::Some(48),
24742 Self::AdvancedBackup => std::option::Option::Some(49),
24743 Self::ManageBackup => std::option::Option::Some(50),
24744 Self::EnhancedBackup => std::option::Option::Some(51),
24745 Self::RepairReadPool => std::option::Option::Some(52),
24746 Self::CreateReadPool => std::option::Option::Some(53),
24747 Self::UnknownValue(u) => u.0.value(),
24748 }
24749 }
24750
24751 /// Gets the enum value as a string.
24752 ///
24753 /// Returns `None` if the enum contains an unknown value deserialized from
24754 /// the integer representation of enums.
24755 pub fn name(&self) -> std::option::Option<&str> {
24756 match self {
24757 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_TYPE_UNSPECIFIED"),
24758 Self::Import => std::option::Option::Some("IMPORT"),
24759 Self::Export => std::option::Option::Some("EXPORT"),
24760 Self::Create => std::option::Option::Some("CREATE"),
24761 Self::Update => std::option::Option::Some("UPDATE"),
24762 Self::Delete => std::option::Option::Some("DELETE"),
24763 Self::Restart => std::option::Option::Some("RESTART"),
24764 Self::Backup => std::option::Option::Some("BACKUP"),
24765 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
24766 Self::BackupVolume => std::option::Option::Some("BACKUP_VOLUME"),
24767 Self::DeleteVolume => std::option::Option::Some("DELETE_VOLUME"),
24768 Self::RestoreVolume => std::option::Option::Some("RESTORE_VOLUME"),
24769 Self::InjectUser => std::option::Option::Some("INJECT_USER"),
24770 Self::Clone => std::option::Option::Some("CLONE"),
24771 Self::StopReplica => std::option::Option::Some("STOP_REPLICA"),
24772 Self::StartReplica => std::option::Option::Some("START_REPLICA"),
24773 Self::PromoteReplica => std::option::Option::Some("PROMOTE_REPLICA"),
24774 Self::CreateReplica => std::option::Option::Some("CREATE_REPLICA"),
24775 Self::CreateUser => std::option::Option::Some("CREATE_USER"),
24776 Self::DeleteUser => std::option::Option::Some("DELETE_USER"),
24777 Self::UpdateUser => std::option::Option::Some("UPDATE_USER"),
24778 Self::CreateDatabase => std::option::Option::Some("CREATE_DATABASE"),
24779 Self::DeleteDatabase => std::option::Option::Some("DELETE_DATABASE"),
24780 Self::UpdateDatabase => std::option::Option::Some("UPDATE_DATABASE"),
24781 Self::Failover => std::option::Option::Some("FAILOVER"),
24782 Self::DeleteBackup => std::option::Option::Some("DELETE_BACKUP"),
24783 Self::RecreateReplica => std::option::Option::Some("RECREATE_REPLICA"),
24784 Self::TruncateLog => std::option::Option::Some("TRUNCATE_LOG"),
24785 Self::DemoteMaster => std::option::Option::Some("DEMOTE_MASTER"),
24786 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
24787 Self::EnablePrivateIp => std::option::Option::Some("ENABLE_PRIVATE_IP"),
24788 Self::DeferMaintenance => std::option::Option::Some("DEFER_MAINTENANCE"),
24789 Self::CreateClone => std::option::Option::Some("CREATE_CLONE"),
24790 Self::RescheduleMaintenance => std::option::Option::Some("RESCHEDULE_MAINTENANCE"),
24791 Self::StartExternalSync => std::option::Option::Some("START_EXTERNAL_SYNC"),
24792 Self::LogCleanup => std::option::Option::Some("LOG_CLEANUP"),
24793 Self::AutoRestart => std::option::Option::Some("AUTO_RESTART"),
24794 Self::Reencrypt => std::option::Option::Some("REENCRYPT"),
24795 Self::Switchover => std::option::Option::Some("SWITCHOVER"),
24796 Self::UpdateBackup => std::option::Option::Some("UPDATE_BACKUP"),
24797 Self::AcquireSsrsLease => std::option::Option::Some("ACQUIRE_SSRS_LEASE"),
24798 Self::ReleaseSsrsLease => std::option::Option::Some("RELEASE_SSRS_LEASE"),
24799 Self::ReconfigureOldPrimary => std::option::Option::Some("RECONFIGURE_OLD_PRIMARY"),
24800 Self::ClusterMaintenance => std::option::Option::Some("CLUSTER_MAINTENANCE"),
24801 Self::SelfServiceMaintenance => {
24802 std::option::Option::Some("SELF_SERVICE_MAINTENANCE")
24803 }
24804 Self::SwitchoverToReplica => std::option::Option::Some("SWITCHOVER_TO_REPLICA"),
24805 Self::MajorVersionUpgrade => std::option::Option::Some("MAJOR_VERSION_UPGRADE"),
24806 Self::AdvancedBackup => std::option::Option::Some("ADVANCED_BACKUP"),
24807 Self::ManageBackup => std::option::Option::Some("MANAGE_BACKUP"),
24808 Self::EnhancedBackup => std::option::Option::Some("ENHANCED_BACKUP"),
24809 Self::RepairReadPool => std::option::Option::Some("REPAIR_READ_POOL"),
24810 Self::CreateReadPool => std::option::Option::Some("CREATE_READ_POOL"),
24811 Self::UnknownValue(u) => u.0.name(),
24812 }
24813 }
24814 }
24815
24816 impl std::default::Default for SqlOperationType {
24817 fn default() -> Self {
24818 use std::convert::From;
24819 Self::from(0)
24820 }
24821 }
24822
24823 impl std::fmt::Display for SqlOperationType {
24824 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
24825 wkt::internal::display_enum(f, self.name(), self.value())
24826 }
24827 }
24828
24829 impl std::convert::From<i32> for SqlOperationType {
24830 fn from(value: i32) -> Self {
24831 match value {
24832 0 => Self::Unspecified,
24833 1 => Self::Import,
24834 2 => Self::Export,
24835 3 => Self::Create,
24836 4 => Self::Update,
24837 5 => Self::Delete,
24838 6 => Self::Restart,
24839 7 => Self::Backup,
24840 8 => Self::Snapshot,
24841 9 => Self::BackupVolume,
24842 10 => Self::DeleteVolume,
24843 11 => Self::RestoreVolume,
24844 12 => Self::InjectUser,
24845 14 => Self::Clone,
24846 15 => Self::StopReplica,
24847 16 => Self::StartReplica,
24848 17 => Self::PromoteReplica,
24849 18 => Self::CreateReplica,
24850 19 => Self::CreateUser,
24851 20 => Self::DeleteUser,
24852 21 => Self::UpdateUser,
24853 22 => Self::CreateDatabase,
24854 23 => Self::DeleteDatabase,
24855 24 => Self::UpdateDatabase,
24856 25 => Self::Failover,
24857 26 => Self::DeleteBackup,
24858 27 => Self::RecreateReplica,
24859 28 => Self::TruncateLog,
24860 29 => Self::DemoteMaster,
24861 30 => Self::Maintenance,
24862 31 => Self::EnablePrivateIp,
24863 32 => Self::DeferMaintenance,
24864 33 => Self::CreateClone,
24865 34 => Self::RescheduleMaintenance,
24866 35 => Self::StartExternalSync,
24867 36 => Self::LogCleanup,
24868 37 => Self::AutoRestart,
24869 38 => Self::Reencrypt,
24870 39 => Self::Switchover,
24871 40 => Self::UpdateBackup,
24872 42 => Self::AcquireSsrsLease,
24873 43 => Self::ReleaseSsrsLease,
24874 44 => Self::ReconfigureOldPrimary,
24875 45 => Self::ClusterMaintenance,
24876 46 => Self::SelfServiceMaintenance,
24877 47 => Self::SwitchoverToReplica,
24878 48 => Self::MajorVersionUpgrade,
24879 49 => Self::AdvancedBackup,
24880 50 => Self::ManageBackup,
24881 51 => Self::EnhancedBackup,
24882 52 => Self::RepairReadPool,
24883 53 => Self::CreateReadPool,
24884 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
24885 wkt::internal::UnknownEnumValue::Integer(value),
24886 )),
24887 }
24888 }
24889 }
24890
24891 impl std::convert::From<&str> for SqlOperationType {
24892 fn from(value: &str) -> Self {
24893 use std::string::ToString;
24894 match value {
24895 "SQL_OPERATION_TYPE_UNSPECIFIED" => Self::Unspecified,
24896 "IMPORT" => Self::Import,
24897 "EXPORT" => Self::Export,
24898 "CREATE" => Self::Create,
24899 "UPDATE" => Self::Update,
24900 "DELETE" => Self::Delete,
24901 "RESTART" => Self::Restart,
24902 "BACKUP" => Self::Backup,
24903 "SNAPSHOT" => Self::Snapshot,
24904 "BACKUP_VOLUME" => Self::BackupVolume,
24905 "DELETE_VOLUME" => Self::DeleteVolume,
24906 "RESTORE_VOLUME" => Self::RestoreVolume,
24907 "INJECT_USER" => Self::InjectUser,
24908 "CLONE" => Self::Clone,
24909 "STOP_REPLICA" => Self::StopReplica,
24910 "START_REPLICA" => Self::StartReplica,
24911 "PROMOTE_REPLICA" => Self::PromoteReplica,
24912 "CREATE_REPLICA" => Self::CreateReplica,
24913 "CREATE_USER" => Self::CreateUser,
24914 "DELETE_USER" => Self::DeleteUser,
24915 "UPDATE_USER" => Self::UpdateUser,
24916 "CREATE_DATABASE" => Self::CreateDatabase,
24917 "DELETE_DATABASE" => Self::DeleteDatabase,
24918 "UPDATE_DATABASE" => Self::UpdateDatabase,
24919 "FAILOVER" => Self::Failover,
24920 "DELETE_BACKUP" => Self::DeleteBackup,
24921 "RECREATE_REPLICA" => Self::RecreateReplica,
24922 "TRUNCATE_LOG" => Self::TruncateLog,
24923 "DEMOTE_MASTER" => Self::DemoteMaster,
24924 "MAINTENANCE" => Self::Maintenance,
24925 "ENABLE_PRIVATE_IP" => Self::EnablePrivateIp,
24926 "DEFER_MAINTENANCE" => Self::DeferMaintenance,
24927 "CREATE_CLONE" => Self::CreateClone,
24928 "RESCHEDULE_MAINTENANCE" => Self::RescheduleMaintenance,
24929 "START_EXTERNAL_SYNC" => Self::StartExternalSync,
24930 "LOG_CLEANUP" => Self::LogCleanup,
24931 "AUTO_RESTART" => Self::AutoRestart,
24932 "REENCRYPT" => Self::Reencrypt,
24933 "SWITCHOVER" => Self::Switchover,
24934 "UPDATE_BACKUP" => Self::UpdateBackup,
24935 "ACQUIRE_SSRS_LEASE" => Self::AcquireSsrsLease,
24936 "RELEASE_SSRS_LEASE" => Self::ReleaseSsrsLease,
24937 "RECONFIGURE_OLD_PRIMARY" => Self::ReconfigureOldPrimary,
24938 "CLUSTER_MAINTENANCE" => Self::ClusterMaintenance,
24939 "SELF_SERVICE_MAINTENANCE" => Self::SelfServiceMaintenance,
24940 "SWITCHOVER_TO_REPLICA" => Self::SwitchoverToReplica,
24941 "MAJOR_VERSION_UPGRADE" => Self::MajorVersionUpgrade,
24942 "ADVANCED_BACKUP" => Self::AdvancedBackup,
24943 "MANAGE_BACKUP" => Self::ManageBackup,
24944 "ENHANCED_BACKUP" => Self::EnhancedBackup,
24945 "REPAIR_READ_POOL" => Self::RepairReadPool,
24946 "CREATE_READ_POOL" => Self::CreateReadPool,
24947 _ => Self::UnknownValue(sql_operation_type::UnknownValue(
24948 wkt::internal::UnknownEnumValue::String(value.to_string()),
24949 )),
24950 }
24951 }
24952 }
24953
24954 impl serde::ser::Serialize for SqlOperationType {
24955 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
24956 where
24957 S: serde::Serializer,
24958 {
24959 match self {
24960 Self::Unspecified => serializer.serialize_i32(0),
24961 Self::Import => serializer.serialize_i32(1),
24962 Self::Export => serializer.serialize_i32(2),
24963 Self::Create => serializer.serialize_i32(3),
24964 Self::Update => serializer.serialize_i32(4),
24965 Self::Delete => serializer.serialize_i32(5),
24966 Self::Restart => serializer.serialize_i32(6),
24967 Self::Backup => serializer.serialize_i32(7),
24968 Self::Snapshot => serializer.serialize_i32(8),
24969 Self::BackupVolume => serializer.serialize_i32(9),
24970 Self::DeleteVolume => serializer.serialize_i32(10),
24971 Self::RestoreVolume => serializer.serialize_i32(11),
24972 Self::InjectUser => serializer.serialize_i32(12),
24973 Self::Clone => serializer.serialize_i32(14),
24974 Self::StopReplica => serializer.serialize_i32(15),
24975 Self::StartReplica => serializer.serialize_i32(16),
24976 Self::PromoteReplica => serializer.serialize_i32(17),
24977 Self::CreateReplica => serializer.serialize_i32(18),
24978 Self::CreateUser => serializer.serialize_i32(19),
24979 Self::DeleteUser => serializer.serialize_i32(20),
24980 Self::UpdateUser => serializer.serialize_i32(21),
24981 Self::CreateDatabase => serializer.serialize_i32(22),
24982 Self::DeleteDatabase => serializer.serialize_i32(23),
24983 Self::UpdateDatabase => serializer.serialize_i32(24),
24984 Self::Failover => serializer.serialize_i32(25),
24985 Self::DeleteBackup => serializer.serialize_i32(26),
24986 Self::RecreateReplica => serializer.serialize_i32(27),
24987 Self::TruncateLog => serializer.serialize_i32(28),
24988 Self::DemoteMaster => serializer.serialize_i32(29),
24989 Self::Maintenance => serializer.serialize_i32(30),
24990 Self::EnablePrivateIp => serializer.serialize_i32(31),
24991 Self::DeferMaintenance => serializer.serialize_i32(32),
24992 Self::CreateClone => serializer.serialize_i32(33),
24993 Self::RescheduleMaintenance => serializer.serialize_i32(34),
24994 Self::StartExternalSync => serializer.serialize_i32(35),
24995 Self::LogCleanup => serializer.serialize_i32(36),
24996 Self::AutoRestart => serializer.serialize_i32(37),
24997 Self::Reencrypt => serializer.serialize_i32(38),
24998 Self::Switchover => serializer.serialize_i32(39),
24999 Self::UpdateBackup => serializer.serialize_i32(40),
25000 Self::AcquireSsrsLease => serializer.serialize_i32(42),
25001 Self::ReleaseSsrsLease => serializer.serialize_i32(43),
25002 Self::ReconfigureOldPrimary => serializer.serialize_i32(44),
25003 Self::ClusterMaintenance => serializer.serialize_i32(45),
25004 Self::SelfServiceMaintenance => serializer.serialize_i32(46),
25005 Self::SwitchoverToReplica => serializer.serialize_i32(47),
25006 Self::MajorVersionUpgrade => serializer.serialize_i32(48),
25007 Self::AdvancedBackup => serializer.serialize_i32(49),
25008 Self::ManageBackup => serializer.serialize_i32(50),
25009 Self::EnhancedBackup => serializer.serialize_i32(51),
25010 Self::RepairReadPool => serializer.serialize_i32(52),
25011 Self::CreateReadPool => serializer.serialize_i32(53),
25012 Self::UnknownValue(u) => u.0.serialize(serializer),
25013 }
25014 }
25015 }
25016
25017 impl<'de> serde::de::Deserialize<'de> for SqlOperationType {
25018 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25019 where
25020 D: serde::Deserializer<'de>,
25021 {
25022 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationType>::new(
25023 ".google.cloud.sql.v1.Operation.SqlOperationType",
25024 ))
25025 }
25026 }
25027
25028 /// The status of an operation.
25029 ///
25030 /// # Working with unknown values
25031 ///
25032 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25033 /// additional enum variants at any time. Adding new variants is not considered
25034 /// a breaking change. Applications should write their code in anticipation of:
25035 ///
25036 /// - New values appearing in future releases of the client library, **and**
25037 /// - New values received dynamically, without application changes.
25038 ///
25039 /// Please consult the [Working with enums] section in the user guide for some
25040 /// guidelines.
25041 ///
25042 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25043 #[derive(Clone, Debug, PartialEq)]
25044 #[non_exhaustive]
25045 pub enum SqlOperationStatus {
25046 /// The state of the operation is unknown.
25047 Unspecified,
25048 /// The operation has been queued, but has not started yet.
25049 Pending,
25050 /// The operation is running.
25051 Running,
25052 /// The operation completed.
25053 Done,
25054 /// If set, the enum was initialized with an unknown value.
25055 ///
25056 /// Applications can examine the value using [SqlOperationStatus::value] or
25057 /// [SqlOperationStatus::name].
25058 UnknownValue(sql_operation_status::UnknownValue),
25059 }
25060
25061 #[doc(hidden)]
25062 pub mod sql_operation_status {
25063 #[allow(unused_imports)]
25064 use super::*;
25065 #[derive(Clone, Debug, PartialEq)]
25066 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25067 }
25068
25069 impl SqlOperationStatus {
25070 /// Gets the enum value.
25071 ///
25072 /// Returns `None` if the enum contains an unknown value deserialized from
25073 /// the string representation of enums.
25074 pub fn value(&self) -> std::option::Option<i32> {
25075 match self {
25076 Self::Unspecified => std::option::Option::Some(0),
25077 Self::Pending => std::option::Option::Some(1),
25078 Self::Running => std::option::Option::Some(2),
25079 Self::Done => std::option::Option::Some(3),
25080 Self::UnknownValue(u) => u.0.value(),
25081 }
25082 }
25083
25084 /// Gets the enum value as a string.
25085 ///
25086 /// Returns `None` if the enum contains an unknown value deserialized from
25087 /// the integer representation of enums.
25088 pub fn name(&self) -> std::option::Option<&str> {
25089 match self {
25090 Self::Unspecified => std::option::Option::Some("SQL_OPERATION_STATUS_UNSPECIFIED"),
25091 Self::Pending => std::option::Option::Some("PENDING"),
25092 Self::Running => std::option::Option::Some("RUNNING"),
25093 Self::Done => std::option::Option::Some("DONE"),
25094 Self::UnknownValue(u) => u.0.name(),
25095 }
25096 }
25097 }
25098
25099 impl std::default::Default for SqlOperationStatus {
25100 fn default() -> Self {
25101 use std::convert::From;
25102 Self::from(0)
25103 }
25104 }
25105
25106 impl std::fmt::Display for SqlOperationStatus {
25107 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25108 wkt::internal::display_enum(f, self.name(), self.value())
25109 }
25110 }
25111
25112 impl std::convert::From<i32> for SqlOperationStatus {
25113 fn from(value: i32) -> Self {
25114 match value {
25115 0 => Self::Unspecified,
25116 1 => Self::Pending,
25117 2 => Self::Running,
25118 3 => Self::Done,
25119 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25120 wkt::internal::UnknownEnumValue::Integer(value),
25121 )),
25122 }
25123 }
25124 }
25125
25126 impl std::convert::From<&str> for SqlOperationStatus {
25127 fn from(value: &str) -> Self {
25128 use std::string::ToString;
25129 match value {
25130 "SQL_OPERATION_STATUS_UNSPECIFIED" => Self::Unspecified,
25131 "PENDING" => Self::Pending,
25132 "RUNNING" => Self::Running,
25133 "DONE" => Self::Done,
25134 _ => Self::UnknownValue(sql_operation_status::UnknownValue(
25135 wkt::internal::UnknownEnumValue::String(value.to_string()),
25136 )),
25137 }
25138 }
25139 }
25140
25141 impl serde::ser::Serialize for SqlOperationStatus {
25142 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25143 where
25144 S: serde::Serializer,
25145 {
25146 match self {
25147 Self::Unspecified => serializer.serialize_i32(0),
25148 Self::Pending => serializer.serialize_i32(1),
25149 Self::Running => serializer.serialize_i32(2),
25150 Self::Done => serializer.serialize_i32(3),
25151 Self::UnknownValue(u) => u.0.serialize(serializer),
25152 }
25153 }
25154 }
25155
25156 impl<'de> serde::de::Deserialize<'de> for SqlOperationStatus {
25157 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25158 where
25159 D: serde::Deserializer<'de>,
25160 {
25161 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlOperationStatus>::new(
25162 ".google.cloud.sql.v1.Operation.SqlOperationStatus",
25163 ))
25164 }
25165 }
25166}
25167
25168/// Database instance operation error.
25169#[derive(Clone, Default, PartialEq)]
25170#[non_exhaustive]
25171pub struct OperationError {
25172 /// This is always `sql#operationError`.
25173 pub kind: std::string::String,
25174
25175 /// Identifies the specific error that occurred.
25176 pub code: std::string::String,
25177
25178 /// Additional information about the error encountered.
25179 pub message: std::string::String,
25180
25181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25182}
25183
25184impl OperationError {
25185 pub fn new() -> Self {
25186 std::default::Default::default()
25187 }
25188
25189 /// Sets the value of [kind][crate::model::OperationError::kind].
25190 ///
25191 /// # Example
25192 /// ```ignore,no_run
25193 /// # use google_cloud_sql_v1::model::OperationError;
25194 /// let x = OperationError::new().set_kind("example");
25195 /// ```
25196 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25197 self.kind = v.into();
25198 self
25199 }
25200
25201 /// Sets the value of [code][crate::model::OperationError::code].
25202 ///
25203 /// # Example
25204 /// ```ignore,no_run
25205 /// # use google_cloud_sql_v1::model::OperationError;
25206 /// let x = OperationError::new().set_code("example");
25207 /// ```
25208 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25209 self.code = v.into();
25210 self
25211 }
25212
25213 /// Sets the value of [message][crate::model::OperationError::message].
25214 ///
25215 /// # Example
25216 /// ```ignore,no_run
25217 /// # use google_cloud_sql_v1::model::OperationError;
25218 /// let x = OperationError::new().set_message("example");
25219 /// ```
25220 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25221 self.message = v.into();
25222 self
25223 }
25224}
25225
25226impl wkt::message::Message for OperationError {
25227 fn typename() -> &'static str {
25228 "type.googleapis.com/google.cloud.sql.v1.OperationError"
25229 }
25230}
25231
25232/// Database instance operation errors list wrapper.
25233#[derive(Clone, Default, PartialEq)]
25234#[non_exhaustive]
25235pub struct OperationErrors {
25236 /// This is always `sql#operationErrors`.
25237 pub kind: std::string::String,
25238
25239 /// The list of errors encountered while processing this operation.
25240 pub errors: std::vec::Vec<crate::model::OperationError>,
25241
25242 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25243}
25244
25245impl OperationErrors {
25246 pub fn new() -> Self {
25247 std::default::Default::default()
25248 }
25249
25250 /// Sets the value of [kind][crate::model::OperationErrors::kind].
25251 ///
25252 /// # Example
25253 /// ```ignore,no_run
25254 /// # use google_cloud_sql_v1::model::OperationErrors;
25255 /// let x = OperationErrors::new().set_kind("example");
25256 /// ```
25257 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
25258 self.kind = v.into();
25259 self
25260 }
25261
25262 /// Sets the value of [errors][crate::model::OperationErrors::errors].
25263 ///
25264 /// # Example
25265 /// ```ignore,no_run
25266 /// # use google_cloud_sql_v1::model::OperationErrors;
25267 /// use google_cloud_sql_v1::model::OperationError;
25268 /// let x = OperationErrors::new()
25269 /// .set_errors([
25270 /// OperationError::default()/* use setters */,
25271 /// OperationError::default()/* use (different) setters */,
25272 /// ]);
25273 /// ```
25274 pub fn set_errors<T, V>(mut self, v: T) -> Self
25275 where
25276 T: std::iter::IntoIterator<Item = V>,
25277 V: std::convert::Into<crate::model::OperationError>,
25278 {
25279 use std::iter::Iterator;
25280 self.errors = v.into_iter().map(|i| i.into()).collect();
25281 self
25282 }
25283}
25284
25285impl wkt::message::Message for OperationErrors {
25286 fn typename() -> &'static str {
25287 "type.googleapis.com/google.cloud.sql.v1.OperationErrors"
25288 }
25289}
25290
25291/// Database instance local user password validation policy.
25292/// This message defines the password policy for local database users.
25293/// When enabled, it enforces constraints on password complexity, length,
25294/// and reuse. Keep this policy enabled to help prevent unauthorized access.
25295#[derive(Clone, Default, PartialEq)]
25296#[non_exhaustive]
25297pub struct PasswordValidationPolicy {
25298 /// Minimum number of characters allowed.
25299 pub min_length: std::option::Option<wkt::Int32Value>,
25300
25301 /// The complexity of the password.
25302 pub complexity: crate::model::password_validation_policy::Complexity,
25303
25304 /// Number of previous passwords that cannot be reused.
25305 pub reuse_interval: std::option::Option<wkt::Int32Value>,
25306
25307 /// Disallow username as a part of the password.
25308 pub disallow_username_substring: std::option::Option<wkt::BoolValue>,
25309
25310 /// Minimum interval after which the password can be changed. This flag is only
25311 /// supported for PostgreSQL.
25312 pub password_change_interval: std::option::Option<wkt::Duration>,
25313
25314 /// Whether to enable the password policy or not. When enabled, passwords must
25315 /// meet complexity requirements. Keep this policy enabled to help prevent
25316 /// unauthorized access. Disabling this policy allows weak passwords.
25317 pub enable_password_policy: std::option::Option<wkt::BoolValue>,
25318
25319 /// This field is deprecated and will be removed in a future version of the
25320 /// API.
25321 #[deprecated]
25322 pub disallow_compromised_credentials: std::option::Option<wkt::BoolValue>,
25323
25324 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25325}
25326
25327impl PasswordValidationPolicy {
25328 pub fn new() -> Self {
25329 std::default::Default::default()
25330 }
25331
25332 /// Sets the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25333 ///
25334 /// # Example
25335 /// ```ignore,no_run
25336 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25337 /// use wkt::Int32Value;
25338 /// let x = PasswordValidationPolicy::new().set_min_length(Int32Value::default()/* use setters */);
25339 /// ```
25340 pub fn set_min_length<T>(mut self, v: T) -> Self
25341 where
25342 T: std::convert::Into<wkt::Int32Value>,
25343 {
25344 self.min_length = std::option::Option::Some(v.into());
25345 self
25346 }
25347
25348 /// Sets or clears the value of [min_length][crate::model::PasswordValidationPolicy::min_length].
25349 ///
25350 /// # Example
25351 /// ```ignore,no_run
25352 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25353 /// use wkt::Int32Value;
25354 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(Some(Int32Value::default()/* use setters */));
25355 /// let x = PasswordValidationPolicy::new().set_or_clear_min_length(None::<Int32Value>);
25356 /// ```
25357 pub fn set_or_clear_min_length<T>(mut self, v: std::option::Option<T>) -> Self
25358 where
25359 T: std::convert::Into<wkt::Int32Value>,
25360 {
25361 self.min_length = v.map(|x| x.into());
25362 self
25363 }
25364
25365 /// Sets the value of [complexity][crate::model::PasswordValidationPolicy::complexity].
25366 ///
25367 /// # Example
25368 /// ```ignore,no_run
25369 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25370 /// use google_cloud_sql_v1::model::password_validation_policy::Complexity;
25371 /// let x0 = PasswordValidationPolicy::new().set_complexity(Complexity::Default);
25372 /// ```
25373 pub fn set_complexity<
25374 T: std::convert::Into<crate::model::password_validation_policy::Complexity>,
25375 >(
25376 mut self,
25377 v: T,
25378 ) -> Self {
25379 self.complexity = v.into();
25380 self
25381 }
25382
25383 /// Sets the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25384 ///
25385 /// # Example
25386 /// ```ignore,no_run
25387 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25388 /// use wkt::Int32Value;
25389 /// let x = PasswordValidationPolicy::new().set_reuse_interval(Int32Value::default()/* use setters */);
25390 /// ```
25391 pub fn set_reuse_interval<T>(mut self, v: T) -> Self
25392 where
25393 T: std::convert::Into<wkt::Int32Value>,
25394 {
25395 self.reuse_interval = std::option::Option::Some(v.into());
25396 self
25397 }
25398
25399 /// Sets or clears the value of [reuse_interval][crate::model::PasswordValidationPolicy::reuse_interval].
25400 ///
25401 /// # Example
25402 /// ```ignore,no_run
25403 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25404 /// use wkt::Int32Value;
25405 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(Some(Int32Value::default()/* use setters */));
25406 /// let x = PasswordValidationPolicy::new().set_or_clear_reuse_interval(None::<Int32Value>);
25407 /// ```
25408 pub fn set_or_clear_reuse_interval<T>(mut self, v: std::option::Option<T>) -> Self
25409 where
25410 T: std::convert::Into<wkt::Int32Value>,
25411 {
25412 self.reuse_interval = v.map(|x| x.into());
25413 self
25414 }
25415
25416 /// Sets the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25417 ///
25418 /// # Example
25419 /// ```ignore,no_run
25420 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25421 /// use wkt::BoolValue;
25422 /// let x = PasswordValidationPolicy::new().set_disallow_username_substring(BoolValue::default()/* use setters */);
25423 /// ```
25424 pub fn set_disallow_username_substring<T>(mut self, v: T) -> Self
25425 where
25426 T: std::convert::Into<wkt::BoolValue>,
25427 {
25428 self.disallow_username_substring = std::option::Option::Some(v.into());
25429 self
25430 }
25431
25432 /// Sets or clears the value of [disallow_username_substring][crate::model::PasswordValidationPolicy::disallow_username_substring].
25433 ///
25434 /// # Example
25435 /// ```ignore,no_run
25436 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25437 /// use wkt::BoolValue;
25438 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(Some(BoolValue::default()/* use setters */));
25439 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_username_substring(None::<BoolValue>);
25440 /// ```
25441 pub fn set_or_clear_disallow_username_substring<T>(mut self, v: std::option::Option<T>) -> Self
25442 where
25443 T: std::convert::Into<wkt::BoolValue>,
25444 {
25445 self.disallow_username_substring = v.map(|x| x.into());
25446 self
25447 }
25448
25449 /// Sets the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25450 ///
25451 /// # Example
25452 /// ```ignore,no_run
25453 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25454 /// use wkt::Duration;
25455 /// let x = PasswordValidationPolicy::new().set_password_change_interval(Duration::default()/* use setters */);
25456 /// ```
25457 pub fn set_password_change_interval<T>(mut self, v: T) -> Self
25458 where
25459 T: std::convert::Into<wkt::Duration>,
25460 {
25461 self.password_change_interval = std::option::Option::Some(v.into());
25462 self
25463 }
25464
25465 /// Sets or clears the value of [password_change_interval][crate::model::PasswordValidationPolicy::password_change_interval].
25466 ///
25467 /// # Example
25468 /// ```ignore,no_run
25469 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25470 /// use wkt::Duration;
25471 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(Some(Duration::default()/* use setters */));
25472 /// let x = PasswordValidationPolicy::new().set_or_clear_password_change_interval(None::<Duration>);
25473 /// ```
25474 pub fn set_or_clear_password_change_interval<T>(mut self, v: std::option::Option<T>) -> Self
25475 where
25476 T: std::convert::Into<wkt::Duration>,
25477 {
25478 self.password_change_interval = v.map(|x| x.into());
25479 self
25480 }
25481
25482 /// Sets the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25483 ///
25484 /// # Example
25485 /// ```ignore,no_run
25486 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25487 /// use wkt::BoolValue;
25488 /// let x = PasswordValidationPolicy::new().set_enable_password_policy(BoolValue::default()/* use setters */);
25489 /// ```
25490 pub fn set_enable_password_policy<T>(mut self, v: T) -> Self
25491 where
25492 T: std::convert::Into<wkt::BoolValue>,
25493 {
25494 self.enable_password_policy = std::option::Option::Some(v.into());
25495 self
25496 }
25497
25498 /// Sets or clears the value of [enable_password_policy][crate::model::PasswordValidationPolicy::enable_password_policy].
25499 ///
25500 /// # Example
25501 /// ```ignore,no_run
25502 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25503 /// use wkt::BoolValue;
25504 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(Some(BoolValue::default()/* use setters */));
25505 /// let x = PasswordValidationPolicy::new().set_or_clear_enable_password_policy(None::<BoolValue>);
25506 /// ```
25507 pub fn set_or_clear_enable_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
25508 where
25509 T: std::convert::Into<wkt::BoolValue>,
25510 {
25511 self.enable_password_policy = v.map(|x| x.into());
25512 self
25513 }
25514
25515 /// Sets the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25516 ///
25517 /// # Example
25518 /// ```ignore,no_run
25519 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25520 /// use wkt::BoolValue;
25521 /// let x = PasswordValidationPolicy::new().set_disallow_compromised_credentials(BoolValue::default()/* use setters */);
25522 /// ```
25523 #[deprecated]
25524 pub fn set_disallow_compromised_credentials<T>(mut self, v: T) -> Self
25525 where
25526 T: std::convert::Into<wkt::BoolValue>,
25527 {
25528 self.disallow_compromised_credentials = std::option::Option::Some(v.into());
25529 self
25530 }
25531
25532 /// Sets or clears the value of [disallow_compromised_credentials][crate::model::PasswordValidationPolicy::disallow_compromised_credentials].
25533 ///
25534 /// # Example
25535 /// ```ignore,no_run
25536 /// # use google_cloud_sql_v1::model::PasswordValidationPolicy;
25537 /// use wkt::BoolValue;
25538 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(Some(BoolValue::default()/* use setters */));
25539 /// let x = PasswordValidationPolicy::new().set_or_clear_disallow_compromised_credentials(None::<BoolValue>);
25540 /// ```
25541 #[deprecated]
25542 pub fn set_or_clear_disallow_compromised_credentials<T>(
25543 mut self,
25544 v: std::option::Option<T>,
25545 ) -> Self
25546 where
25547 T: std::convert::Into<wkt::BoolValue>,
25548 {
25549 self.disallow_compromised_credentials = v.map(|x| x.into());
25550 self
25551 }
25552}
25553
25554impl wkt::message::Message for PasswordValidationPolicy {
25555 fn typename() -> &'static str {
25556 "type.googleapis.com/google.cloud.sql.v1.PasswordValidationPolicy"
25557 }
25558}
25559
25560/// Defines additional types related to [PasswordValidationPolicy].
25561pub mod password_validation_policy {
25562 #[allow(unused_imports)]
25563 use super::*;
25564
25565 /// The complexity choices of the password.
25566 ///
25567 /// # Working with unknown values
25568 ///
25569 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
25570 /// additional enum variants at any time. Adding new variants is not considered
25571 /// a breaking change. Applications should write their code in anticipation of:
25572 ///
25573 /// - New values appearing in future releases of the client library, **and**
25574 /// - New values received dynamically, without application changes.
25575 ///
25576 /// Please consult the [Working with enums] section in the user guide for some
25577 /// guidelines.
25578 ///
25579 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
25580 #[derive(Clone, Debug, PartialEq)]
25581 #[non_exhaustive]
25582 pub enum Complexity {
25583 /// Complexity check is not specified.
25584 Unspecified,
25585 /// A combination of lowercase, uppercase, numeric, and non-alphanumeric
25586 /// characters.
25587 Default,
25588 /// If set, the enum was initialized with an unknown value.
25589 ///
25590 /// Applications can examine the value using [Complexity::value] or
25591 /// [Complexity::name].
25592 UnknownValue(complexity::UnknownValue),
25593 }
25594
25595 #[doc(hidden)]
25596 pub mod complexity {
25597 #[allow(unused_imports)]
25598 use super::*;
25599 #[derive(Clone, Debug, PartialEq)]
25600 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
25601 }
25602
25603 impl Complexity {
25604 /// Gets the enum value.
25605 ///
25606 /// Returns `None` if the enum contains an unknown value deserialized from
25607 /// the string representation of enums.
25608 pub fn value(&self) -> std::option::Option<i32> {
25609 match self {
25610 Self::Unspecified => std::option::Option::Some(0),
25611 Self::Default => std::option::Option::Some(1),
25612 Self::UnknownValue(u) => u.0.value(),
25613 }
25614 }
25615
25616 /// Gets the enum value as a string.
25617 ///
25618 /// Returns `None` if the enum contains an unknown value deserialized from
25619 /// the integer representation of enums.
25620 pub fn name(&self) -> std::option::Option<&str> {
25621 match self {
25622 Self::Unspecified => std::option::Option::Some("COMPLEXITY_UNSPECIFIED"),
25623 Self::Default => std::option::Option::Some("COMPLEXITY_DEFAULT"),
25624 Self::UnknownValue(u) => u.0.name(),
25625 }
25626 }
25627 }
25628
25629 impl std::default::Default for Complexity {
25630 fn default() -> Self {
25631 use std::convert::From;
25632 Self::from(0)
25633 }
25634 }
25635
25636 impl std::fmt::Display for Complexity {
25637 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
25638 wkt::internal::display_enum(f, self.name(), self.value())
25639 }
25640 }
25641
25642 impl std::convert::From<i32> for Complexity {
25643 fn from(value: i32) -> Self {
25644 match value {
25645 0 => Self::Unspecified,
25646 1 => Self::Default,
25647 _ => Self::UnknownValue(complexity::UnknownValue(
25648 wkt::internal::UnknownEnumValue::Integer(value),
25649 )),
25650 }
25651 }
25652 }
25653
25654 impl std::convert::From<&str> for Complexity {
25655 fn from(value: &str) -> Self {
25656 use std::string::ToString;
25657 match value {
25658 "COMPLEXITY_UNSPECIFIED" => Self::Unspecified,
25659 "COMPLEXITY_DEFAULT" => Self::Default,
25660 _ => Self::UnknownValue(complexity::UnknownValue(
25661 wkt::internal::UnknownEnumValue::String(value.to_string()),
25662 )),
25663 }
25664 }
25665 }
25666
25667 impl serde::ser::Serialize for Complexity {
25668 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
25669 where
25670 S: serde::Serializer,
25671 {
25672 match self {
25673 Self::Unspecified => serializer.serialize_i32(0),
25674 Self::Default => serializer.serialize_i32(1),
25675 Self::UnknownValue(u) => u.0.serialize(serializer),
25676 }
25677 }
25678 }
25679
25680 impl<'de> serde::de::Deserialize<'de> for Complexity {
25681 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
25682 where
25683 D: serde::Deserializer<'de>,
25684 {
25685 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Complexity>::new(
25686 ".google.cloud.sql.v1.PasswordValidationPolicy.Complexity",
25687 ))
25688 }
25689 }
25690}
25691
25692/// Data cache configurations.
25693#[derive(Clone, Default, PartialEq)]
25694#[non_exhaustive]
25695pub struct DataCacheConfig {
25696 /// Whether data cache is enabled for the instance.
25697 pub data_cache_enabled: bool,
25698
25699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25700}
25701
25702impl DataCacheConfig {
25703 pub fn new() -> Self {
25704 std::default::Default::default()
25705 }
25706
25707 /// Sets the value of [data_cache_enabled][crate::model::DataCacheConfig::data_cache_enabled].
25708 ///
25709 /// # Example
25710 /// ```ignore,no_run
25711 /// # use google_cloud_sql_v1::model::DataCacheConfig;
25712 /// let x = DataCacheConfig::new().set_data_cache_enabled(true);
25713 /// ```
25714 pub fn set_data_cache_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
25715 self.data_cache_enabled = v.into();
25716 self
25717 }
25718}
25719
25720impl wkt::message::Message for DataCacheConfig {
25721 fn typename() -> &'static str {
25722 "type.googleapis.com/google.cloud.sql.v1.DataCacheConfig"
25723 }
25724}
25725
25726/// Config used to determine the final backup settings for the instance.
25727#[derive(Clone, Default, PartialEq)]
25728#[non_exhaustive]
25729pub struct FinalBackupConfig {
25730 /// Whether the final backup is enabled for the instance.
25731 pub enabled: std::option::Option<bool>,
25732
25733 /// The number of days to retain the final backup after the instance deletion.
25734 /// The final backup will be purged at (time_of_instance_deletion +
25735 /// retention_days).
25736 pub retention_days: std::option::Option<i32>,
25737
25738 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
25739}
25740
25741impl FinalBackupConfig {
25742 pub fn new() -> Self {
25743 std::default::Default::default()
25744 }
25745
25746 /// Sets the value of [enabled][crate::model::FinalBackupConfig::enabled].
25747 ///
25748 /// # Example
25749 /// ```ignore,no_run
25750 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25751 /// let x = FinalBackupConfig::new().set_enabled(true);
25752 /// ```
25753 pub fn set_enabled<T>(mut self, v: T) -> Self
25754 where
25755 T: std::convert::Into<bool>,
25756 {
25757 self.enabled = std::option::Option::Some(v.into());
25758 self
25759 }
25760
25761 /// Sets or clears the value of [enabled][crate::model::FinalBackupConfig::enabled].
25762 ///
25763 /// # Example
25764 /// ```ignore,no_run
25765 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25766 /// let x = FinalBackupConfig::new().set_or_clear_enabled(Some(false));
25767 /// let x = FinalBackupConfig::new().set_or_clear_enabled(None::<bool>);
25768 /// ```
25769 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
25770 where
25771 T: std::convert::Into<bool>,
25772 {
25773 self.enabled = v.map(|x| x.into());
25774 self
25775 }
25776
25777 /// Sets the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
25778 ///
25779 /// # Example
25780 /// ```ignore,no_run
25781 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25782 /// let x = FinalBackupConfig::new().set_retention_days(42);
25783 /// ```
25784 pub fn set_retention_days<T>(mut self, v: T) -> Self
25785 where
25786 T: std::convert::Into<i32>,
25787 {
25788 self.retention_days = std::option::Option::Some(v.into());
25789 self
25790 }
25791
25792 /// Sets or clears the value of [retention_days][crate::model::FinalBackupConfig::retention_days].
25793 ///
25794 /// # Example
25795 /// ```ignore,no_run
25796 /// # use google_cloud_sql_v1::model::FinalBackupConfig;
25797 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(Some(42));
25798 /// let x = FinalBackupConfig::new().set_or_clear_retention_days(None::<i32>);
25799 /// ```
25800 pub fn set_or_clear_retention_days<T>(mut self, v: std::option::Option<T>) -> Self
25801 where
25802 T: std::convert::Into<i32>,
25803 {
25804 self.retention_days = v.map(|x| x.into());
25805 self
25806 }
25807}
25808
25809impl wkt::message::Message for FinalBackupConfig {
25810 fn typename() -> &'static str {
25811 "type.googleapis.com/google.cloud.sql.v1.FinalBackupConfig"
25812 }
25813}
25814
25815/// Database instance settings.
25816#[derive(Clone, Default, PartialEq)]
25817#[non_exhaustive]
25818pub struct Settings {
25819 /// The version of instance settings. This is a required field for update
25820 /// method to make sure concurrent updates are handled properly. During update,
25821 /// use the most recent settingsVersion value for this instance and do not try
25822 /// to update this value.
25823 pub settings_version: std::option::Option<wkt::Int64Value>,
25824
25825 /// The App Engine app IDs that can access this instance.
25826 /// (Deprecated) Applied to First Generation instances only.
25827 #[deprecated]
25828 pub authorized_gae_applications: std::vec::Vec<std::string::String>,
25829
25830 /// The tier (or machine type) for this instance, for example
25831 /// `db-custom-1-3840`. WARNING: Changing this restarts the instance.
25832 pub tier: std::string::String,
25833
25834 /// This is always `sql#settings`.
25835 pub kind: std::string::String,
25836
25837 /// User-provided labels, represented as a dictionary where each label is a
25838 /// single key value pair.
25839 pub user_labels: std::collections::HashMap<std::string::String, std::string::String>,
25840
25841 /// Availability type. Potential values:
25842 ///
25843 /// * `ZONAL`: The instance serves data from only one zone. Outages in that
25844 /// zone affect data accessibility.
25845 /// * `REGIONAL`: The instance can serve data from more than one zone in a
25846 /// region (it is highly available)./
25847 ///
25848 /// For more information, see [Overview of the High Availability
25849 /// Configuration](https://cloud.google.com/sql/docs/mysql/high-availability).
25850 pub availability_type: crate::model::SqlAvailabilityType,
25851
25852 /// The pricing plan for this instance. This can be either `PER_USE` or
25853 /// `PACKAGE`. Only `PER_USE` is supported for Second Generation instances.
25854 pub pricing_plan: crate::model::SqlPricingPlan,
25855
25856 /// The type of replication this instance uses. This can be either
25857 /// `ASYNCHRONOUS` or `SYNCHRONOUS`. (Deprecated) This property was only
25858 /// applicable to First Generation instances.
25859 #[deprecated]
25860 pub replication_type: crate::model::SqlReplicationType,
25861
25862 /// The maximum size to which storage capacity can be automatically increased.
25863 /// The default value is 0, which specifies that there is no limit.
25864 pub storage_auto_resize_limit: std::option::Option<wkt::Int64Value>,
25865
25866 /// The activation policy specifies when the instance is activated; it is
25867 /// applicable only when the instance state is RUNNABLE. Valid values:
25868 ///
25869 /// * `ALWAYS`: The instance is on, and remains so even in the absence of
25870 /// connection requests.
25871 /// * `NEVER`: The instance is off; it is not activated, even if a
25872 /// connection request arrives.
25873 pub activation_policy: crate::model::settings::SqlActivationPolicy,
25874
25875 /// The settings for IP Management. This allows to enable or disable the
25876 /// instance IP and manage which external networks can connect to the instance.
25877 /// The IPv4 address cannot be disabled for Second Generation instances.
25878 pub ip_configuration: std::option::Option<crate::model::IpConfiguration>,
25879
25880 /// Configuration to increase storage size automatically. The default value is
25881 /// true.
25882 pub storage_auto_resize: std::option::Option<wkt::BoolValue>,
25883
25884 /// The location preference settings. This allows the instance to be located as
25885 /// near as possible to either an App Engine app or Compute Engine zone for
25886 /// better performance. App Engine co-location was only applicable to First
25887 /// Generation instances.
25888 pub location_preference: std::option::Option<crate::model::LocationPreference>,
25889
25890 /// The database flags passed to the instance at startup.
25891 pub database_flags: std::vec::Vec<crate::model::DatabaseFlags>,
25892
25893 /// The type of data disk: `PD_SSD` (default) or `PD_HDD`. Not used for
25894 /// First Generation instances.
25895 pub data_disk_type: crate::model::SqlDataDiskType,
25896
25897 /// The maintenance window for this instance. This specifies when the instance
25898 /// can be restarted for maintenance purposes.
25899 pub maintenance_window: std::option::Option<crate::model::MaintenanceWindow>,
25900
25901 /// The daily backup configuration for the instance.
25902 pub backup_configuration: std::option::Option<crate::model::BackupConfiguration>,
25903
25904 /// Configuration specific to read replica instances. Indicates whether
25905 /// replication is enabled or not. WARNING: Changing this restarts the
25906 /// instance.
25907 pub database_replication_enabled: std::option::Option<wkt::BoolValue>,
25908
25909 /// Configuration specific to read replica instances. Indicates whether
25910 /// database flags for crash-safe replication are enabled. This property was
25911 /// only applicable to First Generation instances.
25912 #[deprecated]
25913 pub crash_safe_replication_enabled: std::option::Option<wkt::BoolValue>,
25914
25915 /// The size of data disk, in GB. The data disk size minimum is 10GB.
25916 pub data_disk_size_gb: std::option::Option<wkt::Int64Value>,
25917
25918 /// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
25919 pub active_directory_config: std::option::Option<crate::model::SqlActiveDirectoryConfig>,
25920
25921 /// The name of server Instance collation.
25922 pub collation: std::string::String,
25923
25924 /// Deny maintenance periods
25925 pub deny_maintenance_periods: std::vec::Vec<crate::model::DenyMaintenancePeriod>,
25926
25927 /// Insights configuration, for now relevant only for Postgres.
25928 pub insights_config: std::option::Option<crate::model::InsightsConfig>,
25929
25930 /// The local user password validation policy of the instance.
25931 pub password_validation_policy: std::option::Option<crate::model::PasswordValidationPolicy>,
25932
25933 /// SQL Server specific audit configuration.
25934 pub sql_server_audit_config: std::option::Option<crate::model::SqlServerAuditConfig>,
25935
25936 /// Optional. The edition of the instance.
25937 pub edition: crate::model::settings::Edition,
25938
25939 /// Specifies if connections must use Cloud SQL connectors.
25940 /// Option values include the following: `NOT_REQUIRED` (Cloud SQL instances
25941 /// can be connected without Cloud SQL
25942 /// Connectors) and `REQUIRED` (Only allow connections that use Cloud SQL
25943 /// Connectors).
25944 ///
25945 /// Note that using REQUIRED disables all existing authorized networks. If
25946 /// this field is not specified when creating a new instance, NOT_REQUIRED is
25947 /// used. If this field is not specified when patching or updating an existing
25948 /// instance, it is left unchanged in the instance.
25949 pub connector_enforcement: crate::model::settings::ConnectorEnforcement,
25950
25951 /// Configuration to protect against accidental instance deletion.
25952 pub deletion_protection_enabled: std::option::Option<wkt::BoolValue>,
25953
25954 /// Server timezone, relevant only for Cloud SQL for SQL Server.
25955 pub time_zone: std::string::String,
25956
25957 /// Specifies advanced machine configuration for the instances relevant only
25958 /// for SQL Server.
25959 pub advanced_machine_features: std::option::Option<crate::model::AdvancedMachineFeatures>,
25960
25961 /// Configuration for data cache.
25962 pub data_cache_config: std::option::Option<crate::model::DataCacheConfig>,
25963
25964 /// Optional. Configuration value for recreation of replica after certain
25965 /// replication lag
25966 pub replication_lag_max_seconds: std::option::Option<wkt::Int32Value>,
25967
25968 /// Optional. When this parameter is set to true, Cloud SQL instances can
25969 /// connect to Vertex AI to pass requests for real-time predictions and
25970 /// insights to the AI. The default value is false. This applies only to Cloud
25971 /// SQL for MySQL and Cloud SQL for PostgreSQL instances.
25972 pub enable_google_ml_integration: std::option::Option<wkt::BoolValue>,
25973
25974 /// Optional. By default, Cloud SQL instances have schema extraction disabled
25975 /// for Dataplex. When this parameter is set to true, schema extraction for
25976 /// Dataplex on Cloud SQL instances is activated.
25977 pub enable_dataplex_integration: std::option::Option<wkt::BoolValue>,
25978
25979 /// Optional. When this parameter is set to true, Cloud SQL retains backups of
25980 /// the instance even after the instance is deleted. The ON_DEMAND backup will
25981 /// be retained until customer deletes the backup or the project. The AUTOMATED
25982 /// backup will be retained based on the backups retention setting.
25983 pub retain_backups_on_delete: std::option::Option<wkt::BoolValue>,
25984
25985 /// Optional. Provisioned number of I/O operations per second for the data
25986 /// disk. This field is only used for hyperdisk-balanced disk types.
25987 pub data_disk_provisioned_iops: std::option::Option<i64>,
25988
25989 /// Optional. Provisioned throughput measured in MiB per second for the data
25990 /// disk. This field is only used for hyperdisk-balanced disk types.
25991 pub data_disk_provisioned_throughput: std::option::Option<i64>,
25992
25993 /// Optional. The managed connection pooling configuration for the instance.
25994 pub connection_pool_config: std::option::Option<crate::model::ConnectionPoolConfig>,
25995
25996 /// Optional. The final backup configuration for the instance.
25997 pub final_backup_config: std::option::Option<crate::model::FinalBackupConfig>,
25998
25999 /// Optional. The read pool auto-scale configuration for the instance.
26000 pub read_pool_auto_scale_config: std::option::Option<crate::model::ReadPoolAutoScaleConfig>,
26001
26002 /// Optional. Cloud SQL for MySQL auto-upgrade configuration. When this
26003 /// parameter is set to true, auto-upgrade is enabled for MySQL 8.0 minor
26004 /// versions. The MySQL version must be 8.0.35 or higher.
26005 pub auto_upgrade_enabled: std::option::Option<bool>,
26006
26007 /// Optional. The Microsoft Entra ID configuration for the SQL Server instance.
26008 pub entraid_config: std::option::Option<crate::model::SqlServerEntraIdConfig>,
26009
26010 /// This parameter controls whether to allow using ExecuteSql API to connect to
26011 /// the instance. Not allowed by default.
26012 pub data_api_access: std::option::Option<crate::model::settings::DataApiAccess>,
26013
26014 /// Optional. Configuration for Performance Capture, provides diagnostic
26015 /// metrics during high load situations.
26016 pub performance_capture_config: std::option::Option<crate::model::PerformanceCaptureConfig>,
26017
26018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
26019}
26020
26021impl Settings {
26022 pub fn new() -> Self {
26023 std::default::Default::default()
26024 }
26025
26026 /// Sets the value of [settings_version][crate::model::Settings::settings_version].
26027 ///
26028 /// # Example
26029 /// ```ignore,no_run
26030 /// # use google_cloud_sql_v1::model::Settings;
26031 /// use wkt::Int64Value;
26032 /// let x = Settings::new().set_settings_version(Int64Value::default()/* use setters */);
26033 /// ```
26034 pub fn set_settings_version<T>(mut self, v: T) -> Self
26035 where
26036 T: std::convert::Into<wkt::Int64Value>,
26037 {
26038 self.settings_version = std::option::Option::Some(v.into());
26039 self
26040 }
26041
26042 /// Sets or clears the value of [settings_version][crate::model::Settings::settings_version].
26043 ///
26044 /// # Example
26045 /// ```ignore,no_run
26046 /// # use google_cloud_sql_v1::model::Settings;
26047 /// use wkt::Int64Value;
26048 /// let x = Settings::new().set_or_clear_settings_version(Some(Int64Value::default()/* use setters */));
26049 /// let x = Settings::new().set_or_clear_settings_version(None::<Int64Value>);
26050 /// ```
26051 pub fn set_or_clear_settings_version<T>(mut self, v: std::option::Option<T>) -> Self
26052 where
26053 T: std::convert::Into<wkt::Int64Value>,
26054 {
26055 self.settings_version = v.map(|x| x.into());
26056 self
26057 }
26058
26059 /// Sets the value of [authorized_gae_applications][crate::model::Settings::authorized_gae_applications].
26060 ///
26061 /// # Example
26062 /// ```ignore,no_run
26063 /// # use google_cloud_sql_v1::model::Settings;
26064 /// let x = Settings::new().set_authorized_gae_applications(["a", "b", "c"]);
26065 /// ```
26066 #[deprecated]
26067 pub fn set_authorized_gae_applications<T, V>(mut self, v: T) -> Self
26068 where
26069 T: std::iter::IntoIterator<Item = V>,
26070 V: std::convert::Into<std::string::String>,
26071 {
26072 use std::iter::Iterator;
26073 self.authorized_gae_applications = v.into_iter().map(|i| i.into()).collect();
26074 self
26075 }
26076
26077 /// Sets the value of [tier][crate::model::Settings::tier].
26078 ///
26079 /// # Example
26080 /// ```ignore,no_run
26081 /// # use google_cloud_sql_v1::model::Settings;
26082 /// let x = Settings::new().set_tier("example");
26083 /// ```
26084 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26085 self.tier = v.into();
26086 self
26087 }
26088
26089 /// Sets the value of [kind][crate::model::Settings::kind].
26090 ///
26091 /// # Example
26092 /// ```ignore,no_run
26093 /// # use google_cloud_sql_v1::model::Settings;
26094 /// let x = Settings::new().set_kind("example");
26095 /// ```
26096 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26097 self.kind = v.into();
26098 self
26099 }
26100
26101 /// Sets the value of [user_labels][crate::model::Settings::user_labels].
26102 ///
26103 /// # Example
26104 /// ```ignore,no_run
26105 /// # use google_cloud_sql_v1::model::Settings;
26106 /// let x = Settings::new().set_user_labels([
26107 /// ("key0", "abc"),
26108 /// ("key1", "xyz"),
26109 /// ]);
26110 /// ```
26111 pub fn set_user_labels<T, K, V>(mut self, v: T) -> Self
26112 where
26113 T: std::iter::IntoIterator<Item = (K, V)>,
26114 K: std::convert::Into<std::string::String>,
26115 V: std::convert::Into<std::string::String>,
26116 {
26117 use std::iter::Iterator;
26118 self.user_labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
26119 self
26120 }
26121
26122 /// Sets the value of [availability_type][crate::model::Settings::availability_type].
26123 ///
26124 /// # Example
26125 /// ```ignore,no_run
26126 /// # use google_cloud_sql_v1::model::Settings;
26127 /// use google_cloud_sql_v1::model::SqlAvailabilityType;
26128 /// let x0 = Settings::new().set_availability_type(SqlAvailabilityType::Zonal);
26129 /// let x1 = Settings::new().set_availability_type(SqlAvailabilityType::Regional);
26130 /// ```
26131 pub fn set_availability_type<T: std::convert::Into<crate::model::SqlAvailabilityType>>(
26132 mut self,
26133 v: T,
26134 ) -> Self {
26135 self.availability_type = v.into();
26136 self
26137 }
26138
26139 /// Sets the value of [pricing_plan][crate::model::Settings::pricing_plan].
26140 ///
26141 /// # Example
26142 /// ```ignore,no_run
26143 /// # use google_cloud_sql_v1::model::Settings;
26144 /// use google_cloud_sql_v1::model::SqlPricingPlan;
26145 /// let x0 = Settings::new().set_pricing_plan(SqlPricingPlan::Package);
26146 /// let x1 = Settings::new().set_pricing_plan(SqlPricingPlan::PerUse);
26147 /// ```
26148 pub fn set_pricing_plan<T: std::convert::Into<crate::model::SqlPricingPlan>>(
26149 mut self,
26150 v: T,
26151 ) -> Self {
26152 self.pricing_plan = v.into();
26153 self
26154 }
26155
26156 /// Sets the value of [replication_type][crate::model::Settings::replication_type].
26157 ///
26158 /// # Example
26159 /// ```ignore,no_run
26160 /// # use google_cloud_sql_v1::model::Settings;
26161 /// use google_cloud_sql_v1::model::SqlReplicationType;
26162 /// let x0 = Settings::new().set_replication_type(SqlReplicationType::Synchronous);
26163 /// let x1 = Settings::new().set_replication_type(SqlReplicationType::Asynchronous);
26164 /// ```
26165 #[deprecated]
26166 pub fn set_replication_type<T: std::convert::Into<crate::model::SqlReplicationType>>(
26167 mut self,
26168 v: T,
26169 ) -> Self {
26170 self.replication_type = v.into();
26171 self
26172 }
26173
26174 /// Sets the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26175 ///
26176 /// # Example
26177 /// ```ignore,no_run
26178 /// # use google_cloud_sql_v1::model::Settings;
26179 /// use wkt::Int64Value;
26180 /// let x = Settings::new().set_storage_auto_resize_limit(Int64Value::default()/* use setters */);
26181 /// ```
26182 pub fn set_storage_auto_resize_limit<T>(mut self, v: T) -> Self
26183 where
26184 T: std::convert::Into<wkt::Int64Value>,
26185 {
26186 self.storage_auto_resize_limit = std::option::Option::Some(v.into());
26187 self
26188 }
26189
26190 /// Sets or clears the value of [storage_auto_resize_limit][crate::model::Settings::storage_auto_resize_limit].
26191 ///
26192 /// # Example
26193 /// ```ignore,no_run
26194 /// # use google_cloud_sql_v1::model::Settings;
26195 /// use wkt::Int64Value;
26196 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(Some(Int64Value::default()/* use setters */));
26197 /// let x = Settings::new().set_or_clear_storage_auto_resize_limit(None::<Int64Value>);
26198 /// ```
26199 pub fn set_or_clear_storage_auto_resize_limit<T>(mut self, v: std::option::Option<T>) -> Self
26200 where
26201 T: std::convert::Into<wkt::Int64Value>,
26202 {
26203 self.storage_auto_resize_limit = v.map(|x| x.into());
26204 self
26205 }
26206
26207 /// Sets the value of [activation_policy][crate::model::Settings::activation_policy].
26208 ///
26209 /// # Example
26210 /// ```ignore,no_run
26211 /// # use google_cloud_sql_v1::model::Settings;
26212 /// use google_cloud_sql_v1::model::settings::SqlActivationPolicy;
26213 /// let x0 = Settings::new().set_activation_policy(SqlActivationPolicy::Always);
26214 /// let x1 = Settings::new().set_activation_policy(SqlActivationPolicy::Never);
26215 /// ```
26216 pub fn set_activation_policy<
26217 T: std::convert::Into<crate::model::settings::SqlActivationPolicy>,
26218 >(
26219 mut self,
26220 v: T,
26221 ) -> Self {
26222 self.activation_policy = v.into();
26223 self
26224 }
26225
26226 /// Sets the value of [ip_configuration][crate::model::Settings::ip_configuration].
26227 ///
26228 /// # Example
26229 /// ```ignore,no_run
26230 /// # use google_cloud_sql_v1::model::Settings;
26231 /// use google_cloud_sql_v1::model::IpConfiguration;
26232 /// let x = Settings::new().set_ip_configuration(IpConfiguration::default()/* use setters */);
26233 /// ```
26234 pub fn set_ip_configuration<T>(mut self, v: T) -> Self
26235 where
26236 T: std::convert::Into<crate::model::IpConfiguration>,
26237 {
26238 self.ip_configuration = std::option::Option::Some(v.into());
26239 self
26240 }
26241
26242 /// Sets or clears the value of [ip_configuration][crate::model::Settings::ip_configuration].
26243 ///
26244 /// # Example
26245 /// ```ignore,no_run
26246 /// # use google_cloud_sql_v1::model::Settings;
26247 /// use google_cloud_sql_v1::model::IpConfiguration;
26248 /// let x = Settings::new().set_or_clear_ip_configuration(Some(IpConfiguration::default()/* use setters */));
26249 /// let x = Settings::new().set_or_clear_ip_configuration(None::<IpConfiguration>);
26250 /// ```
26251 pub fn set_or_clear_ip_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26252 where
26253 T: std::convert::Into<crate::model::IpConfiguration>,
26254 {
26255 self.ip_configuration = v.map(|x| x.into());
26256 self
26257 }
26258
26259 /// Sets the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26260 ///
26261 /// # Example
26262 /// ```ignore,no_run
26263 /// # use google_cloud_sql_v1::model::Settings;
26264 /// use wkt::BoolValue;
26265 /// let x = Settings::new().set_storage_auto_resize(BoolValue::default()/* use setters */);
26266 /// ```
26267 pub fn set_storage_auto_resize<T>(mut self, v: T) -> Self
26268 where
26269 T: std::convert::Into<wkt::BoolValue>,
26270 {
26271 self.storage_auto_resize = std::option::Option::Some(v.into());
26272 self
26273 }
26274
26275 /// Sets or clears the value of [storage_auto_resize][crate::model::Settings::storage_auto_resize].
26276 ///
26277 /// # Example
26278 /// ```ignore,no_run
26279 /// # use google_cloud_sql_v1::model::Settings;
26280 /// use wkt::BoolValue;
26281 /// let x = Settings::new().set_or_clear_storage_auto_resize(Some(BoolValue::default()/* use setters */));
26282 /// let x = Settings::new().set_or_clear_storage_auto_resize(None::<BoolValue>);
26283 /// ```
26284 pub fn set_or_clear_storage_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
26285 where
26286 T: std::convert::Into<wkt::BoolValue>,
26287 {
26288 self.storage_auto_resize = v.map(|x| x.into());
26289 self
26290 }
26291
26292 /// Sets the value of [location_preference][crate::model::Settings::location_preference].
26293 ///
26294 /// # Example
26295 /// ```ignore,no_run
26296 /// # use google_cloud_sql_v1::model::Settings;
26297 /// use google_cloud_sql_v1::model::LocationPreference;
26298 /// let x = Settings::new().set_location_preference(LocationPreference::default()/* use setters */);
26299 /// ```
26300 pub fn set_location_preference<T>(mut self, v: T) -> Self
26301 where
26302 T: std::convert::Into<crate::model::LocationPreference>,
26303 {
26304 self.location_preference = std::option::Option::Some(v.into());
26305 self
26306 }
26307
26308 /// Sets or clears the value of [location_preference][crate::model::Settings::location_preference].
26309 ///
26310 /// # Example
26311 /// ```ignore,no_run
26312 /// # use google_cloud_sql_v1::model::Settings;
26313 /// use google_cloud_sql_v1::model::LocationPreference;
26314 /// let x = Settings::new().set_or_clear_location_preference(Some(LocationPreference::default()/* use setters */));
26315 /// let x = Settings::new().set_or_clear_location_preference(None::<LocationPreference>);
26316 /// ```
26317 pub fn set_or_clear_location_preference<T>(mut self, v: std::option::Option<T>) -> Self
26318 where
26319 T: std::convert::Into<crate::model::LocationPreference>,
26320 {
26321 self.location_preference = v.map(|x| x.into());
26322 self
26323 }
26324
26325 /// Sets the value of [database_flags][crate::model::Settings::database_flags].
26326 ///
26327 /// # Example
26328 /// ```ignore,no_run
26329 /// # use google_cloud_sql_v1::model::Settings;
26330 /// use google_cloud_sql_v1::model::DatabaseFlags;
26331 /// let x = Settings::new()
26332 /// .set_database_flags([
26333 /// DatabaseFlags::default()/* use setters */,
26334 /// DatabaseFlags::default()/* use (different) setters */,
26335 /// ]);
26336 /// ```
26337 pub fn set_database_flags<T, V>(mut self, v: T) -> Self
26338 where
26339 T: std::iter::IntoIterator<Item = V>,
26340 V: std::convert::Into<crate::model::DatabaseFlags>,
26341 {
26342 use std::iter::Iterator;
26343 self.database_flags = v.into_iter().map(|i| i.into()).collect();
26344 self
26345 }
26346
26347 /// Sets the value of [data_disk_type][crate::model::Settings::data_disk_type].
26348 ///
26349 /// # Example
26350 /// ```ignore,no_run
26351 /// # use google_cloud_sql_v1::model::Settings;
26352 /// use google_cloud_sql_v1::model::SqlDataDiskType;
26353 /// let x0 = Settings::new().set_data_disk_type(SqlDataDiskType::PdSsd);
26354 /// let x1 = Settings::new().set_data_disk_type(SqlDataDiskType::PdHdd);
26355 /// let x2 = Settings::new().set_data_disk_type(SqlDataDiskType::HyperdiskBalanced);
26356 /// ```
26357 pub fn set_data_disk_type<T: std::convert::Into<crate::model::SqlDataDiskType>>(
26358 mut self,
26359 v: T,
26360 ) -> Self {
26361 self.data_disk_type = v.into();
26362 self
26363 }
26364
26365 /// Sets the value of [maintenance_window][crate::model::Settings::maintenance_window].
26366 ///
26367 /// # Example
26368 /// ```ignore,no_run
26369 /// # use google_cloud_sql_v1::model::Settings;
26370 /// use google_cloud_sql_v1::model::MaintenanceWindow;
26371 /// let x = Settings::new().set_maintenance_window(MaintenanceWindow::default()/* use setters */);
26372 /// ```
26373 pub fn set_maintenance_window<T>(mut self, v: T) -> Self
26374 where
26375 T: std::convert::Into<crate::model::MaintenanceWindow>,
26376 {
26377 self.maintenance_window = std::option::Option::Some(v.into());
26378 self
26379 }
26380
26381 /// Sets or clears the value of [maintenance_window][crate::model::Settings::maintenance_window].
26382 ///
26383 /// # Example
26384 /// ```ignore,no_run
26385 /// # use google_cloud_sql_v1::model::Settings;
26386 /// use google_cloud_sql_v1::model::MaintenanceWindow;
26387 /// let x = Settings::new().set_or_clear_maintenance_window(Some(MaintenanceWindow::default()/* use setters */));
26388 /// let x = Settings::new().set_or_clear_maintenance_window(None::<MaintenanceWindow>);
26389 /// ```
26390 pub fn set_or_clear_maintenance_window<T>(mut self, v: std::option::Option<T>) -> Self
26391 where
26392 T: std::convert::Into<crate::model::MaintenanceWindow>,
26393 {
26394 self.maintenance_window = v.map(|x| x.into());
26395 self
26396 }
26397
26398 /// Sets the value of [backup_configuration][crate::model::Settings::backup_configuration].
26399 ///
26400 /// # Example
26401 /// ```ignore,no_run
26402 /// # use google_cloud_sql_v1::model::Settings;
26403 /// use google_cloud_sql_v1::model::BackupConfiguration;
26404 /// let x = Settings::new().set_backup_configuration(BackupConfiguration::default()/* use setters */);
26405 /// ```
26406 pub fn set_backup_configuration<T>(mut self, v: T) -> Self
26407 where
26408 T: std::convert::Into<crate::model::BackupConfiguration>,
26409 {
26410 self.backup_configuration = std::option::Option::Some(v.into());
26411 self
26412 }
26413
26414 /// Sets or clears the value of [backup_configuration][crate::model::Settings::backup_configuration].
26415 ///
26416 /// # Example
26417 /// ```ignore,no_run
26418 /// # use google_cloud_sql_v1::model::Settings;
26419 /// use google_cloud_sql_v1::model::BackupConfiguration;
26420 /// let x = Settings::new().set_or_clear_backup_configuration(Some(BackupConfiguration::default()/* use setters */));
26421 /// let x = Settings::new().set_or_clear_backup_configuration(None::<BackupConfiguration>);
26422 /// ```
26423 pub fn set_or_clear_backup_configuration<T>(mut self, v: std::option::Option<T>) -> Self
26424 where
26425 T: std::convert::Into<crate::model::BackupConfiguration>,
26426 {
26427 self.backup_configuration = v.map(|x| x.into());
26428 self
26429 }
26430
26431 /// Sets the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26432 ///
26433 /// # Example
26434 /// ```ignore,no_run
26435 /// # use google_cloud_sql_v1::model::Settings;
26436 /// use wkt::BoolValue;
26437 /// let x = Settings::new().set_database_replication_enabled(BoolValue::default()/* use setters */);
26438 /// ```
26439 pub fn set_database_replication_enabled<T>(mut self, v: T) -> Self
26440 where
26441 T: std::convert::Into<wkt::BoolValue>,
26442 {
26443 self.database_replication_enabled = std::option::Option::Some(v.into());
26444 self
26445 }
26446
26447 /// Sets or clears the value of [database_replication_enabled][crate::model::Settings::database_replication_enabled].
26448 ///
26449 /// # Example
26450 /// ```ignore,no_run
26451 /// # use google_cloud_sql_v1::model::Settings;
26452 /// use wkt::BoolValue;
26453 /// let x = Settings::new().set_or_clear_database_replication_enabled(Some(BoolValue::default()/* use setters */));
26454 /// let x = Settings::new().set_or_clear_database_replication_enabled(None::<BoolValue>);
26455 /// ```
26456 pub fn set_or_clear_database_replication_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26457 where
26458 T: std::convert::Into<wkt::BoolValue>,
26459 {
26460 self.database_replication_enabled = v.map(|x| x.into());
26461 self
26462 }
26463
26464 /// Sets the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26465 ///
26466 /// # Example
26467 /// ```ignore,no_run
26468 /// # use google_cloud_sql_v1::model::Settings;
26469 /// use wkt::BoolValue;
26470 /// let x = Settings::new().set_crash_safe_replication_enabled(BoolValue::default()/* use setters */);
26471 /// ```
26472 #[deprecated]
26473 pub fn set_crash_safe_replication_enabled<T>(mut self, v: T) -> Self
26474 where
26475 T: std::convert::Into<wkt::BoolValue>,
26476 {
26477 self.crash_safe_replication_enabled = std::option::Option::Some(v.into());
26478 self
26479 }
26480
26481 /// Sets or clears the value of [crash_safe_replication_enabled][crate::model::Settings::crash_safe_replication_enabled].
26482 ///
26483 /// # Example
26484 /// ```ignore,no_run
26485 /// # use google_cloud_sql_v1::model::Settings;
26486 /// use wkt::BoolValue;
26487 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(Some(BoolValue::default()/* use setters */));
26488 /// let x = Settings::new().set_or_clear_crash_safe_replication_enabled(None::<BoolValue>);
26489 /// ```
26490 #[deprecated]
26491 pub fn set_or_clear_crash_safe_replication_enabled<T>(
26492 mut self,
26493 v: std::option::Option<T>,
26494 ) -> Self
26495 where
26496 T: std::convert::Into<wkt::BoolValue>,
26497 {
26498 self.crash_safe_replication_enabled = v.map(|x| x.into());
26499 self
26500 }
26501
26502 /// Sets the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26503 ///
26504 /// # Example
26505 /// ```ignore,no_run
26506 /// # use google_cloud_sql_v1::model::Settings;
26507 /// use wkt::Int64Value;
26508 /// let x = Settings::new().set_data_disk_size_gb(Int64Value::default()/* use setters */);
26509 /// ```
26510 pub fn set_data_disk_size_gb<T>(mut self, v: T) -> Self
26511 where
26512 T: std::convert::Into<wkt::Int64Value>,
26513 {
26514 self.data_disk_size_gb = std::option::Option::Some(v.into());
26515 self
26516 }
26517
26518 /// Sets or clears the value of [data_disk_size_gb][crate::model::Settings::data_disk_size_gb].
26519 ///
26520 /// # Example
26521 /// ```ignore,no_run
26522 /// # use google_cloud_sql_v1::model::Settings;
26523 /// use wkt::Int64Value;
26524 /// let x = Settings::new().set_or_clear_data_disk_size_gb(Some(Int64Value::default()/* use setters */));
26525 /// let x = Settings::new().set_or_clear_data_disk_size_gb(None::<Int64Value>);
26526 /// ```
26527 pub fn set_or_clear_data_disk_size_gb<T>(mut self, v: std::option::Option<T>) -> Self
26528 where
26529 T: std::convert::Into<wkt::Int64Value>,
26530 {
26531 self.data_disk_size_gb = v.map(|x| x.into());
26532 self
26533 }
26534
26535 /// Sets the value of [active_directory_config][crate::model::Settings::active_directory_config].
26536 ///
26537 /// # Example
26538 /// ```ignore,no_run
26539 /// # use google_cloud_sql_v1::model::Settings;
26540 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26541 /// let x = Settings::new().set_active_directory_config(SqlActiveDirectoryConfig::default()/* use setters */);
26542 /// ```
26543 pub fn set_active_directory_config<T>(mut self, v: T) -> Self
26544 where
26545 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26546 {
26547 self.active_directory_config = std::option::Option::Some(v.into());
26548 self
26549 }
26550
26551 /// Sets or clears the value of [active_directory_config][crate::model::Settings::active_directory_config].
26552 ///
26553 /// # Example
26554 /// ```ignore,no_run
26555 /// # use google_cloud_sql_v1::model::Settings;
26556 /// use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
26557 /// let x = Settings::new().set_or_clear_active_directory_config(Some(SqlActiveDirectoryConfig::default()/* use setters */));
26558 /// let x = Settings::new().set_or_clear_active_directory_config(None::<SqlActiveDirectoryConfig>);
26559 /// ```
26560 pub fn set_or_clear_active_directory_config<T>(mut self, v: std::option::Option<T>) -> Self
26561 where
26562 T: std::convert::Into<crate::model::SqlActiveDirectoryConfig>,
26563 {
26564 self.active_directory_config = v.map(|x| x.into());
26565 self
26566 }
26567
26568 /// Sets the value of [collation][crate::model::Settings::collation].
26569 ///
26570 /// # Example
26571 /// ```ignore,no_run
26572 /// # use google_cloud_sql_v1::model::Settings;
26573 /// let x = Settings::new().set_collation("example");
26574 /// ```
26575 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26576 self.collation = v.into();
26577 self
26578 }
26579
26580 /// Sets the value of [deny_maintenance_periods][crate::model::Settings::deny_maintenance_periods].
26581 ///
26582 /// # Example
26583 /// ```ignore,no_run
26584 /// # use google_cloud_sql_v1::model::Settings;
26585 /// use google_cloud_sql_v1::model::DenyMaintenancePeriod;
26586 /// let x = Settings::new()
26587 /// .set_deny_maintenance_periods([
26588 /// DenyMaintenancePeriod::default()/* use setters */,
26589 /// DenyMaintenancePeriod::default()/* use (different) setters */,
26590 /// ]);
26591 /// ```
26592 pub fn set_deny_maintenance_periods<T, V>(mut self, v: T) -> Self
26593 where
26594 T: std::iter::IntoIterator<Item = V>,
26595 V: std::convert::Into<crate::model::DenyMaintenancePeriod>,
26596 {
26597 use std::iter::Iterator;
26598 self.deny_maintenance_periods = v.into_iter().map(|i| i.into()).collect();
26599 self
26600 }
26601
26602 /// Sets the value of [insights_config][crate::model::Settings::insights_config].
26603 ///
26604 /// # Example
26605 /// ```ignore,no_run
26606 /// # use google_cloud_sql_v1::model::Settings;
26607 /// use google_cloud_sql_v1::model::InsightsConfig;
26608 /// let x = Settings::new().set_insights_config(InsightsConfig::default()/* use setters */);
26609 /// ```
26610 pub fn set_insights_config<T>(mut self, v: T) -> Self
26611 where
26612 T: std::convert::Into<crate::model::InsightsConfig>,
26613 {
26614 self.insights_config = std::option::Option::Some(v.into());
26615 self
26616 }
26617
26618 /// Sets or clears the value of [insights_config][crate::model::Settings::insights_config].
26619 ///
26620 /// # Example
26621 /// ```ignore,no_run
26622 /// # use google_cloud_sql_v1::model::Settings;
26623 /// use google_cloud_sql_v1::model::InsightsConfig;
26624 /// let x = Settings::new().set_or_clear_insights_config(Some(InsightsConfig::default()/* use setters */));
26625 /// let x = Settings::new().set_or_clear_insights_config(None::<InsightsConfig>);
26626 /// ```
26627 pub fn set_or_clear_insights_config<T>(mut self, v: std::option::Option<T>) -> Self
26628 where
26629 T: std::convert::Into<crate::model::InsightsConfig>,
26630 {
26631 self.insights_config = v.map(|x| x.into());
26632 self
26633 }
26634
26635 /// Sets the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26636 ///
26637 /// # Example
26638 /// ```ignore,no_run
26639 /// # use google_cloud_sql_v1::model::Settings;
26640 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26641 /// let x = Settings::new().set_password_validation_policy(PasswordValidationPolicy::default()/* use setters */);
26642 /// ```
26643 pub fn set_password_validation_policy<T>(mut self, v: T) -> Self
26644 where
26645 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26646 {
26647 self.password_validation_policy = std::option::Option::Some(v.into());
26648 self
26649 }
26650
26651 /// Sets or clears the value of [password_validation_policy][crate::model::Settings::password_validation_policy].
26652 ///
26653 /// # Example
26654 /// ```ignore,no_run
26655 /// # use google_cloud_sql_v1::model::Settings;
26656 /// use google_cloud_sql_v1::model::PasswordValidationPolicy;
26657 /// let x = Settings::new().set_or_clear_password_validation_policy(Some(PasswordValidationPolicy::default()/* use setters */));
26658 /// let x = Settings::new().set_or_clear_password_validation_policy(None::<PasswordValidationPolicy>);
26659 /// ```
26660 pub fn set_or_clear_password_validation_policy<T>(mut self, v: std::option::Option<T>) -> Self
26661 where
26662 T: std::convert::Into<crate::model::PasswordValidationPolicy>,
26663 {
26664 self.password_validation_policy = v.map(|x| x.into());
26665 self
26666 }
26667
26668 /// Sets the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26669 ///
26670 /// # Example
26671 /// ```ignore,no_run
26672 /// # use google_cloud_sql_v1::model::Settings;
26673 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26674 /// let x = Settings::new().set_sql_server_audit_config(SqlServerAuditConfig::default()/* use setters */);
26675 /// ```
26676 pub fn set_sql_server_audit_config<T>(mut self, v: T) -> Self
26677 where
26678 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26679 {
26680 self.sql_server_audit_config = std::option::Option::Some(v.into());
26681 self
26682 }
26683
26684 /// Sets or clears the value of [sql_server_audit_config][crate::model::Settings::sql_server_audit_config].
26685 ///
26686 /// # Example
26687 /// ```ignore,no_run
26688 /// # use google_cloud_sql_v1::model::Settings;
26689 /// use google_cloud_sql_v1::model::SqlServerAuditConfig;
26690 /// let x = Settings::new().set_or_clear_sql_server_audit_config(Some(SqlServerAuditConfig::default()/* use setters */));
26691 /// let x = Settings::new().set_or_clear_sql_server_audit_config(None::<SqlServerAuditConfig>);
26692 /// ```
26693 pub fn set_or_clear_sql_server_audit_config<T>(mut self, v: std::option::Option<T>) -> Self
26694 where
26695 T: std::convert::Into<crate::model::SqlServerAuditConfig>,
26696 {
26697 self.sql_server_audit_config = v.map(|x| x.into());
26698 self
26699 }
26700
26701 /// Sets the value of [edition][crate::model::Settings::edition].
26702 ///
26703 /// # Example
26704 /// ```ignore,no_run
26705 /// # use google_cloud_sql_v1::model::Settings;
26706 /// use google_cloud_sql_v1::model::settings::Edition;
26707 /// let x0 = Settings::new().set_edition(Edition::Enterprise);
26708 /// let x1 = Settings::new().set_edition(Edition::EnterprisePlus);
26709 /// ```
26710 pub fn set_edition<T: std::convert::Into<crate::model::settings::Edition>>(
26711 mut self,
26712 v: T,
26713 ) -> Self {
26714 self.edition = v.into();
26715 self
26716 }
26717
26718 /// Sets the value of [connector_enforcement][crate::model::Settings::connector_enforcement].
26719 ///
26720 /// # Example
26721 /// ```ignore,no_run
26722 /// # use google_cloud_sql_v1::model::Settings;
26723 /// use google_cloud_sql_v1::model::settings::ConnectorEnforcement;
26724 /// let x0 = Settings::new().set_connector_enforcement(ConnectorEnforcement::NotRequired);
26725 /// let x1 = Settings::new().set_connector_enforcement(ConnectorEnforcement::Required);
26726 /// ```
26727 pub fn set_connector_enforcement<
26728 T: std::convert::Into<crate::model::settings::ConnectorEnforcement>,
26729 >(
26730 mut self,
26731 v: T,
26732 ) -> Self {
26733 self.connector_enforcement = v.into();
26734 self
26735 }
26736
26737 /// Sets the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26738 ///
26739 /// # Example
26740 /// ```ignore,no_run
26741 /// # use google_cloud_sql_v1::model::Settings;
26742 /// use wkt::BoolValue;
26743 /// let x = Settings::new().set_deletion_protection_enabled(BoolValue::default()/* use setters */);
26744 /// ```
26745 pub fn set_deletion_protection_enabled<T>(mut self, v: T) -> Self
26746 where
26747 T: std::convert::Into<wkt::BoolValue>,
26748 {
26749 self.deletion_protection_enabled = std::option::Option::Some(v.into());
26750 self
26751 }
26752
26753 /// Sets or clears the value of [deletion_protection_enabled][crate::model::Settings::deletion_protection_enabled].
26754 ///
26755 /// # Example
26756 /// ```ignore,no_run
26757 /// # use google_cloud_sql_v1::model::Settings;
26758 /// use wkt::BoolValue;
26759 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(Some(BoolValue::default()/* use setters */));
26760 /// let x = Settings::new().set_or_clear_deletion_protection_enabled(None::<BoolValue>);
26761 /// ```
26762 pub fn set_or_clear_deletion_protection_enabled<T>(mut self, v: std::option::Option<T>) -> Self
26763 where
26764 T: std::convert::Into<wkt::BoolValue>,
26765 {
26766 self.deletion_protection_enabled = v.map(|x| x.into());
26767 self
26768 }
26769
26770 /// Sets the value of [time_zone][crate::model::Settings::time_zone].
26771 ///
26772 /// # Example
26773 /// ```ignore,no_run
26774 /// # use google_cloud_sql_v1::model::Settings;
26775 /// let x = Settings::new().set_time_zone("example");
26776 /// ```
26777 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
26778 self.time_zone = v.into();
26779 self
26780 }
26781
26782 /// Sets the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
26783 ///
26784 /// # Example
26785 /// ```ignore,no_run
26786 /// # use google_cloud_sql_v1::model::Settings;
26787 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
26788 /// let x = Settings::new().set_advanced_machine_features(AdvancedMachineFeatures::default()/* use setters */);
26789 /// ```
26790 pub fn set_advanced_machine_features<T>(mut self, v: T) -> Self
26791 where
26792 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
26793 {
26794 self.advanced_machine_features = std::option::Option::Some(v.into());
26795 self
26796 }
26797
26798 /// Sets or clears the value of [advanced_machine_features][crate::model::Settings::advanced_machine_features].
26799 ///
26800 /// # Example
26801 /// ```ignore,no_run
26802 /// # use google_cloud_sql_v1::model::Settings;
26803 /// use google_cloud_sql_v1::model::AdvancedMachineFeatures;
26804 /// let x = Settings::new().set_or_clear_advanced_machine_features(Some(AdvancedMachineFeatures::default()/* use setters */));
26805 /// let x = Settings::new().set_or_clear_advanced_machine_features(None::<AdvancedMachineFeatures>);
26806 /// ```
26807 pub fn set_or_clear_advanced_machine_features<T>(mut self, v: std::option::Option<T>) -> Self
26808 where
26809 T: std::convert::Into<crate::model::AdvancedMachineFeatures>,
26810 {
26811 self.advanced_machine_features = v.map(|x| x.into());
26812 self
26813 }
26814
26815 /// Sets the value of [data_cache_config][crate::model::Settings::data_cache_config].
26816 ///
26817 /// # Example
26818 /// ```ignore,no_run
26819 /// # use google_cloud_sql_v1::model::Settings;
26820 /// use google_cloud_sql_v1::model::DataCacheConfig;
26821 /// let x = Settings::new().set_data_cache_config(DataCacheConfig::default()/* use setters */);
26822 /// ```
26823 pub fn set_data_cache_config<T>(mut self, v: T) -> Self
26824 where
26825 T: std::convert::Into<crate::model::DataCacheConfig>,
26826 {
26827 self.data_cache_config = std::option::Option::Some(v.into());
26828 self
26829 }
26830
26831 /// Sets or clears the value of [data_cache_config][crate::model::Settings::data_cache_config].
26832 ///
26833 /// # Example
26834 /// ```ignore,no_run
26835 /// # use google_cloud_sql_v1::model::Settings;
26836 /// use google_cloud_sql_v1::model::DataCacheConfig;
26837 /// let x = Settings::new().set_or_clear_data_cache_config(Some(DataCacheConfig::default()/* use setters */));
26838 /// let x = Settings::new().set_or_clear_data_cache_config(None::<DataCacheConfig>);
26839 /// ```
26840 pub fn set_or_clear_data_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
26841 where
26842 T: std::convert::Into<crate::model::DataCacheConfig>,
26843 {
26844 self.data_cache_config = v.map(|x| x.into());
26845 self
26846 }
26847
26848 /// Sets the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
26849 ///
26850 /// # Example
26851 /// ```ignore,no_run
26852 /// # use google_cloud_sql_v1::model::Settings;
26853 /// use wkt::Int32Value;
26854 /// let x = Settings::new().set_replication_lag_max_seconds(Int32Value::default()/* use setters */);
26855 /// ```
26856 pub fn set_replication_lag_max_seconds<T>(mut self, v: T) -> Self
26857 where
26858 T: std::convert::Into<wkt::Int32Value>,
26859 {
26860 self.replication_lag_max_seconds = std::option::Option::Some(v.into());
26861 self
26862 }
26863
26864 /// Sets or clears the value of [replication_lag_max_seconds][crate::model::Settings::replication_lag_max_seconds].
26865 ///
26866 /// # Example
26867 /// ```ignore,no_run
26868 /// # use google_cloud_sql_v1::model::Settings;
26869 /// use wkt::Int32Value;
26870 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(Some(Int32Value::default()/* use setters */));
26871 /// let x = Settings::new().set_or_clear_replication_lag_max_seconds(None::<Int32Value>);
26872 /// ```
26873 pub fn set_or_clear_replication_lag_max_seconds<T>(mut self, v: std::option::Option<T>) -> Self
26874 where
26875 T: std::convert::Into<wkt::Int32Value>,
26876 {
26877 self.replication_lag_max_seconds = v.map(|x| x.into());
26878 self
26879 }
26880
26881 /// Sets the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
26882 ///
26883 /// # Example
26884 /// ```ignore,no_run
26885 /// # use google_cloud_sql_v1::model::Settings;
26886 /// use wkt::BoolValue;
26887 /// let x = Settings::new().set_enable_google_ml_integration(BoolValue::default()/* use setters */);
26888 /// ```
26889 pub fn set_enable_google_ml_integration<T>(mut self, v: T) -> Self
26890 where
26891 T: std::convert::Into<wkt::BoolValue>,
26892 {
26893 self.enable_google_ml_integration = std::option::Option::Some(v.into());
26894 self
26895 }
26896
26897 /// Sets or clears the value of [enable_google_ml_integration][crate::model::Settings::enable_google_ml_integration].
26898 ///
26899 /// # Example
26900 /// ```ignore,no_run
26901 /// # use google_cloud_sql_v1::model::Settings;
26902 /// use wkt::BoolValue;
26903 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(Some(BoolValue::default()/* use setters */));
26904 /// let x = Settings::new().set_or_clear_enable_google_ml_integration(None::<BoolValue>);
26905 /// ```
26906 pub fn set_or_clear_enable_google_ml_integration<T>(mut self, v: std::option::Option<T>) -> Self
26907 where
26908 T: std::convert::Into<wkt::BoolValue>,
26909 {
26910 self.enable_google_ml_integration = v.map(|x| x.into());
26911 self
26912 }
26913
26914 /// Sets the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
26915 ///
26916 /// # Example
26917 /// ```ignore,no_run
26918 /// # use google_cloud_sql_v1::model::Settings;
26919 /// use wkt::BoolValue;
26920 /// let x = Settings::new().set_enable_dataplex_integration(BoolValue::default()/* use setters */);
26921 /// ```
26922 pub fn set_enable_dataplex_integration<T>(mut self, v: T) -> Self
26923 where
26924 T: std::convert::Into<wkt::BoolValue>,
26925 {
26926 self.enable_dataplex_integration = std::option::Option::Some(v.into());
26927 self
26928 }
26929
26930 /// Sets or clears the value of [enable_dataplex_integration][crate::model::Settings::enable_dataplex_integration].
26931 ///
26932 /// # Example
26933 /// ```ignore,no_run
26934 /// # use google_cloud_sql_v1::model::Settings;
26935 /// use wkt::BoolValue;
26936 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(Some(BoolValue::default()/* use setters */));
26937 /// let x = Settings::new().set_or_clear_enable_dataplex_integration(None::<BoolValue>);
26938 /// ```
26939 pub fn set_or_clear_enable_dataplex_integration<T>(mut self, v: std::option::Option<T>) -> Self
26940 where
26941 T: std::convert::Into<wkt::BoolValue>,
26942 {
26943 self.enable_dataplex_integration = v.map(|x| x.into());
26944 self
26945 }
26946
26947 /// Sets the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
26948 ///
26949 /// # Example
26950 /// ```ignore,no_run
26951 /// # use google_cloud_sql_v1::model::Settings;
26952 /// use wkt::BoolValue;
26953 /// let x = Settings::new().set_retain_backups_on_delete(BoolValue::default()/* use setters */);
26954 /// ```
26955 pub fn set_retain_backups_on_delete<T>(mut self, v: T) -> Self
26956 where
26957 T: std::convert::Into<wkt::BoolValue>,
26958 {
26959 self.retain_backups_on_delete = std::option::Option::Some(v.into());
26960 self
26961 }
26962
26963 /// Sets or clears the value of [retain_backups_on_delete][crate::model::Settings::retain_backups_on_delete].
26964 ///
26965 /// # Example
26966 /// ```ignore,no_run
26967 /// # use google_cloud_sql_v1::model::Settings;
26968 /// use wkt::BoolValue;
26969 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(Some(BoolValue::default()/* use setters */));
26970 /// let x = Settings::new().set_or_clear_retain_backups_on_delete(None::<BoolValue>);
26971 /// ```
26972 pub fn set_or_clear_retain_backups_on_delete<T>(mut self, v: std::option::Option<T>) -> Self
26973 where
26974 T: std::convert::Into<wkt::BoolValue>,
26975 {
26976 self.retain_backups_on_delete = v.map(|x| x.into());
26977 self
26978 }
26979
26980 /// Sets the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
26981 ///
26982 /// # Example
26983 /// ```ignore,no_run
26984 /// # use google_cloud_sql_v1::model::Settings;
26985 /// let x = Settings::new().set_data_disk_provisioned_iops(42);
26986 /// ```
26987 pub fn set_data_disk_provisioned_iops<T>(mut self, v: T) -> Self
26988 where
26989 T: std::convert::Into<i64>,
26990 {
26991 self.data_disk_provisioned_iops = std::option::Option::Some(v.into());
26992 self
26993 }
26994
26995 /// Sets or clears the value of [data_disk_provisioned_iops][crate::model::Settings::data_disk_provisioned_iops].
26996 ///
26997 /// # Example
26998 /// ```ignore,no_run
26999 /// # use google_cloud_sql_v1::model::Settings;
27000 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(Some(42));
27001 /// let x = Settings::new().set_or_clear_data_disk_provisioned_iops(None::<i32>);
27002 /// ```
27003 pub fn set_or_clear_data_disk_provisioned_iops<T>(mut self, v: std::option::Option<T>) -> Self
27004 where
27005 T: std::convert::Into<i64>,
27006 {
27007 self.data_disk_provisioned_iops = v.map(|x| x.into());
27008 self
27009 }
27010
27011 /// Sets the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27012 ///
27013 /// # Example
27014 /// ```ignore,no_run
27015 /// # use google_cloud_sql_v1::model::Settings;
27016 /// let x = Settings::new().set_data_disk_provisioned_throughput(42);
27017 /// ```
27018 pub fn set_data_disk_provisioned_throughput<T>(mut self, v: T) -> Self
27019 where
27020 T: std::convert::Into<i64>,
27021 {
27022 self.data_disk_provisioned_throughput = std::option::Option::Some(v.into());
27023 self
27024 }
27025
27026 /// Sets or clears the value of [data_disk_provisioned_throughput][crate::model::Settings::data_disk_provisioned_throughput].
27027 ///
27028 /// # Example
27029 /// ```ignore,no_run
27030 /// # use google_cloud_sql_v1::model::Settings;
27031 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(Some(42));
27032 /// let x = Settings::new().set_or_clear_data_disk_provisioned_throughput(None::<i32>);
27033 /// ```
27034 pub fn set_or_clear_data_disk_provisioned_throughput<T>(
27035 mut self,
27036 v: std::option::Option<T>,
27037 ) -> Self
27038 where
27039 T: std::convert::Into<i64>,
27040 {
27041 self.data_disk_provisioned_throughput = v.map(|x| x.into());
27042 self
27043 }
27044
27045 /// Sets the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27046 ///
27047 /// # Example
27048 /// ```ignore,no_run
27049 /// # use google_cloud_sql_v1::model::Settings;
27050 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27051 /// let x = Settings::new().set_connection_pool_config(ConnectionPoolConfig::default()/* use setters */);
27052 /// ```
27053 pub fn set_connection_pool_config<T>(mut self, v: T) -> Self
27054 where
27055 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27056 {
27057 self.connection_pool_config = std::option::Option::Some(v.into());
27058 self
27059 }
27060
27061 /// Sets or clears the value of [connection_pool_config][crate::model::Settings::connection_pool_config].
27062 ///
27063 /// # Example
27064 /// ```ignore,no_run
27065 /// # use google_cloud_sql_v1::model::Settings;
27066 /// use google_cloud_sql_v1::model::ConnectionPoolConfig;
27067 /// let x = Settings::new().set_or_clear_connection_pool_config(Some(ConnectionPoolConfig::default()/* use setters */));
27068 /// let x = Settings::new().set_or_clear_connection_pool_config(None::<ConnectionPoolConfig>);
27069 /// ```
27070 pub fn set_or_clear_connection_pool_config<T>(mut self, v: std::option::Option<T>) -> Self
27071 where
27072 T: std::convert::Into<crate::model::ConnectionPoolConfig>,
27073 {
27074 self.connection_pool_config = v.map(|x| x.into());
27075 self
27076 }
27077
27078 /// Sets the value of [final_backup_config][crate::model::Settings::final_backup_config].
27079 ///
27080 /// # Example
27081 /// ```ignore,no_run
27082 /// # use google_cloud_sql_v1::model::Settings;
27083 /// use google_cloud_sql_v1::model::FinalBackupConfig;
27084 /// let x = Settings::new().set_final_backup_config(FinalBackupConfig::default()/* use setters */);
27085 /// ```
27086 pub fn set_final_backup_config<T>(mut self, v: T) -> Self
27087 where
27088 T: std::convert::Into<crate::model::FinalBackupConfig>,
27089 {
27090 self.final_backup_config = std::option::Option::Some(v.into());
27091 self
27092 }
27093
27094 /// Sets or clears the value of [final_backup_config][crate::model::Settings::final_backup_config].
27095 ///
27096 /// # Example
27097 /// ```ignore,no_run
27098 /// # use google_cloud_sql_v1::model::Settings;
27099 /// use google_cloud_sql_v1::model::FinalBackupConfig;
27100 /// let x = Settings::new().set_or_clear_final_backup_config(Some(FinalBackupConfig::default()/* use setters */));
27101 /// let x = Settings::new().set_or_clear_final_backup_config(None::<FinalBackupConfig>);
27102 /// ```
27103 pub fn set_or_clear_final_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
27104 where
27105 T: std::convert::Into<crate::model::FinalBackupConfig>,
27106 {
27107 self.final_backup_config = v.map(|x| x.into());
27108 self
27109 }
27110
27111 /// Sets the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27112 ///
27113 /// # Example
27114 /// ```ignore,no_run
27115 /// # use google_cloud_sql_v1::model::Settings;
27116 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27117 /// let x = Settings::new().set_read_pool_auto_scale_config(ReadPoolAutoScaleConfig::default()/* use setters */);
27118 /// ```
27119 pub fn set_read_pool_auto_scale_config<T>(mut self, v: T) -> Self
27120 where
27121 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27122 {
27123 self.read_pool_auto_scale_config = std::option::Option::Some(v.into());
27124 self
27125 }
27126
27127 /// Sets or clears the value of [read_pool_auto_scale_config][crate::model::Settings::read_pool_auto_scale_config].
27128 ///
27129 /// # Example
27130 /// ```ignore,no_run
27131 /// # use google_cloud_sql_v1::model::Settings;
27132 /// use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
27133 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(Some(ReadPoolAutoScaleConfig::default()/* use setters */));
27134 /// let x = Settings::new().set_or_clear_read_pool_auto_scale_config(None::<ReadPoolAutoScaleConfig>);
27135 /// ```
27136 pub fn set_or_clear_read_pool_auto_scale_config<T>(mut self, v: std::option::Option<T>) -> Self
27137 where
27138 T: std::convert::Into<crate::model::ReadPoolAutoScaleConfig>,
27139 {
27140 self.read_pool_auto_scale_config = v.map(|x| x.into());
27141 self
27142 }
27143
27144 /// Sets the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27145 ///
27146 /// # Example
27147 /// ```ignore,no_run
27148 /// # use google_cloud_sql_v1::model::Settings;
27149 /// let x = Settings::new().set_auto_upgrade_enabled(true);
27150 /// ```
27151 pub fn set_auto_upgrade_enabled<T>(mut self, v: T) -> Self
27152 where
27153 T: std::convert::Into<bool>,
27154 {
27155 self.auto_upgrade_enabled = std::option::Option::Some(v.into());
27156 self
27157 }
27158
27159 /// Sets or clears the value of [auto_upgrade_enabled][crate::model::Settings::auto_upgrade_enabled].
27160 ///
27161 /// # Example
27162 /// ```ignore,no_run
27163 /// # use google_cloud_sql_v1::model::Settings;
27164 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(Some(false));
27165 /// let x = Settings::new().set_or_clear_auto_upgrade_enabled(None::<bool>);
27166 /// ```
27167 pub fn set_or_clear_auto_upgrade_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27168 where
27169 T: std::convert::Into<bool>,
27170 {
27171 self.auto_upgrade_enabled = v.map(|x| x.into());
27172 self
27173 }
27174
27175 /// Sets the value of [entraid_config][crate::model::Settings::entraid_config].
27176 ///
27177 /// # Example
27178 /// ```ignore,no_run
27179 /// # use google_cloud_sql_v1::model::Settings;
27180 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27181 /// let x = Settings::new().set_entraid_config(SqlServerEntraIdConfig::default()/* use setters */);
27182 /// ```
27183 pub fn set_entraid_config<T>(mut self, v: T) -> Self
27184 where
27185 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27186 {
27187 self.entraid_config = std::option::Option::Some(v.into());
27188 self
27189 }
27190
27191 /// Sets or clears the value of [entraid_config][crate::model::Settings::entraid_config].
27192 ///
27193 /// # Example
27194 /// ```ignore,no_run
27195 /// # use google_cloud_sql_v1::model::Settings;
27196 /// use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
27197 /// let x = Settings::new().set_or_clear_entraid_config(Some(SqlServerEntraIdConfig::default()/* use setters */));
27198 /// let x = Settings::new().set_or_clear_entraid_config(None::<SqlServerEntraIdConfig>);
27199 /// ```
27200 pub fn set_or_clear_entraid_config<T>(mut self, v: std::option::Option<T>) -> Self
27201 where
27202 T: std::convert::Into<crate::model::SqlServerEntraIdConfig>,
27203 {
27204 self.entraid_config = v.map(|x| x.into());
27205 self
27206 }
27207
27208 /// Sets the value of [data_api_access][crate::model::Settings::data_api_access].
27209 ///
27210 /// # Example
27211 /// ```ignore,no_run
27212 /// # use google_cloud_sql_v1::model::Settings;
27213 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27214 /// let x0 = Settings::new().set_data_api_access(DataApiAccess::DisallowDataApi);
27215 /// let x1 = Settings::new().set_data_api_access(DataApiAccess::AllowDataApi);
27216 /// ```
27217 pub fn set_data_api_access<T>(mut self, v: T) -> Self
27218 where
27219 T: std::convert::Into<crate::model::settings::DataApiAccess>,
27220 {
27221 self.data_api_access = std::option::Option::Some(v.into());
27222 self
27223 }
27224
27225 /// Sets or clears the value of [data_api_access][crate::model::Settings::data_api_access].
27226 ///
27227 /// # Example
27228 /// ```ignore,no_run
27229 /// # use google_cloud_sql_v1::model::Settings;
27230 /// use google_cloud_sql_v1::model::settings::DataApiAccess;
27231 /// let x0 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::DisallowDataApi));
27232 /// let x1 = Settings::new().set_or_clear_data_api_access(Some(DataApiAccess::AllowDataApi));
27233 /// let x_none = Settings::new().set_or_clear_data_api_access(None::<DataApiAccess>);
27234 /// ```
27235 pub fn set_or_clear_data_api_access<T>(mut self, v: std::option::Option<T>) -> Self
27236 where
27237 T: std::convert::Into<crate::model::settings::DataApiAccess>,
27238 {
27239 self.data_api_access = v.map(|x| x.into());
27240 self
27241 }
27242
27243 /// Sets the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27244 ///
27245 /// # Example
27246 /// ```ignore,no_run
27247 /// # use google_cloud_sql_v1::model::Settings;
27248 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27249 /// let x = Settings::new().set_performance_capture_config(PerformanceCaptureConfig::default()/* use setters */);
27250 /// ```
27251 pub fn set_performance_capture_config<T>(mut self, v: T) -> Self
27252 where
27253 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27254 {
27255 self.performance_capture_config = std::option::Option::Some(v.into());
27256 self
27257 }
27258
27259 /// Sets or clears the value of [performance_capture_config][crate::model::Settings::performance_capture_config].
27260 ///
27261 /// # Example
27262 /// ```ignore,no_run
27263 /// # use google_cloud_sql_v1::model::Settings;
27264 /// use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27265 /// let x = Settings::new().set_or_clear_performance_capture_config(Some(PerformanceCaptureConfig::default()/* use setters */));
27266 /// let x = Settings::new().set_or_clear_performance_capture_config(None::<PerformanceCaptureConfig>);
27267 /// ```
27268 pub fn set_or_clear_performance_capture_config<T>(mut self, v: std::option::Option<T>) -> Self
27269 where
27270 T: std::convert::Into<crate::model::PerformanceCaptureConfig>,
27271 {
27272 self.performance_capture_config = v.map(|x| x.into());
27273 self
27274 }
27275}
27276
27277impl wkt::message::Message for Settings {
27278 fn typename() -> &'static str {
27279 "type.googleapis.com/google.cloud.sql.v1.Settings"
27280 }
27281}
27282
27283/// Defines additional types related to [Settings].
27284pub mod settings {
27285 #[allow(unused_imports)]
27286 use super::*;
27287
27288 /// Specifies when the instance is activated.
27289 ///
27290 /// # Working with unknown values
27291 ///
27292 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27293 /// additional enum variants at any time. Adding new variants is not considered
27294 /// a breaking change. Applications should write their code in anticipation of:
27295 ///
27296 /// - New values appearing in future releases of the client library, **and**
27297 /// - New values received dynamically, without application changes.
27298 ///
27299 /// Please consult the [Working with enums] section in the user guide for some
27300 /// guidelines.
27301 ///
27302 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27303 #[derive(Clone, Debug, PartialEq)]
27304 #[non_exhaustive]
27305 pub enum SqlActivationPolicy {
27306 /// Unknown activation plan.
27307 Unspecified,
27308 /// The instance is always up and running.
27309 Always,
27310 /// The instance never starts.
27311 Never,
27312 /// The instance starts upon receiving requests.
27313 #[deprecated]
27314 OnDemand,
27315 /// If set, the enum was initialized with an unknown value.
27316 ///
27317 /// Applications can examine the value using [SqlActivationPolicy::value] or
27318 /// [SqlActivationPolicy::name].
27319 UnknownValue(sql_activation_policy::UnknownValue),
27320 }
27321
27322 #[doc(hidden)]
27323 pub mod sql_activation_policy {
27324 #[allow(unused_imports)]
27325 use super::*;
27326 #[derive(Clone, Debug, PartialEq)]
27327 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27328 }
27329
27330 impl SqlActivationPolicy {
27331 /// Gets the enum value.
27332 ///
27333 /// Returns `None` if the enum contains an unknown value deserialized from
27334 /// the string representation of enums.
27335 pub fn value(&self) -> std::option::Option<i32> {
27336 match self {
27337 Self::Unspecified => std::option::Option::Some(0),
27338 Self::Always => std::option::Option::Some(1),
27339 Self::Never => std::option::Option::Some(2),
27340 Self::OnDemand => std::option::Option::Some(3),
27341 Self::UnknownValue(u) => u.0.value(),
27342 }
27343 }
27344
27345 /// Gets the enum value as a string.
27346 ///
27347 /// Returns `None` if the enum contains an unknown value deserialized from
27348 /// the integer representation of enums.
27349 pub fn name(&self) -> std::option::Option<&str> {
27350 match self {
27351 Self::Unspecified => std::option::Option::Some("SQL_ACTIVATION_POLICY_UNSPECIFIED"),
27352 Self::Always => std::option::Option::Some("ALWAYS"),
27353 Self::Never => std::option::Option::Some("NEVER"),
27354 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
27355 Self::UnknownValue(u) => u.0.name(),
27356 }
27357 }
27358 }
27359
27360 impl std::default::Default for SqlActivationPolicy {
27361 fn default() -> Self {
27362 use std::convert::From;
27363 Self::from(0)
27364 }
27365 }
27366
27367 impl std::fmt::Display for SqlActivationPolicy {
27368 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27369 wkt::internal::display_enum(f, self.name(), self.value())
27370 }
27371 }
27372
27373 impl std::convert::From<i32> for SqlActivationPolicy {
27374 fn from(value: i32) -> Self {
27375 match value {
27376 0 => Self::Unspecified,
27377 1 => Self::Always,
27378 2 => Self::Never,
27379 3 => Self::OnDemand,
27380 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27381 wkt::internal::UnknownEnumValue::Integer(value),
27382 )),
27383 }
27384 }
27385 }
27386
27387 impl std::convert::From<&str> for SqlActivationPolicy {
27388 fn from(value: &str) -> Self {
27389 use std::string::ToString;
27390 match value {
27391 "SQL_ACTIVATION_POLICY_UNSPECIFIED" => Self::Unspecified,
27392 "ALWAYS" => Self::Always,
27393 "NEVER" => Self::Never,
27394 "ON_DEMAND" => Self::OnDemand,
27395 _ => Self::UnknownValue(sql_activation_policy::UnknownValue(
27396 wkt::internal::UnknownEnumValue::String(value.to_string()),
27397 )),
27398 }
27399 }
27400 }
27401
27402 impl serde::ser::Serialize for SqlActivationPolicy {
27403 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27404 where
27405 S: serde::Serializer,
27406 {
27407 match self {
27408 Self::Unspecified => serializer.serialize_i32(0),
27409 Self::Always => serializer.serialize_i32(1),
27410 Self::Never => serializer.serialize_i32(2),
27411 Self::OnDemand => serializer.serialize_i32(3),
27412 Self::UnknownValue(u) => u.0.serialize(serializer),
27413 }
27414 }
27415 }
27416
27417 impl<'de> serde::de::Deserialize<'de> for SqlActivationPolicy {
27418 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27419 where
27420 D: serde::Deserializer<'de>,
27421 {
27422 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlActivationPolicy>::new(
27423 ".google.cloud.sql.v1.Settings.SqlActivationPolicy",
27424 ))
27425 }
27426 }
27427
27428 /// The edition of the instance.
27429 ///
27430 /// # Working with unknown values
27431 ///
27432 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27433 /// additional enum variants at any time. Adding new variants is not considered
27434 /// a breaking change. Applications should write their code in anticipation of:
27435 ///
27436 /// - New values appearing in future releases of the client library, **and**
27437 /// - New values received dynamically, without application changes.
27438 ///
27439 /// Please consult the [Working with enums] section in the user guide for some
27440 /// guidelines.
27441 ///
27442 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27443 #[derive(Clone, Debug, PartialEq)]
27444 #[non_exhaustive]
27445 pub enum Edition {
27446 /// The instance did not specify the edition.
27447 Unspecified,
27448 /// The instance is an enterprise edition.
27449 Enterprise,
27450 /// The instance is an Enterprise Plus edition.
27451 EnterprisePlus,
27452 /// If set, the enum was initialized with an unknown value.
27453 ///
27454 /// Applications can examine the value using [Edition::value] or
27455 /// [Edition::name].
27456 UnknownValue(edition::UnknownValue),
27457 }
27458
27459 #[doc(hidden)]
27460 pub mod edition {
27461 #[allow(unused_imports)]
27462 use super::*;
27463 #[derive(Clone, Debug, PartialEq)]
27464 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27465 }
27466
27467 impl Edition {
27468 /// Gets the enum value.
27469 ///
27470 /// Returns `None` if the enum contains an unknown value deserialized from
27471 /// the string representation of enums.
27472 pub fn value(&self) -> std::option::Option<i32> {
27473 match self {
27474 Self::Unspecified => std::option::Option::Some(0),
27475 Self::Enterprise => std::option::Option::Some(2),
27476 Self::EnterprisePlus => std::option::Option::Some(3),
27477 Self::UnknownValue(u) => u.0.value(),
27478 }
27479 }
27480
27481 /// Gets the enum value as a string.
27482 ///
27483 /// Returns `None` if the enum contains an unknown value deserialized from
27484 /// the integer representation of enums.
27485 pub fn name(&self) -> std::option::Option<&str> {
27486 match self {
27487 Self::Unspecified => std::option::Option::Some("EDITION_UNSPECIFIED"),
27488 Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
27489 Self::EnterprisePlus => std::option::Option::Some("ENTERPRISE_PLUS"),
27490 Self::UnknownValue(u) => u.0.name(),
27491 }
27492 }
27493 }
27494
27495 impl std::default::Default for Edition {
27496 fn default() -> Self {
27497 use std::convert::From;
27498 Self::from(0)
27499 }
27500 }
27501
27502 impl std::fmt::Display for Edition {
27503 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27504 wkt::internal::display_enum(f, self.name(), self.value())
27505 }
27506 }
27507
27508 impl std::convert::From<i32> for Edition {
27509 fn from(value: i32) -> Self {
27510 match value {
27511 0 => Self::Unspecified,
27512 2 => Self::Enterprise,
27513 3 => Self::EnterprisePlus,
27514 _ => Self::UnknownValue(edition::UnknownValue(
27515 wkt::internal::UnknownEnumValue::Integer(value),
27516 )),
27517 }
27518 }
27519 }
27520
27521 impl std::convert::From<&str> for Edition {
27522 fn from(value: &str) -> Self {
27523 use std::string::ToString;
27524 match value {
27525 "EDITION_UNSPECIFIED" => Self::Unspecified,
27526 "ENTERPRISE" => Self::Enterprise,
27527 "ENTERPRISE_PLUS" => Self::EnterprisePlus,
27528 _ => Self::UnknownValue(edition::UnknownValue(
27529 wkt::internal::UnknownEnumValue::String(value.to_string()),
27530 )),
27531 }
27532 }
27533 }
27534
27535 impl serde::ser::Serialize for Edition {
27536 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27537 where
27538 S: serde::Serializer,
27539 {
27540 match self {
27541 Self::Unspecified => serializer.serialize_i32(0),
27542 Self::Enterprise => serializer.serialize_i32(2),
27543 Self::EnterprisePlus => serializer.serialize_i32(3),
27544 Self::UnknownValue(u) => u.0.serialize(serializer),
27545 }
27546 }
27547 }
27548
27549 impl<'de> serde::de::Deserialize<'de> for Edition {
27550 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27551 where
27552 D: serde::Deserializer<'de>,
27553 {
27554 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Edition>::new(
27555 ".google.cloud.sql.v1.Settings.Edition",
27556 ))
27557 }
27558 }
27559
27560 /// The options for enforcing Cloud SQL connectors in the instance.
27561 ///
27562 /// # Working with unknown values
27563 ///
27564 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27565 /// additional enum variants at any time. Adding new variants is not considered
27566 /// a breaking change. Applications should write their code in anticipation of:
27567 ///
27568 /// - New values appearing in future releases of the client library, **and**
27569 /// - New values received dynamically, without application changes.
27570 ///
27571 /// Please consult the [Working with enums] section in the user guide for some
27572 /// guidelines.
27573 ///
27574 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27575 #[derive(Clone, Debug, PartialEq)]
27576 #[non_exhaustive]
27577 pub enum ConnectorEnforcement {
27578 /// The requirement for Cloud SQL connectors is unknown.
27579 Unspecified,
27580 /// Do not require Cloud SQL connectors.
27581 NotRequired,
27582 /// Require all connections to use Cloud SQL connectors, including the
27583 /// Cloud SQL Auth Proxy and Cloud SQL Java, Python, and Go connectors.
27584 /// Note: This disables all existing authorized networks.
27585 Required,
27586 /// If set, the enum was initialized with an unknown value.
27587 ///
27588 /// Applications can examine the value using [ConnectorEnforcement::value] or
27589 /// [ConnectorEnforcement::name].
27590 UnknownValue(connector_enforcement::UnknownValue),
27591 }
27592
27593 #[doc(hidden)]
27594 pub mod connector_enforcement {
27595 #[allow(unused_imports)]
27596 use super::*;
27597 #[derive(Clone, Debug, PartialEq)]
27598 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27599 }
27600
27601 impl ConnectorEnforcement {
27602 /// Gets the enum value.
27603 ///
27604 /// Returns `None` if the enum contains an unknown value deserialized from
27605 /// the string representation of enums.
27606 pub fn value(&self) -> std::option::Option<i32> {
27607 match self {
27608 Self::Unspecified => std::option::Option::Some(0),
27609 Self::NotRequired => std::option::Option::Some(1),
27610 Self::Required => std::option::Option::Some(2),
27611 Self::UnknownValue(u) => u.0.value(),
27612 }
27613 }
27614
27615 /// Gets the enum value as a string.
27616 ///
27617 /// Returns `None` if the enum contains an unknown value deserialized from
27618 /// the integer representation of enums.
27619 pub fn name(&self) -> std::option::Option<&str> {
27620 match self {
27621 Self::Unspecified => std::option::Option::Some("CONNECTOR_ENFORCEMENT_UNSPECIFIED"),
27622 Self::NotRequired => std::option::Option::Some("NOT_REQUIRED"),
27623 Self::Required => std::option::Option::Some("REQUIRED"),
27624 Self::UnknownValue(u) => u.0.name(),
27625 }
27626 }
27627 }
27628
27629 impl std::default::Default for ConnectorEnforcement {
27630 fn default() -> Self {
27631 use std::convert::From;
27632 Self::from(0)
27633 }
27634 }
27635
27636 impl std::fmt::Display for ConnectorEnforcement {
27637 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27638 wkt::internal::display_enum(f, self.name(), self.value())
27639 }
27640 }
27641
27642 impl std::convert::From<i32> for ConnectorEnforcement {
27643 fn from(value: i32) -> Self {
27644 match value {
27645 0 => Self::Unspecified,
27646 1 => Self::NotRequired,
27647 2 => Self::Required,
27648 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27649 wkt::internal::UnknownEnumValue::Integer(value),
27650 )),
27651 }
27652 }
27653 }
27654
27655 impl std::convert::From<&str> for ConnectorEnforcement {
27656 fn from(value: &str) -> Self {
27657 use std::string::ToString;
27658 match value {
27659 "CONNECTOR_ENFORCEMENT_UNSPECIFIED" => Self::Unspecified,
27660 "NOT_REQUIRED" => Self::NotRequired,
27661 "REQUIRED" => Self::Required,
27662 _ => Self::UnknownValue(connector_enforcement::UnknownValue(
27663 wkt::internal::UnknownEnumValue::String(value.to_string()),
27664 )),
27665 }
27666 }
27667 }
27668
27669 impl serde::ser::Serialize for ConnectorEnforcement {
27670 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27671 where
27672 S: serde::Serializer,
27673 {
27674 match self {
27675 Self::Unspecified => serializer.serialize_i32(0),
27676 Self::NotRequired => serializer.serialize_i32(1),
27677 Self::Required => serializer.serialize_i32(2),
27678 Self::UnknownValue(u) => u.0.serialize(serializer),
27679 }
27680 }
27681 }
27682
27683 impl<'de> serde::de::Deserialize<'de> for ConnectorEnforcement {
27684 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27685 where
27686 D: serde::Deserializer<'de>,
27687 {
27688 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectorEnforcement>::new(
27689 ".google.cloud.sql.v1.Settings.ConnectorEnforcement",
27690 ))
27691 }
27692 }
27693
27694 /// ExecuteSql API's access to the instance.
27695 ///
27696 /// # Working with unknown values
27697 ///
27698 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
27699 /// additional enum variants at any time. Adding new variants is not considered
27700 /// a breaking change. Applications should write their code in anticipation of:
27701 ///
27702 /// - New values appearing in future releases of the client library, **and**
27703 /// - New values received dynamically, without application changes.
27704 ///
27705 /// Please consult the [Working with enums] section in the user guide for some
27706 /// guidelines.
27707 ///
27708 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
27709 #[derive(Clone, Debug, PartialEq)]
27710 #[non_exhaustive]
27711 pub enum DataApiAccess {
27712 /// Unspecified, effectively the same as `DISALLOW_DATA_API`.
27713 Unspecified,
27714 /// Disallow using ExecuteSql API to connect to the instance.
27715 DisallowDataApi,
27716 /// Allow using ExecuteSql API to connect to the instance. For private IP
27717 /// instances, this allows authorized users to access the instance from
27718 /// the public internet using ExecuteSql API.
27719 AllowDataApi,
27720 /// If set, the enum was initialized with an unknown value.
27721 ///
27722 /// Applications can examine the value using [DataApiAccess::value] or
27723 /// [DataApiAccess::name].
27724 UnknownValue(data_api_access::UnknownValue),
27725 }
27726
27727 #[doc(hidden)]
27728 pub mod data_api_access {
27729 #[allow(unused_imports)]
27730 use super::*;
27731 #[derive(Clone, Debug, PartialEq)]
27732 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
27733 }
27734
27735 impl DataApiAccess {
27736 /// Gets the enum value.
27737 ///
27738 /// Returns `None` if the enum contains an unknown value deserialized from
27739 /// the string representation of enums.
27740 pub fn value(&self) -> std::option::Option<i32> {
27741 match self {
27742 Self::Unspecified => std::option::Option::Some(0),
27743 Self::DisallowDataApi => std::option::Option::Some(1),
27744 Self::AllowDataApi => std::option::Option::Some(2),
27745 Self::UnknownValue(u) => u.0.value(),
27746 }
27747 }
27748
27749 /// Gets the enum value as a string.
27750 ///
27751 /// Returns `None` if the enum contains an unknown value deserialized from
27752 /// the integer representation of enums.
27753 pub fn name(&self) -> std::option::Option<&str> {
27754 match self {
27755 Self::Unspecified => std::option::Option::Some("DATA_API_ACCESS_UNSPECIFIED"),
27756 Self::DisallowDataApi => std::option::Option::Some("DISALLOW_DATA_API"),
27757 Self::AllowDataApi => std::option::Option::Some("ALLOW_DATA_API"),
27758 Self::UnknownValue(u) => u.0.name(),
27759 }
27760 }
27761 }
27762
27763 impl std::default::Default for DataApiAccess {
27764 fn default() -> Self {
27765 use std::convert::From;
27766 Self::from(0)
27767 }
27768 }
27769
27770 impl std::fmt::Display for DataApiAccess {
27771 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
27772 wkt::internal::display_enum(f, self.name(), self.value())
27773 }
27774 }
27775
27776 impl std::convert::From<i32> for DataApiAccess {
27777 fn from(value: i32) -> Self {
27778 match value {
27779 0 => Self::Unspecified,
27780 1 => Self::DisallowDataApi,
27781 2 => Self::AllowDataApi,
27782 _ => Self::UnknownValue(data_api_access::UnknownValue(
27783 wkt::internal::UnknownEnumValue::Integer(value),
27784 )),
27785 }
27786 }
27787 }
27788
27789 impl std::convert::From<&str> for DataApiAccess {
27790 fn from(value: &str) -> Self {
27791 use std::string::ToString;
27792 match value {
27793 "DATA_API_ACCESS_UNSPECIFIED" => Self::Unspecified,
27794 "DISALLOW_DATA_API" => Self::DisallowDataApi,
27795 "ALLOW_DATA_API" => Self::AllowDataApi,
27796 _ => Self::UnknownValue(data_api_access::UnknownValue(
27797 wkt::internal::UnknownEnumValue::String(value.to_string()),
27798 )),
27799 }
27800 }
27801 }
27802
27803 impl serde::ser::Serialize for DataApiAccess {
27804 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
27805 where
27806 S: serde::Serializer,
27807 {
27808 match self {
27809 Self::Unspecified => serializer.serialize_i32(0),
27810 Self::DisallowDataApi => serializer.serialize_i32(1),
27811 Self::AllowDataApi => serializer.serialize_i32(2),
27812 Self::UnknownValue(u) => u.0.serialize(serializer),
27813 }
27814 }
27815 }
27816
27817 impl<'de> serde::de::Deserialize<'de> for DataApiAccess {
27818 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
27819 where
27820 D: serde::Deserializer<'de>,
27821 {
27822 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataApiAccess>::new(
27823 ".google.cloud.sql.v1.Settings.DataApiAccess",
27824 ))
27825 }
27826 }
27827}
27828
27829/// Performance Capture configuration.
27830#[derive(Clone, Default, PartialEq)]
27831#[non_exhaustive]
27832pub struct PerformanceCaptureConfig {
27833 /// Optional. Enable or disable the Performance Capture feature.
27834 pub enabled: std::option::Option<bool>,
27835
27836 /// Optional. The time interval in seconds between any two probes.
27837 pub probing_interval_seconds: std::option::Option<i32>,
27838
27839 /// Optional. The minimum number of consecutive readings above threshold that
27840 /// triggers instance state capture.
27841 pub probe_threshold: std::option::Option<i32>,
27842
27843 /// Optional. The minimum number of server threads running to trigger the
27844 /// capture on primary.
27845 pub running_threads_threshold: std::option::Option<i32>,
27846
27847 /// Optional. The minimum number of seconds replica must be lagging behind
27848 /// primary to trigger capture on replica.
27849 pub seconds_behind_source_threshold: std::option::Option<i32>,
27850
27851 /// Optional. The amount of time in seconds that a transaction needs to have
27852 /// been open before the watcher starts recording it.
27853 pub transaction_duration_threshold: std::option::Option<i32>,
27854
27855 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
27856}
27857
27858impl PerformanceCaptureConfig {
27859 pub fn new() -> Self {
27860 std::default::Default::default()
27861 }
27862
27863 /// Sets the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
27864 ///
27865 /// # Example
27866 /// ```ignore,no_run
27867 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27868 /// let x = PerformanceCaptureConfig::new().set_enabled(true);
27869 /// ```
27870 pub fn set_enabled<T>(mut self, v: T) -> Self
27871 where
27872 T: std::convert::Into<bool>,
27873 {
27874 self.enabled = std::option::Option::Some(v.into());
27875 self
27876 }
27877
27878 /// Sets or clears the value of [enabled][crate::model::PerformanceCaptureConfig::enabled].
27879 ///
27880 /// # Example
27881 /// ```ignore,no_run
27882 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27883 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(Some(false));
27884 /// let x = PerformanceCaptureConfig::new().set_or_clear_enabled(None::<bool>);
27885 /// ```
27886 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
27887 where
27888 T: std::convert::Into<bool>,
27889 {
27890 self.enabled = v.map(|x| x.into());
27891 self
27892 }
27893
27894 /// Sets the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
27895 ///
27896 /// # Example
27897 /// ```ignore,no_run
27898 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27899 /// let x = PerformanceCaptureConfig::new().set_probing_interval_seconds(42);
27900 /// ```
27901 pub fn set_probing_interval_seconds<T>(mut self, v: T) -> Self
27902 where
27903 T: std::convert::Into<i32>,
27904 {
27905 self.probing_interval_seconds = std::option::Option::Some(v.into());
27906 self
27907 }
27908
27909 /// Sets or clears the value of [probing_interval_seconds][crate::model::PerformanceCaptureConfig::probing_interval_seconds].
27910 ///
27911 /// # Example
27912 /// ```ignore,no_run
27913 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27914 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(Some(42));
27915 /// let x = PerformanceCaptureConfig::new().set_or_clear_probing_interval_seconds(None::<i32>);
27916 /// ```
27917 pub fn set_or_clear_probing_interval_seconds<T>(mut self, v: std::option::Option<T>) -> Self
27918 where
27919 T: std::convert::Into<i32>,
27920 {
27921 self.probing_interval_seconds = v.map(|x| x.into());
27922 self
27923 }
27924
27925 /// Sets the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
27926 ///
27927 /// # Example
27928 /// ```ignore,no_run
27929 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27930 /// let x = PerformanceCaptureConfig::new().set_probe_threshold(42);
27931 /// ```
27932 pub fn set_probe_threshold<T>(mut self, v: T) -> Self
27933 where
27934 T: std::convert::Into<i32>,
27935 {
27936 self.probe_threshold = std::option::Option::Some(v.into());
27937 self
27938 }
27939
27940 /// Sets or clears the value of [probe_threshold][crate::model::PerformanceCaptureConfig::probe_threshold].
27941 ///
27942 /// # Example
27943 /// ```ignore,no_run
27944 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27945 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(Some(42));
27946 /// let x = PerformanceCaptureConfig::new().set_or_clear_probe_threshold(None::<i32>);
27947 /// ```
27948 pub fn set_or_clear_probe_threshold<T>(mut self, v: std::option::Option<T>) -> Self
27949 where
27950 T: std::convert::Into<i32>,
27951 {
27952 self.probe_threshold = v.map(|x| x.into());
27953 self
27954 }
27955
27956 /// Sets the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
27957 ///
27958 /// # Example
27959 /// ```ignore,no_run
27960 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27961 /// let x = PerformanceCaptureConfig::new().set_running_threads_threshold(42);
27962 /// ```
27963 pub fn set_running_threads_threshold<T>(mut self, v: T) -> Self
27964 where
27965 T: std::convert::Into<i32>,
27966 {
27967 self.running_threads_threshold = std::option::Option::Some(v.into());
27968 self
27969 }
27970
27971 /// Sets or clears the value of [running_threads_threshold][crate::model::PerformanceCaptureConfig::running_threads_threshold].
27972 ///
27973 /// # Example
27974 /// ```ignore,no_run
27975 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27976 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(Some(42));
27977 /// let x = PerformanceCaptureConfig::new().set_or_clear_running_threads_threshold(None::<i32>);
27978 /// ```
27979 pub fn set_or_clear_running_threads_threshold<T>(mut self, v: std::option::Option<T>) -> Self
27980 where
27981 T: std::convert::Into<i32>,
27982 {
27983 self.running_threads_threshold = v.map(|x| x.into());
27984 self
27985 }
27986
27987 /// Sets the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
27988 ///
27989 /// # Example
27990 /// ```ignore,no_run
27991 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
27992 /// let x = PerformanceCaptureConfig::new().set_seconds_behind_source_threshold(42);
27993 /// ```
27994 pub fn set_seconds_behind_source_threshold<T>(mut self, v: T) -> Self
27995 where
27996 T: std::convert::Into<i32>,
27997 {
27998 self.seconds_behind_source_threshold = std::option::Option::Some(v.into());
27999 self
28000 }
28001
28002 /// Sets or clears the value of [seconds_behind_source_threshold][crate::model::PerformanceCaptureConfig::seconds_behind_source_threshold].
28003 ///
28004 /// # Example
28005 /// ```ignore,no_run
28006 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28007 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(Some(42));
28008 /// let x = PerformanceCaptureConfig::new().set_or_clear_seconds_behind_source_threshold(None::<i32>);
28009 /// ```
28010 pub fn set_or_clear_seconds_behind_source_threshold<T>(
28011 mut self,
28012 v: std::option::Option<T>,
28013 ) -> Self
28014 where
28015 T: std::convert::Into<i32>,
28016 {
28017 self.seconds_behind_source_threshold = v.map(|x| x.into());
28018 self
28019 }
28020
28021 /// Sets the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28022 ///
28023 /// # Example
28024 /// ```ignore,no_run
28025 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28026 /// let x = PerformanceCaptureConfig::new().set_transaction_duration_threshold(42);
28027 /// ```
28028 pub fn set_transaction_duration_threshold<T>(mut self, v: T) -> Self
28029 where
28030 T: std::convert::Into<i32>,
28031 {
28032 self.transaction_duration_threshold = std::option::Option::Some(v.into());
28033 self
28034 }
28035
28036 /// Sets or clears the value of [transaction_duration_threshold][crate::model::PerformanceCaptureConfig::transaction_duration_threshold].
28037 ///
28038 /// # Example
28039 /// ```ignore,no_run
28040 /// # use google_cloud_sql_v1::model::PerformanceCaptureConfig;
28041 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(Some(42));
28042 /// let x = PerformanceCaptureConfig::new().set_or_clear_transaction_duration_threshold(None::<i32>);
28043 /// ```
28044 pub fn set_or_clear_transaction_duration_threshold<T>(
28045 mut self,
28046 v: std::option::Option<T>,
28047 ) -> Self
28048 where
28049 T: std::convert::Into<i32>,
28050 {
28051 self.transaction_duration_threshold = v.map(|x| x.into());
28052 self
28053 }
28054}
28055
28056impl wkt::message::Message for PerformanceCaptureConfig {
28057 fn typename() -> &'static str {
28058 "type.googleapis.com/google.cloud.sql.v1.PerformanceCaptureConfig"
28059 }
28060}
28061
28062/// Connection pool flags for Cloud SQL instances managed connection pool
28063/// configuration.
28064#[derive(Clone, Default, PartialEq)]
28065#[non_exhaustive]
28066pub struct ConnectionPoolFlags {
28067 /// Required. The name of the flag.
28068 pub name: std::string::String,
28069
28070 /// Required. The value of the flag. Boolean flags are set to `on` for true
28071 /// and `off` for false. This field must be omitted if the flag
28072 /// doesn't take a value.
28073 pub value: std::string::String,
28074
28075 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28076}
28077
28078impl ConnectionPoolFlags {
28079 pub fn new() -> Self {
28080 std::default::Default::default()
28081 }
28082
28083 /// Sets the value of [name][crate::model::ConnectionPoolFlags::name].
28084 ///
28085 /// # Example
28086 /// ```ignore,no_run
28087 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28088 /// let x = ConnectionPoolFlags::new().set_name("example");
28089 /// ```
28090 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28091 self.name = v.into();
28092 self
28093 }
28094
28095 /// Sets the value of [value][crate::model::ConnectionPoolFlags::value].
28096 ///
28097 /// # Example
28098 /// ```ignore,no_run
28099 /// # use google_cloud_sql_v1::model::ConnectionPoolFlags;
28100 /// let x = ConnectionPoolFlags::new().set_value("example");
28101 /// ```
28102 pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28103 self.value = v.into();
28104 self
28105 }
28106}
28107
28108impl wkt::message::Message for ConnectionPoolFlags {
28109 fn typename() -> &'static str {
28110 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolFlags"
28111 }
28112}
28113
28114/// The managed connection pooling configuration.
28115#[derive(Clone, Default, PartialEq)]
28116#[non_exhaustive]
28117pub struct ConnectionPoolConfig {
28118 /// Whether managed connection pooling is enabled.
28119 pub connection_pooling_enabled: std::option::Option<bool>,
28120
28121 /// Optional. List of connection pool configuration flags.
28122 pub flags: std::vec::Vec<crate::model::ConnectionPoolFlags>,
28123
28124 /// Output only. Number of connection poolers.
28125 pub pooler_count: std::option::Option<i32>,
28126
28127 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28128}
28129
28130impl ConnectionPoolConfig {
28131 pub fn new() -> Self {
28132 std::default::Default::default()
28133 }
28134
28135 /// Sets the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28136 ///
28137 /// # Example
28138 /// ```ignore,no_run
28139 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28140 /// let x = ConnectionPoolConfig::new().set_connection_pooling_enabled(true);
28141 /// ```
28142 pub fn set_connection_pooling_enabled<T>(mut self, v: T) -> Self
28143 where
28144 T: std::convert::Into<bool>,
28145 {
28146 self.connection_pooling_enabled = std::option::Option::Some(v.into());
28147 self
28148 }
28149
28150 /// Sets or clears the value of [connection_pooling_enabled][crate::model::ConnectionPoolConfig::connection_pooling_enabled].
28151 ///
28152 /// # Example
28153 /// ```ignore,no_run
28154 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28155 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(Some(false));
28156 /// let x = ConnectionPoolConfig::new().set_or_clear_connection_pooling_enabled(None::<bool>);
28157 /// ```
28158 pub fn set_or_clear_connection_pooling_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28159 where
28160 T: std::convert::Into<bool>,
28161 {
28162 self.connection_pooling_enabled = v.map(|x| x.into());
28163 self
28164 }
28165
28166 /// Sets the value of [flags][crate::model::ConnectionPoolConfig::flags].
28167 ///
28168 /// # Example
28169 /// ```ignore,no_run
28170 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28171 /// use google_cloud_sql_v1::model::ConnectionPoolFlags;
28172 /// let x = ConnectionPoolConfig::new()
28173 /// .set_flags([
28174 /// ConnectionPoolFlags::default()/* use setters */,
28175 /// ConnectionPoolFlags::default()/* use (different) setters */,
28176 /// ]);
28177 /// ```
28178 pub fn set_flags<T, V>(mut self, v: T) -> Self
28179 where
28180 T: std::iter::IntoIterator<Item = V>,
28181 V: std::convert::Into<crate::model::ConnectionPoolFlags>,
28182 {
28183 use std::iter::Iterator;
28184 self.flags = v.into_iter().map(|i| i.into()).collect();
28185 self
28186 }
28187
28188 /// Sets the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28189 ///
28190 /// # Example
28191 /// ```ignore,no_run
28192 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28193 /// let x = ConnectionPoolConfig::new().set_pooler_count(42);
28194 /// ```
28195 pub fn set_pooler_count<T>(mut self, v: T) -> Self
28196 where
28197 T: std::convert::Into<i32>,
28198 {
28199 self.pooler_count = std::option::Option::Some(v.into());
28200 self
28201 }
28202
28203 /// Sets or clears the value of [pooler_count][crate::model::ConnectionPoolConfig::pooler_count].
28204 ///
28205 /// # Example
28206 /// ```ignore,no_run
28207 /// # use google_cloud_sql_v1::model::ConnectionPoolConfig;
28208 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(Some(42));
28209 /// let x = ConnectionPoolConfig::new().set_or_clear_pooler_count(None::<i32>);
28210 /// ```
28211 pub fn set_or_clear_pooler_count<T>(mut self, v: std::option::Option<T>) -> Self
28212 where
28213 T: std::convert::Into<i32>,
28214 {
28215 self.pooler_count = v.map(|x| x.into());
28216 self
28217 }
28218}
28219
28220impl wkt::message::Message for ConnectionPoolConfig {
28221 fn typename() -> &'static str {
28222 "type.googleapis.com/google.cloud.sql.v1.ConnectionPoolConfig"
28223 }
28224}
28225
28226/// The read pool auto-scale configuration.
28227#[derive(Clone, Default, PartialEq)]
28228#[non_exhaustive]
28229pub struct ReadPoolAutoScaleConfig {
28230 /// Indicates whether read pool auto scaling is enabled.
28231 pub enabled: std::option::Option<bool>,
28232
28233 /// Minimum number of read pool nodes to be maintained.
28234 pub min_node_count: std::option::Option<i32>,
28235
28236 /// Maximum number of read pool nodes to be maintained.
28237 pub max_node_count: std::option::Option<i32>,
28238
28239 /// Optional. Target metrics for read pool auto scaling.
28240 pub target_metrics: std::vec::Vec<crate::model::read_pool_auto_scale_config::TargetMetric>,
28241
28242 /// Indicates whether read pool auto scaling supports scale in operations
28243 /// (removing nodes).
28244 pub disable_scale_in: std::option::Option<bool>,
28245
28246 /// The cooldown period for scale-in operations.
28247 pub scale_in_cooldown_seconds: std::option::Option<i32>,
28248
28249 /// The cooldown period for scale-out operations.
28250 pub scale_out_cooldown_seconds: std::option::Option<i32>,
28251
28252 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28253}
28254
28255impl ReadPoolAutoScaleConfig {
28256 pub fn new() -> Self {
28257 std::default::Default::default()
28258 }
28259
28260 /// Sets the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28261 ///
28262 /// # Example
28263 /// ```ignore,no_run
28264 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28265 /// let x = ReadPoolAutoScaleConfig::new().set_enabled(true);
28266 /// ```
28267 pub fn set_enabled<T>(mut self, v: T) -> Self
28268 where
28269 T: std::convert::Into<bool>,
28270 {
28271 self.enabled = std::option::Option::Some(v.into());
28272 self
28273 }
28274
28275 /// Sets or clears the value of [enabled][crate::model::ReadPoolAutoScaleConfig::enabled].
28276 ///
28277 /// # Example
28278 /// ```ignore,no_run
28279 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28280 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(Some(false));
28281 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_enabled(None::<bool>);
28282 /// ```
28283 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
28284 where
28285 T: std::convert::Into<bool>,
28286 {
28287 self.enabled = v.map(|x| x.into());
28288 self
28289 }
28290
28291 /// Sets the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28292 ///
28293 /// # Example
28294 /// ```ignore,no_run
28295 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28296 /// let x = ReadPoolAutoScaleConfig::new().set_min_node_count(42);
28297 /// ```
28298 pub fn set_min_node_count<T>(mut self, v: T) -> Self
28299 where
28300 T: std::convert::Into<i32>,
28301 {
28302 self.min_node_count = std::option::Option::Some(v.into());
28303 self
28304 }
28305
28306 /// Sets or clears the value of [min_node_count][crate::model::ReadPoolAutoScaleConfig::min_node_count].
28307 ///
28308 /// # Example
28309 /// ```ignore,no_run
28310 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28311 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(Some(42));
28312 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_min_node_count(None::<i32>);
28313 /// ```
28314 pub fn set_or_clear_min_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28315 where
28316 T: std::convert::Into<i32>,
28317 {
28318 self.min_node_count = v.map(|x| x.into());
28319 self
28320 }
28321
28322 /// Sets the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28323 ///
28324 /// # Example
28325 /// ```ignore,no_run
28326 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28327 /// let x = ReadPoolAutoScaleConfig::new().set_max_node_count(42);
28328 /// ```
28329 pub fn set_max_node_count<T>(mut self, v: T) -> Self
28330 where
28331 T: std::convert::Into<i32>,
28332 {
28333 self.max_node_count = std::option::Option::Some(v.into());
28334 self
28335 }
28336
28337 /// Sets or clears the value of [max_node_count][crate::model::ReadPoolAutoScaleConfig::max_node_count].
28338 ///
28339 /// # Example
28340 /// ```ignore,no_run
28341 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28342 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(Some(42));
28343 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_max_node_count(None::<i32>);
28344 /// ```
28345 pub fn set_or_clear_max_node_count<T>(mut self, v: std::option::Option<T>) -> Self
28346 where
28347 T: std::convert::Into<i32>,
28348 {
28349 self.max_node_count = v.map(|x| x.into());
28350 self
28351 }
28352
28353 /// Sets the value of [target_metrics][crate::model::ReadPoolAutoScaleConfig::target_metrics].
28354 ///
28355 /// # Example
28356 /// ```ignore,no_run
28357 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28358 /// use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28359 /// let x = ReadPoolAutoScaleConfig::new()
28360 /// .set_target_metrics([
28361 /// TargetMetric::default()/* use setters */,
28362 /// TargetMetric::default()/* use (different) setters */,
28363 /// ]);
28364 /// ```
28365 pub fn set_target_metrics<T, V>(mut self, v: T) -> Self
28366 where
28367 T: std::iter::IntoIterator<Item = V>,
28368 V: std::convert::Into<crate::model::read_pool_auto_scale_config::TargetMetric>,
28369 {
28370 use std::iter::Iterator;
28371 self.target_metrics = v.into_iter().map(|i| i.into()).collect();
28372 self
28373 }
28374
28375 /// Sets the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28376 ///
28377 /// # Example
28378 /// ```ignore,no_run
28379 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28380 /// let x = ReadPoolAutoScaleConfig::new().set_disable_scale_in(true);
28381 /// ```
28382 pub fn set_disable_scale_in<T>(mut self, v: T) -> Self
28383 where
28384 T: std::convert::Into<bool>,
28385 {
28386 self.disable_scale_in = std::option::Option::Some(v.into());
28387 self
28388 }
28389
28390 /// Sets or clears the value of [disable_scale_in][crate::model::ReadPoolAutoScaleConfig::disable_scale_in].
28391 ///
28392 /// # Example
28393 /// ```ignore,no_run
28394 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28395 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(Some(false));
28396 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_disable_scale_in(None::<bool>);
28397 /// ```
28398 pub fn set_or_clear_disable_scale_in<T>(mut self, v: std::option::Option<T>) -> Self
28399 where
28400 T: std::convert::Into<bool>,
28401 {
28402 self.disable_scale_in = v.map(|x| x.into());
28403 self
28404 }
28405
28406 /// Sets the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28407 ///
28408 /// # Example
28409 /// ```ignore,no_run
28410 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28411 /// let x = ReadPoolAutoScaleConfig::new().set_scale_in_cooldown_seconds(42);
28412 /// ```
28413 pub fn set_scale_in_cooldown_seconds<T>(mut self, v: T) -> Self
28414 where
28415 T: std::convert::Into<i32>,
28416 {
28417 self.scale_in_cooldown_seconds = std::option::Option::Some(v.into());
28418 self
28419 }
28420
28421 /// Sets or clears the value of [scale_in_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_in_cooldown_seconds].
28422 ///
28423 /// # Example
28424 /// ```ignore,no_run
28425 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28426 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(Some(42));
28427 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_in_cooldown_seconds(None::<i32>);
28428 /// ```
28429 pub fn set_or_clear_scale_in_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28430 where
28431 T: std::convert::Into<i32>,
28432 {
28433 self.scale_in_cooldown_seconds = v.map(|x| x.into());
28434 self
28435 }
28436
28437 /// Sets the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28438 ///
28439 /// # Example
28440 /// ```ignore,no_run
28441 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28442 /// let x = ReadPoolAutoScaleConfig::new().set_scale_out_cooldown_seconds(42);
28443 /// ```
28444 pub fn set_scale_out_cooldown_seconds<T>(mut self, v: T) -> Self
28445 where
28446 T: std::convert::Into<i32>,
28447 {
28448 self.scale_out_cooldown_seconds = std::option::Option::Some(v.into());
28449 self
28450 }
28451
28452 /// Sets or clears the value of [scale_out_cooldown_seconds][crate::model::ReadPoolAutoScaleConfig::scale_out_cooldown_seconds].
28453 ///
28454 /// # Example
28455 /// ```ignore,no_run
28456 /// # use google_cloud_sql_v1::model::ReadPoolAutoScaleConfig;
28457 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(Some(42));
28458 /// let x = ReadPoolAutoScaleConfig::new().set_or_clear_scale_out_cooldown_seconds(None::<i32>);
28459 /// ```
28460 pub fn set_or_clear_scale_out_cooldown_seconds<T>(mut self, v: std::option::Option<T>) -> Self
28461 where
28462 T: std::convert::Into<i32>,
28463 {
28464 self.scale_out_cooldown_seconds = v.map(|x| x.into());
28465 self
28466 }
28467}
28468
28469impl wkt::message::Message for ReadPoolAutoScaleConfig {
28470 fn typename() -> &'static str {
28471 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig"
28472 }
28473}
28474
28475/// Defines additional types related to [ReadPoolAutoScaleConfig].
28476pub mod read_pool_auto_scale_config {
28477 #[allow(unused_imports)]
28478 use super::*;
28479
28480 /// Target metric for read pool auto scaling.
28481 #[derive(Clone, Default, PartialEq)]
28482 #[non_exhaustive]
28483 pub struct TargetMetric {
28484 /// The metric name to be used for auto scaling.
28485 pub metric: std::option::Option<std::string::String>,
28486
28487 /// The target value for the metric.
28488 pub target_value: std::option::Option<f32>,
28489
28490 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28491 }
28492
28493 impl TargetMetric {
28494 pub fn new() -> Self {
28495 std::default::Default::default()
28496 }
28497
28498 /// Sets the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28499 ///
28500 /// # Example
28501 /// ```ignore,no_run
28502 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28503 /// let x = TargetMetric::new().set_metric("example");
28504 /// ```
28505 pub fn set_metric<T>(mut self, v: T) -> Self
28506 where
28507 T: std::convert::Into<std::string::String>,
28508 {
28509 self.metric = std::option::Option::Some(v.into());
28510 self
28511 }
28512
28513 /// Sets or clears the value of [metric][crate::model::read_pool_auto_scale_config::TargetMetric::metric].
28514 ///
28515 /// # Example
28516 /// ```ignore,no_run
28517 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28518 /// let x = TargetMetric::new().set_or_clear_metric(Some("example"));
28519 /// let x = TargetMetric::new().set_or_clear_metric(None::<String>);
28520 /// ```
28521 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
28522 where
28523 T: std::convert::Into<std::string::String>,
28524 {
28525 self.metric = v.map(|x| x.into());
28526 self
28527 }
28528
28529 /// Sets the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28530 ///
28531 /// # Example
28532 /// ```ignore,no_run
28533 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28534 /// let x = TargetMetric::new().set_target_value(42.0);
28535 /// ```
28536 pub fn set_target_value<T>(mut self, v: T) -> Self
28537 where
28538 T: std::convert::Into<f32>,
28539 {
28540 self.target_value = std::option::Option::Some(v.into());
28541 self
28542 }
28543
28544 /// Sets or clears the value of [target_value][crate::model::read_pool_auto_scale_config::TargetMetric::target_value].
28545 ///
28546 /// # Example
28547 /// ```ignore,no_run
28548 /// # use google_cloud_sql_v1::model::read_pool_auto_scale_config::TargetMetric;
28549 /// let x = TargetMetric::new().set_or_clear_target_value(Some(42.0));
28550 /// let x = TargetMetric::new().set_or_clear_target_value(None::<f32>);
28551 /// ```
28552 pub fn set_or_clear_target_value<T>(mut self, v: std::option::Option<T>) -> Self
28553 where
28554 T: std::convert::Into<f32>,
28555 {
28556 self.target_value = v.map(|x| x.into());
28557 self
28558 }
28559 }
28560
28561 impl wkt::message::Message for TargetMetric {
28562 fn typename() -> &'static str {
28563 "type.googleapis.com/google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric"
28564 }
28565 }
28566}
28567
28568/// Specifies options for controlling advanced machine features.
28569#[derive(Clone, Default, PartialEq)]
28570#[non_exhaustive]
28571pub struct AdvancedMachineFeatures {
28572 /// The number of threads per physical core.
28573 pub threads_per_core: i32,
28574
28575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28576}
28577
28578impl AdvancedMachineFeatures {
28579 pub fn new() -> Self {
28580 std::default::Default::default()
28581 }
28582
28583 /// Sets the value of [threads_per_core][crate::model::AdvancedMachineFeatures::threads_per_core].
28584 ///
28585 /// # Example
28586 /// ```ignore,no_run
28587 /// # use google_cloud_sql_v1::model::AdvancedMachineFeatures;
28588 /// let x = AdvancedMachineFeatures::new().set_threads_per_core(42);
28589 /// ```
28590 pub fn set_threads_per_core<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
28591 self.threads_per_core = v.into();
28592 self
28593 }
28594}
28595
28596impl wkt::message::Message for AdvancedMachineFeatures {
28597 fn typename() -> &'static str {
28598 "type.googleapis.com/google.cloud.sql.v1.AdvancedMachineFeatures"
28599 }
28600}
28601
28602/// SslCerts Resource
28603#[derive(Clone, Default, PartialEq)]
28604#[non_exhaustive]
28605pub struct SslCert {
28606 /// This is always `sql#sslCert`.
28607 pub kind: std::string::String,
28608
28609 /// Serial number, as extracted from the certificate.
28610 pub cert_serial_number: std::string::String,
28611
28612 /// PEM representation.
28613 pub cert: std::string::String,
28614
28615 /// The time when the certificate was created in [RFC
28616 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28617 /// `2012-11-15T16:19:00.094Z`
28618 pub create_time: std::option::Option<wkt::Timestamp>,
28619
28620 /// User supplied name. Constrained to [a-zA-Z.-_ ]+.
28621 pub common_name: std::string::String,
28622
28623 /// The time when the certificate expires in [RFC
28624 /// 3339](https://tools.ietf.org/html/rfc3339) format, for example
28625 /// `2012-11-15T16:19:00.094Z`.
28626 pub expiration_time: std::option::Option<wkt::Timestamp>,
28627
28628 /// Sha1 Fingerprint.
28629 pub sha1_fingerprint: std::string::String,
28630
28631 /// Name of the database instance.
28632 pub instance: std::string::String,
28633
28634 /// The URI of this resource.
28635 pub self_link: std::string::String,
28636
28637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28638}
28639
28640impl SslCert {
28641 pub fn new() -> Self {
28642 std::default::Default::default()
28643 }
28644
28645 /// Sets the value of [kind][crate::model::SslCert::kind].
28646 ///
28647 /// # Example
28648 /// ```ignore,no_run
28649 /// # use google_cloud_sql_v1::model::SslCert;
28650 /// let x = SslCert::new().set_kind("example");
28651 /// ```
28652 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28653 self.kind = v.into();
28654 self
28655 }
28656
28657 /// Sets the value of [cert_serial_number][crate::model::SslCert::cert_serial_number].
28658 ///
28659 /// # Example
28660 /// ```ignore,no_run
28661 /// # use google_cloud_sql_v1::model::SslCert;
28662 /// let x = SslCert::new().set_cert_serial_number("example");
28663 /// ```
28664 pub fn set_cert_serial_number<T: std::convert::Into<std::string::String>>(
28665 mut self,
28666 v: T,
28667 ) -> Self {
28668 self.cert_serial_number = v.into();
28669 self
28670 }
28671
28672 /// Sets the value of [cert][crate::model::SslCert::cert].
28673 ///
28674 /// # Example
28675 /// ```ignore,no_run
28676 /// # use google_cloud_sql_v1::model::SslCert;
28677 /// let x = SslCert::new().set_cert("example");
28678 /// ```
28679 pub fn set_cert<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28680 self.cert = v.into();
28681 self
28682 }
28683
28684 /// Sets the value of [create_time][crate::model::SslCert::create_time].
28685 ///
28686 /// # Example
28687 /// ```ignore,no_run
28688 /// # use google_cloud_sql_v1::model::SslCert;
28689 /// use wkt::Timestamp;
28690 /// let x = SslCert::new().set_create_time(Timestamp::default()/* use setters */);
28691 /// ```
28692 pub fn set_create_time<T>(mut self, v: T) -> Self
28693 where
28694 T: std::convert::Into<wkt::Timestamp>,
28695 {
28696 self.create_time = std::option::Option::Some(v.into());
28697 self
28698 }
28699
28700 /// Sets or clears the value of [create_time][crate::model::SslCert::create_time].
28701 ///
28702 /// # Example
28703 /// ```ignore,no_run
28704 /// # use google_cloud_sql_v1::model::SslCert;
28705 /// use wkt::Timestamp;
28706 /// let x = SslCert::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
28707 /// let x = SslCert::new().set_or_clear_create_time(None::<Timestamp>);
28708 /// ```
28709 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
28710 where
28711 T: std::convert::Into<wkt::Timestamp>,
28712 {
28713 self.create_time = v.map(|x| x.into());
28714 self
28715 }
28716
28717 /// Sets the value of [common_name][crate::model::SslCert::common_name].
28718 ///
28719 /// # Example
28720 /// ```ignore,no_run
28721 /// # use google_cloud_sql_v1::model::SslCert;
28722 /// let x = SslCert::new().set_common_name("example");
28723 /// ```
28724 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28725 self.common_name = v.into();
28726 self
28727 }
28728
28729 /// Sets the value of [expiration_time][crate::model::SslCert::expiration_time].
28730 ///
28731 /// # Example
28732 /// ```ignore,no_run
28733 /// # use google_cloud_sql_v1::model::SslCert;
28734 /// use wkt::Timestamp;
28735 /// let x = SslCert::new().set_expiration_time(Timestamp::default()/* use setters */);
28736 /// ```
28737 pub fn set_expiration_time<T>(mut self, v: T) -> Self
28738 where
28739 T: std::convert::Into<wkt::Timestamp>,
28740 {
28741 self.expiration_time = std::option::Option::Some(v.into());
28742 self
28743 }
28744
28745 /// Sets or clears the value of [expiration_time][crate::model::SslCert::expiration_time].
28746 ///
28747 /// # Example
28748 /// ```ignore,no_run
28749 /// # use google_cloud_sql_v1::model::SslCert;
28750 /// use wkt::Timestamp;
28751 /// let x = SslCert::new().set_or_clear_expiration_time(Some(Timestamp::default()/* use setters */));
28752 /// let x = SslCert::new().set_or_clear_expiration_time(None::<Timestamp>);
28753 /// ```
28754 pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
28755 where
28756 T: std::convert::Into<wkt::Timestamp>,
28757 {
28758 self.expiration_time = v.map(|x| x.into());
28759 self
28760 }
28761
28762 /// Sets the value of [sha1_fingerprint][crate::model::SslCert::sha1_fingerprint].
28763 ///
28764 /// # Example
28765 /// ```ignore,no_run
28766 /// # use google_cloud_sql_v1::model::SslCert;
28767 /// let x = SslCert::new().set_sha1_fingerprint("example");
28768 /// ```
28769 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
28770 mut self,
28771 v: T,
28772 ) -> Self {
28773 self.sha1_fingerprint = v.into();
28774 self
28775 }
28776
28777 /// Sets the value of [instance][crate::model::SslCert::instance].
28778 ///
28779 /// # Example
28780 /// ```ignore,no_run
28781 /// # use google_cloud_sql_v1::model::SslCert;
28782 /// let x = SslCert::new().set_instance("example");
28783 /// ```
28784 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28785 self.instance = v.into();
28786 self
28787 }
28788
28789 /// Sets the value of [self_link][crate::model::SslCert::self_link].
28790 ///
28791 /// # Example
28792 /// ```ignore,no_run
28793 /// # use google_cloud_sql_v1::model::SslCert;
28794 /// let x = SslCert::new().set_self_link("example");
28795 /// ```
28796 pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28797 self.self_link = v.into();
28798 self
28799 }
28800}
28801
28802impl wkt::message::Message for SslCert {
28803 fn typename() -> &'static str {
28804 "type.googleapis.com/google.cloud.sql.v1.SslCert"
28805 }
28806}
28807
28808/// SslCertDetail.
28809#[derive(Clone, Default, PartialEq)]
28810#[non_exhaustive]
28811pub struct SslCertDetail {
28812 /// The public information about the cert.
28813 pub cert_info: std::option::Option<crate::model::SslCert>,
28814
28815 /// The private key for the client cert, in pem format. Keep private in order
28816 /// to protect your security.
28817 pub cert_private_key: std::string::String,
28818
28819 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28820}
28821
28822impl SslCertDetail {
28823 pub fn new() -> Self {
28824 std::default::Default::default()
28825 }
28826
28827 /// Sets the value of [cert_info][crate::model::SslCertDetail::cert_info].
28828 ///
28829 /// # Example
28830 /// ```ignore,no_run
28831 /// # use google_cloud_sql_v1::model::SslCertDetail;
28832 /// use google_cloud_sql_v1::model::SslCert;
28833 /// let x = SslCertDetail::new().set_cert_info(SslCert::default()/* use setters */);
28834 /// ```
28835 pub fn set_cert_info<T>(mut self, v: T) -> Self
28836 where
28837 T: std::convert::Into<crate::model::SslCert>,
28838 {
28839 self.cert_info = std::option::Option::Some(v.into());
28840 self
28841 }
28842
28843 /// Sets or clears the value of [cert_info][crate::model::SslCertDetail::cert_info].
28844 ///
28845 /// # Example
28846 /// ```ignore,no_run
28847 /// # use google_cloud_sql_v1::model::SslCertDetail;
28848 /// use google_cloud_sql_v1::model::SslCert;
28849 /// let x = SslCertDetail::new().set_or_clear_cert_info(Some(SslCert::default()/* use setters */));
28850 /// let x = SslCertDetail::new().set_or_clear_cert_info(None::<SslCert>);
28851 /// ```
28852 pub fn set_or_clear_cert_info<T>(mut self, v: std::option::Option<T>) -> Self
28853 where
28854 T: std::convert::Into<crate::model::SslCert>,
28855 {
28856 self.cert_info = v.map(|x| x.into());
28857 self
28858 }
28859
28860 /// Sets the value of [cert_private_key][crate::model::SslCertDetail::cert_private_key].
28861 ///
28862 /// # Example
28863 /// ```ignore,no_run
28864 /// # use google_cloud_sql_v1::model::SslCertDetail;
28865 /// let x = SslCertDetail::new().set_cert_private_key("example");
28866 /// ```
28867 pub fn set_cert_private_key<T: std::convert::Into<std::string::String>>(
28868 mut self,
28869 v: T,
28870 ) -> Self {
28871 self.cert_private_key = v.into();
28872 self
28873 }
28874}
28875
28876impl wkt::message::Message for SslCertDetail {
28877 fn typename() -> &'static str {
28878 "type.googleapis.com/google.cloud.sql.v1.SslCertDetail"
28879 }
28880}
28881
28882/// Active Directory configuration, relevant only for Cloud SQL for SQL Server.
28883#[derive(Clone, Default, PartialEq)]
28884#[non_exhaustive]
28885pub struct SqlActiveDirectoryConfig {
28886 /// This is always sql#activeDirectoryConfig.
28887 pub kind: std::string::String,
28888
28889 /// The name of the domain (e.g., mydomain.com).
28890 pub domain: std::string::String,
28891
28892 /// Optional. The mode of the Active Directory configuration.
28893 pub mode: crate::model::sql_active_directory_config::ActiveDirectoryMode,
28894
28895 /// Optional. Domain controller IPv4 addresses used to bootstrap Active
28896 /// Directory.
28897 pub dns_servers: std::vec::Vec<std::string::String>,
28898
28899 /// Optional. The secret manager key storing the administrator credential.
28900 /// (e.g., projects/{project}/secrets/{secret}).
28901 pub admin_credential_secret_name: std::string::String,
28902
28903 /// Optional. The organizational unit distinguished name. This is the full
28904 /// hierarchical path to the organizational unit.
28905 pub organizational_unit: std::string::String,
28906
28907 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28908}
28909
28910impl SqlActiveDirectoryConfig {
28911 pub fn new() -> Self {
28912 std::default::Default::default()
28913 }
28914
28915 /// Sets the value of [kind][crate::model::SqlActiveDirectoryConfig::kind].
28916 ///
28917 /// # Example
28918 /// ```ignore,no_run
28919 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28920 /// let x = SqlActiveDirectoryConfig::new().set_kind("example");
28921 /// ```
28922 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28923 self.kind = v.into();
28924 self
28925 }
28926
28927 /// Sets the value of [domain][crate::model::SqlActiveDirectoryConfig::domain].
28928 ///
28929 /// # Example
28930 /// ```ignore,no_run
28931 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28932 /// let x = SqlActiveDirectoryConfig::new().set_domain("example");
28933 /// ```
28934 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
28935 self.domain = v.into();
28936 self
28937 }
28938
28939 /// Sets the value of [mode][crate::model::SqlActiveDirectoryConfig::mode].
28940 ///
28941 /// # Example
28942 /// ```ignore,no_run
28943 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28944 /// use google_cloud_sql_v1::model::sql_active_directory_config::ActiveDirectoryMode;
28945 /// let x0 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::ManagedActiveDirectory);
28946 /// let x1 = SqlActiveDirectoryConfig::new().set_mode(ActiveDirectoryMode::CustomerManagedActiveDirectory);
28947 /// ```
28948 pub fn set_mode<
28949 T: std::convert::Into<crate::model::sql_active_directory_config::ActiveDirectoryMode>,
28950 >(
28951 mut self,
28952 v: T,
28953 ) -> Self {
28954 self.mode = v.into();
28955 self
28956 }
28957
28958 /// Sets the value of [dns_servers][crate::model::SqlActiveDirectoryConfig::dns_servers].
28959 ///
28960 /// # Example
28961 /// ```ignore,no_run
28962 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28963 /// let x = SqlActiveDirectoryConfig::new().set_dns_servers(["a", "b", "c"]);
28964 /// ```
28965 pub fn set_dns_servers<T, V>(mut self, v: T) -> Self
28966 where
28967 T: std::iter::IntoIterator<Item = V>,
28968 V: std::convert::Into<std::string::String>,
28969 {
28970 use std::iter::Iterator;
28971 self.dns_servers = v.into_iter().map(|i| i.into()).collect();
28972 self
28973 }
28974
28975 /// Sets the value of [admin_credential_secret_name][crate::model::SqlActiveDirectoryConfig::admin_credential_secret_name].
28976 ///
28977 /// # Example
28978 /// ```ignore,no_run
28979 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28980 /// let x = SqlActiveDirectoryConfig::new().set_admin_credential_secret_name("example");
28981 /// ```
28982 pub fn set_admin_credential_secret_name<T: std::convert::Into<std::string::String>>(
28983 mut self,
28984 v: T,
28985 ) -> Self {
28986 self.admin_credential_secret_name = v.into();
28987 self
28988 }
28989
28990 /// Sets the value of [organizational_unit][crate::model::SqlActiveDirectoryConfig::organizational_unit].
28991 ///
28992 /// # Example
28993 /// ```ignore,no_run
28994 /// # use google_cloud_sql_v1::model::SqlActiveDirectoryConfig;
28995 /// let x = SqlActiveDirectoryConfig::new().set_organizational_unit("example");
28996 /// ```
28997 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
28998 mut self,
28999 v: T,
29000 ) -> Self {
29001 self.organizational_unit = v.into();
29002 self
29003 }
29004}
29005
29006impl wkt::message::Message for SqlActiveDirectoryConfig {
29007 fn typename() -> &'static str {
29008 "type.googleapis.com/google.cloud.sql.v1.SqlActiveDirectoryConfig"
29009 }
29010}
29011
29012/// Defines additional types related to [SqlActiveDirectoryConfig].
29013pub mod sql_active_directory_config {
29014 #[allow(unused_imports)]
29015 use super::*;
29016
29017 /// The modes of Active Directory configuration.
29018 ///
29019 /// # Working with unknown values
29020 ///
29021 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29022 /// additional enum variants at any time. Adding new variants is not considered
29023 /// a breaking change. Applications should write their code in anticipation of:
29024 ///
29025 /// - New values appearing in future releases of the client library, **and**
29026 /// - New values received dynamically, without application changes.
29027 ///
29028 /// Please consult the [Working with enums] section in the user guide for some
29029 /// guidelines.
29030 ///
29031 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29032 #[derive(Clone, Debug, PartialEq)]
29033 #[non_exhaustive]
29034 pub enum ActiveDirectoryMode {
29035 /// Unspecified mode. Will default to MANAGED_ACTIVE_DIRECTORY if the mode is
29036 /// not specified to maintain backward compatibility.
29037 Unspecified,
29038 /// Managed Active Directory mode.
29039 ManagedActiveDirectory,
29040 /// Deprecated: Use CUSTOMER_MANAGED_ACTIVE_DIRECTORY instead.
29041 #[deprecated]
29042 SelfManagedActiveDirectory,
29043 /// Customer-managed Active Directory mode.
29044 CustomerManagedActiveDirectory,
29045 /// If set, the enum was initialized with an unknown value.
29046 ///
29047 /// Applications can examine the value using [ActiveDirectoryMode::value] or
29048 /// [ActiveDirectoryMode::name].
29049 UnknownValue(active_directory_mode::UnknownValue),
29050 }
29051
29052 #[doc(hidden)]
29053 pub mod active_directory_mode {
29054 #[allow(unused_imports)]
29055 use super::*;
29056 #[derive(Clone, Debug, PartialEq)]
29057 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29058 }
29059
29060 impl ActiveDirectoryMode {
29061 /// Gets the enum value.
29062 ///
29063 /// Returns `None` if the enum contains an unknown value deserialized from
29064 /// the string representation of enums.
29065 pub fn value(&self) -> std::option::Option<i32> {
29066 match self {
29067 Self::Unspecified => std::option::Option::Some(0),
29068 Self::ManagedActiveDirectory => std::option::Option::Some(1),
29069 Self::SelfManagedActiveDirectory => std::option::Option::Some(2),
29070 Self::CustomerManagedActiveDirectory => std::option::Option::Some(3),
29071 Self::UnknownValue(u) => u.0.value(),
29072 }
29073 }
29074
29075 /// Gets the enum value as a string.
29076 ///
29077 /// Returns `None` if the enum contains an unknown value deserialized from
29078 /// the integer representation of enums.
29079 pub fn name(&self) -> std::option::Option<&str> {
29080 match self {
29081 Self::Unspecified => std::option::Option::Some("ACTIVE_DIRECTORY_MODE_UNSPECIFIED"),
29082 Self::ManagedActiveDirectory => {
29083 std::option::Option::Some("MANAGED_ACTIVE_DIRECTORY")
29084 }
29085 Self::SelfManagedActiveDirectory => {
29086 std::option::Option::Some("SELF_MANAGED_ACTIVE_DIRECTORY")
29087 }
29088 Self::CustomerManagedActiveDirectory => {
29089 std::option::Option::Some("CUSTOMER_MANAGED_ACTIVE_DIRECTORY")
29090 }
29091 Self::UnknownValue(u) => u.0.name(),
29092 }
29093 }
29094 }
29095
29096 impl std::default::Default for ActiveDirectoryMode {
29097 fn default() -> Self {
29098 use std::convert::From;
29099 Self::from(0)
29100 }
29101 }
29102
29103 impl std::fmt::Display for ActiveDirectoryMode {
29104 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29105 wkt::internal::display_enum(f, self.name(), self.value())
29106 }
29107 }
29108
29109 impl std::convert::From<i32> for ActiveDirectoryMode {
29110 fn from(value: i32) -> Self {
29111 match value {
29112 0 => Self::Unspecified,
29113 1 => Self::ManagedActiveDirectory,
29114 2 => Self::SelfManagedActiveDirectory,
29115 3 => Self::CustomerManagedActiveDirectory,
29116 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29117 wkt::internal::UnknownEnumValue::Integer(value),
29118 )),
29119 }
29120 }
29121 }
29122
29123 impl std::convert::From<&str> for ActiveDirectoryMode {
29124 fn from(value: &str) -> Self {
29125 use std::string::ToString;
29126 match value {
29127 "ACTIVE_DIRECTORY_MODE_UNSPECIFIED" => Self::Unspecified,
29128 "MANAGED_ACTIVE_DIRECTORY" => Self::ManagedActiveDirectory,
29129 "SELF_MANAGED_ACTIVE_DIRECTORY" => Self::SelfManagedActiveDirectory,
29130 "CUSTOMER_MANAGED_ACTIVE_DIRECTORY" => Self::CustomerManagedActiveDirectory,
29131 _ => Self::UnknownValue(active_directory_mode::UnknownValue(
29132 wkt::internal::UnknownEnumValue::String(value.to_string()),
29133 )),
29134 }
29135 }
29136 }
29137
29138 impl serde::ser::Serialize for ActiveDirectoryMode {
29139 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29140 where
29141 S: serde::Serializer,
29142 {
29143 match self {
29144 Self::Unspecified => serializer.serialize_i32(0),
29145 Self::ManagedActiveDirectory => serializer.serialize_i32(1),
29146 Self::SelfManagedActiveDirectory => serializer.serialize_i32(2),
29147 Self::CustomerManagedActiveDirectory => serializer.serialize_i32(3),
29148 Self::UnknownValue(u) => u.0.serialize(serializer),
29149 }
29150 }
29151 }
29152
29153 impl<'de> serde::de::Deserialize<'de> for ActiveDirectoryMode {
29154 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29155 where
29156 D: serde::Deserializer<'de>,
29157 {
29158 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ActiveDirectoryMode>::new(
29159 ".google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode",
29160 ))
29161 }
29162 }
29163}
29164
29165/// SQL Server specific audit configuration.
29166#[derive(Clone, Default, PartialEq)]
29167#[non_exhaustive]
29168pub struct SqlServerAuditConfig {
29169 /// This is always sql#sqlServerAuditConfig
29170 pub kind: std::string::String,
29171
29172 /// The name of the destination bucket (e.g., gs://mybucket).
29173 pub bucket: std::string::String,
29174
29175 /// How long to keep generated audit files.
29176 pub retention_interval: std::option::Option<wkt::Duration>,
29177
29178 /// How often to upload generated audit files.
29179 pub upload_interval: std::option::Option<wkt::Duration>,
29180
29181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29182}
29183
29184impl SqlServerAuditConfig {
29185 pub fn new() -> Self {
29186 std::default::Default::default()
29187 }
29188
29189 /// Sets the value of [kind][crate::model::SqlServerAuditConfig::kind].
29190 ///
29191 /// # Example
29192 /// ```ignore,no_run
29193 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29194 /// let x = SqlServerAuditConfig::new().set_kind("example");
29195 /// ```
29196 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29197 self.kind = v.into();
29198 self
29199 }
29200
29201 /// Sets the value of [bucket][crate::model::SqlServerAuditConfig::bucket].
29202 ///
29203 /// # Example
29204 /// ```ignore,no_run
29205 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29206 /// let x = SqlServerAuditConfig::new().set_bucket("example");
29207 /// ```
29208 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29209 self.bucket = v.into();
29210 self
29211 }
29212
29213 /// Sets the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29214 ///
29215 /// # Example
29216 /// ```ignore,no_run
29217 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29218 /// use wkt::Duration;
29219 /// let x = SqlServerAuditConfig::new().set_retention_interval(Duration::default()/* use setters */);
29220 /// ```
29221 pub fn set_retention_interval<T>(mut self, v: T) -> Self
29222 where
29223 T: std::convert::Into<wkt::Duration>,
29224 {
29225 self.retention_interval = std::option::Option::Some(v.into());
29226 self
29227 }
29228
29229 /// Sets or clears the value of [retention_interval][crate::model::SqlServerAuditConfig::retention_interval].
29230 ///
29231 /// # Example
29232 /// ```ignore,no_run
29233 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29234 /// use wkt::Duration;
29235 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(Some(Duration::default()/* use setters */));
29236 /// let x = SqlServerAuditConfig::new().set_or_clear_retention_interval(None::<Duration>);
29237 /// ```
29238 pub fn set_or_clear_retention_interval<T>(mut self, v: std::option::Option<T>) -> Self
29239 where
29240 T: std::convert::Into<wkt::Duration>,
29241 {
29242 self.retention_interval = v.map(|x| x.into());
29243 self
29244 }
29245
29246 /// Sets the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29247 ///
29248 /// # Example
29249 /// ```ignore,no_run
29250 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29251 /// use wkt::Duration;
29252 /// let x = SqlServerAuditConfig::new().set_upload_interval(Duration::default()/* use setters */);
29253 /// ```
29254 pub fn set_upload_interval<T>(mut self, v: T) -> Self
29255 where
29256 T: std::convert::Into<wkt::Duration>,
29257 {
29258 self.upload_interval = std::option::Option::Some(v.into());
29259 self
29260 }
29261
29262 /// Sets or clears the value of [upload_interval][crate::model::SqlServerAuditConfig::upload_interval].
29263 ///
29264 /// # Example
29265 /// ```ignore,no_run
29266 /// # use google_cloud_sql_v1::model::SqlServerAuditConfig;
29267 /// use wkt::Duration;
29268 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(Some(Duration::default()/* use setters */));
29269 /// let x = SqlServerAuditConfig::new().set_or_clear_upload_interval(None::<Duration>);
29270 /// ```
29271 pub fn set_or_clear_upload_interval<T>(mut self, v: std::option::Option<T>) -> Self
29272 where
29273 T: std::convert::Into<wkt::Duration>,
29274 {
29275 self.upload_interval = v.map(|x| x.into());
29276 self
29277 }
29278}
29279
29280impl wkt::message::Message for SqlServerAuditConfig {
29281 fn typename() -> &'static str {
29282 "type.googleapis.com/google.cloud.sql.v1.SqlServerAuditConfig"
29283 }
29284}
29285
29286/// SQL Server Entra ID configuration.
29287#[derive(Clone, Default, PartialEq)]
29288#[non_exhaustive]
29289pub struct SqlServerEntraIdConfig {
29290 /// Output only. This is always sql#sqlServerEntraIdConfig
29291 pub kind: std::string::String,
29292
29293 /// Optional. The tenant ID for the Entra ID configuration.
29294 pub tenant_id: std::string::String,
29295
29296 /// Optional. The application ID for the Entra ID configuration.
29297 pub application_id: std::string::String,
29298
29299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29300}
29301
29302impl SqlServerEntraIdConfig {
29303 pub fn new() -> Self {
29304 std::default::Default::default()
29305 }
29306
29307 /// Sets the value of [kind][crate::model::SqlServerEntraIdConfig::kind].
29308 ///
29309 /// # Example
29310 /// ```ignore,no_run
29311 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29312 /// let x = SqlServerEntraIdConfig::new().set_kind("example");
29313 /// ```
29314 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29315 self.kind = v.into();
29316 self
29317 }
29318
29319 /// Sets the value of [tenant_id][crate::model::SqlServerEntraIdConfig::tenant_id].
29320 ///
29321 /// # Example
29322 /// ```ignore,no_run
29323 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29324 /// let x = SqlServerEntraIdConfig::new().set_tenant_id("example");
29325 /// ```
29326 pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29327 self.tenant_id = v.into();
29328 self
29329 }
29330
29331 /// Sets the value of [application_id][crate::model::SqlServerEntraIdConfig::application_id].
29332 ///
29333 /// # Example
29334 /// ```ignore,no_run
29335 /// # use google_cloud_sql_v1::model::SqlServerEntraIdConfig;
29336 /// let x = SqlServerEntraIdConfig::new().set_application_id("example");
29337 /// ```
29338 pub fn set_application_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29339 self.application_id = v.into();
29340 self
29341 }
29342}
29343
29344impl wkt::message::Message for SqlServerEntraIdConfig {
29345 fn typename() -> &'static str {
29346 "type.googleapis.com/google.cloud.sql.v1.SqlServerEntraIdConfig"
29347 }
29348}
29349
29350/// Acquire SSRS lease context.
29351#[derive(Clone, Default, PartialEq)]
29352#[non_exhaustive]
29353pub struct AcquireSsrsLeaseContext {
29354 /// The username to be used as the setup login to connect to the database
29355 /// server for SSRS setup.
29356 pub setup_login: std::option::Option<std::string::String>,
29357
29358 /// The username to be used as the service login to connect to the report
29359 /// database for SSRS setup.
29360 pub service_login: std::option::Option<std::string::String>,
29361
29362 /// The report database to be used for SSRS setup.
29363 pub report_database: std::option::Option<std::string::String>,
29364
29365 /// Lease duration needed for SSRS setup.
29366 pub duration: std::option::Option<wkt::Duration>,
29367
29368 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29369}
29370
29371impl AcquireSsrsLeaseContext {
29372 pub fn new() -> Self {
29373 std::default::Default::default()
29374 }
29375
29376 /// Sets the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29377 ///
29378 /// # Example
29379 /// ```ignore,no_run
29380 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29381 /// let x = AcquireSsrsLeaseContext::new().set_setup_login("example");
29382 /// ```
29383 pub fn set_setup_login<T>(mut self, v: T) -> Self
29384 where
29385 T: std::convert::Into<std::string::String>,
29386 {
29387 self.setup_login = std::option::Option::Some(v.into());
29388 self
29389 }
29390
29391 /// Sets or clears the value of [setup_login][crate::model::AcquireSsrsLeaseContext::setup_login].
29392 ///
29393 /// # Example
29394 /// ```ignore,no_run
29395 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29396 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(Some("example"));
29397 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_setup_login(None::<String>);
29398 /// ```
29399 pub fn set_or_clear_setup_login<T>(mut self, v: std::option::Option<T>) -> Self
29400 where
29401 T: std::convert::Into<std::string::String>,
29402 {
29403 self.setup_login = v.map(|x| x.into());
29404 self
29405 }
29406
29407 /// Sets the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29408 ///
29409 /// # Example
29410 /// ```ignore,no_run
29411 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29412 /// let x = AcquireSsrsLeaseContext::new().set_service_login("example");
29413 /// ```
29414 pub fn set_service_login<T>(mut self, v: T) -> Self
29415 where
29416 T: std::convert::Into<std::string::String>,
29417 {
29418 self.service_login = std::option::Option::Some(v.into());
29419 self
29420 }
29421
29422 /// Sets or clears the value of [service_login][crate::model::AcquireSsrsLeaseContext::service_login].
29423 ///
29424 /// # Example
29425 /// ```ignore,no_run
29426 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29427 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(Some("example"));
29428 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_service_login(None::<String>);
29429 /// ```
29430 pub fn set_or_clear_service_login<T>(mut self, v: std::option::Option<T>) -> Self
29431 where
29432 T: std::convert::Into<std::string::String>,
29433 {
29434 self.service_login = v.map(|x| x.into());
29435 self
29436 }
29437
29438 /// Sets the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29439 ///
29440 /// # Example
29441 /// ```ignore,no_run
29442 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29443 /// let x = AcquireSsrsLeaseContext::new().set_report_database("example");
29444 /// ```
29445 pub fn set_report_database<T>(mut self, v: T) -> Self
29446 where
29447 T: std::convert::Into<std::string::String>,
29448 {
29449 self.report_database = std::option::Option::Some(v.into());
29450 self
29451 }
29452
29453 /// Sets or clears the value of [report_database][crate::model::AcquireSsrsLeaseContext::report_database].
29454 ///
29455 /// # Example
29456 /// ```ignore,no_run
29457 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29458 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(Some("example"));
29459 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_report_database(None::<String>);
29460 /// ```
29461 pub fn set_or_clear_report_database<T>(mut self, v: std::option::Option<T>) -> Self
29462 where
29463 T: std::convert::Into<std::string::String>,
29464 {
29465 self.report_database = v.map(|x| x.into());
29466 self
29467 }
29468
29469 /// Sets the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29470 ///
29471 /// # Example
29472 /// ```ignore,no_run
29473 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29474 /// use wkt::Duration;
29475 /// let x = AcquireSsrsLeaseContext::new().set_duration(Duration::default()/* use setters */);
29476 /// ```
29477 pub fn set_duration<T>(mut self, v: T) -> Self
29478 where
29479 T: std::convert::Into<wkt::Duration>,
29480 {
29481 self.duration = std::option::Option::Some(v.into());
29482 self
29483 }
29484
29485 /// Sets or clears the value of [duration][crate::model::AcquireSsrsLeaseContext::duration].
29486 ///
29487 /// # Example
29488 /// ```ignore,no_run
29489 /// # use google_cloud_sql_v1::model::AcquireSsrsLeaseContext;
29490 /// use wkt::Duration;
29491 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(Some(Duration::default()/* use setters */));
29492 /// let x = AcquireSsrsLeaseContext::new().set_or_clear_duration(None::<Duration>);
29493 /// ```
29494 pub fn set_or_clear_duration<T>(mut self, v: std::option::Option<T>) -> Self
29495 where
29496 T: std::convert::Into<wkt::Duration>,
29497 {
29498 self.duration = v.map(|x| x.into());
29499 self
29500 }
29501}
29502
29503impl wkt::message::Message for AcquireSsrsLeaseContext {
29504 fn typename() -> &'static str {
29505 "type.googleapis.com/google.cloud.sql.v1.AcquireSsrsLeaseContext"
29506 }
29507}
29508
29509/// DNS metadata.
29510#[derive(Clone, Default, PartialEq)]
29511#[non_exhaustive]
29512pub struct DnsNameMapping {
29513 /// Output only. The DNS name.
29514 pub name: std::string::String,
29515
29516 /// Output only. The connection type of the DNS name.
29517 pub connection_type: crate::model::dns_name_mapping::ConnectionType,
29518
29519 /// Output only. The scope that the DNS name applies to.
29520 pub dns_scope: crate::model::dns_name_mapping::DnsScope,
29521
29522 /// Output only. The manager for this DNS record.
29523 pub record_manager: crate::model::dns_name_mapping::RecordManager,
29524
29525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
29526}
29527
29528impl DnsNameMapping {
29529 pub fn new() -> Self {
29530 std::default::Default::default()
29531 }
29532
29533 /// Sets the value of [name][crate::model::DnsNameMapping::name].
29534 ///
29535 /// # Example
29536 /// ```ignore,no_run
29537 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29538 /// let x = DnsNameMapping::new().set_name("example");
29539 /// ```
29540 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
29541 self.name = v.into();
29542 self
29543 }
29544
29545 /// Sets the value of [connection_type][crate::model::DnsNameMapping::connection_type].
29546 ///
29547 /// # Example
29548 /// ```ignore,no_run
29549 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29550 /// use google_cloud_sql_v1::model::dns_name_mapping::ConnectionType;
29551 /// let x0 = DnsNameMapping::new().set_connection_type(ConnectionType::Public);
29552 /// let x1 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServicesAccess);
29553 /// let x2 = DnsNameMapping::new().set_connection_type(ConnectionType::PrivateServiceConnect);
29554 /// ```
29555 pub fn set_connection_type<
29556 T: std::convert::Into<crate::model::dns_name_mapping::ConnectionType>,
29557 >(
29558 mut self,
29559 v: T,
29560 ) -> Self {
29561 self.connection_type = v.into();
29562 self
29563 }
29564
29565 /// Sets the value of [dns_scope][crate::model::DnsNameMapping::dns_scope].
29566 ///
29567 /// # Example
29568 /// ```ignore,no_run
29569 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29570 /// use google_cloud_sql_v1::model::dns_name_mapping::DnsScope;
29571 /// let x0 = DnsNameMapping::new().set_dns_scope(DnsScope::Instance);
29572 /// let x1 = DnsNameMapping::new().set_dns_scope(DnsScope::Cluster);
29573 /// ```
29574 pub fn set_dns_scope<T: std::convert::Into<crate::model::dns_name_mapping::DnsScope>>(
29575 mut self,
29576 v: T,
29577 ) -> Self {
29578 self.dns_scope = v.into();
29579 self
29580 }
29581
29582 /// Sets the value of [record_manager][crate::model::DnsNameMapping::record_manager].
29583 ///
29584 /// # Example
29585 /// ```ignore,no_run
29586 /// # use google_cloud_sql_v1::model::DnsNameMapping;
29587 /// use google_cloud_sql_v1::model::dns_name_mapping::RecordManager;
29588 /// let x0 = DnsNameMapping::new().set_record_manager(RecordManager::Customer);
29589 /// let x1 = DnsNameMapping::new().set_record_manager(RecordManager::CloudSqlAutomation);
29590 /// ```
29591 pub fn set_record_manager<
29592 T: std::convert::Into<crate::model::dns_name_mapping::RecordManager>,
29593 >(
29594 mut self,
29595 v: T,
29596 ) -> Self {
29597 self.record_manager = v.into();
29598 self
29599 }
29600}
29601
29602impl wkt::message::Message for DnsNameMapping {
29603 fn typename() -> &'static str {
29604 "type.googleapis.com/google.cloud.sql.v1.DnsNameMapping"
29605 }
29606}
29607
29608/// Defines additional types related to [DnsNameMapping].
29609pub mod dns_name_mapping {
29610 #[allow(unused_imports)]
29611 use super::*;
29612
29613 /// The connection type of the DNS name.
29614 /// This enum is not frozen, and new values may be added in the future.
29615 ///
29616 /// # Working with unknown values
29617 ///
29618 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29619 /// additional enum variants at any time. Adding new variants is not considered
29620 /// a breaking change. Applications should write their code in anticipation of:
29621 ///
29622 /// - New values appearing in future releases of the client library, **and**
29623 /// - New values received dynamically, without application changes.
29624 ///
29625 /// Please consult the [Working with enums] section in the user guide for some
29626 /// guidelines.
29627 ///
29628 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29629 #[derive(Clone, Debug, PartialEq)]
29630 #[non_exhaustive]
29631 pub enum ConnectionType {
29632 /// Unknown connection type.
29633 Unspecified,
29634 /// Public IP.
29635 Public,
29636 /// Private services access (private IP).
29637 PrivateServicesAccess,
29638 /// Private Service Connect.
29639 PrivateServiceConnect,
29640 /// If set, the enum was initialized with an unknown value.
29641 ///
29642 /// Applications can examine the value using [ConnectionType::value] or
29643 /// [ConnectionType::name].
29644 UnknownValue(connection_type::UnknownValue),
29645 }
29646
29647 #[doc(hidden)]
29648 pub mod connection_type {
29649 #[allow(unused_imports)]
29650 use super::*;
29651 #[derive(Clone, Debug, PartialEq)]
29652 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29653 }
29654
29655 impl ConnectionType {
29656 /// Gets the enum value.
29657 ///
29658 /// Returns `None` if the enum contains an unknown value deserialized from
29659 /// the string representation of enums.
29660 pub fn value(&self) -> std::option::Option<i32> {
29661 match self {
29662 Self::Unspecified => std::option::Option::Some(0),
29663 Self::Public => std::option::Option::Some(1),
29664 Self::PrivateServicesAccess => std::option::Option::Some(2),
29665 Self::PrivateServiceConnect => std::option::Option::Some(3),
29666 Self::UnknownValue(u) => u.0.value(),
29667 }
29668 }
29669
29670 /// Gets the enum value as a string.
29671 ///
29672 /// Returns `None` if the enum contains an unknown value deserialized from
29673 /// the integer representation of enums.
29674 pub fn name(&self) -> std::option::Option<&str> {
29675 match self {
29676 Self::Unspecified => std::option::Option::Some("CONNECTION_TYPE_UNSPECIFIED"),
29677 Self::Public => std::option::Option::Some("PUBLIC"),
29678 Self::PrivateServicesAccess => std::option::Option::Some("PRIVATE_SERVICES_ACCESS"),
29679 Self::PrivateServiceConnect => std::option::Option::Some("PRIVATE_SERVICE_CONNECT"),
29680 Self::UnknownValue(u) => u.0.name(),
29681 }
29682 }
29683 }
29684
29685 impl std::default::Default for ConnectionType {
29686 fn default() -> Self {
29687 use std::convert::From;
29688 Self::from(0)
29689 }
29690 }
29691
29692 impl std::fmt::Display for ConnectionType {
29693 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29694 wkt::internal::display_enum(f, self.name(), self.value())
29695 }
29696 }
29697
29698 impl std::convert::From<i32> for ConnectionType {
29699 fn from(value: i32) -> Self {
29700 match value {
29701 0 => Self::Unspecified,
29702 1 => Self::Public,
29703 2 => Self::PrivateServicesAccess,
29704 3 => Self::PrivateServiceConnect,
29705 _ => Self::UnknownValue(connection_type::UnknownValue(
29706 wkt::internal::UnknownEnumValue::Integer(value),
29707 )),
29708 }
29709 }
29710 }
29711
29712 impl std::convert::From<&str> for ConnectionType {
29713 fn from(value: &str) -> Self {
29714 use std::string::ToString;
29715 match value {
29716 "CONNECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
29717 "PUBLIC" => Self::Public,
29718 "PRIVATE_SERVICES_ACCESS" => Self::PrivateServicesAccess,
29719 "PRIVATE_SERVICE_CONNECT" => Self::PrivateServiceConnect,
29720 _ => Self::UnknownValue(connection_type::UnknownValue(
29721 wkt::internal::UnknownEnumValue::String(value.to_string()),
29722 )),
29723 }
29724 }
29725 }
29726
29727 impl serde::ser::Serialize for ConnectionType {
29728 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29729 where
29730 S: serde::Serializer,
29731 {
29732 match self {
29733 Self::Unspecified => serializer.serialize_i32(0),
29734 Self::Public => serializer.serialize_i32(1),
29735 Self::PrivateServicesAccess => serializer.serialize_i32(2),
29736 Self::PrivateServiceConnect => serializer.serialize_i32(3),
29737 Self::UnknownValue(u) => u.0.serialize(serializer),
29738 }
29739 }
29740 }
29741
29742 impl<'de> serde::de::Deserialize<'de> for ConnectionType {
29743 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29744 where
29745 D: serde::Deserializer<'de>,
29746 {
29747 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionType>::new(
29748 ".google.cloud.sql.v1.DnsNameMapping.ConnectionType",
29749 ))
29750 }
29751 }
29752
29753 /// The scope that the DNS name applies to.
29754 ///
29755 /// # Working with unknown values
29756 ///
29757 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29758 /// additional enum variants at any time. Adding new variants is not considered
29759 /// a breaking change. Applications should write their code in anticipation of:
29760 ///
29761 /// - New values appearing in future releases of the client library, **and**
29762 /// - New values received dynamically, without application changes.
29763 ///
29764 /// Please consult the [Working with enums] section in the user guide for some
29765 /// guidelines.
29766 ///
29767 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29768 #[derive(Clone, Debug, PartialEq)]
29769 #[non_exhaustive]
29770 pub enum DnsScope {
29771 /// DNS scope not set. This value should not be used.
29772 Unspecified,
29773 /// Indicates an instance-level DNS name.
29774 Instance,
29775 /// Indicates a cluster-level DNS name.
29776 Cluster,
29777 /// If set, the enum was initialized with an unknown value.
29778 ///
29779 /// Applications can examine the value using [DnsScope::value] or
29780 /// [DnsScope::name].
29781 UnknownValue(dns_scope::UnknownValue),
29782 }
29783
29784 #[doc(hidden)]
29785 pub mod dns_scope {
29786 #[allow(unused_imports)]
29787 use super::*;
29788 #[derive(Clone, Debug, PartialEq)]
29789 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29790 }
29791
29792 impl DnsScope {
29793 /// Gets the enum value.
29794 ///
29795 /// Returns `None` if the enum contains an unknown value deserialized from
29796 /// the string representation of enums.
29797 pub fn value(&self) -> std::option::Option<i32> {
29798 match self {
29799 Self::Unspecified => std::option::Option::Some(0),
29800 Self::Instance => std::option::Option::Some(1),
29801 Self::Cluster => std::option::Option::Some(2),
29802 Self::UnknownValue(u) => u.0.value(),
29803 }
29804 }
29805
29806 /// Gets the enum value as a string.
29807 ///
29808 /// Returns `None` if the enum contains an unknown value deserialized from
29809 /// the integer representation of enums.
29810 pub fn name(&self) -> std::option::Option<&str> {
29811 match self {
29812 Self::Unspecified => std::option::Option::Some("DNS_SCOPE_UNSPECIFIED"),
29813 Self::Instance => std::option::Option::Some("INSTANCE"),
29814 Self::Cluster => std::option::Option::Some("CLUSTER"),
29815 Self::UnknownValue(u) => u.0.name(),
29816 }
29817 }
29818 }
29819
29820 impl std::default::Default for DnsScope {
29821 fn default() -> Self {
29822 use std::convert::From;
29823 Self::from(0)
29824 }
29825 }
29826
29827 impl std::fmt::Display for DnsScope {
29828 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29829 wkt::internal::display_enum(f, self.name(), self.value())
29830 }
29831 }
29832
29833 impl std::convert::From<i32> for DnsScope {
29834 fn from(value: i32) -> Self {
29835 match value {
29836 0 => Self::Unspecified,
29837 1 => Self::Instance,
29838 2 => Self::Cluster,
29839 _ => Self::UnknownValue(dns_scope::UnknownValue(
29840 wkt::internal::UnknownEnumValue::Integer(value),
29841 )),
29842 }
29843 }
29844 }
29845
29846 impl std::convert::From<&str> for DnsScope {
29847 fn from(value: &str) -> Self {
29848 use std::string::ToString;
29849 match value {
29850 "DNS_SCOPE_UNSPECIFIED" => Self::Unspecified,
29851 "INSTANCE" => Self::Instance,
29852 "CLUSTER" => Self::Cluster,
29853 _ => Self::UnknownValue(dns_scope::UnknownValue(
29854 wkt::internal::UnknownEnumValue::String(value.to_string()),
29855 )),
29856 }
29857 }
29858 }
29859
29860 impl serde::ser::Serialize for DnsScope {
29861 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29862 where
29863 S: serde::Serializer,
29864 {
29865 match self {
29866 Self::Unspecified => serializer.serialize_i32(0),
29867 Self::Instance => serializer.serialize_i32(1),
29868 Self::Cluster => serializer.serialize_i32(2),
29869 Self::UnknownValue(u) => u.0.serialize(serializer),
29870 }
29871 }
29872 }
29873
29874 impl<'de> serde::de::Deserialize<'de> for DnsScope {
29875 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
29876 where
29877 D: serde::Deserializer<'de>,
29878 {
29879 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DnsScope>::new(
29880 ".google.cloud.sql.v1.DnsNameMapping.DnsScope",
29881 ))
29882 }
29883 }
29884
29885 /// The system responsible for managing the DNS record.
29886 ///
29887 /// # Working with unknown values
29888 ///
29889 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
29890 /// additional enum variants at any time. Adding new variants is not considered
29891 /// a breaking change. Applications should write their code in anticipation of:
29892 ///
29893 /// - New values appearing in future releases of the client library, **and**
29894 /// - New values received dynamically, without application changes.
29895 ///
29896 /// Please consult the [Working with enums] section in the user guide for some
29897 /// guidelines.
29898 ///
29899 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
29900 #[derive(Clone, Debug, PartialEq)]
29901 #[non_exhaustive]
29902 pub enum RecordManager {
29903 /// Record manager not set. This value should not be used.
29904 Unspecified,
29905 /// The record may be managed by the customer. It is not automatically
29906 /// managed by Cloud SQL automation.
29907 Customer,
29908 /// The record is managed by Cloud SQL, which will create, update,
29909 /// and delete the DNS records for the zone automatically when
29910 /// the Cloud SQL database instance is created or updated.
29911 CloudSqlAutomation,
29912 /// If set, the enum was initialized with an unknown value.
29913 ///
29914 /// Applications can examine the value using [RecordManager::value] or
29915 /// [RecordManager::name].
29916 UnknownValue(record_manager::UnknownValue),
29917 }
29918
29919 #[doc(hidden)]
29920 pub mod record_manager {
29921 #[allow(unused_imports)]
29922 use super::*;
29923 #[derive(Clone, Debug, PartialEq)]
29924 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
29925 }
29926
29927 impl RecordManager {
29928 /// Gets the enum value.
29929 ///
29930 /// Returns `None` if the enum contains an unknown value deserialized from
29931 /// the string representation of enums.
29932 pub fn value(&self) -> std::option::Option<i32> {
29933 match self {
29934 Self::Unspecified => std::option::Option::Some(0),
29935 Self::Customer => std::option::Option::Some(1),
29936 Self::CloudSqlAutomation => std::option::Option::Some(2),
29937 Self::UnknownValue(u) => u.0.value(),
29938 }
29939 }
29940
29941 /// Gets the enum value as a string.
29942 ///
29943 /// Returns `None` if the enum contains an unknown value deserialized from
29944 /// the integer representation of enums.
29945 pub fn name(&self) -> std::option::Option<&str> {
29946 match self {
29947 Self::Unspecified => std::option::Option::Some("RECORD_MANAGER_UNSPECIFIED"),
29948 Self::Customer => std::option::Option::Some("CUSTOMER"),
29949 Self::CloudSqlAutomation => std::option::Option::Some("CLOUD_SQL_AUTOMATION"),
29950 Self::UnknownValue(u) => u.0.name(),
29951 }
29952 }
29953 }
29954
29955 impl std::default::Default for RecordManager {
29956 fn default() -> Self {
29957 use std::convert::From;
29958 Self::from(0)
29959 }
29960 }
29961
29962 impl std::fmt::Display for RecordManager {
29963 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29964 wkt::internal::display_enum(f, self.name(), self.value())
29965 }
29966 }
29967
29968 impl std::convert::From<i32> for RecordManager {
29969 fn from(value: i32) -> Self {
29970 match value {
29971 0 => Self::Unspecified,
29972 1 => Self::Customer,
29973 2 => Self::CloudSqlAutomation,
29974 _ => Self::UnknownValue(record_manager::UnknownValue(
29975 wkt::internal::UnknownEnumValue::Integer(value),
29976 )),
29977 }
29978 }
29979 }
29980
29981 impl std::convert::From<&str> for RecordManager {
29982 fn from(value: &str) -> Self {
29983 use std::string::ToString;
29984 match value {
29985 "RECORD_MANAGER_UNSPECIFIED" => Self::Unspecified,
29986 "CUSTOMER" => Self::Customer,
29987 "CLOUD_SQL_AUTOMATION" => Self::CloudSqlAutomation,
29988 _ => Self::UnknownValue(record_manager::UnknownValue(
29989 wkt::internal::UnknownEnumValue::String(value.to_string()),
29990 )),
29991 }
29992 }
29993 }
29994
29995 impl serde::ser::Serialize for RecordManager {
29996 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
29997 where
29998 S: serde::Serializer,
29999 {
30000 match self {
30001 Self::Unspecified => serializer.serialize_i32(0),
30002 Self::Customer => serializer.serialize_i32(1),
30003 Self::CloudSqlAutomation => serializer.serialize_i32(2),
30004 Self::UnknownValue(u) => u.0.serialize(serializer),
30005 }
30006 }
30007 }
30008
30009 impl<'de> serde::de::Deserialize<'de> for RecordManager {
30010 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
30011 where
30012 D: serde::Deserializer<'de>,
30013 {
30014 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RecordManager>::new(
30015 ".google.cloud.sql.v1.DnsNameMapping.RecordManager",
30016 ))
30017 }
30018 }
30019}
30020
30021#[derive(Clone, Default, PartialEq)]
30022#[non_exhaustive]
30023pub struct SqlSslCertsDeleteRequest {
30024 /// Cloud SQL instance ID. This does not include the project ID.
30025 pub instance: std::string::String,
30026
30027 /// Project ID of the project that contains the instance.
30028 pub project: std::string::String,
30029
30030 /// Sha1 FingerPrint.
30031 pub sha1_fingerprint: std::string::String,
30032
30033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30034}
30035
30036impl SqlSslCertsDeleteRequest {
30037 pub fn new() -> Self {
30038 std::default::Default::default()
30039 }
30040
30041 /// Sets the value of [instance][crate::model::SqlSslCertsDeleteRequest::instance].
30042 ///
30043 /// # Example
30044 /// ```ignore,no_run
30045 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30046 /// let x = SqlSslCertsDeleteRequest::new().set_instance("example");
30047 /// ```
30048 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30049 self.instance = v.into();
30050 self
30051 }
30052
30053 /// Sets the value of [project][crate::model::SqlSslCertsDeleteRequest::project].
30054 ///
30055 /// # Example
30056 /// ```ignore,no_run
30057 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30058 /// let x = SqlSslCertsDeleteRequest::new().set_project("example");
30059 /// ```
30060 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30061 self.project = v.into();
30062 self
30063 }
30064
30065 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsDeleteRequest::sha1_fingerprint].
30066 ///
30067 /// # Example
30068 /// ```ignore,no_run
30069 /// # use google_cloud_sql_v1::model::SqlSslCertsDeleteRequest;
30070 /// let x = SqlSslCertsDeleteRequest::new().set_sha1_fingerprint("example");
30071 /// ```
30072 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30073 mut self,
30074 v: T,
30075 ) -> Self {
30076 self.sha1_fingerprint = v.into();
30077 self
30078 }
30079}
30080
30081impl wkt::message::Message for SqlSslCertsDeleteRequest {
30082 fn typename() -> &'static str {
30083 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsDeleteRequest"
30084 }
30085}
30086
30087#[derive(Clone, Default, PartialEq)]
30088#[non_exhaustive]
30089pub struct SqlSslCertsGetRequest {
30090 /// Cloud SQL instance ID. This does not include the project ID.
30091 pub instance: std::string::String,
30092
30093 /// Project ID of the project that contains the instance.
30094 pub project: std::string::String,
30095
30096 /// Sha1 FingerPrint.
30097 pub sha1_fingerprint: std::string::String,
30098
30099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30100}
30101
30102impl SqlSslCertsGetRequest {
30103 pub fn new() -> Self {
30104 std::default::Default::default()
30105 }
30106
30107 /// Sets the value of [instance][crate::model::SqlSslCertsGetRequest::instance].
30108 ///
30109 /// # Example
30110 /// ```ignore,no_run
30111 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30112 /// let x = SqlSslCertsGetRequest::new().set_instance("example");
30113 /// ```
30114 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30115 self.instance = v.into();
30116 self
30117 }
30118
30119 /// Sets the value of [project][crate::model::SqlSslCertsGetRequest::project].
30120 ///
30121 /// # Example
30122 /// ```ignore,no_run
30123 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30124 /// let x = SqlSslCertsGetRequest::new().set_project("example");
30125 /// ```
30126 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30127 self.project = v.into();
30128 self
30129 }
30130
30131 /// Sets the value of [sha1_fingerprint][crate::model::SqlSslCertsGetRequest::sha1_fingerprint].
30132 ///
30133 /// # Example
30134 /// ```ignore,no_run
30135 /// # use google_cloud_sql_v1::model::SqlSslCertsGetRequest;
30136 /// let x = SqlSslCertsGetRequest::new().set_sha1_fingerprint("example");
30137 /// ```
30138 pub fn set_sha1_fingerprint<T: std::convert::Into<std::string::String>>(
30139 mut self,
30140 v: T,
30141 ) -> Self {
30142 self.sha1_fingerprint = v.into();
30143 self
30144 }
30145}
30146
30147impl wkt::message::Message for SqlSslCertsGetRequest {
30148 fn typename() -> &'static str {
30149 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsGetRequest"
30150 }
30151}
30152
30153#[derive(Clone, Default, PartialEq)]
30154#[non_exhaustive]
30155pub struct SqlSslCertsInsertRequest {
30156 /// Cloud SQL instance ID. This does not include the project ID.
30157 pub instance: std::string::String,
30158
30159 /// Project ID of the project that contains the instance.
30160 pub project: std::string::String,
30161
30162 pub body: std::option::Option<crate::model::SslCertsInsertRequest>,
30163
30164 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30165}
30166
30167impl SqlSslCertsInsertRequest {
30168 pub fn new() -> Self {
30169 std::default::Default::default()
30170 }
30171
30172 /// Sets the value of [instance][crate::model::SqlSslCertsInsertRequest::instance].
30173 ///
30174 /// # Example
30175 /// ```ignore,no_run
30176 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30177 /// let x = SqlSslCertsInsertRequest::new().set_instance("example");
30178 /// ```
30179 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30180 self.instance = v.into();
30181 self
30182 }
30183
30184 /// Sets the value of [project][crate::model::SqlSslCertsInsertRequest::project].
30185 ///
30186 /// # Example
30187 /// ```ignore,no_run
30188 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30189 /// let x = SqlSslCertsInsertRequest::new().set_project("example");
30190 /// ```
30191 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30192 self.project = v.into();
30193 self
30194 }
30195
30196 /// Sets the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30197 ///
30198 /// # Example
30199 /// ```ignore,no_run
30200 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30201 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30202 /// let x = SqlSslCertsInsertRequest::new().set_body(SslCertsInsertRequest::default()/* use setters */);
30203 /// ```
30204 pub fn set_body<T>(mut self, v: T) -> Self
30205 where
30206 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30207 {
30208 self.body = std::option::Option::Some(v.into());
30209 self
30210 }
30211
30212 /// Sets or clears the value of [body][crate::model::SqlSslCertsInsertRequest::body].
30213 ///
30214 /// # Example
30215 /// ```ignore,no_run
30216 /// # use google_cloud_sql_v1::model::SqlSslCertsInsertRequest;
30217 /// use google_cloud_sql_v1::model::SslCertsInsertRequest;
30218 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(Some(SslCertsInsertRequest::default()/* use setters */));
30219 /// let x = SqlSslCertsInsertRequest::new().set_or_clear_body(None::<SslCertsInsertRequest>);
30220 /// ```
30221 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30222 where
30223 T: std::convert::Into<crate::model::SslCertsInsertRequest>,
30224 {
30225 self.body = v.map(|x| x.into());
30226 self
30227 }
30228}
30229
30230impl wkt::message::Message for SqlSslCertsInsertRequest {
30231 fn typename() -> &'static str {
30232 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsInsertRequest"
30233 }
30234}
30235
30236#[derive(Clone, Default, PartialEq)]
30237#[non_exhaustive]
30238pub struct SqlSslCertsListRequest {
30239 /// Cloud SQL instance ID. This does not include the project ID.
30240 pub instance: std::string::String,
30241
30242 /// Project ID of the project that contains the instance.
30243 pub project: std::string::String,
30244
30245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30246}
30247
30248impl SqlSslCertsListRequest {
30249 pub fn new() -> Self {
30250 std::default::Default::default()
30251 }
30252
30253 /// Sets the value of [instance][crate::model::SqlSslCertsListRequest::instance].
30254 ///
30255 /// # Example
30256 /// ```ignore,no_run
30257 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30258 /// let x = SqlSslCertsListRequest::new().set_instance("example");
30259 /// ```
30260 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30261 self.instance = v.into();
30262 self
30263 }
30264
30265 /// Sets the value of [project][crate::model::SqlSslCertsListRequest::project].
30266 ///
30267 /// # Example
30268 /// ```ignore,no_run
30269 /// # use google_cloud_sql_v1::model::SqlSslCertsListRequest;
30270 /// let x = SqlSslCertsListRequest::new().set_project("example");
30271 /// ```
30272 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30273 self.project = v.into();
30274 self
30275 }
30276}
30277
30278impl wkt::message::Message for SqlSslCertsListRequest {
30279 fn typename() -> &'static str {
30280 "type.googleapis.com/google.cloud.sql.v1.SqlSslCertsListRequest"
30281 }
30282}
30283
30284/// SslCerts insert request.
30285#[derive(Clone, Default, PartialEq)]
30286#[non_exhaustive]
30287pub struct SslCertsInsertRequest {
30288 /// User supplied name. Must be a distinct name from the other certificates
30289 /// for this instance.
30290 pub common_name: std::string::String,
30291
30292 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30293}
30294
30295impl SslCertsInsertRequest {
30296 pub fn new() -> Self {
30297 std::default::Default::default()
30298 }
30299
30300 /// Sets the value of [common_name][crate::model::SslCertsInsertRequest::common_name].
30301 ///
30302 /// # Example
30303 /// ```ignore,no_run
30304 /// # use google_cloud_sql_v1::model::SslCertsInsertRequest;
30305 /// let x = SslCertsInsertRequest::new().set_common_name("example");
30306 /// ```
30307 pub fn set_common_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30308 self.common_name = v.into();
30309 self
30310 }
30311}
30312
30313impl wkt::message::Message for SslCertsInsertRequest {
30314 fn typename() -> &'static str {
30315 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertRequest"
30316 }
30317}
30318
30319/// SslCert insert response.
30320#[derive(Clone, Default, PartialEq)]
30321#[non_exhaustive]
30322pub struct SslCertsInsertResponse {
30323 /// This is always `sql#sslCertsInsert`.
30324 pub kind: std::string::String,
30325
30326 /// The operation to track the ssl certs insert request.
30327 pub operation: std::option::Option<crate::model::Operation>,
30328
30329 /// The server Certificate Authority's certificate. If this is missing you can
30330 /// force a new one to be generated by calling resetSslConfig method on
30331 /// instances resource.
30332 pub server_ca_cert: std::option::Option<crate::model::SslCert>,
30333
30334 /// The new client certificate and private key.
30335 pub client_cert: std::option::Option<crate::model::SslCertDetail>,
30336
30337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30338}
30339
30340impl SslCertsInsertResponse {
30341 pub fn new() -> Self {
30342 std::default::Default::default()
30343 }
30344
30345 /// Sets the value of [kind][crate::model::SslCertsInsertResponse::kind].
30346 ///
30347 /// # Example
30348 /// ```ignore,no_run
30349 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30350 /// let x = SslCertsInsertResponse::new().set_kind("example");
30351 /// ```
30352 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30353 self.kind = v.into();
30354 self
30355 }
30356
30357 /// Sets the value of [operation][crate::model::SslCertsInsertResponse::operation].
30358 ///
30359 /// # Example
30360 /// ```ignore,no_run
30361 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30362 /// use google_cloud_sql_v1::model::Operation;
30363 /// let x = SslCertsInsertResponse::new().set_operation(Operation::default()/* use setters */);
30364 /// ```
30365 pub fn set_operation<T>(mut self, v: T) -> Self
30366 where
30367 T: std::convert::Into<crate::model::Operation>,
30368 {
30369 self.operation = std::option::Option::Some(v.into());
30370 self
30371 }
30372
30373 /// Sets or clears the value of [operation][crate::model::SslCertsInsertResponse::operation].
30374 ///
30375 /// # Example
30376 /// ```ignore,no_run
30377 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30378 /// use google_cloud_sql_v1::model::Operation;
30379 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(Some(Operation::default()/* use setters */));
30380 /// let x = SslCertsInsertResponse::new().set_or_clear_operation(None::<Operation>);
30381 /// ```
30382 pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
30383 where
30384 T: std::convert::Into<crate::model::Operation>,
30385 {
30386 self.operation = v.map(|x| x.into());
30387 self
30388 }
30389
30390 /// Sets the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30391 ///
30392 /// # Example
30393 /// ```ignore,no_run
30394 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30395 /// use google_cloud_sql_v1::model::SslCert;
30396 /// let x = SslCertsInsertResponse::new().set_server_ca_cert(SslCert::default()/* use setters */);
30397 /// ```
30398 pub fn set_server_ca_cert<T>(mut self, v: T) -> Self
30399 where
30400 T: std::convert::Into<crate::model::SslCert>,
30401 {
30402 self.server_ca_cert = std::option::Option::Some(v.into());
30403 self
30404 }
30405
30406 /// Sets or clears the value of [server_ca_cert][crate::model::SslCertsInsertResponse::server_ca_cert].
30407 ///
30408 /// # Example
30409 /// ```ignore,no_run
30410 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30411 /// use google_cloud_sql_v1::model::SslCert;
30412 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(Some(SslCert::default()/* use setters */));
30413 /// let x = SslCertsInsertResponse::new().set_or_clear_server_ca_cert(None::<SslCert>);
30414 /// ```
30415 pub fn set_or_clear_server_ca_cert<T>(mut self, v: std::option::Option<T>) -> Self
30416 where
30417 T: std::convert::Into<crate::model::SslCert>,
30418 {
30419 self.server_ca_cert = v.map(|x| x.into());
30420 self
30421 }
30422
30423 /// Sets the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30424 ///
30425 /// # Example
30426 /// ```ignore,no_run
30427 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30428 /// use google_cloud_sql_v1::model::SslCertDetail;
30429 /// let x = SslCertsInsertResponse::new().set_client_cert(SslCertDetail::default()/* use setters */);
30430 /// ```
30431 pub fn set_client_cert<T>(mut self, v: T) -> Self
30432 where
30433 T: std::convert::Into<crate::model::SslCertDetail>,
30434 {
30435 self.client_cert = std::option::Option::Some(v.into());
30436 self
30437 }
30438
30439 /// Sets or clears the value of [client_cert][crate::model::SslCertsInsertResponse::client_cert].
30440 ///
30441 /// # Example
30442 /// ```ignore,no_run
30443 /// # use google_cloud_sql_v1::model::SslCertsInsertResponse;
30444 /// use google_cloud_sql_v1::model::SslCertDetail;
30445 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(Some(SslCertDetail::default()/* use setters */));
30446 /// let x = SslCertsInsertResponse::new().set_or_clear_client_cert(None::<SslCertDetail>);
30447 /// ```
30448 pub fn set_or_clear_client_cert<T>(mut self, v: std::option::Option<T>) -> Self
30449 where
30450 T: std::convert::Into<crate::model::SslCertDetail>,
30451 {
30452 self.client_cert = v.map(|x| x.into());
30453 self
30454 }
30455}
30456
30457impl wkt::message::Message for SslCertsInsertResponse {
30458 fn typename() -> &'static str {
30459 "type.googleapis.com/google.cloud.sql.v1.SslCertsInsertResponse"
30460 }
30461}
30462
30463/// SslCerts list response.
30464#[derive(Clone, Default, PartialEq)]
30465#[non_exhaustive]
30466pub struct SslCertsListResponse {
30467 /// This is always `sql#sslCertsList`.
30468 pub kind: std::string::String,
30469
30470 /// List of client certificates for the instance.
30471 pub items: std::vec::Vec<crate::model::SslCert>,
30472
30473 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30474}
30475
30476impl SslCertsListResponse {
30477 pub fn new() -> Self {
30478 std::default::Default::default()
30479 }
30480
30481 /// Sets the value of [kind][crate::model::SslCertsListResponse::kind].
30482 ///
30483 /// # Example
30484 /// ```ignore,no_run
30485 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30486 /// let x = SslCertsListResponse::new().set_kind("example");
30487 /// ```
30488 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30489 self.kind = v.into();
30490 self
30491 }
30492
30493 /// Sets the value of [items][crate::model::SslCertsListResponse::items].
30494 ///
30495 /// # Example
30496 /// ```ignore,no_run
30497 /// # use google_cloud_sql_v1::model::SslCertsListResponse;
30498 /// use google_cloud_sql_v1::model::SslCert;
30499 /// let x = SslCertsListResponse::new()
30500 /// .set_items([
30501 /// SslCert::default()/* use setters */,
30502 /// SslCert::default()/* use (different) setters */,
30503 /// ]);
30504 /// ```
30505 pub fn set_items<T, V>(mut self, v: T) -> Self
30506 where
30507 T: std::iter::IntoIterator<Item = V>,
30508 V: std::convert::Into<crate::model::SslCert>,
30509 {
30510 use std::iter::Iterator;
30511 self.items = v.into_iter().map(|i| i.into()).collect();
30512 self
30513 }
30514}
30515
30516impl wkt::message::Message for SslCertsListResponse {
30517 fn typename() -> &'static str {
30518 "type.googleapis.com/google.cloud.sql.v1.SslCertsListResponse"
30519 }
30520}
30521
30522/// Tiers list request.
30523#[derive(Clone, Default, PartialEq)]
30524#[non_exhaustive]
30525pub struct SqlTiersListRequest {
30526 /// Project ID of the project for which to list tiers.
30527 pub project: std::string::String,
30528
30529 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30530}
30531
30532impl SqlTiersListRequest {
30533 pub fn new() -> Self {
30534 std::default::Default::default()
30535 }
30536
30537 /// Sets the value of [project][crate::model::SqlTiersListRequest::project].
30538 ///
30539 /// # Example
30540 /// ```ignore,no_run
30541 /// # use google_cloud_sql_v1::model::SqlTiersListRequest;
30542 /// let x = SqlTiersListRequest::new().set_project("example");
30543 /// ```
30544 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30545 self.project = v.into();
30546 self
30547 }
30548}
30549
30550impl wkt::message::Message for SqlTiersListRequest {
30551 fn typename() -> &'static str {
30552 "type.googleapis.com/google.cloud.sql.v1.SqlTiersListRequest"
30553 }
30554}
30555
30556/// Tiers list response.
30557#[derive(Clone, Default, PartialEq)]
30558#[non_exhaustive]
30559pub struct TiersListResponse {
30560 /// This is always `sql#tiersList`.
30561 pub kind: std::string::String,
30562
30563 /// List of tiers.
30564 pub items: std::vec::Vec<crate::model::Tier>,
30565
30566 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30567}
30568
30569impl TiersListResponse {
30570 pub fn new() -> Self {
30571 std::default::Default::default()
30572 }
30573
30574 /// Sets the value of [kind][crate::model::TiersListResponse::kind].
30575 ///
30576 /// # Example
30577 /// ```ignore,no_run
30578 /// # use google_cloud_sql_v1::model::TiersListResponse;
30579 /// let x = TiersListResponse::new().set_kind("example");
30580 /// ```
30581 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30582 self.kind = v.into();
30583 self
30584 }
30585
30586 /// Sets the value of [items][crate::model::TiersListResponse::items].
30587 ///
30588 /// # Example
30589 /// ```ignore,no_run
30590 /// # use google_cloud_sql_v1::model::TiersListResponse;
30591 /// use google_cloud_sql_v1::model::Tier;
30592 /// let x = TiersListResponse::new()
30593 /// .set_items([
30594 /// Tier::default()/* use setters */,
30595 /// Tier::default()/* use (different) setters */,
30596 /// ]);
30597 /// ```
30598 pub fn set_items<T, V>(mut self, v: T) -> Self
30599 where
30600 T: std::iter::IntoIterator<Item = V>,
30601 V: std::convert::Into<crate::model::Tier>,
30602 {
30603 use std::iter::Iterator;
30604 self.items = v.into_iter().map(|i| i.into()).collect();
30605 self
30606 }
30607}
30608
30609impl wkt::message::Message for TiersListResponse {
30610 fn typename() -> &'static str {
30611 "type.googleapis.com/google.cloud.sql.v1.TiersListResponse"
30612 }
30613}
30614
30615/// A Google Cloud SQL service tier resource.
30616#[derive(Clone, Default, PartialEq)]
30617#[non_exhaustive]
30618pub struct Tier {
30619 /// An identifier for the machine type, for example, `db-custom-1-3840`. For
30620 /// related information, see [Pricing](/sql/pricing).
30621 pub tier: std::string::String,
30622
30623 /// The maximum RAM usage of this tier in bytes.
30624 pub ram: i64,
30625
30626 /// This is always `sql#tier`.
30627 pub kind: std::string::String,
30628
30629 /// The maximum disk size of this tier in bytes.
30630 pub disk_quota: i64,
30631
30632 /// The applicable regions for this tier.
30633 pub region: std::vec::Vec<std::string::String>,
30634
30635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30636}
30637
30638impl Tier {
30639 pub fn new() -> Self {
30640 std::default::Default::default()
30641 }
30642
30643 /// Sets the value of [tier][crate::model::Tier::tier].
30644 ///
30645 /// # Example
30646 /// ```ignore,no_run
30647 /// # use google_cloud_sql_v1::model::Tier;
30648 /// let x = Tier::new().set_tier("example");
30649 /// ```
30650 pub fn set_tier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30651 self.tier = v.into();
30652 self
30653 }
30654
30655 /// Sets the value of [ram][crate::model::Tier::ram].
30656 ///
30657 /// # Example
30658 /// ```ignore,no_run
30659 /// # use google_cloud_sql_v1::model::Tier;
30660 /// let x = Tier::new().set_ram(42);
30661 /// ```
30662 pub fn set_ram<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30663 self.ram = v.into();
30664 self
30665 }
30666
30667 /// Sets the value of [kind][crate::model::Tier::kind].
30668 ///
30669 /// # Example
30670 /// ```ignore,no_run
30671 /// # use google_cloud_sql_v1::model::Tier;
30672 /// let x = Tier::new().set_kind("example");
30673 /// ```
30674 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30675 self.kind = v.into();
30676 self
30677 }
30678
30679 /// Sets the value of [disk_quota][crate::model::Tier::disk_quota].
30680 ///
30681 /// # Example
30682 /// ```ignore,no_run
30683 /// # use google_cloud_sql_v1::model::Tier;
30684 /// let x = Tier::new().set_disk_quota(42);
30685 /// ```
30686 pub fn set_disk_quota<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
30687 self.disk_quota = v.into();
30688 self
30689 }
30690
30691 /// Sets the value of [region][crate::model::Tier::region].
30692 ///
30693 /// # Example
30694 /// ```ignore,no_run
30695 /// # use google_cloud_sql_v1::model::Tier;
30696 /// let x = Tier::new().set_region(["a", "b", "c"]);
30697 /// ```
30698 pub fn set_region<T, V>(mut self, v: T) -> Self
30699 where
30700 T: std::iter::IntoIterator<Item = V>,
30701 V: std::convert::Into<std::string::String>,
30702 {
30703 use std::iter::Iterator;
30704 self.region = v.into_iter().map(|i| i.into()).collect();
30705 self
30706 }
30707}
30708
30709impl wkt::message::Message for Tier {
30710 fn typename() -> &'static str {
30711 "type.googleapis.com/google.cloud.sql.v1.Tier"
30712 }
30713}
30714
30715#[derive(Clone, Default, PartialEq)]
30716#[non_exhaustive]
30717pub struct SqlUsersDeleteRequest {
30718 /// Host of the user in the instance.
30719 pub host: std::string::String,
30720
30721 /// Database instance ID. This does not include the project ID.
30722 pub instance: std::string::String,
30723
30724 /// Name of the user in the instance.
30725 pub name: std::string::String,
30726
30727 /// Project ID of the project that contains the instance.
30728 pub project: std::string::String,
30729
30730 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30731}
30732
30733impl SqlUsersDeleteRequest {
30734 pub fn new() -> Self {
30735 std::default::Default::default()
30736 }
30737
30738 /// Sets the value of [host][crate::model::SqlUsersDeleteRequest::host].
30739 ///
30740 /// # Example
30741 /// ```ignore,no_run
30742 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30743 /// let x = SqlUsersDeleteRequest::new().set_host("example");
30744 /// ```
30745 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30746 self.host = v.into();
30747 self
30748 }
30749
30750 /// Sets the value of [instance][crate::model::SqlUsersDeleteRequest::instance].
30751 ///
30752 /// # Example
30753 /// ```ignore,no_run
30754 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30755 /// let x = SqlUsersDeleteRequest::new().set_instance("example");
30756 /// ```
30757 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30758 self.instance = v.into();
30759 self
30760 }
30761
30762 /// Sets the value of [name][crate::model::SqlUsersDeleteRequest::name].
30763 ///
30764 /// # Example
30765 /// ```ignore,no_run
30766 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30767 /// let x = SqlUsersDeleteRequest::new().set_name("example");
30768 /// ```
30769 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30770 self.name = v.into();
30771 self
30772 }
30773
30774 /// Sets the value of [project][crate::model::SqlUsersDeleteRequest::project].
30775 ///
30776 /// # Example
30777 /// ```ignore,no_run
30778 /// # use google_cloud_sql_v1::model::SqlUsersDeleteRequest;
30779 /// let x = SqlUsersDeleteRequest::new().set_project("example");
30780 /// ```
30781 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30782 self.project = v.into();
30783 self
30784 }
30785}
30786
30787impl wkt::message::Message for SqlUsersDeleteRequest {
30788 fn typename() -> &'static str {
30789 "type.googleapis.com/google.cloud.sql.v1.SqlUsersDeleteRequest"
30790 }
30791}
30792
30793/// Request message for Users Get RPC
30794#[derive(Clone, Default, PartialEq)]
30795#[non_exhaustive]
30796pub struct SqlUsersGetRequest {
30797 /// Database instance ID. This does not include the project ID.
30798 pub instance: std::string::String,
30799
30800 /// User of the instance.
30801 pub name: std::string::String,
30802
30803 /// Project ID of the project that contains the instance.
30804 pub project: std::string::String,
30805
30806 /// Host of a user of the instance.
30807 pub host: std::string::String,
30808
30809 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30810}
30811
30812impl SqlUsersGetRequest {
30813 pub fn new() -> Self {
30814 std::default::Default::default()
30815 }
30816
30817 /// Sets the value of [instance][crate::model::SqlUsersGetRequest::instance].
30818 ///
30819 /// # Example
30820 /// ```ignore,no_run
30821 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30822 /// let x = SqlUsersGetRequest::new().set_instance("example");
30823 /// ```
30824 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30825 self.instance = v.into();
30826 self
30827 }
30828
30829 /// Sets the value of [name][crate::model::SqlUsersGetRequest::name].
30830 ///
30831 /// # Example
30832 /// ```ignore,no_run
30833 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30834 /// let x = SqlUsersGetRequest::new().set_name("example");
30835 /// ```
30836 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30837 self.name = v.into();
30838 self
30839 }
30840
30841 /// Sets the value of [project][crate::model::SqlUsersGetRequest::project].
30842 ///
30843 /// # Example
30844 /// ```ignore,no_run
30845 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30846 /// let x = SqlUsersGetRequest::new().set_project("example");
30847 /// ```
30848 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30849 self.project = v.into();
30850 self
30851 }
30852
30853 /// Sets the value of [host][crate::model::SqlUsersGetRequest::host].
30854 ///
30855 /// # Example
30856 /// ```ignore,no_run
30857 /// # use google_cloud_sql_v1::model::SqlUsersGetRequest;
30858 /// let x = SqlUsersGetRequest::new().set_host("example");
30859 /// ```
30860 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30861 self.host = v.into();
30862 self
30863 }
30864}
30865
30866impl wkt::message::Message for SqlUsersGetRequest {
30867 fn typename() -> &'static str {
30868 "type.googleapis.com/google.cloud.sql.v1.SqlUsersGetRequest"
30869 }
30870}
30871
30872#[derive(Clone, Default, PartialEq)]
30873#[non_exhaustive]
30874pub struct SqlUsersInsertRequest {
30875 /// Database instance ID. This does not include the project ID.
30876 pub instance: std::string::String,
30877
30878 /// Project ID of the project that contains the instance.
30879 pub project: std::string::String,
30880
30881 pub body: std::option::Option<crate::model::User>,
30882
30883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30884}
30885
30886impl SqlUsersInsertRequest {
30887 pub fn new() -> Self {
30888 std::default::Default::default()
30889 }
30890
30891 /// Sets the value of [instance][crate::model::SqlUsersInsertRequest::instance].
30892 ///
30893 /// # Example
30894 /// ```ignore,no_run
30895 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30896 /// let x = SqlUsersInsertRequest::new().set_instance("example");
30897 /// ```
30898 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30899 self.instance = v.into();
30900 self
30901 }
30902
30903 /// Sets the value of [project][crate::model::SqlUsersInsertRequest::project].
30904 ///
30905 /// # Example
30906 /// ```ignore,no_run
30907 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30908 /// let x = SqlUsersInsertRequest::new().set_project("example");
30909 /// ```
30910 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30911 self.project = v.into();
30912 self
30913 }
30914
30915 /// Sets the value of [body][crate::model::SqlUsersInsertRequest::body].
30916 ///
30917 /// # Example
30918 /// ```ignore,no_run
30919 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30920 /// use google_cloud_sql_v1::model::User;
30921 /// let x = SqlUsersInsertRequest::new().set_body(User::default()/* use setters */);
30922 /// ```
30923 pub fn set_body<T>(mut self, v: T) -> Self
30924 where
30925 T: std::convert::Into<crate::model::User>,
30926 {
30927 self.body = std::option::Option::Some(v.into());
30928 self
30929 }
30930
30931 /// Sets or clears the value of [body][crate::model::SqlUsersInsertRequest::body].
30932 ///
30933 /// # Example
30934 /// ```ignore,no_run
30935 /// # use google_cloud_sql_v1::model::SqlUsersInsertRequest;
30936 /// use google_cloud_sql_v1::model::User;
30937 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
30938 /// let x = SqlUsersInsertRequest::new().set_or_clear_body(None::<User>);
30939 /// ```
30940 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
30941 where
30942 T: std::convert::Into<crate::model::User>,
30943 {
30944 self.body = v.map(|x| x.into());
30945 self
30946 }
30947}
30948
30949impl wkt::message::Message for SqlUsersInsertRequest {
30950 fn typename() -> &'static str {
30951 "type.googleapis.com/google.cloud.sql.v1.SqlUsersInsertRequest"
30952 }
30953}
30954
30955#[derive(Clone, Default, PartialEq)]
30956#[non_exhaustive]
30957pub struct SqlUsersListRequest {
30958 /// Database instance ID. This does not include the project ID.
30959 pub instance: std::string::String,
30960
30961 /// Project ID of the project that contains the instance.
30962 pub project: std::string::String,
30963
30964 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
30965}
30966
30967impl SqlUsersListRequest {
30968 pub fn new() -> Self {
30969 std::default::Default::default()
30970 }
30971
30972 /// Sets the value of [instance][crate::model::SqlUsersListRequest::instance].
30973 ///
30974 /// # Example
30975 /// ```ignore,no_run
30976 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
30977 /// let x = SqlUsersListRequest::new().set_instance("example");
30978 /// ```
30979 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30980 self.instance = v.into();
30981 self
30982 }
30983
30984 /// Sets the value of [project][crate::model::SqlUsersListRequest::project].
30985 ///
30986 /// # Example
30987 /// ```ignore,no_run
30988 /// # use google_cloud_sql_v1::model::SqlUsersListRequest;
30989 /// let x = SqlUsersListRequest::new().set_project("example");
30990 /// ```
30991 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
30992 self.project = v.into();
30993 self
30994 }
30995}
30996
30997impl wkt::message::Message for SqlUsersListRequest {
30998 fn typename() -> &'static str {
30999 "type.googleapis.com/google.cloud.sql.v1.SqlUsersListRequest"
31000 }
31001}
31002
31003#[derive(Clone, Default, PartialEq)]
31004#[non_exhaustive]
31005pub struct SqlUsersUpdateRequest {
31006 /// Optional. Host of the user in the instance.
31007 pub host: std::string::String,
31008
31009 /// Database instance ID. This does not include the project ID.
31010 pub instance: std::string::String,
31011
31012 /// Name of the user in the instance.
31013 pub name: std::string::String,
31014
31015 /// Project ID of the project that contains the instance.
31016 pub project: std::string::String,
31017
31018 /// Optional. List of database roles to grant to the user. body.database_roles
31019 /// will be ignored for update request.
31020 pub database_roles: std::vec::Vec<std::string::String>,
31021
31022 /// Optional. Specifies whether to revoke existing roles that are not present
31023 /// in the `database_roles` field. If `false` or unset, the database roles
31024 /// specified in `database_roles` are added to the user's existing roles.
31025 pub revoke_existing_roles: std::option::Option<bool>,
31026
31027 pub body: std::option::Option<crate::model::User>,
31028
31029 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31030}
31031
31032impl SqlUsersUpdateRequest {
31033 pub fn new() -> Self {
31034 std::default::Default::default()
31035 }
31036
31037 /// Sets the value of [host][crate::model::SqlUsersUpdateRequest::host].
31038 ///
31039 /// # Example
31040 /// ```ignore,no_run
31041 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31042 /// let x = SqlUsersUpdateRequest::new().set_host("example");
31043 /// ```
31044 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31045 self.host = v.into();
31046 self
31047 }
31048
31049 /// Sets the value of [instance][crate::model::SqlUsersUpdateRequest::instance].
31050 ///
31051 /// # Example
31052 /// ```ignore,no_run
31053 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31054 /// let x = SqlUsersUpdateRequest::new().set_instance("example");
31055 /// ```
31056 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31057 self.instance = v.into();
31058 self
31059 }
31060
31061 /// Sets the value of [name][crate::model::SqlUsersUpdateRequest::name].
31062 ///
31063 /// # Example
31064 /// ```ignore,no_run
31065 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31066 /// let x = SqlUsersUpdateRequest::new().set_name("example");
31067 /// ```
31068 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31069 self.name = v.into();
31070 self
31071 }
31072
31073 /// Sets the value of [project][crate::model::SqlUsersUpdateRequest::project].
31074 ///
31075 /// # Example
31076 /// ```ignore,no_run
31077 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31078 /// let x = SqlUsersUpdateRequest::new().set_project("example");
31079 /// ```
31080 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31081 self.project = v.into();
31082 self
31083 }
31084
31085 /// Sets the value of [database_roles][crate::model::SqlUsersUpdateRequest::database_roles].
31086 ///
31087 /// # Example
31088 /// ```ignore,no_run
31089 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31090 /// let x = SqlUsersUpdateRequest::new().set_database_roles(["a", "b", "c"]);
31091 /// ```
31092 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31093 where
31094 T: std::iter::IntoIterator<Item = V>,
31095 V: std::convert::Into<std::string::String>,
31096 {
31097 use std::iter::Iterator;
31098 self.database_roles = v.into_iter().map(|i| i.into()).collect();
31099 self
31100 }
31101
31102 /// Sets the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31103 ///
31104 /// # Example
31105 /// ```ignore,no_run
31106 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31107 /// let x = SqlUsersUpdateRequest::new().set_revoke_existing_roles(true);
31108 /// ```
31109 pub fn set_revoke_existing_roles<T>(mut self, v: T) -> Self
31110 where
31111 T: std::convert::Into<bool>,
31112 {
31113 self.revoke_existing_roles = std::option::Option::Some(v.into());
31114 self
31115 }
31116
31117 /// Sets or clears the value of [revoke_existing_roles][crate::model::SqlUsersUpdateRequest::revoke_existing_roles].
31118 ///
31119 /// # Example
31120 /// ```ignore,no_run
31121 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31122 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(Some(false));
31123 /// let x = SqlUsersUpdateRequest::new().set_or_clear_revoke_existing_roles(None::<bool>);
31124 /// ```
31125 pub fn set_or_clear_revoke_existing_roles<T>(mut self, v: std::option::Option<T>) -> Self
31126 where
31127 T: std::convert::Into<bool>,
31128 {
31129 self.revoke_existing_roles = v.map(|x| x.into());
31130 self
31131 }
31132
31133 /// Sets the value of [body][crate::model::SqlUsersUpdateRequest::body].
31134 ///
31135 /// # Example
31136 /// ```ignore,no_run
31137 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31138 /// use google_cloud_sql_v1::model::User;
31139 /// let x = SqlUsersUpdateRequest::new().set_body(User::default()/* use setters */);
31140 /// ```
31141 pub fn set_body<T>(mut self, v: T) -> Self
31142 where
31143 T: std::convert::Into<crate::model::User>,
31144 {
31145 self.body = std::option::Option::Some(v.into());
31146 self
31147 }
31148
31149 /// Sets or clears the value of [body][crate::model::SqlUsersUpdateRequest::body].
31150 ///
31151 /// # Example
31152 /// ```ignore,no_run
31153 /// # use google_cloud_sql_v1::model::SqlUsersUpdateRequest;
31154 /// use google_cloud_sql_v1::model::User;
31155 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(Some(User::default()/* use setters */));
31156 /// let x = SqlUsersUpdateRequest::new().set_or_clear_body(None::<User>);
31157 /// ```
31158 pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
31159 where
31160 T: std::convert::Into<crate::model::User>,
31161 {
31162 self.body = v.map(|x| x.into());
31163 self
31164 }
31165}
31166
31167impl wkt::message::Message for SqlUsersUpdateRequest {
31168 fn typename() -> &'static str {
31169 "type.googleapis.com/google.cloud.sql.v1.SqlUsersUpdateRequest"
31170 }
31171}
31172
31173/// User level password validation policy.
31174#[derive(Clone, Default, PartialEq)]
31175#[non_exhaustive]
31176pub struct UserPasswordValidationPolicy {
31177 /// Number of failed login attempts allowed before user get locked.
31178 pub allowed_failed_attempts: i32,
31179
31180 /// Expiration duration after password is updated.
31181 pub password_expiration_duration: std::option::Option<wkt::Duration>,
31182
31183 /// If true, failed login attempts check will be enabled.
31184 pub enable_failed_attempts_check: bool,
31185
31186 /// Output only. Read-only password status.
31187 pub status: std::option::Option<crate::model::PasswordStatus>,
31188
31189 /// If true, the user must specify the current password before changing the
31190 /// password. This flag is supported only for MySQL.
31191 pub enable_password_verification: bool,
31192
31193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31194}
31195
31196impl UserPasswordValidationPolicy {
31197 pub fn new() -> Self {
31198 std::default::Default::default()
31199 }
31200
31201 /// Sets the value of [allowed_failed_attempts][crate::model::UserPasswordValidationPolicy::allowed_failed_attempts].
31202 ///
31203 /// # Example
31204 /// ```ignore,no_run
31205 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31206 /// let x = UserPasswordValidationPolicy::new().set_allowed_failed_attempts(42);
31207 /// ```
31208 pub fn set_allowed_failed_attempts<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
31209 self.allowed_failed_attempts = v.into();
31210 self
31211 }
31212
31213 /// Sets the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31214 ///
31215 /// # Example
31216 /// ```ignore,no_run
31217 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31218 /// use wkt::Duration;
31219 /// let x = UserPasswordValidationPolicy::new().set_password_expiration_duration(Duration::default()/* use setters */);
31220 /// ```
31221 pub fn set_password_expiration_duration<T>(mut self, v: T) -> Self
31222 where
31223 T: std::convert::Into<wkt::Duration>,
31224 {
31225 self.password_expiration_duration = std::option::Option::Some(v.into());
31226 self
31227 }
31228
31229 /// Sets or clears the value of [password_expiration_duration][crate::model::UserPasswordValidationPolicy::password_expiration_duration].
31230 ///
31231 /// # Example
31232 /// ```ignore,no_run
31233 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31234 /// use wkt::Duration;
31235 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(Some(Duration::default()/* use setters */));
31236 /// let x = UserPasswordValidationPolicy::new().set_or_clear_password_expiration_duration(None::<Duration>);
31237 /// ```
31238 pub fn set_or_clear_password_expiration_duration<T>(mut self, v: std::option::Option<T>) -> Self
31239 where
31240 T: std::convert::Into<wkt::Duration>,
31241 {
31242 self.password_expiration_duration = v.map(|x| x.into());
31243 self
31244 }
31245
31246 /// Sets the value of [enable_failed_attempts_check][crate::model::UserPasswordValidationPolicy::enable_failed_attempts_check].
31247 ///
31248 /// # Example
31249 /// ```ignore,no_run
31250 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31251 /// let x = UserPasswordValidationPolicy::new().set_enable_failed_attempts_check(true);
31252 /// ```
31253 pub fn set_enable_failed_attempts_check<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31254 self.enable_failed_attempts_check = v.into();
31255 self
31256 }
31257
31258 /// Sets the value of [status][crate::model::UserPasswordValidationPolicy::status].
31259 ///
31260 /// # Example
31261 /// ```ignore,no_run
31262 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31263 /// use google_cloud_sql_v1::model::PasswordStatus;
31264 /// let x = UserPasswordValidationPolicy::new().set_status(PasswordStatus::default()/* use setters */);
31265 /// ```
31266 pub fn set_status<T>(mut self, v: T) -> Self
31267 where
31268 T: std::convert::Into<crate::model::PasswordStatus>,
31269 {
31270 self.status = std::option::Option::Some(v.into());
31271 self
31272 }
31273
31274 /// Sets or clears the value of [status][crate::model::UserPasswordValidationPolicy::status].
31275 ///
31276 /// # Example
31277 /// ```ignore,no_run
31278 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31279 /// use google_cloud_sql_v1::model::PasswordStatus;
31280 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(Some(PasswordStatus::default()/* use setters */));
31281 /// let x = UserPasswordValidationPolicy::new().set_or_clear_status(None::<PasswordStatus>);
31282 /// ```
31283 pub fn set_or_clear_status<T>(mut self, v: std::option::Option<T>) -> Self
31284 where
31285 T: std::convert::Into<crate::model::PasswordStatus>,
31286 {
31287 self.status = v.map(|x| x.into());
31288 self
31289 }
31290
31291 /// Sets the value of [enable_password_verification][crate::model::UserPasswordValidationPolicy::enable_password_verification].
31292 ///
31293 /// # Example
31294 /// ```ignore,no_run
31295 /// # use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31296 /// let x = UserPasswordValidationPolicy::new().set_enable_password_verification(true);
31297 /// ```
31298 pub fn set_enable_password_verification<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31299 self.enable_password_verification = v.into();
31300 self
31301 }
31302}
31303
31304impl wkt::message::Message for UserPasswordValidationPolicy {
31305 fn typename() -> &'static str {
31306 "type.googleapis.com/google.cloud.sql.v1.UserPasswordValidationPolicy"
31307 }
31308}
31309
31310/// Read-only password status.
31311#[derive(Clone, Default, PartialEq)]
31312#[non_exhaustive]
31313pub struct PasswordStatus {
31314 /// If true, user does not have login privileges.
31315 pub locked: bool,
31316
31317 /// The expiration time of the current password.
31318 pub password_expiration_time: std::option::Option<wkt::Timestamp>,
31319
31320 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31321}
31322
31323impl PasswordStatus {
31324 pub fn new() -> Self {
31325 std::default::Default::default()
31326 }
31327
31328 /// Sets the value of [locked][crate::model::PasswordStatus::locked].
31329 ///
31330 /// # Example
31331 /// ```ignore,no_run
31332 /// # use google_cloud_sql_v1::model::PasswordStatus;
31333 /// let x = PasswordStatus::new().set_locked(true);
31334 /// ```
31335 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
31336 self.locked = v.into();
31337 self
31338 }
31339
31340 /// Sets the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31341 ///
31342 /// # Example
31343 /// ```ignore,no_run
31344 /// # use google_cloud_sql_v1::model::PasswordStatus;
31345 /// use wkt::Timestamp;
31346 /// let x = PasswordStatus::new().set_password_expiration_time(Timestamp::default()/* use setters */);
31347 /// ```
31348 pub fn set_password_expiration_time<T>(mut self, v: T) -> Self
31349 where
31350 T: std::convert::Into<wkt::Timestamp>,
31351 {
31352 self.password_expiration_time = std::option::Option::Some(v.into());
31353 self
31354 }
31355
31356 /// Sets or clears the value of [password_expiration_time][crate::model::PasswordStatus::password_expiration_time].
31357 ///
31358 /// # Example
31359 /// ```ignore,no_run
31360 /// # use google_cloud_sql_v1::model::PasswordStatus;
31361 /// use wkt::Timestamp;
31362 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(Some(Timestamp::default()/* use setters */));
31363 /// let x = PasswordStatus::new().set_or_clear_password_expiration_time(None::<Timestamp>);
31364 /// ```
31365 pub fn set_or_clear_password_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
31366 where
31367 T: std::convert::Into<wkt::Timestamp>,
31368 {
31369 self.password_expiration_time = v.map(|x| x.into());
31370 self
31371 }
31372}
31373
31374impl wkt::message::Message for PasswordStatus {
31375 fn typename() -> &'static str {
31376 "type.googleapis.com/google.cloud.sql.v1.PasswordStatus"
31377 }
31378}
31379
31380/// A Cloud SQL user resource.
31381#[derive(Clone, Default, PartialEq)]
31382#[non_exhaustive]
31383pub struct User {
31384 /// This is always `sql#user`.
31385 pub kind: std::string::String,
31386
31387 /// The password for the user.
31388 pub password: std::string::String,
31389
31390 /// This field is deprecated and will be removed from a future version of the
31391 /// API.
31392 pub etag: std::string::String,
31393
31394 /// The name of the user in the Cloud SQL instance. Can be omitted for
31395 /// `update` because it is already specified in the URL.
31396 pub name: std::string::String,
31397
31398 /// Optional. The host from which the user can connect. For `insert`
31399 /// operations, host defaults to an empty string. For `update`
31400 /// operations, host is specified as part of the request URL. The host name
31401 /// cannot be updated after insertion. For a MySQL instance, it's required;
31402 /// for a PostgreSQL or SQL Server instance, it's optional.
31403 pub host: std::string::String,
31404
31405 /// The name of the Cloud SQL instance. This does not include the project ID.
31406 /// Can be omitted for `update` because it is already specified on the
31407 /// URL.
31408 pub instance: std::string::String,
31409
31410 /// The project ID of the project containing the Cloud SQL database. The Google
31411 /// apps domain is prefixed if applicable. Can be omitted for `update` because
31412 /// it is already specified on the URL.
31413 pub project: std::string::String,
31414
31415 /// The user type. It determines the method to authenticate the user during
31416 /// login. The default is the database's built-in user type.
31417 pub r#type: crate::model::user::SqlUserType,
31418
31419 /// Optional. The full email for an IAM user. For normal database users, this
31420 /// will not be filled. Only applicable to MySQL database users.
31421 pub iam_email: std::string::String,
31422
31423 /// User level password validation policy.
31424 pub password_policy: std::option::Option<crate::model::UserPasswordValidationPolicy>,
31425
31426 /// Dual password status for the user.
31427 pub dual_password_type: std::option::Option<crate::model::user::DualPasswordType>,
31428
31429 /// Indicates if a group is active or inactive for IAM database authentication.
31430 pub iam_status: std::option::Option<crate::model::user::IamStatus>,
31431
31432 /// Optional. Role memberships of the user
31433 pub database_roles: std::vec::Vec<std::string::String>,
31434
31435 /// User details for specific database type
31436 pub user_details: std::option::Option<crate::model::user::UserDetails>,
31437
31438 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
31439}
31440
31441impl User {
31442 pub fn new() -> Self {
31443 std::default::Default::default()
31444 }
31445
31446 /// Sets the value of [kind][crate::model::User::kind].
31447 ///
31448 /// # Example
31449 /// ```ignore,no_run
31450 /// # use google_cloud_sql_v1::model::User;
31451 /// let x = User::new().set_kind("example");
31452 /// ```
31453 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31454 self.kind = v.into();
31455 self
31456 }
31457
31458 /// Sets the value of [password][crate::model::User::password].
31459 ///
31460 /// # Example
31461 /// ```ignore,no_run
31462 /// # use google_cloud_sql_v1::model::User;
31463 /// let x = User::new().set_password("example");
31464 /// ```
31465 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31466 self.password = v.into();
31467 self
31468 }
31469
31470 /// Sets the value of [etag][crate::model::User::etag].
31471 ///
31472 /// # Example
31473 /// ```ignore,no_run
31474 /// # use google_cloud_sql_v1::model::User;
31475 /// let x = User::new().set_etag("example");
31476 /// ```
31477 pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31478 self.etag = v.into();
31479 self
31480 }
31481
31482 /// Sets the value of [name][crate::model::User::name].
31483 ///
31484 /// # Example
31485 /// ```ignore,no_run
31486 /// # use google_cloud_sql_v1::model::User;
31487 /// let x = User::new().set_name("example");
31488 /// ```
31489 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31490 self.name = v.into();
31491 self
31492 }
31493
31494 /// Sets the value of [host][crate::model::User::host].
31495 ///
31496 /// # Example
31497 /// ```ignore,no_run
31498 /// # use google_cloud_sql_v1::model::User;
31499 /// let x = User::new().set_host("example");
31500 /// ```
31501 pub fn set_host<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31502 self.host = v.into();
31503 self
31504 }
31505
31506 /// Sets the value of [instance][crate::model::User::instance].
31507 ///
31508 /// # Example
31509 /// ```ignore,no_run
31510 /// # use google_cloud_sql_v1::model::User;
31511 /// let x = User::new().set_instance("example");
31512 /// ```
31513 pub fn set_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31514 self.instance = v.into();
31515 self
31516 }
31517
31518 /// Sets the value of [project][crate::model::User::project].
31519 ///
31520 /// # Example
31521 /// ```ignore,no_run
31522 /// # use google_cloud_sql_v1::model::User;
31523 /// let x = User::new().set_project("example");
31524 /// ```
31525 pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31526 self.project = v.into();
31527 self
31528 }
31529
31530 /// Sets the value of [r#type][crate::model::User::type].
31531 ///
31532 /// # Example
31533 /// ```ignore,no_run
31534 /// # use google_cloud_sql_v1::model::User;
31535 /// use google_cloud_sql_v1::model::user::SqlUserType;
31536 /// let x0 = User::new().set_type(SqlUserType::CloudIamUser);
31537 /// let x1 = User::new().set_type(SqlUserType::CloudIamServiceAccount);
31538 /// let x2 = User::new().set_type(SqlUserType::CloudIamGroup);
31539 /// ```
31540 pub fn set_type<T: std::convert::Into<crate::model::user::SqlUserType>>(
31541 mut self,
31542 v: T,
31543 ) -> Self {
31544 self.r#type = v.into();
31545 self
31546 }
31547
31548 /// Sets the value of [iam_email][crate::model::User::iam_email].
31549 ///
31550 /// # Example
31551 /// ```ignore,no_run
31552 /// # use google_cloud_sql_v1::model::User;
31553 /// let x = User::new().set_iam_email("example");
31554 /// ```
31555 pub fn set_iam_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
31556 self.iam_email = v.into();
31557 self
31558 }
31559
31560 /// Sets the value of [password_policy][crate::model::User::password_policy].
31561 ///
31562 /// # Example
31563 /// ```ignore,no_run
31564 /// # use google_cloud_sql_v1::model::User;
31565 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31566 /// let x = User::new().set_password_policy(UserPasswordValidationPolicy::default()/* use setters */);
31567 /// ```
31568 pub fn set_password_policy<T>(mut self, v: T) -> Self
31569 where
31570 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31571 {
31572 self.password_policy = std::option::Option::Some(v.into());
31573 self
31574 }
31575
31576 /// Sets or clears the value of [password_policy][crate::model::User::password_policy].
31577 ///
31578 /// # Example
31579 /// ```ignore,no_run
31580 /// # use google_cloud_sql_v1::model::User;
31581 /// use google_cloud_sql_v1::model::UserPasswordValidationPolicy;
31582 /// let x = User::new().set_or_clear_password_policy(Some(UserPasswordValidationPolicy::default()/* use setters */));
31583 /// let x = User::new().set_or_clear_password_policy(None::<UserPasswordValidationPolicy>);
31584 /// ```
31585 pub fn set_or_clear_password_policy<T>(mut self, v: std::option::Option<T>) -> Self
31586 where
31587 T: std::convert::Into<crate::model::UserPasswordValidationPolicy>,
31588 {
31589 self.password_policy = v.map(|x| x.into());
31590 self
31591 }
31592
31593 /// Sets the value of [dual_password_type][crate::model::User::dual_password_type].
31594 ///
31595 /// # Example
31596 /// ```ignore,no_run
31597 /// # use google_cloud_sql_v1::model::User;
31598 /// use google_cloud_sql_v1::model::user::DualPasswordType;
31599 /// let x0 = User::new().set_dual_password_type(DualPasswordType::NoModifyDualPassword);
31600 /// let x1 = User::new().set_dual_password_type(DualPasswordType::NoDualPassword);
31601 /// let x2 = User::new().set_dual_password_type(DualPasswordType::DualPassword);
31602 /// ```
31603 pub fn set_dual_password_type<T>(mut self, v: T) -> Self
31604 where
31605 T: std::convert::Into<crate::model::user::DualPasswordType>,
31606 {
31607 self.dual_password_type = std::option::Option::Some(v.into());
31608 self
31609 }
31610
31611 /// Sets or clears the value of [dual_password_type][crate::model::User::dual_password_type].
31612 ///
31613 /// # Example
31614 /// ```ignore,no_run
31615 /// # use google_cloud_sql_v1::model::User;
31616 /// use google_cloud_sql_v1::model::user::DualPasswordType;
31617 /// let x0 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoModifyDualPassword));
31618 /// let x1 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::NoDualPassword));
31619 /// let x2 = User::new().set_or_clear_dual_password_type(Some(DualPasswordType::DualPassword));
31620 /// let x_none = User::new().set_or_clear_dual_password_type(None::<DualPasswordType>);
31621 /// ```
31622 pub fn set_or_clear_dual_password_type<T>(mut self, v: std::option::Option<T>) -> Self
31623 where
31624 T: std::convert::Into<crate::model::user::DualPasswordType>,
31625 {
31626 self.dual_password_type = v.map(|x| x.into());
31627 self
31628 }
31629
31630 /// Sets the value of [iam_status][crate::model::User::iam_status].
31631 ///
31632 /// # Example
31633 /// ```ignore,no_run
31634 /// # use google_cloud_sql_v1::model::User;
31635 /// use google_cloud_sql_v1::model::user::IamStatus;
31636 /// let x0 = User::new().set_iam_status(IamStatus::Inactive);
31637 /// let x1 = User::new().set_iam_status(IamStatus::Active);
31638 /// ```
31639 pub fn set_iam_status<T>(mut self, v: T) -> Self
31640 where
31641 T: std::convert::Into<crate::model::user::IamStatus>,
31642 {
31643 self.iam_status = std::option::Option::Some(v.into());
31644 self
31645 }
31646
31647 /// Sets or clears the value of [iam_status][crate::model::User::iam_status].
31648 ///
31649 /// # Example
31650 /// ```ignore,no_run
31651 /// # use google_cloud_sql_v1::model::User;
31652 /// use google_cloud_sql_v1::model::user::IamStatus;
31653 /// let x0 = User::new().set_or_clear_iam_status(Some(IamStatus::Inactive));
31654 /// let x1 = User::new().set_or_clear_iam_status(Some(IamStatus::Active));
31655 /// let x_none = User::new().set_or_clear_iam_status(None::<IamStatus>);
31656 /// ```
31657 pub fn set_or_clear_iam_status<T>(mut self, v: std::option::Option<T>) -> Self
31658 where
31659 T: std::convert::Into<crate::model::user::IamStatus>,
31660 {
31661 self.iam_status = v.map(|x| x.into());
31662 self
31663 }
31664
31665 /// Sets the value of [database_roles][crate::model::User::database_roles].
31666 ///
31667 /// # Example
31668 /// ```ignore,no_run
31669 /// # use google_cloud_sql_v1::model::User;
31670 /// let x = User::new().set_database_roles(["a", "b", "c"]);
31671 /// ```
31672 pub fn set_database_roles<T, V>(mut self, v: T) -> Self
31673 where
31674 T: std::iter::IntoIterator<Item = V>,
31675 V: std::convert::Into<std::string::String>,
31676 {
31677 use std::iter::Iterator;
31678 self.database_roles = v.into_iter().map(|i| i.into()).collect();
31679 self
31680 }
31681
31682 /// Sets the value of [user_details][crate::model::User::user_details].
31683 ///
31684 /// Note that all the setters affecting `user_details` are mutually
31685 /// exclusive.
31686 ///
31687 /// # Example
31688 /// ```ignore,no_run
31689 /// # use google_cloud_sql_v1::model::User;
31690 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
31691 /// let x = User::new().set_user_details(Some(
31692 /// google_cloud_sql_v1::model::user::UserDetails::SqlserverUserDetails(SqlServerUserDetails::default().into())));
31693 /// ```
31694 pub fn set_user_details<
31695 T: std::convert::Into<std::option::Option<crate::model::user::UserDetails>>,
31696 >(
31697 mut self,
31698 v: T,
31699 ) -> Self {
31700 self.user_details = v.into();
31701 self
31702 }
31703
31704 /// The value of [user_details][crate::model::User::user_details]
31705 /// if it holds a `SqlserverUserDetails`, `None` if the field is not set or
31706 /// holds a different branch.
31707 pub fn sqlserver_user_details(
31708 &self,
31709 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerUserDetails>> {
31710 #[allow(unreachable_patterns)]
31711 self.user_details.as_ref().and_then(|v| match v {
31712 crate::model::user::UserDetails::SqlserverUserDetails(v) => {
31713 std::option::Option::Some(v)
31714 }
31715 _ => std::option::Option::None,
31716 })
31717 }
31718
31719 /// Sets the value of [user_details][crate::model::User::user_details]
31720 /// to hold a `SqlserverUserDetails`.
31721 ///
31722 /// Note that all the setters affecting `user_details` are
31723 /// mutually exclusive.
31724 ///
31725 /// # Example
31726 /// ```ignore,no_run
31727 /// # use google_cloud_sql_v1::model::User;
31728 /// use google_cloud_sql_v1::model::SqlServerUserDetails;
31729 /// let x = User::new().set_sqlserver_user_details(SqlServerUserDetails::default()/* use setters */);
31730 /// assert!(x.sqlserver_user_details().is_some());
31731 /// ```
31732 pub fn set_sqlserver_user_details<
31733 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerUserDetails>>,
31734 >(
31735 mut self,
31736 v: T,
31737 ) -> Self {
31738 self.user_details = std::option::Option::Some(
31739 crate::model::user::UserDetails::SqlserverUserDetails(v.into()),
31740 );
31741 self
31742 }
31743}
31744
31745impl wkt::message::Message for User {
31746 fn typename() -> &'static str {
31747 "type.googleapis.com/google.cloud.sql.v1.User"
31748 }
31749}
31750
31751/// Defines additional types related to [User].
31752pub mod user {
31753 #[allow(unused_imports)]
31754 use super::*;
31755
31756 /// The user type.
31757 ///
31758 /// # Working with unknown values
31759 ///
31760 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31761 /// additional enum variants at any time. Adding new variants is not considered
31762 /// a breaking change. Applications should write their code in anticipation of:
31763 ///
31764 /// - New values appearing in future releases of the client library, **and**
31765 /// - New values received dynamically, without application changes.
31766 ///
31767 /// Please consult the [Working with enums] section in the user guide for some
31768 /// guidelines.
31769 ///
31770 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31771 #[derive(Clone, Debug, PartialEq)]
31772 #[non_exhaustive]
31773 pub enum SqlUserType {
31774 /// The database's built-in user type.
31775 BuiltIn,
31776 /// Cloud IAM user.
31777 CloudIamUser,
31778 /// Cloud IAM service account.
31779 CloudIamServiceAccount,
31780 /// Cloud IAM group. Not used for login.
31781 CloudIamGroup,
31782 /// Read-only. Login for a user that belongs to the Cloud IAM group.
31783 CloudIamGroupUser,
31784 /// Read-only. Login for a service account that belongs to the
31785 /// Cloud IAM group.
31786 CloudIamGroupServiceAccount,
31787 /// Microsoft Entra ID user.
31788 EntraidUser,
31789 /// If set, the enum was initialized with an unknown value.
31790 ///
31791 /// Applications can examine the value using [SqlUserType::value] or
31792 /// [SqlUserType::name].
31793 UnknownValue(sql_user_type::UnknownValue),
31794 }
31795
31796 #[doc(hidden)]
31797 pub mod sql_user_type {
31798 #[allow(unused_imports)]
31799 use super::*;
31800 #[derive(Clone, Debug, PartialEq)]
31801 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31802 }
31803
31804 impl SqlUserType {
31805 /// Gets the enum value.
31806 ///
31807 /// Returns `None` if the enum contains an unknown value deserialized from
31808 /// the string representation of enums.
31809 pub fn value(&self) -> std::option::Option<i32> {
31810 match self {
31811 Self::BuiltIn => std::option::Option::Some(0),
31812 Self::CloudIamUser => std::option::Option::Some(1),
31813 Self::CloudIamServiceAccount => std::option::Option::Some(2),
31814 Self::CloudIamGroup => std::option::Option::Some(3),
31815 Self::CloudIamGroupUser => std::option::Option::Some(4),
31816 Self::CloudIamGroupServiceAccount => std::option::Option::Some(5),
31817 Self::EntraidUser => std::option::Option::Some(7),
31818 Self::UnknownValue(u) => u.0.value(),
31819 }
31820 }
31821
31822 /// Gets the enum value as a string.
31823 ///
31824 /// Returns `None` if the enum contains an unknown value deserialized from
31825 /// the integer representation of enums.
31826 pub fn name(&self) -> std::option::Option<&str> {
31827 match self {
31828 Self::BuiltIn => std::option::Option::Some("BUILT_IN"),
31829 Self::CloudIamUser => std::option::Option::Some("CLOUD_IAM_USER"),
31830 Self::CloudIamServiceAccount => {
31831 std::option::Option::Some("CLOUD_IAM_SERVICE_ACCOUNT")
31832 }
31833 Self::CloudIamGroup => std::option::Option::Some("CLOUD_IAM_GROUP"),
31834 Self::CloudIamGroupUser => std::option::Option::Some("CLOUD_IAM_GROUP_USER"),
31835 Self::CloudIamGroupServiceAccount => {
31836 std::option::Option::Some("CLOUD_IAM_GROUP_SERVICE_ACCOUNT")
31837 }
31838 Self::EntraidUser => std::option::Option::Some("ENTRAID_USER"),
31839 Self::UnknownValue(u) => u.0.name(),
31840 }
31841 }
31842 }
31843
31844 impl std::default::Default for SqlUserType {
31845 fn default() -> Self {
31846 use std::convert::From;
31847 Self::from(0)
31848 }
31849 }
31850
31851 impl std::fmt::Display for SqlUserType {
31852 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
31853 wkt::internal::display_enum(f, self.name(), self.value())
31854 }
31855 }
31856
31857 impl std::convert::From<i32> for SqlUserType {
31858 fn from(value: i32) -> Self {
31859 match value {
31860 0 => Self::BuiltIn,
31861 1 => Self::CloudIamUser,
31862 2 => Self::CloudIamServiceAccount,
31863 3 => Self::CloudIamGroup,
31864 4 => Self::CloudIamGroupUser,
31865 5 => Self::CloudIamGroupServiceAccount,
31866 7 => Self::EntraidUser,
31867 _ => Self::UnknownValue(sql_user_type::UnknownValue(
31868 wkt::internal::UnknownEnumValue::Integer(value),
31869 )),
31870 }
31871 }
31872 }
31873
31874 impl std::convert::From<&str> for SqlUserType {
31875 fn from(value: &str) -> Self {
31876 use std::string::ToString;
31877 match value {
31878 "BUILT_IN" => Self::BuiltIn,
31879 "CLOUD_IAM_USER" => Self::CloudIamUser,
31880 "CLOUD_IAM_SERVICE_ACCOUNT" => Self::CloudIamServiceAccount,
31881 "CLOUD_IAM_GROUP" => Self::CloudIamGroup,
31882 "CLOUD_IAM_GROUP_USER" => Self::CloudIamGroupUser,
31883 "CLOUD_IAM_GROUP_SERVICE_ACCOUNT" => Self::CloudIamGroupServiceAccount,
31884 "ENTRAID_USER" => Self::EntraidUser,
31885 _ => Self::UnknownValue(sql_user_type::UnknownValue(
31886 wkt::internal::UnknownEnumValue::String(value.to_string()),
31887 )),
31888 }
31889 }
31890 }
31891
31892 impl serde::ser::Serialize for SqlUserType {
31893 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
31894 where
31895 S: serde::Serializer,
31896 {
31897 match self {
31898 Self::BuiltIn => serializer.serialize_i32(0),
31899 Self::CloudIamUser => serializer.serialize_i32(1),
31900 Self::CloudIamServiceAccount => serializer.serialize_i32(2),
31901 Self::CloudIamGroup => serializer.serialize_i32(3),
31902 Self::CloudIamGroupUser => serializer.serialize_i32(4),
31903 Self::CloudIamGroupServiceAccount => serializer.serialize_i32(5),
31904 Self::EntraidUser => serializer.serialize_i32(7),
31905 Self::UnknownValue(u) => u.0.serialize(serializer),
31906 }
31907 }
31908 }
31909
31910 impl<'de> serde::de::Deserialize<'de> for SqlUserType {
31911 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
31912 where
31913 D: serde::Deserializer<'de>,
31914 {
31915 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUserType>::new(
31916 ".google.cloud.sql.v1.User.SqlUserType",
31917 ))
31918 }
31919 }
31920
31921 /// The type of retained password.
31922 ///
31923 /// # Working with unknown values
31924 ///
31925 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
31926 /// additional enum variants at any time. Adding new variants is not considered
31927 /// a breaking change. Applications should write their code in anticipation of:
31928 ///
31929 /// - New values appearing in future releases of the client library, **and**
31930 /// - New values received dynamically, without application changes.
31931 ///
31932 /// Please consult the [Working with enums] section in the user guide for some
31933 /// guidelines.
31934 ///
31935 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
31936 #[derive(Clone, Debug, PartialEq)]
31937 #[non_exhaustive]
31938 pub enum DualPasswordType {
31939 /// The default value.
31940 Unspecified,
31941 /// Do not update the user's dual password status.
31942 NoModifyDualPassword,
31943 /// No dual password usable for connecting using this user.
31944 NoDualPassword,
31945 /// Dual password usable for connecting using this user.
31946 DualPassword,
31947 /// If set, the enum was initialized with an unknown value.
31948 ///
31949 /// Applications can examine the value using [DualPasswordType::value] or
31950 /// [DualPasswordType::name].
31951 UnknownValue(dual_password_type::UnknownValue),
31952 }
31953
31954 #[doc(hidden)]
31955 pub mod dual_password_type {
31956 #[allow(unused_imports)]
31957 use super::*;
31958 #[derive(Clone, Debug, PartialEq)]
31959 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
31960 }
31961
31962 impl DualPasswordType {
31963 /// Gets the enum value.
31964 ///
31965 /// Returns `None` if the enum contains an unknown value deserialized from
31966 /// the string representation of enums.
31967 pub fn value(&self) -> std::option::Option<i32> {
31968 match self {
31969 Self::Unspecified => std::option::Option::Some(0),
31970 Self::NoModifyDualPassword => std::option::Option::Some(1),
31971 Self::NoDualPassword => std::option::Option::Some(2),
31972 Self::DualPassword => std::option::Option::Some(3),
31973 Self::UnknownValue(u) => u.0.value(),
31974 }
31975 }
31976
31977 /// Gets the enum value as a string.
31978 ///
31979 /// Returns `None` if the enum contains an unknown value deserialized from
31980 /// the integer representation of enums.
31981 pub fn name(&self) -> std::option::Option<&str> {
31982 match self {
31983 Self::Unspecified => std::option::Option::Some("DUAL_PASSWORD_TYPE_UNSPECIFIED"),
31984 Self::NoModifyDualPassword => std::option::Option::Some("NO_MODIFY_DUAL_PASSWORD"),
31985 Self::NoDualPassword => std::option::Option::Some("NO_DUAL_PASSWORD"),
31986 Self::DualPassword => std::option::Option::Some("DUAL_PASSWORD"),
31987 Self::UnknownValue(u) => u.0.name(),
31988 }
31989 }
31990 }
31991
31992 impl std::default::Default for DualPasswordType {
31993 fn default() -> Self {
31994 use std::convert::From;
31995 Self::from(0)
31996 }
31997 }
31998
31999 impl std::fmt::Display for DualPasswordType {
32000 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32001 wkt::internal::display_enum(f, self.name(), self.value())
32002 }
32003 }
32004
32005 impl std::convert::From<i32> for DualPasswordType {
32006 fn from(value: i32) -> Self {
32007 match value {
32008 0 => Self::Unspecified,
32009 1 => Self::NoModifyDualPassword,
32010 2 => Self::NoDualPassword,
32011 3 => Self::DualPassword,
32012 _ => Self::UnknownValue(dual_password_type::UnknownValue(
32013 wkt::internal::UnknownEnumValue::Integer(value),
32014 )),
32015 }
32016 }
32017 }
32018
32019 impl std::convert::From<&str> for DualPasswordType {
32020 fn from(value: &str) -> Self {
32021 use std::string::ToString;
32022 match value {
32023 "DUAL_PASSWORD_TYPE_UNSPECIFIED" => Self::Unspecified,
32024 "NO_MODIFY_DUAL_PASSWORD" => Self::NoModifyDualPassword,
32025 "NO_DUAL_PASSWORD" => Self::NoDualPassword,
32026 "DUAL_PASSWORD" => Self::DualPassword,
32027 _ => Self::UnknownValue(dual_password_type::UnknownValue(
32028 wkt::internal::UnknownEnumValue::String(value.to_string()),
32029 )),
32030 }
32031 }
32032 }
32033
32034 impl serde::ser::Serialize for DualPasswordType {
32035 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32036 where
32037 S: serde::Serializer,
32038 {
32039 match self {
32040 Self::Unspecified => serializer.serialize_i32(0),
32041 Self::NoModifyDualPassword => serializer.serialize_i32(1),
32042 Self::NoDualPassword => serializer.serialize_i32(2),
32043 Self::DualPassword => serializer.serialize_i32(3),
32044 Self::UnknownValue(u) => u.0.serialize(serializer),
32045 }
32046 }
32047 }
32048
32049 impl<'de> serde::de::Deserialize<'de> for DualPasswordType {
32050 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32051 where
32052 D: serde::Deserializer<'de>,
32053 {
32054 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DualPasswordType>::new(
32055 ".google.cloud.sql.v1.User.DualPasswordType",
32056 ))
32057 }
32058 }
32059
32060 /// Indicates if a group is available for IAM database authentication.
32061 ///
32062 /// # Working with unknown values
32063 ///
32064 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32065 /// additional enum variants at any time. Adding new variants is not considered
32066 /// a breaking change. Applications should write their code in anticipation of:
32067 ///
32068 /// - New values appearing in future releases of the client library, **and**
32069 /// - New values received dynamically, without application changes.
32070 ///
32071 /// Please consult the [Working with enums] section in the user guide for some
32072 /// guidelines.
32073 ///
32074 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32075 #[derive(Clone, Debug, PartialEq)]
32076 #[non_exhaustive]
32077 pub enum IamStatus {
32078 /// The default value for users that are not of type CLOUD_IAM_GROUP.
32079 /// Only CLOUD_IAM_GROUP users will be inactive or active.
32080 /// Users with an IamStatus of IAM_STATUS_UNSPECIFIED will not
32081 /// display whether they are active or inactive as that is not applicable to
32082 /// them.
32083 Unspecified,
32084 /// INACTIVE indicates a group is not available for IAM database
32085 /// authentication.
32086 Inactive,
32087 /// ACTIVE indicates a group is available for IAM database authentication.
32088 Active,
32089 /// If set, the enum was initialized with an unknown value.
32090 ///
32091 /// Applications can examine the value using [IamStatus::value] or
32092 /// [IamStatus::name].
32093 UnknownValue(iam_status::UnknownValue),
32094 }
32095
32096 #[doc(hidden)]
32097 pub mod iam_status {
32098 #[allow(unused_imports)]
32099 use super::*;
32100 #[derive(Clone, Debug, PartialEq)]
32101 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32102 }
32103
32104 impl IamStatus {
32105 /// Gets the enum value.
32106 ///
32107 /// Returns `None` if the enum contains an unknown value deserialized from
32108 /// the string representation of enums.
32109 pub fn value(&self) -> std::option::Option<i32> {
32110 match self {
32111 Self::Unspecified => std::option::Option::Some(0),
32112 Self::Inactive => std::option::Option::Some(1),
32113 Self::Active => std::option::Option::Some(2),
32114 Self::UnknownValue(u) => u.0.value(),
32115 }
32116 }
32117
32118 /// Gets the enum value as a string.
32119 ///
32120 /// Returns `None` if the enum contains an unknown value deserialized from
32121 /// the integer representation of enums.
32122 pub fn name(&self) -> std::option::Option<&str> {
32123 match self {
32124 Self::Unspecified => std::option::Option::Some("IAM_STATUS_UNSPECIFIED"),
32125 Self::Inactive => std::option::Option::Some("INACTIVE"),
32126 Self::Active => std::option::Option::Some("ACTIVE"),
32127 Self::UnknownValue(u) => u.0.name(),
32128 }
32129 }
32130 }
32131
32132 impl std::default::Default for IamStatus {
32133 fn default() -> Self {
32134 use std::convert::From;
32135 Self::from(0)
32136 }
32137 }
32138
32139 impl std::fmt::Display for IamStatus {
32140 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32141 wkt::internal::display_enum(f, self.name(), self.value())
32142 }
32143 }
32144
32145 impl std::convert::From<i32> for IamStatus {
32146 fn from(value: i32) -> Self {
32147 match value {
32148 0 => Self::Unspecified,
32149 1 => Self::Inactive,
32150 2 => Self::Active,
32151 _ => Self::UnknownValue(iam_status::UnknownValue(
32152 wkt::internal::UnknownEnumValue::Integer(value),
32153 )),
32154 }
32155 }
32156 }
32157
32158 impl std::convert::From<&str> for IamStatus {
32159 fn from(value: &str) -> Self {
32160 use std::string::ToString;
32161 match value {
32162 "IAM_STATUS_UNSPECIFIED" => Self::Unspecified,
32163 "INACTIVE" => Self::Inactive,
32164 "ACTIVE" => Self::Active,
32165 _ => Self::UnknownValue(iam_status::UnknownValue(
32166 wkt::internal::UnknownEnumValue::String(value.to_string()),
32167 )),
32168 }
32169 }
32170 }
32171
32172 impl serde::ser::Serialize for IamStatus {
32173 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32174 where
32175 S: serde::Serializer,
32176 {
32177 match self {
32178 Self::Unspecified => serializer.serialize_i32(0),
32179 Self::Inactive => serializer.serialize_i32(1),
32180 Self::Active => serializer.serialize_i32(2),
32181 Self::UnknownValue(u) => u.0.serialize(serializer),
32182 }
32183 }
32184 }
32185
32186 impl<'de> serde::de::Deserialize<'de> for IamStatus {
32187 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32188 where
32189 D: serde::Deserializer<'de>,
32190 {
32191 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IamStatus>::new(
32192 ".google.cloud.sql.v1.User.IamStatus",
32193 ))
32194 }
32195 }
32196
32197 /// User details for specific database type
32198 #[derive(Clone, Debug, PartialEq)]
32199 #[non_exhaustive]
32200 pub enum UserDetails {
32201 SqlserverUserDetails(std::boxed::Box<crate::model::SqlServerUserDetails>),
32202 }
32203}
32204
32205/// Represents a Sql Server user on the Cloud SQL instance.
32206#[derive(Clone, Default, PartialEq)]
32207#[non_exhaustive]
32208pub struct SqlServerUserDetails {
32209 /// If the user has been disabled
32210 pub disabled: bool,
32211
32212 /// The server roles for this user
32213 pub server_roles: std::vec::Vec<std::string::String>,
32214
32215 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32216}
32217
32218impl SqlServerUserDetails {
32219 pub fn new() -> Self {
32220 std::default::Default::default()
32221 }
32222
32223 /// Sets the value of [disabled][crate::model::SqlServerUserDetails::disabled].
32224 ///
32225 /// # Example
32226 /// ```ignore,no_run
32227 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32228 /// let x = SqlServerUserDetails::new().set_disabled(true);
32229 /// ```
32230 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
32231 self.disabled = v.into();
32232 self
32233 }
32234
32235 /// Sets the value of [server_roles][crate::model::SqlServerUserDetails::server_roles].
32236 ///
32237 /// # Example
32238 /// ```ignore,no_run
32239 /// # use google_cloud_sql_v1::model::SqlServerUserDetails;
32240 /// let x = SqlServerUserDetails::new().set_server_roles(["a", "b", "c"]);
32241 /// ```
32242 pub fn set_server_roles<T, V>(mut self, v: T) -> Self
32243 where
32244 T: std::iter::IntoIterator<Item = V>,
32245 V: std::convert::Into<std::string::String>,
32246 {
32247 use std::iter::Iterator;
32248 self.server_roles = v.into_iter().map(|i| i.into()).collect();
32249 self
32250 }
32251}
32252
32253impl wkt::message::Message for SqlServerUserDetails {
32254 fn typename() -> &'static str {
32255 "type.googleapis.com/google.cloud.sql.v1.SqlServerUserDetails"
32256 }
32257}
32258
32259/// User list response.
32260#[derive(Clone, Default, PartialEq)]
32261#[non_exhaustive]
32262pub struct UsersListResponse {
32263 /// This is always `sql#usersList`.
32264 pub kind: std::string::String,
32265
32266 /// List of user resources in the instance.
32267 pub items: std::vec::Vec<crate::model::User>,
32268
32269 /// Unused.
32270 #[deprecated]
32271 pub next_page_token: std::string::String,
32272
32273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32274}
32275
32276impl UsersListResponse {
32277 pub fn new() -> Self {
32278 std::default::Default::default()
32279 }
32280
32281 /// Sets the value of [kind][crate::model::UsersListResponse::kind].
32282 ///
32283 /// # Example
32284 /// ```ignore,no_run
32285 /// # use google_cloud_sql_v1::model::UsersListResponse;
32286 /// let x = UsersListResponse::new().set_kind("example");
32287 /// ```
32288 pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32289 self.kind = v.into();
32290 self
32291 }
32292
32293 /// Sets the value of [items][crate::model::UsersListResponse::items].
32294 ///
32295 /// # Example
32296 /// ```ignore,no_run
32297 /// # use google_cloud_sql_v1::model::UsersListResponse;
32298 /// use google_cloud_sql_v1::model::User;
32299 /// let x = UsersListResponse::new()
32300 /// .set_items([
32301 /// User::default()/* use setters */,
32302 /// User::default()/* use (different) setters */,
32303 /// ]);
32304 /// ```
32305 pub fn set_items<T, V>(mut self, v: T) -> Self
32306 where
32307 T: std::iter::IntoIterator<Item = V>,
32308 V: std::convert::Into<crate::model::User>,
32309 {
32310 use std::iter::Iterator;
32311 self.items = v.into_iter().map(|i| i.into()).collect();
32312 self
32313 }
32314
32315 /// Sets the value of [next_page_token][crate::model::UsersListResponse::next_page_token].
32316 ///
32317 /// # Example
32318 /// ```ignore,no_run
32319 /// # use google_cloud_sql_v1::model::UsersListResponse;
32320 /// let x = UsersListResponse::new().set_next_page_token("example");
32321 /// ```
32322 #[deprecated]
32323 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
32324 self.next_page_token = v.into();
32325 self
32326 }
32327}
32328
32329impl wkt::message::Message for UsersListResponse {
32330 fn typename() -> &'static str {
32331 "type.googleapis.com/google.cloud.sql.v1.UsersListResponse"
32332 }
32333}
32334
32335/// The status of a backup run.
32336///
32337/// # Working with unknown values
32338///
32339/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32340/// additional enum variants at any time. Adding new variants is not considered
32341/// a breaking change. Applications should write their code in anticipation of:
32342///
32343/// - New values appearing in future releases of the client library, **and**
32344/// - New values received dynamically, without application changes.
32345///
32346/// Please consult the [Working with enums] section in the user guide for some
32347/// guidelines.
32348///
32349/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32350#[derive(Clone, Debug, PartialEq)]
32351#[non_exhaustive]
32352pub enum SqlBackupRunStatus {
32353 /// The status of the run is unknown.
32354 Unspecified,
32355 /// The backup operation was enqueued.
32356 Enqueued,
32357 /// The backup is overdue across a given backup window. Indicates a
32358 /// problem. Example: Long-running operation in progress during
32359 /// the whole window.
32360 Overdue,
32361 /// The backup is in progress.
32362 Running,
32363 /// The backup failed.
32364 Failed,
32365 /// The backup was successful.
32366 Successful,
32367 /// The backup was skipped (without problems) for a given backup
32368 /// window. Example: Instance was idle.
32369 Skipped,
32370 /// The backup is about to be deleted.
32371 DeletionPending,
32372 /// The backup deletion failed.
32373 DeletionFailed,
32374 /// The backup has been deleted.
32375 Deleted,
32376 /// If set, the enum was initialized with an unknown value.
32377 ///
32378 /// Applications can examine the value using [SqlBackupRunStatus::value] or
32379 /// [SqlBackupRunStatus::name].
32380 UnknownValue(sql_backup_run_status::UnknownValue),
32381}
32382
32383#[doc(hidden)]
32384pub mod sql_backup_run_status {
32385 #[allow(unused_imports)]
32386 use super::*;
32387 #[derive(Clone, Debug, PartialEq)]
32388 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32389}
32390
32391impl SqlBackupRunStatus {
32392 /// Gets the enum value.
32393 ///
32394 /// Returns `None` if the enum contains an unknown value deserialized from
32395 /// the string representation of enums.
32396 pub fn value(&self) -> std::option::Option<i32> {
32397 match self {
32398 Self::Unspecified => std::option::Option::Some(0),
32399 Self::Enqueued => std::option::Option::Some(1),
32400 Self::Overdue => std::option::Option::Some(2),
32401 Self::Running => std::option::Option::Some(3),
32402 Self::Failed => std::option::Option::Some(4),
32403 Self::Successful => std::option::Option::Some(5),
32404 Self::Skipped => std::option::Option::Some(6),
32405 Self::DeletionPending => std::option::Option::Some(7),
32406 Self::DeletionFailed => std::option::Option::Some(8),
32407 Self::Deleted => std::option::Option::Some(9),
32408 Self::UnknownValue(u) => u.0.value(),
32409 }
32410 }
32411
32412 /// Gets the enum value as a string.
32413 ///
32414 /// Returns `None` if the enum contains an unknown value deserialized from
32415 /// the integer representation of enums.
32416 pub fn name(&self) -> std::option::Option<&str> {
32417 match self {
32418 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_STATUS_UNSPECIFIED"),
32419 Self::Enqueued => std::option::Option::Some("ENQUEUED"),
32420 Self::Overdue => std::option::Option::Some("OVERDUE"),
32421 Self::Running => std::option::Option::Some("RUNNING"),
32422 Self::Failed => std::option::Option::Some("FAILED"),
32423 Self::Successful => std::option::Option::Some("SUCCESSFUL"),
32424 Self::Skipped => std::option::Option::Some("SKIPPED"),
32425 Self::DeletionPending => std::option::Option::Some("DELETION_PENDING"),
32426 Self::DeletionFailed => std::option::Option::Some("DELETION_FAILED"),
32427 Self::Deleted => std::option::Option::Some("DELETED"),
32428 Self::UnknownValue(u) => u.0.name(),
32429 }
32430 }
32431}
32432
32433impl std::default::Default for SqlBackupRunStatus {
32434 fn default() -> Self {
32435 use std::convert::From;
32436 Self::from(0)
32437 }
32438}
32439
32440impl std::fmt::Display for SqlBackupRunStatus {
32441 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32442 wkt::internal::display_enum(f, self.name(), self.value())
32443 }
32444}
32445
32446impl std::convert::From<i32> for SqlBackupRunStatus {
32447 fn from(value: i32) -> Self {
32448 match value {
32449 0 => Self::Unspecified,
32450 1 => Self::Enqueued,
32451 2 => Self::Overdue,
32452 3 => Self::Running,
32453 4 => Self::Failed,
32454 5 => Self::Successful,
32455 6 => Self::Skipped,
32456 7 => Self::DeletionPending,
32457 8 => Self::DeletionFailed,
32458 9 => Self::Deleted,
32459 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32460 wkt::internal::UnknownEnumValue::Integer(value),
32461 )),
32462 }
32463 }
32464}
32465
32466impl std::convert::From<&str> for SqlBackupRunStatus {
32467 fn from(value: &str) -> Self {
32468 use std::string::ToString;
32469 match value {
32470 "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" => Self::Unspecified,
32471 "ENQUEUED" => Self::Enqueued,
32472 "OVERDUE" => Self::Overdue,
32473 "RUNNING" => Self::Running,
32474 "FAILED" => Self::Failed,
32475 "SUCCESSFUL" => Self::Successful,
32476 "SKIPPED" => Self::Skipped,
32477 "DELETION_PENDING" => Self::DeletionPending,
32478 "DELETION_FAILED" => Self::DeletionFailed,
32479 "DELETED" => Self::Deleted,
32480 _ => Self::UnknownValue(sql_backup_run_status::UnknownValue(
32481 wkt::internal::UnknownEnumValue::String(value.to_string()),
32482 )),
32483 }
32484 }
32485}
32486
32487impl serde::ser::Serialize for SqlBackupRunStatus {
32488 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32489 where
32490 S: serde::Serializer,
32491 {
32492 match self {
32493 Self::Unspecified => serializer.serialize_i32(0),
32494 Self::Enqueued => serializer.serialize_i32(1),
32495 Self::Overdue => serializer.serialize_i32(2),
32496 Self::Running => serializer.serialize_i32(3),
32497 Self::Failed => serializer.serialize_i32(4),
32498 Self::Successful => serializer.serialize_i32(5),
32499 Self::Skipped => serializer.serialize_i32(6),
32500 Self::DeletionPending => serializer.serialize_i32(7),
32501 Self::DeletionFailed => serializer.serialize_i32(8),
32502 Self::Deleted => serializer.serialize_i32(9),
32503 Self::UnknownValue(u) => u.0.serialize(serializer),
32504 }
32505 }
32506}
32507
32508impl<'de> serde::de::Deserialize<'de> for SqlBackupRunStatus {
32509 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32510 where
32511 D: serde::Deserializer<'de>,
32512 {
32513 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunStatus>::new(
32514 ".google.cloud.sql.v1.SqlBackupRunStatus",
32515 ))
32516 }
32517}
32518
32519/// Defines the supported backup kinds.
32520///
32521/// # Working with unknown values
32522///
32523/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32524/// additional enum variants at any time. Adding new variants is not considered
32525/// a breaking change. Applications should write their code in anticipation of:
32526///
32527/// - New values appearing in future releases of the client library, **and**
32528/// - New values received dynamically, without application changes.
32529///
32530/// Please consult the [Working with enums] section in the user guide for some
32531/// guidelines.
32532///
32533/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32534#[derive(Clone, Debug, PartialEq)]
32535#[non_exhaustive]
32536pub enum SqlBackupKind {
32537 /// This is an unknown BackupKind.
32538 Unspecified,
32539 /// Snapshot-based backups.
32540 Snapshot,
32541 /// Physical backups.
32542 Physical,
32543 /// If set, the enum was initialized with an unknown value.
32544 ///
32545 /// Applications can examine the value using [SqlBackupKind::value] or
32546 /// [SqlBackupKind::name].
32547 UnknownValue(sql_backup_kind::UnknownValue),
32548}
32549
32550#[doc(hidden)]
32551pub mod sql_backup_kind {
32552 #[allow(unused_imports)]
32553 use super::*;
32554 #[derive(Clone, Debug, PartialEq)]
32555 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32556}
32557
32558impl SqlBackupKind {
32559 /// Gets the enum value.
32560 ///
32561 /// Returns `None` if the enum contains an unknown value deserialized from
32562 /// the string representation of enums.
32563 pub fn value(&self) -> std::option::Option<i32> {
32564 match self {
32565 Self::Unspecified => std::option::Option::Some(0),
32566 Self::Snapshot => std::option::Option::Some(1),
32567 Self::Physical => std::option::Option::Some(2),
32568 Self::UnknownValue(u) => u.0.value(),
32569 }
32570 }
32571
32572 /// Gets the enum value as a string.
32573 ///
32574 /// Returns `None` if the enum contains an unknown value deserialized from
32575 /// the integer representation of enums.
32576 pub fn name(&self) -> std::option::Option<&str> {
32577 match self {
32578 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_KIND_UNSPECIFIED"),
32579 Self::Snapshot => std::option::Option::Some("SNAPSHOT"),
32580 Self::Physical => std::option::Option::Some("PHYSICAL"),
32581 Self::UnknownValue(u) => u.0.name(),
32582 }
32583 }
32584}
32585
32586impl std::default::Default for SqlBackupKind {
32587 fn default() -> Self {
32588 use std::convert::From;
32589 Self::from(0)
32590 }
32591}
32592
32593impl std::fmt::Display for SqlBackupKind {
32594 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32595 wkt::internal::display_enum(f, self.name(), self.value())
32596 }
32597}
32598
32599impl std::convert::From<i32> for SqlBackupKind {
32600 fn from(value: i32) -> Self {
32601 match value {
32602 0 => Self::Unspecified,
32603 1 => Self::Snapshot,
32604 2 => Self::Physical,
32605 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32606 wkt::internal::UnknownEnumValue::Integer(value),
32607 )),
32608 }
32609 }
32610}
32611
32612impl std::convert::From<&str> for SqlBackupKind {
32613 fn from(value: &str) -> Self {
32614 use std::string::ToString;
32615 match value {
32616 "SQL_BACKUP_KIND_UNSPECIFIED" => Self::Unspecified,
32617 "SNAPSHOT" => Self::Snapshot,
32618 "PHYSICAL" => Self::Physical,
32619 _ => Self::UnknownValue(sql_backup_kind::UnknownValue(
32620 wkt::internal::UnknownEnumValue::String(value.to_string()),
32621 )),
32622 }
32623 }
32624}
32625
32626impl serde::ser::Serialize for SqlBackupKind {
32627 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32628 where
32629 S: serde::Serializer,
32630 {
32631 match self {
32632 Self::Unspecified => serializer.serialize_i32(0),
32633 Self::Snapshot => serializer.serialize_i32(1),
32634 Self::Physical => serializer.serialize_i32(2),
32635 Self::UnknownValue(u) => u.0.serialize(serializer),
32636 }
32637 }
32638}
32639
32640impl<'de> serde::de::Deserialize<'de> for SqlBackupKind {
32641 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32642 where
32643 D: serde::Deserializer<'de>,
32644 {
32645 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupKind>::new(
32646 ".google.cloud.sql.v1.SqlBackupKind",
32647 ))
32648 }
32649}
32650
32651/// Type of backup (i.e. automated, on demand, etc).
32652///
32653/// # Working with unknown values
32654///
32655/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32656/// additional enum variants at any time. Adding new variants is not considered
32657/// a breaking change. Applications should write their code in anticipation of:
32658///
32659/// - New values appearing in future releases of the client library, **and**
32660/// - New values received dynamically, without application changes.
32661///
32662/// Please consult the [Working with enums] section in the user guide for some
32663/// guidelines.
32664///
32665/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32666#[derive(Clone, Debug, PartialEq)]
32667#[non_exhaustive]
32668pub enum SqlBackupRunType {
32669 /// This is an unknown BackupRun type.
32670 Unspecified,
32671 /// The backup schedule automatically triggers a backup.
32672 Automated,
32673 /// The user manually triggers a backup.
32674 OnDemand,
32675 /// If set, the enum was initialized with an unknown value.
32676 ///
32677 /// Applications can examine the value using [SqlBackupRunType::value] or
32678 /// [SqlBackupRunType::name].
32679 UnknownValue(sql_backup_run_type::UnknownValue),
32680}
32681
32682#[doc(hidden)]
32683pub mod sql_backup_run_type {
32684 #[allow(unused_imports)]
32685 use super::*;
32686 #[derive(Clone, Debug, PartialEq)]
32687 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32688}
32689
32690impl SqlBackupRunType {
32691 /// Gets the enum value.
32692 ///
32693 /// Returns `None` if the enum contains an unknown value deserialized from
32694 /// the string representation of enums.
32695 pub fn value(&self) -> std::option::Option<i32> {
32696 match self {
32697 Self::Unspecified => std::option::Option::Some(0),
32698 Self::Automated => std::option::Option::Some(1),
32699 Self::OnDemand => std::option::Option::Some(2),
32700 Self::UnknownValue(u) => u.0.value(),
32701 }
32702 }
32703
32704 /// Gets the enum value as a string.
32705 ///
32706 /// Returns `None` if the enum contains an unknown value deserialized from
32707 /// the integer representation of enums.
32708 pub fn name(&self) -> std::option::Option<&str> {
32709 match self {
32710 Self::Unspecified => std::option::Option::Some("SQL_BACKUP_RUN_TYPE_UNSPECIFIED"),
32711 Self::Automated => std::option::Option::Some("AUTOMATED"),
32712 Self::OnDemand => std::option::Option::Some("ON_DEMAND"),
32713 Self::UnknownValue(u) => u.0.name(),
32714 }
32715 }
32716}
32717
32718impl std::default::Default for SqlBackupRunType {
32719 fn default() -> Self {
32720 use std::convert::From;
32721 Self::from(0)
32722 }
32723}
32724
32725impl std::fmt::Display for SqlBackupRunType {
32726 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32727 wkt::internal::display_enum(f, self.name(), self.value())
32728 }
32729}
32730
32731impl std::convert::From<i32> for SqlBackupRunType {
32732 fn from(value: i32) -> Self {
32733 match value {
32734 0 => Self::Unspecified,
32735 1 => Self::Automated,
32736 2 => Self::OnDemand,
32737 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
32738 wkt::internal::UnknownEnumValue::Integer(value),
32739 )),
32740 }
32741 }
32742}
32743
32744impl std::convert::From<&str> for SqlBackupRunType {
32745 fn from(value: &str) -> Self {
32746 use std::string::ToString;
32747 match value {
32748 "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" => Self::Unspecified,
32749 "AUTOMATED" => Self::Automated,
32750 "ON_DEMAND" => Self::OnDemand,
32751 _ => Self::UnknownValue(sql_backup_run_type::UnknownValue(
32752 wkt::internal::UnknownEnumValue::String(value.to_string()),
32753 )),
32754 }
32755 }
32756}
32757
32758impl serde::ser::Serialize for SqlBackupRunType {
32759 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32760 where
32761 S: serde::Serializer,
32762 {
32763 match self {
32764 Self::Unspecified => serializer.serialize_i32(0),
32765 Self::Automated => serializer.serialize_i32(1),
32766 Self::OnDemand => serializer.serialize_i32(2),
32767 Self::UnknownValue(u) => u.0.serialize(serializer),
32768 }
32769 }
32770}
32771
32772impl<'de> serde::de::Deserialize<'de> for SqlBackupRunType {
32773 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32774 where
32775 D: serde::Deserializer<'de>,
32776 {
32777 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackupRunType>::new(
32778 ".google.cloud.sql.v1.SqlBackupRunType",
32779 ))
32780 }
32781}
32782
32783///
32784/// # Working with unknown values
32785///
32786/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32787/// additional enum variants at any time. Adding new variants is not considered
32788/// a breaking change. Applications should write their code in anticipation of:
32789///
32790/// - New values appearing in future releases of the client library, **and**
32791/// - New values received dynamically, without application changes.
32792///
32793/// Please consult the [Working with enums] section in the user guide for some
32794/// guidelines.
32795///
32796/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32797#[derive(Clone, Debug, PartialEq)]
32798#[non_exhaustive]
32799pub enum SqlFlagType {
32800 /// This is an unknown flag type.
32801 Unspecified,
32802 /// Boolean type flag.
32803 Boolean,
32804 /// String type flag.
32805 String,
32806 /// Integer type flag.
32807 Integer,
32808 /// Flag type used for a server startup option.
32809 None,
32810 /// Type introduced specially for MySQL TimeZone offset. Accept a string value
32811 /// with the format [-12:59, 13:00].
32812 MysqlTimezoneOffset,
32813 /// Float type flag.
32814 Float,
32815 /// Comma-separated list of the strings in a SqlFlagType enum.
32816 RepeatedString,
32817 /// If set, the enum was initialized with an unknown value.
32818 ///
32819 /// Applications can examine the value using [SqlFlagType::value] or
32820 /// [SqlFlagType::name].
32821 UnknownValue(sql_flag_type::UnknownValue),
32822}
32823
32824#[doc(hidden)]
32825pub mod sql_flag_type {
32826 #[allow(unused_imports)]
32827 use super::*;
32828 #[derive(Clone, Debug, PartialEq)]
32829 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32830}
32831
32832impl SqlFlagType {
32833 /// Gets the enum value.
32834 ///
32835 /// Returns `None` if the enum contains an unknown value deserialized from
32836 /// the string representation of enums.
32837 pub fn value(&self) -> std::option::Option<i32> {
32838 match self {
32839 Self::Unspecified => std::option::Option::Some(0),
32840 Self::Boolean => std::option::Option::Some(1),
32841 Self::String => std::option::Option::Some(2),
32842 Self::Integer => std::option::Option::Some(3),
32843 Self::None => std::option::Option::Some(4),
32844 Self::MysqlTimezoneOffset => std::option::Option::Some(5),
32845 Self::Float => std::option::Option::Some(6),
32846 Self::RepeatedString => std::option::Option::Some(7),
32847 Self::UnknownValue(u) => u.0.value(),
32848 }
32849 }
32850
32851 /// Gets the enum value as a string.
32852 ///
32853 /// Returns `None` if the enum contains an unknown value deserialized from
32854 /// the integer representation of enums.
32855 pub fn name(&self) -> std::option::Option<&str> {
32856 match self {
32857 Self::Unspecified => std::option::Option::Some("SQL_FLAG_TYPE_UNSPECIFIED"),
32858 Self::Boolean => std::option::Option::Some("BOOLEAN"),
32859 Self::String => std::option::Option::Some("STRING"),
32860 Self::Integer => std::option::Option::Some("INTEGER"),
32861 Self::None => std::option::Option::Some("NONE"),
32862 Self::MysqlTimezoneOffset => std::option::Option::Some("MYSQL_TIMEZONE_OFFSET"),
32863 Self::Float => std::option::Option::Some("FLOAT"),
32864 Self::RepeatedString => std::option::Option::Some("REPEATED_STRING"),
32865 Self::UnknownValue(u) => u.0.name(),
32866 }
32867 }
32868}
32869
32870impl std::default::Default for SqlFlagType {
32871 fn default() -> Self {
32872 use std::convert::From;
32873 Self::from(0)
32874 }
32875}
32876
32877impl std::fmt::Display for SqlFlagType {
32878 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
32879 wkt::internal::display_enum(f, self.name(), self.value())
32880 }
32881}
32882
32883impl std::convert::From<i32> for SqlFlagType {
32884 fn from(value: i32) -> Self {
32885 match value {
32886 0 => Self::Unspecified,
32887 1 => Self::Boolean,
32888 2 => Self::String,
32889 3 => Self::Integer,
32890 4 => Self::None,
32891 5 => Self::MysqlTimezoneOffset,
32892 6 => Self::Float,
32893 7 => Self::RepeatedString,
32894 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
32895 wkt::internal::UnknownEnumValue::Integer(value),
32896 )),
32897 }
32898 }
32899}
32900
32901impl std::convert::From<&str> for SqlFlagType {
32902 fn from(value: &str) -> Self {
32903 use std::string::ToString;
32904 match value {
32905 "SQL_FLAG_TYPE_UNSPECIFIED" => Self::Unspecified,
32906 "BOOLEAN" => Self::Boolean,
32907 "STRING" => Self::String,
32908 "INTEGER" => Self::Integer,
32909 "NONE" => Self::None,
32910 "MYSQL_TIMEZONE_OFFSET" => Self::MysqlTimezoneOffset,
32911 "FLOAT" => Self::Float,
32912 "REPEATED_STRING" => Self::RepeatedString,
32913 _ => Self::UnknownValue(sql_flag_type::UnknownValue(
32914 wkt::internal::UnknownEnumValue::String(value.to_string()),
32915 )),
32916 }
32917 }
32918}
32919
32920impl serde::ser::Serialize for SqlFlagType {
32921 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
32922 where
32923 S: serde::Serializer,
32924 {
32925 match self {
32926 Self::Unspecified => serializer.serialize_i32(0),
32927 Self::Boolean => serializer.serialize_i32(1),
32928 Self::String => serializer.serialize_i32(2),
32929 Self::Integer => serializer.serialize_i32(3),
32930 Self::None => serializer.serialize_i32(4),
32931 Self::MysqlTimezoneOffset => serializer.serialize_i32(5),
32932 Self::Float => serializer.serialize_i32(6),
32933 Self::RepeatedString => serializer.serialize_i32(7),
32934 Self::UnknownValue(u) => u.0.serialize(serializer),
32935 }
32936 }
32937}
32938
32939impl<'de> serde::de::Deserialize<'de> for SqlFlagType {
32940 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
32941 where
32942 D: serde::Deserializer<'de>,
32943 {
32944 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagType>::new(
32945 ".google.cloud.sql.v1.SqlFlagType",
32946 ))
32947 }
32948}
32949
32950/// Scopes of a flag describe where the flag is used.
32951///
32952/// # Working with unknown values
32953///
32954/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
32955/// additional enum variants at any time. Adding new variants is not considered
32956/// a breaking change. Applications should write their code in anticipation of:
32957///
32958/// - New values appearing in future releases of the client library, **and**
32959/// - New values received dynamically, without application changes.
32960///
32961/// Please consult the [Working with enums] section in the user guide for some
32962/// guidelines.
32963///
32964/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
32965#[derive(Clone, Debug, PartialEq)]
32966#[non_exhaustive]
32967pub enum SqlFlagScope {
32968 /// Assume database flags if unspecified
32969 Unspecified,
32970 /// database flags
32971 Database,
32972 /// connection pool configuration flags
32973 ConnectionPool,
32974 /// If set, the enum was initialized with an unknown value.
32975 ///
32976 /// Applications can examine the value using [SqlFlagScope::value] or
32977 /// [SqlFlagScope::name].
32978 UnknownValue(sql_flag_scope::UnknownValue),
32979}
32980
32981#[doc(hidden)]
32982pub mod sql_flag_scope {
32983 #[allow(unused_imports)]
32984 use super::*;
32985 #[derive(Clone, Debug, PartialEq)]
32986 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
32987}
32988
32989impl SqlFlagScope {
32990 /// Gets the enum value.
32991 ///
32992 /// Returns `None` if the enum contains an unknown value deserialized from
32993 /// the string representation of enums.
32994 pub fn value(&self) -> std::option::Option<i32> {
32995 match self {
32996 Self::Unspecified => std::option::Option::Some(0),
32997 Self::Database => std::option::Option::Some(1),
32998 Self::ConnectionPool => std::option::Option::Some(2),
32999 Self::UnknownValue(u) => u.0.value(),
33000 }
33001 }
33002
33003 /// Gets the enum value as a string.
33004 ///
33005 /// Returns `None` if the enum contains an unknown value deserialized from
33006 /// the integer representation of enums.
33007 pub fn name(&self) -> std::option::Option<&str> {
33008 match self {
33009 Self::Unspecified => std::option::Option::Some("SQL_FLAG_SCOPE_UNSPECIFIED"),
33010 Self::Database => std::option::Option::Some("SQL_FLAG_SCOPE_DATABASE"),
33011 Self::ConnectionPool => std::option::Option::Some("SQL_FLAG_SCOPE_CONNECTION_POOL"),
33012 Self::UnknownValue(u) => u.0.name(),
33013 }
33014 }
33015}
33016
33017impl std::default::Default for SqlFlagScope {
33018 fn default() -> Self {
33019 use std::convert::From;
33020 Self::from(0)
33021 }
33022}
33023
33024impl std::fmt::Display for SqlFlagScope {
33025 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33026 wkt::internal::display_enum(f, self.name(), self.value())
33027 }
33028}
33029
33030impl std::convert::From<i32> for SqlFlagScope {
33031 fn from(value: i32) -> Self {
33032 match value {
33033 0 => Self::Unspecified,
33034 1 => Self::Database,
33035 2 => Self::ConnectionPool,
33036 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33037 wkt::internal::UnknownEnumValue::Integer(value),
33038 )),
33039 }
33040 }
33041}
33042
33043impl std::convert::From<&str> for SqlFlagScope {
33044 fn from(value: &str) -> Self {
33045 use std::string::ToString;
33046 match value {
33047 "SQL_FLAG_SCOPE_UNSPECIFIED" => Self::Unspecified,
33048 "SQL_FLAG_SCOPE_DATABASE" => Self::Database,
33049 "SQL_FLAG_SCOPE_CONNECTION_POOL" => Self::ConnectionPool,
33050 _ => Self::UnknownValue(sql_flag_scope::UnknownValue(
33051 wkt::internal::UnknownEnumValue::String(value.to_string()),
33052 )),
33053 }
33054 }
33055}
33056
33057impl serde::ser::Serialize for SqlFlagScope {
33058 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33059 where
33060 S: serde::Serializer,
33061 {
33062 match self {
33063 Self::Unspecified => serializer.serialize_i32(0),
33064 Self::Database => serializer.serialize_i32(1),
33065 Self::ConnectionPool => serializer.serialize_i32(2),
33066 Self::UnknownValue(u) => u.0.serialize(serializer),
33067 }
33068 }
33069}
33070
33071impl<'de> serde::de::Deserialize<'de> for SqlFlagScope {
33072 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33073 where
33074 D: serde::Deserializer<'de>,
33075 {
33076 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFlagScope>::new(
33077 ".google.cloud.sql.v1.SqlFlagScope",
33078 ))
33079 }
33080}
33081
33082/// External Sync parallel level.
33083///
33084/// # Working with unknown values
33085///
33086/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33087/// additional enum variants at any time. Adding new variants is not considered
33088/// a breaking change. Applications should write their code in anticipation of:
33089///
33090/// - New values appearing in future releases of the client library, **and**
33091/// - New values received dynamically, without application changes.
33092///
33093/// Please consult the [Working with enums] section in the user guide for some
33094/// guidelines.
33095///
33096/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33097#[derive(Clone, Debug, PartialEq)]
33098#[non_exhaustive]
33099pub enum ExternalSyncParallelLevel {
33100 /// Unknown sync parallel level. Will be defaulted to OPTIMAL.
33101 Unspecified,
33102 /// Minimal parallel level.
33103 Min,
33104 /// Optimal parallel level.
33105 Optimal,
33106 /// Maximum parallel level.
33107 Max,
33108 /// If set, the enum was initialized with an unknown value.
33109 ///
33110 /// Applications can examine the value using [ExternalSyncParallelLevel::value] or
33111 /// [ExternalSyncParallelLevel::name].
33112 UnknownValue(external_sync_parallel_level::UnknownValue),
33113}
33114
33115#[doc(hidden)]
33116pub mod external_sync_parallel_level {
33117 #[allow(unused_imports)]
33118 use super::*;
33119 #[derive(Clone, Debug, PartialEq)]
33120 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33121}
33122
33123impl ExternalSyncParallelLevel {
33124 /// Gets the enum value.
33125 ///
33126 /// Returns `None` if the enum contains an unknown value deserialized from
33127 /// the string representation of enums.
33128 pub fn value(&self) -> std::option::Option<i32> {
33129 match self {
33130 Self::Unspecified => std::option::Option::Some(0),
33131 Self::Min => std::option::Option::Some(1),
33132 Self::Optimal => std::option::Option::Some(2),
33133 Self::Max => std::option::Option::Some(3),
33134 Self::UnknownValue(u) => u.0.value(),
33135 }
33136 }
33137
33138 /// Gets the enum value as a string.
33139 ///
33140 /// Returns `None` if the enum contains an unknown value deserialized from
33141 /// the integer representation of enums.
33142 pub fn name(&self) -> std::option::Option<&str> {
33143 match self {
33144 Self::Unspecified => {
33145 std::option::Option::Some("EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED")
33146 }
33147 Self::Min => std::option::Option::Some("MIN"),
33148 Self::Optimal => std::option::Option::Some("OPTIMAL"),
33149 Self::Max => std::option::Option::Some("MAX"),
33150 Self::UnknownValue(u) => u.0.name(),
33151 }
33152 }
33153}
33154
33155impl std::default::Default for ExternalSyncParallelLevel {
33156 fn default() -> Self {
33157 use std::convert::From;
33158 Self::from(0)
33159 }
33160}
33161
33162impl std::fmt::Display for ExternalSyncParallelLevel {
33163 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33164 wkt::internal::display_enum(f, self.name(), self.value())
33165 }
33166}
33167
33168impl std::convert::From<i32> for ExternalSyncParallelLevel {
33169 fn from(value: i32) -> Self {
33170 match value {
33171 0 => Self::Unspecified,
33172 1 => Self::Min,
33173 2 => Self::Optimal,
33174 3 => Self::Max,
33175 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33176 wkt::internal::UnknownEnumValue::Integer(value),
33177 )),
33178 }
33179 }
33180}
33181
33182impl std::convert::From<&str> for ExternalSyncParallelLevel {
33183 fn from(value: &str) -> Self {
33184 use std::string::ToString;
33185 match value {
33186 "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" => Self::Unspecified,
33187 "MIN" => Self::Min,
33188 "OPTIMAL" => Self::Optimal,
33189 "MAX" => Self::Max,
33190 _ => Self::UnknownValue(external_sync_parallel_level::UnknownValue(
33191 wkt::internal::UnknownEnumValue::String(value.to_string()),
33192 )),
33193 }
33194 }
33195}
33196
33197impl serde::ser::Serialize for ExternalSyncParallelLevel {
33198 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33199 where
33200 S: serde::Serializer,
33201 {
33202 match self {
33203 Self::Unspecified => serializer.serialize_i32(0),
33204 Self::Min => serializer.serialize_i32(1),
33205 Self::Optimal => serializer.serialize_i32(2),
33206 Self::Max => serializer.serialize_i32(3),
33207 Self::UnknownValue(u) => u.0.serialize(serializer),
33208 }
33209 }
33210}
33211
33212impl<'de> serde::de::Deserialize<'de> for ExternalSyncParallelLevel {
33213 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33214 where
33215 D: serde::Deserializer<'de>,
33216 {
33217 deserializer.deserialize_any(
33218 wkt::internal::EnumVisitor::<ExternalSyncParallelLevel>::new(
33219 ".google.cloud.sql.v1.ExternalSyncParallelLevel",
33220 ),
33221 )
33222 }
33223}
33224
33225///
33226/// # Working with unknown values
33227///
33228/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33229/// additional enum variants at any time. Adding new variants is not considered
33230/// a breaking change. Applications should write their code in anticipation of:
33231///
33232/// - New values appearing in future releases of the client library, **and**
33233/// - New values received dynamically, without application changes.
33234///
33235/// Please consult the [Working with enums] section in the user guide for some
33236/// guidelines.
33237///
33238/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33239#[derive(Clone, Debug, PartialEq)]
33240#[non_exhaustive]
33241pub enum SqlInstanceType {
33242 /// This is an unknown Cloud SQL instance type.
33243 Unspecified,
33244 /// A regular Cloud SQL instance that is not replicating from a primary
33245 /// instance.
33246 CloudSqlInstance,
33247 /// An instance running on the customer's premises that is not managed by
33248 /// Cloud SQL.
33249 OnPremisesInstance,
33250 /// A Cloud SQL instance acting as a read-replica.
33251 ReadReplicaInstance,
33252 /// A Cloud SQL read pool.
33253 ReadPoolInstance,
33254 /// If set, the enum was initialized with an unknown value.
33255 ///
33256 /// Applications can examine the value using [SqlInstanceType::value] or
33257 /// [SqlInstanceType::name].
33258 UnknownValue(sql_instance_type::UnknownValue),
33259}
33260
33261#[doc(hidden)]
33262pub mod sql_instance_type {
33263 #[allow(unused_imports)]
33264 use super::*;
33265 #[derive(Clone, Debug, PartialEq)]
33266 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33267}
33268
33269impl SqlInstanceType {
33270 /// Gets the enum value.
33271 ///
33272 /// Returns `None` if the enum contains an unknown value deserialized from
33273 /// the string representation of enums.
33274 pub fn value(&self) -> std::option::Option<i32> {
33275 match self {
33276 Self::Unspecified => std::option::Option::Some(0),
33277 Self::CloudSqlInstance => std::option::Option::Some(1),
33278 Self::OnPremisesInstance => std::option::Option::Some(2),
33279 Self::ReadReplicaInstance => std::option::Option::Some(3),
33280 Self::ReadPoolInstance => std::option::Option::Some(5),
33281 Self::UnknownValue(u) => u.0.value(),
33282 }
33283 }
33284
33285 /// Gets the enum value as a string.
33286 ///
33287 /// Returns `None` if the enum contains an unknown value deserialized from
33288 /// the integer representation of enums.
33289 pub fn name(&self) -> std::option::Option<&str> {
33290 match self {
33291 Self::Unspecified => std::option::Option::Some("SQL_INSTANCE_TYPE_UNSPECIFIED"),
33292 Self::CloudSqlInstance => std::option::Option::Some("CLOUD_SQL_INSTANCE"),
33293 Self::OnPremisesInstance => std::option::Option::Some("ON_PREMISES_INSTANCE"),
33294 Self::ReadReplicaInstance => std::option::Option::Some("READ_REPLICA_INSTANCE"),
33295 Self::ReadPoolInstance => std::option::Option::Some("READ_POOL_INSTANCE"),
33296 Self::UnknownValue(u) => u.0.name(),
33297 }
33298 }
33299}
33300
33301impl std::default::Default for SqlInstanceType {
33302 fn default() -> Self {
33303 use std::convert::From;
33304 Self::from(0)
33305 }
33306}
33307
33308impl std::fmt::Display for SqlInstanceType {
33309 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33310 wkt::internal::display_enum(f, self.name(), self.value())
33311 }
33312}
33313
33314impl std::convert::From<i32> for SqlInstanceType {
33315 fn from(value: i32) -> Self {
33316 match value {
33317 0 => Self::Unspecified,
33318 1 => Self::CloudSqlInstance,
33319 2 => Self::OnPremisesInstance,
33320 3 => Self::ReadReplicaInstance,
33321 5 => Self::ReadPoolInstance,
33322 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33323 wkt::internal::UnknownEnumValue::Integer(value),
33324 )),
33325 }
33326 }
33327}
33328
33329impl std::convert::From<&str> for SqlInstanceType {
33330 fn from(value: &str) -> Self {
33331 use std::string::ToString;
33332 match value {
33333 "SQL_INSTANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33334 "CLOUD_SQL_INSTANCE" => Self::CloudSqlInstance,
33335 "ON_PREMISES_INSTANCE" => Self::OnPremisesInstance,
33336 "READ_REPLICA_INSTANCE" => Self::ReadReplicaInstance,
33337 "READ_POOL_INSTANCE" => Self::ReadPoolInstance,
33338 _ => Self::UnknownValue(sql_instance_type::UnknownValue(
33339 wkt::internal::UnknownEnumValue::String(value.to_string()),
33340 )),
33341 }
33342 }
33343}
33344
33345impl serde::ser::Serialize for SqlInstanceType {
33346 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33347 where
33348 S: serde::Serializer,
33349 {
33350 match self {
33351 Self::Unspecified => serializer.serialize_i32(0),
33352 Self::CloudSqlInstance => serializer.serialize_i32(1),
33353 Self::OnPremisesInstance => serializer.serialize_i32(2),
33354 Self::ReadReplicaInstance => serializer.serialize_i32(3),
33355 Self::ReadPoolInstance => serializer.serialize_i32(5),
33356 Self::UnknownValue(u) => u.0.serialize(serializer),
33357 }
33358 }
33359}
33360
33361impl<'de> serde::de::Deserialize<'de> for SqlInstanceType {
33362 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33363 where
33364 D: serde::Deserializer<'de>,
33365 {
33366 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlInstanceType>::new(
33367 ".google.cloud.sql.v1.SqlInstanceType",
33368 ))
33369 }
33370}
33371
33372/// The suspension reason of the database instance if the state is SUSPENDED.
33373///
33374/// # Working with unknown values
33375///
33376/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33377/// additional enum variants at any time. Adding new variants is not considered
33378/// a breaking change. Applications should write their code in anticipation of:
33379///
33380/// - New values appearing in future releases of the client library, **and**
33381/// - New values received dynamically, without application changes.
33382///
33383/// Please consult the [Working with enums] section in the user guide for some
33384/// guidelines.
33385///
33386/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33387#[derive(Clone, Debug, PartialEq)]
33388#[non_exhaustive]
33389pub enum SqlSuspensionReason {
33390 /// This is an unknown suspension reason.
33391 Unspecified,
33392 /// The instance is suspended due to billing issues (for example:, account
33393 /// issue)
33394 BillingIssue,
33395 /// The instance is suspended due to illegal content (for example:, child
33396 /// pornography, copyrighted material, etc.).
33397 LegalIssue,
33398 /// The instance is causing operational issues (for example:, causing the
33399 /// database to crash).
33400 OperationalIssue,
33401 /// The KMS key used by the instance is either revoked or denied access to
33402 KmsKeyIssue,
33403 /// If set, the enum was initialized with an unknown value.
33404 ///
33405 /// Applications can examine the value using [SqlSuspensionReason::value] or
33406 /// [SqlSuspensionReason::name].
33407 UnknownValue(sql_suspension_reason::UnknownValue),
33408}
33409
33410#[doc(hidden)]
33411pub mod sql_suspension_reason {
33412 #[allow(unused_imports)]
33413 use super::*;
33414 #[derive(Clone, Debug, PartialEq)]
33415 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33416}
33417
33418impl SqlSuspensionReason {
33419 /// Gets the enum value.
33420 ///
33421 /// Returns `None` if the enum contains an unknown value deserialized from
33422 /// the string representation of enums.
33423 pub fn value(&self) -> std::option::Option<i32> {
33424 match self {
33425 Self::Unspecified => std::option::Option::Some(0),
33426 Self::BillingIssue => std::option::Option::Some(2),
33427 Self::LegalIssue => std::option::Option::Some(3),
33428 Self::OperationalIssue => std::option::Option::Some(4),
33429 Self::KmsKeyIssue => std::option::Option::Some(5),
33430 Self::UnknownValue(u) => u.0.value(),
33431 }
33432 }
33433
33434 /// Gets the enum value as a string.
33435 ///
33436 /// Returns `None` if the enum contains an unknown value deserialized from
33437 /// the integer representation of enums.
33438 pub fn name(&self) -> std::option::Option<&str> {
33439 match self {
33440 Self::Unspecified => std::option::Option::Some("SQL_SUSPENSION_REASON_UNSPECIFIED"),
33441 Self::BillingIssue => std::option::Option::Some("BILLING_ISSUE"),
33442 Self::LegalIssue => std::option::Option::Some("LEGAL_ISSUE"),
33443 Self::OperationalIssue => std::option::Option::Some("OPERATIONAL_ISSUE"),
33444 Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
33445 Self::UnknownValue(u) => u.0.name(),
33446 }
33447 }
33448}
33449
33450impl std::default::Default for SqlSuspensionReason {
33451 fn default() -> Self {
33452 use std::convert::From;
33453 Self::from(0)
33454 }
33455}
33456
33457impl std::fmt::Display for SqlSuspensionReason {
33458 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33459 wkt::internal::display_enum(f, self.name(), self.value())
33460 }
33461}
33462
33463impl std::convert::From<i32> for SqlSuspensionReason {
33464 fn from(value: i32) -> Self {
33465 match value {
33466 0 => Self::Unspecified,
33467 2 => Self::BillingIssue,
33468 3 => Self::LegalIssue,
33469 4 => Self::OperationalIssue,
33470 5 => Self::KmsKeyIssue,
33471 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33472 wkt::internal::UnknownEnumValue::Integer(value),
33473 )),
33474 }
33475 }
33476}
33477
33478impl std::convert::From<&str> for SqlSuspensionReason {
33479 fn from(value: &str) -> Self {
33480 use std::string::ToString;
33481 match value {
33482 "SQL_SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
33483 "BILLING_ISSUE" => Self::BillingIssue,
33484 "LEGAL_ISSUE" => Self::LegalIssue,
33485 "OPERATIONAL_ISSUE" => Self::OperationalIssue,
33486 "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
33487 _ => Self::UnknownValue(sql_suspension_reason::UnknownValue(
33488 wkt::internal::UnknownEnumValue::String(value.to_string()),
33489 )),
33490 }
33491 }
33492}
33493
33494impl serde::ser::Serialize for SqlSuspensionReason {
33495 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33496 where
33497 S: serde::Serializer,
33498 {
33499 match self {
33500 Self::Unspecified => serializer.serialize_i32(0),
33501 Self::BillingIssue => serializer.serialize_i32(2),
33502 Self::LegalIssue => serializer.serialize_i32(3),
33503 Self::OperationalIssue => serializer.serialize_i32(4),
33504 Self::KmsKeyIssue => serializer.serialize_i32(5),
33505 Self::UnknownValue(u) => u.0.serialize(serializer),
33506 }
33507 }
33508}
33509
33510impl<'de> serde::de::Deserialize<'de> for SqlSuspensionReason {
33511 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33512 where
33513 D: serde::Deserializer<'de>,
33514 {
33515 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlSuspensionReason>::new(
33516 ".google.cloud.sql.v1.SqlSuspensionReason",
33517 ))
33518 }
33519}
33520
33521///
33522/// # Working with unknown values
33523///
33524/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33525/// additional enum variants at any time. Adding new variants is not considered
33526/// a breaking change. Applications should write their code in anticipation of:
33527///
33528/// - New values appearing in future releases of the client library, **and**
33529/// - New values received dynamically, without application changes.
33530///
33531/// Please consult the [Working with enums] section in the user guide for some
33532/// guidelines.
33533///
33534/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33535#[derive(Clone, Debug, PartialEq)]
33536#[non_exhaustive]
33537pub enum SqlFileType {
33538 /// Unknown file type.
33539 Unspecified,
33540 /// File containing SQL statements.
33541 Sql,
33542 /// File in CSV format.
33543 Csv,
33544 Bak,
33545 /// TDE certificate.
33546 Tde,
33547 /// If set, the enum was initialized with an unknown value.
33548 ///
33549 /// Applications can examine the value using [SqlFileType::value] or
33550 /// [SqlFileType::name].
33551 UnknownValue(sql_file_type::UnknownValue),
33552}
33553
33554#[doc(hidden)]
33555pub mod sql_file_type {
33556 #[allow(unused_imports)]
33557 use super::*;
33558 #[derive(Clone, Debug, PartialEq)]
33559 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33560}
33561
33562impl SqlFileType {
33563 /// Gets the enum value.
33564 ///
33565 /// Returns `None` if the enum contains an unknown value deserialized from
33566 /// the string representation of enums.
33567 pub fn value(&self) -> std::option::Option<i32> {
33568 match self {
33569 Self::Unspecified => std::option::Option::Some(0),
33570 Self::Sql => std::option::Option::Some(1),
33571 Self::Csv => std::option::Option::Some(2),
33572 Self::Bak => std::option::Option::Some(4),
33573 Self::Tde => std::option::Option::Some(8),
33574 Self::UnknownValue(u) => u.0.value(),
33575 }
33576 }
33577
33578 /// Gets the enum value as a string.
33579 ///
33580 /// Returns `None` if the enum contains an unknown value deserialized from
33581 /// the integer representation of enums.
33582 pub fn name(&self) -> std::option::Option<&str> {
33583 match self {
33584 Self::Unspecified => std::option::Option::Some("SQL_FILE_TYPE_UNSPECIFIED"),
33585 Self::Sql => std::option::Option::Some("SQL"),
33586 Self::Csv => std::option::Option::Some("CSV"),
33587 Self::Bak => std::option::Option::Some("BAK"),
33588 Self::Tde => std::option::Option::Some("TDE"),
33589 Self::UnknownValue(u) => u.0.name(),
33590 }
33591 }
33592}
33593
33594impl std::default::Default for SqlFileType {
33595 fn default() -> Self {
33596 use std::convert::From;
33597 Self::from(0)
33598 }
33599}
33600
33601impl std::fmt::Display for SqlFileType {
33602 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33603 wkt::internal::display_enum(f, self.name(), self.value())
33604 }
33605}
33606
33607impl std::convert::From<i32> for SqlFileType {
33608 fn from(value: i32) -> Self {
33609 match value {
33610 0 => Self::Unspecified,
33611 1 => Self::Sql,
33612 2 => Self::Csv,
33613 4 => Self::Bak,
33614 8 => Self::Tde,
33615 _ => Self::UnknownValue(sql_file_type::UnknownValue(
33616 wkt::internal::UnknownEnumValue::Integer(value),
33617 )),
33618 }
33619 }
33620}
33621
33622impl std::convert::From<&str> for SqlFileType {
33623 fn from(value: &str) -> Self {
33624 use std::string::ToString;
33625 match value {
33626 "SQL_FILE_TYPE_UNSPECIFIED" => Self::Unspecified,
33627 "SQL" => Self::Sql,
33628 "CSV" => Self::Csv,
33629 "BAK" => Self::Bak,
33630 "TDE" => Self::Tde,
33631 _ => Self::UnknownValue(sql_file_type::UnknownValue(
33632 wkt::internal::UnknownEnumValue::String(value.to_string()),
33633 )),
33634 }
33635 }
33636}
33637
33638impl serde::ser::Serialize for SqlFileType {
33639 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33640 where
33641 S: serde::Serializer,
33642 {
33643 match self {
33644 Self::Unspecified => serializer.serialize_i32(0),
33645 Self::Sql => serializer.serialize_i32(1),
33646 Self::Csv => serializer.serialize_i32(2),
33647 Self::Bak => serializer.serialize_i32(4),
33648 Self::Tde => serializer.serialize_i32(8),
33649 Self::UnknownValue(u) => u.0.serialize(serializer),
33650 }
33651 }
33652}
33653
33654impl<'de> serde::de::Deserialize<'de> for SqlFileType {
33655 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33656 where
33657 D: serde::Deserializer<'de>,
33658 {
33659 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlFileType>::new(
33660 ".google.cloud.sql.v1.SqlFileType",
33661 ))
33662 }
33663}
33664
33665///
33666/// # Working with unknown values
33667///
33668/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33669/// additional enum variants at any time. Adding new variants is not considered
33670/// a breaking change. Applications should write their code in anticipation of:
33671///
33672/// - New values appearing in future releases of the client library, **and**
33673/// - New values received dynamically, without application changes.
33674///
33675/// Please consult the [Working with enums] section in the user guide for some
33676/// guidelines.
33677///
33678/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33679#[derive(Clone, Debug, PartialEq)]
33680#[non_exhaustive]
33681pub enum BakType {
33682 /// Default type.
33683 Unspecified,
33684 /// Full backup.
33685 Full,
33686 /// Differential backup.
33687 Diff,
33688 /// Transaction Log backup
33689 Tlog,
33690 /// If set, the enum was initialized with an unknown value.
33691 ///
33692 /// Applications can examine the value using [BakType::value] or
33693 /// [BakType::name].
33694 UnknownValue(bak_type::UnknownValue),
33695}
33696
33697#[doc(hidden)]
33698pub mod bak_type {
33699 #[allow(unused_imports)]
33700 use super::*;
33701 #[derive(Clone, Debug, PartialEq)]
33702 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33703}
33704
33705impl BakType {
33706 /// Gets the enum value.
33707 ///
33708 /// Returns `None` if the enum contains an unknown value deserialized from
33709 /// the string representation of enums.
33710 pub fn value(&self) -> std::option::Option<i32> {
33711 match self {
33712 Self::Unspecified => std::option::Option::Some(0),
33713 Self::Full => std::option::Option::Some(1),
33714 Self::Diff => std::option::Option::Some(2),
33715 Self::Tlog => std::option::Option::Some(3),
33716 Self::UnknownValue(u) => u.0.value(),
33717 }
33718 }
33719
33720 /// Gets the enum value as a string.
33721 ///
33722 /// Returns `None` if the enum contains an unknown value deserialized from
33723 /// the integer representation of enums.
33724 pub fn name(&self) -> std::option::Option<&str> {
33725 match self {
33726 Self::Unspecified => std::option::Option::Some("BAK_TYPE_UNSPECIFIED"),
33727 Self::Full => std::option::Option::Some("FULL"),
33728 Self::Diff => std::option::Option::Some("DIFF"),
33729 Self::Tlog => std::option::Option::Some("TLOG"),
33730 Self::UnknownValue(u) => u.0.name(),
33731 }
33732 }
33733}
33734
33735impl std::default::Default for BakType {
33736 fn default() -> Self {
33737 use std::convert::From;
33738 Self::from(0)
33739 }
33740}
33741
33742impl std::fmt::Display for BakType {
33743 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33744 wkt::internal::display_enum(f, self.name(), self.value())
33745 }
33746}
33747
33748impl std::convert::From<i32> for BakType {
33749 fn from(value: i32) -> Self {
33750 match value {
33751 0 => Self::Unspecified,
33752 1 => Self::Full,
33753 2 => Self::Diff,
33754 3 => Self::Tlog,
33755 _ => Self::UnknownValue(bak_type::UnknownValue(
33756 wkt::internal::UnknownEnumValue::Integer(value),
33757 )),
33758 }
33759 }
33760}
33761
33762impl std::convert::From<&str> for BakType {
33763 fn from(value: &str) -> Self {
33764 use std::string::ToString;
33765 match value {
33766 "BAK_TYPE_UNSPECIFIED" => Self::Unspecified,
33767 "FULL" => Self::Full,
33768 "DIFF" => Self::Diff,
33769 "TLOG" => Self::Tlog,
33770 _ => Self::UnknownValue(bak_type::UnknownValue(
33771 wkt::internal::UnknownEnumValue::String(value.to_string()),
33772 )),
33773 }
33774 }
33775}
33776
33777impl serde::ser::Serialize for BakType {
33778 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33779 where
33780 S: serde::Serializer,
33781 {
33782 match self {
33783 Self::Unspecified => serializer.serialize_i32(0),
33784 Self::Full => serializer.serialize_i32(1),
33785 Self::Diff => serializer.serialize_i32(2),
33786 Self::Tlog => serializer.serialize_i32(3),
33787 Self::UnknownValue(u) => u.0.serialize(serializer),
33788 }
33789 }
33790}
33791
33792impl<'de> serde::de::Deserialize<'de> for BakType {
33793 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33794 where
33795 D: serde::Deserializer<'de>,
33796 {
33797 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BakType>::new(
33798 ".google.cloud.sql.v1.BakType",
33799 ))
33800 }
33801}
33802
33803/// The type of maintenance to be performed on the instance.
33804///
33805/// # Working with unknown values
33806///
33807/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33808/// additional enum variants at any time. Adding new variants is not considered
33809/// a breaking change. Applications should write their code in anticipation of:
33810///
33811/// - New values appearing in future releases of the client library, **and**
33812/// - New values received dynamically, without application changes.
33813///
33814/// Please consult the [Working with enums] section in the user guide for some
33815/// guidelines.
33816///
33817/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33818#[derive(Clone, Debug, PartialEq)]
33819#[non_exhaustive]
33820pub enum SqlMaintenanceType {
33821 /// Maintenance type is unspecified.
33822 Unspecified,
33823 /// Indicates that a standalone instance is undergoing maintenance. The
33824 /// instance can be either a primary instance or a replica.
33825 InstanceMaintenance,
33826 /// Indicates that the primary instance and all of its replicas, including
33827 /// cascading replicas, are undergoing maintenance. Maintenance is performed on
33828 /// groups of replicas first, followed by the primary instance.
33829 ReplicaIncludedMaintenance,
33830 /// Indicates that the standalone instance is undergoing maintenance, initiated
33831 /// by self-service. The instance can be either a primary instance or a
33832 /// replica.
33833 InstanceSelfServiceMaintenance,
33834 /// Indicates that the primary instance and all of its replicas are undergoing
33835 /// maintenance, initiated by self-service. Maintenance is performed on groups
33836 /// of replicas first, followed by the primary instance.
33837 ReplicaIncludedSelfServiceMaintenance,
33838 /// If set, the enum was initialized with an unknown value.
33839 ///
33840 /// Applications can examine the value using [SqlMaintenanceType::value] or
33841 /// [SqlMaintenanceType::name].
33842 UnknownValue(sql_maintenance_type::UnknownValue),
33843}
33844
33845#[doc(hidden)]
33846pub mod sql_maintenance_type {
33847 #[allow(unused_imports)]
33848 use super::*;
33849 #[derive(Clone, Debug, PartialEq)]
33850 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
33851}
33852
33853impl SqlMaintenanceType {
33854 /// Gets the enum value.
33855 ///
33856 /// Returns `None` if the enum contains an unknown value deserialized from
33857 /// the string representation of enums.
33858 pub fn value(&self) -> std::option::Option<i32> {
33859 match self {
33860 Self::Unspecified => std::option::Option::Some(0),
33861 Self::InstanceMaintenance => std::option::Option::Some(1),
33862 Self::ReplicaIncludedMaintenance => std::option::Option::Some(2),
33863 Self::InstanceSelfServiceMaintenance => std::option::Option::Some(3),
33864 Self::ReplicaIncludedSelfServiceMaintenance => std::option::Option::Some(4),
33865 Self::UnknownValue(u) => u.0.value(),
33866 }
33867 }
33868
33869 /// Gets the enum value as a string.
33870 ///
33871 /// Returns `None` if the enum contains an unknown value deserialized from
33872 /// the integer representation of enums.
33873 pub fn name(&self) -> std::option::Option<&str> {
33874 match self {
33875 Self::Unspecified => std::option::Option::Some("SQL_MAINTENANCE_TYPE_UNSPECIFIED"),
33876 Self::InstanceMaintenance => std::option::Option::Some("INSTANCE_MAINTENANCE"),
33877 Self::ReplicaIncludedMaintenance => {
33878 std::option::Option::Some("REPLICA_INCLUDED_MAINTENANCE")
33879 }
33880 Self::InstanceSelfServiceMaintenance => {
33881 std::option::Option::Some("INSTANCE_SELF_SERVICE_MAINTENANCE")
33882 }
33883 Self::ReplicaIncludedSelfServiceMaintenance => {
33884 std::option::Option::Some("REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE")
33885 }
33886 Self::UnknownValue(u) => u.0.name(),
33887 }
33888 }
33889}
33890
33891impl std::default::Default for SqlMaintenanceType {
33892 fn default() -> Self {
33893 use std::convert::From;
33894 Self::from(0)
33895 }
33896}
33897
33898impl std::fmt::Display for SqlMaintenanceType {
33899 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
33900 wkt::internal::display_enum(f, self.name(), self.value())
33901 }
33902}
33903
33904impl std::convert::From<i32> for SqlMaintenanceType {
33905 fn from(value: i32) -> Self {
33906 match value {
33907 0 => Self::Unspecified,
33908 1 => Self::InstanceMaintenance,
33909 2 => Self::ReplicaIncludedMaintenance,
33910 3 => Self::InstanceSelfServiceMaintenance,
33911 4 => Self::ReplicaIncludedSelfServiceMaintenance,
33912 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
33913 wkt::internal::UnknownEnumValue::Integer(value),
33914 )),
33915 }
33916 }
33917}
33918
33919impl std::convert::From<&str> for SqlMaintenanceType {
33920 fn from(value: &str) -> Self {
33921 use std::string::ToString;
33922 match value {
33923 "SQL_MAINTENANCE_TYPE_UNSPECIFIED" => Self::Unspecified,
33924 "INSTANCE_MAINTENANCE" => Self::InstanceMaintenance,
33925 "REPLICA_INCLUDED_MAINTENANCE" => Self::ReplicaIncludedMaintenance,
33926 "INSTANCE_SELF_SERVICE_MAINTENANCE" => Self::InstanceSelfServiceMaintenance,
33927 "REPLICA_INCLUDED_SELF_SERVICE_MAINTENANCE" => {
33928 Self::ReplicaIncludedSelfServiceMaintenance
33929 }
33930 _ => Self::UnknownValue(sql_maintenance_type::UnknownValue(
33931 wkt::internal::UnknownEnumValue::String(value.to_string()),
33932 )),
33933 }
33934 }
33935}
33936
33937impl serde::ser::Serialize for SqlMaintenanceType {
33938 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
33939 where
33940 S: serde::Serializer,
33941 {
33942 match self {
33943 Self::Unspecified => serializer.serialize_i32(0),
33944 Self::InstanceMaintenance => serializer.serialize_i32(1),
33945 Self::ReplicaIncludedMaintenance => serializer.serialize_i32(2),
33946 Self::InstanceSelfServiceMaintenance => serializer.serialize_i32(3),
33947 Self::ReplicaIncludedSelfServiceMaintenance => serializer.serialize_i32(4),
33948 Self::UnknownValue(u) => u.0.serialize(serializer),
33949 }
33950 }
33951}
33952
33953impl<'de> serde::de::Deserialize<'de> for SqlMaintenanceType {
33954 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
33955 where
33956 D: serde::Deserializer<'de>,
33957 {
33958 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlMaintenanceType>::new(
33959 ".google.cloud.sql.v1.SqlMaintenanceType",
33960 ))
33961 }
33962}
33963
33964///
33965/// # Working with unknown values
33966///
33967/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
33968/// additional enum variants at any time. Adding new variants is not considered
33969/// a breaking change. Applications should write their code in anticipation of:
33970///
33971/// - New values appearing in future releases of the client library, **and**
33972/// - New values received dynamically, without application changes.
33973///
33974/// Please consult the [Working with enums] section in the user guide for some
33975/// guidelines.
33976///
33977/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
33978#[derive(Clone, Debug, PartialEq)]
33979#[non_exhaustive]
33980pub enum SqlBackendType {
33981 /// This is an unknown backend type for instance.
33982 Unspecified,
33983 /// V1 speckle instance.
33984 #[deprecated]
33985 FirstGen,
33986 /// V2 speckle instance.
33987 SecondGen,
33988 /// On premises instance.
33989 External,
33990 /// If set, the enum was initialized with an unknown value.
33991 ///
33992 /// Applications can examine the value using [SqlBackendType::value] or
33993 /// [SqlBackendType::name].
33994 UnknownValue(sql_backend_type::UnknownValue),
33995}
33996
33997#[doc(hidden)]
33998pub mod sql_backend_type {
33999 #[allow(unused_imports)]
34000 use super::*;
34001 #[derive(Clone, Debug, PartialEq)]
34002 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34003}
34004
34005impl SqlBackendType {
34006 /// Gets the enum value.
34007 ///
34008 /// Returns `None` if the enum contains an unknown value deserialized from
34009 /// the string representation of enums.
34010 pub fn value(&self) -> std::option::Option<i32> {
34011 match self {
34012 Self::Unspecified => std::option::Option::Some(0),
34013 Self::FirstGen => std::option::Option::Some(1),
34014 Self::SecondGen => std::option::Option::Some(2),
34015 Self::External => std::option::Option::Some(3),
34016 Self::UnknownValue(u) => u.0.value(),
34017 }
34018 }
34019
34020 /// Gets the enum value as a string.
34021 ///
34022 /// Returns `None` if the enum contains an unknown value deserialized from
34023 /// the integer representation of enums.
34024 pub fn name(&self) -> std::option::Option<&str> {
34025 match self {
34026 Self::Unspecified => std::option::Option::Some("SQL_BACKEND_TYPE_UNSPECIFIED"),
34027 Self::FirstGen => std::option::Option::Some("FIRST_GEN"),
34028 Self::SecondGen => std::option::Option::Some("SECOND_GEN"),
34029 Self::External => std::option::Option::Some("EXTERNAL"),
34030 Self::UnknownValue(u) => u.0.name(),
34031 }
34032 }
34033}
34034
34035impl std::default::Default for SqlBackendType {
34036 fn default() -> Self {
34037 use std::convert::From;
34038 Self::from(0)
34039 }
34040}
34041
34042impl std::fmt::Display for SqlBackendType {
34043 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34044 wkt::internal::display_enum(f, self.name(), self.value())
34045 }
34046}
34047
34048impl std::convert::From<i32> for SqlBackendType {
34049 fn from(value: i32) -> Self {
34050 match value {
34051 0 => Self::Unspecified,
34052 1 => Self::FirstGen,
34053 2 => Self::SecondGen,
34054 3 => Self::External,
34055 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34056 wkt::internal::UnknownEnumValue::Integer(value),
34057 )),
34058 }
34059 }
34060}
34061
34062impl std::convert::From<&str> for SqlBackendType {
34063 fn from(value: &str) -> Self {
34064 use std::string::ToString;
34065 match value {
34066 "SQL_BACKEND_TYPE_UNSPECIFIED" => Self::Unspecified,
34067 "FIRST_GEN" => Self::FirstGen,
34068 "SECOND_GEN" => Self::SecondGen,
34069 "EXTERNAL" => Self::External,
34070 _ => Self::UnknownValue(sql_backend_type::UnknownValue(
34071 wkt::internal::UnknownEnumValue::String(value.to_string()),
34072 )),
34073 }
34074 }
34075}
34076
34077impl serde::ser::Serialize for SqlBackendType {
34078 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34079 where
34080 S: serde::Serializer,
34081 {
34082 match self {
34083 Self::Unspecified => serializer.serialize_i32(0),
34084 Self::FirstGen => serializer.serialize_i32(1),
34085 Self::SecondGen => serializer.serialize_i32(2),
34086 Self::External => serializer.serialize_i32(3),
34087 Self::UnknownValue(u) => u.0.serialize(serializer),
34088 }
34089 }
34090}
34091
34092impl<'de> serde::de::Deserialize<'de> for SqlBackendType {
34093 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34094 where
34095 D: serde::Deserializer<'de>,
34096 {
34097 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlBackendType>::new(
34098 ".google.cloud.sql.v1.SqlBackendType",
34099 ))
34100 }
34101}
34102
34103///
34104/// # Working with unknown values
34105///
34106/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34107/// additional enum variants at any time. Adding new variants is not considered
34108/// a breaking change. Applications should write their code in anticipation of:
34109///
34110/// - New values appearing in future releases of the client library, **and**
34111/// - New values received dynamically, without application changes.
34112///
34113/// Please consult the [Working with enums] section in the user guide for some
34114/// guidelines.
34115///
34116/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34117#[derive(Clone, Debug, PartialEq)]
34118#[non_exhaustive]
34119pub enum SqlIpAddressType {
34120 /// This is an unknown IP address type.
34121 Unspecified,
34122 /// IP address the customer is supposed to connect to. Usually this is the
34123 /// load balancer's IP address
34124 Primary,
34125 /// Source IP address of the connection a read replica establishes to its
34126 /// external primary instance. This IP address can be allowlisted by the
34127 /// customer in case it has a firewall that filters incoming connection to its
34128 /// on premises primary instance.
34129 Outgoing,
34130 /// Private IP used when using private IPs and network peering.
34131 Private,
34132 /// V1 IP of a migrated instance. We want the user to
34133 /// decommission this IP as soon as the migration is complete.
34134 /// Note: V1 instances with V1 ip addresses will be counted as PRIMARY.
34135 Migrated1StGen,
34136 /// If set, the enum was initialized with an unknown value.
34137 ///
34138 /// Applications can examine the value using [SqlIpAddressType::value] or
34139 /// [SqlIpAddressType::name].
34140 UnknownValue(sql_ip_address_type::UnknownValue),
34141}
34142
34143#[doc(hidden)]
34144pub mod sql_ip_address_type {
34145 #[allow(unused_imports)]
34146 use super::*;
34147 #[derive(Clone, Debug, PartialEq)]
34148 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34149}
34150
34151impl SqlIpAddressType {
34152 /// Gets the enum value.
34153 ///
34154 /// Returns `None` if the enum contains an unknown value deserialized from
34155 /// the string representation of enums.
34156 pub fn value(&self) -> std::option::Option<i32> {
34157 match self {
34158 Self::Unspecified => std::option::Option::Some(0),
34159 Self::Primary => std::option::Option::Some(1),
34160 Self::Outgoing => std::option::Option::Some(2),
34161 Self::Private => std::option::Option::Some(3),
34162 Self::Migrated1StGen => std::option::Option::Some(4),
34163 Self::UnknownValue(u) => u.0.value(),
34164 }
34165 }
34166
34167 /// Gets the enum value as a string.
34168 ///
34169 /// Returns `None` if the enum contains an unknown value deserialized from
34170 /// the integer representation of enums.
34171 pub fn name(&self) -> std::option::Option<&str> {
34172 match self {
34173 Self::Unspecified => std::option::Option::Some("SQL_IP_ADDRESS_TYPE_UNSPECIFIED"),
34174 Self::Primary => std::option::Option::Some("PRIMARY"),
34175 Self::Outgoing => std::option::Option::Some("OUTGOING"),
34176 Self::Private => std::option::Option::Some("PRIVATE"),
34177 Self::Migrated1StGen => std::option::Option::Some("MIGRATED_1ST_GEN"),
34178 Self::UnknownValue(u) => u.0.name(),
34179 }
34180 }
34181}
34182
34183impl std::default::Default for SqlIpAddressType {
34184 fn default() -> Self {
34185 use std::convert::From;
34186 Self::from(0)
34187 }
34188}
34189
34190impl std::fmt::Display for SqlIpAddressType {
34191 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34192 wkt::internal::display_enum(f, self.name(), self.value())
34193 }
34194}
34195
34196impl std::convert::From<i32> for SqlIpAddressType {
34197 fn from(value: i32) -> Self {
34198 match value {
34199 0 => Self::Unspecified,
34200 1 => Self::Primary,
34201 2 => Self::Outgoing,
34202 3 => Self::Private,
34203 4 => Self::Migrated1StGen,
34204 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34205 wkt::internal::UnknownEnumValue::Integer(value),
34206 )),
34207 }
34208 }
34209}
34210
34211impl std::convert::From<&str> for SqlIpAddressType {
34212 fn from(value: &str) -> Self {
34213 use std::string::ToString;
34214 match value {
34215 "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" => Self::Unspecified,
34216 "PRIMARY" => Self::Primary,
34217 "OUTGOING" => Self::Outgoing,
34218 "PRIVATE" => Self::Private,
34219 "MIGRATED_1ST_GEN" => Self::Migrated1StGen,
34220 _ => Self::UnknownValue(sql_ip_address_type::UnknownValue(
34221 wkt::internal::UnknownEnumValue::String(value.to_string()),
34222 )),
34223 }
34224 }
34225}
34226
34227impl serde::ser::Serialize for SqlIpAddressType {
34228 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34229 where
34230 S: serde::Serializer,
34231 {
34232 match self {
34233 Self::Unspecified => serializer.serialize_i32(0),
34234 Self::Primary => serializer.serialize_i32(1),
34235 Self::Outgoing => serializer.serialize_i32(2),
34236 Self::Private => serializer.serialize_i32(3),
34237 Self::Migrated1StGen => serializer.serialize_i32(4),
34238 Self::UnknownValue(u) => u.0.serialize(serializer),
34239 }
34240 }
34241}
34242
34243impl<'de> serde::de::Deserialize<'de> for SqlIpAddressType {
34244 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34245 where
34246 D: serde::Deserializer<'de>,
34247 {
34248 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlIpAddressType>::new(
34249 ".google.cloud.sql.v1.SqlIpAddressType",
34250 ))
34251 }
34252}
34253
34254/// The database engine type and version.
34255///
34256/// # Working with unknown values
34257///
34258/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34259/// additional enum variants at any time. Adding new variants is not considered
34260/// a breaking change. Applications should write their code in anticipation of:
34261///
34262/// - New values appearing in future releases of the client library, **and**
34263/// - New values received dynamically, without application changes.
34264///
34265/// Please consult the [Working with enums] section in the user guide for some
34266/// guidelines.
34267///
34268/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34269#[derive(Clone, Debug, PartialEq)]
34270#[non_exhaustive]
34271pub enum SqlDatabaseVersion {
34272 /// This is an unknown database version.
34273 Unspecified,
34274 /// The database version is MySQL 5.1.
34275 #[deprecated]
34276 Mysql51,
34277 /// The database version is MySQL 5.5.
34278 #[deprecated]
34279 Mysql55,
34280 /// The database version is MySQL 5.6.
34281 Mysql56,
34282 /// The database version is MySQL 5.7.
34283 Mysql57,
34284 /// The database version is MySQL 8.
34285 Mysql80,
34286 /// The database major version is MySQL 8.0 and the minor version is 18.
34287 Mysql8018,
34288 /// The database major version is MySQL 8.0 and the minor version is 26.
34289 Mysql8026,
34290 /// The database major version is MySQL 8.0 and the minor version is 27.
34291 Mysql8027,
34292 /// The database major version is MySQL 8.0 and the minor version is 28.
34293 Mysql8028,
34294 /// The database major version is MySQL 8.0 and the minor version is 29.
34295 #[deprecated]
34296 Mysql8029,
34297 /// The database major version is MySQL 8.0 and the minor version is 30.
34298 Mysql8030,
34299 /// The database major version is MySQL 8.0 and the minor version is 31.
34300 Mysql8031,
34301 /// The database major version is MySQL 8.0 and the minor version is 32.
34302 Mysql8032,
34303 /// The database major version is MySQL 8.0 and the minor version is 33.
34304 Mysql8033,
34305 /// The database major version is MySQL 8.0 and the minor version is 34.
34306 Mysql8034,
34307 /// The database major version is MySQL 8.0 and the minor version is 35.
34308 Mysql8035,
34309 /// The database major version is MySQL 8.0 and the minor version is 36.
34310 Mysql8036,
34311 /// The database major version is MySQL 8.0 and the minor version is 37.
34312 Mysql8037,
34313 /// The database major version is MySQL 8.0 and the minor version is 39.
34314 Mysql8039,
34315 /// The database major version is MySQL 8.0 and the minor version is 40.
34316 Mysql8040,
34317 /// The database major version is MySQL 8.0 and the minor version is 41.
34318 Mysql8041,
34319 /// The database major version is MySQL 8.0 and the minor version is 42.
34320 Mysql8042,
34321 /// The database major version is MySQL 8.0 and the minor version is 43.
34322 Mysql8043,
34323 /// The database major version is MySQL 8.0 and the minor version is 44.
34324 Mysql8044,
34325 /// The database major version is MySQL 8.0 and the minor version is 45.
34326 Mysql8045,
34327 /// The database major version is MySQL 8.0 and the minor version is 46.
34328 Mysql8046,
34329 /// The database version is MySQL 8.4.
34330 Mysql84,
34331 /// The database version is MySQL 9.7.
34332 Mysql97,
34333 /// The database version is SQL Server 2017 Standard.
34334 Sqlserver2017Standard,
34335 /// The database version is SQL Server 2017 Enterprise.
34336 Sqlserver2017Enterprise,
34337 /// The database version is SQL Server 2017 Express.
34338 Sqlserver2017Express,
34339 /// The database version is SQL Server 2017 Web.
34340 Sqlserver2017Web,
34341 /// The database version is PostgreSQL 9.6.
34342 Postgres96,
34343 /// The database version is PostgreSQL 10.
34344 Postgres10,
34345 /// The database version is PostgreSQL 11.
34346 Postgres11,
34347 /// The database version is PostgreSQL 12.
34348 Postgres12,
34349 /// The database version is PostgreSQL 13.
34350 Postgres13,
34351 /// The database version is PostgreSQL 14.
34352 Postgres14,
34353 /// The database version is PostgreSQL 15.
34354 Postgres15,
34355 /// The database version is PostgreSQL 16.
34356 Postgres16,
34357 /// The database version is PostgreSQL 17.
34358 Postgres17,
34359 /// The database version is PostgreSQL 18.
34360 Postgres18,
34361 /// The database version is SQL Server 2019 Standard.
34362 Sqlserver2019Standard,
34363 /// The database version is SQL Server 2019 Enterprise.
34364 Sqlserver2019Enterprise,
34365 /// The database version is SQL Server 2019 Express.
34366 Sqlserver2019Express,
34367 /// The database version is SQL Server 2019 Web.
34368 Sqlserver2019Web,
34369 /// The database version is SQL Server 2022 Standard.
34370 Sqlserver2022Standard,
34371 /// The database version is SQL Server 2022 Enterprise.
34372 Sqlserver2022Enterprise,
34373 /// The database version is SQL Server 2022 Express.
34374 Sqlserver2022Express,
34375 /// The database version is SQL Server 2022 Web.
34376 Sqlserver2022Web,
34377 /// If set, the enum was initialized with an unknown value.
34378 ///
34379 /// Applications can examine the value using [SqlDatabaseVersion::value] or
34380 /// [SqlDatabaseVersion::name].
34381 UnknownValue(sql_database_version::UnknownValue),
34382}
34383
34384#[doc(hidden)]
34385pub mod sql_database_version {
34386 #[allow(unused_imports)]
34387 use super::*;
34388 #[derive(Clone, Debug, PartialEq)]
34389 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34390}
34391
34392impl SqlDatabaseVersion {
34393 /// Gets the enum value.
34394 ///
34395 /// Returns `None` if the enum contains an unknown value deserialized from
34396 /// the string representation of enums.
34397 pub fn value(&self) -> std::option::Option<i32> {
34398 match self {
34399 Self::Unspecified => std::option::Option::Some(0),
34400 Self::Mysql51 => std::option::Option::Some(2),
34401 Self::Mysql55 => std::option::Option::Some(3),
34402 Self::Mysql56 => std::option::Option::Some(5),
34403 Self::Mysql57 => std::option::Option::Some(6),
34404 Self::Mysql80 => std::option::Option::Some(20),
34405 Self::Mysql8018 => std::option::Option::Some(41),
34406 Self::Mysql8026 => std::option::Option::Some(85),
34407 Self::Mysql8027 => std::option::Option::Some(111),
34408 Self::Mysql8028 => std::option::Option::Some(132),
34409 Self::Mysql8029 => std::option::Option::Some(148),
34410 Self::Mysql8030 => std::option::Option::Some(174),
34411 Self::Mysql8031 => std::option::Option::Some(197),
34412 Self::Mysql8032 => std::option::Option::Some(213),
34413 Self::Mysql8033 => std::option::Option::Some(238),
34414 Self::Mysql8034 => std::option::Option::Some(239),
34415 Self::Mysql8035 => std::option::Option::Some(240),
34416 Self::Mysql8036 => std::option::Option::Some(241),
34417 Self::Mysql8037 => std::option::Option::Some(355),
34418 Self::Mysql8039 => std::option::Option::Some(357),
34419 Self::Mysql8040 => std::option::Option::Some(358),
34420 Self::Mysql8041 => std::option::Option::Some(488),
34421 Self::Mysql8042 => std::option::Option::Some(489),
34422 Self::Mysql8043 => std::option::Option::Some(553),
34423 Self::Mysql8044 => std::option::Option::Some(554),
34424 Self::Mysql8045 => std::option::Option::Some(555),
34425 Self::Mysql8046 => std::option::Option::Some(556),
34426 Self::Mysql84 => std::option::Option::Some(398),
34427 Self::Mysql97 => std::option::Option::Some(654),
34428 Self::Sqlserver2017Standard => std::option::Option::Some(11),
34429 Self::Sqlserver2017Enterprise => std::option::Option::Some(14),
34430 Self::Sqlserver2017Express => std::option::Option::Some(15),
34431 Self::Sqlserver2017Web => std::option::Option::Some(16),
34432 Self::Postgres96 => std::option::Option::Some(9),
34433 Self::Postgres10 => std::option::Option::Some(18),
34434 Self::Postgres11 => std::option::Option::Some(10),
34435 Self::Postgres12 => std::option::Option::Some(19),
34436 Self::Postgres13 => std::option::Option::Some(23),
34437 Self::Postgres14 => std::option::Option::Some(110),
34438 Self::Postgres15 => std::option::Option::Some(172),
34439 Self::Postgres16 => std::option::Option::Some(272),
34440 Self::Postgres17 => std::option::Option::Some(408),
34441 Self::Postgres18 => std::option::Option::Some(557),
34442 Self::Sqlserver2019Standard => std::option::Option::Some(26),
34443 Self::Sqlserver2019Enterprise => std::option::Option::Some(27),
34444 Self::Sqlserver2019Express => std::option::Option::Some(28),
34445 Self::Sqlserver2019Web => std::option::Option::Some(29),
34446 Self::Sqlserver2022Standard => std::option::Option::Some(199),
34447 Self::Sqlserver2022Enterprise => std::option::Option::Some(200),
34448 Self::Sqlserver2022Express => std::option::Option::Some(201),
34449 Self::Sqlserver2022Web => std::option::Option::Some(202),
34450 Self::UnknownValue(u) => u.0.value(),
34451 }
34452 }
34453
34454 /// Gets the enum value as a string.
34455 ///
34456 /// Returns `None` if the enum contains an unknown value deserialized from
34457 /// the integer representation of enums.
34458 pub fn name(&self) -> std::option::Option<&str> {
34459 match self {
34460 Self::Unspecified => std::option::Option::Some("SQL_DATABASE_VERSION_UNSPECIFIED"),
34461 Self::Mysql51 => std::option::Option::Some("MYSQL_5_1"),
34462 Self::Mysql55 => std::option::Option::Some("MYSQL_5_5"),
34463 Self::Mysql56 => std::option::Option::Some("MYSQL_5_6"),
34464 Self::Mysql57 => std::option::Option::Some("MYSQL_5_7"),
34465 Self::Mysql80 => std::option::Option::Some("MYSQL_8_0"),
34466 Self::Mysql8018 => std::option::Option::Some("MYSQL_8_0_18"),
34467 Self::Mysql8026 => std::option::Option::Some("MYSQL_8_0_26"),
34468 Self::Mysql8027 => std::option::Option::Some("MYSQL_8_0_27"),
34469 Self::Mysql8028 => std::option::Option::Some("MYSQL_8_0_28"),
34470 Self::Mysql8029 => std::option::Option::Some("MYSQL_8_0_29"),
34471 Self::Mysql8030 => std::option::Option::Some("MYSQL_8_0_30"),
34472 Self::Mysql8031 => std::option::Option::Some("MYSQL_8_0_31"),
34473 Self::Mysql8032 => std::option::Option::Some("MYSQL_8_0_32"),
34474 Self::Mysql8033 => std::option::Option::Some("MYSQL_8_0_33"),
34475 Self::Mysql8034 => std::option::Option::Some("MYSQL_8_0_34"),
34476 Self::Mysql8035 => std::option::Option::Some("MYSQL_8_0_35"),
34477 Self::Mysql8036 => std::option::Option::Some("MYSQL_8_0_36"),
34478 Self::Mysql8037 => std::option::Option::Some("MYSQL_8_0_37"),
34479 Self::Mysql8039 => std::option::Option::Some("MYSQL_8_0_39"),
34480 Self::Mysql8040 => std::option::Option::Some("MYSQL_8_0_40"),
34481 Self::Mysql8041 => std::option::Option::Some("MYSQL_8_0_41"),
34482 Self::Mysql8042 => std::option::Option::Some("MYSQL_8_0_42"),
34483 Self::Mysql8043 => std::option::Option::Some("MYSQL_8_0_43"),
34484 Self::Mysql8044 => std::option::Option::Some("MYSQL_8_0_44"),
34485 Self::Mysql8045 => std::option::Option::Some("MYSQL_8_0_45"),
34486 Self::Mysql8046 => std::option::Option::Some("MYSQL_8_0_46"),
34487 Self::Mysql84 => std::option::Option::Some("MYSQL_8_4"),
34488 Self::Mysql97 => std::option::Option::Some("MYSQL_9_7"),
34489 Self::Sqlserver2017Standard => std::option::Option::Some("SQLSERVER_2017_STANDARD"),
34490 Self::Sqlserver2017Enterprise => std::option::Option::Some("SQLSERVER_2017_ENTERPRISE"),
34491 Self::Sqlserver2017Express => std::option::Option::Some("SQLSERVER_2017_EXPRESS"),
34492 Self::Sqlserver2017Web => std::option::Option::Some("SQLSERVER_2017_WEB"),
34493 Self::Postgres96 => std::option::Option::Some("POSTGRES_9_6"),
34494 Self::Postgres10 => std::option::Option::Some("POSTGRES_10"),
34495 Self::Postgres11 => std::option::Option::Some("POSTGRES_11"),
34496 Self::Postgres12 => std::option::Option::Some("POSTGRES_12"),
34497 Self::Postgres13 => std::option::Option::Some("POSTGRES_13"),
34498 Self::Postgres14 => std::option::Option::Some("POSTGRES_14"),
34499 Self::Postgres15 => std::option::Option::Some("POSTGRES_15"),
34500 Self::Postgres16 => std::option::Option::Some("POSTGRES_16"),
34501 Self::Postgres17 => std::option::Option::Some("POSTGRES_17"),
34502 Self::Postgres18 => std::option::Option::Some("POSTGRES_18"),
34503 Self::Sqlserver2019Standard => std::option::Option::Some("SQLSERVER_2019_STANDARD"),
34504 Self::Sqlserver2019Enterprise => std::option::Option::Some("SQLSERVER_2019_ENTERPRISE"),
34505 Self::Sqlserver2019Express => std::option::Option::Some("SQLSERVER_2019_EXPRESS"),
34506 Self::Sqlserver2019Web => std::option::Option::Some("SQLSERVER_2019_WEB"),
34507 Self::Sqlserver2022Standard => std::option::Option::Some("SQLSERVER_2022_STANDARD"),
34508 Self::Sqlserver2022Enterprise => std::option::Option::Some("SQLSERVER_2022_ENTERPRISE"),
34509 Self::Sqlserver2022Express => std::option::Option::Some("SQLSERVER_2022_EXPRESS"),
34510 Self::Sqlserver2022Web => std::option::Option::Some("SQLSERVER_2022_WEB"),
34511 Self::UnknownValue(u) => u.0.name(),
34512 }
34513 }
34514}
34515
34516impl std::default::Default for SqlDatabaseVersion {
34517 fn default() -> Self {
34518 use std::convert::From;
34519 Self::from(0)
34520 }
34521}
34522
34523impl std::fmt::Display for SqlDatabaseVersion {
34524 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34525 wkt::internal::display_enum(f, self.name(), self.value())
34526 }
34527}
34528
34529impl std::convert::From<i32> for SqlDatabaseVersion {
34530 fn from(value: i32) -> Self {
34531 match value {
34532 0 => Self::Unspecified,
34533 2 => Self::Mysql51,
34534 3 => Self::Mysql55,
34535 5 => Self::Mysql56,
34536 6 => Self::Mysql57,
34537 9 => Self::Postgres96,
34538 10 => Self::Postgres11,
34539 11 => Self::Sqlserver2017Standard,
34540 14 => Self::Sqlserver2017Enterprise,
34541 15 => Self::Sqlserver2017Express,
34542 16 => Self::Sqlserver2017Web,
34543 18 => Self::Postgres10,
34544 19 => Self::Postgres12,
34545 20 => Self::Mysql80,
34546 23 => Self::Postgres13,
34547 26 => Self::Sqlserver2019Standard,
34548 27 => Self::Sqlserver2019Enterprise,
34549 28 => Self::Sqlserver2019Express,
34550 29 => Self::Sqlserver2019Web,
34551 41 => Self::Mysql8018,
34552 85 => Self::Mysql8026,
34553 110 => Self::Postgres14,
34554 111 => Self::Mysql8027,
34555 132 => Self::Mysql8028,
34556 148 => Self::Mysql8029,
34557 172 => Self::Postgres15,
34558 174 => Self::Mysql8030,
34559 197 => Self::Mysql8031,
34560 199 => Self::Sqlserver2022Standard,
34561 200 => Self::Sqlserver2022Enterprise,
34562 201 => Self::Sqlserver2022Express,
34563 202 => Self::Sqlserver2022Web,
34564 213 => Self::Mysql8032,
34565 238 => Self::Mysql8033,
34566 239 => Self::Mysql8034,
34567 240 => Self::Mysql8035,
34568 241 => Self::Mysql8036,
34569 272 => Self::Postgres16,
34570 355 => Self::Mysql8037,
34571 357 => Self::Mysql8039,
34572 358 => Self::Mysql8040,
34573 398 => Self::Mysql84,
34574 408 => Self::Postgres17,
34575 488 => Self::Mysql8041,
34576 489 => Self::Mysql8042,
34577 553 => Self::Mysql8043,
34578 554 => Self::Mysql8044,
34579 555 => Self::Mysql8045,
34580 556 => Self::Mysql8046,
34581 557 => Self::Postgres18,
34582 654 => Self::Mysql97,
34583 _ => Self::UnknownValue(sql_database_version::UnknownValue(
34584 wkt::internal::UnknownEnumValue::Integer(value),
34585 )),
34586 }
34587 }
34588}
34589
34590impl std::convert::From<&str> for SqlDatabaseVersion {
34591 fn from(value: &str) -> Self {
34592 use std::string::ToString;
34593 match value {
34594 "SQL_DATABASE_VERSION_UNSPECIFIED" => Self::Unspecified,
34595 "MYSQL_5_1" => Self::Mysql51,
34596 "MYSQL_5_5" => Self::Mysql55,
34597 "MYSQL_5_6" => Self::Mysql56,
34598 "MYSQL_5_7" => Self::Mysql57,
34599 "MYSQL_8_0" => Self::Mysql80,
34600 "MYSQL_8_0_18" => Self::Mysql8018,
34601 "MYSQL_8_0_26" => Self::Mysql8026,
34602 "MYSQL_8_0_27" => Self::Mysql8027,
34603 "MYSQL_8_0_28" => Self::Mysql8028,
34604 "MYSQL_8_0_29" => Self::Mysql8029,
34605 "MYSQL_8_0_30" => Self::Mysql8030,
34606 "MYSQL_8_0_31" => Self::Mysql8031,
34607 "MYSQL_8_0_32" => Self::Mysql8032,
34608 "MYSQL_8_0_33" => Self::Mysql8033,
34609 "MYSQL_8_0_34" => Self::Mysql8034,
34610 "MYSQL_8_0_35" => Self::Mysql8035,
34611 "MYSQL_8_0_36" => Self::Mysql8036,
34612 "MYSQL_8_0_37" => Self::Mysql8037,
34613 "MYSQL_8_0_39" => Self::Mysql8039,
34614 "MYSQL_8_0_40" => Self::Mysql8040,
34615 "MYSQL_8_0_41" => Self::Mysql8041,
34616 "MYSQL_8_0_42" => Self::Mysql8042,
34617 "MYSQL_8_0_43" => Self::Mysql8043,
34618 "MYSQL_8_0_44" => Self::Mysql8044,
34619 "MYSQL_8_0_45" => Self::Mysql8045,
34620 "MYSQL_8_0_46" => Self::Mysql8046,
34621 "MYSQL_8_4" => Self::Mysql84,
34622 "MYSQL_9_7" => Self::Mysql97,
34623 "SQLSERVER_2017_STANDARD" => Self::Sqlserver2017Standard,
34624 "SQLSERVER_2017_ENTERPRISE" => Self::Sqlserver2017Enterprise,
34625 "SQLSERVER_2017_EXPRESS" => Self::Sqlserver2017Express,
34626 "SQLSERVER_2017_WEB" => Self::Sqlserver2017Web,
34627 "POSTGRES_9_6" => Self::Postgres96,
34628 "POSTGRES_10" => Self::Postgres10,
34629 "POSTGRES_11" => Self::Postgres11,
34630 "POSTGRES_12" => Self::Postgres12,
34631 "POSTGRES_13" => Self::Postgres13,
34632 "POSTGRES_14" => Self::Postgres14,
34633 "POSTGRES_15" => Self::Postgres15,
34634 "POSTGRES_16" => Self::Postgres16,
34635 "POSTGRES_17" => Self::Postgres17,
34636 "POSTGRES_18" => Self::Postgres18,
34637 "SQLSERVER_2019_STANDARD" => Self::Sqlserver2019Standard,
34638 "SQLSERVER_2019_ENTERPRISE" => Self::Sqlserver2019Enterprise,
34639 "SQLSERVER_2019_EXPRESS" => Self::Sqlserver2019Express,
34640 "SQLSERVER_2019_WEB" => Self::Sqlserver2019Web,
34641 "SQLSERVER_2022_STANDARD" => Self::Sqlserver2022Standard,
34642 "SQLSERVER_2022_ENTERPRISE" => Self::Sqlserver2022Enterprise,
34643 "SQLSERVER_2022_EXPRESS" => Self::Sqlserver2022Express,
34644 "SQLSERVER_2022_WEB" => Self::Sqlserver2022Web,
34645 _ => Self::UnknownValue(sql_database_version::UnknownValue(
34646 wkt::internal::UnknownEnumValue::String(value.to_string()),
34647 )),
34648 }
34649 }
34650}
34651
34652impl serde::ser::Serialize for SqlDatabaseVersion {
34653 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34654 where
34655 S: serde::Serializer,
34656 {
34657 match self {
34658 Self::Unspecified => serializer.serialize_i32(0),
34659 Self::Mysql51 => serializer.serialize_i32(2),
34660 Self::Mysql55 => serializer.serialize_i32(3),
34661 Self::Mysql56 => serializer.serialize_i32(5),
34662 Self::Mysql57 => serializer.serialize_i32(6),
34663 Self::Mysql80 => serializer.serialize_i32(20),
34664 Self::Mysql8018 => serializer.serialize_i32(41),
34665 Self::Mysql8026 => serializer.serialize_i32(85),
34666 Self::Mysql8027 => serializer.serialize_i32(111),
34667 Self::Mysql8028 => serializer.serialize_i32(132),
34668 Self::Mysql8029 => serializer.serialize_i32(148),
34669 Self::Mysql8030 => serializer.serialize_i32(174),
34670 Self::Mysql8031 => serializer.serialize_i32(197),
34671 Self::Mysql8032 => serializer.serialize_i32(213),
34672 Self::Mysql8033 => serializer.serialize_i32(238),
34673 Self::Mysql8034 => serializer.serialize_i32(239),
34674 Self::Mysql8035 => serializer.serialize_i32(240),
34675 Self::Mysql8036 => serializer.serialize_i32(241),
34676 Self::Mysql8037 => serializer.serialize_i32(355),
34677 Self::Mysql8039 => serializer.serialize_i32(357),
34678 Self::Mysql8040 => serializer.serialize_i32(358),
34679 Self::Mysql8041 => serializer.serialize_i32(488),
34680 Self::Mysql8042 => serializer.serialize_i32(489),
34681 Self::Mysql8043 => serializer.serialize_i32(553),
34682 Self::Mysql8044 => serializer.serialize_i32(554),
34683 Self::Mysql8045 => serializer.serialize_i32(555),
34684 Self::Mysql8046 => serializer.serialize_i32(556),
34685 Self::Mysql84 => serializer.serialize_i32(398),
34686 Self::Mysql97 => serializer.serialize_i32(654),
34687 Self::Sqlserver2017Standard => serializer.serialize_i32(11),
34688 Self::Sqlserver2017Enterprise => serializer.serialize_i32(14),
34689 Self::Sqlserver2017Express => serializer.serialize_i32(15),
34690 Self::Sqlserver2017Web => serializer.serialize_i32(16),
34691 Self::Postgres96 => serializer.serialize_i32(9),
34692 Self::Postgres10 => serializer.serialize_i32(18),
34693 Self::Postgres11 => serializer.serialize_i32(10),
34694 Self::Postgres12 => serializer.serialize_i32(19),
34695 Self::Postgres13 => serializer.serialize_i32(23),
34696 Self::Postgres14 => serializer.serialize_i32(110),
34697 Self::Postgres15 => serializer.serialize_i32(172),
34698 Self::Postgres16 => serializer.serialize_i32(272),
34699 Self::Postgres17 => serializer.serialize_i32(408),
34700 Self::Postgres18 => serializer.serialize_i32(557),
34701 Self::Sqlserver2019Standard => serializer.serialize_i32(26),
34702 Self::Sqlserver2019Enterprise => serializer.serialize_i32(27),
34703 Self::Sqlserver2019Express => serializer.serialize_i32(28),
34704 Self::Sqlserver2019Web => serializer.serialize_i32(29),
34705 Self::Sqlserver2022Standard => serializer.serialize_i32(199),
34706 Self::Sqlserver2022Enterprise => serializer.serialize_i32(200),
34707 Self::Sqlserver2022Express => serializer.serialize_i32(201),
34708 Self::Sqlserver2022Web => serializer.serialize_i32(202),
34709 Self::UnknownValue(u) => u.0.serialize(serializer),
34710 }
34711 }
34712}
34713
34714impl<'de> serde::de::Deserialize<'de> for SqlDatabaseVersion {
34715 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34716 where
34717 D: serde::Deserializer<'de>,
34718 {
34719 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDatabaseVersion>::new(
34720 ".google.cloud.sql.v1.SqlDatabaseVersion",
34721 ))
34722 }
34723}
34724
34725/// The pricing plan for this instance.
34726///
34727/// # Working with unknown values
34728///
34729/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34730/// additional enum variants at any time. Adding new variants is not considered
34731/// a breaking change. Applications should write their code in anticipation of:
34732///
34733/// - New values appearing in future releases of the client library, **and**
34734/// - New values received dynamically, without application changes.
34735///
34736/// Please consult the [Working with enums] section in the user guide for some
34737/// guidelines.
34738///
34739/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34740#[derive(Clone, Debug, PartialEq)]
34741#[non_exhaustive]
34742pub enum SqlPricingPlan {
34743 /// This is an unknown pricing plan for this instance.
34744 Unspecified,
34745 /// The instance is billed at a monthly flat rate.
34746 Package,
34747 /// The instance is billed per usage.
34748 PerUse,
34749 /// If set, the enum was initialized with an unknown value.
34750 ///
34751 /// Applications can examine the value using [SqlPricingPlan::value] or
34752 /// [SqlPricingPlan::name].
34753 UnknownValue(sql_pricing_plan::UnknownValue),
34754}
34755
34756#[doc(hidden)]
34757pub mod sql_pricing_plan {
34758 #[allow(unused_imports)]
34759 use super::*;
34760 #[derive(Clone, Debug, PartialEq)]
34761 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34762}
34763
34764impl SqlPricingPlan {
34765 /// Gets the enum value.
34766 ///
34767 /// Returns `None` if the enum contains an unknown value deserialized from
34768 /// the string representation of enums.
34769 pub fn value(&self) -> std::option::Option<i32> {
34770 match self {
34771 Self::Unspecified => std::option::Option::Some(0),
34772 Self::Package => std::option::Option::Some(1),
34773 Self::PerUse => std::option::Option::Some(2),
34774 Self::UnknownValue(u) => u.0.value(),
34775 }
34776 }
34777
34778 /// Gets the enum value as a string.
34779 ///
34780 /// Returns `None` if the enum contains an unknown value deserialized from
34781 /// the integer representation of enums.
34782 pub fn name(&self) -> std::option::Option<&str> {
34783 match self {
34784 Self::Unspecified => std::option::Option::Some("SQL_PRICING_PLAN_UNSPECIFIED"),
34785 Self::Package => std::option::Option::Some("PACKAGE"),
34786 Self::PerUse => std::option::Option::Some("PER_USE"),
34787 Self::UnknownValue(u) => u.0.name(),
34788 }
34789 }
34790}
34791
34792impl std::default::Default for SqlPricingPlan {
34793 fn default() -> Self {
34794 use std::convert::From;
34795 Self::from(0)
34796 }
34797}
34798
34799impl std::fmt::Display for SqlPricingPlan {
34800 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34801 wkt::internal::display_enum(f, self.name(), self.value())
34802 }
34803}
34804
34805impl std::convert::From<i32> for SqlPricingPlan {
34806 fn from(value: i32) -> Self {
34807 match value {
34808 0 => Self::Unspecified,
34809 1 => Self::Package,
34810 2 => Self::PerUse,
34811 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
34812 wkt::internal::UnknownEnumValue::Integer(value),
34813 )),
34814 }
34815 }
34816}
34817
34818impl std::convert::From<&str> for SqlPricingPlan {
34819 fn from(value: &str) -> Self {
34820 use std::string::ToString;
34821 match value {
34822 "SQL_PRICING_PLAN_UNSPECIFIED" => Self::Unspecified,
34823 "PACKAGE" => Self::Package,
34824 "PER_USE" => Self::PerUse,
34825 _ => Self::UnknownValue(sql_pricing_plan::UnknownValue(
34826 wkt::internal::UnknownEnumValue::String(value.to_string()),
34827 )),
34828 }
34829 }
34830}
34831
34832impl serde::ser::Serialize for SqlPricingPlan {
34833 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34834 where
34835 S: serde::Serializer,
34836 {
34837 match self {
34838 Self::Unspecified => serializer.serialize_i32(0),
34839 Self::Package => serializer.serialize_i32(1),
34840 Self::PerUse => serializer.serialize_i32(2),
34841 Self::UnknownValue(u) => u.0.serialize(serializer),
34842 }
34843 }
34844}
34845
34846impl<'de> serde::de::Deserialize<'de> for SqlPricingPlan {
34847 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34848 where
34849 D: serde::Deserializer<'de>,
34850 {
34851 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlPricingPlan>::new(
34852 ".google.cloud.sql.v1.SqlPricingPlan",
34853 ))
34854 }
34855}
34856
34857///
34858/// # Working with unknown values
34859///
34860/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34861/// additional enum variants at any time. Adding new variants is not considered
34862/// a breaking change. Applications should write their code in anticipation of:
34863///
34864/// - New values appearing in future releases of the client library, **and**
34865/// - New values received dynamically, without application changes.
34866///
34867/// Please consult the [Working with enums] section in the user guide for some
34868/// guidelines.
34869///
34870/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
34871#[derive(Clone, Debug, PartialEq)]
34872#[non_exhaustive]
34873pub enum SqlReplicationType {
34874 /// This is an unknown replication type for a Cloud SQL instance.
34875 Unspecified,
34876 /// The synchronous replication mode for First Generation instances. It is the
34877 /// default value.
34878 Synchronous,
34879 /// The asynchronous replication mode for First Generation instances. It
34880 /// provides a slight performance gain, but if an outage occurs while this
34881 /// option is set to asynchronous, you can lose up to a few seconds of updates
34882 /// to your data.
34883 Asynchronous,
34884 /// If set, the enum was initialized with an unknown value.
34885 ///
34886 /// Applications can examine the value using [SqlReplicationType::value] or
34887 /// [SqlReplicationType::name].
34888 UnknownValue(sql_replication_type::UnknownValue),
34889}
34890
34891#[doc(hidden)]
34892pub mod sql_replication_type {
34893 #[allow(unused_imports)]
34894 use super::*;
34895 #[derive(Clone, Debug, PartialEq)]
34896 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
34897}
34898
34899impl SqlReplicationType {
34900 /// Gets the enum value.
34901 ///
34902 /// Returns `None` if the enum contains an unknown value deserialized from
34903 /// the string representation of enums.
34904 pub fn value(&self) -> std::option::Option<i32> {
34905 match self {
34906 Self::Unspecified => std::option::Option::Some(0),
34907 Self::Synchronous => std::option::Option::Some(1),
34908 Self::Asynchronous => std::option::Option::Some(2),
34909 Self::UnknownValue(u) => u.0.value(),
34910 }
34911 }
34912
34913 /// Gets the enum value as a string.
34914 ///
34915 /// Returns `None` if the enum contains an unknown value deserialized from
34916 /// the integer representation of enums.
34917 pub fn name(&self) -> std::option::Option<&str> {
34918 match self {
34919 Self::Unspecified => std::option::Option::Some("SQL_REPLICATION_TYPE_UNSPECIFIED"),
34920 Self::Synchronous => std::option::Option::Some("SYNCHRONOUS"),
34921 Self::Asynchronous => std::option::Option::Some("ASYNCHRONOUS"),
34922 Self::UnknownValue(u) => u.0.name(),
34923 }
34924 }
34925}
34926
34927impl std::default::Default for SqlReplicationType {
34928 fn default() -> Self {
34929 use std::convert::From;
34930 Self::from(0)
34931 }
34932}
34933
34934impl std::fmt::Display for SqlReplicationType {
34935 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
34936 wkt::internal::display_enum(f, self.name(), self.value())
34937 }
34938}
34939
34940impl std::convert::From<i32> for SqlReplicationType {
34941 fn from(value: i32) -> Self {
34942 match value {
34943 0 => Self::Unspecified,
34944 1 => Self::Synchronous,
34945 2 => Self::Asynchronous,
34946 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
34947 wkt::internal::UnknownEnumValue::Integer(value),
34948 )),
34949 }
34950 }
34951}
34952
34953impl std::convert::From<&str> for SqlReplicationType {
34954 fn from(value: &str) -> Self {
34955 use std::string::ToString;
34956 match value {
34957 "SQL_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
34958 "SYNCHRONOUS" => Self::Synchronous,
34959 "ASYNCHRONOUS" => Self::Asynchronous,
34960 _ => Self::UnknownValue(sql_replication_type::UnknownValue(
34961 wkt::internal::UnknownEnumValue::String(value.to_string()),
34962 )),
34963 }
34964 }
34965}
34966
34967impl serde::ser::Serialize for SqlReplicationType {
34968 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
34969 where
34970 S: serde::Serializer,
34971 {
34972 match self {
34973 Self::Unspecified => serializer.serialize_i32(0),
34974 Self::Synchronous => serializer.serialize_i32(1),
34975 Self::Asynchronous => serializer.serialize_i32(2),
34976 Self::UnknownValue(u) => u.0.serialize(serializer),
34977 }
34978 }
34979}
34980
34981impl<'de> serde::de::Deserialize<'de> for SqlReplicationType {
34982 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
34983 where
34984 D: serde::Deserializer<'de>,
34985 {
34986 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlReplicationType>::new(
34987 ".google.cloud.sql.v1.SqlReplicationType",
34988 ))
34989 }
34990}
34991
34992/// The type of disk that is used for a v2 instance to use.
34993///
34994/// # Working with unknown values
34995///
34996/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
34997/// additional enum variants at any time. Adding new variants is not considered
34998/// a breaking change. Applications should write their code in anticipation of:
34999///
35000/// - New values appearing in future releases of the client library, **and**
35001/// - New values received dynamically, without application changes.
35002///
35003/// Please consult the [Working with enums] section in the user guide for some
35004/// guidelines.
35005///
35006/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
35007#[derive(Clone, Debug, PartialEq)]
35008#[non_exhaustive]
35009pub enum SqlDataDiskType {
35010 /// This is an unknown data disk type.
35011 Unspecified,
35012 /// An SSD data disk.
35013 PdSsd,
35014 /// An HDD data disk.
35015 PdHdd,
35016 /// This field is deprecated and will be removed from a future version of the
35017 /// API.
35018 #[deprecated]
35019 ObsoleteLocalSsd,
35020 /// A Hyperdisk Balanced data disk.
35021 HyperdiskBalanced,
35022 /// If set, the enum was initialized with an unknown value.
35023 ///
35024 /// Applications can examine the value using [SqlDataDiskType::value] or
35025 /// [SqlDataDiskType::name].
35026 UnknownValue(sql_data_disk_type::UnknownValue),
35027}
35028
35029#[doc(hidden)]
35030pub mod sql_data_disk_type {
35031 #[allow(unused_imports)]
35032 use super::*;
35033 #[derive(Clone, Debug, PartialEq)]
35034 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35035}
35036
35037impl SqlDataDiskType {
35038 /// Gets the enum value.
35039 ///
35040 /// Returns `None` if the enum contains an unknown value deserialized from
35041 /// the string representation of enums.
35042 pub fn value(&self) -> std::option::Option<i32> {
35043 match self {
35044 Self::Unspecified => std::option::Option::Some(0),
35045 Self::PdSsd => std::option::Option::Some(1),
35046 Self::PdHdd => std::option::Option::Some(2),
35047 Self::ObsoleteLocalSsd => std::option::Option::Some(3),
35048 Self::HyperdiskBalanced => std::option::Option::Some(4),
35049 Self::UnknownValue(u) => u.0.value(),
35050 }
35051 }
35052
35053 /// Gets the enum value as a string.
35054 ///
35055 /// Returns `None` if the enum contains an unknown value deserialized from
35056 /// the integer representation of enums.
35057 pub fn name(&self) -> std::option::Option<&str> {
35058 match self {
35059 Self::Unspecified => std::option::Option::Some("SQL_DATA_DISK_TYPE_UNSPECIFIED"),
35060 Self::PdSsd => std::option::Option::Some("PD_SSD"),
35061 Self::PdHdd => std::option::Option::Some("PD_HDD"),
35062 Self::ObsoleteLocalSsd => std::option::Option::Some("OBSOLETE_LOCAL_SSD"),
35063 Self::HyperdiskBalanced => std::option::Option::Some("HYPERDISK_BALANCED"),
35064 Self::UnknownValue(u) => u.0.name(),
35065 }
35066 }
35067}
35068
35069impl std::default::Default for SqlDataDiskType {
35070 fn default() -> Self {
35071 use std::convert::From;
35072 Self::from(0)
35073 }
35074}
35075
35076impl std::fmt::Display for SqlDataDiskType {
35077 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35078 wkt::internal::display_enum(f, self.name(), self.value())
35079 }
35080}
35081
35082impl std::convert::From<i32> for SqlDataDiskType {
35083 fn from(value: i32) -> Self {
35084 match value {
35085 0 => Self::Unspecified,
35086 1 => Self::PdSsd,
35087 2 => Self::PdHdd,
35088 3 => Self::ObsoleteLocalSsd,
35089 4 => Self::HyperdiskBalanced,
35090 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35091 wkt::internal::UnknownEnumValue::Integer(value),
35092 )),
35093 }
35094 }
35095}
35096
35097impl std::convert::From<&str> for SqlDataDiskType {
35098 fn from(value: &str) -> Self {
35099 use std::string::ToString;
35100 match value {
35101 "SQL_DATA_DISK_TYPE_UNSPECIFIED" => Self::Unspecified,
35102 "PD_SSD" => Self::PdSsd,
35103 "PD_HDD" => Self::PdHdd,
35104 "OBSOLETE_LOCAL_SSD" => Self::ObsoleteLocalSsd,
35105 "HYPERDISK_BALANCED" => Self::HyperdiskBalanced,
35106 _ => Self::UnknownValue(sql_data_disk_type::UnknownValue(
35107 wkt::internal::UnknownEnumValue::String(value.to_string()),
35108 )),
35109 }
35110 }
35111}
35112
35113impl serde::ser::Serialize for SqlDataDiskType {
35114 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35115 where
35116 S: serde::Serializer,
35117 {
35118 match self {
35119 Self::Unspecified => serializer.serialize_i32(0),
35120 Self::PdSsd => serializer.serialize_i32(1),
35121 Self::PdHdd => serializer.serialize_i32(2),
35122 Self::ObsoleteLocalSsd => serializer.serialize_i32(3),
35123 Self::HyperdiskBalanced => serializer.serialize_i32(4),
35124 Self::UnknownValue(u) => u.0.serialize(serializer),
35125 }
35126 }
35127}
35128
35129impl<'de> serde::de::Deserialize<'de> for SqlDataDiskType {
35130 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35131 where
35132 D: serde::Deserializer<'de>,
35133 {
35134 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlDataDiskType>::new(
35135 ".google.cloud.sql.v1.SqlDataDiskType",
35136 ))
35137 }
35138}
35139
35140/// The availability type of the given Cloud SQL instance.
35141///
35142/// # Working with unknown values
35143///
35144/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35145/// additional enum variants at any time. Adding new variants is not considered
35146/// a breaking change. Applications should write their code in anticipation of:
35147///
35148/// - New values appearing in future releases of the client library, **and**
35149/// - New values received dynamically, without application changes.
35150///
35151/// Please consult the [Working with enums] section in the user guide for some
35152/// guidelines.
35153///
35154/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
35155#[derive(Clone, Debug, PartialEq)]
35156#[non_exhaustive]
35157pub enum SqlAvailabilityType {
35158 /// This is an unknown Availability type.
35159 Unspecified,
35160 /// Zonal available instance.
35161 Zonal,
35162 /// Regional available instance.
35163 Regional,
35164 /// If set, the enum was initialized with an unknown value.
35165 ///
35166 /// Applications can examine the value using [SqlAvailabilityType::value] or
35167 /// [SqlAvailabilityType::name].
35168 UnknownValue(sql_availability_type::UnknownValue),
35169}
35170
35171#[doc(hidden)]
35172pub mod sql_availability_type {
35173 #[allow(unused_imports)]
35174 use super::*;
35175 #[derive(Clone, Debug, PartialEq)]
35176 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35177}
35178
35179impl SqlAvailabilityType {
35180 /// Gets the enum value.
35181 ///
35182 /// Returns `None` if the enum contains an unknown value deserialized from
35183 /// the string representation of enums.
35184 pub fn value(&self) -> std::option::Option<i32> {
35185 match self {
35186 Self::Unspecified => std::option::Option::Some(0),
35187 Self::Zonal => std::option::Option::Some(1),
35188 Self::Regional => std::option::Option::Some(2),
35189 Self::UnknownValue(u) => u.0.value(),
35190 }
35191 }
35192
35193 /// Gets the enum value as a string.
35194 ///
35195 /// Returns `None` if the enum contains an unknown value deserialized from
35196 /// the integer representation of enums.
35197 pub fn name(&self) -> std::option::Option<&str> {
35198 match self {
35199 Self::Unspecified => std::option::Option::Some("SQL_AVAILABILITY_TYPE_UNSPECIFIED"),
35200 Self::Zonal => std::option::Option::Some("ZONAL"),
35201 Self::Regional => std::option::Option::Some("REGIONAL"),
35202 Self::UnknownValue(u) => u.0.name(),
35203 }
35204 }
35205}
35206
35207impl std::default::Default for SqlAvailabilityType {
35208 fn default() -> Self {
35209 use std::convert::From;
35210 Self::from(0)
35211 }
35212}
35213
35214impl std::fmt::Display for SqlAvailabilityType {
35215 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35216 wkt::internal::display_enum(f, self.name(), self.value())
35217 }
35218}
35219
35220impl std::convert::From<i32> for SqlAvailabilityType {
35221 fn from(value: i32) -> Self {
35222 match value {
35223 0 => Self::Unspecified,
35224 1 => Self::Zonal,
35225 2 => Self::Regional,
35226 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35227 wkt::internal::UnknownEnumValue::Integer(value),
35228 )),
35229 }
35230 }
35231}
35232
35233impl std::convert::From<&str> for SqlAvailabilityType {
35234 fn from(value: &str) -> Self {
35235 use std::string::ToString;
35236 match value {
35237 "SQL_AVAILABILITY_TYPE_UNSPECIFIED" => Self::Unspecified,
35238 "ZONAL" => Self::Zonal,
35239 "REGIONAL" => Self::Regional,
35240 _ => Self::UnknownValue(sql_availability_type::UnknownValue(
35241 wkt::internal::UnknownEnumValue::String(value.to_string()),
35242 )),
35243 }
35244 }
35245}
35246
35247impl serde::ser::Serialize for SqlAvailabilityType {
35248 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35249 where
35250 S: serde::Serializer,
35251 {
35252 match self {
35253 Self::Unspecified => serializer.serialize_i32(0),
35254 Self::Zonal => serializer.serialize_i32(1),
35255 Self::Regional => serializer.serialize_i32(2),
35256 Self::UnknownValue(u) => u.0.serialize(serializer),
35257 }
35258 }
35259}
35260
35261impl<'de> serde::de::Deserialize<'de> for SqlAvailabilityType {
35262 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35263 where
35264 D: serde::Deserializer<'de>,
35265 {
35266 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlAvailabilityType>::new(
35267 ".google.cloud.sql.v1.SqlAvailabilityType",
35268 ))
35269 }
35270}
35271
35272///
35273/// # Working with unknown values
35274///
35275/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
35276/// additional enum variants at any time. Adding new variants is not considered
35277/// a breaking change. Applications should write their code in anticipation of:
35278///
35279/// - New values appearing in future releases of the client library, **and**
35280/// - New values received dynamically, without application changes.
35281///
35282/// Please consult the [Working with enums] section in the user guide for some
35283/// guidelines.
35284///
35285/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
35286#[derive(Clone, Debug, PartialEq)]
35287#[non_exhaustive]
35288pub enum SqlUpdateTrack {
35289 /// This is an unknown maintenance timing preference.
35290 Unspecified,
35291 /// For an instance with a scheduled maintenance window, this maintenance
35292 /// timing indicates that the maintenance update is scheduled 7 to 14 days
35293 /// after the notification is sent out. Also referred to as `Week 1` (Console)
35294 /// and `preview` (gcloud CLI).
35295 Canary,
35296 /// For an instance with a scheduled maintenance window, this maintenance
35297 /// timing indicates that the maintenance update is scheduled 15 to 21 days
35298 /// after the notification is sent out. Also referred to as `Week 2` (Console)
35299 /// and `production` (gcloud CLI).
35300 Stable,
35301 /// For instance with a scheduled maintenance window, this maintenance
35302 /// timing indicates that the maintenance update is scheduled 35 to 42 days
35303 /// after the notification is sent out.
35304 Week5,
35305 /// If set, the enum was initialized with an unknown value.
35306 ///
35307 /// Applications can examine the value using [SqlUpdateTrack::value] or
35308 /// [SqlUpdateTrack::name].
35309 UnknownValue(sql_update_track::UnknownValue),
35310}
35311
35312#[doc(hidden)]
35313pub mod sql_update_track {
35314 #[allow(unused_imports)]
35315 use super::*;
35316 #[derive(Clone, Debug, PartialEq)]
35317 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
35318}
35319
35320impl SqlUpdateTrack {
35321 /// Gets the enum value.
35322 ///
35323 /// Returns `None` if the enum contains an unknown value deserialized from
35324 /// the string representation of enums.
35325 pub fn value(&self) -> std::option::Option<i32> {
35326 match self {
35327 Self::Unspecified => std::option::Option::Some(0),
35328 Self::Canary => std::option::Option::Some(1),
35329 Self::Stable => std::option::Option::Some(2),
35330 Self::Week5 => std::option::Option::Some(3),
35331 Self::UnknownValue(u) => u.0.value(),
35332 }
35333 }
35334
35335 /// Gets the enum value as a string.
35336 ///
35337 /// Returns `None` if the enum contains an unknown value deserialized from
35338 /// the integer representation of enums.
35339 pub fn name(&self) -> std::option::Option<&str> {
35340 match self {
35341 Self::Unspecified => std::option::Option::Some("SQL_UPDATE_TRACK_UNSPECIFIED"),
35342 Self::Canary => std::option::Option::Some("canary"),
35343 Self::Stable => std::option::Option::Some("stable"),
35344 Self::Week5 => std::option::Option::Some("week5"),
35345 Self::UnknownValue(u) => u.0.name(),
35346 }
35347 }
35348}
35349
35350impl std::default::Default for SqlUpdateTrack {
35351 fn default() -> Self {
35352 use std::convert::From;
35353 Self::from(0)
35354 }
35355}
35356
35357impl std::fmt::Display for SqlUpdateTrack {
35358 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
35359 wkt::internal::display_enum(f, self.name(), self.value())
35360 }
35361}
35362
35363impl std::convert::From<i32> for SqlUpdateTrack {
35364 fn from(value: i32) -> Self {
35365 match value {
35366 0 => Self::Unspecified,
35367 1 => Self::Canary,
35368 2 => Self::Stable,
35369 3 => Self::Week5,
35370 _ => Self::UnknownValue(sql_update_track::UnknownValue(
35371 wkt::internal::UnknownEnumValue::Integer(value),
35372 )),
35373 }
35374 }
35375}
35376
35377impl std::convert::From<&str> for SqlUpdateTrack {
35378 fn from(value: &str) -> Self {
35379 use std::string::ToString;
35380 match value {
35381 "SQL_UPDATE_TRACK_UNSPECIFIED" => Self::Unspecified,
35382 "canary" => Self::Canary,
35383 "stable" => Self::Stable,
35384 "week5" => Self::Week5,
35385 _ => Self::UnknownValue(sql_update_track::UnknownValue(
35386 wkt::internal::UnknownEnumValue::String(value.to_string()),
35387 )),
35388 }
35389 }
35390}
35391
35392impl serde::ser::Serialize for SqlUpdateTrack {
35393 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
35394 where
35395 S: serde::Serializer,
35396 {
35397 match self {
35398 Self::Unspecified => serializer.serialize_i32(0),
35399 Self::Canary => serializer.serialize_i32(1),
35400 Self::Stable => serializer.serialize_i32(2),
35401 Self::Week5 => serializer.serialize_i32(3),
35402 Self::UnknownValue(u) => u.0.serialize(serializer),
35403 }
35404 }
35405}
35406
35407impl<'de> serde::de::Deserialize<'de> for SqlUpdateTrack {
35408 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
35409 where
35410 D: serde::Deserializer<'de>,
35411 {
35412 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SqlUpdateTrack>::new(
35413 ".google.cloud.sql.v1.SqlUpdateTrack",
35414 ))
35415 }
35416}