mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
339 lines
8.1 KiB
Go
339 lines
8.1 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 Decision type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Decision{}
|
|
|
|
// Decision struct for Decision
|
|
type Decision struct {
|
|
Defaults *Grants `json:"defaults,omitempty"`
|
|
Floor *int32 `json:"floor,omitempty"`
|
|
Mode *string `json:"mode,omitempty"`
|
|
Refused *bool `json:"refused,omitempty"`
|
|
Region *string `json:"region,omitempty"`
|
|
Version *int32 `json:"version,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Decision Decision
|
|
|
|
// NewDecision instantiates a new Decision 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 NewDecision() *Decision {
|
|
this := Decision{}
|
|
return &this
|
|
}
|
|
|
|
// NewDecisionWithDefaults instantiates a new Decision 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 NewDecisionWithDefaults() *Decision {
|
|
this := Decision{}
|
|
return &this
|
|
}
|
|
|
|
// GetDefaults returns the Defaults field value if set, zero value otherwise.
|
|
func (o *Decision) GetDefaults() Grants {
|
|
if o == nil || IsNil(o.Defaults) {
|
|
var ret Grants
|
|
return ret
|
|
}
|
|
return *o.Defaults
|
|
}
|
|
|
|
// GetDefaultsOk returns a tuple with the Defaults field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Decision) GetDefaultsOk() (*Grants, bool) {
|
|
if o == nil || IsNil(o.Defaults) {
|
|
return nil, false
|
|
}
|
|
return o.Defaults, true
|
|
}
|
|
|
|
// HasDefaults returns a boolean if a field has been set.
|
|
func (o *Decision) HasDefaults() bool {
|
|
if o != nil && !IsNil(o.Defaults) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDefaults gets a reference to the given Grants and assigns it to the Defaults field.
|
|
func (o *Decision) SetDefaults(v Grants) {
|
|
o.Defaults = &v
|
|
}
|
|
|
|
// GetFloor returns the Floor field value if set, zero value otherwise.
|
|
func (o *Decision) GetFloor() int32 {
|
|
if o == nil || IsNil(o.Floor) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Floor
|
|
}
|
|
|
|
// GetFloorOk returns a tuple with the Floor field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Decision) GetFloorOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Floor) {
|
|
return nil, false
|
|
}
|
|
return o.Floor, true
|
|
}
|
|
|
|
// HasFloor returns a boolean if a field has been set.
|
|
func (o *Decision) HasFloor() bool {
|
|
if o != nil && !IsNil(o.Floor) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFloor gets a reference to the given int32 and assigns it to the Floor field.
|
|
func (o *Decision) SetFloor(v int32) {
|
|
o.Floor = &v
|
|
}
|
|
|
|
// GetMode returns the Mode field value if set, zero value otherwise.
|
|
func (o *Decision) GetMode() string {
|
|
if o == nil || IsNil(o.Mode) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Mode
|
|
}
|
|
|
|
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Decision) GetModeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Mode) {
|
|
return nil, false
|
|
}
|
|
return o.Mode, true
|
|
}
|
|
|
|
// HasMode returns a boolean if a field has been set.
|
|
func (o *Decision) HasMode() bool {
|
|
if o != nil && !IsNil(o.Mode) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMode gets a reference to the given string and assigns it to the Mode field.
|
|
func (o *Decision) SetMode(v string) {
|
|
o.Mode = &v
|
|
}
|
|
|
|
// GetRefused returns the Refused field value if set, zero value otherwise.
|
|
func (o *Decision) GetRefused() bool {
|
|
if o == nil || IsNil(o.Refused) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Refused
|
|
}
|
|
|
|
// GetRefusedOk returns a tuple with the Refused field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Decision) GetRefusedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Refused) {
|
|
return nil, false
|
|
}
|
|
return o.Refused, true
|
|
}
|
|
|
|
// HasRefused returns a boolean if a field has been set.
|
|
func (o *Decision) HasRefused() bool {
|
|
if o != nil && !IsNil(o.Refused) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRefused gets a reference to the given bool and assigns it to the Refused field.
|
|
func (o *Decision) SetRefused(v bool) {
|
|
o.Refused = &v
|
|
}
|
|
|
|
// GetRegion returns the Region field value if set, zero value otherwise.
|
|
func (o *Decision) GetRegion() string {
|
|
if o == nil || IsNil(o.Region) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Region
|
|
}
|
|
|
|
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Decision) GetRegionOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Region) {
|
|
return nil, false
|
|
}
|
|
return o.Region, true
|
|
}
|
|
|
|
// HasRegion returns a boolean if a field has been set.
|
|
func (o *Decision) HasRegion() bool {
|
|
if o != nil && !IsNil(o.Region) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRegion gets a reference to the given string and assigns it to the Region field.
|
|
func (o *Decision) SetRegion(v string) {
|
|
o.Region = &v
|
|
}
|
|
|
|
// GetVersion returns the Version field value if set, zero value otherwise.
|
|
func (o *Decision) GetVersion() int32 {
|
|
if o == nil || IsNil(o.Version) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.Version
|
|
}
|
|
|
|
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Decision) GetVersionOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.Version) {
|
|
return nil, false
|
|
}
|
|
return o.Version, true
|
|
}
|
|
|
|
// HasVersion returns a boolean if a field has been set.
|
|
func (o *Decision) HasVersion() bool {
|
|
if o != nil && !IsNil(o.Version) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVersion gets a reference to the given int32 and assigns it to the Version field.
|
|
func (o *Decision) SetVersion(v int32) {
|
|
o.Version = &v
|
|
}
|
|
|
|
func (o Decision) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Decision) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Defaults) {
|
|
toSerialize["defaults"] = o.Defaults
|
|
}
|
|
if !IsNil(o.Floor) {
|
|
toSerialize["floor"] = o.Floor
|
|
}
|
|
if !IsNil(o.Mode) {
|
|
toSerialize["mode"] = o.Mode
|
|
}
|
|
if !IsNil(o.Refused) {
|
|
toSerialize["refused"] = o.Refused
|
|
}
|
|
if !IsNil(o.Region) {
|
|
toSerialize["region"] = o.Region
|
|
}
|
|
if !IsNil(o.Version) {
|
|
toSerialize["version"] = o.Version
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Decision) UnmarshalJSON(data []byte) (err error) {
|
|
varDecision := _Decision{}
|
|
|
|
err = json.Unmarshal(data, &varDecision)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Decision(varDecision)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "defaults")
|
|
delete(additionalProperties, "floor")
|
|
delete(additionalProperties, "mode")
|
|
delete(additionalProperties, "refused")
|
|
delete(additionalProperties, "region")
|
|
delete(additionalProperties, "version")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableDecision struct {
|
|
value *Decision
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableDecision) Get() *Decision {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableDecision) Set(val *Decision) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableDecision) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableDecision) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableDecision(val *Decision) *NullableDecision {
|
|
return &NullableDecision{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableDecision) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableDecision) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|