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

// EnableRelayRequest action to start a relay request
type EnableRelayRequest struct {
	// starting GTID of the upstream binlog
	RelayBinlogGtid NullableString `json:"relay_binlog_gtid,omitempty"`
	// starting filename of the upstream binlog
	RelayBinlogName NullableString `json:"relay_binlog_name,omitempty"`
	// the directory where the relay log is stored
	RelayDir NullableString `json:"relay_dir,omitempty"`
	// worker name list
	WorkerNameList []string `json:"worker_name_list,omitempty"`
}

// NewEnableRelayRequest instantiates a new EnableRelayRequest 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 NewEnableRelayRequest() *EnableRelayRequest {
	this := EnableRelayRequest{}
	var relayDir string = "./relay_log"
	this.RelayDir = *NewNullableString(&relayDir)
	return &this
}

// NewEnableRelayRequestWithDefaults instantiates a new EnableRelayRequest 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 NewEnableRelayRequestWithDefaults() *EnableRelayRequest {
	this := EnableRelayRequest{}
	var relayDir string = "./relay_log"
	this.RelayDir = *NewNullableString(&relayDir)
	return &this
}

// GetRelayBinlogGtid returns the RelayBinlogGtid field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EnableRelayRequest) GetRelayBinlogGtid() string {
	if o == nil || IsNil(o.RelayBinlogGtid.Get()) {
		var ret string
		return ret
	}
	return *o.RelayBinlogGtid.Get()
}

// GetRelayBinlogGtidOk returns a tuple with the RelayBinlogGtid field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EnableRelayRequest) GetRelayBinlogGtidOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.RelayBinlogGtid.Get(), o.RelayBinlogGtid.IsSet()
}

// HasRelayBinlogGtid returns a boolean if a field has been set.
func (o *EnableRelayRequest) HasRelayBinlogGtid() bool {
	if o != nil && o.RelayBinlogGtid.IsSet() {
		return true
	}

	return false
}

// SetRelayBinlogGtid gets a reference to the given NullableString and assigns it to the RelayBinlogGtid field.
func (o *EnableRelayRequest) SetRelayBinlogGtid(v string) {
	o.RelayBinlogGtid.Set(&v)
}

// SetRelayBinlogGtidNil sets the value for RelayBinlogGtid to be an explicit nil
func (o *EnableRelayRequest) SetRelayBinlogGtidNil() {
	o.RelayBinlogGtid.Set(nil)
}

// UnsetRelayBinlogGtid ensures that no value is present for RelayBinlogGtid, not even an explicit nil
func (o *EnableRelayRequest) UnsetRelayBinlogGtid() {
	o.RelayBinlogGtid.Unset()
}

// GetRelayBinlogName returns the RelayBinlogName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EnableRelayRequest) GetRelayBinlogName() string {
	if o == nil || IsNil(o.RelayBinlogName.Get()) {
		var ret string
		return ret
	}
	return *o.RelayBinlogName.Get()
}

// GetRelayBinlogNameOk returns a tuple with the RelayBinlogName field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EnableRelayRequest) GetRelayBinlogNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.RelayBinlogName.Get(), o.RelayBinlogName.IsSet()
}

// HasRelayBinlogName returns a boolean if a field has been set.
func (o *EnableRelayRequest) HasRelayBinlogName() bool {
	if o != nil && o.RelayBinlogName.IsSet() {
		return true
	}

	return false
}

// SetRelayBinlogName gets a reference to the given NullableString and assigns it to the RelayBinlogName field.
func (o *EnableRelayRequest) SetRelayBinlogName(v string) {
	o.RelayBinlogName.Set(&v)
}

// SetRelayBinlogNameNil sets the value for RelayBinlogName to be an explicit nil
func (o *EnableRelayRequest) SetRelayBinlogNameNil() {
	o.RelayBinlogName.Set(nil)
}

// UnsetRelayBinlogName ensures that no value is present for RelayBinlogName, not even an explicit nil
func (o *EnableRelayRequest) UnsetRelayBinlogName() {
	o.RelayBinlogName.Unset()
}

// GetRelayDir returns the RelayDir field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EnableRelayRequest) GetRelayDir() string {
	if o == nil || IsNil(o.RelayDir.Get()) {
		var ret string
		return ret
	}
	return *o.RelayDir.Get()
}

// GetRelayDirOk returns a tuple with the RelayDir field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EnableRelayRequest) GetRelayDirOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.RelayDir.Get(), o.RelayDir.IsSet()
}

// HasRelayDir returns a boolean if a field has been set.
func (o *EnableRelayRequest) HasRelayDir() bool {
	if o != nil && o.RelayDir.IsSet() {
		return true
	}

	return false
}

// SetRelayDir gets a reference to the given NullableString and assigns it to the RelayDir field.
func (o *EnableRelayRequest) SetRelayDir(v string) {
	o.RelayDir.Set(&v)
}

// SetRelayDirNil sets the value for RelayDir to be an explicit nil
func (o *EnableRelayRequest) SetRelayDirNil() {
	o.RelayDir.Set(nil)
}

// UnsetRelayDir ensures that no value is present for RelayDir, not even an explicit nil
func (o *EnableRelayRequest) UnsetRelayDir() {
	o.RelayDir.Unset()
}

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

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

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

	return false
}

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

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

func (o EnableRelayRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if o.RelayBinlogGtid.IsSet() {
		toSerialize["relay_binlog_gtid"] = o.RelayBinlogGtid.Get()
	}
	if o.RelayBinlogName.IsSet() {
		toSerialize["relay_binlog_name"] = o.RelayBinlogName.Get()
	}
	if o.RelayDir.IsSet() {
		toSerialize["relay_dir"] = o.RelayDir.Get()
	}
	if !IsNil(o.WorkerNameList) {
		toSerialize["worker_name_list"] = o.WorkerNameList
	}
	return toSerialize, nil
}

type NullableEnableRelayRequest struct {
	value *EnableRelayRequest
	isSet bool
}

func (v NullableEnableRelayRequest) Get() *EnableRelayRequest {
	return v.value
}

func (v *NullableEnableRelayRequest) Set(val *EnableRelayRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEnableRelayRequest(val *EnableRelayRequest) *NullableEnableRelayRequest {
	return &NullableEnableRelayRequest{value: val, isSet: true}
}

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

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