/*
POS Terminal Management API

API version: 1
*/

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

package posterminalmanagement

import (
	"encoding/json"

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

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

// MerchantAccount struct for MerchantAccount
type MerchantAccount struct {
	// List of terminals assigned to this merchant account as in-store terminals. This means that the terminal is ready to be boarded, or is already boarded.
	InStoreTerminals []string `json:"inStoreTerminals,omitempty"`
	// List of terminals assigned to the inventory of this merchant account.
	InventoryTerminals []string `json:"inventoryTerminals,omitempty"`
	// The merchant account.
	MerchantAccount string `json:"merchantAccount"`
	// Array of stores under this merchant account.
	Stores []Store `json:"stores,omitempty"`
}

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

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

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

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

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

	return false
}

// SetInStoreTerminals gets a reference to the given []string and assigns it to the InStoreTerminals field.
func (o *MerchantAccount) SetInStoreTerminals(v []string) {
	o.InStoreTerminals = v
}

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

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

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

	return false
}

// SetInventoryTerminals gets a reference to the given []string and assigns it to the InventoryTerminals field.
func (o *MerchantAccount) SetInventoryTerminals(v []string) {
	o.InventoryTerminals = v
}

// GetMerchantAccount returns the MerchantAccount field value
func (o *MerchantAccount) 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 *MerchantAccount) GetMerchantAccountOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.MerchantAccount, true
}

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

// GetStores returns the Stores field value if set, zero value otherwise.
func (o *MerchantAccount) GetStores() []Store {
	if o == nil || common.IsNil(o.Stores) {
		var ret []Store
		return ret
	}
	return o.Stores
}

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

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

	return false
}

// SetStores gets a reference to the given []Store and assigns it to the Stores field.
func (o *MerchantAccount) SetStores(v []Store) {
	o.Stores = v
}

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

func (o MerchantAccount) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.InStoreTerminals) {
		toSerialize["inStoreTerminals"] = o.InStoreTerminals
	}
	if !common.IsNil(o.InventoryTerminals) {
		toSerialize["inventoryTerminals"] = o.InventoryTerminals
	}
	toSerialize["merchantAccount"] = o.MerchantAccount
	if !common.IsNil(o.Stores) {
		toSerialize["stores"] = o.Stores
	}
	return toSerialize, nil
}

type NullableMerchantAccount struct {
	value *MerchantAccount
	isSet bool
}

func (v NullableMerchantAccount) Get() *MerchantAccount {
	return v.value
}

func (v *NullableMerchantAccount) Set(val *MerchantAccount) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMerchantAccount(val *MerchantAccount) *NullableMerchantAccount {
	return &NullableMerchantAccount{value: val, isSet: true}
}

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

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