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

// WebData struct for WebData
type WebData struct {
	// The URL of the website or the app store URL.
	WebAddress *string `json:"webAddress,omitempty"`
	// The unique identifier of the web address.
	WebAddressId *string `json:"webAddressId,omitempty"`
}

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

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

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

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

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

	return false
}

// SetWebAddress gets a reference to the given string and assigns it to the WebAddress field.
func (o *WebData) SetWebAddress(v string) {
	o.WebAddress = &v
}

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

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

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

	return false
}

// SetWebAddressId gets a reference to the given string and assigns it to the WebAddressId field.
func (o *WebData) SetWebAddressId(v string) {
	o.WebAddressId = &v
}

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

func (o WebData) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.WebAddress) {
		toSerialize["webAddress"] = o.WebAddress
	}
	if !common.IsNil(o.WebAddressId) {
		toSerialize["webAddressId"] = o.WebAddressId
	}
	return toSerialize, nil
}

type NullableWebData struct {
	value *WebData
	isSet bool
}

func (v NullableWebData) Get() *WebData {
	return v.value
}

func (v *NullableWebData) Set(val *WebData) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableWebData(val *WebData) *NullableWebData {
	return &NullableWebData{value: val, isSet: true}
}

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

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