mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
497 lines
13 KiB
Go
497 lines
13 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the UsageUsageSummary type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &UsageUsageSummary{}
|
|
|
|
// UsageUsageSummary struct for UsageUsageSummary
|
|
type UsageUsageSummary struct {
|
|
// Accounts is the caller's own linked provider accounts beside the org's Hanzo-routed usage, labelled row by row and never summed together.
|
|
Accounts *UsageAccounts `json:"accounts,omitempty"`
|
|
// End is the window's exclusive end, RFC3339 UTC.
|
|
End *string `json:"end,omitempty"`
|
|
// Interval is the bucket width the spend series is gap-filled at.
|
|
Interval *string `json:"interval,omitempty"`
|
|
// Kai is the org's Kai decisions: count, input tokens and cost. Also counted in LLM.
|
|
Kai *UsageKai `json:"kai,omitempty"`
|
|
// LLM is the org's Hanzo-routed inference totals from the warehouse.
|
|
Llm *UsageLLM `json:"llm,omitempty"`
|
|
// Range is the window label that was served.
|
|
Range *string `json:"range,omitempty"`
|
|
// Scope is the tenant and subject the roll-up was answered for.
|
|
Scope *UsageUsageScope `json:"scope,omitempty"`
|
|
// Sources says which upstreams actually answered, so a zero can be read as \"no data yet\" rather than as a measurement.
|
|
Sources *UsageSources `json:"sources,omitempty"`
|
|
// Spend is the categorized cost roll-up from the billing ledger.
|
|
Spend *UsageSpend `json:"spend,omitempty"`
|
|
// Start is the window's inclusive start, RFC3339 UTC.
|
|
Start *string `json:"start,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _UsageUsageSummary UsageUsageSummary
|
|
|
|
// NewUsageUsageSummary instantiates a new UsageUsageSummary object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewUsageUsageSummary() *UsageUsageSummary {
|
|
this := UsageUsageSummary{}
|
|
return &this
|
|
}
|
|
|
|
// NewUsageUsageSummaryWithDefaults instantiates a new UsageUsageSummary object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewUsageUsageSummaryWithDefaults() *UsageUsageSummary {
|
|
this := UsageUsageSummary{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccounts returns the Accounts field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetAccounts() UsageAccounts {
|
|
if o == nil || IsNil(o.Accounts) {
|
|
var ret UsageAccounts
|
|
return ret
|
|
}
|
|
return *o.Accounts
|
|
}
|
|
|
|
// GetAccountsOk returns a tuple with the Accounts field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetAccountsOk() (*UsageAccounts, bool) {
|
|
if o == nil || IsNil(o.Accounts) {
|
|
return nil, false
|
|
}
|
|
return o.Accounts, true
|
|
}
|
|
|
|
// HasAccounts returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasAccounts() bool {
|
|
if o != nil && !IsNil(o.Accounts) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccounts gets a reference to the given UsageAccounts and assigns it to the Accounts field.
|
|
func (o *UsageUsageSummary) SetAccounts(v UsageAccounts) {
|
|
o.Accounts = &v
|
|
}
|
|
|
|
// GetEnd returns the End field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetEnd() string {
|
|
if o == nil || IsNil(o.End) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.End
|
|
}
|
|
|
|
// GetEndOk returns a tuple with the End field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetEndOk() (*string, bool) {
|
|
if o == nil || IsNil(o.End) {
|
|
return nil, false
|
|
}
|
|
return o.End, true
|
|
}
|
|
|
|
// HasEnd returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasEnd() bool {
|
|
if o != nil && !IsNil(o.End) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnd gets a reference to the given string and assigns it to the End field.
|
|
func (o *UsageUsageSummary) SetEnd(v string) {
|
|
o.End = &v
|
|
}
|
|
|
|
// GetInterval returns the Interval field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetInterval() string {
|
|
if o == nil || IsNil(o.Interval) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Interval
|
|
}
|
|
|
|
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetIntervalOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Interval) {
|
|
return nil, false
|
|
}
|
|
return o.Interval, true
|
|
}
|
|
|
|
// HasInterval returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasInterval() bool {
|
|
if o != nil && !IsNil(o.Interval) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetInterval gets a reference to the given string and assigns it to the Interval field.
|
|
func (o *UsageUsageSummary) SetInterval(v string) {
|
|
o.Interval = &v
|
|
}
|
|
|
|
// GetKai returns the Kai field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetKai() UsageKai {
|
|
if o == nil || IsNil(o.Kai) {
|
|
var ret UsageKai
|
|
return ret
|
|
}
|
|
return *o.Kai
|
|
}
|
|
|
|
// GetKaiOk returns a tuple with the Kai field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetKaiOk() (*UsageKai, bool) {
|
|
if o == nil || IsNil(o.Kai) {
|
|
return nil, false
|
|
}
|
|
return o.Kai, true
|
|
}
|
|
|
|
// HasKai returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasKai() bool {
|
|
if o != nil && !IsNil(o.Kai) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKai gets a reference to the given UsageKai and assigns it to the Kai field.
|
|
func (o *UsageUsageSummary) SetKai(v UsageKai) {
|
|
o.Kai = &v
|
|
}
|
|
|
|
// GetLlm returns the Llm field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetLlm() UsageLLM {
|
|
if o == nil || IsNil(o.Llm) {
|
|
var ret UsageLLM
|
|
return ret
|
|
}
|
|
return *o.Llm
|
|
}
|
|
|
|
// GetLlmOk returns a tuple with the Llm field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetLlmOk() (*UsageLLM, bool) {
|
|
if o == nil || IsNil(o.Llm) {
|
|
return nil, false
|
|
}
|
|
return o.Llm, true
|
|
}
|
|
|
|
// HasLlm returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasLlm() bool {
|
|
if o != nil && !IsNil(o.Llm) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLlm gets a reference to the given UsageLLM and assigns it to the Llm field.
|
|
func (o *UsageUsageSummary) SetLlm(v UsageLLM) {
|
|
o.Llm = &v
|
|
}
|
|
|
|
// GetRange returns the Range field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetRange() string {
|
|
if o == nil || IsNil(o.Range) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Range
|
|
}
|
|
|
|
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetRangeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Range) {
|
|
return nil, false
|
|
}
|
|
return o.Range, true
|
|
}
|
|
|
|
// HasRange returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasRange() bool {
|
|
if o != nil && !IsNil(o.Range) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRange gets a reference to the given string and assigns it to the Range field.
|
|
func (o *UsageUsageSummary) SetRange(v string) {
|
|
o.Range = &v
|
|
}
|
|
|
|
// GetScope returns the Scope field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetScope() UsageUsageScope {
|
|
if o == nil || IsNil(o.Scope) {
|
|
var ret UsageUsageScope
|
|
return ret
|
|
}
|
|
return *o.Scope
|
|
}
|
|
|
|
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetScopeOk() (*UsageUsageScope, bool) {
|
|
if o == nil || IsNil(o.Scope) {
|
|
return nil, false
|
|
}
|
|
return o.Scope, true
|
|
}
|
|
|
|
// HasScope returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasScope() bool {
|
|
if o != nil && !IsNil(o.Scope) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetScope gets a reference to the given UsageUsageScope and assigns it to the Scope field.
|
|
func (o *UsageUsageSummary) SetScope(v UsageUsageScope) {
|
|
o.Scope = &v
|
|
}
|
|
|
|
// GetSources returns the Sources field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetSources() UsageSources {
|
|
if o == nil || IsNil(o.Sources) {
|
|
var ret UsageSources
|
|
return ret
|
|
}
|
|
return *o.Sources
|
|
}
|
|
|
|
// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetSourcesOk() (*UsageSources, bool) {
|
|
if o == nil || IsNil(o.Sources) {
|
|
return nil, false
|
|
}
|
|
return o.Sources, true
|
|
}
|
|
|
|
// HasSources returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasSources() bool {
|
|
if o != nil && !IsNil(o.Sources) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSources gets a reference to the given UsageSources and assigns it to the Sources field.
|
|
func (o *UsageUsageSummary) SetSources(v UsageSources) {
|
|
o.Sources = &v
|
|
}
|
|
|
|
// GetSpend returns the Spend field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetSpend() UsageSpend {
|
|
if o == nil || IsNil(o.Spend) {
|
|
var ret UsageSpend
|
|
return ret
|
|
}
|
|
return *o.Spend
|
|
}
|
|
|
|
// GetSpendOk returns a tuple with the Spend field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetSpendOk() (*UsageSpend, bool) {
|
|
if o == nil || IsNil(o.Spend) {
|
|
return nil, false
|
|
}
|
|
return o.Spend, true
|
|
}
|
|
|
|
// HasSpend returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasSpend() bool {
|
|
if o != nil && !IsNil(o.Spend) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSpend gets a reference to the given UsageSpend and assigns it to the Spend field.
|
|
func (o *UsageUsageSummary) SetSpend(v UsageSpend) {
|
|
o.Spend = &v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *UsageUsageSummary) GetStart() string {
|
|
if o == nil || IsNil(o.Start) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Start
|
|
}
|
|
|
|
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageSummary) GetStartOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Start) {
|
|
return nil, false
|
|
}
|
|
return o.Start, true
|
|
}
|
|
|
|
// HasStart returns a boolean if a field has been set.
|
|
func (o *UsageUsageSummary) HasStart() bool {
|
|
if o != nil && !IsNil(o.Start) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStart gets a reference to the given string and assigns it to the Start field.
|
|
func (o *UsageUsageSummary) SetStart(v string) {
|
|
o.Start = &v
|
|
}
|
|
|
|
func (o UsageUsageSummary) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o UsageUsageSummary) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Accounts) {
|
|
toSerialize["accounts"] = o.Accounts
|
|
}
|
|
if !IsNil(o.End) {
|
|
toSerialize["end"] = o.End
|
|
}
|
|
if !IsNil(o.Interval) {
|
|
toSerialize["interval"] = o.Interval
|
|
}
|
|
if !IsNil(o.Kai) {
|
|
toSerialize["kai"] = o.Kai
|
|
}
|
|
if !IsNil(o.Llm) {
|
|
toSerialize["llm"] = o.Llm
|
|
}
|
|
if !IsNil(o.Range) {
|
|
toSerialize["range"] = o.Range
|
|
}
|
|
if !IsNil(o.Scope) {
|
|
toSerialize["scope"] = o.Scope
|
|
}
|
|
if !IsNil(o.Sources) {
|
|
toSerialize["sources"] = o.Sources
|
|
}
|
|
if !IsNil(o.Spend) {
|
|
toSerialize["spend"] = o.Spend
|
|
}
|
|
if !IsNil(o.Start) {
|
|
toSerialize["start"] = o.Start
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *UsageUsageSummary) UnmarshalJSON(data []byte) (err error) {
|
|
varUsageUsageSummary := _UsageUsageSummary{}
|
|
|
|
err = json.Unmarshal(data, &varUsageUsageSummary)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = UsageUsageSummary(varUsageUsageSummary)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "accounts")
|
|
delete(additionalProperties, "end")
|
|
delete(additionalProperties, "interval")
|
|
delete(additionalProperties, "kai")
|
|
delete(additionalProperties, "llm")
|
|
delete(additionalProperties, "range")
|
|
delete(additionalProperties, "scope")
|
|
delete(additionalProperties, "sources")
|
|
delete(additionalProperties, "spend")
|
|
delete(additionalProperties, "start")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableUsageUsageSummary struct {
|
|
value *UsageUsageSummary
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUsageUsageSummary) Get() *UsageUsageSummary {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUsageUsageSummary) Set(val *UsageUsageSummary) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUsageUsageSummary) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUsageUsageSummary) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUsageUsageSummary(val *UsageUsageSummary) *NullableUsageUsageSummary {
|
|
return &NullableUsageUsageSummary{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUsageUsageSummary) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUsageUsageSummary) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|