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

// ModelPredictionConfig struct for ModelPredictionConfig
type ModelPredictionConfig struct {
	MockResponse *MockResponse `json:"mock_response,omitempty"`
}

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

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

// GetMockResponse returns the MockResponse field value if set, zero value otherwise.
func (o *ModelPredictionConfig) GetMockResponse() MockResponse {
	if o == nil || IsNil(o.MockResponse) {
		var ret MockResponse
		return ret
	}
	return *o.MockResponse
}

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

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

	return false
}

// SetMockResponse gets a reference to the given MockResponse and assigns it to the MockResponse field.
func (o *ModelPredictionConfig) SetMockResponse(v MockResponse) {
	o.MockResponse = &v
}

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

func (o ModelPredictionConfig) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.MockResponse) {
		toSerialize["mock_response"] = o.MockResponse
	}
	return toSerialize, nil
}

type NullableModelPredictionConfig struct {
	value *ModelPredictionConfig
	isSet bool
}

func (v NullableModelPredictionConfig) Get() *ModelPredictionConfig {
	return v.value
}

func (v *NullableModelPredictionConfig) Set(val *ModelPredictionConfig) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableModelPredictionConfig(val *ModelPredictionConfig) *NullableModelPredictionConfig {
	return &NullableModelPredictionConfig{value: val, isSet: true}
}

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

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