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 GetConnectionStatusOutput {
    /// <p>The ID of the managed node to check connection status.</p>
    pub target: ::std::option::Option<::std::string::String>,
    /// <p>The status of the connection to the managed node.</p>
    pub status: ::std::option::Option<crate::types::ConnectionStatus>,
    _request_id: Option<String>,
}
impl GetConnectionStatusOutput {
    /// <p>The ID of the managed node to check connection status.</p>
    pub fn target(&self) -> ::std::option::Option<&str> {
        self.target.as_deref()
    }
    /// <p>The status of the connection to the managed node.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::ConnectionStatus> {
        self.status.as_ref()
    }
}
static GETCONNECTIONSTATUSOUTPUT_MEMBER_TARGET: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetConnectionStatusOutput$Target",
        "com.amazonaws.ssm.synthetic",
        "GetConnectionStatusOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Target",
    0,
);
static GETCONNECTIONSTATUSOUTPUT_MEMBER_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetConnectionStatusOutput$Status",
        "com.amazonaws.ssm.synthetic",
        "GetConnectionStatusOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Status",
    1,
);
static GETCONNECTIONSTATUSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetConnectionStatusOutput",
        "com.amazonaws.ssm.synthetic",
        "GetConnectionStatusOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&GETCONNECTIONSTATUSOUTPUT_MEMBER_TARGET, &GETCONNECTIONSTATUSOUTPUT_MEMBER_STATUS],
)
.with_original_name("GetConnectionStatusResponse");
impl GetConnectionStatusOutput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETCONNECTIONSTATUSOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetConnectionStatusOutput {
    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.target {
            ser.write_string(&GETCONNECTIONSTATUSOUTPUT_MEMBER_TARGET, val)?;
        }
        if let Some(ref val) = self.status {
            ser.write_string(&GETCONNECTIONSTATUSOUTPUT_MEMBER_STATUS, val.as_str())?;
        }
        Ok(())
    }
}
impl crate::operation::get_connection_status::builders::GetConnectionStatusOutputBuilder {
    #[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(&GETCONNECTIONSTATUSOUTPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.target = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.status = Some(crate::types::ConnectionStatus::from(deser.read_string(member)?.as_str()));
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl GetConnectionStatusOutput {
    /// 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)?;
        Ok(builder.build())
    }
}
impl ::aws_types::request_id::RequestId for GetConnectionStatusOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetConnectionStatusOutput {
    /// Creates a new builder-style object to manufacture [`GetConnectionStatusOutput`](crate::operation::get_connection_status::GetConnectionStatusOutput).
    pub fn builder() -> crate::operation::get_connection_status::builders::GetConnectionStatusOutputBuilder {
        crate::operation::get_connection_status::builders::GetConnectionStatusOutputBuilder::default()
    }
}

/// A builder for [`GetConnectionStatusOutput`](crate::operation::get_connection_status::GetConnectionStatusOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetConnectionStatusOutputBuilder {
    pub(crate) target: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ConnectionStatus>,
    _request_id: Option<String>,
}
impl GetConnectionStatusOutputBuilder {
    /// <p>The ID of the managed node to check connection status.</p>
    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the managed node to check connection status.</p>
    pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target = input;
        self
    }
    /// <p>The ID of the managed node to check connection status.</p>
    pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
        &self.target
    }
    /// <p>The status of the connection to the managed node.</p>
    pub fn status(mut self, input: crate::types::ConnectionStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the connection to the managed node.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ConnectionStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the connection to the managed node.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ConnectionStatus> {
        &self.status
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetConnectionStatusOutput`](crate::operation::get_connection_status::GetConnectionStatusOutput).
    pub fn build(self) -> crate::operation::get_connection_status::GetConnectionStatusOutput {
        crate::operation::get_connection_status::GetConnectionStatusOutput {
            target: self.target,
            status: self.status,
            _request_id: self._request_id,
        }
    }
}