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

// StartTaskRequest struct for StartTaskRequest
type StartTaskRequest struct {
	// whether to remove meta database in downstream database
	RemoveMeta *bool `json:"remove_meta,omitempty"`
	// time duration of safe mode
	SafeModeTimeDuration *string `json:"safe_mode_time_duration,omitempty"`
	// source name list
	SourceNameList []string `json:"source_name_list,omitempty"`
	// task start time
	StartTime *string `json:"start_time,omitempty"`
}

// NewStartTaskRequest instantiates a new StartTaskRequest 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 NewStartTaskRequest() *StartTaskRequest {
	this := StartTaskRequest{}
	var removeMeta bool = false
	this.RemoveMeta = &removeMeta
	return &this
}

// NewStartTaskRequestWithDefaults instantiates a new StartTaskRequest 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 NewStartTaskRequestWithDefaults() *StartTaskRequest {
	this := StartTaskRequest{}
	var removeMeta bool = false
	this.RemoveMeta = &removeMeta
	return &this
}

// GetRemoveMeta returns the RemoveMeta field value if set, zero value otherwise.
func (o *StartTaskRequest) GetRemoveMeta() bool {
	if o == nil || IsNil(o.RemoveMeta) {
		var ret bool
		return ret
	}
	return *o.RemoveMeta
}

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

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

	return false
}

// SetRemoveMeta gets a reference to the given bool and assigns it to the RemoveMeta field.
func (o *StartTaskRequest) SetRemoveMeta(v bool) {
	o.RemoveMeta = &v
}

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

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

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

	return false
}

// SetSafeModeTimeDuration gets a reference to the given string and assigns it to the SafeModeTimeDuration field.
func (o *StartTaskRequest) SetSafeModeTimeDuration(v string) {
	o.SafeModeTimeDuration = &v
}

// GetSourceNameList returns the SourceNameList field value if set, zero value otherwise.
func (o *StartTaskRequest) GetSourceNameList() []string {
	if o == nil || IsNil(o.SourceNameList) {
		var ret []string
		return ret
	}
	return o.SourceNameList
}

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

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

	return false
}

// SetSourceNameList gets a reference to the given []string and assigns it to the SourceNameList field.
func (o *StartTaskRequest) SetSourceNameList(v []string) {
	o.SourceNameList = v
}

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

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

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

	return false
}

// SetStartTime gets a reference to the given string and assigns it to the StartTime field.
func (o *StartTaskRequest) SetStartTime(v string) {
	o.StartTime = &v
}

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

func (o StartTaskRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.RemoveMeta) {
		toSerialize["remove_meta"] = o.RemoveMeta
	}
	if !IsNil(o.SafeModeTimeDuration) {
		toSerialize["safe_mode_time_duration"] = o.SafeModeTimeDuration
	}
	if !IsNil(o.SourceNameList) {
		toSerialize["source_name_list"] = o.SourceNameList
	}
	if !IsNil(o.StartTime) {
		toSerialize["start_time"] = o.StartTime
	}
	return toSerialize, nil
}

type NullableStartTaskRequest struct {
	value *StartTaskRequest
	isSet bool
}

func (v NullableStartTaskRequest) Get() *StartTaskRequest {
	return v.value
}

func (v *NullableStartTaskRequest) Set(val *StartTaskRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableStartTaskRequest(val *StartTaskRequest) *NullableStartTaskRequest {
	return &NullableStartTaskRequest{value: val, isSet: true}
}

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

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