/*
Mender API

Combined API specification for the features of the different Mender backend services, suitable for code generation applications 

API version: 1
Contact: support@mender.io
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package client

import (
	"encoding/json"
)

// checks if the Features type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Features{}

// Features Features descriptor.
type Features struct {
	Rbac *bool `json:"rbac,omitempty"`
	AuditLogs *bool `json:"audit_logs,omitempty"`
	DynamicGroups *bool `json:"dynamic_groups,omitempty"`
	Terminal *bool `json:"terminal,omitempty"`
	FileTransfer *bool `json:"file_transfer,omitempty"`
	Configuration *bool `json:"configuration,omitempty"`
	Monitoring *bool `json:"monitoring,omitempty"`
	Reporting *bool `json:"reporting,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _Features Features

// NewFeatures instantiates a new Features 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 NewFeatures() *Features {
	this := Features{}
	return &this
}

// NewFeaturesWithDefaults instantiates a new Features 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 NewFeaturesWithDefaults() *Features {
	this := Features{}
	return &this
}

// GetRbac returns the Rbac field value if set, zero value otherwise.
func (o *Features) GetRbac() bool {
	if o == nil || IsNil(o.Rbac) {
		var ret bool
		return ret
	}
	return *o.Rbac
}

// GetRbacOk returns a tuple with the Rbac field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetRbacOk() (*bool, bool) {
	if o == nil || IsNil(o.Rbac) {
		return nil, false
	}
	return o.Rbac, true
}

// HasRbac returns a boolean if a field has been set.
func (o *Features) HasRbac() bool {
	if o != nil && !IsNil(o.Rbac) {
		return true
	}

	return false
}

// SetRbac gets a reference to the given bool and assigns it to the Rbac field.
func (o *Features) SetRbac(v bool) {
	o.Rbac = &v
}

// GetAuditLogs returns the AuditLogs field value if set, zero value otherwise.
func (o *Features) GetAuditLogs() bool {
	if o == nil || IsNil(o.AuditLogs) {
		var ret bool
		return ret
	}
	return *o.AuditLogs
}

// GetAuditLogsOk returns a tuple with the AuditLogs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetAuditLogsOk() (*bool, bool) {
	if o == nil || IsNil(o.AuditLogs) {
		return nil, false
	}
	return o.AuditLogs, true
}

// HasAuditLogs returns a boolean if a field has been set.
func (o *Features) HasAuditLogs() bool {
	if o != nil && !IsNil(o.AuditLogs) {
		return true
	}

	return false
}

// SetAuditLogs gets a reference to the given bool and assigns it to the AuditLogs field.
func (o *Features) SetAuditLogs(v bool) {
	o.AuditLogs = &v
}

// GetDynamicGroups returns the DynamicGroups field value if set, zero value otherwise.
func (o *Features) GetDynamicGroups() bool {
	if o == nil || IsNil(o.DynamicGroups) {
		var ret bool
		return ret
	}
	return *o.DynamicGroups
}

// GetDynamicGroupsOk returns a tuple with the DynamicGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetDynamicGroupsOk() (*bool, bool) {
	if o == nil || IsNil(o.DynamicGroups) {
		return nil, false
	}
	return o.DynamicGroups, true
}

// HasDynamicGroups returns a boolean if a field has been set.
func (o *Features) HasDynamicGroups() bool {
	if o != nil && !IsNil(o.DynamicGroups) {
		return true
	}

	return false
}

// SetDynamicGroups gets a reference to the given bool and assigns it to the DynamicGroups field.
func (o *Features) SetDynamicGroups(v bool) {
	o.DynamicGroups = &v
}

// GetTerminal returns the Terminal field value if set, zero value otherwise.
func (o *Features) GetTerminal() bool {
	if o == nil || IsNil(o.Terminal) {
		var ret bool
		return ret
	}
	return *o.Terminal
}

// GetTerminalOk returns a tuple with the Terminal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetTerminalOk() (*bool, bool) {
	if o == nil || IsNil(o.Terminal) {
		return nil, false
	}
	return o.Terminal, true
}

// HasTerminal returns a boolean if a field has been set.
func (o *Features) HasTerminal() bool {
	if o != nil && !IsNil(o.Terminal) {
		return true
	}

	return false
}

// SetTerminal gets a reference to the given bool and assigns it to the Terminal field.
func (o *Features) SetTerminal(v bool) {
	o.Terminal = &v
}

// GetFileTransfer returns the FileTransfer field value if set, zero value otherwise.
func (o *Features) GetFileTransfer() bool {
	if o == nil || IsNil(o.FileTransfer) {
		var ret bool
		return ret
	}
	return *o.FileTransfer
}

// GetFileTransferOk returns a tuple with the FileTransfer field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetFileTransferOk() (*bool, bool) {
	if o == nil || IsNil(o.FileTransfer) {
		return nil, false
	}
	return o.FileTransfer, true
}

// HasFileTransfer returns a boolean if a field has been set.
func (o *Features) HasFileTransfer() bool {
	if o != nil && !IsNil(o.FileTransfer) {
		return true
	}

	return false
}

// SetFileTransfer gets a reference to the given bool and assigns it to the FileTransfer field.
func (o *Features) SetFileTransfer(v bool) {
	o.FileTransfer = &v
}

// GetConfiguration returns the Configuration field value if set, zero value otherwise.
func (o *Features) GetConfiguration() bool {
	if o == nil || IsNil(o.Configuration) {
		var ret bool
		return ret
	}
	return *o.Configuration
}

// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetConfigurationOk() (*bool, bool) {
	if o == nil || IsNil(o.Configuration) {
		return nil, false
	}
	return o.Configuration, true
}

// HasConfiguration returns a boolean if a field has been set.
func (o *Features) HasConfiguration() bool {
	if o != nil && !IsNil(o.Configuration) {
		return true
	}

	return false
}

// SetConfiguration gets a reference to the given bool and assigns it to the Configuration field.
func (o *Features) SetConfiguration(v bool) {
	o.Configuration = &v
}

// GetMonitoring returns the Monitoring field value if set, zero value otherwise.
func (o *Features) GetMonitoring() bool {
	if o == nil || IsNil(o.Monitoring) {
		var ret bool
		return ret
	}
	return *o.Monitoring
}

// GetMonitoringOk returns a tuple with the Monitoring field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetMonitoringOk() (*bool, bool) {
	if o == nil || IsNil(o.Monitoring) {
		return nil, false
	}
	return o.Monitoring, true
}

// HasMonitoring returns a boolean if a field has been set.
func (o *Features) HasMonitoring() bool {
	if o != nil && !IsNil(o.Monitoring) {
		return true
	}

	return false
}

// SetMonitoring gets a reference to the given bool and assigns it to the Monitoring field.
func (o *Features) SetMonitoring(v bool) {
	o.Monitoring = &v
}

// GetReporting returns the Reporting field value if set, zero value otherwise.
func (o *Features) GetReporting() bool {
	if o == nil || IsNil(o.Reporting) {
		var ret bool
		return ret
	}
	return *o.Reporting
}

// GetReportingOk returns a tuple with the Reporting field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Features) GetReportingOk() (*bool, bool) {
	if o == nil || IsNil(o.Reporting) {
		return nil, false
	}
	return o.Reporting, true
}

// HasReporting returns a boolean if a field has been set.
func (o *Features) HasReporting() bool {
	if o != nil && !IsNil(o.Reporting) {
		return true
	}

	return false
}

// SetReporting gets a reference to the given bool and assigns it to the Reporting field.
func (o *Features) SetReporting(v bool) {
	o.Reporting = &v
}

func (o Features) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o Features) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Rbac) {
		toSerialize["rbac"] = o.Rbac
	}
	if !IsNil(o.AuditLogs) {
		toSerialize["audit_logs"] = o.AuditLogs
	}
	if !IsNil(o.DynamicGroups) {
		toSerialize["dynamic_groups"] = o.DynamicGroups
	}
	if !IsNil(o.Terminal) {
		toSerialize["terminal"] = o.Terminal
	}
	if !IsNil(o.FileTransfer) {
		toSerialize["file_transfer"] = o.FileTransfer
	}
	if !IsNil(o.Configuration) {
		toSerialize["configuration"] = o.Configuration
	}
	if !IsNil(o.Monitoring) {
		toSerialize["monitoring"] = o.Monitoring
	}
	if !IsNil(o.Reporting) {
		toSerialize["reporting"] = o.Reporting
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *Features) UnmarshalJSON(data []byte) (err error) {
	varFeatures := _Features{}

	err = json.Unmarshal(data, &varFeatures)

	if err != nil {
		return err
	}

	*o = Features(varFeatures)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "rbac")
		delete(additionalProperties, "audit_logs")
		delete(additionalProperties, "dynamic_groups")
		delete(additionalProperties, "terminal")
		delete(additionalProperties, "file_transfer")
		delete(additionalProperties, "configuration")
		delete(additionalProperties, "monitoring")
		delete(additionalProperties, "reporting")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableFeatures struct {
	value *Features
	isSet bool
}

func (v NullableFeatures) Get() *Features {
	return v.value
}

func (v *NullableFeatures) Set(val *Features) {
	v.value = val
	v.isSet = true
}

func (v NullableFeatures) IsSet() bool {
	return v.isSet
}

func (v *NullableFeatures) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableFeatures(val *Features) *NullableFeatures {
	return &NullableFeatures{value: val, isSet: true}
}

func (v NullableFeatures) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableFeatures) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


