Class Usage
[Serializable]
public class Usage : IEquatable<Usage>
- Inheritance
-
objectUsage
- Implements
-
IEquatable<Usage>
- Derived
Constructors
Usage()
public Usage()
Usage(UsageType)
public Usage(UsageType type)
Parameters
typeUsageType
Fields
costInUsd
public double costInUsd
Field Value
- double
m_TypeNameCache
protected string m_TypeNameCache
Field Value
- string
type
The type of usage, e.g., Token, Image, Audio, Transcription.
public UsageType type
Field Value
Properties
HasValue
public virtual bool HasValue { get; }
Property Value
- bool
Methods
CalcCostInUsd(string)
public void CalcCostInUsd(string modelId)
Parameters
modelIdstring
Equals(Usage)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Usage other)
Parameters
otherUsageAn object to compare with this object.
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
GetInspectorTypeName()
public virtual string GetInspectorTypeName()
Returns
- string
GetInspectorValueName()
public virtual string GetInspectorValueName()
Returns
- string
IsMatchingPrice(ModelPrice)
public bool IsMatchingPrice(ModelPrice price)
Parameters
priceModelPrice
Returns
- bool
TryMerge(Usage)
public virtual bool TryMerge(Usage other)
Parameters
otherUsage
Returns
- bool
Operators
operator ==(Usage, Usage)
public static bool operator ==(Usage left, Usage right)
Parameters
Returns
- bool
operator !=(Usage, Usage)
public static bool operator !=(Usage left, Usage right)
Parameters
Returns
- bool