All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.costexplorer.model.Impact Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Cost Explorer module holds the client classes that are used for communicating with AWS Cost Explorer Service

There is a newer version: 2.28.4
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.costexplorer.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The dollar value of the anomaly. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Impact implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField MAX_IMPACT_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("MaxImpact").getter(getter(Impact::maxImpact)).setter(setter(Builder::maxImpact)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxImpact").build()).build(); private static final SdkField TOTAL_IMPACT_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("TotalImpact").getter(getter(Impact::totalImpact)).setter(setter(Builder::totalImpact)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalImpact").build()).build(); private static final SdkField TOTAL_ACTUAL_SPEND_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("TotalActualSpend").getter(getter(Impact::totalActualSpend)).setter(setter(Builder::totalActualSpend)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalActualSpend").build()).build(); private static final SdkField TOTAL_EXPECTED_SPEND_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("TotalExpectedSpend").getter(getter(Impact::totalExpectedSpend)) .setter(setter(Builder::totalExpectedSpend)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalExpectedSpend").build()) .build(); private static final SdkField TOTAL_IMPACT_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("TotalImpactPercentage").getter(getter(Impact::totalImpactPercentage)) .setter(setter(Builder::totalImpactPercentage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalImpactPercentage").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MAX_IMPACT_FIELD, TOTAL_IMPACT_FIELD, TOTAL_ACTUAL_SPEND_FIELD, TOTAL_EXPECTED_SPEND_FIELD, TOTAL_IMPACT_PERCENTAGE_FIELD)); private static final long serialVersionUID = 1L; private final Double maxImpact; private final Double totalImpact; private final Double totalActualSpend; private final Double totalExpectedSpend; private final Double totalImpactPercentage; private Impact(BuilderImpl builder) { this.maxImpact = builder.maxImpact; this.totalImpact = builder.totalImpact; this.totalActualSpend = builder.totalActualSpend; this.totalExpectedSpend = builder.totalExpectedSpend; this.totalImpactPercentage = builder.totalImpactPercentage; } /** *

* The maximum dollar value that's observed for an anomaly. *

* * @return The maximum dollar value that's observed for an anomaly. */ public final Double maxImpact() { return maxImpact; } /** *

* The cumulative dollar difference between the total actual spend and total expected spend. It is calculated as * TotalActualSpend - TotalExpectedSpend. *

* * @return The cumulative dollar difference between the total actual spend and total expected spend. It is * calculated as TotalActualSpend - TotalExpectedSpend. */ public final Double totalImpact() { return totalImpact; } /** *

* The cumulative dollar amount that was actually spent during the anomaly. *

* * @return The cumulative dollar amount that was actually spent during the anomaly. */ public final Double totalActualSpend() { return totalActualSpend; } /** *

* The cumulative dollar amount that was expected to be spent during the anomaly. It is calculated using advanced * machine learning models to determine the typical spending pattern based on historical data for a customer. *

* * @return The cumulative dollar amount that was expected to be spent during the anomaly. It is calculated using * advanced machine learning models to determine the typical spending pattern based on historical data for a * customer. */ public final Double totalExpectedSpend() { return totalExpectedSpend; } /** *

* The cumulative percentage difference between the total actual spend and total expected spend. It is calculated as * (TotalImpact / TotalExpectedSpend) * 100. When TotalExpectedSpend is zero, this field * is omitted. Expected spend can be zero in situations such as when you start to use a service for the first time. *

* * @return The cumulative percentage difference between the total actual spend and total expected spend. It is * calculated as (TotalImpact / TotalExpectedSpend) * 100. When TotalExpectedSpend * is zero, this field is omitted. Expected spend can be zero in situations such as when you start to use a * service for the first time. */ public final Double totalImpactPercentage() { return totalImpactPercentage; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(maxImpact()); hashCode = 31 * hashCode + Objects.hashCode(totalImpact()); hashCode = 31 * hashCode + Objects.hashCode(totalActualSpend()); hashCode = 31 * hashCode + Objects.hashCode(totalExpectedSpend()); hashCode = 31 * hashCode + Objects.hashCode(totalImpactPercentage()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Impact)) { return false; } Impact other = (Impact) obj; return Objects.equals(maxImpact(), other.maxImpact()) && Objects.equals(totalImpact(), other.totalImpact()) && Objects.equals(totalActualSpend(), other.totalActualSpend()) && Objects.equals(totalExpectedSpend(), other.totalExpectedSpend()) && Objects.equals(totalImpactPercentage(), other.totalImpactPercentage()); } /** * 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. */ @Override public final String toString() { return ToString.builder("Impact").add("MaxImpact", maxImpact()).add("TotalImpact", totalImpact()) .add("TotalActualSpend", totalActualSpend()).add("TotalExpectedSpend", totalExpectedSpend()) .add("TotalImpactPercentage", totalImpactPercentage()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "MaxImpact": return Optional.ofNullable(clazz.cast(maxImpact())); case "TotalImpact": return Optional.ofNullable(clazz.cast(totalImpact())); case "TotalActualSpend": return Optional.ofNullable(clazz.cast(totalActualSpend())); case "TotalExpectedSpend": return Optional.ofNullable(clazz.cast(totalExpectedSpend())); case "TotalImpactPercentage": return Optional.ofNullable(clazz.cast(totalImpactPercentage())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Impact) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The maximum dollar value that's observed for an anomaly. *

* * @param maxImpact * The maximum dollar value that's observed for an anomaly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxImpact(Double maxImpact); /** *

* The cumulative dollar difference between the total actual spend and total expected spend. It is calculated as * TotalActualSpend - TotalExpectedSpend. *

* * @param totalImpact * The cumulative dollar difference between the total actual spend and total expected spend. It is * calculated as TotalActualSpend - TotalExpectedSpend. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalImpact(Double totalImpact); /** *

* The cumulative dollar amount that was actually spent during the anomaly. *

* * @param totalActualSpend * The cumulative dollar amount that was actually spent during the anomaly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalActualSpend(Double totalActualSpend); /** *

* The cumulative dollar amount that was expected to be spent during the anomaly. It is calculated using * advanced machine learning models to determine the typical spending pattern based on historical data for a * customer. *

* * @param totalExpectedSpend * The cumulative dollar amount that was expected to be spent during the anomaly. It is calculated using * advanced machine learning models to determine the typical spending pattern based on historical data * for a customer. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalExpectedSpend(Double totalExpectedSpend); /** *

* The cumulative percentage difference between the total actual spend and total expected spend. It is * calculated as (TotalImpact / TotalExpectedSpend) * 100. When TotalExpectedSpend is * zero, this field is omitted. Expected spend can be zero in situations such as when you start to use a service * for the first time. *

* * @param totalImpactPercentage * The cumulative percentage difference between the total actual spend and total expected spend. It is * calculated as (TotalImpact / TotalExpectedSpend) * 100. When * TotalExpectedSpend is zero, this field is omitted. Expected spend can be zero in * situations such as when you start to use a service for the first time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalImpactPercentage(Double totalImpactPercentage); } static final class BuilderImpl implements Builder { private Double maxImpact; private Double totalImpact; private Double totalActualSpend; private Double totalExpectedSpend; private Double totalImpactPercentage; private BuilderImpl() { } private BuilderImpl(Impact model) { maxImpact(model.maxImpact); totalImpact(model.totalImpact); totalActualSpend(model.totalActualSpend); totalExpectedSpend(model.totalExpectedSpend); totalImpactPercentage(model.totalImpactPercentage); } public final Double getMaxImpact() { return maxImpact; } public final void setMaxImpact(Double maxImpact) { this.maxImpact = maxImpact; } @Override public final Builder maxImpact(Double maxImpact) { this.maxImpact = maxImpact; return this; } public final Double getTotalImpact() { return totalImpact; } public final void setTotalImpact(Double totalImpact) { this.totalImpact = totalImpact; } @Override public final Builder totalImpact(Double totalImpact) { this.totalImpact = totalImpact; return this; } public final Double getTotalActualSpend() { return totalActualSpend; } public final void setTotalActualSpend(Double totalActualSpend) { this.totalActualSpend = totalActualSpend; } @Override public final Builder totalActualSpend(Double totalActualSpend) { this.totalActualSpend = totalActualSpend; return this; } public final Double getTotalExpectedSpend() { return totalExpectedSpend; } public final void setTotalExpectedSpend(Double totalExpectedSpend) { this.totalExpectedSpend = totalExpectedSpend; } @Override public final Builder totalExpectedSpend(Double totalExpectedSpend) { this.totalExpectedSpend = totalExpectedSpend; return this; } public final Double getTotalImpactPercentage() { return totalImpactPercentage; } public final void setTotalImpactPercentage(Double totalImpactPercentage) { this.totalImpactPercentage = totalImpactPercentage; } @Override public final Builder totalImpactPercentage(Double totalImpactPercentage) { this.totalImpactPercentage = totalImpactPercentage; return this; } @Override public Impact build() { return new Impact(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy