aws_sdk_codedeploy/types/
_alarm.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about an alarm.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Alarm {
7    /// <p>The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9}
10impl Alarm {
11    /// <p>The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.</p>
12    pub fn name(&self) -> ::std::option::Option<&str> {
13        self.name.as_deref()
14    }
15}
16impl Alarm {
17    /// Creates a new builder-style object to manufacture [`Alarm`](crate::types::Alarm).
18    pub fn builder() -> crate::types::builders::AlarmBuilder {
19        crate::types::builders::AlarmBuilder::default()
20    }
21}
22
23/// A builder for [`Alarm`](crate::types::Alarm).
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
25#[non_exhaustive]
26pub struct AlarmBuilder {
27    pub(crate) name: ::std::option::Option<::std::string::String>,
28}
29impl AlarmBuilder {
30    /// <p>The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.</p>
31    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
32        self.name = ::std::option::Option::Some(input.into());
33        self
34    }
35    /// <p>The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.</p>
36    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
37        self.name = input;
38        self
39    }
40    /// <p>The name of the alarm. Maximum length is 255 characters. Each alarm name can be used only once in a list of alarms.</p>
41    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
42        &self.name
43    }
44    /// Consumes the builder and constructs a [`Alarm`](crate::types::Alarm).
45    pub fn build(self) -> crate::types::Alarm {
46        crate::types::Alarm { name: self.name }
47    }
48}