com.amazonaws.services.macie2.model.GetUsageStatisticsRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-macie2 Show documentation
/*
* 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.macie2.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 GetUsageStatisticsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* An array of objects, one for each condition to use to filter the query results. If you specify more than one
* condition, Amazon Macie uses an AND operator to join the conditions.
*
*/
private java.util.List filterBy;
/**
*
* The maximum number of items to include in each page of the response.
*
*/
private Integer maxResults;
/**
*
* The nextToken string that specifies which page of results to return in a paginated response.
*
*/
private String nextToken;
/**
*
* The criteria to use to sort the query results.
*
*/
private UsageStatisticsSortBy sortBy;
/**
*
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current calendar
* month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon Macie provides
* usage data for the preceding 30 days.
*
*/
private String timeRange;
/**
*
* An array of objects, one for each condition to use to filter the query results. If you specify more than one
* condition, Amazon Macie uses an AND operator to join the conditions.
*
*
* @return An array of objects, one for each condition to use to filter the query results. If you specify more than
* one condition, Amazon Macie uses an AND operator to join the conditions.
*/
public java.util.List getFilterBy() {
return filterBy;
}
/**
*
* An array of objects, one for each condition to use to filter the query results. If you specify more than one
* condition, Amazon Macie uses an AND operator to join the conditions.
*
*
* @param filterBy
* An array of objects, one for each condition to use to filter the query results. If you specify more than
* one condition, Amazon Macie uses an AND operator to join the conditions.
*/
public void setFilterBy(java.util.Collection filterBy) {
if (filterBy == null) {
this.filterBy = null;
return;
}
this.filterBy = new java.util.ArrayList(filterBy);
}
/**
*
* An array of objects, one for each condition to use to filter the query results. If you specify more than one
* condition, Amazon Macie uses an AND operator to join the conditions.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setFilterBy(java.util.Collection)} or {@link #withFilterBy(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param filterBy
* An array of objects, one for each condition to use to filter the query results. If you specify more than
* one condition, Amazon Macie uses an AND operator to join the conditions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageStatisticsRequest withFilterBy(UsageStatisticsFilter... filterBy) {
if (this.filterBy == null) {
setFilterBy(new java.util.ArrayList(filterBy.length));
}
for (UsageStatisticsFilter ele : filterBy) {
this.filterBy.add(ele);
}
return this;
}
/**
*
* An array of objects, one for each condition to use to filter the query results. If you specify more than one
* condition, Amazon Macie uses an AND operator to join the conditions.
*
*
* @param filterBy
* An array of objects, one for each condition to use to filter the query results. If you specify more than
* one condition, Amazon Macie uses an AND operator to join the conditions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageStatisticsRequest withFilterBy(java.util.Collection filterBy) {
setFilterBy(filterBy);
return this;
}
/**
*
* The maximum number of items to include in each page of the response.
*
*
* @param maxResults
* The maximum number of items to include in each page of the response.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The maximum number of items to include in each page of the response.
*
*
* @return The maximum number of items to include in each page of the response.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The maximum number of items to include in each page of the response.
*
*
* @param maxResults
* The maximum number of items to include in each page of the response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageStatisticsRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* The nextToken string that specifies which page of results to return in a paginated response.
*
*
* @param nextToken
* The nextToken string that specifies which page of results to return in a paginated response.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* The nextToken string that specifies which page of results to return in a paginated response.
*
*
* @return The nextToken string that specifies which page of results to return in a paginated response.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* The nextToken string that specifies which page of results to return in a paginated response.
*
*
* @param nextToken
* The nextToken string that specifies which page of results to return in a paginated response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageStatisticsRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The criteria to use to sort the query results.
*
*
* @param sortBy
* The criteria to use to sort the query results.
*/
public void setSortBy(UsageStatisticsSortBy sortBy) {
this.sortBy = sortBy;
}
/**
*
* The criteria to use to sort the query results.
*
*
* @return The criteria to use to sort the query results.
*/
public UsageStatisticsSortBy getSortBy() {
return this.sortBy;
}
/**
*
* The criteria to use to sort the query results.
*
*
* @param sortBy
* The criteria to use to sort the query results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetUsageStatisticsRequest withSortBy(UsageStatisticsSortBy sortBy) {
setSortBy(sortBy);
return this;
}
/**
*
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current calendar
* month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon Macie provides
* usage data for the preceding 30 days.
*
*
* @param timeRange
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current
* calendar month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon
* Macie provides usage data for the preceding 30 days.
* @see TimeRange
*/
public void setTimeRange(String timeRange) {
this.timeRange = timeRange;
}
/**
*
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current calendar
* month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon Macie provides
* usage data for the preceding 30 days.
*
*
* @return The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current
* calendar month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value,
* Amazon Macie provides usage data for the preceding 30 days.
* @see TimeRange
*/
public String getTimeRange() {
return this.timeRange;
}
/**
*
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current calendar
* month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon Macie provides
* usage data for the preceding 30 days.
*
*
* @param timeRange
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current
* calendar month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon
* Macie provides usage data for the preceding 30 days.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TimeRange
*/
public GetUsageStatisticsRequest withTimeRange(String timeRange) {
setTimeRange(timeRange);
return this;
}
/**
*
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current calendar
* month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon Macie provides
* usage data for the preceding 30 days.
*
*
* @param timeRange
* The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current
* calendar month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon
* Macie provides usage data for the preceding 30 days.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TimeRange
*/
public GetUsageStatisticsRequest withTimeRange(TimeRange timeRange) {
this.timeRange = timeRange.toString();
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 (getFilterBy() != null)
sb.append("FilterBy: ").append(getFilterBy()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getSortBy() != null)
sb.append("SortBy: ").append(getSortBy()).append(",");
if (getTimeRange() != null)
sb.append("TimeRange: ").append(getTimeRange());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetUsageStatisticsRequest == false)
return false;
GetUsageStatisticsRequest other = (GetUsageStatisticsRequest) obj;
if (other.getFilterBy() == null ^ this.getFilterBy() == null)
return false;
if (other.getFilterBy() != null && other.getFilterBy().equals(this.getFilterBy()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getSortBy() == null ^ this.getSortBy() == null)
return false;
if (other.getSortBy() != null && other.getSortBy().equals(this.getSortBy()) == false)
return false;
if (other.getTimeRange() == null ^ this.getTimeRange() == null)
return false;
if (other.getTimeRange() != null && other.getTimeRange().equals(this.getTimeRange()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFilterBy() == null) ? 0 : getFilterBy().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getSortBy() == null) ? 0 : getSortBy().hashCode());
hashCode = prime * hashCode + ((getTimeRange() == null) ? 0 : getTimeRange().hashCode());
return hashCode;
}
@Override
public GetUsageStatisticsRequest clone() {
return (GetUsageStatisticsRequest) super.clone();
}
}