/*
Configuration API

API version: 2
*/

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

package balanceplatform

import (
	"encoding/json"

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

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

// BalanceAccountUpdateRequest struct for BalanceAccountUpdateRequest
type BalanceAccountUpdateRequest struct {
	// The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account.
	AccountHolderId *string `json:"accountHolderId,omitempty"`
	// A human-readable description of the balance account. You can use this parameter to distinguish between multiple balance accounts under an account holder.
	Description *string `json:"description,omitempty"`
	// A set of key and value pairs for general use. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.
	Metadata                     *map[string]string            `json:"metadata,omitempty"`
	PlatformPaymentConfiguration *PlatformPaymentConfiguration `json:"platformPaymentConfiguration,omitempty"`
	// Your reference to the balance account.
	Reference *string `json:"reference,omitempty"`
	// The status of the balance account. Payment instruments linked to the balance account can only be used if the balance account status is **active**.  Possible values: **active**, **closed**, **suspended**.
	Status *string `json:"status,omitempty"`
	// The time zone of the balance account. For example, **Europe/Amsterdam**. Defaults to the time zone of the account holder if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
	TimeZone *string `json:"timeZone,omitempty"`
}

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

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

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

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

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

	return false
}

// SetAccountHolderId gets a reference to the given string and assigns it to the AccountHolderId field.
func (o *BalanceAccountUpdateRequest) SetAccountHolderId(v string) {
	o.AccountHolderId = &v
}

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

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

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

	return false
}

// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *BalanceAccountUpdateRequest) SetDescription(v string) {
	o.Description = &v
}

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

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

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

	return false
}

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

// GetPlatformPaymentConfiguration returns the PlatformPaymentConfiguration field value if set, zero value otherwise.
func (o *BalanceAccountUpdateRequest) GetPlatformPaymentConfiguration() PlatformPaymentConfiguration {
	if o == nil || common.IsNil(o.PlatformPaymentConfiguration) {
		var ret PlatformPaymentConfiguration
		return ret
	}
	return *o.PlatformPaymentConfiguration
}

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

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

	return false
}

// SetPlatformPaymentConfiguration gets a reference to the given PlatformPaymentConfiguration and assigns it to the PlatformPaymentConfiguration field.
func (o *BalanceAccountUpdateRequest) SetPlatformPaymentConfiguration(v PlatformPaymentConfiguration) {
	o.PlatformPaymentConfiguration = &v
}

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

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

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

	return false
}

// SetReference gets a reference to the given string and assigns it to the Reference field.
func (o *BalanceAccountUpdateRequest) SetReference(v string) {
	o.Reference = &v
}

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

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

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

	return false
}

// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *BalanceAccountUpdateRequest) SetStatus(v string) {
	o.Status = &v
}

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

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

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

	return false
}

// SetTimeZone gets a reference to the given string and assigns it to the TimeZone field.
func (o *BalanceAccountUpdateRequest) SetTimeZone(v string) {
	o.TimeZone = &v
}

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

func (o BalanceAccountUpdateRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.AccountHolderId) {
		toSerialize["accountHolderId"] = o.AccountHolderId
	}
	if !common.IsNil(o.Description) {
		toSerialize["description"] = o.Description
	}
	if !common.IsNil(o.Metadata) {
		toSerialize["metadata"] = o.Metadata
	}
	if !common.IsNil(o.PlatformPaymentConfiguration) {
		toSerialize["platformPaymentConfiguration"] = o.PlatformPaymentConfiguration
	}
	if !common.IsNil(o.Reference) {
		toSerialize["reference"] = o.Reference
	}
	if !common.IsNil(o.Status) {
		toSerialize["status"] = o.Status
	}
	if !common.IsNil(o.TimeZone) {
		toSerialize["timeZone"] = o.TimeZone
	}
	return toSerialize, nil
}

type NullableBalanceAccountUpdateRequest struct {
	value *BalanceAccountUpdateRequest
	isSet bool
}

func (v NullableBalanceAccountUpdateRequest) Get() *BalanceAccountUpdateRequest {
	return v.value
}

func (v *NullableBalanceAccountUpdateRequest) Set(val *BalanceAccountUpdateRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableBalanceAccountUpdateRequest(val *BalanceAccountUpdateRequest) *NullableBalanceAccountUpdateRequest {
	return &NullableBalanceAccountUpdateRequest{value: val, isSet: true}
}

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

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

func (o *BalanceAccountUpdateRequest) isValidStatus() bool {
	var allowedEnumValues = []string{"active", "closed", "inactive", "suspended"}
	for _, allowed := range allowedEnumValues {
		if o.GetStatus() == allowed {
			return true
		}
	}
	return false
}
