aws_sdk_securityhub/types/_aws_ecr_container_image_details.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about an Amazon ECR image.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsEcrContainerImageDetails {
7 /// <p>The Amazon Web Services account identifier that is associated with the registry that the image belongs to.</p>
8 pub registry_id: ::std::option::Option<::std::string::String>,
9 /// <p>The name of the repository that the image belongs to.</p>
10 pub repository_name: ::std::option::Option<::std::string::String>,
11 /// <p>The architecture of the image. Valid values are as follows:</p>
12 /// <ul>
13 /// <li>
14 /// <p><code>arm64</code></p></li>
15 /// <li>
16 /// <p><code>i386</code></p></li>
17 /// <li>
18 /// <p><code>x86_64</code></p></li>
19 /// </ul>
20 pub architecture: ::std::option::Option<::std::string::String>,
21 /// <p>The sha256 digest of the image manifest.</p>
22 pub image_digest: ::std::option::Option<::std::string::String>,
23 /// <p>The list of tags that are associated with the image.</p>
24 pub image_tags: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
25 /// <p>The date and time when the image was pushed to the repository.</p>
26 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
27 pub image_published_at: ::std::option::Option<::std::string::String>,
28}
29impl AwsEcrContainerImageDetails {
30 /// <p>The Amazon Web Services account identifier that is associated with the registry that the image belongs to.</p>
31 pub fn registry_id(&self) -> ::std::option::Option<&str> {
32 self.registry_id.as_deref()
33 }
34 /// <p>The name of the repository that the image belongs to.</p>
35 pub fn repository_name(&self) -> ::std::option::Option<&str> {
36 self.repository_name.as_deref()
37 }
38 /// <p>The architecture of the image. Valid values are as follows:</p>
39 /// <ul>
40 /// <li>
41 /// <p><code>arm64</code></p></li>
42 /// <li>
43 /// <p><code>i386</code></p></li>
44 /// <li>
45 /// <p><code>x86_64</code></p></li>
46 /// </ul>
47 pub fn architecture(&self) -> ::std::option::Option<&str> {
48 self.architecture.as_deref()
49 }
50 /// <p>The sha256 digest of the image manifest.</p>
51 pub fn image_digest(&self) -> ::std::option::Option<&str> {
52 self.image_digest.as_deref()
53 }
54 /// <p>The list of tags that are associated with the image.</p>
55 ///
56 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.image_tags.is_none()`.
57 pub fn image_tags(&self) -> &[::std::string::String] {
58 self.image_tags.as_deref().unwrap_or_default()
59 }
60 /// <p>The date and time when the image was pushed to the repository.</p>
61 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
62 pub fn image_published_at(&self) -> ::std::option::Option<&str> {
63 self.image_published_at.as_deref()
64 }
65}
66impl AwsEcrContainerImageDetails {
67 /// Creates a new builder-style object to manufacture [`AwsEcrContainerImageDetails`](crate::types::AwsEcrContainerImageDetails).
68 pub fn builder() -> crate::types::builders::AwsEcrContainerImageDetailsBuilder {
69 crate::types::builders::AwsEcrContainerImageDetailsBuilder::default()
70 }
71}
72
73/// A builder for [`AwsEcrContainerImageDetails`](crate::types::AwsEcrContainerImageDetails).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct AwsEcrContainerImageDetailsBuilder {
77 pub(crate) registry_id: ::std::option::Option<::std::string::String>,
78 pub(crate) repository_name: ::std::option::Option<::std::string::String>,
79 pub(crate) architecture: ::std::option::Option<::std::string::String>,
80 pub(crate) image_digest: ::std::option::Option<::std::string::String>,
81 pub(crate) image_tags: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
82 pub(crate) image_published_at: ::std::option::Option<::std::string::String>,
83}
84impl AwsEcrContainerImageDetailsBuilder {
85 /// <p>The Amazon Web Services account identifier that is associated with the registry that the image belongs to.</p>
86 pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.registry_id = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>The Amazon Web Services account identifier that is associated with the registry that the image belongs to.</p>
91 pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.registry_id = input;
93 self
94 }
95 /// <p>The Amazon Web Services account identifier that is associated with the registry that the image belongs to.</p>
96 pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
97 &self.registry_id
98 }
99 /// <p>The name of the repository that the image belongs to.</p>
100 pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.repository_name = ::std::option::Option::Some(input.into());
102 self
103 }
104 /// <p>The name of the repository that the image belongs to.</p>
105 pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.repository_name = input;
107 self
108 }
109 /// <p>The name of the repository that the image belongs to.</p>
110 pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
111 &self.repository_name
112 }
113 /// <p>The architecture of the image. Valid values are as follows:</p>
114 /// <ul>
115 /// <li>
116 /// <p><code>arm64</code></p></li>
117 /// <li>
118 /// <p><code>i386</code></p></li>
119 /// <li>
120 /// <p><code>x86_64</code></p></li>
121 /// </ul>
122 pub fn architecture(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.architecture = ::std::option::Option::Some(input.into());
124 self
125 }
126 /// <p>The architecture of the image. Valid values are as follows:</p>
127 /// <ul>
128 /// <li>
129 /// <p><code>arm64</code></p></li>
130 /// <li>
131 /// <p><code>i386</code></p></li>
132 /// <li>
133 /// <p><code>x86_64</code></p></li>
134 /// </ul>
135 pub fn set_architecture(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.architecture = input;
137 self
138 }
139 /// <p>The architecture of the image. Valid values are as follows:</p>
140 /// <ul>
141 /// <li>
142 /// <p><code>arm64</code></p></li>
143 /// <li>
144 /// <p><code>i386</code></p></li>
145 /// <li>
146 /// <p><code>x86_64</code></p></li>
147 /// </ul>
148 pub fn get_architecture(&self) -> &::std::option::Option<::std::string::String> {
149 &self.architecture
150 }
151 /// <p>The sha256 digest of the image manifest.</p>
152 pub fn image_digest(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.image_digest = ::std::option::Option::Some(input.into());
154 self
155 }
156 /// <p>The sha256 digest of the image manifest.</p>
157 pub fn set_image_digest(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.image_digest = input;
159 self
160 }
161 /// <p>The sha256 digest of the image manifest.</p>
162 pub fn get_image_digest(&self) -> &::std::option::Option<::std::string::String> {
163 &self.image_digest
164 }
165 /// Appends an item to `image_tags`.
166 ///
167 /// To override the contents of this collection use [`set_image_tags`](Self::set_image_tags).
168 ///
169 /// <p>The list of tags that are associated with the image.</p>
170 pub fn image_tags(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171 let mut v = self.image_tags.unwrap_or_default();
172 v.push(input.into());
173 self.image_tags = ::std::option::Option::Some(v);
174 self
175 }
176 /// <p>The list of tags that are associated with the image.</p>
177 pub fn set_image_tags(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
178 self.image_tags = input;
179 self
180 }
181 /// <p>The list of tags that are associated with the image.</p>
182 pub fn get_image_tags(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
183 &self.image_tags
184 }
185 /// <p>The date and time when the image was pushed to the repository.</p>
186 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
187 pub fn image_published_at(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188 self.image_published_at = ::std::option::Option::Some(input.into());
189 self
190 }
191 /// <p>The date and time when the image was pushed to the repository.</p>
192 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
193 pub fn set_image_published_at(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.image_published_at = input;
195 self
196 }
197 /// <p>The date and time when the image was pushed to the repository.</p>
198 /// <p>For more information about the validation and formatting of timestamp fields in Security Hub CSPM, see <a href="https://docs.aws.amazon.com/securityhub/1.0/APIReference/Welcome.html#timestamps">Timestamps</a>.</p>
199 pub fn get_image_published_at(&self) -> &::std::option::Option<::std::string::String> {
200 &self.image_published_at
201 }
202 /// Consumes the builder and constructs a [`AwsEcrContainerImageDetails`](crate::types::AwsEcrContainerImageDetails).
203 pub fn build(self) -> crate::types::AwsEcrContainerImageDetails {
204 crate::types::AwsEcrContainerImageDetails {
205 registry_id: self.registry_id,
206 repository_name: self.repository_name,
207 architecture: self.architecture,
208 image_digest: self.image_digest,
209 image_tags: self.image_tags,
210 image_published_at: self.image_published_at,
211 }
212 }
213}