aws-sdk-devopsagent 1.4.0

AWS SDK for AWS DevOps Agent Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Represents an execution instance with its lifecycle information
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Execution {
    /// The unique identifier for the agent space containing this execution
    pub agent_space_id: ::std::string::String,
    /// The unique identifier for this execution
    pub execution_id: ::std::string::String,
    /// The identifier of the parent execution, if this is a child execution
    pub parent_execution_id: ::std::option::Option<::std::string::String>,
    /// The specific subtask being executed by the agent
    pub agent_sub_task: ::std::string::String,
    /// Timestamp when this execution was created
    pub created_at: ::aws_smithy_types::DateTime,
    /// Timestamp when this execution was last updated
    pub updated_at: ::aws_smithy_types::DateTime,
    /// The current status of this execution
    pub execution_status: crate::types::ExecutionStatus,
    /// The type of agent that performed this execution.
    pub agent_type: ::std::option::Option<::std::string::String>,
    /// The unique identifier for the user session associated with this execution
    pub uid: ::std::option::Option<::std::string::String>,
}
impl Execution {
    /// The unique identifier for the agent space containing this execution
    pub fn agent_space_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_id.deref()
    }
    /// The unique identifier for this execution
    pub fn execution_id(&self) -> &str {
        use std::ops::Deref;
        self.execution_id.deref()
    }
    /// The identifier of the parent execution, if this is a child execution
    pub fn parent_execution_id(&self) -> ::std::option::Option<&str> {
        self.parent_execution_id.as_deref()
    }
    /// The specific subtask being executed by the agent
    pub fn agent_sub_task(&self) -> &str {
        use std::ops::Deref;
        self.agent_sub_task.deref()
    }
    /// Timestamp when this execution was created
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// Timestamp when this execution was last updated
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// The current status of this execution
    pub fn execution_status(&self) -> &crate::types::ExecutionStatus {
        &self.execution_status
    }
    /// The type of agent that performed this execution.
    pub fn agent_type(&self) -> ::std::option::Option<&str> {
        self.agent_type.as_deref()
    }
    /// The unique identifier for the user session associated with this execution
    pub fn uid(&self) -> ::std::option::Option<&str> {
        self.uid.as_deref()
    }
}
impl Execution {
    /// Creates a new builder-style object to manufacture [`Execution`](crate::types::Execution).
    pub fn builder() -> crate::types::builders::ExecutionBuilder {
        crate::types::builders::ExecutionBuilder::default()
    }
}

/// A builder for [`Execution`](crate::types::Execution).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExecutionBuilder {
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
    pub(crate) parent_execution_id: ::std::option::Option<::std::string::String>,
    pub(crate) agent_sub_task: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) execution_status: ::std::option::Option<crate::types::ExecutionStatus>,
    pub(crate) agent_type: ::std::option::Option<::std::string::String>,
    pub(crate) uid: ::std::option::Option<::std::string::String>,
}
impl ExecutionBuilder {
    /// The unique identifier for the agent space containing this execution
    /// This field is required.
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier for the agent space containing this execution
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// The unique identifier for the agent space containing this execution
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// The unique identifier for this execution
    /// This field is required.
    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.execution_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier for this execution
    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.execution_id = input;
        self
    }
    /// The unique identifier for this execution
    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_id
    }
    /// The identifier of the parent execution, if this is a child execution
    pub fn parent_execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.parent_execution_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The identifier of the parent execution, if this is a child execution
    pub fn set_parent_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.parent_execution_id = input;
        self
    }
    /// The identifier of the parent execution, if this is a child execution
    pub fn get_parent_execution_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.parent_execution_id
    }
    /// The specific subtask being executed by the agent
    /// This field is required.
    pub fn agent_sub_task(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_sub_task = ::std::option::Option::Some(input.into());
        self
    }
    /// The specific subtask being executed by the agent
    pub fn set_agent_sub_task(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_sub_task = input;
        self
    }
    /// The specific subtask being executed by the agent
    pub fn get_agent_sub_task(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_sub_task
    }
    /// Timestamp when this execution was created
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when this execution was created
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// Timestamp when this execution was created
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// Timestamp when this execution was last updated
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when this execution was last updated
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// Timestamp when this execution was last updated
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// The current status of this execution
    /// This field is required.
    pub fn execution_status(mut self, input: crate::types::ExecutionStatus) -> Self {
        self.execution_status = ::std::option::Option::Some(input);
        self
    }
    /// The current status of this execution
    pub fn set_execution_status(mut self, input: ::std::option::Option<crate::types::ExecutionStatus>) -> Self {
        self.execution_status = input;
        self
    }
    /// The current status of this execution
    pub fn get_execution_status(&self) -> &::std::option::Option<crate::types::ExecutionStatus> {
        &self.execution_status
    }
    /// The type of agent that performed this execution.
    pub fn agent_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_type = ::std::option::Option::Some(input.into());
        self
    }
    /// The type of agent that performed this execution.
    pub fn set_agent_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_type = input;
        self
    }
    /// The type of agent that performed this execution.
    pub fn get_agent_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_type
    }
    /// The unique identifier for the user session associated with this execution
    pub fn uid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.uid = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier for the user session associated with this execution
    pub fn set_uid(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.uid = input;
        self
    }
    /// The unique identifier for the user session associated with this execution
    pub fn get_uid(&self) -> &::std::option::Option<::std::string::String> {
        &self.uid
    }
    /// Consumes the builder and constructs a [`Execution`](crate::types::Execution).
    /// This method will fail if any of the following fields are not set:
    /// - [`agent_space_id`](crate::types::builders::ExecutionBuilder::agent_space_id)
    /// - [`execution_id`](crate::types::builders::ExecutionBuilder::execution_id)
    /// - [`agent_sub_task`](crate::types::builders::ExecutionBuilder::agent_sub_task)
    /// - [`created_at`](crate::types::builders::ExecutionBuilder::created_at)
    /// - [`updated_at`](crate::types::builders::ExecutionBuilder::updated_at)
    /// - [`execution_status`](crate::types::builders::ExecutionBuilder::execution_status)
    pub fn build(self) -> ::std::result::Result<crate::types::Execution, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Execution {
            agent_space_id: self.agent_space_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_space_id",
                    "agent_space_id was not specified but it is required when building Execution",
                )
            })?,
            execution_id: self.execution_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "execution_id",
                    "execution_id was not specified but it is required when building Execution",
                )
            })?,
            parent_execution_id: self.parent_execution_id,
            agent_sub_task: self.agent_sub_task.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_sub_task",
                    "agent_sub_task was not specified but it is required when building Execution",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building Execution",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building Execution",
                )
            })?,
            execution_status: self.execution_status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "execution_status",
                    "execution_status was not specified but it is required when building Execution",
                )
            })?,
            agent_type: self.agent_type,
            uid: self.uid,
        })
    }
}