mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
342 lines
8.4 KiB
Go
342 lines
8.4 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 AiClass type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &AiClass{}
|
|
|
|
// AiClass struct for AiClass
|
|
type AiClass struct {
|
|
// Paying is plan, prepaid, credits, or none.
|
|
Paying *string `json:"paying,omitempty"`
|
|
Percent *int64 `json:"percent,omitempty"`
|
|
ResetsAt *string `json:"resets_at,omitempty"`
|
|
// State is ok, near, or limited when the class is used up and nothing else pays.
|
|
State *string `json:"state,omitempty"`
|
|
// Unbounded says the plan includes all of this class's use: there is no share to use up, and Percent is 0.
|
|
Unbounded *bool `json:"unbounded,omitempty"`
|
|
Window *AiWindow `json:"window,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _AiClass AiClass
|
|
|
|
// NewAiClass instantiates a new AiClass 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 NewAiClass() *AiClass {
|
|
this := AiClass{}
|
|
return &this
|
|
}
|
|
|
|
// NewAiClassWithDefaults instantiates a new AiClass 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 NewAiClassWithDefaults() *AiClass {
|
|
this := AiClass{}
|
|
return &this
|
|
}
|
|
|
|
// GetPaying returns the Paying field value if set, zero value otherwise.
|
|
func (o *AiClass) GetPaying() string {
|
|
if o == nil || IsNil(o.Paying) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Paying
|
|
}
|
|
|
|
// GetPayingOk returns a tuple with the Paying field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiClass) GetPayingOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Paying) {
|
|
return nil, false
|
|
}
|
|
return o.Paying, true
|
|
}
|
|
|
|
// HasPaying returns a boolean if a field has been set.
|
|
func (o *AiClass) HasPaying() bool {
|
|
if o != nil && !IsNil(o.Paying) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPaying gets a reference to the given string and assigns it to the Paying field.
|
|
func (o *AiClass) SetPaying(v string) {
|
|
o.Paying = &v
|
|
}
|
|
|
|
// GetPercent returns the Percent field value if set, zero value otherwise.
|
|
func (o *AiClass) GetPercent() int64 {
|
|
if o == nil || IsNil(o.Percent) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Percent
|
|
}
|
|
|
|
// GetPercentOk returns a tuple with the Percent field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiClass) GetPercentOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Percent) {
|
|
return nil, false
|
|
}
|
|
return o.Percent, true
|
|
}
|
|
|
|
// HasPercent returns a boolean if a field has been set.
|
|
func (o *AiClass) HasPercent() bool {
|
|
if o != nil && !IsNil(o.Percent) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPercent gets a reference to the given int64 and assigns it to the Percent field.
|
|
func (o *AiClass) SetPercent(v int64) {
|
|
o.Percent = &v
|
|
}
|
|
|
|
// GetResetsAt returns the ResetsAt field value if set, zero value otherwise.
|
|
func (o *AiClass) GetResetsAt() string {
|
|
if o == nil || IsNil(o.ResetsAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.ResetsAt
|
|
}
|
|
|
|
// GetResetsAtOk returns a tuple with the ResetsAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiClass) GetResetsAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.ResetsAt) {
|
|
return nil, false
|
|
}
|
|
return o.ResetsAt, true
|
|
}
|
|
|
|
// HasResetsAt returns a boolean if a field has been set.
|
|
func (o *AiClass) HasResetsAt() bool {
|
|
if o != nil && !IsNil(o.ResetsAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetResetsAt gets a reference to the given string and assigns it to the ResetsAt field.
|
|
func (o *AiClass) SetResetsAt(v string) {
|
|
o.ResetsAt = &v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *AiClass) 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 *AiClass) 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 *AiClass) 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 *AiClass) SetState(v string) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetUnbounded returns the Unbounded field value if set, zero value otherwise.
|
|
func (o *AiClass) GetUnbounded() bool {
|
|
if o == nil || IsNil(o.Unbounded) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Unbounded
|
|
}
|
|
|
|
// GetUnboundedOk returns a tuple with the Unbounded field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiClass) GetUnboundedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Unbounded) {
|
|
return nil, false
|
|
}
|
|
return o.Unbounded, true
|
|
}
|
|
|
|
// HasUnbounded returns a boolean if a field has been set.
|
|
func (o *AiClass) HasUnbounded() bool {
|
|
if o != nil && !IsNil(o.Unbounded) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUnbounded gets a reference to the given bool and assigns it to the Unbounded field.
|
|
func (o *AiClass) SetUnbounded(v bool) {
|
|
o.Unbounded = &v
|
|
}
|
|
|
|
// GetWindow returns the Window field value if set, zero value otherwise.
|
|
func (o *AiClass) GetWindow() AiWindow {
|
|
if o == nil || IsNil(o.Window) {
|
|
var ret AiWindow
|
|
return ret
|
|
}
|
|
return *o.Window
|
|
}
|
|
|
|
// GetWindowOk returns a tuple with the Window field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *AiClass) GetWindowOk() (*AiWindow, bool) {
|
|
if o == nil || IsNil(o.Window) {
|
|
return nil, false
|
|
}
|
|
return o.Window, true
|
|
}
|
|
|
|
// HasWindow returns a boolean if a field has been set.
|
|
func (o *AiClass) HasWindow() bool {
|
|
if o != nil && !IsNil(o.Window) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWindow gets a reference to the given AiWindow and assigns it to the Window field.
|
|
func (o *AiClass) SetWindow(v AiWindow) {
|
|
o.Window = &v
|
|
}
|
|
|
|
func (o AiClass) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o AiClass) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Paying) {
|
|
toSerialize["paying"] = o.Paying
|
|
}
|
|
if !IsNil(o.Percent) {
|
|
toSerialize["percent"] = o.Percent
|
|
}
|
|
if !IsNil(o.ResetsAt) {
|
|
toSerialize["resets_at"] = o.ResetsAt
|
|
}
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.Unbounded) {
|
|
toSerialize["unbounded"] = o.Unbounded
|
|
}
|
|
if !IsNil(o.Window) {
|
|
toSerialize["window"] = o.Window
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *AiClass) UnmarshalJSON(data []byte) (err error) {
|
|
varAiClass := _AiClass{}
|
|
|
|
err = json.Unmarshal(data, &varAiClass)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = AiClass(varAiClass)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "paying")
|
|
delete(additionalProperties, "percent")
|
|
delete(additionalProperties, "resets_at")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "unbounded")
|
|
delete(additionalProperties, "window")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableAiClass struct {
|
|
value *AiClass
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableAiClass) Get() *AiClass {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableAiClass) Set(val *AiClass) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableAiClass) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableAiClass) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableAiClass(val *AiClass) *NullableAiClass {
|
|
return &NullableAiClass{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableAiClass) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableAiClass) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|