mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
524 lines
14 KiB
Go
524 lines
14 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 AiProviderUsage type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiProviderUsage{}
|
|
|
|
// AiProviderUsage struct for AiProviderUsage
|
|
type AiProviderUsage struct {
|
|
Available *bool `json:"available,omitempty"`
|
|
ByModel []AiProviderUsageModelSpend `json:"byModel,omitempty"`
|
|
Connected *bool `json:"connected,omitempty"`
|
|
Currency *string `json:"currency,omitempty"`
|
|
End *string `json:"end,omitempty"`
|
|
Interval *string `json:"interval,omitempty"`
|
|
Note *string `json:"note,omitempty"`
|
|
Provider *string `json:"provider,omitempty"`
|
|
Series []AiProviderUsageSeriesPoint `json:"series,omitempty"`
|
|
Start *string `json:"start,omitempty"`
|
|
Totals *AiProviderUsageTotals `json:"totals,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiProviderUsage AiProviderUsage
|
|
|
|
// NewAiProviderUsage instantiates a new AiProviderUsage 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 NewAiProviderUsage() *AiProviderUsage {
|
|
this := AiProviderUsage{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiProviderUsageWithDefaults instantiates a new AiProviderUsage 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 NewAiProviderUsageWithDefaults() *AiProviderUsage {
|
|
this := AiProviderUsage{}
|
|
return &this
|
|
}
|
|
|
|
// GetAvailable returns the Available field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) SetAvailable(v bool) {
|
|
o.Available = &v
|
|
}
|
|
|
|
// GetByModel returns the ByModel field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) GetByModel() []AiProviderUsageModelSpend {
|
|
if o == nil || IsNil(o.ByModel) {
|
|
var ret []AiProviderUsageModelSpend
|
|
return ret
|
|
}
|
|
return o.ByModel
|
|
}
|
|
|
|
// GetByModelOk returns a tuple with the ByModel field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiProviderUsage) GetByModelOk() ([]AiProviderUsageModelSpend, bool) {
|
|
if o == nil || IsNil(o.ByModel) {
|
|
return nil, false
|
|
}
|
|
return o.ByModel, true
|
|
}
|
|
|
|
// HasByModel returns a boolean if a field has been set.
|
|
func (o *AiProviderUsage) HasByModel() bool {
|
|
if o != nil && !IsNil(o.ByModel) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetByModel gets a reference to the given []AiProviderUsageModelSpend and assigns it to the ByModel field.
|
|
func (o *AiProviderUsage) SetByModel(v []AiProviderUsageModelSpend) {
|
|
o.ByModel = v
|
|
}
|
|
|
|
// GetConnected returns the Connected field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) GetConnected() bool {
|
|
if o == nil || IsNil(o.Connected) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Connected
|
|
}
|
|
|
|
// GetConnectedOk returns a tuple with the Connected field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiProviderUsage) GetConnectedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Connected) {
|
|
return nil, false
|
|
}
|
|
return o.Connected, true
|
|
}
|
|
|
|
// HasConnected returns a boolean if a field has been set.
|
|
func (o *AiProviderUsage) HasConnected() bool {
|
|
if o != nil && !IsNil(o.Connected) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetConnected gets a reference to the given bool and assigns it to the Connected field.
|
|
func (o *AiProviderUsage) SetConnected(v bool) {
|
|
o.Connected = &v
|
|
}
|
|
|
|
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) GetCurrency() string {
|
|
if o == nil || IsNil(o.Currency) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Currency
|
|
}
|
|
|
|
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiProviderUsage) GetCurrencyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Currency) {
|
|
return nil, false
|
|
}
|
|
return o.Currency, true
|
|
}
|
|
|
|
// HasCurrency returns a boolean if a field has been set.
|
|
func (o *AiProviderUsage) HasCurrency() bool {
|
|
if o != nil && !IsNil(o.Currency) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
|
|
func (o *AiProviderUsage) SetCurrency(v string) {
|
|
o.Currency = &v
|
|
}
|
|
|
|
// GetEnd returns the End field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) SetEnd(v string) {
|
|
o.End = &v
|
|
}
|
|
|
|
// GetInterval returns the Interval field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) SetInterval(v string) {
|
|
o.Interval = &v
|
|
}
|
|
|
|
// GetNote returns the Note field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) GetNote() string {
|
|
if o == nil || IsNil(o.Note) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Note
|
|
}
|
|
|
|
// GetNoteOk returns a tuple with the Note field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiProviderUsage) GetNoteOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Note) {
|
|
return nil, false
|
|
}
|
|
return o.Note, true
|
|
}
|
|
|
|
// HasNote returns a boolean if a field has been set.
|
|
func (o *AiProviderUsage) HasNote() bool {
|
|
if o != nil && !IsNil(o.Note) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNote gets a reference to the given string and assigns it to the Note field.
|
|
func (o *AiProviderUsage) SetNote(v string) {
|
|
o.Note = &v
|
|
}
|
|
|
|
// GetProvider returns the Provider field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) SetProvider(v string) {
|
|
o.Provider = &v
|
|
}
|
|
|
|
// GetSeries returns the Series field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) GetSeries() []AiProviderUsageSeriesPoint {
|
|
if o == nil || IsNil(o.Series) {
|
|
var ret []AiProviderUsageSeriesPoint
|
|
return ret
|
|
}
|
|
return o.Series
|
|
}
|
|
|
|
// GetSeriesOk returns a tuple with the Series field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiProviderUsage) GetSeriesOk() ([]AiProviderUsageSeriesPoint, bool) {
|
|
if o == nil || IsNil(o.Series) {
|
|
return nil, false
|
|
}
|
|
return o.Series, true
|
|
}
|
|
|
|
// HasSeries returns a boolean if a field has been set.
|
|
func (o *AiProviderUsage) HasSeries() bool {
|
|
if o != nil && !IsNil(o.Series) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeries gets a reference to the given []AiProviderUsageSeriesPoint and assigns it to the Series field.
|
|
func (o *AiProviderUsage) SetSeries(v []AiProviderUsageSeriesPoint) {
|
|
o.Series = v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) 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 *AiProviderUsage) SetStart(v string) {
|
|
o.Start = &v
|
|
}
|
|
|
|
// GetTotals returns the Totals field value if set, zero value otherwise.
|
|
func (o *AiProviderUsage) GetTotals() AiProviderUsageTotals {
|
|
if o == nil || IsNil(o.Totals) {
|
|
var ret AiProviderUsageTotals
|
|
return ret
|
|
}
|
|
return *o.Totals
|
|
}
|
|
|
|
// GetTotalsOk returns a tuple with the Totals field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiProviderUsage) GetTotalsOk() (*AiProviderUsageTotals, bool) {
|
|
if o == nil || IsNil(o.Totals) {
|
|
return nil, false
|
|
}
|
|
return o.Totals, true
|
|
}
|
|
|
|
// HasTotals returns a boolean if a field has been set.
|
|
func (o *AiProviderUsage) HasTotals() bool {
|
|
if o != nil && !IsNil(o.Totals) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTotals gets a reference to the given AiProviderUsageTotals and assigns it to the Totals field.
|
|
func (o *AiProviderUsage) SetTotals(v AiProviderUsageTotals) {
|
|
o.Totals = &v
|
|
}
|
|
|
|
func (o AiProviderUsage) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiProviderUsage) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Available) {
|
|
toSerialize["available"] = o.Available
|
|
}
|
|
if !IsNil(o.ByModel) {
|
|
toSerialize["byModel"] = o.ByModel
|
|
}
|
|
if !IsNil(o.Connected) {
|
|
toSerialize["connected"] = o.Connected
|
|
}
|
|
if !IsNil(o.Currency) {
|
|
toSerialize["currency"] = o.Currency
|
|
}
|
|
if !IsNil(o.End) {
|
|
toSerialize["end"] = o.End
|
|
}
|
|
if !IsNil(o.Interval) {
|
|
toSerialize["interval"] = o.Interval
|
|
}
|
|
if !IsNil(o.Note) {
|
|
toSerialize["note"] = o.Note
|
|
}
|
|
if !IsNil(o.Provider) {
|
|
toSerialize["provider"] = o.Provider
|
|
}
|
|
if !IsNil(o.Series) {
|
|
toSerialize["series"] = o.Series
|
|
}
|
|
if !IsNil(o.Start) {
|
|
toSerialize["start"] = o.Start
|
|
}
|
|
if !IsNil(o.Totals) {
|
|
toSerialize["totals"] = o.Totals
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiProviderUsage) UnmarshalJSON(data []byte) (err error) {
|
|
varAiProviderUsage := _AiProviderUsage{}
|
|
|
|
err = json.Unmarshal(data, &varAiProviderUsage)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiProviderUsage(varAiProviderUsage)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "available")
|
|
delete(additionalProperties, "byModel")
|
|
delete(additionalProperties, "connected")
|
|
delete(additionalProperties, "currency")
|
|
delete(additionalProperties, "end")
|
|
delete(additionalProperties, "interval")
|
|
delete(additionalProperties, "note")
|
|
delete(additionalProperties, "provider")
|
|
delete(additionalProperties, "series")
|
|
delete(additionalProperties, "start")
|
|
delete(additionalProperties, "totals")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiProviderUsage struct {
|
|
value *AiProviderUsage
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiProviderUsage) Get() *AiProviderUsage {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiProviderUsage) Set(val *AiProviderUsage) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiProviderUsage) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiProviderUsage) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiProviderUsage(val *AiProviderUsage) *NullableAiProviderUsage {
|
|
return &NullableAiProviderUsage{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiProviderUsage) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiProviderUsage) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|