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 GetOpsItemOutput {
    /// <p>The OpsItem.</p>
    pub ops_item: ::std::option::Option<crate::types::OpsItem>,
    _request_id: Option<String>,
}
impl GetOpsItemOutput {
    /// <p>The OpsItem.</p>
    pub fn ops_item(&self) -> ::std::option::Option<&crate::types::OpsItem> {
        self.ops_item.as_ref()
    }
}
static GETOPSITEMOUTPUT_MEMBER_OPS_ITEM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetOpsItemOutput$OpsItem",
        "com.amazonaws.ssm.synthetic",
        "GetOpsItemOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    "OpsItem",
    0,
);
static GETOPSITEMOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetOpsItemOutput",
        "com.amazonaws.ssm.synthetic",
        "GetOpsItemOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&GETOPSITEMOUTPUT_MEMBER_OPS_ITEM],
)
.with_original_name("GetOpsItemResponse");
impl GetOpsItemOutput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETOPSITEMOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetOpsItemOutput {
    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.ops_item {
            ser.write_struct(&GETOPSITEMOUTPUT_MEMBER_OPS_ITEM, val)?;
        }
        Ok(())
    }
}
impl crate::operation::get_ops_item::builders::GetOpsItemOutputBuilder {
    #[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(&GETOPSITEMOUTPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.ops_item = Some(crate::types::OpsItem::deserialize(deser)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl GetOpsItemOutput {
    /// 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 GetOpsItemOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetOpsItemOutput {
    /// Creates a new builder-style object to manufacture [`GetOpsItemOutput`](crate::operation::get_ops_item::GetOpsItemOutput).
    pub fn builder() -> crate::operation::get_ops_item::builders::GetOpsItemOutputBuilder {
        crate::operation::get_ops_item::builders::GetOpsItemOutputBuilder::default()
    }
}

/// A builder for [`GetOpsItemOutput`](crate::operation::get_ops_item::GetOpsItemOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetOpsItemOutputBuilder {
    pub(crate) ops_item: ::std::option::Option<crate::types::OpsItem>,
    _request_id: Option<String>,
}
impl GetOpsItemOutputBuilder {
    /// <p>The OpsItem.</p>
    pub fn ops_item(mut self, input: crate::types::OpsItem) -> Self {
        self.ops_item = ::std::option::Option::Some(input);
        self
    }
    /// <p>The OpsItem.</p>
    pub fn set_ops_item(mut self, input: ::std::option::Option<crate::types::OpsItem>) -> Self {
        self.ops_item = input;
        self
    }
    /// <p>The OpsItem.</p>
    pub fn get_ops_item(&self) -> &::std::option::Option<crate::types::OpsItem> {
        &self.ops_item
    }
    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 [`GetOpsItemOutput`](crate::operation::get_ops_item::GetOpsItemOutput).
    pub fn build(self) -> crate::operation::get_ops_item::GetOpsItemOutput {
        crate::operation::get_ops_item::GetOpsItemOutput {
            ops_item: self.ops_item,
            _request_id: self._request_id,
        }
    }
}