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

// AgentDeployment Describe all the details needed to deploy an agent by the Agent Workflow Server
type AgentDeployment struct {
	DeploymentOptions []AgentDeploymentDeploymentOptionsInner `json:"deployment_options"`
	EnvVars           []EnvVar                                `json:"env_vars,omitempty"`
	AgentDeps         []AgentDependency                       `json:"agent_deps,omitempty"`
}

// NewAgentDeployment instantiates a new AgentDeployment 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 NewAgentDeployment(deploymentOptions []AgentDeploymentDeploymentOptionsInner) *AgentDeployment {
	this := AgentDeployment{}
	this.DeploymentOptions = deploymentOptions
	return &this
}

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

// GetDeploymentOptions returns the DeploymentOptions field value
func (o *AgentDeployment) GetDeploymentOptions() []AgentDeploymentDeploymentOptionsInner {
	if o == nil {
		var ret []AgentDeploymentDeploymentOptionsInner
		return ret
	}

	return o.DeploymentOptions
}

// GetDeploymentOptionsOk returns a tuple with the DeploymentOptions field value
// and a boolean to check if the value has been set.
func (o *AgentDeployment) GetDeploymentOptionsOk() ([]AgentDeploymentDeploymentOptionsInner, bool) {
	if o == nil {
		return nil, false
	}
	return o.DeploymentOptions, true
}

// SetDeploymentOptions sets field value
func (o *AgentDeployment) SetDeploymentOptions(v []AgentDeploymentDeploymentOptionsInner) {
	o.DeploymentOptions = v
}

// GetEnvVars returns the EnvVars field value if set, zero value otherwise.
func (o *AgentDeployment) GetEnvVars() []EnvVar {
	if o == nil || IsNil(o.EnvVars) {
		var ret []EnvVar
		return ret
	}
	return o.EnvVars
}

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

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

	return false
}

// SetEnvVars gets a reference to the given []EnvVar and assigns it to the EnvVars field.
func (o *AgentDeployment) SetEnvVars(v []EnvVar) {
	o.EnvVars = v
}

// GetAgentDeps returns the AgentDeps field value if set, zero value otherwise.
func (o *AgentDeployment) GetAgentDeps() []AgentDependency {
	if o == nil || IsNil(o.AgentDeps) {
		var ret []AgentDependency
		return ret
	}
	return o.AgentDeps
}

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

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

	return false
}

// SetAgentDeps gets a reference to the given []AgentDependency and assigns it to the AgentDeps field.
func (o *AgentDeployment) SetAgentDeps(v []AgentDependency) {
	o.AgentDeps = v
}

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

func (o AgentDeployment) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["deployment_options"] = o.DeploymentOptions
	if !IsNil(o.EnvVars) {
		toSerialize["env_vars"] = o.EnvVars
	}
	if !IsNil(o.AgentDeps) {
		toSerialize["agent_deps"] = o.AgentDeps
	}
	return toSerialize, nil
}

type NullableAgentDeployment struct {
	value *AgentDeployment
	isSet bool
}

func (v NullableAgentDeployment) Get() *AgentDeployment {
	return v.value
}

func (v *NullableAgentDeployment) Set(val *AgentDeployment) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAgentDeployment(val *AgentDeployment) *NullableAgentDeployment {
	return &NullableAgentDeployment{value: val, isSet: true}
}

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

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