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

// RemoteServiceDeployment Describes the network endpoint where the agent is available
type RemoteServiceDeployment struct {
	Type string `json:"type"`
	// Name this deployment option is referred to within this agent. This is needed to indicate which one is preferred when this manifest is referred. Can be omitted, in such case selection is not possible.            -
	Name     *string              `json:"name,omitempty"`
	Protocol AgentConnectProtocol `json:"protocol"`
}

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

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

// GetType returns the Type field value
func (o *RemoteServiceDeployment) 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 *RemoteServiceDeployment) GetTypeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Type, true
}

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

// GetName returns the Name field value if set, zero value otherwise.
func (o *RemoteServiceDeployment) 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 *RemoteServiceDeployment) 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 *RemoteServiceDeployment) 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 *RemoteServiceDeployment) SetName(v string) {
	o.Name = &v
}

// GetProtocol returns the Protocol field value
func (o *RemoteServiceDeployment) GetProtocol() AgentConnectProtocol {
	if o == nil {
		var ret AgentConnectProtocol
		return ret
	}

	return o.Protocol
}

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

// SetProtocol sets field value
func (o *RemoteServiceDeployment) SetProtocol(v AgentConnectProtocol) {
	o.Protocol = v
}

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

func (o RemoteServiceDeployment) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["type"] = o.Type
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	toSerialize["protocol"] = o.Protocol
	return toSerialize, nil
}

type NullableRemoteServiceDeployment struct {
	value *RemoteServiceDeployment
	isSet bool
}

func (v NullableRemoteServiceDeployment) Get() *RemoteServiceDeployment {
	return v.value
}

func (v *NullableRemoteServiceDeployment) Set(val *RemoteServiceDeployment) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRemoteServiceDeployment(val *RemoteServiceDeployment) *NullableRemoteServiceDeployment {
	return &NullableRemoteServiceDeployment{value: val, isSet: true}
}

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

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