/* * 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.budgets.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The parameters that define or describe the historical data that your auto-adjusting budget is based on. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class HistoricalOptions implements Serializable, Cloneable, StructuredPojo { /** *
* The number of budget periods included in the moving-average calculation that determines your auto-adjusted budget
* amount. The maximum value depends on the TimeUnit
granularity of the budget:
*
* For the DAILY
granularity, the maximum value is 60
.
*
* For the MONTHLY
granularity, the maximum value is 12
.
*
* For the QUARTERLY
granularity, the maximum value is 4
.
*
* For the ANNUALLY
granularity, the maximum value is 1
.
*
* The integer that describes how many budget periods in your BudgetAdjustmentPeriod
are included in
* the calculation of your current BudgetLimit
. If the first budget period in your
* BudgetAdjustmentPeriod
has no cost data, then that budget period isn’t included in the average that
* determines your budget limit.
*
* For example, if you set BudgetAdjustmentPeriod
as 4
quarters, but your account had no
* cost data in the first quarter, then only the last three quarters are included in the calculation. In this
* scenario, LookBackAvailablePeriods
returns 3
.
*
* You can’t set your own LookBackAvailablePeriods
. The value is automatically calculated from the
* BudgetAdjustmentPeriod
and your historical cost data.
*
* The number of budget periods included in the moving-average calculation that determines your auto-adjusted budget
* amount. The maximum value depends on the TimeUnit
granularity of the budget:
*
* For the DAILY
granularity, the maximum value is 60
.
*
* For the MONTHLY
granularity, the maximum value is 12
.
*
* For the QUARTERLY
granularity, the maximum value is 4
.
*
* For the ANNUALLY
granularity, the maximum value is 1
.
*
TimeUnit
granularity of the budget:
*
* For the DAILY
granularity, the maximum value is 60
.
*
* For the MONTHLY
granularity, the maximum value is 12
.
*
* For the QUARTERLY
granularity, the maximum value is 4
.
*
* For the ANNUALLY
granularity, the maximum value is 1
.
*
* The number of budget periods included in the moving-average calculation that determines your auto-adjusted budget
* amount. The maximum value depends on the TimeUnit
granularity of the budget:
*
* For the DAILY
granularity, the maximum value is 60
.
*
* For the MONTHLY
granularity, the maximum value is 12
.
*
* For the QUARTERLY
granularity, the maximum value is 4
.
*
* For the ANNUALLY
granularity, the maximum value is 1
.
*
TimeUnit
granularity of the
* budget:
*
* For the DAILY
granularity, the maximum value is 60
.
*
* For the MONTHLY
granularity, the maximum value is 12
.
*
* For the QUARTERLY
granularity, the maximum value is 4
.
*
* For the ANNUALLY
granularity, the maximum value is 1
.
*
* The number of budget periods included in the moving-average calculation that determines your auto-adjusted budget
* amount. The maximum value depends on the TimeUnit
granularity of the budget:
*
* For the DAILY
granularity, the maximum value is 60
.
*
* For the MONTHLY
granularity, the maximum value is 12
.
*
* For the QUARTERLY
granularity, the maximum value is 4
.
*
* For the ANNUALLY
granularity, the maximum value is 1
.
*
TimeUnit
granularity of the budget:
*
* For the DAILY
granularity, the maximum value is 60
.
*
* For the MONTHLY
granularity, the maximum value is 12
.
*
* For the QUARTERLY
granularity, the maximum value is 4
.
*
* For the ANNUALLY
granularity, the maximum value is 1
.
*
* The integer that describes how many budget periods in your BudgetAdjustmentPeriod
are included in
* the calculation of your current BudgetLimit
. If the first budget period in your
* BudgetAdjustmentPeriod
has no cost data, then that budget period isn’t included in the average that
* determines your budget limit.
*
* For example, if you set BudgetAdjustmentPeriod
as 4
quarters, but your account had no
* cost data in the first quarter, then only the last three quarters are included in the calculation. In this
* scenario, LookBackAvailablePeriods
returns 3
.
*
* You can’t set your own LookBackAvailablePeriods
. The value is automatically calculated from the
* BudgetAdjustmentPeriod
and your historical cost data.
*
BudgetAdjustmentPeriod
are
* included in the calculation of your current BudgetLimit
. If the first budget period in your
* BudgetAdjustmentPeriod
has no cost data, then that budget period isn’t included in the
* average that determines your budget limit.
*
* For example, if you set BudgetAdjustmentPeriod
as 4
quarters, but your account
* had no cost data in the first quarter, then only the last three quarters are included in the calculation.
* In this scenario, LookBackAvailablePeriods
returns 3
.
*
* You can’t set your own LookBackAvailablePeriods
. The value is automatically calculated from
* the BudgetAdjustmentPeriod
and your historical cost data.
*/
public void setLookBackAvailablePeriods(Integer lookBackAvailablePeriods) {
this.lookBackAvailablePeriods = lookBackAvailablePeriods;
}
/**
*
* The integer that describes how many budget periods in your BudgetAdjustmentPeriod
are included in
* the calculation of your current BudgetLimit
. If the first budget period in your
* BudgetAdjustmentPeriod
has no cost data, then that budget period isn’t included in the average that
* determines your budget limit.
*
* For example, if you set BudgetAdjustmentPeriod
as 4
quarters, but your account had no
* cost data in the first quarter, then only the last three quarters are included in the calculation. In this
* scenario, LookBackAvailablePeriods
returns 3
.
*
* You can’t set your own LookBackAvailablePeriods
. The value is automatically calculated from the
* BudgetAdjustmentPeriod
and your historical cost data.
*
BudgetAdjustmentPeriod
are
* included in the calculation of your current BudgetLimit
. If the first budget period in your
* BudgetAdjustmentPeriod
has no cost data, then that budget period isn’t included in the
* average that determines your budget limit.
*
* For example, if you set BudgetAdjustmentPeriod
as 4
quarters, but your account
* had no cost data in the first quarter, then only the last three quarters are included in the calculation.
* In this scenario, LookBackAvailablePeriods
returns 3
.
*
* You can’t set your own LookBackAvailablePeriods
. The value is automatically calculated from
* the BudgetAdjustmentPeriod
and your historical cost data.
*/
public Integer getLookBackAvailablePeriods() {
return this.lookBackAvailablePeriods;
}
/**
*
* The integer that describes how many budget periods in your BudgetAdjustmentPeriod
are included in
* the calculation of your current BudgetLimit
. If the first budget period in your
* BudgetAdjustmentPeriod
has no cost data, then that budget period isn’t included in the average that
* determines your budget limit.
*
* For example, if you set BudgetAdjustmentPeriod
as 4
quarters, but your account had no
* cost data in the first quarter, then only the last three quarters are included in the calculation. In this
* scenario, LookBackAvailablePeriods
returns 3
.
*
* You can’t set your own LookBackAvailablePeriods
. The value is automatically calculated from the
* BudgetAdjustmentPeriod
and your historical cost data.
*
BudgetAdjustmentPeriod
are
* included in the calculation of your current BudgetLimit
. If the first budget period in your
* BudgetAdjustmentPeriod
has no cost data, then that budget period isn’t included in the
* average that determines your budget limit.
*
* For example, if you set BudgetAdjustmentPeriod
as 4
quarters, but your account
* had no cost data in the first quarter, then only the last three quarters are included in the calculation.
* In this scenario, LookBackAvailablePeriods
returns 3
.
*
* You can’t set your own LookBackAvailablePeriods
. The value is automatically calculated from
* the BudgetAdjustmentPeriod
and your historical cost data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public HistoricalOptions withLookBackAvailablePeriods(Integer lookBackAvailablePeriods) {
setLookBackAvailablePeriods(lookBackAvailablePeriods);
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 (getBudgetAdjustmentPeriod() != null)
sb.append("BudgetAdjustmentPeriod: ").append(getBudgetAdjustmentPeriod()).append(",");
if (getLookBackAvailablePeriods() != null)
sb.append("LookBackAvailablePeriods: ").append(getLookBackAvailablePeriods());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof HistoricalOptions == false)
return false;
HistoricalOptions other = (HistoricalOptions) obj;
if (other.getBudgetAdjustmentPeriod() == null ^ this.getBudgetAdjustmentPeriod() == null)
return false;
if (other.getBudgetAdjustmentPeriod() != null && other.getBudgetAdjustmentPeriod().equals(this.getBudgetAdjustmentPeriod()) == false)
return false;
if (other.getLookBackAvailablePeriods() == null ^ this.getLookBackAvailablePeriods() == null)
return false;
if (other.getLookBackAvailablePeriods() != null && other.getLookBackAvailablePeriods().equals(this.getLookBackAvailablePeriods()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBudgetAdjustmentPeriod() == null) ? 0 : getBudgetAdjustmentPeriod().hashCode());
hashCode = prime * hashCode + ((getLookBackAvailablePeriods() == null) ? 0 : getLookBackAvailablePeriods().hashCode());
return hashCode;
}
@Override
public HistoricalOptions clone() {
try {
return (HistoricalOptions) 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.budgets.model.transform.HistoricalOptionsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}