aws_sdk_redshift/types/
_update_target.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A maintenance track that you can switch the current track to.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateTarget {
7    /// <p>The name of the new maintenance track.</p>
8    pub maintenance_track_name: ::std::option::Option<::std::string::String>,
9    /// <p>The cluster version for the new maintenance track.</p>
10    pub database_version: ::std::option::Option<::std::string::String>,
11    /// <p>A list of operations supported by the maintenance track.</p>
12    pub supported_operations: ::std::option::Option<::std::vec::Vec<crate::types::SupportedOperation>>,
13}
14impl UpdateTarget {
15    /// <p>The name of the new maintenance track.</p>
16    pub fn maintenance_track_name(&self) -> ::std::option::Option<&str> {
17        self.maintenance_track_name.as_deref()
18    }
19    /// <p>The cluster version for the new maintenance track.</p>
20    pub fn database_version(&self) -> ::std::option::Option<&str> {
21        self.database_version.as_deref()
22    }
23    /// <p>A list of operations supported by the maintenance track.</p>
24    ///
25    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.supported_operations.is_none()`.
26    pub fn supported_operations(&self) -> &[crate::types::SupportedOperation] {
27        self.supported_operations.as_deref().unwrap_or_default()
28    }
29}
30impl UpdateTarget {
31    /// Creates a new builder-style object to manufacture [`UpdateTarget`](crate::types::UpdateTarget).
32    pub fn builder() -> crate::types::builders::UpdateTargetBuilder {
33        crate::types::builders::UpdateTargetBuilder::default()
34    }
35}
36
37/// A builder for [`UpdateTarget`](crate::types::UpdateTarget).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct UpdateTargetBuilder {
41    pub(crate) maintenance_track_name: ::std::option::Option<::std::string::String>,
42    pub(crate) database_version: ::std::option::Option<::std::string::String>,
43    pub(crate) supported_operations: ::std::option::Option<::std::vec::Vec<crate::types::SupportedOperation>>,
44}
45impl UpdateTargetBuilder {
46    /// <p>The name of the new maintenance track.</p>
47    pub fn maintenance_track_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.maintenance_track_name = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The name of the new maintenance track.</p>
52    pub fn set_maintenance_track_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.maintenance_track_name = input;
54        self
55    }
56    /// <p>The name of the new maintenance track.</p>
57    pub fn get_maintenance_track_name(&self) -> &::std::option::Option<::std::string::String> {
58        &self.maintenance_track_name
59    }
60    /// <p>The cluster version for the new maintenance track.</p>
61    pub fn database_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.database_version = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The cluster version for the new maintenance track.</p>
66    pub fn set_database_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.database_version = input;
68        self
69    }
70    /// <p>The cluster version for the new maintenance track.</p>
71    pub fn get_database_version(&self) -> &::std::option::Option<::std::string::String> {
72        &self.database_version
73    }
74    /// Appends an item to `supported_operations`.
75    ///
76    /// To override the contents of this collection use [`set_supported_operations`](Self::set_supported_operations).
77    ///
78    /// <p>A list of operations supported by the maintenance track.</p>
79    pub fn supported_operations(mut self, input: crate::types::SupportedOperation) -> Self {
80        let mut v = self.supported_operations.unwrap_or_default();
81        v.push(input);
82        self.supported_operations = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>A list of operations supported by the maintenance track.</p>
86    pub fn set_supported_operations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SupportedOperation>>) -> Self {
87        self.supported_operations = input;
88        self
89    }
90    /// <p>A list of operations supported by the maintenance track.</p>
91    pub fn get_supported_operations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SupportedOperation>> {
92        &self.supported_operations
93    }
94    /// Consumes the builder and constructs a [`UpdateTarget`](crate::types::UpdateTarget).
95    pub fn build(self) -> crate::types::UpdateTarget {
96        crate::types::UpdateTarget {
97            maintenance_track_name: self.maintenance_track_name,
98            database_version: self.database_version,
99            supported_operations: self.supported_operations,
100        }
101    }
102}