aws-sdk-greengrass 1.98.0

AWS SDK for AWS Greengrass
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Information about a logger
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Logger {
    /// The component that will be subject to logging.
    pub component: ::std::option::Option<crate::types::LoggerComponent>,
    /// A descriptive or arbitrary ID for the logger. This value must be unique within the logger definition version. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''.
    pub id: ::std::option::Option<::std::string::String>,
    /// The level of the logs.
    pub level: ::std::option::Option<crate::types::LoggerLevel>,
    /// The amount of file space, in KB, to use if the local file system is used for logging purposes.
    pub space: ::std::option::Option<i32>,
    /// The type of log output which will be used.
    pub r#type: ::std::option::Option<crate::types::LoggerType>,
}
impl Logger {
    /// The component that will be subject to logging.
    pub fn component(&self) -> ::std::option::Option<&crate::types::LoggerComponent> {
        self.component.as_ref()
    }
    /// A descriptive or arbitrary ID for the logger. This value must be unique within the logger definition version. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''.
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// The level of the logs.
    pub fn level(&self) -> ::std::option::Option<&crate::types::LoggerLevel> {
        self.level.as_ref()
    }
    /// The amount of file space, in KB, to use if the local file system is used for logging purposes.
    pub fn space(&self) -> ::std::option::Option<i32> {
        self.space
    }
    /// The type of log output which will be used.
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::LoggerType> {
        self.r#type.as_ref()
    }
}
impl Logger {
    /// Creates a new builder-style object to manufacture [`Logger`](crate::types::Logger).
    pub fn builder() -> crate::types::builders::LoggerBuilder {
        crate::types::builders::LoggerBuilder::default()
    }
}

/// A builder for [`Logger`](crate::types::Logger).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LoggerBuilder {
    pub(crate) component: ::std::option::Option<crate::types::LoggerComponent>,
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) level: ::std::option::Option<crate::types::LoggerLevel>,
    pub(crate) space: ::std::option::Option<i32>,
    pub(crate) r#type: ::std::option::Option<crate::types::LoggerType>,
}
impl LoggerBuilder {
    /// The component that will be subject to logging.
    /// This field is required.
    pub fn component(mut self, input: crate::types::LoggerComponent) -> Self {
        self.component = ::std::option::Option::Some(input);
        self
    }
    /// The component that will be subject to logging.
    pub fn set_component(mut self, input: ::std::option::Option<crate::types::LoggerComponent>) -> Self {
        self.component = input;
        self
    }
    /// The component that will be subject to logging.
    pub fn get_component(&self) -> &::std::option::Option<crate::types::LoggerComponent> {
        &self.component
    }
    /// A descriptive or arbitrary ID for the logger. This value must be unique within the logger definition version. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''.
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// A descriptive or arbitrary ID for the logger. This value must be unique within the logger definition version. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''.
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// A descriptive or arbitrary ID for the logger. This value must be unique within the logger definition version. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''.
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// The level of the logs.
    /// This field is required.
    pub fn level(mut self, input: crate::types::LoggerLevel) -> Self {
        self.level = ::std::option::Option::Some(input);
        self
    }
    /// The level of the logs.
    pub fn set_level(mut self, input: ::std::option::Option<crate::types::LoggerLevel>) -> Self {
        self.level = input;
        self
    }
    /// The level of the logs.
    pub fn get_level(&self) -> &::std::option::Option<crate::types::LoggerLevel> {
        &self.level
    }
    /// The amount of file space, in KB, to use if the local file system is used for logging purposes.
    pub fn space(mut self, input: i32) -> Self {
        self.space = ::std::option::Option::Some(input);
        self
    }
    /// The amount of file space, in KB, to use if the local file system is used for logging purposes.
    pub fn set_space(mut self, input: ::std::option::Option<i32>) -> Self {
        self.space = input;
        self
    }
    /// The amount of file space, in KB, to use if the local file system is used for logging purposes.
    pub fn get_space(&self) -> &::std::option::Option<i32> {
        &self.space
    }
    /// The type of log output which will be used.
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::LoggerType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// The type of log output which will be used.
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::LoggerType>) -> Self {
        self.r#type = input;
        self
    }
    /// The type of log output which will be used.
    pub fn get_type(&self) -> &::std::option::Option<crate::types::LoggerType> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`Logger`](crate::types::Logger).
    pub fn build(self) -> crate::types::Logger {
        crate::types::Logger {
            component: self.component,
            id: self.id,
            level: self.level,
            space: self.space,
            r#type: self.r#type,
        }
    }
}