/*
Merlin

API Guide for accessing Merlin's model management, deployment, and serving functionalities

API version: 0.14.0
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package client

import (
	"encoding/json"
)

// checks if the PredictionJobConfigModelResult type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PredictionJobConfigModelResult{}

// PredictionJobConfigModelResult struct for PredictionJobConfigModelResult
type PredictionJobConfigModelResult struct {
	Type     *ResultType `json:"type,omitempty"`
	ItemType *ResultType `json:"item_type,omitempty"`
}

// NewPredictionJobConfigModelResult instantiates a new PredictionJobConfigModelResult 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 NewPredictionJobConfigModelResult() *PredictionJobConfigModelResult {
	this := PredictionJobConfigModelResult{}
	var type_ ResultType = RESULTTYPE_DOUBLE
	this.Type = &type_
	var itemType ResultType = RESULTTYPE_DOUBLE
	this.ItemType = &itemType
	return &this
}

// NewPredictionJobConfigModelResultWithDefaults instantiates a new PredictionJobConfigModelResult 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 NewPredictionJobConfigModelResultWithDefaults() *PredictionJobConfigModelResult {
	this := PredictionJobConfigModelResult{}
	var type_ ResultType = RESULTTYPE_DOUBLE
	this.Type = &type_
	var itemType ResultType = RESULTTYPE_DOUBLE
	this.ItemType = &itemType
	return &this
}

// GetType returns the Type field value if set, zero value otherwise.
func (o *PredictionJobConfigModelResult) GetType() ResultType {
	if o == nil || IsNil(o.Type) {
		var ret ResultType
		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 *PredictionJobConfigModelResult) GetTypeOk() (*ResultType, 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 *PredictionJobConfigModelResult) HasType() bool {
	if o != nil && !IsNil(o.Type) {
		return true
	}

	return false
}

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

// GetItemType returns the ItemType field value if set, zero value otherwise.
func (o *PredictionJobConfigModelResult) GetItemType() ResultType {
	if o == nil || IsNil(o.ItemType) {
		var ret ResultType
		return ret
	}
	return *o.ItemType
}

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

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

	return false
}

// SetItemType gets a reference to the given ResultType and assigns it to the ItemType field.
func (o *PredictionJobConfigModelResult) SetItemType(v ResultType) {
	o.ItemType = &v
}

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

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

type NullablePredictionJobConfigModelResult struct {
	value *PredictionJobConfigModelResult
	isSet bool
}

func (v NullablePredictionJobConfigModelResult) Get() *PredictionJobConfigModelResult {
	return v.value
}

func (v *NullablePredictionJobConfigModelResult) Set(val *PredictionJobConfigModelResult) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePredictionJobConfigModelResult(val *PredictionJobConfigModelResult) *NullablePredictionJobConfigModelResult {
	return &NullablePredictionJobConfigModelResult{value: val, isSet: true}
}

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

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