aws-sdk-cloudfront 1.115.0

AWS SDK for Amazon CloudFront
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 UpdatePublicKeyInput {
    /// <p>A public key configuration.</p>
    pub public_key_config: ::std::option::Option<crate::types::PublicKeyConfig>,
    /// <p>The identifier of the public key that you are updating.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The value of the <code>ETag</code> header that you received when retrieving the public key to update. For example: <code>E2QWRUHAPOMQZL</code>.</p>
    pub if_match: ::std::option::Option<::std::string::String>,
}
impl UpdatePublicKeyInput {
    /// <p>A public key configuration.</p>
    pub fn public_key_config(&self) -> ::std::option::Option<&crate::types::PublicKeyConfig> {
        self.public_key_config.as_ref()
    }
    /// <p>The identifier of the public key that you are updating.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The value of the <code>ETag</code> header that you received when retrieving the public key to update. For example: <code>E2QWRUHAPOMQZL</code>.</p>
    pub fn if_match(&self) -> ::std::option::Option<&str> {
        self.if_match.as_deref()
    }
}
impl UpdatePublicKeyInput {
    /// Creates a new builder-style object to manufacture [`UpdatePublicKeyInput`](crate::operation::update_public_key::UpdatePublicKeyInput).
    pub fn builder() -> crate::operation::update_public_key::builders::UpdatePublicKeyInputBuilder {
        crate::operation::update_public_key::builders::UpdatePublicKeyInputBuilder::default()
    }
}

/// A builder for [`UpdatePublicKeyInput`](crate::operation::update_public_key::UpdatePublicKeyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdatePublicKeyInputBuilder {
    pub(crate) public_key_config: ::std::option::Option<crate::types::PublicKeyConfig>,
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) if_match: ::std::option::Option<::std::string::String>,
}
impl UpdatePublicKeyInputBuilder {
    /// <p>A public key configuration.</p>
    /// This field is required.
    pub fn public_key_config(mut self, input: crate::types::PublicKeyConfig) -> Self {
        self.public_key_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>A public key configuration.</p>
    pub fn set_public_key_config(mut self, input: ::std::option::Option<crate::types::PublicKeyConfig>) -> Self {
        self.public_key_config = input;
        self
    }
    /// <p>A public key configuration.</p>
    pub fn get_public_key_config(&self) -> &::std::option::Option<crate::types::PublicKeyConfig> {
        &self.public_key_config
    }
    /// <p>The identifier of the public key that you are updating.</p>
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the public key that you are updating.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The identifier of the public key that you are updating.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The value of the <code>ETag</code> header that you received when retrieving the public key to update. For example: <code>E2QWRUHAPOMQZL</code>.</p>
    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.if_match = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The value of the <code>ETag</code> header that you received when retrieving the public key to update. For example: <code>E2QWRUHAPOMQZL</code>.</p>
    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.if_match = input;
        self
    }
    /// <p>The value of the <code>ETag</code> header that you received when retrieving the public key to update. For example: <code>E2QWRUHAPOMQZL</code>.</p>
    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
        &self.if_match
    }
    /// Consumes the builder and constructs a [`UpdatePublicKeyInput`](crate::operation::update_public_key::UpdatePublicKeyInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_public_key::UpdatePublicKeyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_public_key::UpdatePublicKeyInput {
            public_key_config: self.public_key_config,
            id: self.id,
            if_match: self.if_match,
        })
    }
}