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

// DeviceWithImageImage struct for DeviceWithImageImage
type DeviceWithImageImage struct {
	// Image ID
	Id *string `json:"id,omitempty"`
	Meta *DeviceWithImageImageMeta `json:"meta,omitempty"`
	MetaArtifact *DeviceWithImageImageMetaArtifact `json:"meta_artifact,omitempty"`
	// Image size in bytes
	Size *int32 `json:"size,omitempty"`
	// Creation / last edition of any of the artifact properties
	Modified *time.Time `json:"modified,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _DeviceWithImageImage DeviceWithImageImage

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

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

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

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

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

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

	return false
}

// SetMeta gets a reference to the given DeviceWithImageImageMeta and assigns it to the Meta field.
func (o *DeviceWithImageImage) SetMeta(v DeviceWithImageImageMeta) {
	o.Meta = &v
}

// GetMetaArtifact returns the MetaArtifact field value if set, zero value otherwise.
func (o *DeviceWithImageImage) GetMetaArtifact() DeviceWithImageImageMetaArtifact {
	if o == nil || IsNil(o.MetaArtifact) {
		var ret DeviceWithImageImageMetaArtifact
		return ret
	}
	return *o.MetaArtifact
}

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

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

	return false
}

// SetMetaArtifact gets a reference to the given DeviceWithImageImageMetaArtifact and assigns it to the MetaArtifact field.
func (o *DeviceWithImageImage) SetMetaArtifact(v DeviceWithImageImageMetaArtifact) {
	o.MetaArtifact = &v
}

// GetSize returns the Size field value if set, zero value otherwise.
func (o *DeviceWithImageImage) GetSize() int32 {
	if o == nil || IsNil(o.Size) {
		var ret int32
		return ret
	}
	return *o.Size
}

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

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

	return false
}

// SetSize gets a reference to the given int32 and assigns it to the Size field.
func (o *DeviceWithImageImage) SetSize(v int32) {
	o.Size = &v
}

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

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

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

	return false
}

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

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

func (o DeviceWithImageImage) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !IsNil(o.Meta) {
		toSerialize["meta"] = o.Meta
	}
	if !IsNil(o.MetaArtifact) {
		toSerialize["meta_artifact"] = o.MetaArtifact
	}
	if !IsNil(o.Size) {
		toSerialize["size"] = o.Size
	}
	if !IsNil(o.Modified) {
		toSerialize["modified"] = o.Modified
	}

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

	return toSerialize, nil
}

func (o *DeviceWithImageImage) UnmarshalJSON(data []byte) (err error) {
	varDeviceWithImageImage := _DeviceWithImageImage{}

	err = json.Unmarshal(data, &varDeviceWithImageImage)

	if err != nil {
		return err
	}

	*o = DeviceWithImageImage(varDeviceWithImageImage)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "id")
		delete(additionalProperties, "meta")
		delete(additionalProperties, "meta_artifact")
		delete(additionalProperties, "size")
		delete(additionalProperties, "modified")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableDeviceWithImageImage struct {
	value *DeviceWithImageImage
	isSet bool
}

func (v NullableDeviceWithImageImage) Get() *DeviceWithImageImage {
	return v.value
}

func (v *NullableDeviceWithImageImage) Set(val *DeviceWithImageImage) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeviceWithImageImage(val *DeviceWithImageImage) *NullableDeviceWithImageImage {
	return &NullableDeviceWithImageImage{value: val, isSet: true}
}

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

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


