// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeImageReferencesInput {
/// <p>The IDs of the images to check for resource references.</p>
pub image_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Specifies whether to check all supported Amazon Web Services resource types for image references. When specified, default values are applied for <code>ResourceTypeOptions</code>. For the default values, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-ami-references.html#how-ami-references-works">How AMI reference checks work</a> in the <i>Amazon EC2 User Guide</i>. If you also specify <code>ResourceTypes</code> with <code>ResourceTypeOptions</code>, your specified values override the default values.</p>
/// <p>Supported resource types: <code>ec2:Instance</code> | <code>ec2:LaunchTemplate</code> | <code>ssm:Parameter</code> | <code>imagebuilder:ImageRecipe</code> | <code>imagebuilder:ContainerRecipe</code></p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub include_all_resource_types: ::std::option::Option<bool>,
/// <p>The Amazon Web Services resource types to check for image references.</p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeRequest>>,
/// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
pub next_token: ::std::option::Option<::std::string::String>,
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub dry_run: ::std::option::Option<bool>,
/// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
pub max_results: ::std::option::Option<i32>,
}
impl DescribeImageReferencesInput {
/// <p>The IDs of the images to check for resource references.</p>
///
/// 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_ids.is_none()`.
pub fn image_ids(&self) -> &[::std::string::String] {
self.image_ids.as_deref().unwrap_or_default()
}
/// <p>Specifies whether to check all supported Amazon Web Services resource types for image references. When specified, default values are applied for <code>ResourceTypeOptions</code>. For the default values, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-ami-references.html#how-ami-references-works">How AMI reference checks work</a> in the <i>Amazon EC2 User Guide</i>. If you also specify <code>ResourceTypes</code> with <code>ResourceTypeOptions</code>, your specified values override the default values.</p>
/// <p>Supported resource types: <code>ec2:Instance</code> | <code>ec2:LaunchTemplate</code> | <code>ssm:Parameter</code> | <code>imagebuilder:ImageRecipe</code> | <code>imagebuilder:ContainerRecipe</code></p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub fn include_all_resource_types(&self) -> ::std::option::Option<bool> {
self.include_all_resource_types
}
/// <p>The Amazon Web Services resource types to check for image references.</p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`.
pub fn resource_types(&self) -> &[crate::types::ResourceTypeRequest] {
self.resource_types.as_deref().unwrap_or_default()
}
/// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
pub fn next_token(&self) -> ::std::option::Option<&str> {
self.next_token.as_deref()
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn dry_run(&self) -> ::std::option::Option<bool> {
self.dry_run
}
/// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
pub fn max_results(&self) -> ::std::option::Option<i32> {
self.max_results
}
}
impl DescribeImageReferencesInput {
/// Creates a new builder-style object to manufacture [`DescribeImageReferencesInput`](crate::operation::describe_image_references::DescribeImageReferencesInput).
pub fn builder() -> crate::operation::describe_image_references::builders::DescribeImageReferencesInputBuilder {
crate::operation::describe_image_references::builders::DescribeImageReferencesInputBuilder::default()
}
}
/// A builder for [`DescribeImageReferencesInput`](crate::operation::describe_image_references::DescribeImageReferencesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeImageReferencesInputBuilder {
pub(crate) image_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) include_all_resource_types: ::std::option::Option<bool>,
pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeRequest>>,
pub(crate) next_token: ::std::option::Option<::std::string::String>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) max_results: ::std::option::Option<i32>,
}
impl DescribeImageReferencesInputBuilder {
/// Appends an item to `image_ids`.
///
/// To override the contents of this collection use [`set_image_ids`](Self::set_image_ids).
///
/// <p>The IDs of the images to check for resource references.</p>
pub fn image_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.image_ids.unwrap_or_default();
v.push(input.into());
self.image_ids = ::std::option::Option::Some(v);
self
}
/// <p>The IDs of the images to check for resource references.</p>
pub fn set_image_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.image_ids = input;
self
}
/// <p>The IDs of the images to check for resource references.</p>
pub fn get_image_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.image_ids
}
/// <p>Specifies whether to check all supported Amazon Web Services resource types for image references. When specified, default values are applied for <code>ResourceTypeOptions</code>. For the default values, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-ami-references.html#how-ami-references-works">How AMI reference checks work</a> in the <i>Amazon EC2 User Guide</i>. If you also specify <code>ResourceTypes</code> with <code>ResourceTypeOptions</code>, your specified values override the default values.</p>
/// <p>Supported resource types: <code>ec2:Instance</code> | <code>ec2:LaunchTemplate</code> | <code>ssm:Parameter</code> | <code>imagebuilder:ImageRecipe</code> | <code>imagebuilder:ContainerRecipe</code></p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub fn include_all_resource_types(mut self, input: bool) -> Self {
self.include_all_resource_types = ::std::option::Option::Some(input);
self
}
/// <p>Specifies whether to check all supported Amazon Web Services resource types for image references. When specified, default values are applied for <code>ResourceTypeOptions</code>. For the default values, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-ami-references.html#how-ami-references-works">How AMI reference checks work</a> in the <i>Amazon EC2 User Guide</i>. If you also specify <code>ResourceTypes</code> with <code>ResourceTypeOptions</code>, your specified values override the default values.</p>
/// <p>Supported resource types: <code>ec2:Instance</code> | <code>ec2:LaunchTemplate</code> | <code>ssm:Parameter</code> | <code>imagebuilder:ImageRecipe</code> | <code>imagebuilder:ContainerRecipe</code></p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub fn set_include_all_resource_types(mut self, input: ::std::option::Option<bool>) -> Self {
self.include_all_resource_types = input;
self
}
/// <p>Specifies whether to check all supported Amazon Web Services resource types for image references. When specified, default values are applied for <code>ResourceTypeOptions</code>. For the default values, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-ami-references.html#how-ami-references-works">How AMI reference checks work</a> in the <i>Amazon EC2 User Guide</i>. If you also specify <code>ResourceTypes</code> with <code>ResourceTypeOptions</code>, your specified values override the default values.</p>
/// <p>Supported resource types: <code>ec2:Instance</code> | <code>ec2:LaunchTemplate</code> | <code>ssm:Parameter</code> | <code>imagebuilder:ImageRecipe</code> | <code>imagebuilder:ContainerRecipe</code></p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub fn get_include_all_resource_types(&self) -> &::std::option::Option<bool> {
&self.include_all_resource_types
}
/// Appends an item to `resource_types`.
///
/// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
///
/// <p>The Amazon Web Services resource types to check for image references.</p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub fn resource_types(mut self, input: crate::types::ResourceTypeRequest) -> Self {
let mut v = self.resource_types.unwrap_or_default();
v.push(input);
self.resource_types = ::std::option::Option::Some(v);
self
}
/// <p>The Amazon Web Services resource types to check for image references.</p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeRequest>>) -> Self {
self.resource_types = input;
self
}
/// <p>The Amazon Web Services resource types to check for image references.</p>
/// <p>Either <code>IncludeAllResourceTypes</code> or <code>ResourceTypes</code> must be specified.</p>
pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTypeRequest>> {
&self.resource_types
}
/// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.next_token = ::std::option::Option::Some(input.into());
self
}
/// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.next_token = input;
self
}
/// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
&self.next_token
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = ::std::option::Option::Some(input);
self
}
/// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
&self.max_results
}
/// Consumes the builder and constructs a [`DescribeImageReferencesInput`](crate::operation::describe_image_references::DescribeImageReferencesInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::describe_image_references::DescribeImageReferencesInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::describe_image_references::DescribeImageReferencesInput {
image_ids: self.image_ids,
include_all_resource_types: self.include_all_resource_types,
resource_types: self.resource_types,
next_token: self.next_token,
dry_run: self.dry_run,
max_results: self.max_results,
})
}
}