aws_sdk_ec2/client/
deregister_image.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`DeregisterImage`](crate::operation::deregister_image::builders::DeregisterImageFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`image_id(impl Into<String>)`](crate::operation::deregister_image::builders::DeregisterImageFluentBuilder::image_id) / [`set_image_id(Option<String>)`](crate::operation::deregister_image::builders::DeregisterImageFluentBuilder::set_image_id):<br>required: **true**<br><p>The ID of the AMI.</p><br>
7    ///   - [`delete_associated_snapshots(bool)`](crate::operation::deregister_image::builders::DeregisterImageFluentBuilder::delete_associated_snapshots) / [`set_delete_associated_snapshots(Option<bool>)`](crate::operation::deregister_image::builders::DeregisterImageFluentBuilder::set_delete_associated_snapshots):<br>required: **false**<br><p>Specifies whether to delete the snapshots associated with the AMI during deregistration.</p><note>  <p>If a snapshot is associated with multiple AMIs, it is not deleted, regardless of this setting.</p> </note> <p>Default: The snapshots are not deleted.</p><br>
8    ///   - [`dry_run(bool)`](crate::operation::deregister_image::builders::DeregisterImageFluentBuilder::dry_run) / [`set_dry_run(Option<bool>)`](crate::operation::deregister_image::builders::DeregisterImageFluentBuilder::set_dry_run):<br>required: **false**<br><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><br>
9    /// - On success, responds with [`DeregisterImageOutput`](crate::operation::deregister_image::DeregisterImageOutput) with field(s):
10    ///   - [`r#return(Option<bool>)`](crate::operation::deregister_image::DeregisterImageOutput::return): <p>Returns <code>true</code> if the request succeeds; otherwise, it returns an error.</p>
11    ///   - [`delete_snapshot_results(Option<Vec::<DeleteSnapshotReturnCode>>)`](crate::operation::deregister_image::DeregisterImageOutput::delete_snapshot_results): <p>The deletion result for each snapshot associated with the AMI, including the snapshot ID and its success or error code.</p>
12    /// - On failure, responds with [`SdkError<DeregisterImageError>`](crate::operation::deregister_image::DeregisterImageError)
13    pub fn deregister_image(&self) -> crate::operation::deregister_image::builders::DeregisterImageFluentBuilder {
14        crate::operation::deregister_image::builders::DeregisterImageFluentBuilder::new(self.handle.clone())
15    }
16}