/*
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 DeviceInventory type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DeviceInventory{}

// DeviceInventory struct for DeviceInventory
type DeviceInventory struct {
	// Mender-assigned unique ID.
	Id *string `json:"id,omitempty"`
	// Timestamp of the most recent attribute update.
	UpdatedTs *string `json:"updated_ts,omitempty"`
	// A list of attribute descriptors.
	Attributes []AttributeV2 `json:"attributes,omitempty"`
}

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

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

// GetId returns the Id field value if set, zero value otherwise.
func (o *DeviceInventory) 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 *DeviceInventory) 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 *DeviceInventory) 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 *DeviceInventory) SetId(v string) {
	o.Id = &v
}

// GetUpdatedTs returns the UpdatedTs field value if set, zero value otherwise.
func (o *DeviceInventory) GetUpdatedTs() string {
	if o == nil || IsNil(o.UpdatedTs) {
		var ret string
		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 *DeviceInventory) GetUpdatedTsOk() (*string, 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 *DeviceInventory) HasUpdatedTs() bool {
	if o != nil && !IsNil(o.UpdatedTs) {
		return true
	}

	return false
}

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

// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *DeviceInventory) GetAttributes() []AttributeV2 {
	if o == nil || IsNil(o.Attributes) {
		var ret []AttributeV2
		return ret
	}
	return o.Attributes
}

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

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

	return false
}

// SetAttributes gets a reference to the given []AttributeV2 and assigns it to the Attributes field.
func (o *DeviceInventory) SetAttributes(v []AttributeV2) {
	o.Attributes = v
}

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

func (o DeviceInventory) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.UpdatedTs) {
		toSerialize["updated_ts"] = o.UpdatedTs
	}
	if !IsNil(o.Attributes) {
		toSerialize["attributes"] = o.Attributes
	}
	return toSerialize, nil
}

type NullableDeviceInventory struct {
	value *DeviceInventory
	isSet bool
}

func (v NullableDeviceInventory) Get() *DeviceInventory {
	return v.value
}

func (v *NullableDeviceInventory) Set(val *DeviceInventory) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeviceInventory(val *DeviceInventory) *NullableDeviceInventory {
	return &NullableDeviceInventory{value: val, isSet: true}
}

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

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


