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

// EventUrl struct for EventUrl
type EventUrl struct {
	// One or more local URLs to send event notifications to when using Terminal API.
	EventLocalUrls []Url `json:"eventLocalUrls,omitempty"`
	// One or more public URLs to send event notifications to when using Terminal API.
	EventPublicUrls []Url `json:"eventPublicUrls,omitempty"`
}

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

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

// GetEventLocalUrls returns the EventLocalUrls field value if set, zero value otherwise.
func (o *EventUrl) GetEventLocalUrls() []Url {
	if o == nil || common.IsNil(o.EventLocalUrls) {
		var ret []Url
		return ret
	}
	return o.EventLocalUrls
}

// GetEventLocalUrlsOk returns a tuple with the EventLocalUrls field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventUrl) GetEventLocalUrlsOk() ([]Url, bool) {
	if o == nil || common.IsNil(o.EventLocalUrls) {
		return nil, false
	}
	return o.EventLocalUrls, true
}

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

	return false
}

// SetEventLocalUrls gets a reference to the given []Url and assigns it to the EventLocalUrls field.
func (o *EventUrl) SetEventLocalUrls(v []Url) {
	o.EventLocalUrls = v
}

// GetEventPublicUrls returns the EventPublicUrls field value if set, zero value otherwise.
func (o *EventUrl) GetEventPublicUrls() []Url {
	if o == nil || common.IsNil(o.EventPublicUrls) {
		var ret []Url
		return ret
	}
	return o.EventPublicUrls
}

// GetEventPublicUrlsOk returns a tuple with the EventPublicUrls field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventUrl) GetEventPublicUrlsOk() ([]Url, bool) {
	if o == nil || common.IsNil(o.EventPublicUrls) {
		return nil, false
	}
	return o.EventPublicUrls, true
}

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

	return false
}

// SetEventPublicUrls gets a reference to the given []Url and assigns it to the EventPublicUrls field.
func (o *EventUrl) SetEventPublicUrls(v []Url) {
	o.EventPublicUrls = v
}

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

func (o EventUrl) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.EventLocalUrls) {
		toSerialize["eventLocalUrls"] = o.EventLocalUrls
	}
	if !common.IsNil(o.EventPublicUrls) {
		toSerialize["eventPublicUrls"] = o.EventPublicUrls
	}
	return toSerialize, nil
}

type NullableEventUrl struct {
	value *EventUrl
	isSet bool
}

func (v NullableEventUrl) Get() *EventUrl {
	return v.value
}

func (v *NullableEventUrl) Set(val *EventUrl) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEventUrl(val *EventUrl) *NullableEventUrl {
	return &NullableEventUrl{value: val, isSet: true}
}

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

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