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

// BirthData struct for BirthData
type BirthData struct {
	// The individual's date of birth, in YYYY-MM-DD format.
	DateOfBirth *string `json:"dateOfBirth,omitempty"`
}

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

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

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

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

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

	return false
}

// SetDateOfBirth gets a reference to the given string and assigns it to the DateOfBirth field.
func (o *BirthData) SetDateOfBirth(v string) {
	o.DateOfBirth = &v
}

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

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

type NullableBirthData struct {
	value *BirthData
	isSet bool
}

func (v NullableBirthData) Get() *BirthData {
	return v.value
}

func (v *NullableBirthData) Set(val *BirthData) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBirthData(val *BirthData) *NullableBirthData {
	return &NullableBirthData{value: val, isSet: true}
}

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

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