aws_sdk_ecr/operation/start_image_scan/
_start_image_scan_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct StartImageScanInput {
6    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.</p>
7    pub registry_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the repository that contains the images to scan.</p>
9    pub repository_name: ::std::option::Option<::std::string::String>,
10    /// <p>An object with identifying information for an image in an Amazon ECR repository.</p>
11    pub image_id: ::std::option::Option<crate::types::ImageIdentifier>,
12}
13impl StartImageScanInput {
14    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.</p>
15    pub fn registry_id(&self) -> ::std::option::Option<&str> {
16        self.registry_id.as_deref()
17    }
18    /// <p>The name of the repository that contains the images to scan.</p>
19    pub fn repository_name(&self) -> ::std::option::Option<&str> {
20        self.repository_name.as_deref()
21    }
22    /// <p>An object with identifying information for an image in an Amazon ECR repository.</p>
23    pub fn image_id(&self) -> ::std::option::Option<&crate::types::ImageIdentifier> {
24        self.image_id.as_ref()
25    }
26}
27impl StartImageScanInput {
28    /// Creates a new builder-style object to manufacture [`StartImageScanInput`](crate::operation::start_image_scan::StartImageScanInput).
29    pub fn builder() -> crate::operation::start_image_scan::builders::StartImageScanInputBuilder {
30        crate::operation::start_image_scan::builders::StartImageScanInputBuilder::default()
31    }
32}
33
34/// A builder for [`StartImageScanInput`](crate::operation::start_image_scan::StartImageScanInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct StartImageScanInputBuilder {
38    pub(crate) registry_id: ::std::option::Option<::std::string::String>,
39    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
40    pub(crate) image_id: ::std::option::Option<crate::types::ImageIdentifier>,
41}
42impl StartImageScanInputBuilder {
43    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.</p>
44    pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.registry_id = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.</p>
49    pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.registry_id = input;
51        self
52    }
53    /// <p>The Amazon Web Services account ID associated with the registry that contains the repository in which to start an image scan request. If you do not specify a registry, the default registry is assumed.</p>
54    pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
55        &self.registry_id
56    }
57    /// <p>The name of the repository that contains the images to scan.</p>
58    /// This field is required.
59    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.repository_name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the repository that contains the images to scan.</p>
64    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.repository_name = input;
66        self
67    }
68    /// <p>The name of the repository that contains the images to scan.</p>
69    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.repository_name
71    }
72    /// <p>An object with identifying information for an image in an Amazon ECR repository.</p>
73    /// This field is required.
74    pub fn image_id(mut self, input: crate::types::ImageIdentifier) -> Self {
75        self.image_id = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>An object with identifying information for an image in an Amazon ECR repository.</p>
79    pub fn set_image_id(mut self, input: ::std::option::Option<crate::types::ImageIdentifier>) -> Self {
80        self.image_id = input;
81        self
82    }
83    /// <p>An object with identifying information for an image in an Amazon ECR repository.</p>
84    pub fn get_image_id(&self) -> &::std::option::Option<crate::types::ImageIdentifier> {
85        &self.image_id
86    }
87    /// Consumes the builder and constructs a [`StartImageScanInput`](crate::operation::start_image_scan::StartImageScanInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::start_image_scan::StartImageScanInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::start_image_scan::StartImageScanInput {
92            registry_id: self.registry_id,
93            repository_name: self.repository_name,
94            image_id: self.image_id,
95        })
96    }
97}