/*
Dispute webhooks

API version: 1
*/

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

package disputewebhook

import (
	"encoding/json"

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

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

// DisputeNotificationRequest struct for DisputeNotificationRequest
type DisputeNotificationRequest struct {
	Data DisputeEventNotification `json:"data"`
	// Type of webhook.
	Type string `json:"type"`
}

// NewDisputeNotificationRequest instantiates a new DisputeNotificationRequest 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 NewDisputeNotificationRequest(data DisputeEventNotification, type_ string) *DisputeNotificationRequest {
	this := DisputeNotificationRequest{}
	this.Data = data
	this.Type = type_
	return &this
}

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

// GetData returns the Data field value
func (o *DisputeNotificationRequest) GetData() DisputeEventNotification {
	if o == nil {
		var ret DisputeEventNotification
		return ret
	}

	return o.Data
}

// GetDataOk returns a tuple with the Data field value
// and a boolean to check if the value has been set.
func (o *DisputeNotificationRequest) GetDataOk() (*DisputeEventNotification, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Data, true
}

// SetData sets field value
func (o *DisputeNotificationRequest) SetData(v DisputeEventNotification) {
	o.Data = v
}

// GetType returns the Type field value
func (o *DisputeNotificationRequest) GetType() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Type
}

// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *DisputeNotificationRequest) GetTypeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Type, true
}

// SetType sets field value
func (o *DisputeNotificationRequest) SetType(v string) {
	o.Type = v
}

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

func (o DisputeNotificationRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["data"] = o.Data
	toSerialize["type"] = o.Type
	return toSerialize, nil
}

type NullableDisputeNotificationRequest struct {
	value *DisputeNotificationRequest
	isSet bool
}

func (v NullableDisputeNotificationRequest) Get() *DisputeNotificationRequest {
	return v.value
}

func (v *NullableDisputeNotificationRequest) Set(val *DisputeNotificationRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDisputeNotificationRequest(val *DisputeNotificationRequest) *NullableDisputeNotificationRequest {
	return &NullableDisputeNotificationRequest{value: val, isSet: true}
}

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

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

func (o *DisputeNotificationRequest) isValidType() bool {
	var allowedEnumValues = []string{"balancePlatform.dispute.created", "balancePlatform.dispute.updated"}
	for _, allowed := range allowedEnumValues {
		if o.GetType() == allowed {
			return true
		}
	}
	return false
}
