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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The encryption algorithm options that are available to a code-signing job.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EncryptionAlgorithmOptions {
    /// <p>The set of accepted encryption algorithms that are allowed in a code-signing job.</p>
    pub allowed_values: ::std::vec::Vec<crate::types::EncryptionAlgorithm>,
    /// <p>The default encryption algorithm that is used by a code-signing job.</p>
    pub default_value: crate::types::EncryptionAlgorithm,
}
impl EncryptionAlgorithmOptions {
    /// <p>The set of accepted encryption algorithms that are allowed in a code-signing job.</p>
    pub fn allowed_values(&self) -> &[crate::types::EncryptionAlgorithm] {
        use std::ops::Deref;
        self.allowed_values.deref()
    }
    /// <p>The default encryption algorithm that is used by a code-signing job.</p>
    pub fn default_value(&self) -> &crate::types::EncryptionAlgorithm {
        &self.default_value
    }
}
impl EncryptionAlgorithmOptions {
    /// Creates a new builder-style object to manufacture [`EncryptionAlgorithmOptions`](crate::types::EncryptionAlgorithmOptions).
    pub fn builder() -> crate::types::builders::EncryptionAlgorithmOptionsBuilder {
        crate::types::builders::EncryptionAlgorithmOptionsBuilder::default()
    }
}

/// A builder for [`EncryptionAlgorithmOptions`](crate::types::EncryptionAlgorithmOptions).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EncryptionAlgorithmOptionsBuilder {
    pub(crate) allowed_values: ::std::option::Option<::std::vec::Vec<crate::types::EncryptionAlgorithm>>,
    pub(crate) default_value: ::std::option::Option<crate::types::EncryptionAlgorithm>,
}
impl EncryptionAlgorithmOptionsBuilder {
    /// Appends an item to `allowed_values`.
    ///
    /// To override the contents of this collection use [`set_allowed_values`](Self::set_allowed_values).
    ///
    /// <p>The set of accepted encryption algorithms that are allowed in a code-signing job.</p>
    pub fn allowed_values(mut self, input: crate::types::EncryptionAlgorithm) -> Self {
        let mut v = self.allowed_values.unwrap_or_default();
        v.push(input);
        self.allowed_values = ::std::option::Option::Some(v);
        self
    }
    /// <p>The set of accepted encryption algorithms that are allowed in a code-signing job.</p>
    pub fn set_allowed_values(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EncryptionAlgorithm>>) -> Self {
        self.allowed_values = input;
        self
    }
    /// <p>The set of accepted encryption algorithms that are allowed in a code-signing job.</p>
    pub fn get_allowed_values(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EncryptionAlgorithm>> {
        &self.allowed_values
    }
    /// <p>The default encryption algorithm that is used by a code-signing job.</p>
    /// This field is required.
    pub fn default_value(mut self, input: crate::types::EncryptionAlgorithm) -> Self {
        self.default_value = ::std::option::Option::Some(input);
        self
    }
    /// <p>The default encryption algorithm that is used by a code-signing job.</p>
    pub fn set_default_value(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithm>) -> Self {
        self.default_value = input;
        self
    }
    /// <p>The default encryption algorithm that is used by a code-signing job.</p>
    pub fn get_default_value(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithm> {
        &self.default_value
    }
    /// Consumes the builder and constructs a [`EncryptionAlgorithmOptions`](crate::types::EncryptionAlgorithmOptions).
    /// This method will fail if any of the following fields are not set:
    /// - [`allowed_values`](crate::types::builders::EncryptionAlgorithmOptionsBuilder::allowed_values)
    /// - [`default_value`](crate::types::builders::EncryptionAlgorithmOptionsBuilder::default_value)
    pub fn build(self) -> ::std::result::Result<crate::types::EncryptionAlgorithmOptions, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::EncryptionAlgorithmOptions {
            allowed_values: self.allowed_values.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "allowed_values",
                    "allowed_values was not specified but it is required when building EncryptionAlgorithmOptions",
                )
            })?,
            default_value: self.default_value.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "default_value",
                    "default_value was not specified but it is required when building EncryptionAlgorithmOptions",
                )
            })?,
        })
    }
}