aws-sdk-iotdataplane 1.99.0

AWS SDK for AWS IoT Data Plane
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The input for the UpdateThingShadow operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateThingShadowInput {
    /// <p>The name of the thing.</p>
    pub thing_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the shadow.</p>
    pub shadow_name: ::std::option::Option<::std::string::String>,
    /// <p>The state information, in JSON format.</p>
    pub payload: ::std::option::Option<::aws_smithy_types::Blob>,
}
impl UpdateThingShadowInput {
    /// <p>The name of the thing.</p>
    pub fn thing_name(&self) -> ::std::option::Option<&str> {
        self.thing_name.as_deref()
    }
    /// <p>The name of the shadow.</p>
    pub fn shadow_name(&self) -> ::std::option::Option<&str> {
        self.shadow_name.as_deref()
    }
    /// <p>The state information, in JSON format.</p>
    pub fn payload(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
        self.payload.as_ref()
    }
}
impl UpdateThingShadowInput {
    /// Creates a new builder-style object to manufacture [`UpdateThingShadowInput`](crate::operation::update_thing_shadow::UpdateThingShadowInput).
    pub fn builder() -> crate::operation::update_thing_shadow::builders::UpdateThingShadowInputBuilder {
        crate::operation::update_thing_shadow::builders::UpdateThingShadowInputBuilder::default()
    }
}

/// A builder for [`UpdateThingShadowInput`](crate::operation::update_thing_shadow::UpdateThingShadowInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateThingShadowInputBuilder {
    pub(crate) thing_name: ::std::option::Option<::std::string::String>,
    pub(crate) shadow_name: ::std::option::Option<::std::string::String>,
    pub(crate) payload: ::std::option::Option<::aws_smithy_types::Blob>,
}
impl UpdateThingShadowInputBuilder {
    /// <p>The name of the thing.</p>
    /// This field is required.
    pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the thing.</p>
    pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_name = input;
        self
    }
    /// <p>The name of the thing.</p>
    pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_name
    }
    /// <p>The name of the shadow.</p>
    pub fn shadow_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.shadow_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the shadow.</p>
    pub fn set_shadow_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.shadow_name = input;
        self
    }
    /// <p>The name of the shadow.</p>
    pub fn get_shadow_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.shadow_name
    }
    /// <p>The state information, in JSON format.</p>
    /// This field is required.
    pub fn payload(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.payload = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state information, in JSON format.</p>
    pub fn set_payload(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.payload = input;
        self
    }
    /// <p>The state information, in JSON format.</p>
    pub fn get_payload(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.payload
    }
    /// Consumes the builder and constructs a [`UpdateThingShadowInput`](crate::operation::update_thing_shadow::UpdateThingShadowInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_thing_shadow::UpdateThingShadowInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_thing_shadow::UpdateThingShadowInput {
            thing_name: self.thing_name,
            shadow_name: self.shadow_name,
            payload: self.payload,
        })
    }
}