1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A subset of the attributes that describe a log group. In CloudWatch a log group is a group of log streams that share the same retention, monitoring, and access control settings.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct LogGroupSummary {
    /// <p>The type of log.</p>
    pub log_type: ::std::string::String,
    /// <p>The name of the log group.</p>
    pub log_group_name: ::std::string::String,
}
impl LogGroupSummary {
    /// <p>The type of log.</p>
    pub fn log_type(&self) -> &str {
        use std::ops::Deref;
        self.log_type.deref()
    }
    /// <p>The name of the log group.</p>
    pub fn log_group_name(&self) -> &str {
        use std::ops::Deref;
        self.log_group_name.deref()
    }
}
impl LogGroupSummary {
    /// Creates a new builder-style object to manufacture [`LogGroupSummary`](crate::types::LogGroupSummary).
    pub fn builder() -> crate::types::builders::LogGroupSummaryBuilder {
        crate::types::builders::LogGroupSummaryBuilder::default()
    }
}

/// A builder for [`LogGroupSummary`](crate::types::LogGroupSummary).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct LogGroupSummaryBuilder {
    pub(crate) log_type: ::std::option::Option<::std::string::String>,
    pub(crate) log_group_name: ::std::option::Option<::std::string::String>,
}
impl LogGroupSummaryBuilder {
    /// <p>The type of log.</p>
    /// This field is required.
    pub fn log_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.log_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of log.</p>
    pub fn set_log_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.log_type = input;
        self
    }
    /// <p>The type of log.</p>
    pub fn get_log_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.log_type
    }
    /// <p>The name of the log group.</p>
    /// This field is required.
    pub fn log_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.log_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the log group.</p>
    pub fn set_log_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.log_group_name = input;
        self
    }
    /// <p>The name of the log group.</p>
    pub fn get_log_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.log_group_name
    }
    /// Consumes the builder and constructs a [`LogGroupSummary`](crate::types::LogGroupSummary).
    /// This method will fail if any of the following fields are not set:
    /// - [`log_type`](crate::types::builders::LogGroupSummaryBuilder::log_type)
    /// - [`log_group_name`](crate::types::builders::LogGroupSummaryBuilder::log_group_name)
    pub fn build(self) -> ::std::result::Result<crate::types::LogGroupSummary, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::LogGroupSummary {
            log_type: self.log_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "log_type",
                    "log_type was not specified but it is required when building LogGroupSummary",
                )
            })?,
            log_group_name: self.log_group_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "log_group_name",
                    "log_group_name was not specified but it is required when building LogGroupSummary",
                )
            })?,
        })
    }
}