Class UsageRecord
- java.lang.Object
-
- software.amazon.awssdk.services.marketplacemetering.model.UsageRecord
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<UsageRecord.Builder,UsageRecord>
@Generated("software.amazon.awssdk:codegen") public final class UsageRecord extends Object implements SdkPojo, Serializable, ToCopyableBuilder<UsageRecord.Builder,UsageRecord>
A
UsageRecordindicates a quantity of usage for a given product, customer, dimension and time.Multiple requests with the same
UsageRecordsas input will be de-duplicated to prevent double charges.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceUsageRecord.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UsageRecord.Builderbuilder()StringcustomerIdentifier()TheCustomerIdentifieris obtained through theResolveCustomeroperation and represents an individual buyer in your application.Stringdimension()During the process of registering a product on AWS Marketplace, dimensions are specified.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)inthashCode()booleanhasUsageAllocations()For responses, this returns true if the service returned a value for the UsageAllocations property.Integerquantity()The quantity of usage consumed by the customer for the given dimension and time.List<SdkField<?>>sdkFields()static Class<? extends UsageRecord.Builder>serializableBuilderClass()Instanttimestamp()Timestamp, in UTC, for which the usage is being reported.UsageRecord.BuildertoBuilder()StringtoString()Returns a string representation of this object.List<UsageAllocation>usageAllocations()The set ofUsageAllocationsto submit.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
timestamp
public final Instant timestamp()
Timestamp, in UTC, for which the usage is being reported.
Your application can meter usage for up to one hour in the past. Make sure the
timestampvalue is not before the start of the software usage.- Returns:
- Timestamp, in UTC, for which the usage is being reported.
Your application can meter usage for up to one hour in the past. Make sure the
timestampvalue is not before the start of the software usage.
-
customerIdentifier
public final String customerIdentifier()
The
CustomerIdentifieris obtained through theResolveCustomeroperation and represents an individual buyer in your application.- Returns:
- The
CustomerIdentifieris obtained through theResolveCustomeroperation and represents an individual buyer in your application.
-
dimension
public final String dimension()
During the process of registering a product on AWS Marketplace, dimensions are specified. These represent different units of value in your application.
- Returns:
- During the process of registering a product on AWS Marketplace, dimensions are specified. These represent different units of value in your application.
-
quantity
public final Integer quantity()
The quantity of usage consumed by the customer for the given dimension and time. Defaults to
0if not specified.- Returns:
- The quantity of usage consumed by the customer for the given dimension and time. Defaults to
0if not specified.
-
hasUsageAllocations
public final boolean hasUsageAllocations()
For responses, this returns true if the service returned a value for the UsageAllocations property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
usageAllocations
public final List<UsageAllocation> usageAllocations()
The set of
UsageAllocationsto submit. The sum of allUsageAllocationquantities must equal the Quantity of theUsageRecord.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasUsageAllocations()method.- Returns:
- The set of
UsageAllocationsto submit. The sum of allUsageAllocationquantities must equal the Quantity of theUsageRecord.
-
toBuilder
public UsageRecord.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<UsageRecord.Builder,UsageRecord>
-
builder
public static UsageRecord.Builder builder()
-
serializableBuilderClass
public static Class<? extends UsageRecord.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
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.
-
-