aws_sdk_signer/types/
_encryption_algorithm_options.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EncryptionAlgorithmOptions {
7 pub allowed_values: ::std::vec::Vec<crate::types::EncryptionAlgorithm>,
9 pub default_value: crate::types::EncryptionAlgorithm,
11}
12impl EncryptionAlgorithmOptions {
13 pub fn allowed_values(&self) -> &[crate::types::EncryptionAlgorithm] {
15 use std::ops::Deref;
16 self.allowed_values.deref()
17 }
18 pub fn default_value(&self) -> &crate::types::EncryptionAlgorithm {
20 &self.default_value
21 }
22}
23impl EncryptionAlgorithmOptions {
24 pub fn builder() -> crate::types::builders::EncryptionAlgorithmOptionsBuilder {
26 crate::types::builders::EncryptionAlgorithmOptionsBuilder::default()
27 }
28}
29
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct EncryptionAlgorithmOptionsBuilder {
34 pub(crate) allowed_values: ::std::option::Option<::std::vec::Vec<crate::types::EncryptionAlgorithm>>,
35 pub(crate) default_value: ::std::option::Option<crate::types::EncryptionAlgorithm>,
36}
37impl EncryptionAlgorithmOptionsBuilder {
38 pub fn allowed_values(mut self, input: crate::types::EncryptionAlgorithm) -> Self {
44 let mut v = self.allowed_values.unwrap_or_default();
45 v.push(input);
46 self.allowed_values = ::std::option::Option::Some(v);
47 self
48 }
49 pub fn set_allowed_values(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EncryptionAlgorithm>>) -> Self {
51 self.allowed_values = input;
52 self
53 }
54 pub fn get_allowed_values(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EncryptionAlgorithm>> {
56 &self.allowed_values
57 }
58 pub fn default_value(mut self, input: crate::types::EncryptionAlgorithm) -> Self {
61 self.default_value = ::std::option::Option::Some(input);
62 self
63 }
64 pub fn set_default_value(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithm>) -> Self {
66 self.default_value = input;
67 self
68 }
69 pub fn get_default_value(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithm> {
71 &self.default_value
72 }
73 pub fn build(self) -> ::std::result::Result<crate::types::EncryptionAlgorithmOptions, ::aws_smithy_types::error::operation::BuildError> {
78 ::std::result::Result::Ok(crate::types::EncryptionAlgorithmOptions {
79 allowed_values: self.allowed_values.ok_or_else(|| {
80 ::aws_smithy_types::error::operation::BuildError::missing_field(
81 "allowed_values",
82 "allowed_values was not specified but it is required when building EncryptionAlgorithmOptions",
83 )
84 })?,
85 default_value: self.default_value.ok_or_else(|| {
86 ::aws_smithy_types::error::operation::BuildError::missing_field(
87 "default_value",
88 "default_value was not specified but it is required when building EncryptionAlgorithmOptions",
89 )
90 })?,
91 })
92 }
93}