/*
Legal Entity Management API

API version: 3
*/

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

package legalentity

import (
	"encoding/json"

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

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

// UndefinedBeneficiary struct for UndefinedBeneficiary
type UndefinedBeneficiary struct {
	// The details of the undefined beneficiary.
	Description *string `json:"description,omitempty"`
	// The reference of the undefined beneficiary.
	Reference *string `json:"reference,omitempty"`
}

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

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

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

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

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

	return false
}

// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *UndefinedBeneficiary) SetDescription(v string) {
	o.Description = &v
}

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

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

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

	return false
}

// SetReference gets a reference to the given string and assigns it to the Reference field.
func (o *UndefinedBeneficiary) SetReference(v string) {
	o.Reference = &v
}

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

func (o UndefinedBeneficiary) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Description) {
		toSerialize["description"] = o.Description
	}
	if !common.IsNil(o.Reference) {
		toSerialize["reference"] = o.Reference
	}
	return toSerialize, nil
}

type NullableUndefinedBeneficiary struct {
	value *UndefinedBeneficiary
	isSet bool
}

func (v NullableUndefinedBeneficiary) Get() *UndefinedBeneficiary {
	return v.value
}

func (v *NullableUndefinedBeneficiary) Set(val *UndefinedBeneficiary) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUndefinedBeneficiary(val *UndefinedBeneficiary) *NullableUndefinedBeneficiary {
	return &NullableUndefinedBeneficiary{value: val, isSet: true}
}

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

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