Files
sdk/model_ai_limits.go

533 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 AiLimits type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AiLimits{}
// AiLimits struct for AiLimits
type AiLimits struct {
// Actions are the ways on: upgrade, add prepaid credit.
Actions []AiAction `json:"actions,omitempty"`
// Classes are premium (third-party frontier models) and ours (Hanzo's), each present when the plan includes it.
Classes map[string]AiClass `json:"classes,omitempty"`
Day *AiWindow `json:"day,omitempty"`
// Limited is present in limited mode.
Limited *AiLimited `json:"limited,omitempty"`
// Paused are the models whose share of the plan is used for now: each is answered by its fallback in chat until its share resets.
Paused []AiPaused `json:"paused,omitempty"`
PeriodEnd *string `json:"period_end,omitempty"`
// PeriodStart and PeriodEnd bound the month the plan's usage renews over (RFC3339): the billing period, or one month of a yearly one.
PeriodStart *string `json:"period_start,omitempty"`
// Plan is the plan the caller is served as (\"dev\", \"max-5x\", \"max-20x\", \"team\", \"agency\", \"advisory\", \"dedicated\", ...), \"free\" when none counts.
Plan *string `json:"plan,omitempty"`
// Session and Day are the request windows over every request the plan covers.
Session *AiWindow `json:"session,omitempty"`
// State is the worst class's: ok, near or limited.
State *string `json:"state,omitempty"`
// Upgrade is the plan that raises these limits, absent at the top.
Upgrade *string `json:"upgrade,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AiLimits AiLimits
// NewAiLimits instantiates a new AiLimits 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 NewAiLimits() *AiLimits {
this := AiLimits{}
return &this
}
// NewAiLimitsWithDefaults instantiates a new AiLimits 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 NewAiLimitsWithDefaults() *AiLimits {
this := AiLimits{}
return &this
}
// GetActions returns the Actions field value if set, zero value otherwise.
func (o *AiLimits) GetActions() []AiAction {
if o == nil || IsNil(o.Actions) {
var ret []AiAction
return ret
}
return o.Actions
}
// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetActionsOk() ([]AiAction, bool) {
if o == nil || IsNil(o.Actions) {
return nil, false
}
return o.Actions, true
}
// HasActions returns a boolean if a field has been set.
func (o *AiLimits) HasActions() bool {
if o != nil && !IsNil(o.Actions) {
return true
}
return false
}
// SetActions gets a reference to the given []AiAction and assigns it to the Actions field.
func (o *AiLimits) SetActions(v []AiAction) {
o.Actions = v
}
// GetClasses returns the Classes field value if set, zero value otherwise.
func (o *AiLimits) GetClasses() map[string]AiClass {
if o == nil || IsNil(o.Classes) {
var ret map[string]AiClass
return ret
}
return o.Classes
}
// GetClassesOk returns a tuple with the Classes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetClassesOk() (map[string]AiClass, bool) {
if o == nil || IsNil(o.Classes) {
return map[string]AiClass{}, false
}
return o.Classes, true
}
// HasClasses returns a boolean if a field has been set.
func (o *AiLimits) HasClasses() bool {
if o != nil && !IsNil(o.Classes) {
return true
}
return false
}
// SetClasses gets a reference to the given map[string]AiClass and assigns it to the Classes field.
func (o *AiLimits) SetClasses(v map[string]AiClass) {
o.Classes = v
}
// GetDay returns the Day field value if set, zero value otherwise.
func (o *AiLimits) GetDay() AiWindow {
if o == nil || IsNil(o.Day) {
var ret AiWindow
return ret
}
return *o.Day
}
// GetDayOk returns a tuple with the Day field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetDayOk() (*AiWindow, bool) {
if o == nil || IsNil(o.Day) {
return nil, false
}
return o.Day, true
}
// HasDay returns a boolean if a field has been set.
func (o *AiLimits) HasDay() bool {
if o != nil && !IsNil(o.Day) {
return true
}
return false
}
// SetDay gets a reference to the given AiWindow and assigns it to the Day field.
func (o *AiLimits) SetDay(v AiWindow) {
o.Day = &v
}
// GetLimited returns the Limited field value if set, zero value otherwise.
func (o *AiLimits) GetLimited() AiLimited {
if o == nil || IsNil(o.Limited) {
var ret AiLimited
return ret
}
return *o.Limited
}
// GetLimitedOk returns a tuple with the Limited field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetLimitedOk() (*AiLimited, bool) {
if o == nil || IsNil(o.Limited) {
return nil, false
}
return o.Limited, true
}
// HasLimited returns a boolean if a field has been set.
func (o *AiLimits) HasLimited() bool {
if o != nil && !IsNil(o.Limited) {
return true
}
return false
}
// SetLimited gets a reference to the given AiLimited and assigns it to the Limited field.
func (o *AiLimits) SetLimited(v AiLimited) {
o.Limited = &v
}
// GetPaused returns the Paused field value if set, zero value otherwise.
func (o *AiLimits) GetPaused() []AiPaused {
if o == nil || IsNil(o.Paused) {
var ret []AiPaused
return ret
}
return o.Paused
}
// GetPausedOk returns a tuple with the Paused field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetPausedOk() ([]AiPaused, bool) {
if o == nil || IsNil(o.Paused) {
return nil, false
}
return o.Paused, true
}
// HasPaused returns a boolean if a field has been set.
func (o *AiLimits) HasPaused() bool {
if o != nil && !IsNil(o.Paused) {
return true
}
return false
}
// SetPaused gets a reference to the given []AiPaused and assigns it to the Paused field.
func (o *AiLimits) SetPaused(v []AiPaused) {
o.Paused = v
}
// GetPeriodEnd returns the PeriodEnd field value if set, zero value otherwise.
func (o *AiLimits) GetPeriodEnd() string {
if o == nil || IsNil(o.PeriodEnd) {
var ret string
return ret
}
return *o.PeriodEnd
}
// GetPeriodEndOk returns a tuple with the PeriodEnd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetPeriodEndOk() (*string, bool) {
if o == nil || IsNil(o.PeriodEnd) {
return nil, false
}
return o.PeriodEnd, true
}
// HasPeriodEnd returns a boolean if a field has been set.
func (o *AiLimits) HasPeriodEnd() bool {
if o != nil && !IsNil(o.PeriodEnd) {
return true
}
return false
}
// SetPeriodEnd gets a reference to the given string and assigns it to the PeriodEnd field.
func (o *AiLimits) SetPeriodEnd(v string) {
o.PeriodEnd = &v
}
// GetPeriodStart returns the PeriodStart field value if set, zero value otherwise.
func (o *AiLimits) GetPeriodStart() string {
if o == nil || IsNil(o.PeriodStart) {
var ret string
return ret
}
return *o.PeriodStart
}
// GetPeriodStartOk returns a tuple with the PeriodStart field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetPeriodStartOk() (*string, bool) {
if o == nil || IsNil(o.PeriodStart) {
return nil, false
}
return o.PeriodStart, true
}
// HasPeriodStart returns a boolean if a field has been set.
func (o *AiLimits) HasPeriodStart() bool {
if o != nil && !IsNil(o.PeriodStart) {
return true
}
return false
}
// SetPeriodStart gets a reference to the given string and assigns it to the PeriodStart field.
func (o *AiLimits) SetPeriodStart(v string) {
o.PeriodStart = &v
}
// GetPlan returns the Plan field value if set, zero value otherwise.
func (o *AiLimits) GetPlan() string {
if o == nil || IsNil(o.Plan) {
var ret string
return ret
}
return *o.Plan
}
// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetPlanOk() (*string, bool) {
if o == nil || IsNil(o.Plan) {
return nil, false
}
return o.Plan, true
}
// HasPlan returns a boolean if a field has been set.
func (o *AiLimits) HasPlan() bool {
if o != nil && !IsNil(o.Plan) {
return true
}
return false
}
// SetPlan gets a reference to the given string and assigns it to the Plan field.
func (o *AiLimits) SetPlan(v string) {
o.Plan = &v
}
// GetSession returns the Session field value if set, zero value otherwise.
func (o *AiLimits) GetSession() AiWindow {
if o == nil || IsNil(o.Session) {
var ret AiWindow
return ret
}
return *o.Session
}
// GetSessionOk returns a tuple with the Session field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetSessionOk() (*AiWindow, bool) {
if o == nil || IsNil(o.Session) {
return nil, false
}
return o.Session, true
}
// HasSession returns a boolean if a field has been set.
func (o *AiLimits) HasSession() bool {
if o != nil && !IsNil(o.Session) {
return true
}
return false
}
// SetSession gets a reference to the given AiWindow and assigns it to the Session field.
func (o *AiLimits) SetSession(v AiWindow) {
o.Session = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *AiLimits) GetState() string {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetStateOk() (*string, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *AiLimits) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *AiLimits) SetState(v string) {
o.State = &v
}
// GetUpgrade returns the Upgrade field value if set, zero value otherwise.
func (o *AiLimits) GetUpgrade() string {
if o == nil || IsNil(o.Upgrade) {
var ret string
return ret
}
return *o.Upgrade
}
// GetUpgradeOk returns a tuple with the Upgrade field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AiLimits) GetUpgradeOk() (*string, bool) {
if o == nil || IsNil(o.Upgrade) {
return nil, false
}
return o.Upgrade, true
}
// HasUpgrade returns a boolean if a field has been set.
func (o *AiLimits) HasUpgrade() bool {
if o != nil && !IsNil(o.Upgrade) {
return true
}
return false
}
// SetUpgrade gets a reference to the given string and assigns it to the Upgrade field.
func (o *AiLimits) SetUpgrade(v string) {
o.Upgrade = &v
}
func (o AiLimits) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AiLimits) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Actions) {
toSerialize["actions"] = o.Actions
}
if !IsNil(o.Classes) {
toSerialize["classes"] = o.Classes
}
if !IsNil(o.Day) {
toSerialize["day"] = o.Day
}
if !IsNil(o.Limited) {
toSerialize["limited"] = o.Limited
}
if !IsNil(o.Paused) {
toSerialize["paused"] = o.Paused
}
if !IsNil(o.PeriodEnd) {
toSerialize["period_end"] = o.PeriodEnd
}
if !IsNil(o.PeriodStart) {
toSerialize["period_start"] = o.PeriodStart
}
if !IsNil(o.Plan) {
toSerialize["plan"] = o.Plan
}
if !IsNil(o.Session) {
toSerialize["session"] = o.Session
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Upgrade) {
toSerialize["upgrade"] = o.Upgrade
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AiLimits) UnmarshalJSON(data []byte) (err error) {
varAiLimits := _AiLimits{}
err = json.Unmarshal(data, &varAiLimits)
if err != nil {
return err
}
*o = AiLimits(varAiLimits)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "actions")
delete(additionalProperties, "classes")
delete(additionalProperties, "day")
delete(additionalProperties, "limited")
delete(additionalProperties, "paused")
delete(additionalProperties, "period_end")
delete(additionalProperties, "period_start")
delete(additionalProperties, "plan")
delete(additionalProperties, "session")
delete(additionalProperties, "state")
delete(additionalProperties, "upgrade")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAiLimits struct {
value *AiLimits
isSet bool
}
func (v NullableAiLimits) Get() *AiLimits {
return v.value
}
func (v *NullableAiLimits) Set(val *AiLimits) {
v.value = val
v.isSet = true
}
func (v NullableAiLimits) IsSet() bool {
return v.isSet
}
func (v *NullableAiLimits) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAiLimits(val *AiLimits) *NullableAiLimits {
return &NullableAiLimits{value: val, isSet: true}
}
func (v NullableAiLimits) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAiLimits) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}