1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A structure describing the configuration and details of a storage optimizer.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StorageOptimizer {
/// <p>The specific type of storage optimizer. The supported value is <code>compaction</code>.</p>
pub storage_optimizer_type: ::std::option::Option<crate::types::OptimizerType>,
/// <p>A map of the storage optimizer configuration. Currently contains only one key-value pair: <code>is_enabled</code> indicates true or false for acceleration.</p>
pub config: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>A message that contains information about any error (if present).</p>
/// <p>When an acceleration result has an enabled status, the error message is empty.</p>
/// <p>When an acceleration result has a disabled status, the message describes an error or simply indicates "disabled by the user".</p>
pub error_message: ::std::option::Option<::std::string::String>,
/// <p>A message that contains information about any warnings (if present).</p>
pub warnings: ::std::option::Option<::std::string::String>,
/// <p>When an acceleration result has an enabled status, contains the details of the last job run.</p>
pub last_run_details: ::std::option::Option<::std::string::String>,
}
impl StorageOptimizer {
/// <p>The specific type of storage optimizer. The supported value is <code>compaction</code>.</p>
pub fn storage_optimizer_type(&self) -> ::std::option::Option<&crate::types::OptimizerType> {
self.storage_optimizer_type.as_ref()
}
/// <p>A map of the storage optimizer configuration. Currently contains only one key-value pair: <code>is_enabled</code> indicates true or false for acceleration.</p>
pub fn config(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.config.as_ref()
}
/// <p>A message that contains information about any error (if present).</p>
/// <p>When an acceleration result has an enabled status, the error message is empty.</p>
/// <p>When an acceleration result has a disabled status, the message describes an error or simply indicates "disabled by the user".</p>
pub fn error_message(&self) -> ::std::option::Option<&str> {
self.error_message.as_deref()
}
/// <p>A message that contains information about any warnings (if present).</p>
pub fn warnings(&self) -> ::std::option::Option<&str> {
self.warnings.as_deref()
}
/// <p>When an acceleration result has an enabled status, contains the details of the last job run.</p>
pub fn last_run_details(&self) -> ::std::option::Option<&str> {
self.last_run_details.as_deref()
}
}
impl StorageOptimizer {
/// Creates a new builder-style object to manufacture [`StorageOptimizer`](crate::types::StorageOptimizer).
pub fn builder() -> crate::types::builders::StorageOptimizerBuilder {
crate::types::builders::StorageOptimizerBuilder::default()
}
}
/// A builder for [`StorageOptimizer`](crate::types::StorageOptimizer).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct StorageOptimizerBuilder {
pub(crate) storage_optimizer_type: ::std::option::Option<crate::types::OptimizerType>,
pub(crate) config: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) error_message: ::std::option::Option<::std::string::String>,
pub(crate) warnings: ::std::option::Option<::std::string::String>,
pub(crate) last_run_details: ::std::option::Option<::std::string::String>,
}
impl StorageOptimizerBuilder {
/// <p>The specific type of storage optimizer. The supported value is <code>compaction</code>.</p>
pub fn storage_optimizer_type(mut self, input: crate::types::OptimizerType) -> Self {
self.storage_optimizer_type = ::std::option::Option::Some(input);
self
}
/// <p>The specific type of storage optimizer. The supported value is <code>compaction</code>.</p>
pub fn set_storage_optimizer_type(mut self, input: ::std::option::Option<crate::types::OptimizerType>) -> Self {
self.storage_optimizer_type = input;
self
}
/// <p>The specific type of storage optimizer. The supported value is <code>compaction</code>.</p>
pub fn get_storage_optimizer_type(&self) -> &::std::option::Option<crate::types::OptimizerType> {
&self.storage_optimizer_type
}
/// Adds a key-value pair to `config`.
///
/// To override the contents of this collection use [`set_config`](Self::set_config).
///
/// <p>A map of the storage optimizer configuration. Currently contains only one key-value pair: <code>is_enabled</code> indicates true or false for acceleration.</p>
pub fn config(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.config.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.config = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map of the storage optimizer configuration. Currently contains only one key-value pair: <code>is_enabled</code> indicates true or false for acceleration.</p>
pub fn set_config(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.config = input;
self
}
/// <p>A map of the storage optimizer configuration. Currently contains only one key-value pair: <code>is_enabled</code> indicates true or false for acceleration.</p>
pub fn get_config(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.config
}
/// <p>A message that contains information about any error (if present).</p>
/// <p>When an acceleration result has an enabled status, the error message is empty.</p>
/// <p>When an acceleration result has a disabled status, the message describes an error or simply indicates "disabled by the user".</p>
pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.error_message = ::std::option::Option::Some(input.into());
self
}
/// <p>A message that contains information about any error (if present).</p>
/// <p>When an acceleration result has an enabled status, the error message is empty.</p>
/// <p>When an acceleration result has a disabled status, the message describes an error or simply indicates "disabled by the user".</p>
pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.error_message = input;
self
}
/// <p>A message that contains information about any error (if present).</p>
/// <p>When an acceleration result has an enabled status, the error message is empty.</p>
/// <p>When an acceleration result has a disabled status, the message describes an error or simply indicates "disabled by the user".</p>
pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
&self.error_message
}
/// <p>A message that contains information about any warnings (if present).</p>
pub fn warnings(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.warnings = ::std::option::Option::Some(input.into());
self
}
/// <p>A message that contains information about any warnings (if present).</p>
pub fn set_warnings(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.warnings = input;
self
}
/// <p>A message that contains information about any warnings (if present).</p>
pub fn get_warnings(&self) -> &::std::option::Option<::std::string::String> {
&self.warnings
}
/// <p>When an acceleration result has an enabled status, contains the details of the last job run.</p>
pub fn last_run_details(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.last_run_details = ::std::option::Option::Some(input.into());
self
}
/// <p>When an acceleration result has an enabled status, contains the details of the last job run.</p>
pub fn set_last_run_details(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.last_run_details = input;
self
}
/// <p>When an acceleration result has an enabled status, contains the details of the last job run.</p>
pub fn get_last_run_details(&self) -> &::std::option::Option<::std::string::String> {
&self.last_run_details
}
/// Consumes the builder and constructs a [`StorageOptimizer`](crate::types::StorageOptimizer).
pub fn build(self) -> crate::types::StorageOptimizer {
crate::types::StorageOptimizer {
storage_optimizer_type: self.storage_optimizer_type,
config: self.config,
error_message: self.error_message,
warnings: self.warnings,
last_run_details: self.last_run_details,
}
}
}