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

// SourceCodeDeployment Describes the source code where the agent is available. It specifies also the type of deployer that it supports.
type SourceCodeDeployment 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"`
	// Location of the source code.              Can be a local path to a directory or a tar/gz/zip file containing sources,  e.g., /path/to/your/local/folder or file:///path/to/your/local/folder. Can point to a GitHub repository, e.g., github.com/cisco-eti/agent-connect-protocol.git//examples/agents/mailcomposer  or https://github.com/cisco-eti/agent-connect-protocol.git//examples/agents/mailcomposer,  which indicates that source files can be found in the /examples/agents/mailcomposer subfolder in the repository.  You can also specify a branch, e.g., github.com/cisco-eti/agent-connect-protocol.git?ref=branch_name.
	Url             string                              `json:"url"`
	FrameworkConfig SourceCodeDeploymentFrameworkConfig `json:"framework_config"`
}

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

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

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

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

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

// GetUrl returns the Url field value
func (o *SourceCodeDeployment) 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 *SourceCodeDeployment) GetUrlOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Url, true
}

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

// GetFrameworkConfig returns the FrameworkConfig field value
func (o *SourceCodeDeployment) GetFrameworkConfig() SourceCodeDeploymentFrameworkConfig {
	if o == nil {
		var ret SourceCodeDeploymentFrameworkConfig
		return ret
	}

	return o.FrameworkConfig
}

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

// SetFrameworkConfig sets field value
func (o *SourceCodeDeployment) SetFrameworkConfig(v SourceCodeDeploymentFrameworkConfig) {
	o.FrameworkConfig = v
}

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

func (o SourceCodeDeployment) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["type"] = o.Type
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	toSerialize["url"] = o.Url
	toSerialize["framework_config"] = o.FrameworkConfig
	return toSerialize, nil
}

type NullableSourceCodeDeployment struct {
	value *SourceCodeDeployment
	isSet bool
}

func (v NullableSourceCodeDeployment) Get() *SourceCodeDeployment {
	return v.value
}

func (v *NullableSourceCodeDeployment) Set(val *SourceCodeDeployment) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSourceCodeDeployment(val *SourceCodeDeployment) *NullableSourceCodeDeployment {
	return &NullableSourceCodeDeployment{value: val, isSet: true}
}

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

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