/*
DM OpenAPI DOC

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 6.0.0
*/

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

package dm

import (
	"encoding/json"
)

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

// TaskIncrMigrateConf configuration of incremental tasks
type TaskIncrMigrateConf struct {
	// incremental synchronization of batch execution sql quantities
	ReplBatch *int32 `json:"repl_batch,omitempty"`
	// incremental task of concurrent
	ReplThreads *int32 `json:"repl_threads,omitempty"`
}

// NewTaskIncrMigrateConf instantiates a new TaskIncrMigrateConf 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 NewTaskIncrMigrateConf() *TaskIncrMigrateConf {
	this := TaskIncrMigrateConf{}
	var replBatch int32 = 100
	this.ReplBatch = &replBatch
	var replThreads int32 = 16
	this.ReplThreads = &replThreads
	return &this
}

// NewTaskIncrMigrateConfWithDefaults instantiates a new TaskIncrMigrateConf 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 NewTaskIncrMigrateConfWithDefaults() *TaskIncrMigrateConf {
	this := TaskIncrMigrateConf{}
	var replBatch int32 = 100
	this.ReplBatch = &replBatch
	var replThreads int32 = 16
	this.ReplThreads = &replThreads
	return &this
}

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

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

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

	return false
}

// SetReplBatch gets a reference to the given int32 and assigns it to the ReplBatch field.
func (o *TaskIncrMigrateConf) SetReplBatch(v int32) {
	o.ReplBatch = &v
}

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

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

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

	return false
}

// SetReplThreads gets a reference to the given int32 and assigns it to the ReplThreads field.
func (o *TaskIncrMigrateConf) SetReplThreads(v int32) {
	o.ReplThreads = &v
}

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

func (o TaskIncrMigrateConf) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.ReplBatch) {
		toSerialize["repl_batch"] = o.ReplBatch
	}
	if !IsNil(o.ReplThreads) {
		toSerialize["repl_threads"] = o.ReplThreads
	}
	return toSerialize, nil
}

type NullableTaskIncrMigrateConf struct {
	value *TaskIncrMigrateConf
	isSet bool
}

func (v NullableTaskIncrMigrateConf) Get() *TaskIncrMigrateConf {
	return v.value
}

func (v *NullableTaskIncrMigrateConf) Set(val *TaskIncrMigrateConf) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTaskIncrMigrateConf(val *TaskIncrMigrateConf) *NullableTaskIncrMigrateConf {
	return &NullableTaskIncrMigrateConf{value: val, isSet: true}
}

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

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