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

// ConfigSvcListConfigsRequest struct for ConfigSvcListConfigsRequest
type ConfigSvcListConfigsRequest struct {
	AppHost string `json:"appHost"`
	// Ids are camelCased slugs of the config owners. Specifying only the ids will mean all of the config will be returned for that key.  If the configs are large, consider using the `Selector` request field.
	Ids []string `json:"ids,omitempty"`
	// Selector allows dotPath-based filtering per config owner. Example: {   \"user1\": [\"settings.theme\", \"featureFlags.enableNewUI\"],   \"user2\": [\"settings.language\"] }
	Selector *map[string][]string `json:"selector,omitempty"`
}

type _ConfigSvcListConfigsRequest ConfigSvcListConfigsRequest

// NewConfigSvcListConfigsRequest instantiates a new ConfigSvcListConfigsRequest 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 NewConfigSvcListConfigsRequest(appHost string) *ConfigSvcListConfigsRequest {
	this := ConfigSvcListConfigsRequest{}
	this.AppHost = appHost
	return &this
}

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

// GetAppHost returns the AppHost field value
func (o *ConfigSvcListConfigsRequest) GetAppHost() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.AppHost
}

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

// SetAppHost sets field value
func (o *ConfigSvcListConfigsRequest) SetAppHost(v string) {
	o.AppHost = v
}

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

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

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

	return false
}

// SetIds gets a reference to the given []string and assigns it to the Ids field.
func (o *ConfigSvcListConfigsRequest) SetIds(v []string) {
	o.Ids = v
}

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

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

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

	return false
}

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

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

func (o ConfigSvcListConfigsRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["appHost"] = o.AppHost
	if !IsNil(o.Ids) {
		toSerialize["ids"] = o.Ids
	}
	if !IsNil(o.Selector) {
		toSerialize["selector"] = o.Selector
	}
	return toSerialize, nil
}

func (o *ConfigSvcListConfigsRequest) 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{
		"appHost",
	}

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

	varConfigSvcListConfigsRequest := _ConfigSvcListConfigsRequest{}

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

	if err != nil {
		return err
	}

	*o = ConfigSvcListConfigsRequest(varConfigSvcListConfigsRequest)

	return err
}

type NullableConfigSvcListConfigsRequest struct {
	value *ConfigSvcListConfigsRequest
	isSet bool
}

func (v NullableConfigSvcListConfigsRequest) Get() *ConfigSvcListConfigsRequest {
	return v.value
}

func (v *NullableConfigSvcListConfigsRequest) Set(val *ConfigSvcListConfigsRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableConfigSvcListConfigsRequest(val *ConfigSvcListConfigsRequest) *NullableConfigSvcListConfigsRequest {
	return &NullableConfigSvcListConfigsRequest{value: val, isSet: true}
}

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

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


