![JAR search and dependency download from the Maven repository](/logo.png)
software.amazon.awssdk.services.marketplaceagreement.model.EstimatedCharges Maven / Gradle / Ivy
Show all versions of marketplaceagreement Show documentation
/*
* 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.marketplaceagreement.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;
/**
*
* Estimated cost of the agreement.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class EstimatedCharges implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField AGREEMENT_VALUE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("agreementValue").getter(getter(EstimatedCharges::agreementValue))
.setter(setter(Builder::agreementValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("agreementValue").build()).build();
private static final SdkField CURRENCY_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("currencyCode").getter(getter(EstimatedCharges::currencyCode)).setter(setter(Builder::currencyCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("currencyCode").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AGREEMENT_VALUE_FIELD,
CURRENCY_CODE_FIELD));
private static final long serialVersionUID = 1L;
private final String agreementValue;
private final String currencyCode;
private EstimatedCharges(BuilderImpl builder) {
this.agreementValue = builder.agreementValue;
this.currencyCode = builder.currencyCode;
}
/**
*
* The total known amount customer has to pay across the lifecycle of the agreement.
*
*
*
* This is the total contract value if accepted terms contain ConfigurableUpfrontPricingTerm
or
* FixedUpfrontPricingTerm
. In the case of pure contract pricing, this will be the total value of the
* contract. In the case of contracts with consumption pricing, this will only include the committed value and not
* include any overages that occur.
*
*
* If the accepted terms contain PaymentScheduleTerm
, it will be the total payment schedule amount.
* This occurs when flexible payment schedule is used, and is the sum of all invoice charges in the payment
* schedule.
*
*
* In case a customer has amended an agreement, by purchasing more units of any dimension, this will include both
* the original cost as well as the added cost incurred due to addition of new units.
*
*
* This is 0
if the accepted terms contain UsageBasedPricingTerm
without
* ConfigurableUpfrontPricingTerm
or RecurringPaymentTerm
. This occurs for usage-based
* pricing (such as SaaS metered or AMI/container hourly or monthly), because the exact usage is not known upfront.
*
*
*
* @return The total known amount customer has to pay across the lifecycle of the agreement.
*
* This is the total contract value if accepted terms contain ConfigurableUpfrontPricingTerm
or
* FixedUpfrontPricingTerm
. In the case of pure contract pricing, this will be the total value
* of the contract. In the case of contracts with consumption pricing, this will only include the committed
* value and not include any overages that occur.
*
*
* If the accepted terms contain PaymentScheduleTerm
, it will be the total payment schedule
* amount. This occurs when flexible payment schedule is used, and is the sum of all invoice charges in the
* payment schedule.
*
*
* In case a customer has amended an agreement, by purchasing more units of any dimension, this will include
* both the original cost as well as the added cost incurred due to addition of new units.
*
*
* This is 0
if the accepted terms contain UsageBasedPricingTerm
without
* ConfigurableUpfrontPricingTerm
or RecurringPaymentTerm
. This occurs for
* usage-based pricing (such as SaaS metered or AMI/container hourly or monthly), because the exact usage is
* not known upfront.
*
*/
public final String agreementValue() {
return agreementValue;
}
/**
*
* Defines the currency code for the charge.
*
*
* @return Defines the currency code for the charge.
*/
public final String currencyCode() {
return currencyCode;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(agreementValue());
hashCode = 31 * hashCode + Objects.hashCode(currencyCode());
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 EstimatedCharges)) {
return false;
}
EstimatedCharges other = (EstimatedCharges) obj;
return Objects.equals(agreementValue(), other.agreementValue()) && Objects.equals(currencyCode(), other.currencyCode());
}
/**
* 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("EstimatedCharges").add("AgreementValue", agreementValue()).add("CurrencyCode", currencyCode())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "agreementValue":
return Optional.ofNullable(clazz.cast(agreementValue()));
case "currencyCode":
return Optional.ofNullable(clazz.cast(currencyCode()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function