com.amazonaws.services.redshift.model.EnableLoggingRequest 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;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EnableLoggingRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The identifier of the cluster on which logging is to be started.
*
*
* Example: examplecluster
*
*/
private String clusterIdentifier;
/**
*
* The name of an existing S3 bucket where the log files are to be stored.
*
*
* Constraints:
*
*
* -
*
* Must be in the same region as the cluster
*
*
* -
*
* The cluster must have read bucket and put object permissions
*
*
*
*/
private String bucketName;
/**
*
* The prefix applied to the log file names.
*
*
* Constraints:
*
*
* -
*
* Cannot exceed 512 characters
*
*
* -
*
* Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (\), or control characters. The
* hexadecimal codes for invalid characters are:
*
*
* -
*
* x00 to x20
*
*
* -
*
* x22
*
*
* -
*
* x27
*
*
* -
*
* x5c
*
*
* -
*
* x7f or larger
*
*
*
*
*
*/
private String s3KeyPrefix;
/**
*
* 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;
/**
*
* The identifier of the cluster on which logging is to be started.
*
*
* Example: examplecluster
*
*
* @param clusterIdentifier
* The identifier of the cluster on which logging is to be started.
*
* Example: examplecluster
*/
public void setClusterIdentifier(String clusterIdentifier) {
this.clusterIdentifier = clusterIdentifier;
}
/**
*
* The identifier of the cluster on which logging is to be started.
*
*
* Example: examplecluster
*
*
* @return The identifier of the cluster on which logging is to be started.
*
* Example: examplecluster
*/
public String getClusterIdentifier() {
return this.clusterIdentifier;
}
/**
*
* The identifier of the cluster on which logging is to be started.
*
*
* Example: examplecluster
*
*
* @param clusterIdentifier
* The identifier of the cluster on which logging is to be started.
*
* Example: examplecluster
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EnableLoggingRequest withClusterIdentifier(String clusterIdentifier) {
setClusterIdentifier(clusterIdentifier);
return this;
}
/**
*
* The name of an existing S3 bucket where the log files are to be stored.
*
*
* Constraints:
*
*
* -
*
* Must be in the same region as the cluster
*
*
* -
*
* The cluster must have read bucket and put object permissions
*
*
*
*
* @param bucketName
* The name of an existing S3 bucket where the log files are to be stored.
*
* Constraints:
*
*
* -
*
* Must be in the same region as the cluster
*
*
* -
*
* The cluster must have read bucket and put object permissions
*
*
*/
public void setBucketName(String bucketName) {
this.bucketName = bucketName;
}
/**
*
* The name of an existing S3 bucket where the log files are to be stored.
*
*
* Constraints:
*
*
* -
*
* Must be in the same region as the cluster
*
*
* -
*
* The cluster must have read bucket and put object permissions
*
*
*
*
* @return The name of an existing S3 bucket where the log files are to be stored.
*
* Constraints:
*
*
* -
*
* Must be in the same region as the cluster
*
*
* -
*
* The cluster must have read bucket and put object permissions
*
*
*/
public String getBucketName() {
return this.bucketName;
}
/**
*
* The name of an existing S3 bucket where the log files are to be stored.
*
*
* Constraints:
*
*
* -
*
* Must be in the same region as the cluster
*
*
* -
*
* The cluster must have read bucket and put object permissions
*
*
*
*
* @param bucketName
* The name of an existing S3 bucket where the log files are to be stored.
*
* Constraints:
*
*
* -
*
* Must be in the same region as the cluster
*
*
* -
*
* The cluster must have read bucket and put object permissions
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EnableLoggingRequest withBucketName(String bucketName) {
setBucketName(bucketName);
return this;
}
/**
*
* The prefix applied to the log file names.
*
*
* Constraints:
*
*
* -
*
* Cannot exceed 512 characters
*
*
* -
*
* Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (\), or control characters. The
* hexadecimal codes for invalid characters are:
*
*
* -
*
* x00 to x20
*
*
* -
*
* x22
*
*
* -
*
* x27
*
*
* -
*
* x5c
*
*
* -
*
* x7f or larger
*
*
*
*
*
*
* @param s3KeyPrefix
* The prefix applied to the log file names.
*
* Constraints:
*
*
* -
*
* Cannot exceed 512 characters
*
*
* -
*
* Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (\), or control characters.
* The hexadecimal codes for invalid characters are:
*
*
* -
*
* x00 to x20
*
*
* -
*
* x22
*
*
* -
*
* x27
*
*
* -
*
* x5c
*
*
* -
*
* x7f or larger
*
*
*
*
*/
public void setS3KeyPrefix(String s3KeyPrefix) {
this.s3KeyPrefix = s3KeyPrefix;
}
/**
*
* The prefix applied to the log file names.
*
*
* Constraints:
*
*
* -
*
* Cannot exceed 512 characters
*
*
* -
*
* Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (\), or control characters. The
* hexadecimal codes for invalid characters are:
*
*
* -
*
* x00 to x20
*
*
* -
*
* x22
*
*
* -
*
* x27
*
*
* -
*
* x5c
*
*
* -
*
* x7f or larger
*
*
*
*
*
*
* @return The prefix applied to the log file names.
*
* Constraints:
*
*
* -
*
* Cannot exceed 512 characters
*
*
* -
*
* Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (\), or control characters.
* The hexadecimal codes for invalid characters are:
*
*
* -
*
* x00 to x20
*
*
* -
*
* x22
*
*
* -
*
* x27
*
*
* -
*
* x5c
*
*
* -
*
* x7f or larger
*
*
*
*
*/
public String getS3KeyPrefix() {
return this.s3KeyPrefix;
}
/**
*
* The prefix applied to the log file names.
*
*
* Constraints:
*
*
* -
*
* Cannot exceed 512 characters
*
*
* -
*
* Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (\), or control characters. The
* hexadecimal codes for invalid characters are:
*
*
* -
*
* x00 to x20
*
*
* -
*
* x22
*
*
* -
*
* x27
*
*
* -
*
* x5c
*
*
* -
*
* x7f or larger
*
*
*
*
*
*
* @param s3KeyPrefix
* The prefix applied to the log file names.
*
* Constraints:
*
*
* -
*
* Cannot exceed 512 characters
*
*
* -
*
* Cannot contain spaces( ), double quotes ("), single quotes ('), a backslash (\), or control characters.
* The hexadecimal codes for invalid characters are:
*
*
* -
*
* x00 to x20
*
*
* -
*
* x22
*
*
* -
*
* x27
*
*
* -
*
* x5c
*
*
* -
*
* x7f or larger
*
*
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EnableLoggingRequest withS3KeyPrefix(String s3KeyPrefix) {
setS3KeyPrefix(s3KeyPrefix);
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 EnableLoggingRequest 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 EnableLoggingRequest 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 EnableLoggingRequest 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 EnableLoggingRequest 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 (getClusterIdentifier() != null)
sb.append("ClusterIdentifier: ").append(getClusterIdentifier()).append(",");
if (getBucketName() != null)
sb.append("BucketName: ").append(getBucketName()).append(",");
if (getS3KeyPrefix() != null)
sb.append("S3KeyPrefix: ").append(getS3KeyPrefix()).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 EnableLoggingRequest == false)
return false;
EnableLoggingRequest other = (EnableLoggingRequest) obj;
if (other.getClusterIdentifier() == null ^ this.getClusterIdentifier() == null)
return false;
if (other.getClusterIdentifier() != null && other.getClusterIdentifier().equals(this.getClusterIdentifier()) == 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.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 + ((getClusterIdentifier() == null) ? 0 : getClusterIdentifier().hashCode());
hashCode = prime * hashCode + ((getBucketName() == null) ? 0 : getBucketName().hashCode());
hashCode = prime * hashCode + ((getS3KeyPrefix() == null) ? 0 : getS3KeyPrefix().hashCode());
hashCode = prime * hashCode + ((getLogDestinationType() == null) ? 0 : getLogDestinationType().hashCode());
hashCode = prime * hashCode + ((getLogExports() == null) ? 0 : getLogExports().hashCode());
return hashCode;
}
@Override
public EnableLoggingRequest clone() {
return (EnableLoggingRequest) super.clone();
}
}