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

// StopTaskRequest struct for StopTaskRequest
type StopTaskRequest struct {
	// source name list
	SourceNameList []string `json:"source_name_list,omitempty"`
	// time duration waiting task stop
	TimeoutDuration *string `json:"timeout_duration,omitempty"`
}

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

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

// GetSourceNameList returns the SourceNameList field value if set, zero value otherwise.
func (o *StopTaskRequest) 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 *StopTaskRequest) 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 *StopTaskRequest) 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 *StopTaskRequest) SetSourceNameList(v []string) {
	o.SourceNameList = v
}

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

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

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

	return false
}

// SetTimeoutDuration gets a reference to the given string and assigns it to the TimeoutDuration field.
func (o *StopTaskRequest) SetTimeoutDuration(v string) {
	o.TimeoutDuration = &v
}

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

func (o StopTaskRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.SourceNameList) {
		toSerialize["source_name_list"] = o.SourceNameList
	}
	if !IsNil(o.TimeoutDuration) {
		toSerialize["timeout_duration"] = o.TimeoutDuration
	}
	return toSerialize, nil
}

type NullableStopTaskRequest struct {
	value *StopTaskRequest
	isSet bool
}

func (v NullableStopTaskRequest) Get() *StopTaskRequest {
	return v.value
}

func (v *NullableStopTaskRequest) Set(val *StopTaskRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableStopTaskRequest(val *StopTaskRequest) *NullableStopTaskRequest {
	return &NullableStopTaskRequest{value: val, isSet: true}
}

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

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