Files
sdk/model_event_usage_point.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 EventUsagePoint type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EventUsagePoint{}
// EventUsagePoint struct for EventUsagePoint
type EventUsagePoint struct {
// Requests is how many LLM calls fell in this bucket.
Requests *int64 `json:"requests,omitempty"`
// SpendCents is what they cost, in cents.
SpendCents *int64 `json:"spendCents,omitempty"`
// T is the bucket's start, RFC3339 UTC, aligned to the interval.
T *string `json:"t,omitempty"`
// Tokens is prompt plus completion tokens over those calls.
Tokens *int64 `json:"tokens,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EventUsagePoint EventUsagePoint
// NewEventUsagePoint instantiates a new EventUsagePoint 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 NewEventUsagePoint() *EventUsagePoint {
this := EventUsagePoint{}
return &this
}
// NewEventUsagePointWithDefaults instantiates a new EventUsagePoint 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 NewEventUsagePointWithDefaults() *EventUsagePoint {
this := EventUsagePoint{}
return &this
}
// GetRequests returns the Requests field value if set, zero value otherwise.
func (o *EventUsagePoint) 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 *EventUsagePoint) 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 *EventUsagePoint) 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 *EventUsagePoint) SetRequests(v int64) {
o.Requests = &v
}
// GetSpendCents returns the SpendCents field value if set, zero value otherwise.
func (o *EventUsagePoint) 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 *EventUsagePoint) 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 *EventUsagePoint) 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 *EventUsagePoint) SetSpendCents(v int64) {
o.SpendCents = &v
}
// GetT returns the T field value if set, zero value otherwise.
func (o *EventUsagePoint) GetT() string {
if o == nil || IsNil(o.T) {
var ret string
return ret
}
return *o.T
}
// GetTOk returns a tuple with the T field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventUsagePoint) GetTOk() (*string, bool) {
if o == nil || IsNil(o.T) {
return nil, false
}
return o.T, true
}
// HasT returns a boolean if a field has been set.
func (o *EventUsagePoint) HasT() bool {
if o != nil && !IsNil(o.T) {
return true
}
return false
}
// SetT gets a reference to the given string and assigns it to the T field.
func (o *EventUsagePoint) SetT(v string) {
o.T = &v
}
// GetTokens returns the Tokens field value if set, zero value otherwise.
func (o *EventUsagePoint) 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 *EventUsagePoint) 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 *EventUsagePoint) 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 *EventUsagePoint) SetTokens(v int64) {
o.Tokens = &v
}
func (o EventUsagePoint) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EventUsagePoint) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Requests) {
toSerialize["requests"] = o.Requests
}
if !IsNil(o.SpendCents) {
toSerialize["spendCents"] = o.SpendCents
}
if !IsNil(o.T) {
toSerialize["t"] = o.T
}
if !IsNil(o.Tokens) {
toSerialize["tokens"] = o.Tokens
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EventUsagePoint) UnmarshalJSON(data []byte) (err error) {
varEventUsagePoint := _EventUsagePoint{}
err = json.Unmarshal(data, &varEventUsagePoint)
if err != nil {
return err
}
*o = EventUsagePoint(varEventUsagePoint)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "requests")
delete(additionalProperties, "spendCents")
delete(additionalProperties, "t")
delete(additionalProperties, "tokens")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEventUsagePoint struct {
value *EventUsagePoint
isSet bool
}
func (v NullableEventUsagePoint) Get() *EventUsagePoint {
return v.value
}
func (v *NullableEventUsagePoint) Set(val *EventUsagePoint) {
v.value = val
v.isSet = true
}
func (v NullableEventUsagePoint) IsSet() bool {
return v.isSet
}
func (v *NullableEventUsagePoint) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEventUsagePoint(val *EventUsagePoint) *NullableEventUsagePoint {
return &NullableEventUsagePoint{value: val, isSet: true}
}
func (v NullableEventUsagePoint) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEventUsagePoint) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}