mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.9 KiB
Go
231 lines
5.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 WorldLimitsView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &WorldLimitsView{}
|
|
|
|
// WorldLimitsView struct for WorldLimitsView
|
|
type WorldLimitsView struct {
|
|
// Limits is the plan's decision.
|
|
Limits *WorldLimitsBlock `json:"limits,omitempty"`
|
|
// Plan echoes the plan id the limits were resolved for, after the empty-means- world-free default.
|
|
Plan *string `json:"plan,omitempty"`
|
|
// Unit names what the two rate numbers are counted in: requests/minute.
|
|
Unit *string `json:"unit,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _WorldLimitsView WorldLimitsView
|
|
|
|
// NewWorldLimitsView instantiates a new WorldLimitsView 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 NewWorldLimitsView() *WorldLimitsView {
|
|
this := WorldLimitsView{}
|
|
return &this
|
|
}
|
|
|
|
// NewWorldLimitsViewWithDefaults instantiates a new WorldLimitsView 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 NewWorldLimitsViewWithDefaults() *WorldLimitsView {
|
|
this := WorldLimitsView{}
|
|
return &this
|
|
}
|
|
|
|
// GetLimits returns the Limits field value if set, zero value otherwise.
|
|
func (o *WorldLimitsView) GetLimits() WorldLimitsBlock {
|
|
if o == nil || IsNil(o.Limits) {
|
|
var ret WorldLimitsBlock
|
|
return ret
|
|
}
|
|
return *o.Limits
|
|
}
|
|
|
|
// GetLimitsOk returns a tuple with the Limits field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WorldLimitsView) GetLimitsOk() (*WorldLimitsBlock, bool) {
|
|
if o == nil || IsNil(o.Limits) {
|
|
return nil, false
|
|
}
|
|
return o.Limits, true
|
|
}
|
|
|
|
// HasLimits returns a boolean if a field has been set.
|
|
func (o *WorldLimitsView) HasLimits() bool {
|
|
if o != nil && !IsNil(o.Limits) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLimits gets a reference to the given WorldLimitsBlock and assigns it to the Limits field.
|
|
func (o *WorldLimitsView) SetLimits(v WorldLimitsBlock) {
|
|
o.Limits = &v
|
|
}
|
|
|
|
// GetPlan returns the Plan field value if set, zero value otherwise.
|
|
func (o *WorldLimitsView) 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 *WorldLimitsView) 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 *WorldLimitsView) 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 *WorldLimitsView) SetPlan(v string) {
|
|
o.Plan = &v
|
|
}
|
|
|
|
// GetUnit returns the Unit field value if set, zero value otherwise.
|
|
func (o *WorldLimitsView) GetUnit() string {
|
|
if o == nil || IsNil(o.Unit) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Unit
|
|
}
|
|
|
|
// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *WorldLimitsView) GetUnitOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Unit) {
|
|
return nil, false
|
|
}
|
|
return o.Unit, true
|
|
}
|
|
|
|
// HasUnit returns a boolean if a field has been set.
|
|
func (o *WorldLimitsView) HasUnit() bool {
|
|
if o != nil && !IsNil(o.Unit) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUnit gets a reference to the given string and assigns it to the Unit field.
|
|
func (o *WorldLimitsView) SetUnit(v string) {
|
|
o.Unit = &v
|
|
}
|
|
|
|
func (o WorldLimitsView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o WorldLimitsView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Limits) {
|
|
toSerialize["limits"] = o.Limits
|
|
}
|
|
if !IsNil(o.Plan) {
|
|
toSerialize["plan"] = o.Plan
|
|
}
|
|
if !IsNil(o.Unit) {
|
|
toSerialize["unit"] = o.Unit
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *WorldLimitsView) UnmarshalJSON(data []byte) (err error) {
|
|
varWorldLimitsView := _WorldLimitsView{}
|
|
|
|
err = json.Unmarshal(data, &varWorldLimitsView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = WorldLimitsView(varWorldLimitsView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "limits")
|
|
delete(additionalProperties, "plan")
|
|
delete(additionalProperties, "unit")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableWorldLimitsView struct {
|
|
value *WorldLimitsView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableWorldLimitsView) Get() *WorldLimitsView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableWorldLimitsView) Set(val *WorldLimitsView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableWorldLimitsView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableWorldLimitsView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableWorldLimitsView(val *WorldLimitsView) *NullableWorldLimitsView {
|
|
return &NullableWorldLimitsView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableWorldLimitsView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableWorldLimitsView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|