/*
Adyen Checkout API

API version: 71
*/

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

package checkout

import (
	"encoding/json"

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

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

// DonationCampaignsRequest struct for DonationCampaignsRequest
type DonationCampaignsRequest struct {
	// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
	Currency string `json:"currency"`
	// Locale on the shopper interaction device.
	Locale *string `json:"locale,omitempty"`
	// Your merchant account identifier.
	MerchantAccount string `json:"merchantAccount"`
}

// NewDonationCampaignsRequest instantiates a new DonationCampaignsRequest 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 NewDonationCampaignsRequest(currency string, merchantAccount string) *DonationCampaignsRequest {
	this := DonationCampaignsRequest{}
	this.Currency = currency
	this.MerchantAccount = merchantAccount
	return &this
}

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

// GetCurrency returns the Currency field value
func (o *DonationCampaignsRequest) GetCurrency() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Currency
}

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

// SetCurrency sets field value
func (o *DonationCampaignsRequest) SetCurrency(v string) {
	o.Currency = v
}

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

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

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

	return false
}

// SetLocale gets a reference to the given string and assigns it to the Locale field.
func (o *DonationCampaignsRequest) SetLocale(v string) {
	o.Locale = &v
}

// GetMerchantAccount returns the MerchantAccount field value
func (o *DonationCampaignsRequest) GetMerchantAccount() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.MerchantAccount
}

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

// SetMerchantAccount sets field value
func (o *DonationCampaignsRequest) SetMerchantAccount(v string) {
	o.MerchantAccount = v
}

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

func (o DonationCampaignsRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["currency"] = o.Currency
	if !common.IsNil(o.Locale) {
		toSerialize["locale"] = o.Locale
	}
	toSerialize["merchantAccount"] = o.MerchantAccount
	return toSerialize, nil
}

type NullableDonationCampaignsRequest struct {
	value *DonationCampaignsRequest
	isSet bool
}

func (v NullableDonationCampaignsRequest) Get() *DonationCampaignsRequest {
	return v.value
}

func (v *NullableDonationCampaignsRequest) Set(val *DonationCampaignsRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDonationCampaignsRequest(val *DonationCampaignsRequest) *NullableDonationCampaignsRequest {
	return &NullableDonationCampaignsRequest{value: val, isSet: true}
}

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

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