Skip to main content

aws_sdk_devopsagent/operation/update_recommendation/
_update_recommendation_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Request structure for updating an existing recommendation
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateRecommendationInput {
7    /// The unique identifier for the agent space containing the recommendation
8    pub agent_space_id: ::std::option::Option<::std::string::String>,
9    /// The unique identifier for the recommendation to update
10    pub recommendation_id: ::std::option::Option<::std::string::String>,
11    /// Current status of the recommendation
12    pub status: ::std::option::Option<crate::types::RecommendationStatus>,
13    /// Additional context for recommendation
14    pub additional_context: ::std::option::Option<::std::string::String>,
15    /// A unique token that ensures idempotency of the request
16    pub client_token: ::std::option::Option<::std::string::String>,
17}
18impl UpdateRecommendationInput {
19    /// The unique identifier for the agent space containing the recommendation
20    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
21        self.agent_space_id.as_deref()
22    }
23    /// The unique identifier for the recommendation to update
24    pub fn recommendation_id(&self) -> ::std::option::Option<&str> {
25        self.recommendation_id.as_deref()
26    }
27    /// Current status of the recommendation
28    pub fn status(&self) -> ::std::option::Option<&crate::types::RecommendationStatus> {
29        self.status.as_ref()
30    }
31    /// Additional context for recommendation
32    pub fn additional_context(&self) -> ::std::option::Option<&str> {
33        self.additional_context.as_deref()
34    }
35    /// A unique token that ensures idempotency of the request
36    pub fn client_token(&self) -> ::std::option::Option<&str> {
37        self.client_token.as_deref()
38    }
39}
40impl UpdateRecommendationInput {
41    /// Creates a new builder-style object to manufacture [`UpdateRecommendationInput`](crate::operation::update_recommendation::UpdateRecommendationInput).
42    pub fn builder() -> crate::operation::update_recommendation::builders::UpdateRecommendationInputBuilder {
43        crate::operation::update_recommendation::builders::UpdateRecommendationInputBuilder::default()
44    }
45}
46
47/// A builder for [`UpdateRecommendationInput`](crate::operation::update_recommendation::UpdateRecommendationInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct UpdateRecommendationInputBuilder {
51    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
52    pub(crate) recommendation_id: ::std::option::Option<::std::string::String>,
53    pub(crate) status: ::std::option::Option<crate::types::RecommendationStatus>,
54    pub(crate) additional_context: ::std::option::Option<::std::string::String>,
55    pub(crate) client_token: ::std::option::Option<::std::string::String>,
56}
57impl UpdateRecommendationInputBuilder {
58    /// The unique identifier for the agent space containing the recommendation
59    /// This field is required.
60    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.agent_space_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// The unique identifier for the agent space containing the recommendation
65    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.agent_space_id = input;
67        self
68    }
69    /// The unique identifier for the agent space containing the recommendation
70    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.agent_space_id
72    }
73    /// The unique identifier for the recommendation to update
74    /// This field is required.
75    pub fn recommendation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.recommendation_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// The unique identifier for the recommendation to update
80    pub fn set_recommendation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.recommendation_id = input;
82        self
83    }
84    /// The unique identifier for the recommendation to update
85    pub fn get_recommendation_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.recommendation_id
87    }
88    /// Current status of the recommendation
89    pub fn status(mut self, input: crate::types::RecommendationStatus) -> Self {
90        self.status = ::std::option::Option::Some(input);
91        self
92    }
93    /// Current status of the recommendation
94    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RecommendationStatus>) -> Self {
95        self.status = input;
96        self
97    }
98    /// Current status of the recommendation
99    pub fn get_status(&self) -> &::std::option::Option<crate::types::RecommendationStatus> {
100        &self.status
101    }
102    /// Additional context for recommendation
103    pub fn additional_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.additional_context = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// Additional context for recommendation
108    pub fn set_additional_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.additional_context = input;
110        self
111    }
112    /// Additional context for recommendation
113    pub fn get_additional_context(&self) -> &::std::option::Option<::std::string::String> {
114        &self.additional_context
115    }
116    /// A unique token that ensures idempotency of the request
117    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.client_token = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// A unique token that ensures idempotency of the request
122    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.client_token = input;
124        self
125    }
126    /// A unique token that ensures idempotency of the request
127    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
128        &self.client_token
129    }
130    /// Consumes the builder and constructs a [`UpdateRecommendationInput`](crate::operation::update_recommendation::UpdateRecommendationInput).
131    pub fn build(
132        self,
133    ) -> ::std::result::Result<crate::operation::update_recommendation::UpdateRecommendationInput, ::aws_smithy_types::error::operation::BuildError>
134    {
135        ::std::result::Result::Ok(crate::operation::update_recommendation::UpdateRecommendationInput {
136            agent_space_id: self.agent_space_id,
137            recommendation_id: self.recommendation_id,
138            status: self.status,
139            additional_context: self.additional_context,
140            client_token: self.client_token,
141        })
142    }
143}