Skip to main content

aws_sdk_securityhub/types/
_recommendation.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A recommendation on how to remediate the issue identified in a finding.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Recommendation {
7    /// <p>Describes the recommended steps to take to remediate an issue identified in a finding.</p>
8    /// <p>Length Constraints: Minimum of 1 length. Maximum of 512 length.</p>
9    pub text: ::std::option::Option<::std::string::String>,
10    /// <p>A URL to a page or site that contains information about how to remediate a finding.</p>
11    pub url: ::std::option::Option<::std::string::String>,
12}
13impl Recommendation {
14    /// <p>Describes the recommended steps to take to remediate an issue identified in a finding.</p>
15    /// <p>Length Constraints: Minimum of 1 length. Maximum of 512 length.</p>
16    pub fn text(&self) -> ::std::option::Option<&str> {
17        self.text.as_deref()
18    }
19    /// <p>A URL to a page or site that contains information about how to remediate a finding.</p>
20    pub fn url(&self) -> ::std::option::Option<&str> {
21        self.url.as_deref()
22    }
23}
24impl Recommendation {
25    /// Creates a new builder-style object to manufacture [`Recommendation`](crate::types::Recommendation).
26    pub fn builder() -> crate::types::builders::RecommendationBuilder {
27        crate::types::builders::RecommendationBuilder::default()
28    }
29}
30
31/// A builder for [`Recommendation`](crate::types::Recommendation).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct RecommendationBuilder {
35    pub(crate) text: ::std::option::Option<::std::string::String>,
36    pub(crate) url: ::std::option::Option<::std::string::String>,
37}
38impl RecommendationBuilder {
39    /// <p>Describes the recommended steps to take to remediate an issue identified in a finding.</p>
40    /// <p>Length Constraints: Minimum of 1 length. Maximum of 512 length.</p>
41    pub fn text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.text = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>Describes the recommended steps to take to remediate an issue identified in a finding.</p>
46    /// <p>Length Constraints: Minimum of 1 length. Maximum of 512 length.</p>
47    pub fn set_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
48        self.text = input;
49        self
50    }
51    /// <p>Describes the recommended steps to take to remediate an issue identified in a finding.</p>
52    /// <p>Length Constraints: Minimum of 1 length. Maximum of 512 length.</p>
53    pub fn get_text(&self) -> &::std::option::Option<::std::string::String> {
54        &self.text
55    }
56    /// <p>A URL to a page or site that contains information about how to remediate a finding.</p>
57    pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.url = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>A URL to a page or site that contains information about how to remediate a finding.</p>
62    pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
63        self.url = input;
64        self
65    }
66    /// <p>A URL to a page or site that contains information about how to remediate a finding.</p>
67    pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
68        &self.url
69    }
70    /// Consumes the builder and constructs a [`Recommendation`](crate::types::Recommendation).
71    pub fn build(self) -> crate::types::Recommendation {
72        crate::types::Recommendation {
73            text: self.text,
74            url: self.url,
75        }
76    }
77}