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 DeleteOpsItemInput {
    /// <p>The ID of the OpsItem that you want to delete.</p>
    pub ops_item_id: ::std::option::Option<::std::string::String>,
}
impl DeleteOpsItemInput {
    /// <p>The ID of the OpsItem that you want to delete.</p>
    pub fn ops_item_id(&self) -> ::std::option::Option<&str> {
        self.ops_item_id.as_deref()
    }
}
static DELETEOPSITEMINPUT_MEMBER_OPS_ITEM_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeleteOpsItemInput$OpsItemId",
        "com.amazonaws.ssm.synthetic",
        "DeleteOpsItemInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "OpsItemId",
    0,
);
static DELETEOPSITEMINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#DeleteOpsItemInput",
        "com.amazonaws.ssm.synthetic",
        "DeleteOpsItemInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[&DELETEOPSITEMINPUT_MEMBER_OPS_ITEM_ID],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("DeleteOpsItemRequest");
impl DeleteOpsItemInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DELETEOPSITEMINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for DeleteOpsItemInput {
    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_id {
            ser.write_string(&DELETEOPSITEMINPUT_MEMBER_OPS_ITEM_ID, val)?;
        }
        Ok(())
    }
}
impl crate::operation::delete_ops_item::builders::DeleteOpsItemInputBuilder {
    #[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(&DELETEOPSITEMINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.ops_item_id = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl DeleteOpsItemInput {
    /// 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.ops_item_id = builder.ops_item_id.or(Some(String::new()));
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl DeleteOpsItemInput {
    /// Creates a new builder-style object to manufacture [`DeleteOpsItemInput`](crate::operation::delete_ops_item::DeleteOpsItemInput).
    pub fn builder() -> crate::operation::delete_ops_item::builders::DeleteOpsItemInputBuilder {
        crate::operation::delete_ops_item::builders::DeleteOpsItemInputBuilder::default()
    }
}

/// A builder for [`DeleteOpsItemInput`](crate::operation::delete_ops_item::DeleteOpsItemInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeleteOpsItemInputBuilder {
    pub(crate) ops_item_id: ::std::option::Option<::std::string::String>,
}
impl DeleteOpsItemInputBuilder {
    /// <p>The ID of the OpsItem that you want to delete.</p>
    /// This field is required.
    pub fn ops_item_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ops_item_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the OpsItem that you want to delete.</p>
    pub fn set_ops_item_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ops_item_id = input;
        self
    }
    /// <p>The ID of the OpsItem that you want to delete.</p>
    pub fn get_ops_item_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.ops_item_id
    }
    /// Consumes the builder and constructs a [`DeleteOpsItemInput`](crate::operation::delete_ops_item::DeleteOpsItemInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::delete_ops_item::DeleteOpsItemInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::delete_ops_item::DeleteOpsItemInput {
            ops_item_id: self.ops_item_id,
        })
    }
}