Class CustomCharge

java.lang.Object
software.amazon.awssdk.services.appmonetization.model.CustomCharge
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<CustomCharge.Builder,CustomCharge>

@Generated("software.amazon.awssdk:codegen") public final class CustomCharge extends Object implements SdkPojo, Serializable, ToCopyableBuilder<CustomCharge.Builder,CustomCharge>

One developer-computed charge.

See Also:
  • Method Details

    • chargeId

      public final String chargeId()

      Caller-chosen stable id for THIS charge. It is the idempotency and replace key: re-submitting the same chargeId within its assigned period upserts the charge in place. A chargeId is bound to the first period it is accepted into; re-submitting it after that period rolls over is refused (ConflictException) rather than billing it again, so it must be unique per charge for this user across all periods — use a UUID or your own invoice-line id (the caller does not know the billing period, so it cannot be encoded in the id).

      Returns:
      Caller-chosen stable id for THIS charge. It is the idempotency and replace key: re-submitting the same chargeId within its assigned period upserts the charge in place. A chargeId is bound to the first period it is accepted into; re-submitting it after that period rolls over is refused (ConflictException) rather than billing it again, so it must be unique per charge for this user across all periods — use a UUID or your own invoice-line id (the caller does not know the billing period, so it cannot be encoded in the id).
    • description

      public final String description()

      Human-readable description, surfaced on the invoice line.

      Returns:
      Human-readable description, surfaced on the invoice line.
    • amount

      public final String amount()

      The charge, as a decimal string in major currency units (for example, "12.50").

      Returns:
      The charge, as a decimal string in major currency units (for example, "12.50").
    • currency

      public final String currency()

      The ISO 4217 currency of the amount. Only USD is supported; a non-USD value is rejected.

      Returns:
      The ISO 4217 currency of the amount. Only USD is supported; a non-USD value is rejected.
    • metricId

      public final String metricId()

      Optional metric this charge derives from. Omitted for a charge not tied to a metric (a flat or custom fee).

      Returns:
      Optional metric this charge derives from. Omitted for a charge not tied to a metric (a flat or custom fee).
    • taxCode

      public final String taxCode()

      Optional product tax code; defaults to the service default when omitted.

      Returns:
      Optional product tax code; defaults to the service default when omitted.
    • toBuilder

      public CustomCharge.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<CustomCharge.Builder,CustomCharge>
      Returns:
      a builder for type T
    • builder

      public static CustomCharge.Builder builder()
    • serializableBuilderClass

      public static Class<? extends CustomCharge.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.