/* * Copyright 2018-2023 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.securityhub.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Information about logging for the S3 bucket *

* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AwsS3BucketLoggingConfiguration implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the S3 bucket where log files for the S3 bucket are stored. *

*/ private String destinationBucketName; /** *

* The prefix added to log files for the S3 bucket. *

*/ private String logFilePrefix; /** *

* The name of the S3 bucket where log files for the S3 bucket are stored. *

* * @param destinationBucketName * The name of the S3 bucket where log files for the S3 bucket are stored. */ public void setDestinationBucketName(String destinationBucketName) { this.destinationBucketName = destinationBucketName; } /** *

* The name of the S3 bucket where log files for the S3 bucket are stored. *

* * @return The name of the S3 bucket where log files for the S3 bucket are stored. */ public String getDestinationBucketName() { return this.destinationBucketName; } /** *

* The name of the S3 bucket where log files for the S3 bucket are stored. *

* * @param destinationBucketName * The name of the S3 bucket where log files for the S3 bucket are stored. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsS3BucketLoggingConfiguration withDestinationBucketName(String destinationBucketName) { setDestinationBucketName(destinationBucketName); return this; } /** *

* The prefix added to log files for the S3 bucket. *

* * @param logFilePrefix * The prefix added to log files for the S3 bucket. */ public void setLogFilePrefix(String logFilePrefix) { this.logFilePrefix = logFilePrefix; } /** *

* The prefix added to log files for the S3 bucket. *

* * @return The prefix added to log files for the S3 bucket. */ public String getLogFilePrefix() { return this.logFilePrefix; } /** *

* The prefix added to log files for the S3 bucket. *

* * @param logFilePrefix * The prefix added to log files for the S3 bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public AwsS3BucketLoggingConfiguration withLogFilePrefix(String logFilePrefix) { setLogFilePrefix(logFilePrefix); 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 (getDestinationBucketName() != null) sb.append("DestinationBucketName: ").append(getDestinationBucketName()).append(","); if (getLogFilePrefix() != null) sb.append("LogFilePrefix: ").append(getLogFilePrefix()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AwsS3BucketLoggingConfiguration == false) return false; AwsS3BucketLoggingConfiguration other = (AwsS3BucketLoggingConfiguration) obj; if (other.getDestinationBucketName() == null ^ this.getDestinationBucketName() == null) return false; if (other.getDestinationBucketName() != null && other.getDestinationBucketName().equals(this.getDestinationBucketName()) == false) return false; if (other.getLogFilePrefix() == null ^ this.getLogFilePrefix() == null) return false; if (other.getLogFilePrefix() != null && other.getLogFilePrefix().equals(this.getLogFilePrefix()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDestinationBucketName() == null) ? 0 : getDestinationBucketName().hashCode()); hashCode = prime * hashCode + ((getLogFilePrefix() == null) ? 0 : getLogFilePrefix().hashCode()); return hashCode; } @Override public AwsS3BucketLoggingConfiguration clone() { try { return (AwsS3BucketLoggingConfiguration) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.securityhub.model.transform.AwsS3BucketLoggingConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }