Skip to main content

aws_sdk_redshift/types/
_snapshot_error_message.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the errors returned by a snapshot.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SnapshotErrorMessage {
7    /// <p>A unique identifier for the snapshot returning the error.</p>
8    pub snapshot_identifier: ::std::option::Option<::std::string::String>,
9    /// <p>A unique identifier for the cluster.</p>
10    pub snapshot_cluster_identifier: ::std::option::Option<::std::string::String>,
11    /// <p>The failure code for the error.</p>
12    pub failure_code: ::std::option::Option<::std::string::String>,
13    /// <p>The text message describing the error.</p>
14    pub failure_reason: ::std::option::Option<::std::string::String>,
15}
16impl SnapshotErrorMessage {
17    /// <p>A unique identifier for the snapshot returning the error.</p>
18    pub fn snapshot_identifier(&self) -> ::std::option::Option<&str> {
19        self.snapshot_identifier.as_deref()
20    }
21    /// <p>A unique identifier for the cluster.</p>
22    pub fn snapshot_cluster_identifier(&self) -> ::std::option::Option<&str> {
23        self.snapshot_cluster_identifier.as_deref()
24    }
25    /// <p>The failure code for the error.</p>
26    pub fn failure_code(&self) -> ::std::option::Option<&str> {
27        self.failure_code.as_deref()
28    }
29    /// <p>The text message describing the error.</p>
30    pub fn failure_reason(&self) -> ::std::option::Option<&str> {
31        self.failure_reason.as_deref()
32    }
33}
34impl SnapshotErrorMessage {
35    /// Creates a new builder-style object to manufacture [`SnapshotErrorMessage`](crate::types::SnapshotErrorMessage).
36    pub fn builder() -> crate::types::builders::SnapshotErrorMessageBuilder {
37        crate::types::builders::SnapshotErrorMessageBuilder::default()
38    }
39}
40
41/// A builder for [`SnapshotErrorMessage`](crate::types::SnapshotErrorMessage).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct SnapshotErrorMessageBuilder {
45    pub(crate) snapshot_identifier: ::std::option::Option<::std::string::String>,
46    pub(crate) snapshot_cluster_identifier: ::std::option::Option<::std::string::String>,
47    pub(crate) failure_code: ::std::option::Option<::std::string::String>,
48    pub(crate) failure_reason: ::std::option::Option<::std::string::String>,
49}
50impl SnapshotErrorMessageBuilder {
51    /// <p>A unique identifier for the snapshot returning the error.</p>
52    pub fn snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.snapshot_identifier = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>A unique identifier for the snapshot returning the error.</p>
57    pub fn set_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.snapshot_identifier = input;
59        self
60    }
61    /// <p>A unique identifier for the snapshot returning the error.</p>
62    pub fn get_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
63        &self.snapshot_identifier
64    }
65    /// <p>A unique identifier for the cluster.</p>
66    pub fn snapshot_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.snapshot_cluster_identifier = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>A unique identifier for the cluster.</p>
71    pub fn set_snapshot_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.snapshot_cluster_identifier = input;
73        self
74    }
75    /// <p>A unique identifier for the cluster.</p>
76    pub fn get_snapshot_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
77        &self.snapshot_cluster_identifier
78    }
79    /// <p>The failure code for the error.</p>
80    pub fn failure_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.failure_code = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The failure code for the error.</p>
85    pub fn set_failure_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.failure_code = input;
87        self
88    }
89    /// <p>The failure code for the error.</p>
90    pub fn get_failure_code(&self) -> &::std::option::Option<::std::string::String> {
91        &self.failure_code
92    }
93    /// <p>The text message describing the error.</p>
94    pub fn failure_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.failure_reason = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The text message describing the error.</p>
99    pub fn set_failure_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.failure_reason = input;
101        self
102    }
103    /// <p>The text message describing the error.</p>
104    pub fn get_failure_reason(&self) -> &::std::option::Option<::std::string::String> {
105        &self.failure_reason
106    }
107    /// Consumes the builder and constructs a [`SnapshotErrorMessage`](crate::types::SnapshotErrorMessage).
108    pub fn build(self) -> crate::types::SnapshotErrorMessage {
109        crate::types::SnapshotErrorMessage {
110            snapshot_identifier: self.snapshot_identifier,
111            snapshot_cluster_identifier: self.snapshot_cluster_identifier,
112            failure_code: self.failure_code,
113            failure_reason: self.failure_reason,
114        }
115    }
116}