com.amazonaws.services.costexplorer.model.GetCostAndUsageWithResourcesResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-costexplorer Show documentation
/*
* Copyright 2015-2020 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.costexplorer.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetCostAndUsageWithResourcesResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The token for the next set of retrievable results. AWS provides the token when the response from a previous call
* has more results than the maximum page size.
*
*/
private String nextPageToken;
/**
*
* The groups that are specified by the Filter
or GroupBy
parameters in the request.
*
*/
private java.util.List groupDefinitions;
/**
*
* The time period that is covered by the results in the response.
*
*/
private java.util.List resultsByTime;
/**
*
* The token for the next set of retrievable results. AWS provides the token when the response from a previous call
* has more results than the maximum page size.
*
*
* @param nextPageToken
* The token for the next set of retrievable results. AWS provides the token when the response from a
* previous call has more results than the maximum page size.
*/
public void setNextPageToken(String nextPageToken) {
this.nextPageToken = nextPageToken;
}
/**
*
* The token for the next set of retrievable results. AWS provides the token when the response from a previous call
* has more results than the maximum page size.
*
*
* @return The token for the next set of retrievable results. AWS provides the token when the response from a
* previous call has more results than the maximum page size.
*/
public String getNextPageToken() {
return this.nextPageToken;
}
/**
*
* The token for the next set of retrievable results. AWS provides the token when the response from a previous call
* has more results than the maximum page size.
*
*
* @param nextPageToken
* The token for the next set of retrievable results. AWS provides the token when the response from a
* previous call has more results than the maximum page size.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageWithResourcesResult withNextPageToken(String nextPageToken) {
setNextPageToken(nextPageToken);
return this;
}
/**
*
* The groups that are specified by the Filter
or GroupBy
parameters in the request.
*
*
* @return The groups that are specified by the Filter
or GroupBy
parameters in the
* request.
*/
public java.util.List getGroupDefinitions() {
return groupDefinitions;
}
/**
*
* The groups that are specified by the Filter
or GroupBy
parameters in the request.
*
*
* @param groupDefinitions
* The groups that are specified by the Filter
or GroupBy
parameters in the
* request.
*/
public void setGroupDefinitions(java.util.Collection groupDefinitions) {
if (groupDefinitions == null) {
this.groupDefinitions = null;
return;
}
this.groupDefinitions = new java.util.ArrayList(groupDefinitions);
}
/**
*
* The groups that are specified by the Filter
or GroupBy
parameters in the request.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setGroupDefinitions(java.util.Collection)} or {@link #withGroupDefinitions(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param groupDefinitions
* The groups that are specified by the Filter
or GroupBy
parameters in the
* request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageWithResourcesResult withGroupDefinitions(GroupDefinition... groupDefinitions) {
if (this.groupDefinitions == null) {
setGroupDefinitions(new java.util.ArrayList(groupDefinitions.length));
}
for (GroupDefinition ele : groupDefinitions) {
this.groupDefinitions.add(ele);
}
return this;
}
/**
*
* The groups that are specified by the Filter
or GroupBy
parameters in the request.
*
*
* @param groupDefinitions
* The groups that are specified by the Filter
or GroupBy
parameters in the
* request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageWithResourcesResult withGroupDefinitions(java.util.Collection groupDefinitions) {
setGroupDefinitions(groupDefinitions);
return this;
}
/**
*
* The time period that is covered by the results in the response.
*
*
* @return The time period that is covered by the results in the response.
*/
public java.util.List getResultsByTime() {
return resultsByTime;
}
/**
*
* The time period that is covered by the results in the response.
*
*
* @param resultsByTime
* The time period that is covered by the results in the response.
*/
public void setResultsByTime(java.util.Collection resultsByTime) {
if (resultsByTime == null) {
this.resultsByTime = null;
return;
}
this.resultsByTime = new java.util.ArrayList(resultsByTime);
}
/**
*
* The time period that is covered by the results in the response.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResultsByTime(java.util.Collection)} or {@link #withResultsByTime(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param resultsByTime
* The time period that is covered by the results in the response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageWithResourcesResult withResultsByTime(ResultByTime... resultsByTime) {
if (this.resultsByTime == null) {
setResultsByTime(new java.util.ArrayList(resultsByTime.length));
}
for (ResultByTime ele : resultsByTime) {
this.resultsByTime.add(ele);
}
return this;
}
/**
*
* The time period that is covered by the results in the response.
*
*
* @param resultsByTime
* The time period that is covered by the results in the response.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetCostAndUsageWithResourcesResult withResultsByTime(java.util.Collection resultsByTime) {
setResultsByTime(resultsByTime);
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 (getNextPageToken() != null)
sb.append("NextPageToken: ").append(getNextPageToken()).append(",");
if (getGroupDefinitions() != null)
sb.append("GroupDefinitions: ").append(getGroupDefinitions()).append(",");
if (getResultsByTime() != null)
sb.append("ResultsByTime: ").append(getResultsByTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetCostAndUsageWithResourcesResult == false)
return false;
GetCostAndUsageWithResourcesResult other = (GetCostAndUsageWithResourcesResult) obj;
if (other.getNextPageToken() == null ^ this.getNextPageToken() == null)
return false;
if (other.getNextPageToken() != null && other.getNextPageToken().equals(this.getNextPageToken()) == false)
return false;
if (other.getGroupDefinitions() == null ^ this.getGroupDefinitions() == null)
return false;
if (other.getGroupDefinitions() != null && other.getGroupDefinitions().equals(this.getGroupDefinitions()) == false)
return false;
if (other.getResultsByTime() == null ^ this.getResultsByTime() == null)
return false;
if (other.getResultsByTime() != null && other.getResultsByTime().equals(this.getResultsByTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNextPageToken() == null) ? 0 : getNextPageToken().hashCode());
hashCode = prime * hashCode + ((getGroupDefinitions() == null) ? 0 : getGroupDefinitions().hashCode());
hashCode = prime * hashCode + ((getResultsByTime() == null) ? 0 : getResultsByTime().hashCode());
return hashCode;
}
@Override
public GetCostAndUsageWithResourcesResult clone() {
try {
return (GetCostAndUsageWithResourcesResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}