/*
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"
)

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

// ConfigSvcSaveConfigRequest struct for ConfigSvcSaveConfigRequest
type ConfigSvcSaveConfigRequest struct {
	// AppHost can only be specified by users who have the `config-svc:config:edit-on-behalf` permission, who are typically admins.  If not specified, the config will be saved for the current app of the user's token.
	AppHost *string `json:"appHost,omitempty"`
	Data map[string]interface{} `json:"data,omitempty"`
	DataJson *string `json:"dataJson,omitempty"`
	// Id is the slug of the owner to save the config for. Only user with the `config-svc:config:edit-on-behalf` can specify this. For everyone else, it is automatically set to the slug of the caller user.
	Id *string `json:"id,omitempty"`
}

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

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

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

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

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

	return false
}

// SetAppHost gets a reference to the given string and assigns it to the AppHost field.
func (o *ConfigSvcSaveConfigRequest) SetAppHost(v string) {
	o.AppHost = &v
}

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetDataJson gets a reference to the given string and assigns it to the DataJson field.
func (o *ConfigSvcSaveConfigRequest) SetDataJson(v string) {
	o.DataJson = &v
}

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

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *ConfigSvcSaveConfigRequest) SetId(v string) {
	o.Id = &v
}

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

func (o ConfigSvcSaveConfigRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.AppHost) {
		toSerialize["appHost"] = o.AppHost
	}
	if !IsNil(o.Data) {
		toSerialize["data"] = o.Data
	}
	if !IsNil(o.DataJson) {
		toSerialize["dataJson"] = o.DataJson
	}
	if !IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	return toSerialize, nil
}

type NullableConfigSvcSaveConfigRequest struct {
	value *ConfigSvcSaveConfigRequest
	isSet bool
}

func (v NullableConfigSvcSaveConfigRequest) Get() *ConfigSvcSaveConfigRequest {
	return v.value
}

func (v *NullableConfigSvcSaveConfigRequest) Set(val *ConfigSvcSaveConfigRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableConfigSvcSaveConfigRequest(val *ConfigSvcSaveConfigRequest) *NullableConfigSvcSaveConfigRequest {
	return &NullableConfigSvcSaveConfigRequest{value: val, isSet: true}
}

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

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


