Skip to main content

aws_sdk_shield/types/
_mitigation.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The mitigation applied to a DDoS attack.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Mitigation {
7    /// <p>The name of the mitigation taken for this attack.</p>
8    pub mitigation_name: ::std::option::Option<::std::string::String>,
9}
10impl Mitigation {
11    /// <p>The name of the mitigation taken for this attack.</p>
12    pub fn mitigation_name(&self) -> ::std::option::Option<&str> {
13        self.mitigation_name.as_deref()
14    }
15}
16impl Mitigation {
17    /// Creates a new builder-style object to manufacture [`Mitigation`](crate::types::Mitigation).
18    pub fn builder() -> crate::types::builders::MitigationBuilder {
19        crate::types::builders::MitigationBuilder::default()
20    }
21}
22
23/// A builder for [`Mitigation`](crate::types::Mitigation).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct MitigationBuilder {
27    pub(crate) mitigation_name: ::std::option::Option<::std::string::String>,
28}
29impl MitigationBuilder {
30    /// <p>The name of the mitigation taken for this attack.</p>
31    pub fn mitigation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
32        self.mitigation_name = ::std::option::Option::Some(input.into());
33        self
34    }
35    /// <p>The name of the mitigation taken for this attack.</p>
36    pub fn set_mitigation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
37        self.mitigation_name = input;
38        self
39    }
40    /// <p>The name of the mitigation taken for this attack.</p>
41    pub fn get_mitigation_name(&self) -> &::std::option::Option<::std::string::String> {
42        &self.mitigation_name
43    }
44    /// Consumes the builder and constructs a [`Mitigation`](crate::types::Mitigation).
45    pub fn build(self) -> crate::types::Mitigation {
46        crate::types::Mitigation {
47            mitigation_name: self.mitigation_name,
48        }
49    }
50}