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

// Skill Describes the skills of the agent.
type Skill struct {
	CategoryUid  *int32            `json:"category_uid,omitempty"`
	ClassUid     int32             `json:"class_uid"`
	CategoryName *string           `json:"category_name,omitempty"`
	ClassName    *string           `json:"class_name,omitempty"`
	Annotations  map[string]string `json:"annotations,omitempty"`
}

// NewSkill instantiates a new Skill 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 NewSkill(classUid int32) *Skill {
	this := Skill{}
	this.ClassUid = classUid
	return &this
}

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

// GetCategoryUid returns the CategoryUid field value if set, zero value otherwise.
func (o *Skill) GetCategoryUid() int32 {
	if o == nil || IsNil(o.CategoryUid) {
		var ret int32
		return ret
	}
	return *o.CategoryUid
}

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

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

	return false
}

// SetCategoryUid gets a reference to the given int32 and assigns it to the CategoryUid field.
func (o *Skill) SetCategoryUid(v int32) {
	o.CategoryUid = &v
}

// GetClassUid returns the ClassUid field value
func (o *Skill) GetClassUid() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.ClassUid
}

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

// SetClassUid sets field value
func (o *Skill) SetClassUid(v int32) {
	o.ClassUid = v
}

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

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

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

	return false
}

// SetCategoryName gets a reference to the given string and assigns it to the CategoryName field.
func (o *Skill) SetCategoryName(v string) {
	o.CategoryName = &v
}

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

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

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

	return false
}

// SetClassName gets a reference to the given string and assigns it to the ClassName field.
func (o *Skill) SetClassName(v string) {
	o.ClassName = &v
}

// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Skill) GetAnnotations() map[string]string {
	if o == nil {
		var ret map[string]string
		return ret
	}
	return o.Annotations
}

// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Skill) GetAnnotationsOk() (*map[string]string, bool) {
	if o == nil || IsNil(o.Annotations) {
		return nil, false
	}
	return &o.Annotations, true
}

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

	return false
}

// SetAnnotations gets a reference to the given map[string]string and assigns it to the Annotations field.
func (o *Skill) SetAnnotations(v map[string]string) {
	o.Annotations = v
}

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

func (o Skill) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.CategoryUid) {
		toSerialize["category_uid"] = o.CategoryUid
	}
	toSerialize["class_uid"] = o.ClassUid
	if !IsNil(o.CategoryName) {
		toSerialize["category_name"] = o.CategoryName
	}
	if !IsNil(o.ClassName) {
		toSerialize["class_name"] = o.ClassName
	}
	if o.Annotations != nil {
		toSerialize["annotations"] = o.Annotations
	}
	return toSerialize, nil
}

type NullableSkill struct {
	value *Skill
	isSet bool
}

func (v NullableSkill) Get() *Skill {
	return v.value
}

func (v *NullableSkill) Set(val *Skill) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSkill(val *Skill) *NullableSkill {
	return &NullableSkill{value: val, isSet: true}
}

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

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