aws-sdk-redshift 1.106.0

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

/// <p>Describes the status of logging for a cluster.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeLoggingStatusOutput {
    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
    pub logging_enabled: ::std::option::Option<bool>,
    /// <p>The name of the S3 bucket where the log files are stored.</p>
    pub bucket_name: ::std::option::Option<::std::string::String>,
    /// <p>The prefix applied to the log file names.</p>
    pub s3_key_prefix: ::std::option::Option<::std::string::String>,
    /// <p>The last time that logs were delivered.</p>
    pub last_successful_delivery_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The last time when logs failed to be delivered.</p>
    pub last_failure_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The message indicating that logs failed to be delivered.</p>
    pub last_failure_message: ::std::option::Option<::std::string::String>,
    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
    pub log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
    pub log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    _request_id: Option<String>,
}
impl DescribeLoggingStatusOutput {
    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
    pub fn logging_enabled(&self) -> ::std::option::Option<bool> {
        self.logging_enabled
    }
    /// <p>The name of the S3 bucket where the log files are stored.</p>
    pub fn bucket_name(&self) -> ::std::option::Option<&str> {
        self.bucket_name.as_deref()
    }
    /// <p>The prefix applied to the log file names.</p>
    pub fn s3_key_prefix(&self) -> ::std::option::Option<&str> {
        self.s3_key_prefix.as_deref()
    }
    /// <p>The last time that logs were delivered.</p>
    pub fn last_successful_delivery_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_successful_delivery_time.as_ref()
    }
    /// <p>The last time when logs failed to be delivered.</p>
    pub fn last_failure_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_failure_time.as_ref()
    }
    /// <p>The message indicating that logs failed to be delivered.</p>
    pub fn last_failure_message(&self) -> ::std::option::Option<&str> {
        self.last_failure_message.as_deref()
    }
    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
    pub fn log_destination_type(&self) -> ::std::option::Option<&crate::types::LogDestinationType> {
        self.log_destination_type.as_ref()
    }
    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.log_exports.is_none()`.
    pub fn log_exports(&self) -> &[::std::string::String] {
        self.log_exports.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for DescribeLoggingStatusOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeLoggingStatusOutput {
    /// Creates a new builder-style object to manufacture [`DescribeLoggingStatusOutput`](crate::operation::describe_logging_status::DescribeLoggingStatusOutput).
    pub fn builder() -> crate::operation::describe_logging_status::builders::DescribeLoggingStatusOutputBuilder {
        crate::operation::describe_logging_status::builders::DescribeLoggingStatusOutputBuilder::default()
    }
}

/// A builder for [`DescribeLoggingStatusOutput`](crate::operation::describe_logging_status::DescribeLoggingStatusOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeLoggingStatusOutputBuilder {
    pub(crate) logging_enabled: ::std::option::Option<bool>,
    pub(crate) bucket_name: ::std::option::Option<::std::string::String>,
    pub(crate) s3_key_prefix: ::std::option::Option<::std::string::String>,
    pub(crate) last_successful_delivery_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_failure_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_failure_message: ::std::option::Option<::std::string::String>,
    pub(crate) log_destination_type: ::std::option::Option<crate::types::LogDestinationType>,
    pub(crate) log_exports: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    _request_id: Option<String>,
}
impl DescribeLoggingStatusOutputBuilder {
    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
    pub fn logging_enabled(mut self, input: bool) -> Self {
        self.logging_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
    pub fn set_logging_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.logging_enabled = input;
        self
    }
    /// <p><code>true</code> if logging is on, <code>false</code> if logging is off.</p>
    pub fn get_logging_enabled(&self) -> &::std::option::Option<bool> {
        &self.logging_enabled
    }
    /// <p>The name of the S3 bucket where the log files are stored.</p>
    pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bucket_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the S3 bucket where the log files are stored.</p>
    pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bucket_name = input;
        self
    }
    /// <p>The name of the S3 bucket where the log files are stored.</p>
    pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.bucket_name
    }
    /// <p>The prefix applied to the log file names.</p>
    pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.s3_key_prefix = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The prefix applied to the log file names.</p>
    pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.s3_key_prefix = input;
        self
    }
    /// <p>The prefix applied to the log file names.</p>
    pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
        &self.s3_key_prefix
    }
    /// <p>The last time that logs were delivered.</p>
    pub fn last_successful_delivery_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_successful_delivery_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The last time that logs were delivered.</p>
    pub fn set_last_successful_delivery_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_successful_delivery_time = input;
        self
    }
    /// <p>The last time that logs were delivered.</p>
    pub fn get_last_successful_delivery_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_successful_delivery_time
    }
    /// <p>The last time when logs failed to be delivered.</p>
    pub fn last_failure_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_failure_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The last time when logs failed to be delivered.</p>
    pub fn set_last_failure_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_failure_time = input;
        self
    }
    /// <p>The last time when logs failed to be delivered.</p>
    pub fn get_last_failure_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_failure_time
    }
    /// <p>The message indicating that logs failed to be delivered.</p>
    pub fn last_failure_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_failure_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message indicating that logs failed to be delivered.</p>
    pub fn set_last_failure_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_failure_message = input;
        self
    }
    /// <p>The message indicating that logs failed to be delivered.</p>
    pub fn get_last_failure_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_failure_message
    }
    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
    pub fn log_destination_type(mut self, input: crate::types::LogDestinationType) -> Self {
        self.log_destination_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
    pub fn set_log_destination_type(mut self, input: ::std::option::Option<crate::types::LogDestinationType>) -> Self {
        self.log_destination_type = input;
        self
    }
    /// <p>The log destination type. An enum with possible values of <code>s3</code> and <code>cloudwatch</code>.</p>
    pub fn get_log_destination_type(&self) -> &::std::option::Option<crate::types::LogDestinationType> {
        &self.log_destination_type
    }
    /// Appends an item to `log_exports`.
    ///
    /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
    ///
    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
    pub fn log_exports(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.log_exports.unwrap_or_default();
        v.push(input.into());
        self.log_exports = ::std::option::Option::Some(v);
        self
    }
    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
    pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.log_exports = input;
        self
    }
    /// <p>The collection of exported log types. Possible values are <code>connectionlog</code>, <code>useractivitylog</code>, and <code>userlog</code>.</p>
    pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.log_exports
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeLoggingStatusOutput`](crate::operation::describe_logging_status::DescribeLoggingStatusOutput).
    pub fn build(self) -> crate::operation::describe_logging_status::DescribeLoggingStatusOutput {
        crate::operation::describe_logging_status::DescribeLoggingStatusOutput {
            logging_enabled: self.logging_enabled,
            bucket_name: self.bucket_name,
            s3_key_prefix: self.s3_key_prefix,
            last_successful_delivery_time: self.last_successful_delivery_time,
            last_failure_time: self.last_failure_time,
            last_failure_message: self.last_failure_message,
            log_destination_type: self.log_destination_type,
            log_exports: self.log_exports,
            _request_id: self._request_id,
        }
    }
}