#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Task {
pub agent_space_id: ::std::string::String,
pub task_id: ::std::string::String,
pub execution_id: ::std::option::Option<::std::string::String>,
pub title: ::std::string::String,
pub description: ::std::option::Option<::std::string::String>,
pub reference: ::std::option::Option<crate::types::ReferenceOutput>,
pub task_type: crate::types::TaskType,
pub priority: crate::types::Priority,
pub status: crate::types::TaskStatus,
pub created_at: ::aws_smithy_types::DateTime,
pub updated_at: ::aws_smithy_types::DateTime,
pub version: i32,
pub support_metadata: ::std::option::Option<::aws_smithy_types::Document>,
pub metadata: ::std::option::Option<::aws_smithy_types::Document>,
pub primary_task_id: ::std::option::Option<::std::string::String>,
pub status_reason: ::std::option::Option<::std::string::String>,
pub has_linked_tasks: bool,
}
impl Task {
pub fn agent_space_id(&self) -> &str {
use std::ops::Deref;
self.agent_space_id.deref()
}
pub fn task_id(&self) -> &str {
use std::ops::Deref;
self.task_id.deref()
}
pub fn execution_id(&self) -> ::std::option::Option<&str> {
self.execution_id.as_deref()
}
pub fn title(&self) -> &str {
use std::ops::Deref;
self.title.deref()
}
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
pub fn reference(&self) -> ::std::option::Option<&crate::types::ReferenceOutput> {
self.reference.as_ref()
}
pub fn task_type(&self) -> &crate::types::TaskType {
&self.task_type
}
pub fn priority(&self) -> &crate::types::Priority {
&self.priority
}
pub fn status(&self) -> &crate::types::TaskStatus {
&self.status
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
pub fn version(&self) -> i32 {
self.version
}
pub fn support_metadata(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
self.support_metadata.as_ref()
}
pub fn metadata(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
self.metadata.as_ref()
}
pub fn primary_task_id(&self) -> ::std::option::Option<&str> {
self.primary_task_id.as_deref()
}
pub fn status_reason(&self) -> ::std::option::Option<&str> {
self.status_reason.as_deref()
}
pub fn has_linked_tasks(&self) -> bool {
self.has_linked_tasks
}
}
impl Task {
pub fn builder() -> crate::types::builders::TaskBuilder {
crate::types::builders::TaskBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TaskBuilder {
pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
pub(crate) task_id: ::std::option::Option<::std::string::String>,
pub(crate) execution_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) reference: ::std::option::Option<crate::types::ReferenceOutput>,
pub(crate) task_type: ::std::option::Option<crate::types::TaskType>,
pub(crate) priority: ::std::option::Option<crate::types::Priority>,
pub(crate) status: ::std::option::Option<crate::types::TaskStatus>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) version: ::std::option::Option<i32>,
pub(crate) support_metadata: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) metadata: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) primary_task_id: ::std::option::Option<::std::string::String>,
pub(crate) status_reason: ::std::option::Option<::std::string::String>,
pub(crate) has_linked_tasks: ::std::option::Option<bool>,
}
impl TaskBuilder {
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
}
pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.agent_space_id = input;
self
}
pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
&self.agent_space_id
}
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
}
pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.task_id = input;
self
}
pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
&self.task_id
}
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
}
pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.execution_id = input;
self
}
pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
&self.execution_id
}
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
pub fn reference(mut self, input: crate::types::ReferenceOutput) -> Self {
self.reference = ::std::option::Option::Some(input);
self
}
pub fn set_reference(mut self, input: ::std::option::Option<crate::types::ReferenceOutput>) -> Self {
self.reference = input;
self
}
pub fn get_reference(&self) -> &::std::option::Option<crate::types::ReferenceOutput> {
&self.reference
}
pub fn task_type(mut self, input: crate::types::TaskType) -> Self {
self.task_type = ::std::option::Option::Some(input);
self
}
pub fn set_task_type(mut self, input: ::std::option::Option<crate::types::TaskType>) -> Self {
self.task_type = input;
self
}
pub fn get_task_type(&self) -> &::std::option::Option<crate::types::TaskType> {
&self.task_type
}
pub fn priority(mut self, input: crate::types::Priority) -> Self {
self.priority = ::std::option::Option::Some(input);
self
}
pub fn set_priority(mut self, input: ::std::option::Option<crate::types::Priority>) -> Self {
self.priority = input;
self
}
pub fn get_priority(&self) -> &::std::option::Option<crate::types::Priority> {
&self.priority
}
pub fn status(mut self, input: crate::types::TaskStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::TaskStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::TaskStatus> {
&self.status
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub fn version(mut self, input: i32) -> Self {
self.version = ::std::option::Option::Some(input);
self
}
pub fn set_version(mut self, input: ::std::option::Option<i32>) -> Self {
self.version = input;
self
}
pub fn get_version(&self) -> &::std::option::Option<i32> {
&self.version
}
pub fn support_metadata(mut self, input: ::aws_smithy_types::Document) -> Self {
self.support_metadata = ::std::option::Option::Some(input);
self
}
pub fn set_support_metadata(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.support_metadata = input;
self
}
pub fn get_support_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.support_metadata
}
pub fn metadata(mut self, input: ::aws_smithy_types::Document) -> Self {
self.metadata = ::std::option::Option::Some(input);
self
}
pub fn set_metadata(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.metadata = input;
self
}
pub fn get_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.metadata
}
pub fn primary_task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.primary_task_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_primary_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.primary_task_id = input;
self
}
pub fn get_primary_task_id(&self) -> &::std::option::Option<::std::string::String> {
&self.primary_task_id
}
pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status_reason = ::std::option::Option::Some(input.into());
self
}
pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status_reason = input;
self
}
pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.status_reason
}
pub fn has_linked_tasks(mut self, input: bool) -> Self {
self.has_linked_tasks = ::std::option::Option::Some(input);
self
}
pub fn set_has_linked_tasks(mut self, input: ::std::option::Option<bool>) -> Self {
self.has_linked_tasks = input;
self
}
pub fn get_has_linked_tasks(&self) -> &::std::option::Option<bool> {
&self.has_linked_tasks
}
pub fn build(self) -> ::std::result::Result<crate::types::Task, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Task {
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 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",
)
})?,
execution_id: self.execution_id,
title: self.title.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"title",
"title was not specified but it is required when building Task",
)
})?,
description: self.description,
reference: self.reference,
task_type: self.task_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"task_type",
"task_type was not specified but it is required when building Task",
)
})?,
priority: self.priority.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"priority",
"priority was not specified but it is required when building Task",
)
})?,
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 Task",
)
})?,
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 Task",
)
})?,
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 Task",
)
})?,
version: self.version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"version",
"version was not specified but it is required when building Task",
)
})?,
support_metadata: self.support_metadata,
metadata: self.metadata,
primary_task_id: self.primary_task_id,
status_reason: self.status_reason,
has_linked_tasks: self.has_linked_tasks.unwrap_or_default(),
})
}
}