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

// AgentConnectProtocol ACP endpoint description
type AgentConnectProtocol struct {
	Type string `json:"type"`
	// URL pointing to the ACP endpoint root.
	Url string `json:"url"`
	// Agent identifier in ACP server. If missing, the first returned agent with matching name and version should be used.
	AgentId *string `json:"agent_id,omitempty"`
	// This object contains an instance of an OpenAPI schema object, formatted as per the OpenAPI specs: https://spec.openapis.org/oas/v3.1.1.html#security-scheme-object-0
	Authentication map[string]interface{} `json:"authentication,omitempty"`
}

// NewAgentConnectProtocol instantiates a new AgentConnectProtocol 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 NewAgentConnectProtocol(type_ string, url string) *AgentConnectProtocol {
	this := AgentConnectProtocol{}
	this.Type = type_
	this.Url = url
	return &this
}

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

// GetType returns the Type field value
func (o *AgentConnectProtocol) GetType() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Type
}

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

// SetType sets field value
func (o *AgentConnectProtocol) SetType(v string) {
	o.Type = v
}

// GetUrl returns the Url field value
func (o *AgentConnectProtocol) GetUrl() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Url
}

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

// SetUrl sets field value
func (o *AgentConnectProtocol) SetUrl(v string) {
	o.Url = v
}

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

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

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

	return false
}

// SetAgentId gets a reference to the given string and assigns it to the AgentId field.
func (o *AgentConnectProtocol) SetAgentId(v string) {
	o.AgentId = &v
}

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

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

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

	return false
}

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

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

func (o AgentConnectProtocol) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["type"] = o.Type
	toSerialize["url"] = o.Url
	if !IsNil(o.AgentId) {
		toSerialize["agent_id"] = o.AgentId
	}
	if !IsNil(o.Authentication) {
		toSerialize["authentication"] = o.Authentication
	}
	return toSerialize, nil
}

type NullableAgentConnectProtocol struct {
	value *AgentConnectProtocol
	isSet bool
}

func (v NullableAgentConnectProtocol) Get() *AgentConnectProtocol {
	return v.value
}

func (v *NullableAgentConnectProtocol) Set(val *AgentConnectProtocol) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAgentConnectProtocol(val *AgentConnectProtocol) *NullableAgentConnectProtocol {
	return &NullableAgentConnectProtocol{value: val, isSet: true}
}

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

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