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 image format of a AWS Signer platform or profile.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SigningImageFormat {
    /// <p>The supported formats of a signing image.</p>
    pub supported_formats: ::std::vec::Vec<crate::types::ImageFormat>,
    /// <p>The default format of a signing image.</p>
    pub default_format: crate::types::ImageFormat,
}
impl SigningImageFormat {
    /// <p>The supported formats of a signing image.</p>
    pub fn supported_formats(&self) -> &[crate::types::ImageFormat] {
        use std::ops::Deref;
        self.supported_formats.deref()
    }
    /// <p>The default format of a signing image.</p>
    pub fn default_format(&self) -> &crate::types::ImageFormat {
        &self.default_format
    }
}
impl SigningImageFormat {
    /// Creates a new builder-style object to manufacture [`SigningImageFormat`](crate::types::SigningImageFormat).
    pub fn builder() -> crate::types::builders::SigningImageFormatBuilder {
        crate::types::builders::SigningImageFormatBuilder::default()
    }
}

/// A builder for [`SigningImageFormat`](crate::types::SigningImageFormat).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SigningImageFormatBuilder {
    pub(crate) supported_formats: ::std::option::Option<::std::vec::Vec<crate::types::ImageFormat>>,
    pub(crate) default_format: ::std::option::Option<crate::types::ImageFormat>,
}
impl SigningImageFormatBuilder {
    /// Appends an item to `supported_formats`.
    ///
    /// To override the contents of this collection use [`set_supported_formats`](Self::set_supported_formats).
    ///
    /// <p>The supported formats of a signing image.</p>
    pub fn supported_formats(mut self, input: crate::types::ImageFormat) -> Self {
        let mut v = self.supported_formats.unwrap_or_default();
        v.push(input);
        self.supported_formats = ::std::option::Option::Some(v);
        self
    }
    /// <p>The supported formats of a signing image.</p>
    pub fn set_supported_formats(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImageFormat>>) -> Self {
        self.supported_formats = input;
        self
    }
    /// <p>The supported formats of a signing image.</p>
    pub fn get_supported_formats(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageFormat>> {
        &self.supported_formats
    }
    /// <p>The default format of a signing image.</p>
    /// This field is required.
    pub fn default_format(mut self, input: crate::types::ImageFormat) -> Self {
        self.default_format = ::std::option::Option::Some(input);
        self
    }
    /// <p>The default format of a signing image.</p>
    pub fn set_default_format(mut self, input: ::std::option::Option<crate::types::ImageFormat>) -> Self {
        self.default_format = input;
        self
    }
    /// <p>The default format of a signing image.</p>
    pub fn get_default_format(&self) -> &::std::option::Option<crate::types::ImageFormat> {
        &self.default_format
    }
    /// Consumes the builder and constructs a [`SigningImageFormat`](crate::types::SigningImageFormat).
    /// This method will fail if any of the following fields are not set:
    /// - [`supported_formats`](crate::types::builders::SigningImageFormatBuilder::supported_formats)
    /// - [`default_format`](crate::types::builders::SigningImageFormatBuilder::default_format)
    pub fn build(self) -> ::std::result::Result<crate::types::SigningImageFormat, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::SigningImageFormat {
            supported_formats: self.supported_formats.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "supported_formats",
                    "supported_formats was not specified but it is required when building SigningImageFormat",
                )
            })?,
            default_format: self.default_format.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "default_format",
                    "default_format was not specified but it is required when building SigningImageFormat",
                )
            })?,
        })
    }
}