/*
Adyen Checkout API

API version: 71
*/

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

package checkout

import (
	"encoding/json"

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

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

// EnhancedSchemeData struct for EnhancedSchemeData
type EnhancedSchemeData struct {
	Airline *Airline `json:"airline,omitempty"`
}

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

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

// GetAirline returns the Airline field value if set, zero value otherwise.
func (o *EnhancedSchemeData) GetAirline() Airline {
	if o == nil || common.IsNil(o.Airline) {
		var ret Airline
		return ret
	}
	return *o.Airline
}

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

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

	return false
}

// SetAirline gets a reference to the given Airline and assigns it to the Airline field.
func (o *EnhancedSchemeData) SetAirline(v Airline) {
	o.Airline = &v
}

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

func (o EnhancedSchemeData) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Airline) {
		toSerialize["airline"] = o.Airline
	}
	return toSerialize, nil
}

type NullableEnhancedSchemeData struct {
	value *EnhancedSchemeData
	isSet bool
}

func (v NullableEnhancedSchemeData) Get() *EnhancedSchemeData {
	return v.value
}

func (v *NullableEnhancedSchemeData) Set(val *EnhancedSchemeData) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEnhancedSchemeData(val *EnhancedSchemeData) *NullableEnhancedSchemeData {
	return &NullableEnhancedSchemeData{value: val, isSet: true}
}

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

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