Skip to main content

aws_sdk_imagebuilder/types/
_image_state.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Image status and the reason for that status.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ImageState {
7    /// <p>The status of the image.</p>
8    pub status: ::std::option::Option<crate::types::ImageStatus>,
9    /// <p>The reason for the status of the image.</p>
10    pub reason: ::std::option::Option<::std::string::String>,
11}
12impl ImageState {
13    /// <p>The status of the image.</p>
14    pub fn status(&self) -> ::std::option::Option<&crate::types::ImageStatus> {
15        self.status.as_ref()
16    }
17    /// <p>The reason for the status of the image.</p>
18    pub fn reason(&self) -> ::std::option::Option<&str> {
19        self.reason.as_deref()
20    }
21}
22impl ImageState {
23    /// Creates a new builder-style object to manufacture [`ImageState`](crate::types::ImageState).
24    pub fn builder() -> crate::types::builders::ImageStateBuilder {
25        crate::types::builders::ImageStateBuilder::default()
26    }
27}
28
29/// A builder for [`ImageState`](crate::types::ImageState).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct ImageStateBuilder {
33    pub(crate) status: ::std::option::Option<crate::types::ImageStatus>,
34    pub(crate) reason: ::std::option::Option<::std::string::String>,
35}
36impl ImageStateBuilder {
37    /// <p>The status of the image.</p>
38    pub fn status(mut self, input: crate::types::ImageStatus) -> Self {
39        self.status = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The status of the image.</p>
43    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ImageStatus>) -> Self {
44        self.status = input;
45        self
46    }
47    /// <p>The status of the image.</p>
48    pub fn get_status(&self) -> &::std::option::Option<crate::types::ImageStatus> {
49        &self.status
50    }
51    /// <p>The reason for the status of the image.</p>
52    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.reason = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The reason for the status of the image.</p>
57    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.reason = input;
59        self
60    }
61    /// <p>The reason for the status of the image.</p>
62    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
63        &self.reason
64    }
65    /// Consumes the builder and constructs a [`ImageState`](crate::types::ImageState).
66    pub fn build(self) -> crate::types::ImageState {
67        crate::types::ImageState {
68            status: self.status,
69            reason: self.reason,
70        }
71    }
72}