mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
8.8 KiB
Go
345 lines
8.8 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 EventModelRow type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EventModelRow{}
|
|
|
|
// EventModelRow struct for EventModelRow
|
|
type EventModelRow struct {
|
|
// Model is the model id, e.g. zen5-coder.
|
|
Model *string `json:"model,omitempty"`
|
|
// Pct is this model's share of the window's returned spend, 0..100, one decimal.
|
|
Pct *float64 `json:"pct,omitempty"`
|
|
// Provider is who served it.
|
|
Provider *string `json:"provider,omitempty"`
|
|
// Requests is how many calls went to this model.
|
|
Requests *int64 `json:"requests,omitempty"`
|
|
// SpendCents is what they cost, in cents.
|
|
SpendCents *int64 `json:"spendCents,omitempty"`
|
|
// Tokens is prompt plus completion tokens over those calls.
|
|
Tokens *int64 `json:"tokens,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EventModelRow EventModelRow
|
|
|
|
// NewEventModelRow instantiates a new EventModelRow 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 NewEventModelRow() *EventModelRow {
|
|
this := EventModelRow{}
|
|
return &this
|
|
}
|
|
|
|
// NewEventModelRowWithDefaults instantiates a new EventModelRow 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 NewEventModelRowWithDefaults() *EventModelRow {
|
|
this := EventModelRow{}
|
|
return &this
|
|
}
|
|
|
|
// GetModel returns the Model field value if set, zero value otherwise.
|
|
func (o *EventModelRow) GetModel() string {
|
|
if o == nil || IsNil(o.Model) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Model
|
|
}
|
|
|
|
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventModelRow) GetModelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Model) {
|
|
return nil, false
|
|
}
|
|
return o.Model, true
|
|
}
|
|
|
|
// HasModel returns a boolean if a field has been set.
|
|
func (o *EventModelRow) HasModel() bool {
|
|
if o != nil && !IsNil(o.Model) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModel gets a reference to the given string and assigns it to the Model field.
|
|
func (o *EventModelRow) SetModel(v string) {
|
|
o.Model = &v
|
|
}
|
|
|
|
// GetPct returns the Pct field value if set, zero value otherwise.
|
|
func (o *EventModelRow) GetPct() float64 {
|
|
if o == nil || IsNil(o.Pct) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.Pct
|
|
}
|
|
|
|
// GetPctOk returns a tuple with the Pct field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventModelRow) GetPctOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.Pct) {
|
|
return nil, false
|
|
}
|
|
return o.Pct, true
|
|
}
|
|
|
|
// HasPct returns a boolean if a field has been set.
|
|
func (o *EventModelRow) HasPct() bool {
|
|
if o != nil && !IsNil(o.Pct) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPct gets a reference to the given float64 and assigns it to the Pct field.
|
|
func (o *EventModelRow) SetPct(v float64) {
|
|
o.Pct = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *EventModelRow) GetProvider() string {
|
|
if o == nil || IsNil(o.Provider) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Provider
|
|
}
|
|
|
|
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventModelRow) GetProviderOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Provider) {
|
|
return nil, false
|
|
}
|
|
return o.Provider, true
|
|
}
|
|
|
|
// HasProvider returns a boolean if a field has been set.
|
|
func (o *EventModelRow) HasProvider() bool {
|
|
if o != nil && !IsNil(o.Provider) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
|
func (o *EventModelRow) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetRequests returns the Requests field value if set, zero value otherwise.
|
|
func (o *EventModelRow) GetRequests() int64 {
|
|
if o == nil || IsNil(o.Requests) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Requests
|
|
}
|
|
|
|
// GetRequestsOk returns a tuple with the Requests field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventModelRow) GetRequestsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Requests) {
|
|
return nil, false
|
|
}
|
|
return o.Requests, true
|
|
}
|
|
|
|
// HasRequests returns a boolean if a field has been set.
|
|
func (o *EventModelRow) HasRequests() bool {
|
|
if o != nil && !IsNil(o.Requests) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRequests gets a reference to the given int64 and assigns it to the Requests field.
|
|
func (o *EventModelRow) SetRequests(v int64) {
|
|
o.Requests = &v
|
|
}
|
|
|
|
// GetSpendCents returns the SpendCents field value if set, zero value otherwise.
|
|
func (o *EventModelRow) GetSpendCents() int64 {
|
|
if o == nil || IsNil(o.SpendCents) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.SpendCents
|
|
}
|
|
|
|
// GetSpendCentsOk returns a tuple with the SpendCents field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventModelRow) GetSpendCentsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.SpendCents) {
|
|
return nil, false
|
|
}
|
|
return o.SpendCents, true
|
|
}
|
|
|
|
// HasSpendCents returns a boolean if a field has been set.
|
|
func (o *EventModelRow) HasSpendCents() bool {
|
|
if o != nil && !IsNil(o.SpendCents) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSpendCents gets a reference to the given int64 and assigns it to the SpendCents field.
|
|
func (o *EventModelRow) SetSpendCents(v int64) {
|
|
o.SpendCents = &v
|
|
}
|
|
|
|
// GetTokens returns the Tokens field value if set, zero value otherwise.
|
|
func (o *EventModelRow) GetTokens() int64 {
|
|
if o == nil || IsNil(o.Tokens) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Tokens
|
|
}
|
|
|
|
// GetTokensOk returns a tuple with the Tokens field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventModelRow) GetTokensOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Tokens) {
|
|
return nil, false
|
|
}
|
|
return o.Tokens, true
|
|
}
|
|
|
|
// HasTokens returns a boolean if a field has been set.
|
|
func (o *EventModelRow) HasTokens() bool {
|
|
if o != nil && !IsNil(o.Tokens) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTokens gets a reference to the given int64 and assigns it to the Tokens field.
|
|
func (o *EventModelRow) SetTokens(v int64) {
|
|
o.Tokens = &v
|
|
}
|
|
|
|
func (o EventModelRow) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EventModelRow) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Model) {
|
|
toSerialize["model"] = o.Model
|
|
}
|
|
if !IsNil(o.Pct) {
|
|
toSerialize["pct"] = o.Pct
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.Requests) {
|
|
toSerialize["requests"] = o.Requests
|
|
}
|
|
if !IsNil(o.SpendCents) {
|
|
toSerialize["spendCents"] = o.SpendCents
|
|
}
|
|
if !IsNil(o.Tokens) {
|
|
toSerialize["tokens"] = o.Tokens
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EventModelRow) UnmarshalJSON(data []byte) (err error) {
|
|
varEventModelRow := _EventModelRow{}
|
|
|
|
err = json.Unmarshal(data, &varEventModelRow)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EventModelRow(varEventModelRow)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "pct")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "requests")
|
|
delete(additionalProperties, "spendCents")
|
|
delete(additionalProperties, "tokens")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEventModelRow struct {
|
|
value *EventModelRow
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEventModelRow) Get() *EventModelRow {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEventModelRow) Set(val *EventModelRow) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEventModelRow) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEventModelRow) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEventModelRow(val *EventModelRow) *NullableEventModelRow {
|
|
return &NullableEventModelRow{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEventModelRow) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEventModelRow) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|