com.amazonaws.services.guardduty.model.UsageStatistics Maven / Gradle / Ivy
Show all versions of aws-java-sdk-guardduty Show documentation
/*
* Copyright 2019-2024 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.guardduty.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains the result of GuardDuty usage. If a UsageStatisticType is provided the result for other types will be null.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UsageStatistics implements Serializable, Cloneable, StructuredPojo {
/**
*
* The usage statistic sum organized by account ID.
*
*/
private java.util.List sumByAccount;
/**
*
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most to
* least expensive.
*
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
*
*/
private java.util.List topAccountsByFeature;
/**
*
* The usage statistic sum organized by on data source.
*
*/
private java.util.List sumByDataSource;
/**
*
* The usage statistic sum organized by resource.
*
*/
private java.util.List sumByResource;
/**
*
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least expensive.
*
*/
private java.util.List topResources;
/**
*
* The usage statistic sum organized by feature.
*
*/
private java.util.List sumByFeature;
/**
*
* The usage statistic sum organized by account ID.
*
*
* @return The usage statistic sum organized by account ID.
*/
public java.util.List getSumByAccount() {
return sumByAccount;
}
/**
*
* The usage statistic sum organized by account ID.
*
*
* @param sumByAccount
* The usage statistic sum organized by account ID.
*/
public void setSumByAccount(java.util.Collection sumByAccount) {
if (sumByAccount == null) {
this.sumByAccount = null;
return;
}
this.sumByAccount = new java.util.ArrayList(sumByAccount);
}
/**
*
* The usage statistic sum organized by account ID.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSumByAccount(java.util.Collection)} or {@link #withSumByAccount(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param sumByAccount
* The usage statistic sum organized by account ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByAccount(UsageAccountResult... sumByAccount) {
if (this.sumByAccount == null) {
setSumByAccount(new java.util.ArrayList(sumByAccount.length));
}
for (UsageAccountResult ele : sumByAccount) {
this.sumByAccount.add(ele);
}
return this;
}
/**
*
* The usage statistic sum organized by account ID.
*
*
* @param sumByAccount
* The usage statistic sum organized by account ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByAccount(java.util.Collection sumByAccount) {
setSumByAccount(sumByAccount);
return this;
}
/**
*
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most to
* least expensive.
*
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
*
*
* @return Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most
* to least expensive.
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
*/
public java.util.List getTopAccountsByFeature() {
return topAccountsByFeature;
}
/**
*
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most to
* least expensive.
*
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
*
*
* @param topAccountsByFeature
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most
* to least expensive.
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
*/
public void setTopAccountsByFeature(java.util.Collection topAccountsByFeature) {
if (topAccountsByFeature == null) {
this.topAccountsByFeature = null;
return;
}
this.topAccountsByFeature = new java.util.ArrayList(topAccountsByFeature);
}
/**
*
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most to
* least expensive.
*
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTopAccountsByFeature(java.util.Collection)} or {@link #withTopAccountsByFeature(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param topAccountsByFeature
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most
* to least expensive.
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withTopAccountsByFeature(UsageTopAccountsResult... topAccountsByFeature) {
if (this.topAccountsByFeature == null) {
setTopAccountsByFeature(new java.util.ArrayList(topAccountsByFeature.length));
}
for (UsageTopAccountsResult ele : topAccountsByFeature) {
this.topAccountsByFeature.add(ele);
}
return this;
}
/**
*
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most to
* least expensive.
*
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
*
*
* @param topAccountsByFeature
* Lists the top 50 accounts by feature that have generated the most GuardDuty usage, in the order from most
* to least expensive.
*
* Currently, this doesn't support RDS_LOGIN_EVENTS
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withTopAccountsByFeature(java.util.Collection topAccountsByFeature) {
setTopAccountsByFeature(topAccountsByFeature);
return this;
}
/**
*
* The usage statistic sum organized by on data source.
*
*
* @return The usage statistic sum organized by on data source.
*/
public java.util.List getSumByDataSource() {
return sumByDataSource;
}
/**
*
* The usage statistic sum organized by on data source.
*
*
* @param sumByDataSource
* The usage statistic sum organized by on data source.
*/
public void setSumByDataSource(java.util.Collection sumByDataSource) {
if (sumByDataSource == null) {
this.sumByDataSource = null;
return;
}
this.sumByDataSource = new java.util.ArrayList(sumByDataSource);
}
/**
*
* The usage statistic sum organized by on data source.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSumByDataSource(java.util.Collection)} or {@link #withSumByDataSource(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param sumByDataSource
* The usage statistic sum organized by on data source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByDataSource(UsageDataSourceResult... sumByDataSource) {
if (this.sumByDataSource == null) {
setSumByDataSource(new java.util.ArrayList(sumByDataSource.length));
}
for (UsageDataSourceResult ele : sumByDataSource) {
this.sumByDataSource.add(ele);
}
return this;
}
/**
*
* The usage statistic sum organized by on data source.
*
*
* @param sumByDataSource
* The usage statistic sum organized by on data source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByDataSource(java.util.Collection sumByDataSource) {
setSumByDataSource(sumByDataSource);
return this;
}
/**
*
* The usage statistic sum organized by resource.
*
*
* @return The usage statistic sum organized by resource.
*/
public java.util.List getSumByResource() {
return sumByResource;
}
/**
*
* The usage statistic sum organized by resource.
*
*
* @param sumByResource
* The usage statistic sum organized by resource.
*/
public void setSumByResource(java.util.Collection sumByResource) {
if (sumByResource == null) {
this.sumByResource = null;
return;
}
this.sumByResource = new java.util.ArrayList(sumByResource);
}
/**
*
* The usage statistic sum organized by resource.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSumByResource(java.util.Collection)} or {@link #withSumByResource(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param sumByResource
* The usage statistic sum organized by resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByResource(UsageResourceResult... sumByResource) {
if (this.sumByResource == null) {
setSumByResource(new java.util.ArrayList(sumByResource.length));
}
for (UsageResourceResult ele : sumByResource) {
this.sumByResource.add(ele);
}
return this;
}
/**
*
* The usage statistic sum organized by resource.
*
*
* @param sumByResource
* The usage statistic sum organized by resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByResource(java.util.Collection sumByResource) {
setSumByResource(sumByResource);
return this;
}
/**
*
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least expensive.
*
*
* @return Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least
* expensive.
*/
public java.util.List getTopResources() {
return topResources;
}
/**
*
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least expensive.
*
*
* @param topResources
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least
* expensive.
*/
public void setTopResources(java.util.Collection topResources) {
if (topResources == null) {
this.topResources = null;
return;
}
this.topResources = new java.util.ArrayList(topResources);
}
/**
*
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least expensive.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTopResources(java.util.Collection)} or {@link #withTopResources(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param topResources
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least
* expensive.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withTopResources(UsageResourceResult... topResources) {
if (this.topResources == null) {
setTopResources(new java.util.ArrayList(topResources.length));
}
for (UsageResourceResult ele : topResources) {
this.topResources.add(ele);
}
return this;
}
/**
*
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least expensive.
*
*
* @param topResources
* Lists the top 50 resources that have generated the most GuardDuty usage, in order from most to least
* expensive.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withTopResources(java.util.Collection topResources) {
setTopResources(topResources);
return this;
}
/**
*
* The usage statistic sum organized by feature.
*
*
* @return The usage statistic sum organized by feature.
*/
public java.util.List getSumByFeature() {
return sumByFeature;
}
/**
*
* The usage statistic sum organized by feature.
*
*
* @param sumByFeature
* The usage statistic sum organized by feature.
*/
public void setSumByFeature(java.util.Collection sumByFeature) {
if (sumByFeature == null) {
this.sumByFeature = null;
return;
}
this.sumByFeature = new java.util.ArrayList(sumByFeature);
}
/**
*
* The usage statistic sum organized by feature.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSumByFeature(java.util.Collection)} or {@link #withSumByFeature(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param sumByFeature
* The usage statistic sum organized by feature.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByFeature(UsageFeatureResult... sumByFeature) {
if (this.sumByFeature == null) {
setSumByFeature(new java.util.ArrayList(sumByFeature.length));
}
for (UsageFeatureResult ele : sumByFeature) {
this.sumByFeature.add(ele);
}
return this;
}
/**
*
* The usage statistic sum organized by feature.
*
*
* @param sumByFeature
* The usage statistic sum organized by feature.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UsageStatistics withSumByFeature(java.util.Collection sumByFeature) {
setSumByFeature(sumByFeature);
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 (getSumByAccount() != null)
sb.append("SumByAccount: ").append(getSumByAccount()).append(",");
if (getTopAccountsByFeature() != null)
sb.append("TopAccountsByFeature: ").append(getTopAccountsByFeature()).append(",");
if (getSumByDataSource() != null)
sb.append("SumByDataSource: ").append(getSumByDataSource()).append(",");
if (getSumByResource() != null)
sb.append("SumByResource: ").append(getSumByResource()).append(",");
if (getTopResources() != null)
sb.append("TopResources: ").append(getTopResources()).append(",");
if (getSumByFeature() != null)
sb.append("SumByFeature: ").append(getSumByFeature());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UsageStatistics == false)
return false;
UsageStatistics other = (UsageStatistics) obj;
if (other.getSumByAccount() == null ^ this.getSumByAccount() == null)
return false;
if (other.getSumByAccount() != null && other.getSumByAccount().equals(this.getSumByAccount()) == false)
return false;
if (other.getTopAccountsByFeature() == null ^ this.getTopAccountsByFeature() == null)
return false;
if (other.getTopAccountsByFeature() != null && other.getTopAccountsByFeature().equals(this.getTopAccountsByFeature()) == false)
return false;
if (other.getSumByDataSource() == null ^ this.getSumByDataSource() == null)
return false;
if (other.getSumByDataSource() != null && other.getSumByDataSource().equals(this.getSumByDataSource()) == false)
return false;
if (other.getSumByResource() == null ^ this.getSumByResource() == null)
return false;
if (other.getSumByResource() != null && other.getSumByResource().equals(this.getSumByResource()) == false)
return false;
if (other.getTopResources() == null ^ this.getTopResources() == null)
return false;
if (other.getTopResources() != null && other.getTopResources().equals(this.getTopResources()) == false)
return false;
if (other.getSumByFeature() == null ^ this.getSumByFeature() == null)
return false;
if (other.getSumByFeature() != null && other.getSumByFeature().equals(this.getSumByFeature()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSumByAccount() == null) ? 0 : getSumByAccount().hashCode());
hashCode = prime * hashCode + ((getTopAccountsByFeature() == null) ? 0 : getTopAccountsByFeature().hashCode());
hashCode = prime * hashCode + ((getSumByDataSource() == null) ? 0 : getSumByDataSource().hashCode());
hashCode = prime * hashCode + ((getSumByResource() == null) ? 0 : getSumByResource().hashCode());
hashCode = prime * hashCode + ((getTopResources() == null) ? 0 : getTopResources().hashCode());
hashCode = prime * hashCode + ((getSumByFeature() == null) ? 0 : getSumByFeature().hashCode());
return hashCode;
}
@Override
public UsageStatistics clone() {
try {
return (UsageStatistics) 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.guardduty.model.transform.UsageStatisticsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}