/*
Transfer webhooks

API version: 4
*/

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

package transferwebhook

import (
	"encoding/json"

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

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

// Lodging struct for Lodging
type Lodging struct {
	// The check-in date.
	CheckInDate *string `json:"checkInDate,omitempty"`
	// The total number of nights the room is booked for.
	NumberOfNights *int32 `json:"numberOfNights,omitempty"`
}

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

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

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

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

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

	return false
}

// SetCheckInDate gets a reference to the given string and assigns it to the CheckInDate field.
func (o *Lodging) SetCheckInDate(v string) {
	o.CheckInDate = &v
}

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

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

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

	return false
}

// SetNumberOfNights gets a reference to the given int32 and assigns it to the NumberOfNights field.
func (o *Lodging) SetNumberOfNights(v int32) {
	o.NumberOfNights = &v
}

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

func (o Lodging) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.CheckInDate) {
		toSerialize["checkInDate"] = o.CheckInDate
	}
	if !common.IsNil(o.NumberOfNights) {
		toSerialize["numberOfNights"] = o.NumberOfNights
	}
	return toSerialize, nil
}

type NullableLodging struct {
	value *Lodging
	isSet bool
}

func (v NullableLodging) Get() *Lodging {
	return v.value
}

func (v *NullableLodging) Set(val *Lodging) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableLodging(val *Lodging) *NullableLodging {
	return &NullableLodging{value: val, isSet: true}
}

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

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