Skip to main content

aws_sdk_devopsagent/operation/get_recommendation/
_get_recommendation_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Request structure for retrieving a specific recommendation
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetRecommendationInput {
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 retrieve
10    pub recommendation_id: ::std::option::Option<::std::string::String>,
11    /// Specific version of the recommendation to retrieve. If not specified, returns the latest version.
12    pub recommendation_version: ::std::option::Option<i64>,
13}
14impl GetRecommendationInput {
15    /// The unique identifier for the agent space containing the recommendation
16    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
17        self.agent_space_id.as_deref()
18    }
19    /// The unique identifier for the recommendation to retrieve
20    pub fn recommendation_id(&self) -> ::std::option::Option<&str> {
21        self.recommendation_id.as_deref()
22    }
23    /// Specific version of the recommendation to retrieve. If not specified, returns the latest version.
24    pub fn recommendation_version(&self) -> ::std::option::Option<i64> {
25        self.recommendation_version
26    }
27}
28impl GetRecommendationInput {
29    /// Creates a new builder-style object to manufacture [`GetRecommendationInput`](crate::operation::get_recommendation::GetRecommendationInput).
30    pub fn builder() -> crate::operation::get_recommendation::builders::GetRecommendationInputBuilder {
31        crate::operation::get_recommendation::builders::GetRecommendationInputBuilder::default()
32    }
33}
34
35/// A builder for [`GetRecommendationInput`](crate::operation::get_recommendation::GetRecommendationInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct GetRecommendationInputBuilder {
39    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
40    pub(crate) recommendation_id: ::std::option::Option<::std::string::String>,
41    pub(crate) recommendation_version: ::std::option::Option<i64>,
42}
43impl GetRecommendationInputBuilder {
44    /// The unique identifier for the agent space containing the recommendation
45    /// This field is required.
46    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.agent_space_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// The unique identifier for the agent space containing the recommendation
51    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.agent_space_id = input;
53        self
54    }
55    /// The unique identifier for the agent space containing the recommendation
56    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.agent_space_id
58    }
59    /// The unique identifier for the recommendation to retrieve
60    /// This field is required.
61    pub fn recommendation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.recommendation_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// The unique identifier for the recommendation to retrieve
66    pub fn set_recommendation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.recommendation_id = input;
68        self
69    }
70    /// The unique identifier for the recommendation to retrieve
71    pub fn get_recommendation_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.recommendation_id
73    }
74    /// Specific version of the recommendation to retrieve. If not specified, returns the latest version.
75    pub fn recommendation_version(mut self, input: i64) -> Self {
76        self.recommendation_version = ::std::option::Option::Some(input);
77        self
78    }
79    /// Specific version of the recommendation to retrieve. If not specified, returns the latest version.
80    pub fn set_recommendation_version(mut self, input: ::std::option::Option<i64>) -> Self {
81        self.recommendation_version = input;
82        self
83    }
84    /// Specific version of the recommendation to retrieve. If not specified, returns the latest version.
85    pub fn get_recommendation_version(&self) -> &::std::option::Option<i64> {
86        &self.recommendation_version
87    }
88    /// Consumes the builder and constructs a [`GetRecommendationInput`](crate::operation::get_recommendation::GetRecommendationInput).
89    pub fn build(
90        self,
91    ) -> ::std::result::Result<crate::operation::get_recommendation::GetRecommendationInput, ::aws_smithy_types::error::operation::BuildError> {
92        ::std::result::Result::Ok(crate::operation::get_recommendation::GetRecommendationInput {
93            agent_space_id: self.agent_space_id,
94            recommendation_id: self.recommendation_id,
95            recommendation_version: self.recommendation_version,
96        })
97    }
98}