Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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;
 

Returns the objects or data listed below if successful. Otherwise, returns an error.

 
 public class CreateTrailResult implements SerializableCloneable {

    
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 precedes the name of the bucket you have designated for log file delivery.
 
     private String s3KeyPrefix;

    
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.
 
     private String snsTopicName;

    
Specifies whether the trail is publishing events from global services such as IAM to the log files.
 
     private Boolean includeGlobalServiceEvents;

    
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be 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 name of the trail.

Returns:
Specifies the name of the trail.
 
     public String getName() {
         return ;
     }
    
    
Specifies the name of the trail.

Parameters:
name Specifies the name of the trail.
 
     public void setName(String name) {
         this. = name;
     }
    
    
Specifies the name of the trail.

Returns a reference to this object so that method calls can be chained together.

Parameters:
name Specifies the name of the trail.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateTrailResult withName(String name) {
         this. = name;
         return this;
     }

    
Specifies the name of the Amazon S3 bucket designated for publishing log files.

Returns:
Specifies the name of the Amazon S3 bucket designated for publishing log files.
    public String getS3BucketName() {
        return ;
    }
    
    
Specifies the name of the Amazon S3 bucket designated for publishing log files.

Parameters:
s3BucketName Specifies the name of the Amazon S3 bucket designated for publishing log files.
    public void setS3BucketName(String s3BucketName) {
        this. = s3BucketName;
    }
    
    
Specifies the name of the Amazon S3 bucket designated for publishing log files.

Returns a reference to this object so that method calls can be chained together.

Parameters:
s3BucketName Specifies the name of the Amazon S3 bucket designated for publishing log files.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTrailResult withS3BucketName(String s3BucketName) {
        this. = s3BucketName;
        return this;
    }

    
Specifies the Amazon S3 key prefix that precedes the name of the bucket you have designated for log file delivery.

Returns:
Specifies the Amazon S3 key prefix that precedes the name of the bucket you have designated for log file delivery.
    public String getS3KeyPrefix() {
        return ;
    }
    
    
Specifies the Amazon S3 key prefix that precedes the name of the bucket you have designated for log file delivery.

Parameters:
s3KeyPrefix Specifies the Amazon S3 key prefix that precedes the name of the bucket you have designated for log file delivery.
    public void setS3KeyPrefix(String s3KeyPrefix) {
        this. = s3KeyPrefix;
    }
    
    
Specifies the Amazon S3 key prefix that precedes the name of the bucket you have designated for log file delivery.

Returns a reference to this object so that method calls can be chained together.

Parameters:
s3KeyPrefix Specifies the Amazon S3 key prefix that precedes the name of the bucket you have designated for log file delivery.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTrailResult withS3KeyPrefix(String s3KeyPrefix) {
        this. = s3KeyPrefix;
        return this;
    }

    
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.

Returns:
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.
    public String getSnsTopicName() {
        return ;
    }
    
    
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.

Parameters:
snsTopicName Specifies the name of the Amazon SNS topic defined for notification of log file delivery.
    public void setSnsTopicName(String snsTopicName) {
        this. = snsTopicName;
    }
    
    
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.

Returns a reference to this object so that method calls can be chained together.

Parameters:
snsTopicName Specifies the name of the Amazon SNS topic defined for notification of log file delivery.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTrailResult withSnsTopicName(String snsTopicName) {
        this. = snsTopicName;
        return this;
    }

    
Specifies whether the trail is publishing events from global services such as IAM to the log files.

Returns:
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.

Parameters:
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;
    }
    
    
Specifies whether the trail is publishing events from global services such as IAM to the log files.

Returns a reference to this object so that method calls can be chained together.

Parameters:
includeGlobalServiceEvents Specifies whether the trail is publishing events from global services such as IAM to the log files.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTrailResult withIncludeGlobalServiceEvents(Boolean includeGlobalServiceEvents) {
        this. = includeGlobalServiceEvents;
        return this;
    }

    
Specifies whether the trail is publishing events from global services such as IAM to the log files.

Returns:
Specifies whether the trail is publishing events from global services such as IAM to the log files.
        return ;
    }

    
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.

Returns:
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.
        return ;
    }
    
    
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.

Parameters:
cloudWatchLogsLogGroupArn Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.
    public void setCloudWatchLogsLogGroupArn(String cloudWatchLogsLogGroupArn) {
        this. = cloudWatchLogsLogGroupArn;
    }
    
    
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.

Returns a reference to this object so that method calls can be chained together.

Parameters:
cloudWatchLogsLogGroupArn Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTrailResult withCloudWatchLogsLogGroupArn(String cloudWatchLogsLogGroupArn) {
        this. = cloudWatchLogsLogGroupArn;
        return this;
    }

    
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user???s log group.

Returns:
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user???s log group.
    public String getCloudWatchLogsRoleArn() {
        return ;
    }
    
    
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user???s log group.

Parameters:
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;
    }
    
    
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user???s log group.

Returns a reference to this object so that method calls can be chained together.

Parameters:
cloudWatchLogsRoleArn Specifies the role for the CloudWatch Logs endpoint to assume to write to a user???s log group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateTrailResult withCloudWatchLogsRoleArn(String cloudWatchLogsRoleArn) {
        this. = cloudWatchLogsRoleArn;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getName() != nullsb.append("Name: " + getName() + ",");
        if (getS3BucketName() != nullsb.append("S3BucketName: " + getS3BucketName() + ",");
        if (getS3KeyPrefix() != nullsb.append("S3KeyPrefix: " + getS3KeyPrefix() + ",");
        if (getSnsTopicName() != nullsb.append("SnsTopicName: " + getSnsTopicName() + ",");
        if (isIncludeGlobalServiceEvents() != nullsb.append("IncludeGlobalServiceEvents: " + isIncludeGlobalServiceEvents() + ",");
        if (getCloudWatchLogsLogGroupArn() != nullsb.append("CloudWatchLogsLogGroupArn: " + getCloudWatchLogsLogGroupArn() + ",");
        if (getCloudWatchLogsRoleArn() != nullsb.append("CloudWatchLogsRoleArn: " + getCloudWatchLogsRoleArn() );
        sb.append("}");
        return sb.toString();
    }
    
    @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 + ((isIncludeGlobalServiceEvents() == null) ? 0 : isIncludeGlobalServiceEvents().hashCode()); 
        hashCode = prime * hashCode + ((getCloudWatchLogsLogGroupArn() == null) ? 0 : getCloudWatchLogsLogGroupArn().hashCode()); 
        hashCode = prime * hashCode + ((getCloudWatchLogsRoleArn() == null) ? 0 : getCloudWatchLogsRoleArn().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateTrailResult == falsereturn false;
        CreateTrailResult other = (CreateTrailResult)obj;
        
        if (other.getName() == null ^ this.getName() == nullreturn false;
        if (other.getName() != null && other.getName().equals(this.getName()) == falsereturn false
        if (other.getS3BucketName() == null ^ this.getS3BucketName() == nullreturn false;
        if (other.getS3BucketName() != null && other.getS3BucketName().equals(this.getS3BucketName()) == falsereturn false
        if (other.getS3KeyPrefix() == null ^ this.getS3KeyPrefix() == nullreturn false;
        if (other.getS3KeyPrefix() != null && other.getS3KeyPrefix().equals(this.getS3KeyPrefix()) == falsereturn false
        if (other.getSnsTopicName() == null ^ this.getSnsTopicName() == nullreturn false;
        if (other.getSnsTopicName() != null && other.getSnsTopicName().equals(this.getSnsTopicName()) == falsereturn false
        if (other.isIncludeGlobalServiceEvents() == null ^ this.isIncludeGlobalServiceEvents() == nullreturn false;
        if (other.isIncludeGlobalServiceEvents() != null && other.isIncludeGlobalServiceEvents().equals(this.isIncludeGlobalServiceEvents()) == falsereturn false
        if (other.getCloudWatchLogsLogGroupArn() == null ^ this.getCloudWatchLogsLogGroupArn() == nullreturn false;
        if (other.getCloudWatchLogsLogGroupArn() != null && other.getCloudWatchLogsLogGroupArn().equals(this.getCloudWatchLogsLogGroupArn()) == falsereturn false
        if (other.getCloudWatchLogsRoleArn() == null ^ this.getCloudWatchLogsRoleArn() == nullreturn false;
        if (other.getCloudWatchLogsRoleArn() != null && other.getCloudWatchLogsRoleArn().equals(this.getCloudWatchLogsRoleArn()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateTrailResult clone() {
        try {
            return (CreateTrailResultsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X