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

// ArtifactTypeInfo Information about update type. 
type ArtifactTypeInfo struct {
	// Note that for emtpy Artifacts, the type is 'null'
	Type *string `json:"type,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _ArtifactTypeInfo ArtifactTypeInfo

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

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

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

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

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

	return false
}

// SetType gets a reference to the given string and assigns it to the Type field.
func (o *ArtifactTypeInfo) SetType(v string) {
	o.Type = &v
}

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

func (o ArtifactTypeInfo) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Type) {
		toSerialize["type"] = o.Type
	}

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

	return toSerialize, nil
}

func (o *ArtifactTypeInfo) UnmarshalJSON(data []byte) (err error) {
	varArtifactTypeInfo := _ArtifactTypeInfo{}

	err = json.Unmarshal(data, &varArtifactTypeInfo)

	if err != nil {
		return err
	}

	*o = ArtifactTypeInfo(varArtifactTypeInfo)

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

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

	return err
}

type NullableArtifactTypeInfo struct {
	value *ArtifactTypeInfo
	isSet bool
}

func (v NullableArtifactTypeInfo) Get() *ArtifactTypeInfo {
	return v.value
}

func (v *NullableArtifactTypeInfo) Set(val *ArtifactTypeInfo) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableArtifactTypeInfo(val *ArtifactTypeInfo) *NullableArtifactTypeInfo {
	return &NullableArtifactTypeInfo{value: val, isSet: true}
}

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

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


