/*
TiDB Cloud Console API

TiDB Cloud Console API.

API version: v1beta1
*/

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

package client

import (
	"encoding/json"
)

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

// ClusterNodeChangingProgress struct for ClusterNodeChangingProgress
type ClusterNodeChangingProgress struct {
	// The number of nodes that match the specified node spec.
	MatchingNodeSpecNodeCount *int32 `json:"matchingNodeSpecNodeCount,omitempty"`
	// The number of nodes pending deletion. This value appears only during node deletion operations.
	RemainingDeletionNodeCount *int32 `json:"remainingDeletionNodeCount,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _ClusterNodeChangingProgress ClusterNodeChangingProgress

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

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

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

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

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

	return false
}

// SetMatchingNodeSpecNodeCount gets a reference to the given int32 and assigns it to the MatchingNodeSpecNodeCount field.
func (o *ClusterNodeChangingProgress) SetMatchingNodeSpecNodeCount(v int32) {
	o.MatchingNodeSpecNodeCount = &v
}

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

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

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

	return false
}

// SetRemainingDeletionNodeCount gets a reference to the given int32 and assigns it to the RemainingDeletionNodeCount field.
func (o *ClusterNodeChangingProgress) SetRemainingDeletionNodeCount(v int32) {
	o.RemainingDeletionNodeCount = &v
}

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

func (o ClusterNodeChangingProgress) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.MatchingNodeSpecNodeCount) {
		toSerialize["matchingNodeSpecNodeCount"] = o.MatchingNodeSpecNodeCount
	}
	if !IsNil(o.RemainingDeletionNodeCount) {
		toSerialize["remainingDeletionNodeCount"] = o.RemainingDeletionNodeCount
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *ClusterNodeChangingProgress) UnmarshalJSON(data []byte) (err error) {
	varClusterNodeChangingProgress := _ClusterNodeChangingProgress{}

	err = json.Unmarshal(data, &varClusterNodeChangingProgress)

	if err != nil {
		return err
	}

	*o = ClusterNodeChangingProgress(varClusterNodeChangingProgress)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "matchingNodeSpecNodeCount")
		delete(additionalProperties, "remainingDeletionNodeCount")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableClusterNodeChangingProgress struct {
	value *ClusterNodeChangingProgress
	isSet bool
}

func (v NullableClusterNodeChangingProgress) Get() *ClusterNodeChangingProgress {
	return v.value
}

func (v *NullableClusterNodeChangingProgress) Set(val *ClusterNodeChangingProgress) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableClusterNodeChangingProgress(val *ClusterNodeChangingProgress) *NullableClusterNodeChangingProgress {
	return &NullableClusterNodeChangingProgress{value: val, isSet: true}
}

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

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


