java.lang.Object
co.ankatech.keymanagement.client.keymanagement.model.GrantConsumption

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class GrantConsumption extends Object
The use that exhausted a Capability Grant, as the cryptographic service's consumption ledger recorded it.
  • Field Details

  • Constructor Details

    • GrantConsumption

      public GrantConsumption()
  • Method Details

    • getCauseAsString

      public String getCauseAsString()
      The wire value of cause: what the server sent, verbatim.
      • For a value this release declares, the same wire value the enum names.
      • For a value it does not declare (one a later server added), the server's wire value verbatim, while getCause() reads UNKNOWN_DEFAULT_OPEN_API; writing this model sends that wire value back, never the sentinel.
      • For an absent member, null.
      Returns:
      the wire value, or null when the member is absent
    • cause

      public GrantConsumption cause(@Nonnull GrantConsumption.CauseEnum cause)
    • getCause

      @Nonnull public GrantConsumption.CauseEnum getCause()
      REVOKED_ON_USE: the single permitted use was taken. MAX_USAGE: the maxUsage ceiling was reached.
      Returns:
      cause
    • setCause

      public void setCause(@Nonnull GrantConsumption.CauseEnum cause)
    • consumedAt

      public GrantConsumption consumedAt(@Nonnull OffsetDateTime consumedAt)
    • getConsumedAt

      @Nonnull public OffsetDateTime getConsumedAt()
      When the use that exhausted the grant was charged
      Returns:
      consumedAt
    • setConsumedAt

      public void setConsumedAt(@Nonnull OffsetDateTime consumedAt)
    • useCount

      public GrantConsumption useCount(@Nonnull Long useCount)
    • getUseCount

      @Nonnull public Long getUseCount()
      Admitted uses charged to the grant, the exhausting one included
      Returns:
      useCount
    • setUseCount

      public void setUseCount(@Nonnull Long useCount)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to GrantConsumption
    • validateJsonElementAsCandidate

      public static void validateJsonElementAsCandidate(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element as a candidate of a oneOf schema: the checks of validateJsonElement(JsonElement), and the element carries no member this model does not declare. A oneOf schema without a discriminator tells its candidates apart by their member sets, so a candidate is matched on its closed member set.
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is not a GrantConsumption
    • fromJson

      public static GrantConsumption fromJson(String jsonString) throws IOException
      Create an instance of GrantConsumption given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of GrantConsumption
      Throws:
      IOException - if the JSON string is invalid with respect to GrantConsumption
    • toJson

      public String toJson()
      Convert an instance of GrantConsumption to an JSON string
      Returns:
      JSON string