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

// Manifest struct for Manifest
type Manifest struct {
	Annotations map[string]string  `json:"annotations,omitempty"`
	Data        DeploymentManifest `json:"data"`
	Name        string             `json:"name"`
	Version     *string            `json:"version,omitempty"`
}

// NewManifest instantiates a new Manifest 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 NewManifest(data DeploymentManifest, name string) *Manifest {
	this := Manifest{}
	this.Data = data
	this.Name = name
	return &this
}

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

// GetAnnotations returns the Annotations field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Manifest) 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 *Manifest) 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 *Manifest) 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 *Manifest) SetAnnotations(v map[string]string) {
	o.Annotations = v
}

// GetData returns the Data field value
func (o *Manifest) GetData() DeploymentManifest {
	if o == nil {
		var ret DeploymentManifest
		return ret
	}

	return o.Data
}

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

// SetData sets field value
func (o *Manifest) SetData(v DeploymentManifest) {
	o.Data = v
}

// GetName returns the Name field value
func (o *Manifest) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

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

// SetName sets field value
func (o *Manifest) SetName(v string) {
	o.Name = v
}

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

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

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

	return false
}

// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *Manifest) SetVersion(v string) {
	o.Version = &v
}

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

func (o Manifest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.Annotations != nil {
		toSerialize["annotations"] = o.Annotations
	}
	toSerialize["data"] = o.Data
	toSerialize["name"] = o.Name
	if !IsNil(o.Version) {
		toSerialize["version"] = o.Version
	}
	return toSerialize, nil
}

type NullableManifest struct {
	value *Manifest
	isSet bool
}

func (v NullableManifest) Get() *Manifest {
	return v.value
}

func (v *NullableManifest) Set(val *Manifest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableManifest(val *Manifest) *NullableManifest {
	return &NullableManifest{value: val, isSet: true}
}

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

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