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

// DeviceWithImageImageMeta struct for DeviceWithImageImageMeta
type DeviceWithImageImageMeta struct {
	// Image description
	Description *string `json:"description,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _DeviceWithImageImageMeta DeviceWithImageImageMeta

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

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

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

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

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

	return false
}

// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *DeviceWithImageImageMeta) SetDescription(v string) {
	o.Description = &v
}

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

func (o DeviceWithImageImageMeta) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Description) {
		toSerialize["description"] = o.Description
	}

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

	return toSerialize, nil
}

func (o *DeviceWithImageImageMeta) UnmarshalJSON(data []byte) (err error) {
	varDeviceWithImageImageMeta := _DeviceWithImageImageMeta{}

	err = json.Unmarshal(data, &varDeviceWithImageImageMeta)

	if err != nil {
		return err
	}

	*o = DeviceWithImageImageMeta(varDeviceWithImageImageMeta)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "description")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableDeviceWithImageImageMeta struct {
	value *DeviceWithImageImageMeta
	isSet bool
}

func (v NullableDeviceWithImageImageMeta) Get() *DeviceWithImageImageMeta {
	return v.value
}

func (v *NullableDeviceWithImageImageMeta) Set(val *DeviceWithImageImageMeta) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeviceWithImageImageMeta(val *DeviceWithImageImageMeta) *NullableDeviceWithImageImageMeta {
	return &NullableDeviceWithImageImageMeta{value: val, isSet: true}
}

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

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


