Files
sdk/model_usage_kai.go

269 lines
6.9 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 UsageKai type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UsageKai{}
// UsageKai struct for UsageKai
type UsageKai struct {
// Available is false when the warehouse was not connected or a query blipped. The totals below are then honest zeros, NOT measured ones.
Available *bool `json:"available,omitempty"`
// CostCents is what they cost the org, in US cents.
CostCents *int64 `json:"costCents,omitempty"`
// Decisions is how many decisions Kai answered in the window.
Decisions *int64 `json:"decisions,omitempty"`
// InputTokens is the input tokens those decisions were billed on.
InputTokens *int64 `json:"inputTokens,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UsageKai UsageKai
// NewUsageKai instantiates a new UsageKai 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 NewUsageKai() *UsageKai {
this := UsageKai{}
return &this
}
// NewUsageKaiWithDefaults instantiates a new UsageKai 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 NewUsageKaiWithDefaults() *UsageKai {
this := UsageKai{}
return &this
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *UsageKai) GetAvailable() bool {
if o == nil || IsNil(o.Available) {
var ret bool
return ret
}
return *o.Available
}
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageKai) GetAvailableOk() (*bool, bool) {
if o == nil || IsNil(o.Available) {
return nil, false
}
return o.Available, true
}
// HasAvailable returns a boolean if a field has been set.
func (o *UsageKai) HasAvailable() bool {
if o != nil && !IsNil(o.Available) {
return true
}
return false
}
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
func (o *UsageKai) SetAvailable(v bool) {
o.Available = &v
}
// GetCostCents returns the CostCents field value if set, zero value otherwise.
func (o *UsageKai) GetCostCents() int64 {
if o == nil || IsNil(o.CostCents) {
var ret int64
return ret
}
return *o.CostCents
}
// GetCostCentsOk returns a tuple with the CostCents field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageKai) GetCostCentsOk() (*int64, bool) {
if o == nil || IsNil(o.CostCents) {
return nil, false
}
return o.CostCents, true
}
// HasCostCents returns a boolean if a field has been set.
func (o *UsageKai) HasCostCents() bool {
if o != nil && !IsNil(o.CostCents) {
return true
}
return false
}
// SetCostCents gets a reference to the given int64 and assigns it to the CostCents field.
func (o *UsageKai) SetCostCents(v int64) {
o.CostCents = &v
}
// GetDecisions returns the Decisions field value if set, zero value otherwise.
func (o *UsageKai) GetDecisions() int64 {
if o == nil || IsNil(o.Decisions) {
var ret int64
return ret
}
return *o.Decisions
}
// GetDecisionsOk returns a tuple with the Decisions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageKai) GetDecisionsOk() (*int64, bool) {
if o == nil || IsNil(o.Decisions) {
return nil, false
}
return o.Decisions, true
}
// HasDecisions returns a boolean if a field has been set.
func (o *UsageKai) HasDecisions() bool {
if o != nil && !IsNil(o.Decisions) {
return true
}
return false
}
// SetDecisions gets a reference to the given int64 and assigns it to the Decisions field.
func (o *UsageKai) SetDecisions(v int64) {
o.Decisions = &v
}
// GetInputTokens returns the InputTokens field value if set, zero value otherwise.
func (o *UsageKai) GetInputTokens() int64 {
if o == nil || IsNil(o.InputTokens) {
var ret int64
return ret
}
return *o.InputTokens
}
// GetInputTokensOk returns a tuple with the InputTokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageKai) GetInputTokensOk() (*int64, bool) {
if o == nil || IsNil(o.InputTokens) {
return nil, false
}
return o.InputTokens, true
}
// HasInputTokens returns a boolean if a field has been set.
func (o *UsageKai) HasInputTokens() bool {
if o != nil && !IsNil(o.InputTokens) {
return true
}
return false
}
// SetInputTokens gets a reference to the given int64 and assigns it to the InputTokens field.
func (o *UsageKai) SetInputTokens(v int64) {
o.InputTokens = &v
}
func (o UsageKai) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UsageKai) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.CostCents) {
toSerialize["costCents"] = o.CostCents
}
if !IsNil(o.Decisions) {
toSerialize["decisions"] = o.Decisions
}
if !IsNil(o.InputTokens) {
toSerialize["inputTokens"] = o.InputTokens
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UsageKai) UnmarshalJSON(data []byte) (err error) {
varUsageKai := _UsageKai{}
err = json.Unmarshal(data, &varUsageKai)
if err != nil {
return err
}
*o = UsageKai(varUsageKai)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "available")
delete(additionalProperties, "costCents")
delete(additionalProperties, "decisions")
delete(additionalProperties, "inputTokens")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUsageKai struct {
value *UsageKai
isSet bool
}
func (v NullableUsageKai) Get() *UsageKai {
return v.value
}
func (v *NullableUsageKai) Set(val *UsageKai) {
v.value = val
v.isSet = true
}
func (v NullableUsageKai) IsSet() bool {
return v.isSet
}
func (v *NullableUsageKai) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUsageKai(val *UsageKai) *NullableUsageKai {
return &NullableUsageKai{value: val, isSet: true}
}
func (v NullableUsageKai) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUsageKai) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}