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 that contains information about one version of a secret.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SecretVersionsListEntry {
/// <p>The unique version identifier of this version of the secret.</p>
pub version_id: ::std::option::Option<::std::string::String>,
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
pub version_stages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The date and time this version of the secret was created.</p>
pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The KMS keys used to encrypt the secret version.</p>
pub kms_key_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl SecretVersionsListEntry {
/// <p>The unique version identifier of this version of the secret.</p>
pub fn version_id(&self) -> ::std::option::Option<&str> {
self.version_id.as_deref()
}
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.version_stages.is_none()`.
pub fn version_stages(&self) -> &[::std::string::String] {
self.version_stages.as_deref().unwrap_or_default()
}
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub fn last_accessed_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_accessed_date.as_ref()
}
/// <p>The date and time this version of the secret was created.</p>
pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_date.as_ref()
}
/// <p>The KMS keys used to encrypt the secret version.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.kms_key_ids.is_none()`.
pub fn kms_key_ids(&self) -> &[::std::string::String] {
self.kms_key_ids.as_deref().unwrap_or_default()
}
}
impl SecretVersionsListEntry {
/// Creates a new builder-style object to manufacture [`SecretVersionsListEntry`](crate::types::SecretVersionsListEntry).
pub fn builder() -> crate::types::builders::SecretVersionsListEntryBuilder {
crate::types::builders::SecretVersionsListEntryBuilder::default()
}
}
/// A builder for [`SecretVersionsListEntry`](crate::types::SecretVersionsListEntry).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SecretVersionsListEntryBuilder {
pub(crate) version_id: ::std::option::Option<::std::string::String>,
pub(crate) version_stages: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) last_accessed_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) kms_key_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl SecretVersionsListEntryBuilder {
/// <p>The unique version identifier of this version of the secret.</p>
pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.version_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The unique version identifier of this version of the secret.</p>
pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.version_id = input;
self
}
/// <p>The unique version identifier of this version of the secret.</p>
pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
&self.version_id
}
/// Appends an item to `version_stages`.
///
/// To override the contents of this collection use [`set_version_stages`](Self::set_version_stages).
///
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
pub fn version_stages(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.version_stages.unwrap_or_default();
v.push(input.into());
self.version_stages = ::std::option::Option::Some(v);
self
}
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
pub fn set_version_stages(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.version_stages = input;
self
}
/// <p>An array of staging labels that are currently associated with this version of the secret.</p>
pub fn get_version_stages(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.version_stages
}
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub fn last_accessed_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_accessed_date = ::std::option::Option::Some(input);
self
}
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub fn set_last_accessed_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_accessed_date = input;
self
}
/// <p>The date that this version of the secret was last accessed. Note that the resolution of this field is at the date level and does not include the time.</p>
pub fn get_last_accessed_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_accessed_date
}
/// <p>The date and time this version of the secret was created.</p>
pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_date = ::std::option::Option::Some(input);
self
}
/// <p>The date and time this version of the secret was created.</p>
pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_date = input;
self
}
/// <p>The date and time this version of the secret was created.</p>
pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_date
}
/// Appends an item to `kms_key_ids`.
///
/// To override the contents of this collection use [`set_kms_key_ids`](Self::set_kms_key_ids).
///
/// <p>The KMS keys used to encrypt the secret version.</p>
pub fn kms_key_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.kms_key_ids.unwrap_or_default();
v.push(input.into());
self.kms_key_ids = ::std::option::Option::Some(v);
self
}
/// <p>The KMS keys used to encrypt the secret version.</p>
pub fn set_kms_key_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.kms_key_ids = input;
self
}
/// <p>The KMS keys used to encrypt the secret version.</p>
pub fn get_kms_key_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.kms_key_ids
}
/// Consumes the builder and constructs a [`SecretVersionsListEntry`](crate::types::SecretVersionsListEntry).
pub fn build(self) -> crate::types::SecretVersionsListEntry {
crate::types::SecretVersionsListEntry {
version_id: self.version_id,
version_stages: self.version_stages,
last_accessed_date: self.last_accessed_date,
created_date: self.created_date,
kms_key_ids: self.kms_key_ids,
}
}
}