/*
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"
	"time"
)

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

// DeviceConfiguration struct for DeviceConfiguration
type DeviceConfiguration struct {
	Id *string `json:"id,omitempty"`
	Configured *map[string]string `json:"configured,omitempty"`
	Reported *map[string]string `json:"reported,omitempty"`
	// ID of the latest configuration deployment
	DeploymentId *string `json:"deployment_id,omitempty"`
	ReportedTs *time.Time `json:"reported_ts,omitempty"`
	UpdatedTs *time.Time `json:"updated_ts,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _DeviceConfiguration DeviceConfiguration

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

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

// GetId returns the Id field value if set, zero value otherwise.
func (o *DeviceConfiguration) GetId() string {
	if o == nil || IsNil(o.Id) {
		var ret string
		return ret
	}
	return *o.Id
}

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *DeviceConfiguration) SetId(v string) {
	o.Id = &v
}

// GetConfigured returns the Configured field value if set, zero value otherwise.
func (o *DeviceConfiguration) GetConfigured() map[string]string {
	if o == nil || IsNil(o.Configured) {
		var ret map[string]string
		return ret
	}
	return *o.Configured
}

// GetConfiguredOk returns a tuple with the Configured field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceConfiguration) GetConfiguredOk() (*map[string]string, bool) {
	if o == nil || IsNil(o.Configured) {
		return nil, false
	}
	return o.Configured, true
}

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

	return false
}

// SetConfigured gets a reference to the given map[string]string and assigns it to the Configured field.
func (o *DeviceConfiguration) SetConfigured(v map[string]string) {
	o.Configured = &v
}

// GetReported returns the Reported field value if set, zero value otherwise.
func (o *DeviceConfiguration) GetReported() map[string]string {
	if o == nil || IsNil(o.Reported) {
		var ret map[string]string
		return ret
	}
	return *o.Reported
}

// GetReportedOk returns a tuple with the Reported field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeviceConfiguration) GetReportedOk() (*map[string]string, bool) {
	if o == nil || IsNil(o.Reported) {
		return nil, false
	}
	return o.Reported, true
}

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

	return false
}

// SetReported gets a reference to the given map[string]string and assigns it to the Reported field.
func (o *DeviceConfiguration) SetReported(v map[string]string) {
	o.Reported = &v
}

// GetDeploymentId returns the DeploymentId field value if set, zero value otherwise.
func (o *DeviceConfiguration) GetDeploymentId() string {
	if o == nil || IsNil(o.DeploymentId) {
		var ret string
		return ret
	}
	return *o.DeploymentId
}

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

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

	return false
}

// SetDeploymentId gets a reference to the given string and assigns it to the DeploymentId field.
func (o *DeviceConfiguration) SetDeploymentId(v string) {
	o.DeploymentId = &v
}

// GetReportedTs returns the ReportedTs field value if set, zero value otherwise.
func (o *DeviceConfiguration) GetReportedTs() time.Time {
	if o == nil || IsNil(o.ReportedTs) {
		var ret time.Time
		return ret
	}
	return *o.ReportedTs
}

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

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

	return false
}

// SetReportedTs gets a reference to the given time.Time and assigns it to the ReportedTs field.
func (o *DeviceConfiguration) SetReportedTs(v time.Time) {
	o.ReportedTs = &v
}

// GetUpdatedTs returns the UpdatedTs field value if set, zero value otherwise.
func (o *DeviceConfiguration) GetUpdatedTs() time.Time {
	if o == nil || IsNil(o.UpdatedTs) {
		var ret time.Time
		return ret
	}
	return *o.UpdatedTs
}

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

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

	return false
}

// SetUpdatedTs gets a reference to the given time.Time and assigns it to the UpdatedTs field.
func (o *DeviceConfiguration) SetUpdatedTs(v time.Time) {
	o.UpdatedTs = &v
}

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

func (o DeviceConfiguration) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.Configured) {
		toSerialize["configured"] = o.Configured
	}
	if !IsNil(o.Reported) {
		toSerialize["reported"] = o.Reported
	}
	if !IsNil(o.DeploymentId) {
		toSerialize["deployment_id"] = o.DeploymentId
	}
	if !IsNil(o.ReportedTs) {
		toSerialize["reported_ts"] = o.ReportedTs
	}
	if !IsNil(o.UpdatedTs) {
		toSerialize["updated_ts"] = o.UpdatedTs
	}

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

	return toSerialize, nil
}

func (o *DeviceConfiguration) UnmarshalJSON(data []byte) (err error) {
	varDeviceConfiguration := _DeviceConfiguration{}

	err = json.Unmarshal(data, &varDeviceConfiguration)

	if err != nil {
		return err
	}

	*o = DeviceConfiguration(varDeviceConfiguration)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "configured")
		delete(additionalProperties, "reported")
		delete(additionalProperties, "deployment_id")
		delete(additionalProperties, "reported_ts")
		delete(additionalProperties, "updated_ts")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableDeviceConfiguration struct {
	value *DeviceConfiguration
	isSet bool
}

func (v NullableDeviceConfiguration) Get() *DeviceConfiguration {
	return v.value
}

func (v *NullableDeviceConfiguration) Set(val *DeviceConfiguration) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeviceConfiguration(val *DeviceConfiguration) *NullableDeviceConfiguration {
	return &NullableDeviceConfiguration{value: val, isSet: true}
}

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

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


