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 GetExecutionPreviewOutput {
    /// <p>The generated ID for the existing execution preview.</p>
    pub execution_preview_id: ::std::option::Option<::std::string::String>,
    /// <p>A UTC timestamp indicating when the execution preview operation ended.</p>
    pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The current status of the execution preview operation.</p>
    pub status: ::std::option::Option<crate::types::ExecutionPreviewStatus>,
    /// <p>Supplemental information about the current status of the execution preview.</p>
    pub status_message: ::std::option::Option<::std::string::String>,
    /// <p>Information about the changes that would be made if an execution were run.</p>
    pub execution_preview: ::std::option::Option<crate::types::ExecutionPreview>,
    _request_id: Option<String>,
}
impl GetExecutionPreviewOutput {
    /// <p>The generated ID for the existing execution preview.</p>
    pub fn execution_preview_id(&self) -> ::std::option::Option<&str> {
        self.execution_preview_id.as_deref()
    }
    /// <p>A UTC timestamp indicating when the execution preview operation ended.</p>
    pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.ended_at.as_ref()
    }
    /// <p>The current status of the execution preview operation.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::ExecutionPreviewStatus> {
        self.status.as_ref()
    }
    /// <p>Supplemental information about the current status of the execution preview.</p>
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// <p>Information about the changes that would be made if an execution were run.</p>
    pub fn execution_preview(&self) -> ::std::option::Option<&crate::types::ExecutionPreview> {
        self.execution_preview.as_ref()
    }
}
static GETEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetExecutionPreviewOutput$ExecutionPreviewId",
        "com.amazonaws.ssm.synthetic",
        "GetExecutionPreviewOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "ExecutionPreviewId",
    0,
);
static GETEXECUTIONPREVIEWOUTPUT_MEMBER_ENDED_AT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetExecutionPreviewOutput$EndedAt",
        "com.amazonaws.ssm.synthetic",
        "GetExecutionPreviewOutput",
    ),
    ::aws_smithy_schema::ShapeType::Timestamp,
    "EndedAt",
    1,
);
static GETEXECUTIONPREVIEWOUTPUT_MEMBER_STATUS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetExecutionPreviewOutput$Status",
        "com.amazonaws.ssm.synthetic",
        "GetExecutionPreviewOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Status",
    2,
);
static GETEXECUTIONPREVIEWOUTPUT_MEMBER_STATUS_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetExecutionPreviewOutput$StatusMessage",
        "com.amazonaws.ssm.synthetic",
        "GetExecutionPreviewOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "StatusMessage",
    3,
);
static GETEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetExecutionPreviewOutput$ExecutionPreview",
        "com.amazonaws.ssm.synthetic",
        "GetExecutionPreviewOutput",
    ),
    ::aws_smithy_schema::ShapeType::Union,
    "ExecutionPreview",
    4,
);
static GETEXECUTIONPREVIEWOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetExecutionPreviewOutput",
        "com.amazonaws.ssm.synthetic",
        "GetExecutionPreviewOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &GETEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW_ID,
        &GETEXECUTIONPREVIEWOUTPUT_MEMBER_ENDED_AT,
        &GETEXECUTIONPREVIEWOUTPUT_MEMBER_STATUS,
        &GETEXECUTIONPREVIEWOUTPUT_MEMBER_STATUS_MESSAGE,
        &GETEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW,
    ],
)
.with_original_name("GetExecutionPreviewResponse");
impl GetExecutionPreviewOutput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETEXECUTIONPREVIEWOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetExecutionPreviewOutput {
    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.execution_preview_id {
            ser.write_string(&GETEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW_ID, val)?;
        }
        if let Some(ref val) = self.ended_at {
            ser.write_timestamp(&GETEXECUTIONPREVIEWOUTPUT_MEMBER_ENDED_AT, val)?;
        }
        if let Some(ref val) = self.status {
            ser.write_string(&GETEXECUTIONPREVIEWOUTPUT_MEMBER_STATUS, val.as_str())?;
        }
        if let Some(ref val) = self.status_message {
            ser.write_string(&GETEXECUTIONPREVIEWOUTPUT_MEMBER_STATUS_MESSAGE, val)?;
        }
        if let Some(ref val) = self.execution_preview {
            ser.write_struct(&GETEXECUTIONPREVIEWOUTPUT_MEMBER_EXECUTION_PREVIEW, val)?;
        }
        Ok(())
    }
}
impl crate::operation::get_execution_preview::builders::GetExecutionPreviewOutputBuilder {
    #[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(&GETEXECUTIONPREVIEWOUTPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.execution_preview_id = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.ended_at = Some(deser.read_timestamp(member)?);
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.status = Some(crate::types::ExecutionPreviewStatus::from(deser.read_string(member)?.as_str()));
                    }
                }
                Some(3) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.status_message = Some(deser.read_string(member)?);
                    }
                }
                Some(4) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.execution_preview = Some(crate::types::ExecutionPreview::deserialize(deser)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

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

/// A builder for [`GetExecutionPreviewOutput`](crate::operation::get_execution_preview::GetExecutionPreviewOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetExecutionPreviewOutputBuilder {
    pub(crate) execution_preview_id: ::std::option::Option<::std::string::String>,
    pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) status: ::std::option::Option<crate::types::ExecutionPreviewStatus>,
    pub(crate) status_message: ::std::option::Option<::std::string::String>,
    pub(crate) execution_preview: ::std::option::Option<crate::types::ExecutionPreview>,
    _request_id: Option<String>,
}
impl GetExecutionPreviewOutputBuilder {
    /// <p>The generated ID for the existing execution preview.</p>
    pub fn execution_preview_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.execution_preview_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The generated ID for the existing execution preview.</p>
    pub fn set_execution_preview_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.execution_preview_id = input;
        self
    }
    /// <p>The generated ID for the existing execution preview.</p>
    pub fn get_execution_preview_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_preview_id
    }
    /// <p>A UTC timestamp indicating when the execution preview operation ended.</p>
    pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.ended_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>A UTC timestamp indicating when the execution preview operation ended.</p>
    pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.ended_at = input;
        self
    }
    /// <p>A UTC timestamp indicating when the execution preview operation ended.</p>
    pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.ended_at
    }
    /// <p>The current status of the execution preview operation.</p>
    pub fn status(mut self, input: crate::types::ExecutionPreviewStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the execution preview operation.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ExecutionPreviewStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the execution preview operation.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ExecutionPreviewStatus> {
        &self.status
    }
    /// <p>Supplemental information about the current status of the execution preview.</p>
    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Supplemental information about the current status of the execution preview.</p>
    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_message = input;
        self
    }
    /// <p>Supplemental information about the current status of the execution preview.</p>
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// <p>Information about the changes that would be made if an execution were run.</p>
    pub fn execution_preview(mut self, input: crate::types::ExecutionPreview) -> Self {
        self.execution_preview = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the changes that would be made if an execution were run.</p>
    pub fn set_execution_preview(mut self, input: ::std::option::Option<crate::types::ExecutionPreview>) -> Self {
        self.execution_preview = input;
        self
    }
    /// <p>Information about the changes that would be made if an execution were run.</p>
    pub fn get_execution_preview(&self) -> &::std::option::Option<crate::types::ExecutionPreview> {
        &self.execution_preview
    }
    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 [`GetExecutionPreviewOutput`](crate::operation::get_execution_preview::GetExecutionPreviewOutput).
    pub fn build(self) -> crate::operation::get_execution_preview::GetExecutionPreviewOutput {
        crate::operation::get_execution_preview::GetExecutionPreviewOutput {
            execution_preview_id: self.execution_preview_id,
            ended_at: self.ended_at,
            status: self.status,
            status_message: self.status_message,
            execution_preview: self.execution_preview,
            _request_id: self._request_id,
        }
    }
}