Record Class ToolExecutionUsage

java.lang.Object
java.lang.Record
com.github.copilot.generated.ToolExecutionUsage

@CopilotExperimental @Generated("copilot-sdk-codegen") public record ToolExecutionUsage(String requestId, String model, ModelProviderRef provider, UsageAccountingIdentity accounting, Long inputTokens, Long outputTokens, Long totalTokens, ToolExecutionUsageTokenDetails inputTokensDetails, ToolExecutionUsageTokenDetails outputTokensDetails, AssistantUsageCopilotUsage copilotUsage, Map<String,Object> quotaSnapshots) extends Record
Authoritative usage reported by a separately metered runtime-owned tool operation. May be present on a failed tool when the service reported usage before local result processing failed. Missing token counts or billing mean unavailable, not zero.
Since:
1.0.0
  • Constructor Details

    • ToolExecutionUsage

      public ToolExecutionUsage(String requestId, String model, ModelProviderRef provider, UsageAccountingIdentity accounting, Long inputTokens, Long outputTokens, Long totalTokens, ToolExecutionUsageTokenDetails inputTokensDetails, ToolExecutionUsageTokenDetails outputTokensDetails, AssistantUsageCopilotUsage copilotUsage, Map<String,Object> quotaSnapshots)
      Creates an instance of a ToolExecutionUsage record class.
      Parameters:
      requestId - the value for the requestId record component
      model - the value for the model record component
      provider - the value for the provider record component
      accounting - the value for the accounting record component
      inputTokens - the value for the inputTokens record component
      outputTokens - the value for the outputTokens record component
      totalTokens - the value for the totalTokens record component
      inputTokensDetails - the value for the inputTokensDetails record component
      outputTokensDetails - the value for the outputTokensDetails record component
      copilotUsage - the value for the copilotUsage record component
      quotaSnapshots - the value for the quotaSnapshots record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • requestId

      public String requestId()
      Returns the value of the requestId record component.
      Returns:
      the value of the requestId record component
    • model

      public String model()
      Returns the value of the model record component.
      Returns:
      the value of the model record component
    • provider

      public ModelProviderRef provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • accounting

      public UsageAccountingIdentity accounting()
      Returns the value of the accounting record component.
      Returns:
      the value of the accounting record component
    • inputTokens

      public Long inputTokens()
      Returns the value of the inputTokens record component.
      Returns:
      the value of the inputTokens record component
    • outputTokens

      public Long outputTokens()
      Returns the value of the outputTokens record component.
      Returns:
      the value of the outputTokens record component
    • totalTokens

      public Long totalTokens()
      Returns the value of the totalTokens record component.
      Returns:
      the value of the totalTokens record component
    • inputTokensDetails

      public ToolExecutionUsageTokenDetails inputTokensDetails()
      Returns the value of the inputTokensDetails record component.
      Returns:
      the value of the inputTokensDetails record component
    • outputTokensDetails

      public ToolExecutionUsageTokenDetails outputTokensDetails()
      Returns the value of the outputTokensDetails record component.
      Returns:
      the value of the outputTokensDetails record component
    • copilotUsage

      public AssistantUsageCopilotUsage copilotUsage()
      Returns the value of the copilotUsage record component.
      Returns:
      the value of the copilotUsage record component
    • quotaSnapshots

      public Map<String,Object> quotaSnapshots()
      Returns the value of the quotaSnapshots record component.
      Returns:
      the value of the quotaSnapshots record component