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 StartExecutionPreviewInput {
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
    pub document_name: ::std::option::Option<::std::string::String>,
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
    pub document_version: ::std::option::Option<::std::string::String>,
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
    pub execution_inputs: ::std::option::Option<crate::types::ExecutionInputs>,
}
impl StartExecutionPreviewInput {
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
    pub fn document_name(&self) -> ::std::option::Option<&str> {
        self.document_name.as_deref()
    }
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
    pub fn document_version(&self) -> ::std::option::Option<&str> {
        self.document_version.as_deref()
    }
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
    pub fn execution_inputs(&self) -> ::std::option::Option<&crate::types::ExecutionInputs> {
        self.execution_inputs.as_ref()
    }
}
static STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput$DocumentName",
        "com.amazonaws.ssm.synthetic",
        "StartExecutionPreviewInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "DocumentName",
    0,
);
static STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput$DocumentVersion",
        "com.amazonaws.ssm.synthetic",
        "StartExecutionPreviewInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "DocumentVersion",
    1,
);
static STARTEXECUTIONPREVIEWINPUT_MEMBER_EXECUTION_INPUTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput$ExecutionInputs",
        "com.amazonaws.ssm.synthetic",
        "StartExecutionPreviewInput",
    ),
    ::aws_smithy_schema::ShapeType::Union,
    "ExecutionInputs",
    2,
);
static STARTEXECUTIONPREVIEWINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#StartExecutionPreviewInput",
        "com.amazonaws.ssm.synthetic",
        "StartExecutionPreviewInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_NAME,
        &STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_VERSION,
        &STARTEXECUTIONPREVIEWINPUT_MEMBER_EXECUTION_INPUTS,
    ],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("StartExecutionPreviewRequest");
impl StartExecutionPreviewInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &STARTEXECUTIONPREVIEWINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for StartExecutionPreviewInput {
    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.document_name {
            ser.write_string(&STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_NAME, val)?;
        }
        if let Some(ref val) = self.document_version {
            ser.write_string(&STARTEXECUTIONPREVIEWINPUT_MEMBER_DOCUMENT_VERSION, val)?;
        }
        if let Some(ref val) = self.execution_inputs {
            ser.write_struct(&STARTEXECUTIONPREVIEWINPUT_MEMBER_EXECUTION_INPUTS, val)?;
        }
        Ok(())
    }
}
impl crate::operation::start_execution_preview::builders::StartExecutionPreviewInputBuilder {
    #[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(&STARTEXECUTIONPREVIEWINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.document_name = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.document_version = Some(deser.read_string(member)?);
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.execution_inputs = Some(crate::types::ExecutionInputs::deserialize(deser)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

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

/// A builder for [`StartExecutionPreviewInput`](crate::operation::start_execution_preview::StartExecutionPreviewInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartExecutionPreviewInputBuilder {
    pub(crate) document_name: ::std::option::Option<::std::string::String>,
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
    pub(crate) execution_inputs: ::std::option::Option<crate::types::ExecutionInputs>,
}
impl StartExecutionPreviewInputBuilder {
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
    /// This field is required.
    pub fn document_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.document_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
    pub fn set_document_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.document_name = input;
        self
    }
    /// <p>The name of the Automation runbook to run. The result of the execution preview indicates what the impact would be of running this runbook.</p>
    pub fn get_document_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.document_name
    }
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.document_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.document_version = input;
        self
    }
    /// <p>The version of the Automation runbook to run. The default value is <code>$DEFAULT</code>.</p>
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.document_version
    }
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
    pub fn execution_inputs(mut self, input: crate::types::ExecutionInputs) -> Self {
        self.execution_inputs = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
    pub fn set_execution_inputs(mut self, input: ::std::option::Option<crate::types::ExecutionInputs>) -> Self {
        self.execution_inputs = input;
        self
    }
    /// <p>Information about the inputs that can be specified for the preview operation.</p>
    pub fn get_execution_inputs(&self) -> &::std::option::Option<crate::types::ExecutionInputs> {
        &self.execution_inputs
    }
    /// Consumes the builder and constructs a [`StartExecutionPreviewInput`](crate::operation::start_execution_preview::StartExecutionPreviewInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_execution_preview::StartExecutionPreviewInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_execution_preview::StartExecutionPreviewInput {
            document_name: self.document_name,
            document_version: self.document_version,
            execution_inputs: self.execution_inputs,
        })
    }
}