aws-sdk-securityagent 1.1.0

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

/// Represents a task within a pentest job
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Task {
    /// Unique identifier for the task
    pub task_id: ::std::string::String,
    /// Identifier of the parent pentest
    pub pentest_id: ::std::option::Option<::std::string::String>,
    /// Identifier of the pentest job this task belongs to
    pub pentest_job_id: ::std::option::Option<::std::string::String>,
    /// Identifier of the agent space this task belongs to
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// Title or name of the task
    pub title: ::std::option::Option<::std::string::String>,
    /// Detailed description of the task's purpose and scope
    pub description: ::std::option::Option<::std::string::String>,
    /// List of categories associated with this task
    pub categories: ::std::option::Option<::std::vec::Vec<crate::types::Category>>,
    /// Type of security risk this task is designed to test
    pub risk_type: ::std::option::Option<crate::types::RiskType>,
    /// Target endpoint for this security test
    pub target_endpoint: ::std::option::Option<crate::types::Endpoint>,
    /// Current status of the task execution
    pub execution_status: ::std::option::Option<crate::types::TaskExecutionStatus>,
    /// Location of execution logs for auditing and review
    pub logs_location: ::std::option::Option<crate::types::LogLocation>,
    /// Timestamp when the task was created
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Timestamp when the task was last updated
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Task {
    /// Unique identifier for the task
    pub fn task_id(&self) -> &str {
        use std::ops::Deref;
        self.task_id.deref()
    }
    /// Identifier of the parent pentest
    pub fn pentest_id(&self) -> ::std::option::Option<&str> {
        self.pentest_id.as_deref()
    }
    /// Identifier of the pentest job this task belongs to
    pub fn pentest_job_id(&self) -> ::std::option::Option<&str> {
        self.pentest_job_id.as_deref()
    }
    /// Identifier of the agent space this task belongs to
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// Title or name of the task
    pub fn title(&self) -> ::std::option::Option<&str> {
        self.title.as_deref()
    }
    /// Detailed description of the task's purpose and scope
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// List of categories associated with this task
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.categories.is_none()`.
    pub fn categories(&self) -> &[crate::types::Category] {
        self.categories.as_deref().unwrap_or_default()
    }
    /// Type of security risk this task is designed to test
    pub fn risk_type(&self) -> ::std::option::Option<&crate::types::RiskType> {
        self.risk_type.as_ref()
    }
    /// Target endpoint for this security test
    pub fn target_endpoint(&self) -> ::std::option::Option<&crate::types::Endpoint> {
        self.target_endpoint.as_ref()
    }
    /// Current status of the task execution
    pub fn execution_status(&self) -> ::std::option::Option<&crate::types::TaskExecutionStatus> {
        self.execution_status.as_ref()
    }
    /// Location of execution logs for auditing and review
    pub fn logs_location(&self) -> ::std::option::Option<&crate::types::LogLocation> {
        self.logs_location.as_ref()
    }
    /// Timestamp when the task was created
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// Timestamp when the task was last updated
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
}
impl Task {
    /// Creates a new builder-style object to manufacture [`Task`](crate::types::Task).
    pub fn builder() -> crate::types::builders::TaskBuilder {
        crate::types::builders::TaskBuilder::default()
    }
}

/// A builder for [`Task`](crate::types::Task).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TaskBuilder {
    pub(crate) task_id: ::std::option::Option<::std::string::String>,
    pub(crate) pentest_id: ::std::option::Option<::std::string::String>,
    pub(crate) pentest_job_id: ::std::option::Option<::std::string::String>,
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) categories: ::std::option::Option<::std::vec::Vec<crate::types::Category>>,
    pub(crate) risk_type: ::std::option::Option<crate::types::RiskType>,
    pub(crate) target_endpoint: ::std::option::Option<crate::types::Endpoint>,
    pub(crate) execution_status: ::std::option::Option<crate::types::TaskExecutionStatus>,
    pub(crate) logs_location: ::std::option::Option<crate::types::LogLocation>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl TaskBuilder {
    /// Unique identifier for the task
    /// This field is required.
    pub fn task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.task_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Unique identifier for the task
    pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_id = input;
        self
    }
    /// Unique identifier for the task
    pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_id
    }
    /// Identifier of the parent pentest
    pub fn pentest_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pentest_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the parent pentest
    pub fn set_pentest_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pentest_id = input;
        self
    }
    /// Identifier of the parent pentest
    pub fn get_pentest_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.pentest_id
    }
    /// Identifier of the pentest job this task belongs to
    pub fn pentest_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pentest_job_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the pentest job this task belongs to
    pub fn set_pentest_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pentest_job_id = input;
        self
    }
    /// Identifier of the pentest job this task belongs to
    pub fn get_pentest_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.pentest_job_id
    }
    /// Identifier of the agent space this task belongs to
    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
    }
    /// Identifier of the agent space this task belongs to
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// Identifier of the agent space this task belongs to
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// Title or name of the task
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// Title or name of the task
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// Title or name of the task
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// Detailed description of the task's purpose and scope
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// Detailed description of the task's purpose and scope
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// Detailed description of the task's purpose and scope
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `categories`.
    ///
    /// To override the contents of this collection use [`set_categories`](Self::set_categories).
    ///
    /// List of categories associated with this task
    pub fn categories(mut self, input: crate::types::Category) -> Self {
        let mut v = self.categories.unwrap_or_default();
        v.push(input);
        self.categories = ::std::option::Option::Some(v);
        self
    }
    /// List of categories associated with this task
    pub fn set_categories(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Category>>) -> Self {
        self.categories = input;
        self
    }
    /// List of categories associated with this task
    pub fn get_categories(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Category>> {
        &self.categories
    }
    /// Type of security risk this task is designed to test
    pub fn risk_type(mut self, input: crate::types::RiskType) -> Self {
        self.risk_type = ::std::option::Option::Some(input);
        self
    }
    /// Type of security risk this task is designed to test
    pub fn set_risk_type(mut self, input: ::std::option::Option<crate::types::RiskType>) -> Self {
        self.risk_type = input;
        self
    }
    /// Type of security risk this task is designed to test
    pub fn get_risk_type(&self) -> &::std::option::Option<crate::types::RiskType> {
        &self.risk_type
    }
    /// Target endpoint for this security test
    pub fn target_endpoint(mut self, input: crate::types::Endpoint) -> Self {
        self.target_endpoint = ::std::option::Option::Some(input);
        self
    }
    /// Target endpoint for this security test
    pub fn set_target_endpoint(mut self, input: ::std::option::Option<crate::types::Endpoint>) -> Self {
        self.target_endpoint = input;
        self
    }
    /// Target endpoint for this security test
    pub fn get_target_endpoint(&self) -> &::std::option::Option<crate::types::Endpoint> {
        &self.target_endpoint
    }
    /// Current status of the task execution
    pub fn execution_status(mut self, input: crate::types::TaskExecutionStatus) -> Self {
        self.execution_status = ::std::option::Option::Some(input);
        self
    }
    /// Current status of the task execution
    pub fn set_execution_status(mut self, input: ::std::option::Option<crate::types::TaskExecutionStatus>) -> Self {
        self.execution_status = input;
        self
    }
    /// Current status of the task execution
    pub fn get_execution_status(&self) -> &::std::option::Option<crate::types::TaskExecutionStatus> {
        &self.execution_status
    }
    /// Location of execution logs for auditing and review
    pub fn logs_location(mut self, input: crate::types::LogLocation) -> Self {
        self.logs_location = ::std::option::Option::Some(input);
        self
    }
    /// Location of execution logs for auditing and review
    pub fn set_logs_location(mut self, input: ::std::option::Option<crate::types::LogLocation>) -> Self {
        self.logs_location = input;
        self
    }
    /// Location of execution logs for auditing and review
    pub fn get_logs_location(&self) -> &::std::option::Option<crate::types::LogLocation> {
        &self.logs_location
    }
    /// Timestamp when the task was created
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when the task 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 the task was created
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// Timestamp when the task was last updated
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when the task 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 the task was last updated
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Consumes the builder and constructs a [`Task`](crate::types::Task).
    /// This method will fail if any of the following fields are not set:
    /// - [`task_id`](crate::types::builders::TaskBuilder::task_id)
    pub fn build(self) -> ::std::result::Result<crate::types::Task, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Task {
            task_id: self.task_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "task_id",
                    "task_id was not specified but it is required when building Task",
                )
            })?,
            pentest_id: self.pentest_id,
            pentest_job_id: self.pentest_job_id,
            agent_space_id: self.agent_space_id,
            title: self.title,
            description: self.description,
            categories: self.categories,
            risk_type: self.risk_type,
            target_endpoint: self.target_endpoint,
            execution_status: self.execution_status,
            logs_location: self.logs_location,
            created_at: self.created_at,
            updated_at: self.updated_at,
        })
    }
}