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

// DeviceWithImageImageMetaArtifact struct for DeviceWithImageImageMetaArtifact
type DeviceWithImageImageMetaArtifact struct {
	Name *string `json:"name,omitempty"`
	// An array of compatible device types.
	DeviceTypesCompatible []string `json:"device_types_compatible,omitempty"`
	Info *ArtifactInfo `json:"info,omitempty"`
	// Idicates if artifact is signed or not.
	Signed *bool `json:"signed,omitempty"`
	Updates []Update `json:"updates,omitempty"`
	// List of Artifact provides.  Map of key/value pairs, where both keys and values are strings. 
	ArtifactProvides *map[string]string `json:"artifact_provides,omitempty"`
	// List of Artifact depends.  Map of key/value pairs, where keys are strings and values are lists of strings. 
	ArtifactDepends *map[string][]string `json:"artifact_depends,omitempty"`
	// List of Clear Artifact provides.
	ClearsArtifactProvides []string `json:"clears_artifact_provides,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _DeviceWithImageImageMetaArtifact DeviceWithImageImageMetaArtifact

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

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

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

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

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

	return false
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *DeviceWithImageImageMetaArtifact) SetName(v string) {
	o.Name = &v
}

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

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

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

	return false
}

// SetDeviceTypesCompatible gets a reference to the given []string and assigns it to the DeviceTypesCompatible field.
func (o *DeviceWithImageImageMetaArtifact) SetDeviceTypesCompatible(v []string) {
	o.DeviceTypesCompatible = v
}

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

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

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

	return false
}

// SetInfo gets a reference to the given ArtifactInfo and assigns it to the Info field.
func (o *DeviceWithImageImageMetaArtifact) SetInfo(v ArtifactInfo) {
	o.Info = &v
}

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

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

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

	return false
}

// SetSigned gets a reference to the given bool and assigns it to the Signed field.
func (o *DeviceWithImageImageMetaArtifact) SetSigned(v bool) {
	o.Signed = &v
}

// GetUpdates returns the Updates field value if set, zero value otherwise.
func (o *DeviceWithImageImageMetaArtifact) GetUpdates() []Update {
	if o == nil || IsNil(o.Updates) {
		var ret []Update
		return ret
	}
	return o.Updates
}

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

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

	return false
}

// SetUpdates gets a reference to the given []Update and assigns it to the Updates field.
func (o *DeviceWithImageImageMetaArtifact) SetUpdates(v []Update) {
	o.Updates = v
}

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

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

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

	return false
}

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

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetClearsArtifactProvides gets a reference to the given []string and assigns it to the ClearsArtifactProvides field.
func (o *DeviceWithImageImageMetaArtifact) SetClearsArtifactProvides(v []string) {
	o.ClearsArtifactProvides = v
}

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

func (o DeviceWithImageImageMetaArtifact) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if !IsNil(o.DeviceTypesCompatible) {
		toSerialize["device_types_compatible"] = o.DeviceTypesCompatible
	}
	if !IsNil(o.Info) {
		toSerialize["info"] = o.Info
	}
	if !IsNil(o.Signed) {
		toSerialize["signed"] = o.Signed
	}
	if !IsNil(o.Updates) {
		toSerialize["updates"] = o.Updates
	}
	if !IsNil(o.ArtifactProvides) {
		toSerialize["artifact_provides"] = o.ArtifactProvides
	}
	if !IsNil(o.ArtifactDepends) {
		toSerialize["artifact_depends"] = o.ArtifactDepends
	}
	if !IsNil(o.ClearsArtifactProvides) {
		toSerialize["clears_artifact_provides"] = o.ClearsArtifactProvides
	}

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

	return toSerialize, nil
}

func (o *DeviceWithImageImageMetaArtifact) UnmarshalJSON(data []byte) (err error) {
	varDeviceWithImageImageMetaArtifact := _DeviceWithImageImageMetaArtifact{}

	err = json.Unmarshal(data, &varDeviceWithImageImageMetaArtifact)

	if err != nil {
		return err
	}

	*o = DeviceWithImageImageMetaArtifact(varDeviceWithImageImageMetaArtifact)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "name")
		delete(additionalProperties, "device_types_compatible")
		delete(additionalProperties, "info")
		delete(additionalProperties, "signed")
		delete(additionalProperties, "updates")
		delete(additionalProperties, "artifact_provides")
		delete(additionalProperties, "artifact_depends")
		delete(additionalProperties, "clears_artifact_provides")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableDeviceWithImageImageMetaArtifact struct {
	value *DeviceWithImageImageMetaArtifact
	isSet bool
}

func (v NullableDeviceWithImageImageMetaArtifact) Get() *DeviceWithImageImageMetaArtifact {
	return v.value
}

func (v *NullableDeviceWithImageImageMetaArtifact) Set(val *DeviceWithImageImageMetaArtifact) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDeviceWithImageImageMetaArtifact(val *DeviceWithImageImageMetaArtifact) *NullableDeviceWithImageImageMetaArtifact {
	return &NullableDeviceWithImageImageMetaArtifact{value: val, isSet: true}
}

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

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


