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 a recommendation with all its properties and metadata
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Recommendation {
    /// ARN of the agent space this recommendation belongs to
    pub agent_space_arn: ::std::string::String,
    /// The unique identifier for this recommendation
    pub recommendation_id: ::std::string::String,
    /// ID of the task that generated the recommendation
    pub task_id: ::std::string::String,
    /// ID of the goal this recommendation is associated with
    pub goal_id: ::std::option::Option<::std::string::String>,
    /// The title of the recommendation
    pub title: ::std::string::String,
    /// Content of the recommendation
    pub content: ::std::option::Option<crate::types::RecommendationContent>,
    /// Current status of the recommendation
    pub status: crate::types::RecommendationStatus,
    /// Priority level of the recommendation
    pub priority: crate::types::RecommendationPriority,
    /// Version of the goal at the time this recommendation was generated
    pub goal_version: ::std::option::Option<i64>,
    /// Additional context for recommendation
    pub additional_context: ::std::option::Option<::std::string::String>,
    /// Timestamp when this recommendation was created
    pub created_at: ::aws_smithy_types::DateTime,
    /// Timestamp when this recommendation was last updated
    pub updated_at: ::aws_smithy_types::DateTime,
    /// Version number for optimistic locking
    pub version: i64,
}
impl Recommendation {
    /// ARN of the agent space this recommendation belongs to
    pub fn agent_space_arn(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_arn.deref()
    }
    /// The unique identifier for this recommendation
    pub fn recommendation_id(&self) -> &str {
        use std::ops::Deref;
        self.recommendation_id.deref()
    }
    /// ID of the task that generated the recommendation
    pub fn task_id(&self) -> &str {
        use std::ops::Deref;
        self.task_id.deref()
    }
    /// ID of the goal this recommendation is associated with
    pub fn goal_id(&self) -> ::std::option::Option<&str> {
        self.goal_id.as_deref()
    }
    /// The title of the recommendation
    pub fn title(&self) -> &str {
        use std::ops::Deref;
        self.title.deref()
    }
    /// Content of the recommendation
    pub fn content(&self) -> ::std::option::Option<&crate::types::RecommendationContent> {
        self.content.as_ref()
    }
    /// Current status of the recommendation
    pub fn status(&self) -> &crate::types::RecommendationStatus {
        &self.status
    }
    /// Priority level of the recommendation
    pub fn priority(&self) -> &crate::types::RecommendationPriority {
        &self.priority
    }
    /// Version of the goal at the time this recommendation was generated
    pub fn goal_version(&self) -> ::std::option::Option<i64> {
        self.goal_version
    }
    /// Additional context for recommendation
    pub fn additional_context(&self) -> ::std::option::Option<&str> {
        self.additional_context.as_deref()
    }
    /// Timestamp when this recommendation was created
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// Timestamp when this recommendation was last updated
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// Version number for optimistic locking
    pub fn version(&self) -> i64 {
        self.version
    }
}
impl Recommendation {
    /// Creates a new builder-style object to manufacture [`Recommendation`](crate::types::Recommendation).
    pub fn builder() -> crate::types::builders::RecommendationBuilder {
        crate::types::builders::RecommendationBuilder::default()
    }
}

/// A builder for [`Recommendation`](crate::types::Recommendation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RecommendationBuilder {
    pub(crate) agent_space_arn: ::std::option::Option<::std::string::String>,
    pub(crate) recommendation_id: ::std::option::Option<::std::string::String>,
    pub(crate) task_id: ::std::option::Option<::std::string::String>,
    pub(crate) goal_id: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) content: ::std::option::Option<crate::types::RecommendationContent>,
    pub(crate) status: ::std::option::Option<crate::types::RecommendationStatus>,
    pub(crate) priority: ::std::option::Option<crate::types::RecommendationPriority>,
    pub(crate) goal_version: ::std::option::Option<i64>,
    pub(crate) additional_context: ::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) version: ::std::option::Option<i64>,
}
impl RecommendationBuilder {
    /// ARN of the agent space this recommendation belongs to
    /// This field is required.
    pub fn agent_space_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_space_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// ARN of the agent space this recommendation belongs to
    pub fn set_agent_space_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_arn = input;
        self
    }
    /// ARN of the agent space this recommendation belongs to
    pub fn get_agent_space_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_arn
    }
    /// The unique identifier for this recommendation
    /// This field is required.
    pub fn recommendation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.recommendation_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier for this recommendation
    pub fn set_recommendation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.recommendation_id = input;
        self
    }
    /// The unique identifier for this recommendation
    pub fn get_recommendation_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.recommendation_id
    }
    /// ID of the task that generated the recommendation
    /// 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
    }
    /// ID of the task that generated the recommendation
    pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_id = input;
        self
    }
    /// ID of the task that generated the recommendation
    pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_id
    }
    /// ID of the goal this recommendation is associated with
    pub fn goal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.goal_id = ::std::option::Option::Some(input.into());
        self
    }
    /// ID of the goal this recommendation is associated with
    pub fn set_goal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.goal_id = input;
        self
    }
    /// ID of the goal this recommendation is associated with
    pub fn get_goal_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.goal_id
    }
    /// The title of the recommendation
    /// This field is required.
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// The title of the recommendation
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// The title of the recommendation
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// Content of the recommendation
    /// This field is required.
    pub fn content(mut self, input: crate::types::RecommendationContent) -> Self {
        self.content = ::std::option::Option::Some(input);
        self
    }
    /// Content of the recommendation
    pub fn set_content(mut self, input: ::std::option::Option<crate::types::RecommendationContent>) -> Self {
        self.content = input;
        self
    }
    /// Content of the recommendation
    pub fn get_content(&self) -> &::std::option::Option<crate::types::RecommendationContent> {
        &self.content
    }
    /// Current status of the recommendation
    /// This field is required.
    pub fn status(mut self, input: crate::types::RecommendationStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// Current status of the recommendation
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RecommendationStatus>) -> Self {
        self.status = input;
        self
    }
    /// Current status of the recommendation
    pub fn get_status(&self) -> &::std::option::Option<crate::types::RecommendationStatus> {
        &self.status
    }
    /// Priority level of the recommendation
    /// This field is required.
    pub fn priority(mut self, input: crate::types::RecommendationPriority) -> Self {
        self.priority = ::std::option::Option::Some(input);
        self
    }
    /// Priority level of the recommendation
    pub fn set_priority(mut self, input: ::std::option::Option<crate::types::RecommendationPriority>) -> Self {
        self.priority = input;
        self
    }
    /// Priority level of the recommendation
    pub fn get_priority(&self) -> &::std::option::Option<crate::types::RecommendationPriority> {
        &self.priority
    }
    /// Version of the goal at the time this recommendation was generated
    pub fn goal_version(mut self, input: i64) -> Self {
        self.goal_version = ::std::option::Option::Some(input);
        self
    }
    /// Version of the goal at the time this recommendation was generated
    pub fn set_goal_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.goal_version = input;
        self
    }
    /// Version of the goal at the time this recommendation was generated
    pub fn get_goal_version(&self) -> &::std::option::Option<i64> {
        &self.goal_version
    }
    /// Additional context for recommendation
    pub fn additional_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.additional_context = ::std::option::Option::Some(input.into());
        self
    }
    /// Additional context for recommendation
    pub fn set_additional_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.additional_context = input;
        self
    }
    /// Additional context for recommendation
    pub fn get_additional_context(&self) -> &::std::option::Option<::std::string::String> {
        &self.additional_context
    }
    /// Timestamp when this recommendation 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 recommendation 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 recommendation was created
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// Timestamp when this recommendation 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 recommendation 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 recommendation was last updated
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Version number for optimistic locking
    /// This field is required.
    pub fn version(mut self, input: i64) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    /// Version number for optimistic locking
    pub fn set_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.version = input;
        self
    }
    /// Version number for optimistic locking
    pub fn get_version(&self) -> &::std::option::Option<i64> {
        &self.version
    }
    /// Consumes the builder and constructs a [`Recommendation`](crate::types::Recommendation).
    /// This method will fail if any of the following fields are not set:
    /// - [`agent_space_arn`](crate::types::builders::RecommendationBuilder::agent_space_arn)
    /// - [`recommendation_id`](crate::types::builders::RecommendationBuilder::recommendation_id)
    /// - [`task_id`](crate::types::builders::RecommendationBuilder::task_id)
    /// - [`title`](crate::types::builders::RecommendationBuilder::title)
    /// - [`status`](crate::types::builders::RecommendationBuilder::status)
    /// - [`priority`](crate::types::builders::RecommendationBuilder::priority)
    /// - [`created_at`](crate::types::builders::RecommendationBuilder::created_at)
    /// - [`updated_at`](crate::types::builders::RecommendationBuilder::updated_at)
    /// - [`version`](crate::types::builders::RecommendationBuilder::version)
    pub fn build(self) -> ::std::result::Result<crate::types::Recommendation, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Recommendation {
            agent_space_arn: self.agent_space_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_space_arn",
                    "agent_space_arn was not specified but it is required when building Recommendation",
                )
            })?,
            recommendation_id: self.recommendation_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "recommendation_id",
                    "recommendation_id was not specified but it is required when building Recommendation",
                )
            })?,
            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 Recommendation",
                )
            })?,
            goal_id: self.goal_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 Recommendation",
                )
            })?,
            content: self.content,
            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 Recommendation",
                )
            })?,
            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 Recommendation",
                )
            })?,
            goal_version: self.goal_version,
            additional_context: self.additional_context,
            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 Recommendation",
                )
            })?,
            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 Recommendation",
                )
            })?,
            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 Recommendation",
                )
            })?,
        })
    }
}