Class ActionAvailability

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

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class ActionAvailability extends Object
Per-action capability flag computed server-side. Indicates whether a lifecycle action is permitted for the current key state and caller authorities. The optional 'reason' is populated only when 'allowed' is false and is suitable for direct end-user display.
  • Field Details

  • Constructor Details

    • ActionAvailability

      public ActionAvailability()
  • Method Details

    • allowed

      public ActionAvailability allowed(@Nonnull Boolean allowed)
    • getAllowed

      @Nonnull public Boolean getAllowed()
      True when the corresponding action is permitted in the current key state and the caller holds the required scope.
      Returns:
      allowed
    • setAllowed

      public void setAllowed(@Nonnull Boolean allowed)
    • reason

      public ActionAvailability reason(@Nullable String reason)
    • getReason

      @Nullable public String getReason()
      End-user-displayable rationale when 'allowed' is false. Omitted (null) when 'allowed' is true. The literal string 'Insufficient privileges' indicates the caller lacks the required scope; no scope name is leaked.
      Returns:
      reason
    • setReason

      public void setReason(@Nullable String reason)
    • 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 ActionAvailability
    • 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 ActionAvailability
    • fromJson

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

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