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

// AgentDependency Reference to an Agent Record in the Agent Directory, it includes name, version and a locator.
type AgentDependency struct {
	// Name of the agent dependency
	Name string         `json:"name"`
	Ref  AgentReference `json:"ref"`
	// Selected deployment option for this agent.
	DeploymentOption *string `json:"deployment_option,omitempty"`
	// Environment variable values to be set for this agent.
	EnvVarValues *EnvVarValues `json:"env_var_values,omitempty"`
}

// NewAgentDependency instantiates a new AgentDependency 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 NewAgentDependency(name string, ref AgentReference) *AgentDependency {
	this := AgentDependency{}
	this.Name = name
	this.Ref = ref
	return &this
}

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

// GetName returns the Name field value
func (o *AgentDependency) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

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

// SetName sets field value
func (o *AgentDependency) SetName(v string) {
	o.Name = v
}

// GetRef returns the Ref field value
func (o *AgentDependency) GetRef() AgentReference {
	if o == nil {
		var ret AgentReference
		return ret
	}

	return o.Ref
}

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

// SetRef sets field value
func (o *AgentDependency) SetRef(v AgentReference) {
	o.Ref = v
}

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

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

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

	return false
}

// SetDeploymentOption gets a reference to the given string and assigns it to the DeploymentOption field.
func (o *AgentDependency) SetDeploymentOption(v string) {
	o.DeploymentOption = &v
}

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

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

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

	return false
}

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

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

func (o AgentDependency) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["name"] = o.Name
	toSerialize["ref"] = o.Ref
	if !IsNil(o.DeploymentOption) {
		toSerialize["deployment_option"] = o.DeploymentOption
	}
	if !IsNil(o.EnvVarValues) {
		toSerialize["env_var_values"] = o.EnvVarValues
	}
	return toSerialize, nil
}

type NullableAgentDependency struct {
	value *AgentDependency
	isSet bool
}

func (v NullableAgentDependency) Get() *AgentDependency {
	return v.value
}

func (v *NullableAgentDependency) Set(val *AgentDependency) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAgentDependency(val *AgentDependency) *NullableAgentDependency {
	return &NullableAgentDependency{value: val, isSet: true}
}

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

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