aws-sdk-deadline 1.94.0

AWS SDK for AWSDeadlineCloud
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)]
pub struct GetSessionActionOutput {
    /// <p>The session action ID.</p>
    pub session_action_id: ::std::string::String,
    /// <p>The status of the session action.</p>
    pub status: crate::types::SessionActionStatus,
    /// <p>The date and time the resource started running.</p>
    pub started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time the resource ended running.</p>
    pub ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Linux timestamp of the date and time the session action was last updated.</p>
    pub worker_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The percentage completed for a session action.</p>
    pub progress_percent: ::std::option::Option<f32>,
    /// <p>The session ID for the session action.</p>
    pub session_id: ::std::string::String,
    /// <p>The process exit code. The default Deadline Cloud worker agent converts unsigned 32-bit exit codes to signed 32-bit exit codes.</p>
    pub process_exit_code: ::std::option::Option<i32>,
    /// <p>The message that communicates the progress of the session action.</p>
    pub progress_message: ::std::option::Option<::std::string::String>,
    /// <p>The session action definition.</p>
    pub definition: ::std::option::Option<crate::types::SessionActionDefinition>,
    /// <p>The limits and their amounts acquired during a session action. If no limits were acquired during the session, this field isn't returned.</p>
    pub acquired_limits: ::std::option::Option<::std::vec::Vec<crate::types::AcquiredLimit>>,
    /// <p>The list of manifest properties that describe file attachments for the task run.</p>
    pub manifests: ::std::option::Option<::std::vec::Vec<crate::types::TaskRunManifestPropertiesResponse>>,
    _request_id: Option<String>,
}
impl GetSessionActionOutput {
    /// <p>The session action ID.</p>
    pub fn session_action_id(&self) -> &str {
        use std::ops::Deref;
        self.session_action_id.deref()
    }
    /// <p>The status of the session action.</p>
    pub fn status(&self) -> &crate::types::SessionActionStatus {
        &self.status
    }
    /// <p>The date and time the resource started running.</p>
    pub fn started_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.started_at.as_ref()
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn ended_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.ended_at.as_ref()
    }
    /// <p>The Linux timestamp of the date and time the session action was last updated.</p>
    pub fn worker_updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.worker_updated_at.as_ref()
    }
    /// <p>The percentage completed for a session action.</p>
    pub fn progress_percent(&self) -> ::std::option::Option<f32> {
        self.progress_percent
    }
    /// <p>The session ID for the session action.</p>
    pub fn session_id(&self) -> &str {
        use std::ops::Deref;
        self.session_id.deref()
    }
    /// <p>The process exit code. The default Deadline Cloud worker agent converts unsigned 32-bit exit codes to signed 32-bit exit codes.</p>
    pub fn process_exit_code(&self) -> ::std::option::Option<i32> {
        self.process_exit_code
    }
    /// <p>The message that communicates the progress of the session action.</p>
    pub fn progress_message(&self) -> ::std::option::Option<&str> {
        self.progress_message.as_deref()
    }
    /// <p>The session action definition.</p>
    pub fn definition(&self) -> ::std::option::Option<&crate::types::SessionActionDefinition> {
        self.definition.as_ref()
    }
    /// <p>The limits and their amounts acquired during a session action. If no limits were acquired during the session, this field isn't returned.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.acquired_limits.is_none()`.
    pub fn acquired_limits(&self) -> &[crate::types::AcquiredLimit] {
        self.acquired_limits.as_deref().unwrap_or_default()
    }
    /// <p>The list of manifest properties that describe file attachments for the task run.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.manifests.is_none()`.
    pub fn manifests(&self) -> &[crate::types::TaskRunManifestPropertiesResponse] {
        self.manifests.as_deref().unwrap_or_default()
    }
}
impl ::std::fmt::Debug for GetSessionActionOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetSessionActionOutput");
        formatter.field("session_action_id", &self.session_action_id);
        formatter.field("status", &self.status);
        formatter.field("started_at", &self.started_at);
        formatter.field("ended_at", &self.ended_at);
        formatter.field("worker_updated_at", &self.worker_updated_at);
        formatter.field("progress_percent", &self.progress_percent);
        formatter.field("session_id", &self.session_id);
        formatter.field("process_exit_code", &self.process_exit_code);
        formatter.field("progress_message", &"*** Sensitive Data Redacted ***");
        formatter.field("definition", &self.definition);
        formatter.field("acquired_limits", &self.acquired_limits);
        formatter.field("manifests", &self.manifests);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetSessionActionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSessionActionOutput {
    /// Creates a new builder-style object to manufacture [`GetSessionActionOutput`](crate::operation::get_session_action::GetSessionActionOutput).
    pub fn builder() -> crate::operation::get_session_action::builders::GetSessionActionOutputBuilder {
        crate::operation::get_session_action::builders::GetSessionActionOutputBuilder::default()
    }
}

/// A builder for [`GetSessionActionOutput`](crate::operation::get_session_action::GetSessionActionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetSessionActionOutputBuilder {
    pub(crate) session_action_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::SessionActionStatus>,
    pub(crate) started_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) ended_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) worker_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) progress_percent: ::std::option::Option<f32>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) process_exit_code: ::std::option::Option<i32>,
    pub(crate) progress_message: ::std::option::Option<::std::string::String>,
    pub(crate) definition: ::std::option::Option<crate::types::SessionActionDefinition>,
    pub(crate) acquired_limits: ::std::option::Option<::std::vec::Vec<crate::types::AcquiredLimit>>,
    pub(crate) manifests: ::std::option::Option<::std::vec::Vec<crate::types::TaskRunManifestPropertiesResponse>>,
    _request_id: Option<String>,
}
impl GetSessionActionOutputBuilder {
    /// <p>The session action ID.</p>
    /// This field is required.
    pub fn session_action_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_action_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The session action ID.</p>
    pub fn set_session_action_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_action_id = input;
        self
    }
    /// <p>The session action ID.</p>
    pub fn get_session_action_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_action_id
    }
    /// <p>The status of the session action.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::SessionActionStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the session action.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::SessionActionStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the session action.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::SessionActionStatus> {
        &self.status
    }
    /// <p>The date and time the resource started running.</p>
    pub fn started_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.started_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time the resource started running.</p>
    pub fn set_started_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.started_at = input;
        self
    }
    /// <p>The date and time the resource started running.</p>
    pub fn get_started_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.started_at
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn ended_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.ended_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn set_ended_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.ended_at = input;
        self
    }
    /// <p>The date and time the resource ended running.</p>
    pub fn get_ended_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.ended_at
    }
    /// <p>The Linux timestamp of the date and time the session action was last updated.</p>
    pub fn worker_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.worker_updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Linux timestamp of the date and time the session action was last updated.</p>
    pub fn set_worker_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.worker_updated_at = input;
        self
    }
    /// <p>The Linux timestamp of the date and time the session action was last updated.</p>
    pub fn get_worker_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.worker_updated_at
    }
    /// <p>The percentage completed for a session action.</p>
    pub fn progress_percent(mut self, input: f32) -> Self {
        self.progress_percent = ::std::option::Option::Some(input);
        self
    }
    /// <p>The percentage completed for a session action.</p>
    pub fn set_progress_percent(mut self, input: ::std::option::Option<f32>) -> Self {
        self.progress_percent = input;
        self
    }
    /// <p>The percentage completed for a session action.</p>
    pub fn get_progress_percent(&self) -> &::std::option::Option<f32> {
        &self.progress_percent
    }
    /// <p>The session ID for the session action.</p>
    /// This field is required.
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The session ID for the session action.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The session ID for the session action.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The process exit code. The default Deadline Cloud worker agent converts unsigned 32-bit exit codes to signed 32-bit exit codes.</p>
    pub fn process_exit_code(mut self, input: i32) -> Self {
        self.process_exit_code = ::std::option::Option::Some(input);
        self
    }
    /// <p>The process exit code. The default Deadline Cloud worker agent converts unsigned 32-bit exit codes to signed 32-bit exit codes.</p>
    pub fn set_process_exit_code(mut self, input: ::std::option::Option<i32>) -> Self {
        self.process_exit_code = input;
        self
    }
    /// <p>The process exit code. The default Deadline Cloud worker agent converts unsigned 32-bit exit codes to signed 32-bit exit codes.</p>
    pub fn get_process_exit_code(&self) -> &::std::option::Option<i32> {
        &self.process_exit_code
    }
    /// <p>The message that communicates the progress of the session action.</p>
    pub fn progress_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.progress_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message that communicates the progress of the session action.</p>
    pub fn set_progress_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.progress_message = input;
        self
    }
    /// <p>The message that communicates the progress of the session action.</p>
    pub fn get_progress_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.progress_message
    }
    /// <p>The session action definition.</p>
    /// This field is required.
    pub fn definition(mut self, input: crate::types::SessionActionDefinition) -> Self {
        self.definition = ::std::option::Option::Some(input);
        self
    }
    /// <p>The session action definition.</p>
    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::SessionActionDefinition>) -> Self {
        self.definition = input;
        self
    }
    /// <p>The session action definition.</p>
    pub fn get_definition(&self) -> &::std::option::Option<crate::types::SessionActionDefinition> {
        &self.definition
    }
    /// Appends an item to `acquired_limits`.
    ///
    /// To override the contents of this collection use [`set_acquired_limits`](Self::set_acquired_limits).
    ///
    /// <p>The limits and their amounts acquired during a session action. If no limits were acquired during the session, this field isn't returned.</p>
    pub fn acquired_limits(mut self, input: crate::types::AcquiredLimit) -> Self {
        let mut v = self.acquired_limits.unwrap_or_default();
        v.push(input);
        self.acquired_limits = ::std::option::Option::Some(v);
        self
    }
    /// <p>The limits and their amounts acquired during a session action. If no limits were acquired during the session, this field isn't returned.</p>
    pub fn set_acquired_limits(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AcquiredLimit>>) -> Self {
        self.acquired_limits = input;
        self
    }
    /// <p>The limits and their amounts acquired during a session action. If no limits were acquired during the session, this field isn't returned.</p>
    pub fn get_acquired_limits(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AcquiredLimit>> {
        &self.acquired_limits
    }
    /// Appends an item to `manifests`.
    ///
    /// To override the contents of this collection use [`set_manifests`](Self::set_manifests).
    ///
    /// <p>The list of manifest properties that describe file attachments for the task run.</p>
    pub fn manifests(mut self, input: crate::types::TaskRunManifestPropertiesResponse) -> Self {
        let mut v = self.manifests.unwrap_or_default();
        v.push(input);
        self.manifests = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of manifest properties that describe file attachments for the task run.</p>
    pub fn set_manifests(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TaskRunManifestPropertiesResponse>>) -> Self {
        self.manifests = input;
        self
    }
    /// <p>The list of manifest properties that describe file attachments for the task run.</p>
    pub fn get_manifests(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TaskRunManifestPropertiesResponse>> {
        &self.manifests
    }
    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 [`GetSessionActionOutput`](crate::operation::get_session_action::GetSessionActionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`session_action_id`](crate::operation::get_session_action::builders::GetSessionActionOutputBuilder::session_action_id)
    /// - [`status`](crate::operation::get_session_action::builders::GetSessionActionOutputBuilder::status)
    /// - [`session_id`](crate::operation::get_session_action::builders::GetSessionActionOutputBuilder::session_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_session_action::GetSessionActionOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_session_action::GetSessionActionOutput {
            session_action_id: self.session_action_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_action_id",
                    "session_action_id was not specified but it is required when building GetSessionActionOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetSessionActionOutput",
                )
            })?,
            started_at: self.started_at,
            ended_at: self.ended_at,
            worker_updated_at: self.worker_updated_at,
            progress_percent: self.progress_percent,
            session_id: self.session_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_id",
                    "session_id was not specified but it is required when building GetSessionActionOutput",
                )
            })?,
            process_exit_code: self.process_exit_code,
            progress_message: self.progress_message,
            definition: self.definition,
            acquired_limits: self.acquired_limits,
            manifests: self.manifests,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetSessionActionOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetSessionActionOutputBuilder");
        formatter.field("session_action_id", &self.session_action_id);
        formatter.field("status", &self.status);
        formatter.field("started_at", &self.started_at);
        formatter.field("ended_at", &self.ended_at);
        formatter.field("worker_updated_at", &self.worker_updated_at);
        formatter.field("progress_percent", &self.progress_percent);
        formatter.field("session_id", &self.session_id);
        formatter.field("process_exit_code", &self.process_exit_code);
        formatter.field("progress_message", &"*** Sensitive Data Redacted ***");
        formatter.field("definition", &self.definition);
        formatter.field("acquired_limits", &self.acquired_limits);
        formatter.field("manifests", &self.manifests);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}