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;
 
 
Container for the parameters to the LookupEvents operation.

Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports five different attributes: time range (defined by a start time and end time), user name, event name, resource type, and resource name. All attributes are optional. The maximum number of attributes that can be specified in any one lookup request are time range and one other attribute. The default number of results returned is 10, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.

IMPORTANT:The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.

IMPORTANT:Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.

 
 public class LookupEventsRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
Contains a list of lookup attributes. Currently the list can contain only one item.
 
Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.
 
     private java.util.Date startTime;

    
Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.
 
     private java.util.Date endTime;

    
The number of events to return. Possible values are 1 through 50. The default is 10.

Constraints:
Range: 1 - 50

 
     private Integer maxResults;

    
The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
 
     private String nextToken;

    
Contains a list of lookup attributes. Currently the list can contain only one item.

Returns:
Contains a list of lookup attributes. Currently the list can contain only one item.
 
         if ( == null) {
               .setAutoConstruct(true);
        }
        return ;
    }
    
    
Contains a list of lookup attributes. Currently the list can contain only one item.

Parameters:
lookupAttributes Contains a list of lookup attributes. Currently the list can contain only one item.
    public void setLookupAttributes(java.util.Collection<LookupAttributelookupAttributes) {
        if (lookupAttributes == null) {
            this. = null;
            return;
        }
        lookupAttributesCopy.addAll(lookupAttributes);
        this. = lookupAttributesCopy;
    }
    
    
Contains a list of lookup attributes. Currently the list can contain only one item.

NOTE: This method appends the values to the existing list (if any). Use setLookupAttributes(java.util.Collection) or withLookupAttributes(java.util.Collection) if you want to override the existing values.

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

Parameters:
lookupAttributes Contains a list of lookup attributes. Currently the list can contain only one item.
Returns:
A reference to this updated object so that method calls can be chained together.
    public LookupEventsRequest withLookupAttributes(LookupAttribute... lookupAttributes) {
        if (getLookupAttributes() == nullsetLookupAttributes(new java.util.ArrayList<LookupAttribute>(lookupAttributes.length));
        for (LookupAttribute value : lookupAttributes) {
            getLookupAttributes().add(value);
        }
        return this;
    }
    
    
Contains a list of lookup attributes. Currently the list can contain only one item.

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

Parameters:
lookupAttributes Contains a list of lookup attributes. Currently the list can contain only one item.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (lookupAttributes == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<LookupAttributelookupAttributesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<LookupAttribute>(lookupAttributes.size());
            lookupAttributesCopy.addAll(lookupAttributes);
            this. = lookupAttributesCopy;
        }
        return this;
    }

    
Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.

Returns:
Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.
    public java.util.Date getStartTime() {
        return ;
    }
    
    
Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.

Parameters:
startTime Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.
    public void setStartTime(java.util.Date startTime) {
        this. = startTime;
    }
    
    
Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.

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

Parameters:
startTime Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.
Returns:
A reference to this updated object so that method calls can be chained together.
    public LookupEventsRequest withStartTime(java.util.Date startTime) {
        this. = startTime;
        return this;
    }

    
Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.

Returns:
Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.
    public java.util.Date getEndTime() {
        return ;
    }
    
    
Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.

Parameters:
endTime Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.
    public void setEndTime(java.util.Date endTime) {
        this. = endTime;
    }
    
    
Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.

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

Parameters:
endTime Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.
Returns:
A reference to this updated object so that method calls can be chained together.
    public LookupEventsRequest withEndTime(java.util.Date endTime) {
        this. = endTime;
        return this;
    }

    
The number of events to return. Possible values are 1 through 50. The default is 10.

Constraints:
Range: 1 - 50

Returns:
The number of events to return. Possible values are 1 through 50. The default is 10.
    public Integer getMaxResults() {
        return ;
    }
    
    
The number of events to return. Possible values are 1 through 50. The default is 10.

Constraints:
Range: 1 - 50

Parameters:
maxResults The number of events to return. Possible values are 1 through 50. The default is 10.
    public void setMaxResults(Integer maxResults) {
        this. = maxResults;
    }
    
    
The number of events to return. Possible values are 1 through 50. The default is 10.

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

Constraints:
Range: 1 - 50

Parameters:
maxResults The number of events to return. Possible values are 1 through 50. The default is 10.
Returns:
A reference to this updated object so that method calls can be chained together.
    public LookupEventsRequest withMaxResults(Integer maxResults) {
        this. = maxResults;
        return this;
    }

    
The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.

Returns:
The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
    public String getNextToken() {
        return ;
    }
    
    
The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.

Parameters:
nextToken The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
    public void setNextToken(String nextToken) {
        this. = nextToken;
    }
    
    
The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.

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

Parameters:
nextToken The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
Returns:
A reference to this updated object so that method calls can be chained together.
    public LookupEventsRequest withNextToken(String nextToken) {
        this. = nextToken;
        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 (getLookupAttributes() != nullsb.append("LookupAttributes: " + getLookupAttributes() + ",");
        if (getStartTime() != nullsb.append("StartTime: " + getStartTime() + ",");
        if (getEndTime() != nullsb.append("EndTime: " + getEndTime() + ",");
        if (getMaxResults() != nullsb.append("MaxResults: " + getMaxResults() + ",");
        if (getNextToken() != nullsb.append("NextToken: " + getNextToken() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getLookupAttributes() == null) ? 0 : getLookupAttributes().hashCode()); 
        hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); 
        hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); 
        hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); 
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof LookupEventsRequest == falsereturn false;
        LookupEventsRequest other = (LookupEventsRequest)obj;
        
        if (other.getLookupAttributes() == null ^ this.getLookupAttributes() == nullreturn false;
        if (other.getLookupAttributes() != null && other.getLookupAttributes().equals(this.getLookupAttributes()) == falsereturn false
        if (other.getStartTime() == null ^ this.getStartTime() == nullreturn false;
        if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == falsereturn false
        if (other.getEndTime() == null ^ this.getEndTime() == nullreturn false;
        if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == falsereturn false
        if (other.getMaxResults() == null ^ this.getMaxResults() == nullreturn false;
        if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == falsereturn false
        if (other.getNextToken() == null ^ this.getNextToken() == nullreturn false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == falsereturn false
        return true;
    }
    
    @Override
    public LookupEventsRequest clone() {
        
            return (LookupEventsRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X