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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Parameters used when defining a mitigation action that enable Amazon Web Services IoT Core logging.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EnableIoTLoggingParams {
    /// <p>The Amazon Resource Name (ARN) of the IAM role used for logging.</p>
    pub role_arn_for_logging: ::std::string::String,
    /// <p>Specifies the type of information to be logged.</p>
    pub log_level: crate::types::LogLevel,
}
impl EnableIoTLoggingParams {
    /// <p>The Amazon Resource Name (ARN) of the IAM role used for logging.</p>
    pub fn role_arn_for_logging(&self) -> &str {
        use std::ops::Deref;
        self.role_arn_for_logging.deref()
    }
    /// <p>Specifies the type of information to be logged.</p>
    pub fn log_level(&self) -> &crate::types::LogLevel {
        &self.log_level
    }
}
impl EnableIoTLoggingParams {
    /// Creates a new builder-style object to manufacture [`EnableIoTLoggingParams`](crate::types::EnableIoTLoggingParams).
    pub fn builder() -> crate::types::builders::EnableIoTLoggingParamsBuilder {
        crate::types::builders::EnableIoTLoggingParamsBuilder::default()
    }
}

/// A builder for [`EnableIoTLoggingParams`](crate::types::EnableIoTLoggingParams).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EnableIoTLoggingParamsBuilder {
    pub(crate) role_arn_for_logging: ::std::option::Option<::std::string::String>,
    pub(crate) log_level: ::std::option::Option<crate::types::LogLevel>,
}
impl EnableIoTLoggingParamsBuilder {
    /// <p>The Amazon Resource Name (ARN) of the IAM role used for logging.</p>
    /// This field is required.
    pub fn role_arn_for_logging(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn_for_logging = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role used for logging.</p>
    pub fn set_role_arn_for_logging(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn_for_logging = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role used for logging.</p>
    pub fn get_role_arn_for_logging(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn_for_logging
    }
    /// <p>Specifies the type of information to be logged.</p>
    /// This field is required.
    pub fn log_level(mut self, input: crate::types::LogLevel) -> Self {
        self.log_level = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the type of information to be logged.</p>
    pub fn set_log_level(mut self, input: ::std::option::Option<crate::types::LogLevel>) -> Self {
        self.log_level = input;
        self
    }
    /// <p>Specifies the type of information to be logged.</p>
    pub fn get_log_level(&self) -> &::std::option::Option<crate::types::LogLevel> {
        &self.log_level
    }
    /// Consumes the builder and constructs a [`EnableIoTLoggingParams`](crate::types::EnableIoTLoggingParams).
    /// This method will fail if any of the following fields are not set:
    /// - [`role_arn_for_logging`](crate::types::builders::EnableIoTLoggingParamsBuilder::role_arn_for_logging)
    /// - [`log_level`](crate::types::builders::EnableIoTLoggingParamsBuilder::log_level)
    pub fn build(self) -> ::std::result::Result<crate::types::EnableIoTLoggingParams, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::EnableIoTLoggingParams {
            role_arn_for_logging: self.role_arn_for_logging.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "role_arn_for_logging",
                    "role_arn_for_logging was not specified but it is required when building EnableIoTLoggingParams",
                )
            })?,
            log_level: self.log_level.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "log_level",
                    "log_level was not specified but it is required when building EnableIoTLoggingParams",
                )
            })?,
        })
    }
}