/*
Management API

API version: 3
*/

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

package management

import (
	"encoding/json"

	"github.com/adyen/adyen-go-api-library/v21/src/common"
)

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

// Settings struct for Settings
type Settings struct {
	// The preferred Wi-Fi band, for use if the terminals support multiple bands. Possible values: All, 2.4GHz, 5GHz.
	Band *string `json:"band,omitempty"`
	// Indicates whether roaming is enabled on the terminals.
	Roaming *bool `json:"roaming,omitempty"`
	// The connection time-out in seconds. Minimum value: 0.
	Timeout *int32 `json:"timeout,omitempty"`
}

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

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

// GetBand returns the Band field value if set, zero value otherwise.
func (o *Settings) GetBand() string {
	if o == nil || common.IsNil(o.Band) {
		var ret string
		return ret
	}
	return *o.Band
}

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

// HasBand returns a boolean if a field has been set.
func (o *Settings) HasBand() bool {
	if o != nil && !common.IsNil(o.Band) {
		return true
	}

	return false
}

// SetBand gets a reference to the given string and assigns it to the Band field.
func (o *Settings) SetBand(v string) {
	o.Band = &v
}

// GetRoaming returns the Roaming field value if set, zero value otherwise.
func (o *Settings) GetRoaming() bool {
	if o == nil || common.IsNil(o.Roaming) {
		var ret bool
		return ret
	}
	return *o.Roaming
}

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

// HasRoaming returns a boolean if a field has been set.
func (o *Settings) HasRoaming() bool {
	if o != nil && !common.IsNil(o.Roaming) {
		return true
	}

	return false
}

// SetRoaming gets a reference to the given bool and assigns it to the Roaming field.
func (o *Settings) SetRoaming(v bool) {
	o.Roaming = &v
}

// GetTimeout returns the Timeout field value if set, zero value otherwise.
func (o *Settings) GetTimeout() int32 {
	if o == nil || common.IsNil(o.Timeout) {
		var ret int32
		return ret
	}
	return *o.Timeout
}

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

// HasTimeout returns a boolean if a field has been set.
func (o *Settings) HasTimeout() bool {
	if o != nil && !common.IsNil(o.Timeout) {
		return true
	}

	return false
}

// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field.
func (o *Settings) SetTimeout(v int32) {
	o.Timeout = &v
}

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

func (o Settings) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Band) {
		toSerialize["band"] = o.Band
	}
	if !common.IsNil(o.Roaming) {
		toSerialize["roaming"] = o.Roaming
	}
	if !common.IsNil(o.Timeout) {
		toSerialize["timeout"] = o.Timeout
	}
	return toSerialize, nil
}

type NullableSettings struct {
	value *Settings
	isSet bool
}

func (v NullableSettings) Get() *Settings {
	return v.value
}

func (v *NullableSettings) Set(val *Settings) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSettings(val *Settings) *NullableSettings {
	return &NullableSettings{value: val, isSet: true}
}

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

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