com.amazonaws.services.redshift.model.DisableLoggingResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshift Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.redshift.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Describes the status of logging for a cluster.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DisableLoggingResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* true
if logging is on, false
if logging is off.
*
*/
private Boolean loggingEnabled;
/**
*
* The name of the S3 bucket where the log files are stored.
*
*/
private String bucketName;
/**
*
* The prefix applied to the log file names.
*
*/
private String s3KeyPrefix;
/**
*
* The last time that logs were delivered.
*
*/
private java.util.Date lastSuccessfulDeliveryTime;
/**
*
* The last time when logs failed to be delivered.
*
*/
private java.util.Date lastFailureTime;
/**
*
* The message indicating that logs failed to be delivered.
*
*/
private String lastFailureMessage;
/**
*
* The log destination type. An enum with possible values of s3
and cloudwatch
.
*
*/
private String logDestinationType;
/**
*
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
*
*/
private com.amazonaws.internal.SdkInternalList logExports;
/**
*
* true
if logging is on, false
if logging is off.
*
*
* @param loggingEnabled
* true
if logging is on, false
if logging is off.
*/
public void setLoggingEnabled(Boolean loggingEnabled) {
this.loggingEnabled = loggingEnabled;
}
/**
*
* true
if logging is on, false
if logging is off.
*
*
* @return true
if logging is on, false
if logging is off.
*/
public Boolean getLoggingEnabled() {
return this.loggingEnabled;
}
/**
*
* true
if logging is on, false
if logging is off.
*
*
* @param loggingEnabled
* true
if logging is on, false
if logging is off.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withLoggingEnabled(Boolean loggingEnabled) {
setLoggingEnabled(loggingEnabled);
return this;
}
/**
*
* true
if logging is on, false
if logging is off.
*
*
* @return true
if logging is on, false
if logging is off.
*/
public Boolean isLoggingEnabled() {
return this.loggingEnabled;
}
/**
*
* The name of the S3 bucket where the log files are stored.
*
*
* @param bucketName
* The name of the S3 bucket where the log files are stored.
*/
public void setBucketName(String bucketName) {
this.bucketName = bucketName;
}
/**
*
* The name of the S3 bucket where the log files are stored.
*
*
* @return The name of the S3 bucket where the log files are stored.
*/
public String getBucketName() {
return this.bucketName;
}
/**
*
* The name of the S3 bucket where the log files are stored.
*
*
* @param bucketName
* The name of the S3 bucket where the log files are stored.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withBucketName(String bucketName) {
setBucketName(bucketName);
return this;
}
/**
*
* The prefix applied to the log file names.
*
*
* @param s3KeyPrefix
* The prefix applied to the log file names.
*/
public void setS3KeyPrefix(String s3KeyPrefix) {
this.s3KeyPrefix = s3KeyPrefix;
}
/**
*
* The prefix applied to the log file names.
*
*
* @return The prefix applied to the log file names.
*/
public String getS3KeyPrefix() {
return this.s3KeyPrefix;
}
/**
*
* The prefix applied to the log file names.
*
*
* @param s3KeyPrefix
* The prefix applied to the log file names.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withS3KeyPrefix(String s3KeyPrefix) {
setS3KeyPrefix(s3KeyPrefix);
return this;
}
/**
*
* The last time that logs were delivered.
*
*
* @param lastSuccessfulDeliveryTime
* The last time that logs were delivered.
*/
public void setLastSuccessfulDeliveryTime(java.util.Date lastSuccessfulDeliveryTime) {
this.lastSuccessfulDeliveryTime = lastSuccessfulDeliveryTime;
}
/**
*
* The last time that logs were delivered.
*
*
* @return The last time that logs were delivered.
*/
public java.util.Date getLastSuccessfulDeliveryTime() {
return this.lastSuccessfulDeliveryTime;
}
/**
*
* The last time that logs were delivered.
*
*
* @param lastSuccessfulDeliveryTime
* The last time that logs were delivered.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withLastSuccessfulDeliveryTime(java.util.Date lastSuccessfulDeliveryTime) {
setLastSuccessfulDeliveryTime(lastSuccessfulDeliveryTime);
return this;
}
/**
*
* The last time when logs failed to be delivered.
*
*
* @param lastFailureTime
* The last time when logs failed to be delivered.
*/
public void setLastFailureTime(java.util.Date lastFailureTime) {
this.lastFailureTime = lastFailureTime;
}
/**
*
* The last time when logs failed to be delivered.
*
*
* @return The last time when logs failed to be delivered.
*/
public java.util.Date getLastFailureTime() {
return this.lastFailureTime;
}
/**
*
* The last time when logs failed to be delivered.
*
*
* @param lastFailureTime
* The last time when logs failed to be delivered.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withLastFailureTime(java.util.Date lastFailureTime) {
setLastFailureTime(lastFailureTime);
return this;
}
/**
*
* The message indicating that logs failed to be delivered.
*
*
* @param lastFailureMessage
* The message indicating that logs failed to be delivered.
*/
public void setLastFailureMessage(String lastFailureMessage) {
this.lastFailureMessage = lastFailureMessage;
}
/**
*
* The message indicating that logs failed to be delivered.
*
*
* @return The message indicating that logs failed to be delivered.
*/
public String getLastFailureMessage() {
return this.lastFailureMessage;
}
/**
*
* The message indicating that logs failed to be delivered.
*
*
* @param lastFailureMessage
* The message indicating that logs failed to be delivered.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withLastFailureMessage(String lastFailureMessage) {
setLastFailureMessage(lastFailureMessage);
return this;
}
/**
*
* The log destination type. An enum with possible values of s3
and cloudwatch
.
*
*
* @param logDestinationType
* The log destination type. An enum with possible values of s3
and cloudwatch
.
* @see LogDestinationType
*/
public void setLogDestinationType(String logDestinationType) {
this.logDestinationType = logDestinationType;
}
/**
*
* The log destination type. An enum with possible values of s3
and cloudwatch
.
*
*
* @return The log destination type. An enum with possible values of s3
and cloudwatch
.
* @see LogDestinationType
*/
public String getLogDestinationType() {
return this.logDestinationType;
}
/**
*
* The log destination type. An enum with possible values of s3
and cloudwatch
.
*
*
* @param logDestinationType
* The log destination type. An enum with possible values of s3
and cloudwatch
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LogDestinationType
*/
public DisableLoggingResult withLogDestinationType(String logDestinationType) {
setLogDestinationType(logDestinationType);
return this;
}
/**
*
* The log destination type. An enum with possible values of s3
and cloudwatch
.
*
*
* @param logDestinationType
* The log destination type. An enum with possible values of s3
and cloudwatch
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LogDestinationType
*/
public DisableLoggingResult withLogDestinationType(LogDestinationType logDestinationType) {
this.logDestinationType = logDestinationType.toString();
return this;
}
/**
*
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
*
*
* @return The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
*/
public java.util.List getLogExports() {
if (logExports == null) {
logExports = new com.amazonaws.internal.SdkInternalList();
}
return logExports;
}
/**
*
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
*
*
* @param logExports
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
*/
public void setLogExports(java.util.Collection logExports) {
if (logExports == null) {
this.logExports = null;
return;
}
this.logExports = new com.amazonaws.internal.SdkInternalList(logExports);
}
/**
*
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLogExports(java.util.Collection)} or {@link #withLogExports(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param logExports
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withLogExports(String... logExports) {
if (this.logExports == null) {
setLogExports(new com.amazonaws.internal.SdkInternalList(logExports.length));
}
for (String ele : logExports) {
this.logExports.add(ele);
}
return this;
}
/**
*
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
*
*
* @param logExports
* The collection of exported log types. Possible values are connectionlog
,
* useractivitylog
, and userlog
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DisableLoggingResult withLogExports(java.util.Collection logExports) {
setLogExports(logExports);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getLoggingEnabled() != null)
sb.append("LoggingEnabled: ").append(getLoggingEnabled()).append(",");
if (getBucketName() != null)
sb.append("BucketName: ").append(getBucketName()).append(",");
if (getS3KeyPrefix() != null)
sb.append("S3KeyPrefix: ").append(getS3KeyPrefix()).append(",");
if (getLastSuccessfulDeliveryTime() != null)
sb.append("LastSuccessfulDeliveryTime: ").append(getLastSuccessfulDeliveryTime()).append(",");
if (getLastFailureTime() != null)
sb.append("LastFailureTime: ").append(getLastFailureTime()).append(",");
if (getLastFailureMessage() != null)
sb.append("LastFailureMessage: ").append(getLastFailureMessage()).append(",");
if (getLogDestinationType() != null)
sb.append("LogDestinationType: ").append(getLogDestinationType()).append(",");
if (getLogExports() != null)
sb.append("LogExports: ").append(getLogExports());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DisableLoggingResult == false)
return false;
DisableLoggingResult other = (DisableLoggingResult) obj;
if (other.getLoggingEnabled() == null ^ this.getLoggingEnabled() == null)
return false;
if (other.getLoggingEnabled() != null && other.getLoggingEnabled().equals(this.getLoggingEnabled()) == false)
return false;
if (other.getBucketName() == null ^ this.getBucketName() == null)
return false;
if (other.getBucketName() != null && other.getBucketName().equals(this.getBucketName()) == false)
return false;
if (other.getS3KeyPrefix() == null ^ this.getS3KeyPrefix() == null)
return false;
if (other.getS3KeyPrefix() != null && other.getS3KeyPrefix().equals(this.getS3KeyPrefix()) == false)
return false;
if (other.getLastSuccessfulDeliveryTime() == null ^ this.getLastSuccessfulDeliveryTime() == null)
return false;
if (other.getLastSuccessfulDeliveryTime() != null && other.getLastSuccessfulDeliveryTime().equals(this.getLastSuccessfulDeliveryTime()) == false)
return false;
if (other.getLastFailureTime() == null ^ this.getLastFailureTime() == null)
return false;
if (other.getLastFailureTime() != null && other.getLastFailureTime().equals(this.getLastFailureTime()) == false)
return false;
if (other.getLastFailureMessage() == null ^ this.getLastFailureMessage() == null)
return false;
if (other.getLastFailureMessage() != null && other.getLastFailureMessage().equals(this.getLastFailureMessage()) == false)
return false;
if (other.getLogDestinationType() == null ^ this.getLogDestinationType() == null)
return false;
if (other.getLogDestinationType() != null && other.getLogDestinationType().equals(this.getLogDestinationType()) == false)
return false;
if (other.getLogExports() == null ^ this.getLogExports() == null)
return false;
if (other.getLogExports() != null && other.getLogExports().equals(this.getLogExports()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLoggingEnabled() == null) ? 0 : getLoggingEnabled().hashCode());
hashCode = prime * hashCode + ((getBucketName() == null) ? 0 : getBucketName().hashCode());
hashCode = prime * hashCode + ((getS3KeyPrefix() == null) ? 0 : getS3KeyPrefix().hashCode());
hashCode = prime * hashCode + ((getLastSuccessfulDeliveryTime() == null) ? 0 : getLastSuccessfulDeliveryTime().hashCode());
hashCode = prime * hashCode + ((getLastFailureTime() == null) ? 0 : getLastFailureTime().hashCode());
hashCode = prime * hashCode + ((getLastFailureMessage() == null) ? 0 : getLastFailureMessage().hashCode());
hashCode = prime * hashCode + ((getLogDestinationType() == null) ? 0 : getLogDestinationType().hashCode());
hashCode = prime * hashCode + ((getLogExports() == null) ? 0 : getLogExports().hashCode());
return hashCode;
}
@Override
public DisableLoggingResult clone() {
try {
return (DisableLoggingResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}