Files
sdk/model_flag_platform_out.go

155 lines
4.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 FlagPlatformOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlagPlatformOut{}
// FlagPlatformOut struct for FlagPlatformOut
type FlagPlatformOut struct {
// Flags maps each principal switch's key to whether it is on for the caller: `beta` is whether the caller sees products and catalog items that are not yet generally available, and beta.<id> whether they see that one app in beta in the Hanzo app.
Flags map[string]bool `json:"flags,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FlagPlatformOut FlagPlatformOut
// NewFlagPlatformOut instantiates a new FlagPlatformOut 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 NewFlagPlatformOut() *FlagPlatformOut {
this := FlagPlatformOut{}
return &this
}
// NewFlagPlatformOutWithDefaults instantiates a new FlagPlatformOut 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 NewFlagPlatformOutWithDefaults() *FlagPlatformOut {
this := FlagPlatformOut{}
return &this
}
// GetFlags returns the Flags field value if set, zero value otherwise.
func (o *FlagPlatformOut) GetFlags() map[string]bool {
if o == nil || IsNil(o.Flags) {
var ret map[string]bool
return ret
}
return o.Flags
}
// GetFlagsOk returns a tuple with the Flags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagPlatformOut) GetFlagsOk() (map[string]bool, bool) {
if o == nil || IsNil(o.Flags) {
return map[string]bool{}, false
}
return o.Flags, true
}
// HasFlags returns a boolean if a field has been set.
func (o *FlagPlatformOut) HasFlags() bool {
if o != nil && !IsNil(o.Flags) {
return true
}
return false
}
// SetFlags gets a reference to the given map[string]bool and assigns it to the Flags field.
func (o *FlagPlatformOut) SetFlags(v map[string]bool) {
o.Flags = v
}
func (o FlagPlatformOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlagPlatformOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Flags) {
toSerialize["flags"] = o.Flags
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FlagPlatformOut) UnmarshalJSON(data []byte) (err error) {
varFlagPlatformOut := _FlagPlatformOut{}
err = json.Unmarshal(data, &varFlagPlatformOut)
if err != nil {
return err
}
*o = FlagPlatformOut(varFlagPlatformOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "flags")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFlagPlatformOut struct {
value *FlagPlatformOut
isSet bool
}
func (v NullableFlagPlatformOut) Get() *FlagPlatformOut {
return v.value
}
func (v *NullableFlagPlatformOut) Set(val *FlagPlatformOut) {
v.value = val
v.isSet = true
}
func (v NullableFlagPlatformOut) IsSet() bool {
return v.isSet
}
func (v *NullableFlagPlatformOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFlagPlatformOut(val *FlagPlatformOut) *NullableFlagPlatformOut {
return &NullableFlagPlatformOut{value: val, isSet: true}
}
func (v NullableFlagPlatformOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFlagPlatformOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}