/* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) API version: 1.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package openapi import ( "encoding/json" ) // checks if the SchemaPrivilegeOption type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SchemaPrivilegeOption{} // SchemaPrivilegeOption struct for SchemaPrivilegeOption type SchemaPrivilegeOption struct { Level *SchemaPrivilegeLevel `json:"level,omitempty"` LevelDesc *string `json:"level_desc,omitempty"` Privileges []ConstantPrivilege `json:"privileges,omitempty"` } // NewSchemaPrivilegeOption instantiates a new SchemaPrivilegeOption 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 NewSchemaPrivilegeOption() *SchemaPrivilegeOption { this := SchemaPrivilegeOption{} return &this } // NewSchemaPrivilegeOptionWithDefaults instantiates a new SchemaPrivilegeOption 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 NewSchemaPrivilegeOptionWithDefaults() *SchemaPrivilegeOption { this := SchemaPrivilegeOption{} return &this } // GetLevel returns the Level field value if set, zero value otherwise. func (o *SchemaPrivilegeOption) GetLevel() SchemaPrivilegeLevel { if o == nil || IsNil(o.Level) { var ret SchemaPrivilegeLevel return ret } return *o.Level } // GetLevelOk returns a tuple with the Level field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SchemaPrivilegeOption) GetLevelOk() (*SchemaPrivilegeLevel, bool) { if o == nil || IsNil(o.Level) { return nil, false } return o.Level, true } // HasLevel returns a boolean if a field has been set. func (o *SchemaPrivilegeOption) HasLevel() bool { if o != nil && !IsNil(o.Level) { return true } return false } // SetLevel gets a reference to the given SchemaPrivilegeLevel and assigns it to the Level field. func (o *SchemaPrivilegeOption) SetLevel(v SchemaPrivilegeLevel) { o.Level = &v } // GetLevelDesc returns the LevelDesc field value if set, zero value otherwise. func (o *SchemaPrivilegeOption) GetLevelDesc() string { if o == nil || IsNil(o.LevelDesc) { var ret string return ret } return *o.LevelDesc } // GetLevelDescOk returns a tuple with the LevelDesc field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SchemaPrivilegeOption) GetLevelDescOk() (*string, bool) { if o == nil || IsNil(o.LevelDesc) { return nil, false } return o.LevelDesc, true } // HasLevelDesc returns a boolean if a field has been set. func (o *SchemaPrivilegeOption) HasLevelDesc() bool { if o != nil && !IsNil(o.LevelDesc) { return true } return false } // SetLevelDesc gets a reference to the given string and assigns it to the LevelDesc field. func (o *SchemaPrivilegeOption) SetLevelDesc(v string) { o.LevelDesc = &v } // GetPrivileges returns the Privileges field value if set, zero value otherwise. func (o *SchemaPrivilegeOption) GetPrivileges() []ConstantPrivilege { if o == nil || IsNil(o.Privileges) { var ret []ConstantPrivilege return ret } return o.Privileges } // GetPrivilegesOk returns a tuple with the Privileges field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SchemaPrivilegeOption) GetPrivilegesOk() ([]ConstantPrivilege, bool) { if o == nil || IsNil(o.Privileges) { return nil, false } return o.Privileges, true } // HasPrivileges returns a boolean if a field has been set. func (o *SchemaPrivilegeOption) HasPrivileges() bool { if o != nil && !IsNil(o.Privileges) { return true } return false } // SetPrivileges gets a reference to the given []ConstantPrivilege and assigns it to the Privileges field. func (o *SchemaPrivilegeOption) SetPrivileges(v []ConstantPrivilege) { o.Privileges = v } func (o SchemaPrivilegeOption) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o SchemaPrivilegeOption) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Level) { toSerialize["level"] = o.Level } if !IsNil(o.LevelDesc) { toSerialize["level_desc"] = o.LevelDesc } if !IsNil(o.Privileges) { toSerialize["privileges"] = o.Privileges } return toSerialize, nil } type NullableSchemaPrivilegeOption struct { value *SchemaPrivilegeOption isSet bool } func (v NullableSchemaPrivilegeOption) Get() *SchemaPrivilegeOption { return v.value } func (v *NullableSchemaPrivilegeOption) Set(val *SchemaPrivilegeOption) { v.value = val v.isSet = true } func (v NullableSchemaPrivilegeOption) IsSet() bool { return v.isSet } func (v *NullableSchemaPrivilegeOption) Unset() { v.value = nil v.isSet = false } func NewNullableSchemaPrivilegeOption(val *SchemaPrivilegeOption) *NullableSchemaPrivilegeOption { return &NullableSchemaPrivilegeOption{value: val, isSet: true} } func (v NullableSchemaPrivilegeOption) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableSchemaPrivilegeOption) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }