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

// MockResponse struct for MockResponse
type MockResponse struct {
	Body    map[string]interface{} `json:"body,omitempty"`
	Headers map[string]interface{} `json:"headers,omitempty"`
}

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

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

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

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

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

	return false
}

// SetBody gets a reference to the given map[string]interface{} and assigns it to the Body field.
func (o *MockResponse) SetBody(v map[string]interface{}) {
	o.Body = v
}

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

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

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

	return false
}

// SetHeaders gets a reference to the given map[string]interface{} and assigns it to the Headers field.
func (o *MockResponse) SetHeaders(v map[string]interface{}) {
	o.Headers = v
}

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

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

type NullableMockResponse struct {
	value *MockResponse
	isSet bool
}

func (v NullableMockResponse) Get() *MockResponse {
	return v.value
}

func (v *NullableMockResponse) Set(val *MockResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMockResponse(val *MockResponse) *NullableMockResponse {
	return &NullableMockResponse{value: val, isSet: true}
}

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

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