Files
sdk/model_flag_optin_out.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 FlagOptinOut type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlagOptinOut{}
// FlagOptinOut struct for FlagOptinOut
type FlagOptinOut struct {
// Blocked is true when the org the caller acts in turned the opt-in off for its members. Their own choice is kept and applies again once unblocked.
Blocked *bool `json:"blocked,omitempty"`
// On is true when the caller opted in: every public beta, and each one promoted later, is on for them unless Blocked.
On *bool `json:"on,omitempty"`
// Public is the id of every beta anyone may opt in to (beta.<id>). The rest are private: a SuperAdmin grants them, person by person.
Public []string `json:"public,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FlagOptinOut FlagOptinOut
// NewFlagOptinOut instantiates a new FlagOptinOut 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 NewFlagOptinOut() *FlagOptinOut {
this := FlagOptinOut{}
return &this
}
// NewFlagOptinOutWithDefaults instantiates a new FlagOptinOut 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 NewFlagOptinOutWithDefaults() *FlagOptinOut {
this := FlagOptinOut{}
return &this
}
// GetBlocked returns the Blocked field value if set, zero value otherwise.
func (o *FlagOptinOut) GetBlocked() bool {
if o == nil || IsNil(o.Blocked) {
var ret bool
return ret
}
return *o.Blocked
}
// GetBlockedOk returns a tuple with the Blocked field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagOptinOut) GetBlockedOk() (*bool, bool) {
if o == nil || IsNil(o.Blocked) {
return nil, false
}
return o.Blocked, true
}
// HasBlocked returns a boolean if a field has been set.
func (o *FlagOptinOut) HasBlocked() bool {
if o != nil && !IsNil(o.Blocked) {
return true
}
return false
}
// SetBlocked gets a reference to the given bool and assigns it to the Blocked field.
func (o *FlagOptinOut) SetBlocked(v bool) {
o.Blocked = &v
}
// GetOn returns the On field value if set, zero value otherwise.
func (o *FlagOptinOut) GetOn() bool {
if o == nil || IsNil(o.On) {
var ret bool
return ret
}
return *o.On
}
// GetOnOk returns a tuple with the On field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagOptinOut) GetOnOk() (*bool, bool) {
if o == nil || IsNil(o.On) {
return nil, false
}
return o.On, true
}
// HasOn returns a boolean if a field has been set.
func (o *FlagOptinOut) HasOn() bool {
if o != nil && !IsNil(o.On) {
return true
}
return false
}
// SetOn gets a reference to the given bool and assigns it to the On field.
func (o *FlagOptinOut) SetOn(v bool) {
o.On = &v
}
// GetPublic returns the Public field value if set, zero value otherwise.
func (o *FlagOptinOut) GetPublic() []string {
if o == nil || IsNil(o.Public) {
var ret []string
return ret
}
return o.Public
}
// GetPublicOk returns a tuple with the Public field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagOptinOut) GetPublicOk() ([]string, bool) {
if o == nil || IsNil(o.Public) {
return nil, false
}
return o.Public, true
}
// HasPublic returns a boolean if a field has been set.
func (o *FlagOptinOut) HasPublic() bool {
if o != nil && !IsNil(o.Public) {
return true
}
return false
}
// SetPublic gets a reference to the given []string and assigns it to the Public field.
func (o *FlagOptinOut) SetPublic(v []string) {
o.Public = v
}
func (o FlagOptinOut) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlagOptinOut) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Blocked) {
toSerialize["blocked"] = o.Blocked
}
if !IsNil(o.On) {
toSerialize["on"] = o.On
}
if !IsNil(o.Public) {
toSerialize["public"] = o.Public
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FlagOptinOut) UnmarshalJSON(data []byte) (err error) {
varFlagOptinOut := _FlagOptinOut{}
err = json.Unmarshal(data, &varFlagOptinOut)
if err != nil {
return err
}
*o = FlagOptinOut(varFlagOptinOut)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "blocked")
delete(additionalProperties, "on")
delete(additionalProperties, "public")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFlagOptinOut struct {
value *FlagOptinOut
isSet bool
}
func (v NullableFlagOptinOut) Get() *FlagOptinOut {
return v.value
}
func (v *NullableFlagOptinOut) Set(val *FlagOptinOut) {
v.value = val
v.isSet = true
}
func (v NullableFlagOptinOut) IsSet() bool {
return v.isSet
}
func (v *NullableFlagOptinOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFlagOptinOut(val *FlagOptinOut) *NullableFlagOptinOut {
return &NullableFlagOptinOut{value: val, isSet: true}
}
func (v NullableFlagOptinOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFlagOptinOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}