/* * 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.cloudtrail.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* Returns the objects or data listed below if successful. Otherwise, returns an error. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UpdateTrailResult extends com.amazonaws.AmazonWebServiceResult* Specifies the name of the trail. *
*/ private String name; /** ** Specifies the name of the Amazon S3 bucket designated for publishing log files. *
*/ private String s3BucketName; /** ** Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file * delivery. For more information, see Finding Your IAM * Log Files. *
*/ private String s3KeyPrefix; /** *
* This field is no longer in use. Use SnsTopicARN
.
*
* Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are * delivered. The following is the format of a topic ARN. *
*
* arn:aws:sns:us-east-2:123456789012:MyTopic
*
* Specifies whether the trail is publishing events from global services such as IAM to the log files. *
*/ private Boolean includeGlobalServiceEvents; /** ** Specifies whether the trail exists in one Region or in all Regions. *
*/ private Boolean isMultiRegionTrail; /** ** Specifies the ARN of the trail that was updated. The following is the format of a trail ARN. *
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
* Specifies whether log file integrity validation is enabled. *
*/ private Boolean logFileValidationEnabled; /** ** Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered. *
*/ private String cloudWatchLogsLogGroupArn; /** ** Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. *
*/ private String cloudWatchLogsRoleArn; /** ** Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a * KMS key in the following format. *
*
* arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
*
* Specifies whether the trail is an organization trail. *
*/ private Boolean isOrganizationTrail; /** ** Specifies the name of the trail. *
* * @param name * Specifies the name of the trail. */ public void setName(String name) { this.name = name; } /** ** Specifies the name of the trail. *
* * @return Specifies the name of the trail. */ public String getName() { return this.name; } /** ** Specifies the name of the trail. *
* * @param name * Specifies the name of the trail. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withName(String name) { setName(name); return this; } /** ** Specifies the name of the Amazon S3 bucket designated for publishing log files. *
* * @param s3BucketName * Specifies the name of the Amazon S3 bucket designated for publishing log files. */ public void setS3BucketName(String s3BucketName) { this.s3BucketName = s3BucketName; } /** ** Specifies the name of the Amazon S3 bucket designated for publishing log files. *
* * @return Specifies the name of the Amazon S3 bucket designated for publishing log files. */ public String getS3BucketName() { return this.s3BucketName; } /** ** Specifies the name of the Amazon S3 bucket designated for publishing log files. *
* * @param s3BucketName * Specifies the name of the Amazon S3 bucket designated for publishing log files. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withS3BucketName(String s3BucketName) { setS3BucketName(s3BucketName); return this; } /** ** Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file * delivery. For more information, see Finding Your IAM * Log Files. *
* * @param s3KeyPrefix * Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log * file delivery. For more information, see Finding * Your IAM Log Files. */ public void setS3KeyPrefix(String s3KeyPrefix) { this.s3KeyPrefix = s3KeyPrefix; } /** ** Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file * delivery. For more information, see Finding Your IAM * Log Files. *
* * @return Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log * file delivery. For more information, see Finding * Your IAM Log Files. */ public String getS3KeyPrefix() { return this.s3KeyPrefix; } /** ** Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file * delivery. For more information, see Finding Your IAM * Log Files. *
* * @param s3KeyPrefix * Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log * file delivery. For more information, see Finding * Your IAM Log Files. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withS3KeyPrefix(String s3KeyPrefix) { setS3KeyPrefix(s3KeyPrefix); return this; } /** *
* This field is no longer in use. Use SnsTopicARN
.
*
SnsTopicARN
.
*/
@Deprecated
public void setSnsTopicName(String snsTopicName) {
this.snsTopicName = snsTopicName;
}
/**
*
* This field is no longer in use. Use SnsTopicARN
.
*
SnsTopicARN
.
*/
@Deprecated
public String getSnsTopicName() {
return this.snsTopicName;
}
/**
*
* This field is no longer in use. Use SnsTopicARN
.
*
SnsTopicARN
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public UpdateTrailResult withSnsTopicName(String snsTopicName) {
setSnsTopicName(snsTopicName);
return this;
}
/**
* * Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are * delivered. The following is the format of a topic ARN. *
*
* arn:aws:sns:us-east-2:123456789012:MyTopic
*
* arn:aws:sns:us-east-2:123456789012:MyTopic
*/
public void setSnsTopicARN(String snsTopicARN) {
this.snsTopicARN = snsTopicARN;
}
/**
*
* Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are * delivered. The following is the format of a topic ARN. *
*
* arn:aws:sns:us-east-2:123456789012:MyTopic
*
* arn:aws:sns:us-east-2:123456789012:MyTopic
*/
public String getSnsTopicARN() {
return this.snsTopicARN;
}
/**
*
* Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are * delivered. The following is the format of a topic ARN. *
*
* arn:aws:sns:us-east-2:123456789012:MyTopic
*
* arn:aws:sns:us-east-2:123456789012:MyTopic
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateTrailResult withSnsTopicARN(String snsTopicARN) {
setSnsTopicARN(snsTopicARN);
return this;
}
/**
*
* Specifies whether the trail is publishing events from global services such as IAM to the log files. *
* * @param includeGlobalServiceEvents * Specifies whether the trail is publishing events from global services such as IAM to the log files. */ public void setIncludeGlobalServiceEvents(Boolean includeGlobalServiceEvents) { this.includeGlobalServiceEvents = includeGlobalServiceEvents; } /** ** Specifies whether the trail is publishing events from global services such as IAM to the log files. *
* * @return Specifies whether the trail is publishing events from global services such as IAM to the log files. */ public Boolean getIncludeGlobalServiceEvents() { return this.includeGlobalServiceEvents; } /** ** Specifies whether the trail is publishing events from global services such as IAM to the log files. *
* * @param includeGlobalServiceEvents * Specifies whether the trail is publishing events from global services such as IAM to the log files. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withIncludeGlobalServiceEvents(Boolean includeGlobalServiceEvents) { setIncludeGlobalServiceEvents(includeGlobalServiceEvents); return this; } /** ** Specifies whether the trail is publishing events from global services such as IAM to the log files. *
* * @return Specifies whether the trail is publishing events from global services such as IAM to the log files. */ public Boolean isIncludeGlobalServiceEvents() { return this.includeGlobalServiceEvents; } /** ** Specifies whether the trail exists in one Region or in all Regions. *
* * @param isMultiRegionTrail * Specifies whether the trail exists in one Region or in all Regions. */ public void setIsMultiRegionTrail(Boolean isMultiRegionTrail) { this.isMultiRegionTrail = isMultiRegionTrail; } /** ** Specifies whether the trail exists in one Region or in all Regions. *
* * @return Specifies whether the trail exists in one Region or in all Regions. */ public Boolean getIsMultiRegionTrail() { return this.isMultiRegionTrail; } /** ** Specifies whether the trail exists in one Region or in all Regions. *
* * @param isMultiRegionTrail * Specifies whether the trail exists in one Region or in all Regions. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withIsMultiRegionTrail(Boolean isMultiRegionTrail) { setIsMultiRegionTrail(isMultiRegionTrail); return this; } /** ** Specifies whether the trail exists in one Region or in all Regions. *
* * @return Specifies whether the trail exists in one Region or in all Regions. */ public Boolean isMultiRegionTrail() { return this.isMultiRegionTrail; } /** ** Specifies the ARN of the trail that was updated. The following is the format of a trail ARN. *
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*/
public void setTrailARN(String trailARN) {
this.trailARN = trailARN;
}
/**
*
* Specifies the ARN of the trail that was updated. The following is the format of a trail ARN. *
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*/
public String getTrailARN() {
return this.trailARN;
}
/**
*
* Specifies the ARN of the trail that was updated. The following is the format of a trail ARN. *
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
*
* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateTrailResult withTrailARN(String trailARN) {
setTrailARN(trailARN);
return this;
}
/**
*
* Specifies whether log file integrity validation is enabled. *
* * @param logFileValidationEnabled * Specifies whether log file integrity validation is enabled. */ public void setLogFileValidationEnabled(Boolean logFileValidationEnabled) { this.logFileValidationEnabled = logFileValidationEnabled; } /** ** Specifies whether log file integrity validation is enabled. *
* * @return Specifies whether log file integrity validation is enabled. */ public Boolean getLogFileValidationEnabled() { return this.logFileValidationEnabled; } /** ** Specifies whether log file integrity validation is enabled. *
* * @param logFileValidationEnabled * Specifies whether log file integrity validation is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withLogFileValidationEnabled(Boolean logFileValidationEnabled) { setLogFileValidationEnabled(logFileValidationEnabled); return this; } /** ** Specifies whether log file integrity validation is enabled. *
* * @return Specifies whether log file integrity validation is enabled. */ public Boolean isLogFileValidationEnabled() { return this.logFileValidationEnabled; } /** ** Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered. *
* * @param cloudWatchLogsLogGroupArn * Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered. */ public void setCloudWatchLogsLogGroupArn(String cloudWatchLogsLogGroupArn) { this.cloudWatchLogsLogGroupArn = cloudWatchLogsLogGroupArn; } /** ** Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered. *
* * @return Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered. */ public String getCloudWatchLogsLogGroupArn() { return this.cloudWatchLogsLogGroupArn; } /** ** Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered. *
* * @param cloudWatchLogsLogGroupArn * Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withCloudWatchLogsLogGroupArn(String cloudWatchLogsLogGroupArn) { setCloudWatchLogsLogGroupArn(cloudWatchLogsLogGroupArn); return this; } /** ** Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. *
* * @param cloudWatchLogsRoleArn * Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. */ public void setCloudWatchLogsRoleArn(String cloudWatchLogsRoleArn) { this.cloudWatchLogsRoleArn = cloudWatchLogsRoleArn; } /** ** Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. *
* * @return Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. */ public String getCloudWatchLogsRoleArn() { return this.cloudWatchLogsRoleArn; } /** ** Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. *
* * @param cloudWatchLogsRoleArn * Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withCloudWatchLogsRoleArn(String cloudWatchLogsRoleArn) { setCloudWatchLogsRoleArn(cloudWatchLogsRoleArn); return this; } /** ** Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a * KMS key in the following format. *
*
* arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
*
* arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
*
* Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a * KMS key in the following format. *
*
* arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
*
* arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
*
* Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a * KMS key in the following format. *
*
* arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
*
* arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateTrailResult withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
return this;
}
/**
*
* Specifies whether the trail is an organization trail. *
* * @param isOrganizationTrail * Specifies whether the trail is an organization trail. */ public void setIsOrganizationTrail(Boolean isOrganizationTrail) { this.isOrganizationTrail = isOrganizationTrail; } /** ** Specifies whether the trail is an organization trail. *
* * @return Specifies whether the trail is an organization trail. */ public Boolean getIsOrganizationTrail() { return this.isOrganizationTrail; } /** ** Specifies whether the trail is an organization trail. *
* * @param isOrganizationTrail * Specifies whether the trail is an organization trail. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateTrailResult withIsOrganizationTrail(Boolean isOrganizationTrail) { setIsOrganizationTrail(isOrganizationTrail); return this; } /** ** Specifies whether the trail is an organization trail. *
* * @return Specifies whether the trail is an organization trail. */ public Boolean isOrganizationTrail() { return this.isOrganizationTrail; } /** * 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getS3BucketName() != null) sb.append("S3BucketName: ").append(getS3BucketName()).append(","); if (getS3KeyPrefix() != null) sb.append("S3KeyPrefix: ").append(getS3KeyPrefix()).append(","); if (getSnsTopicName() != null) sb.append("SnsTopicName: ").append(getSnsTopicName()).append(","); if (getSnsTopicARN() != null) sb.append("SnsTopicARN: ").append(getSnsTopicARN()).append(","); if (getIncludeGlobalServiceEvents() != null) sb.append("IncludeGlobalServiceEvents: ").append(getIncludeGlobalServiceEvents()).append(","); if (getIsMultiRegionTrail() != null) sb.append("IsMultiRegionTrail: ").append(getIsMultiRegionTrail()).append(","); if (getTrailARN() != null) sb.append("TrailARN: ").append(getTrailARN()).append(","); if (getLogFileValidationEnabled() != null) sb.append("LogFileValidationEnabled: ").append(getLogFileValidationEnabled()).append(","); if (getCloudWatchLogsLogGroupArn() != null) sb.append("CloudWatchLogsLogGroupArn: ").append(getCloudWatchLogsLogGroupArn()).append(","); if (getCloudWatchLogsRoleArn() != null) sb.append("CloudWatchLogsRoleArn: ").append(getCloudWatchLogsRoleArn()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()).append(","); if (getIsOrganizationTrail() != null) sb.append("IsOrganizationTrail: ").append(getIsOrganizationTrail()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateTrailResult == false) return false; UpdateTrailResult other = (UpdateTrailResult) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getS3BucketName() == null ^ this.getS3BucketName() == null) return false; if (other.getS3BucketName() != null && other.getS3BucketName().equals(this.getS3BucketName()) == 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.getSnsTopicName() == null ^ this.getSnsTopicName() == null) return false; if (other.getSnsTopicName() != null && other.getSnsTopicName().equals(this.getSnsTopicName()) == false) return false; if (other.getSnsTopicARN() == null ^ this.getSnsTopicARN() == null) return false; if (other.getSnsTopicARN() != null && other.getSnsTopicARN().equals(this.getSnsTopicARN()) == false) return false; if (other.getIncludeGlobalServiceEvents() == null ^ this.getIncludeGlobalServiceEvents() == null) return false; if (other.getIncludeGlobalServiceEvents() != null && other.getIncludeGlobalServiceEvents().equals(this.getIncludeGlobalServiceEvents()) == false) return false; if (other.getIsMultiRegionTrail() == null ^ this.getIsMultiRegionTrail() == null) return false; if (other.getIsMultiRegionTrail() != null && other.getIsMultiRegionTrail().equals(this.getIsMultiRegionTrail()) == false) return false; if (other.getTrailARN() == null ^ this.getTrailARN() == null) return false; if (other.getTrailARN() != null && other.getTrailARN().equals(this.getTrailARN()) == false) return false; if (other.getLogFileValidationEnabled() == null ^ this.getLogFileValidationEnabled() == null) return false; if (other.getLogFileValidationEnabled() != null && other.getLogFileValidationEnabled().equals(this.getLogFileValidationEnabled()) == false) return false; if (other.getCloudWatchLogsLogGroupArn() == null ^ this.getCloudWatchLogsLogGroupArn() == null) return false; if (other.getCloudWatchLogsLogGroupArn() != null && other.getCloudWatchLogsLogGroupArn().equals(this.getCloudWatchLogsLogGroupArn()) == false) return false; if (other.getCloudWatchLogsRoleArn() == null ^ this.getCloudWatchLogsRoleArn() == null) return false; if (other.getCloudWatchLogsRoleArn() != null && other.getCloudWatchLogsRoleArn().equals(this.getCloudWatchLogsRoleArn()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; if (other.getIsOrganizationTrail() == null ^ this.getIsOrganizationTrail() == null) return false; if (other.getIsOrganizationTrail() != null && other.getIsOrganizationTrail().equals(this.getIsOrganizationTrail()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getS3BucketName() == null) ? 0 : getS3BucketName().hashCode()); hashCode = prime * hashCode + ((getS3KeyPrefix() == null) ? 0 : getS3KeyPrefix().hashCode()); hashCode = prime * hashCode + ((getSnsTopicName() == null) ? 0 : getSnsTopicName().hashCode()); hashCode = prime * hashCode + ((getSnsTopicARN() == null) ? 0 : getSnsTopicARN().hashCode()); hashCode = prime * hashCode + ((getIncludeGlobalServiceEvents() == null) ? 0 : getIncludeGlobalServiceEvents().hashCode()); hashCode = prime * hashCode + ((getIsMultiRegionTrail() == null) ? 0 : getIsMultiRegionTrail().hashCode()); hashCode = prime * hashCode + ((getTrailARN() == null) ? 0 : getTrailARN().hashCode()); hashCode = prime * hashCode + ((getLogFileValidationEnabled() == null) ? 0 : getLogFileValidationEnabled().hashCode()); hashCode = prime * hashCode + ((getCloudWatchLogsLogGroupArn() == null) ? 0 : getCloudWatchLogsLogGroupArn().hashCode()); hashCode = prime * hashCode + ((getCloudWatchLogsRoleArn() == null) ? 0 : getCloudWatchLogsRoleArn().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getIsOrganizationTrail() == null) ? 0 : getIsOrganizationTrail().hashCode()); return hashCode; } @Override public UpdateTrailResult clone() { try { return (UpdateTrailResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }