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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An Amazon Web Services Systems Manager parameter in Parameter Store.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Parameter {
/// <p>The name of the parameter.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub r#type: ::std::option::Option<crate::types::ParameterType>,
/// <p>The parameter value.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub value: ::std::option::Option<::std::string::String>,
/// <p>The parameter version.</p>
pub version: i64,
/// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
/// <p>parameter_name:version</p>
/// <p>parameter_name:label</p>
pub selector: ::std::option::Option<::std::string::String>,
/// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
pub source_result: ::std::option::Option<::std::string::String>,
/// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The Amazon Resource Name (ARN) of the parameter.</p>
pub arn: ::std::option::Option<::std::string::String>,
/// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
pub data_type: ::std::option::Option<::std::string::String>,
}
impl Parameter {
/// <p>The name of the parameter.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn r#type(&self) -> ::std::option::Option<&crate::types::ParameterType> {
self.r#type.as_ref()
}
/// <p>The parameter value.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn value(&self) -> ::std::option::Option<&str> {
self.value.as_deref()
}
/// <p>The parameter version.</p>
pub fn version(&self) -> i64 {
self.version
}
/// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
/// <p>parameter_name:version</p>
/// <p>parameter_name:label</p>
pub fn selector(&self) -> ::std::option::Option<&str> {
self.selector.as_deref()
}
/// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
pub fn source_result(&self) -> ::std::option::Option<&str> {
self.source_result.as_deref()
}
/// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_modified_date.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of the parameter.</p>
pub fn arn(&self) -> ::std::option::Option<&str> {
self.arn.as_deref()
}
/// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
pub fn data_type(&self) -> ::std::option::Option<&str> {
self.data_type.as_deref()
}
}
impl ::std::fmt::Debug for Parameter {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Parameter");
formatter.field("name", &self.name);
formatter.field("r#type", &self.r#type);
formatter.field("value", &"*** Sensitive Data Redacted ***");
formatter.field("version", &self.version);
formatter.field("selector", &self.selector);
formatter.field("source_result", &self.source_result);
formatter.field("last_modified_date", &self.last_modified_date);
formatter.field("arn", &self.arn);
formatter.field("data_type", &self.data_type);
formatter.finish()
}
}
impl Parameter {
/// Creates a new builder-style object to manufacture [`Parameter`](crate::types::Parameter).
pub fn builder() -> crate::types::builders::ParameterBuilder {
crate::types::builders::ParameterBuilder::default()
}
}
/// A builder for [`Parameter`](crate::types::Parameter).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct ParameterBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::ParameterType>,
pub(crate) value: ::std::option::Option<::std::string::String>,
pub(crate) version: ::std::option::Option<i64>,
pub(crate) selector: ::std::option::Option<::std::string::String>,
pub(crate) source_result: ::std::option::Option<::std::string::String>,
pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) data_type: ::std::option::Option<::std::string::String>,
}
impl ParameterBuilder {
/// <p>The name of the parameter.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the parameter.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the parameter.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn r#type(mut self, input: crate::types::ParameterType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::ParameterType>) -> Self {
self.r#type = input;
self
}
/// <p>The type of parameter. Valid values include the following: <code>String</code>, <code>StringList</code>, and <code>SecureString</code>.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn get_type(&self) -> &::std::option::Option<crate::types::ParameterType> {
&self.r#type
}
/// <p>The parameter value.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.value = ::std::option::Option::Some(input.into());
self
}
/// <p>The parameter value.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.value = input;
self
}
/// <p>The parameter value.</p><note>
/// <p>If type is <code>StringList</code>, the system returns a comma-separated string with no spaces between commas in the <code>Value</code> field.</p>
/// </note>
pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
&self.value
}
/// <p>The parameter version.</p>
pub fn version(mut self, input: i64) -> Self {
self.version = ::std::option::Option::Some(input);
self
}
/// <p>The parameter version.</p>
pub fn set_version(mut self, input: ::std::option::Option<i64>) -> Self {
self.version = input;
self
}
/// <p>The parameter version.</p>
pub fn get_version(&self) -> &::std::option::Option<i64> {
&self.version
}
/// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
/// <p>parameter_name:version</p>
/// <p>parameter_name:label</p>
pub fn selector(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.selector = ::std::option::Option::Some(input.into());
self
}
/// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
/// <p>parameter_name:version</p>
/// <p>parameter_name:label</p>
pub fn set_selector(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.selector = input;
self
}
/// <p>Either the version number or the label used to retrieve the parameter value. Specify selectors by using one of the following formats:</p>
/// <p>parameter_name:version</p>
/// <p>parameter_name:label</p>
pub fn get_selector(&self) -> &::std::option::Option<::std::string::String> {
&self.selector
}
/// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
pub fn source_result(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_result = ::std::option::Option::Some(input.into());
self
}
/// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
pub fn set_source_result(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_result = input;
self
}
/// <p>Applies to parameters that reference information in other Amazon Web Services services. <code>SourceResult</code> is the raw result or response from the source.</p>
pub fn get_source_result(&self) -> &::std::option::Option<::std::string::String> {
&self.source_result
}
/// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_modified_date = ::std::option::Option::Some(input);
self
}
/// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_modified_date = input;
self
}
/// <p>Date the parameter was last changed or updated and the parameter version was created.</p>
pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_modified_date
}
/// <p>The Amazon Resource Name (ARN) of the parameter.</p>
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the parameter.</p>
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the parameter.</p>
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
/// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
pub fn data_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.data_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
pub fn set_data_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.data_type = input;
self
}
/// <p>The data type of the parameter, such as <code>text</code> or <code>aws:ec2:image</code>. The default is <code>text</code>.</p>
pub fn get_data_type(&self) -> &::std::option::Option<::std::string::String> {
&self.data_type
}
/// Consumes the builder and constructs a [`Parameter`](crate::types::Parameter).
pub fn build(self) -> crate::types::Parameter {
crate::types::Parameter {
name: self.name,
r#type: self.r#type,
value: self.value,
version: self.version.unwrap_or_default(),
selector: self.selector,
source_result: self.source_result,
last_modified_date: self.last_modified_date,
arn: self.arn,
data_type: self.data_type,
}
}
}
impl ::std::fmt::Debug for ParameterBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("ParameterBuilder");
formatter.field("name", &self.name);
formatter.field("r#type", &self.r#type);
formatter.field("value", &"*** Sensitive Data Redacted ***");
formatter.field("version", &self.version);
formatter.field("selector", &self.selector);
formatter.field("source_result", &self.source_result);
formatter.field("last_modified_date", &self.last_modified_date);
formatter.field("arn", &self.arn);
formatter.field("data_type", &self.data_type);
formatter.finish()
}
}