aws-sdk-imagebuilder 1.111.0

AWS SDK for EC2 Image Builder
Documentation
// 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 PutImagePolicyInput {
    /// <p>The Amazon Resource Name (ARN) of the image that this policy should be applied to.</p>
    pub image_arn: ::std::option::Option<::std::string::String>,
    /// <p>The policy to apply.</p>
    pub policy: ::std::option::Option<::std::string::String>,
}
impl PutImagePolicyInput {
    /// <p>The Amazon Resource Name (ARN) of the image that this policy should be applied to.</p>
    pub fn image_arn(&self) -> ::std::option::Option<&str> {
        self.image_arn.as_deref()
    }
    /// <p>The policy to apply.</p>
    pub fn policy(&self) -> ::std::option::Option<&str> {
        self.policy.as_deref()
    }
}
impl PutImagePolicyInput {
    /// Creates a new builder-style object to manufacture [`PutImagePolicyInput`](crate::operation::put_image_policy::PutImagePolicyInput).
    pub fn builder() -> crate::operation::put_image_policy::builders::PutImagePolicyInputBuilder {
        crate::operation::put_image_policy::builders::PutImagePolicyInputBuilder::default()
    }
}

/// A builder for [`PutImagePolicyInput`](crate::operation::put_image_policy::PutImagePolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutImagePolicyInputBuilder {
    pub(crate) image_arn: ::std::option::Option<::std::string::String>,
    pub(crate) policy: ::std::option::Option<::std::string::String>,
}
impl PutImagePolicyInputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the image that this policy should be applied to.</p>
    /// This field is required.
    pub fn image_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.image_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the image that this policy should be applied to.</p>
    pub fn set_image_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.image_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the image that this policy should be applied to.</p>
    pub fn get_image_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.image_arn
    }
    /// <p>The policy to apply.</p>
    /// This field is required.
    pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.policy = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The policy to apply.</p>
    pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.policy = input;
        self
    }
    /// <p>The policy to apply.</p>
    pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
        &self.policy
    }
    /// Consumes the builder and constructs a [`PutImagePolicyInput`](crate::operation::put_image_policy::PutImagePolicyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_image_policy::PutImagePolicyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_image_policy::PutImagePolicyInput {
            image_arn: self.image_arn,
            policy: self.policy,
        })
    }
}