/*
1Backend

AI-native microservices platform.

API version: 0.8.2
Contact: sales@singulatron.com
*/

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

package openapi

import (
	"encoding/json"
	"bytes"
	"fmt"
)

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

// ConfigSvcListConfigsResponse struct for ConfigSvcListConfigsResponse
type ConfigSvcListConfigsResponse struct {
	// Configs is a map of camelcase owner slug to Config. Eg. {  \"testUserSlug0\": {   \"id\": \"testUserSlug0\",   \"data\": {     \"key1\": \"value1\",     \"key2\": \"value2\"   }  } }
	Configs map[string]ConfigSvcConfig `json:"configs"`
}

type _ConfigSvcListConfigsResponse ConfigSvcListConfigsResponse

// NewConfigSvcListConfigsResponse instantiates a new ConfigSvcListConfigsResponse 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 NewConfigSvcListConfigsResponse(configs map[string]ConfigSvcConfig) *ConfigSvcListConfigsResponse {
	this := ConfigSvcListConfigsResponse{}
	this.Configs = configs
	return &this
}

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

// GetConfigs returns the Configs field value
func (o *ConfigSvcListConfigsResponse) GetConfigs() map[string]ConfigSvcConfig {
	if o == nil {
		var ret map[string]ConfigSvcConfig
		return ret
	}

	return o.Configs
}

// GetConfigsOk returns a tuple with the Configs field value
// and a boolean to check if the value has been set.
func (o *ConfigSvcListConfigsResponse) GetConfigsOk() (*map[string]ConfigSvcConfig, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Configs, true
}

// SetConfigs sets field value
func (o *ConfigSvcListConfigsResponse) SetConfigs(v map[string]ConfigSvcConfig) {
	o.Configs = v
}

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

func (o ConfigSvcListConfigsResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["configs"] = o.Configs
	return toSerialize, nil
}

func (o *ConfigSvcListConfigsResponse) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"configs",
	}

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

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varConfigSvcListConfigsResponse := _ConfigSvcListConfigsResponse{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varConfigSvcListConfigsResponse)

	if err != nil {
		return err
	}

	*o = ConfigSvcListConfigsResponse(varConfigSvcListConfigsResponse)

	return err
}

type NullableConfigSvcListConfigsResponse struct {
	value *ConfigSvcListConfigsResponse
	isSet bool
}

func (v NullableConfigSvcListConfigsResponse) Get() *ConfigSvcListConfigsResponse {
	return v.value
}

func (v *NullableConfigSvcListConfigsResponse) Set(val *ConfigSvcListConfigsResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableConfigSvcListConfigsResponse(val *ConfigSvcListConfigsResponse) *NullableConfigSvcListConfigsResponse {
	return &NullableConfigSvcListConfigsResponse{value: val, isSet: true}
}

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

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


