/*
Adyen Payout API

API version: 68
*/

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

package payout

import (
	"encoding/json"

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

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

// SubmitResponse struct for SubmitResponse
type SubmitResponse struct {
	// This field contains additional data, which may be returned in a particular response.
	AdditionalData *map[string]string `json:"additionalData,omitempty"`
	// A new reference to uniquely identify this request.
	PspReference string `json:"pspReference"`
	// In case of refusal, an informational message for the reason.
	RefusalReason *string `json:"refusalReason,omitempty"`
	// The response: * In case of success, it is `payout-submit-received`. * In case of an error, an informational message is returned.
	ResultCode string `json:"resultCode"`
}

// NewSubmitResponse instantiates a new SubmitResponse 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 NewSubmitResponse(pspReference string, resultCode string) *SubmitResponse {
	this := SubmitResponse{}
	this.PspReference = pspReference
	this.ResultCode = resultCode
	return &this
}

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

// GetAdditionalData returns the AdditionalData field value if set, zero value otherwise.
func (o *SubmitResponse) GetAdditionalData() map[string]string {
	if o == nil || common.IsNil(o.AdditionalData) {
		var ret map[string]string
		return ret
	}
	return *o.AdditionalData
}

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

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

	return false
}

// SetAdditionalData gets a reference to the given map[string]string and assigns it to the AdditionalData field.
func (o *SubmitResponse) SetAdditionalData(v map[string]string) {
	o.AdditionalData = &v
}

// GetPspReference returns the PspReference field value
func (o *SubmitResponse) GetPspReference() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.PspReference
}

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

// SetPspReference sets field value
func (o *SubmitResponse) SetPspReference(v string) {
	o.PspReference = v
}

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

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

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

	return false
}

// SetRefusalReason gets a reference to the given string and assigns it to the RefusalReason field.
func (o *SubmitResponse) SetRefusalReason(v string) {
	o.RefusalReason = &v
}

// GetResultCode returns the ResultCode field value
func (o *SubmitResponse) GetResultCode() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ResultCode
}

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

// SetResultCode sets field value
func (o *SubmitResponse) SetResultCode(v string) {
	o.ResultCode = v
}

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

func (o SubmitResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.AdditionalData) {
		toSerialize["additionalData"] = o.AdditionalData
	}
	toSerialize["pspReference"] = o.PspReference
	if !common.IsNil(o.RefusalReason) {
		toSerialize["refusalReason"] = o.RefusalReason
	}
	toSerialize["resultCode"] = o.ResultCode
	return toSerialize, nil
}

type NullableSubmitResponse struct {
	value *SubmitResponse
	isSet bool
}

func (v NullableSubmitResponse) Get() *SubmitResponse {
	return v.value
}

func (v *NullableSubmitResponse) Set(val *SubmitResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSubmitResponse(val *SubmitResponse) *NullableSubmitResponse {
	return &NullableSubmitResponse{value: val, isSet: true}
}

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

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