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

// ConfigSvcConfig struct for ConfigSvcConfig
type ConfigSvcConfig struct {
	AppId string `json:"appId"`
	CreatedAt string `json:"createdAt"`
	Data map[string]interface{} `json:"data"`
	DataJson string `json:"dataJson"`
	// CamelCased slugs of the config owners
	Id string `json:"id"`
	InternalId *string `json:"internalId,omitempty"`
	UpdatedAt string `json:"updatedAt"`
}

type _ConfigSvcConfig ConfigSvcConfig

// NewConfigSvcConfig instantiates a new ConfigSvcConfig 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 NewConfigSvcConfig(appId string, createdAt string, data map[string]interface{}, dataJson string, id string, updatedAt string) *ConfigSvcConfig {
	this := ConfigSvcConfig{}
	this.AppId = appId
	this.CreatedAt = createdAt
	this.Data = data
	this.DataJson = dataJson
	this.Id = id
	this.UpdatedAt = updatedAt
	return &this
}

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

// GetAppId returns the AppId field value
func (o *ConfigSvcConfig) GetAppId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.AppId
}

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

// SetAppId sets field value
func (o *ConfigSvcConfig) SetAppId(v string) {
	o.AppId = v
}

// GetCreatedAt returns the CreatedAt field value
func (o *ConfigSvcConfig) GetCreatedAt() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.CreatedAt
}

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

// SetCreatedAt sets field value
func (o *ConfigSvcConfig) SetCreatedAt(v string) {
	o.CreatedAt = v
}

// GetData returns the Data field value
func (o *ConfigSvcConfig) GetData() map[string]interface{} {
	if o == nil {
		var ret map[string]interface{}
		return ret
	}

	return o.Data
}

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

// SetData sets field value
func (o *ConfigSvcConfig) SetData(v map[string]interface{}) {
	o.Data = v
}

// GetDataJson returns the DataJson field value
func (o *ConfigSvcConfig) GetDataJson() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.DataJson
}

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

// SetDataJson sets field value
func (o *ConfigSvcConfig) SetDataJson(v string) {
	o.DataJson = v
}

// GetId returns the Id field value
func (o *ConfigSvcConfig) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

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

// SetId sets field value
func (o *ConfigSvcConfig) SetId(v string) {
	o.Id = v
}

// GetInternalId returns the InternalId field value if set, zero value otherwise.
func (o *ConfigSvcConfig) GetInternalId() string {
	if o == nil || IsNil(o.InternalId) {
		var ret string
		return ret
	}
	return *o.InternalId
}

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

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

	return false
}

// SetInternalId gets a reference to the given string and assigns it to the InternalId field.
func (o *ConfigSvcConfig) SetInternalId(v string) {
	o.InternalId = &v
}

// GetUpdatedAt returns the UpdatedAt field value
func (o *ConfigSvcConfig) GetUpdatedAt() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.UpdatedAt
}

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

// SetUpdatedAt sets field value
func (o *ConfigSvcConfig) SetUpdatedAt(v string) {
	o.UpdatedAt = v
}

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

func (o ConfigSvcConfig) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["appId"] = o.AppId
	toSerialize["createdAt"] = o.CreatedAt
	toSerialize["data"] = o.Data
	toSerialize["dataJson"] = o.DataJson
	toSerialize["id"] = o.Id
	if !IsNil(o.InternalId) {
		toSerialize["internalId"] = o.InternalId
	}
	toSerialize["updatedAt"] = o.UpdatedAt
	return toSerialize, nil
}

func (o *ConfigSvcConfig) 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{
		"appId",
		"createdAt",
		"data",
		"dataJson",
		"id",
		"updatedAt",
	}

	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)
		}
	}

	varConfigSvcConfig := _ConfigSvcConfig{}

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

	if err != nil {
		return err
	}

	*o = ConfigSvcConfig(varConfigSvcConfig)

	return err
}

type NullableConfigSvcConfig struct {
	value *ConfigSvcConfig
	isSet bool
}

func (v NullableConfigSvcConfig) Get() *ConfigSvcConfig {
	return v.value
}

func (v *NullableConfigSvcConfig) Set(val *ConfigSvcConfig) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableConfigSvcConfig(val *ConfigSvcConfig) *NullableConfigSvcConfig {
	return &NullableConfigSvcConfig{value: val, isSet: true}
}

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

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


