aws_sdk_iot/types/
_enable_io_t_logging_params.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EnableIoTLoggingParams {
7 pub role_arn_for_logging: ::std::string::String,
9 pub log_level: crate::types::LogLevel,
11}
12impl EnableIoTLoggingParams {
13 pub fn role_arn_for_logging(&self) -> &str {
15 use std::ops::Deref;
16 self.role_arn_for_logging.deref()
17 }
18 pub fn log_level(&self) -> &crate::types::LogLevel {
20 &self.log_level
21 }
22}
23impl EnableIoTLoggingParams {
24 pub fn builder() -> crate::types::builders::EnableIoTLoggingParamsBuilder {
26 crate::types::builders::EnableIoTLoggingParamsBuilder::default()
27 }
28}
29
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct EnableIoTLoggingParamsBuilder {
34 pub(crate) role_arn_for_logging: ::std::option::Option<::std::string::String>,
35 pub(crate) log_level: ::std::option::Option<crate::types::LogLevel>,
36}
37impl EnableIoTLoggingParamsBuilder {
38 pub fn role_arn_for_logging(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41 self.role_arn_for_logging = ::std::option::Option::Some(input.into());
42 self
43 }
44 pub fn set_role_arn_for_logging(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46 self.role_arn_for_logging = input;
47 self
48 }
49 pub fn get_role_arn_for_logging(&self) -> &::std::option::Option<::std::string::String> {
51 &self.role_arn_for_logging
52 }
53 pub fn log_level(mut self, input: crate::types::LogLevel) -> Self {
56 self.log_level = ::std::option::Option::Some(input);
57 self
58 }
59 pub fn set_log_level(mut self, input: ::std::option::Option<crate::types::LogLevel>) -> Self {
61 self.log_level = input;
62 self
63 }
64 pub fn get_log_level(&self) -> &::std::option::Option<crate::types::LogLevel> {
66 &self.log_level
67 }
68 pub fn build(self) -> ::std::result::Result<crate::types::EnableIoTLoggingParams, ::aws_smithy_types::error::operation::BuildError> {
73 ::std::result::Result::Ok(crate::types::EnableIoTLoggingParams {
74 role_arn_for_logging: self.role_arn_for_logging.ok_or_else(|| {
75 ::aws_smithy_types::error::operation::BuildError::missing_field(
76 "role_arn_for_logging",
77 "role_arn_for_logging was not specified but it is required when building EnableIoTLoggingParams",
78 )
79 })?,
80 log_level: self.log_level.ok_or_else(|| {
81 ::aws_smithy_types::error::operation::BuildError::missing_field(
82 "log_level",
83 "log_level was not specified but it is required when building EnableIoTLoggingParams",
84 )
85 })?,
86 })
87 }
88}