/*
OpenAPI Petstore

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\

API version: 1.0.0
*/

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

package petstore

import (
	"encoding/json"
)

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

// MapTest struct for MapTest
type MapTest struct {
	MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"`
	MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"`
	DirectMap *map[string]bool `json:"direct_map,omitempty"`
	IndirectMap *map[string]bool `json:"indirect_map,omitempty"`
}

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

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

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

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

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

	return false
}

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

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field.
func (o *MapTest) SetDirectMap(v map[string]bool) {
	o.DirectMap = &v
}

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

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

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

	return false
}

// SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field.
func (o *MapTest) SetIndirectMap(v map[string]bool) {
	o.IndirectMap = &v
}

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

func (o MapTest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.MapMapOfString) {
		toSerialize["map_map_of_string"] = o.MapMapOfString
	}
	if !IsNil(o.MapOfEnumString) {
		toSerialize["map_of_enum_string"] = o.MapOfEnumString
	}
	if !IsNil(o.DirectMap) {
		toSerialize["direct_map"] = o.DirectMap
	}
	if !IsNil(o.IndirectMap) {
		toSerialize["indirect_map"] = o.IndirectMap
	}
	return toSerialize, nil
}

type NullableMapTest struct {
	value *MapTest
	isSet bool
}

func (v NullableMapTest) Get() *MapTest {
	return v.value
}

func (v *NullableMapTest) Set(val *MapTest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMapTest(val *MapTest) *NullableMapTest {
	return &NullableMapTest{value: val, isSet: true}
}

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

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


