// Copyright AGNTCY Contributors (https://github.com/agntcy)
// SPDX-License-Identifier: Apache-2.0
/*
Agent Manifest Definition

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 0.1
*/

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

package manifests

import (
	"encoding/json"
)

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

// EnvVarValues Describes the values of the environment variables for a specific agent and it's dependencies
type EnvVarValues struct {
	// name of the agent dependency these environment variables are for
	Name    *string           `json:"name,omitempty"`
	Values  map[string]string `json:"values,omitempty"`
	EnvDeps []EnvVarValues    `json:"env_deps,omitempty"`
}

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

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

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

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

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

	return false
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *EnvVarValues) SetName(v string) {
	o.Name = &v
}

// GetValues returns the Values field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EnvVarValues) GetValues() map[string]string {
	if o == nil {
		var ret map[string]string
		return ret
	}
	return o.Values
}

// GetValuesOk returns a tuple with the Values field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EnvVarValues) GetValuesOk() (*map[string]string, bool) {
	if o == nil || IsNil(o.Values) {
		return nil, false
	}
	return &o.Values, true
}

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

	return false
}

// SetValues gets a reference to the given map[string]string and assigns it to the Values field.
func (o *EnvVarValues) SetValues(v map[string]string) {
	o.Values = v
}

// GetEnvDeps returns the EnvDeps field value if set, zero value otherwise.
func (o *EnvVarValues) GetEnvDeps() []EnvVarValues {
	if o == nil || IsNil(o.EnvDeps) {
		var ret []EnvVarValues
		return ret
	}
	return o.EnvDeps
}

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

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

	return false
}

// SetEnvDeps gets a reference to the given []EnvVarValues and assigns it to the EnvDeps field.
func (o *EnvVarValues) SetEnvDeps(v []EnvVarValues) {
	o.EnvDeps = v
}

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

func (o EnvVarValues) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if o.Values != nil {
		toSerialize["values"] = o.Values
	}
	if !IsNil(o.EnvDeps) {
		toSerialize["env_deps"] = o.EnvDeps
	}
	return toSerialize, nil
}

type NullableEnvVarValues struct {
	value *EnvVarValues
	isSet bool
}

func (v NullableEnvVarValues) Get() *EnvVarValues {
	return v.value
}

func (v *NullableEnvVarValues) Set(val *EnvVarValues) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEnvVarValues(val *EnvVarValues) *NullableEnvVarValues {
	return &NullableEnvVarValues{value: val, isSet: true}
}

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

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