/*
ChromaDB API

This is OpenAPI schema for ChromaDB API.

API version: 1.0.0
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package openapi

import (
	"encoding/json"
)

// checks if the UpdateCollection type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UpdateCollection{}

// UpdateCollection struct for UpdateCollection
type UpdateCollection struct {
	NewName     *string                `json:"new_name,omitempty"`
	NewMetadata map[string]interface{} `json:"new_metadata,omitempty"`
}

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

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

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

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

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

	return false
}

// SetNewName gets a reference to the given string and assigns it to the NewName field.
func (o *UpdateCollection) SetNewName(v string) {
	o.NewName = &v
}

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

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

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

	return false
}

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

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

func (o UpdateCollection) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.NewName) {
		toSerialize["new_name"] = o.NewName
	}
	if !IsNil(o.NewMetadata) {
		toSerialize["new_metadata"] = o.NewMetadata
	}
	return toSerialize, nil
}

type NullableUpdateCollection struct {
	value *UpdateCollection
	isSet bool
}

func (v NullableUpdateCollection) Get() *UpdateCollection {
	return v.value
}

func (v *NullableUpdateCollection) Set(val *UpdateCollection) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUpdateCollection(val *UpdateCollection) *NullableUpdateCollection {
	return &NullableUpdateCollection{value: val, isSet: true}
}

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

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