aws-sdk-ssm 1.131.0

AWS SDK for Amazon Simple Systems Manager (SSM)
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 DeregisterManagedInstanceInput {
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
}
impl DeregisterManagedInstanceInput {
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
}
static DEREGISTERMANAGEDINSTANCEINPUT_MEMBER_INSTANCE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeregisterManagedInstanceInput$InstanceId",
        "com.amazonaws.ssm.synthetic",
        "DeregisterManagedInstanceInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "InstanceId",
    0,
);
static DEREGISTERMANAGEDINSTANCEINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeregisterManagedInstanceInput",
        "com.amazonaws.ssm.synthetic",
        "DeregisterManagedInstanceInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&DEREGISTERMANAGEDINSTANCEINPUT_MEMBER_INSTANCE_ID],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DeregisterManagedInstanceRequest");
impl DeregisterManagedInstanceInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DEREGISTERMANAGEDINSTANCEINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DeregisterManagedInstanceInput {
    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
        Self::SCHEMA
    }

    #[allow(unused_variables, clippy::diverging_sub_expression)]
    fn serialize_members(
        &self,
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        if let Some(ref val) = self.instance_id {
            ser.write_string(&DEREGISTERMANAGEDINSTANCEINPUT_MEMBER_INSTANCE_ID, val)?;
        }
        Ok(())
    }
}
impl crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder {
    #[allow(
        unused_variables,
        unreachable_code,
        clippy::single_match,
        clippy::match_single_binding,
        clippy::diverging_sub_expression
    )]
    pub(crate) fn deserialize_members(
        &mut self,
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        deserializer.read_struct(&DEREGISTERMANAGEDINSTANCEINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.instance_id = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl DeregisterManagedInstanceInput {
    /// Deserializes this structure from a [`ShapeDeserializer`].
    pub fn deserialize(
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
        let mut builder = Self::builder();
        builder.deserialize_members(deserializer)?;
        builder.instance_id = builder.instance_id.or(Some(String::new()));
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl DeregisterManagedInstanceInput {
    /// Creates a new builder-style object to manufacture [`DeregisterManagedInstanceInput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput).
    pub fn builder() -> crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder {
        crate::operation::deregister_managed_instance::builders::DeregisterManagedInstanceInputBuilder::default()
    }
}

/// A builder for [`DeregisterManagedInstanceInput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeregisterManagedInstanceInputBuilder {
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
}
impl DeregisterManagedInstanceInputBuilder {
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
    /// This field is required.
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The ID assigned to the managed node when you registered it using the activation process.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// Consumes the builder and constructs a [`DeregisterManagedInstanceInput`](crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::deregister_managed_instance::DeregisterManagedInstanceInput {
            instance_id: self.instance_id,
        })
    }
}