/*
Management API

API version: 3
*/

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

package management

import (
	"encoding/json"

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

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

// Store struct for Store
type Store struct {
	Links   *Links         `json:"_links,omitempty"`
	Address *StoreLocation `json:"address,omitempty"`
	// The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with.  If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account.
	BusinessLineIds []string `json:"businessLineIds,omitempty"`
	// The description of the store.
	Description *string `json:"description,omitempty"`
	// The unique identifier of the store, used by certain payment methods and tax authorities.  Required for CNPJ in Brazil, in the format 00.000.000/0000-00 separated by dots, slashes, hyphens, or without separators.  Optional for SIRET in France, up to 14 digits.  Optional for Zip in Australia, up to 50 digits.
	ExternalReferenceId *string `json:"externalReferenceId,omitempty"`
	// The unique identifier of the store. This value is generated by Adyen.
	Id *string `json:"id,omitempty"`
	// The unique identifier of the merchant account that the store belongs to.
	MerchantId *string `json:"merchantId,omitempty"`
	// The phone number of the store, including '+' and country code in the [E.164](https://en.wikipedia.org/wiki/E.164) format. If passed in a different format, we convert and validate the phone number against E.164.
	PhoneNumber *string `json:"phoneNumber,omitempty"`
	// A reference to recognize the store by. Also known as the store code.  Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_)
	Reference *string `json:"reference,omitempty"`
	// The store name shown on the shopper's bank or credit card statement and on the shopper receipt.
	ShopperStatement   *string                  `json:"shopperStatement,omitempty"`
	SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"`
	// The status of the store. Possible values are:  - **active**. This value is assigned automatically when a store is created.  - **inactive**. The terminals under the store are blocked from accepting new transactions, but capturing outstanding transactions is still possible. - **closed**. This status is irreversible. The terminals under the store are reassigned to the merchant inventory.
	Status *string `json:"status,omitempty"`
}

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

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

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

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

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

	return false
}

// SetLinks gets a reference to the given Links and assigns it to the Links field.
func (o *Store) SetLinks(v Links) {
	o.Links = &v
}

// GetAddress returns the Address field value if set, zero value otherwise.
func (o *Store) GetAddress() StoreLocation {
	if o == nil || common.IsNil(o.Address) {
		var ret StoreLocation
		return ret
	}
	return *o.Address
}

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

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

	return false
}

// SetAddress gets a reference to the given StoreLocation and assigns it to the Address field.
func (o *Store) SetAddress(v StoreLocation) {
	o.Address = &v
}

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

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

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

	return false
}

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

// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Store) 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 *Store) 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 *Store) 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 *Store) SetDescription(v string) {
	o.Description = &v
}

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

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

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

	return false
}

// SetExternalReferenceId gets a reference to the given string and assigns it to the ExternalReferenceId field.
func (o *Store) SetExternalReferenceId(v string) {
	o.ExternalReferenceId = &v
}

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

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

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

	return false
}

// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Store) SetId(v string) {
	o.Id = &v
}

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

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

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

	return false
}

// SetMerchantId gets a reference to the given string and assigns it to the MerchantId field.
func (o *Store) SetMerchantId(v string) {
	o.MerchantId = &v
}

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

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

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

	return false
}

// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field.
func (o *Store) SetPhoneNumber(v string) {
	o.PhoneNumber = &v
}

// GetReference returns the Reference field value if set, zero value otherwise.
func (o *Store) 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 *Store) 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 *Store) 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 *Store) SetReference(v string) {
	o.Reference = &v
}

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

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

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

	return false
}

// SetShopperStatement gets a reference to the given string and assigns it to the ShopperStatement field.
func (o *Store) SetShopperStatement(v string) {
	o.ShopperStatement = &v
}

// GetSplitConfiguration returns the SplitConfiguration field value if set, zero value otherwise.
func (o *Store) GetSplitConfiguration() StoreSplitConfiguration {
	if o == nil || common.IsNil(o.SplitConfiguration) {
		var ret StoreSplitConfiguration
		return ret
	}
	return *o.SplitConfiguration
}

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

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

	return false
}

// SetSplitConfiguration gets a reference to the given StoreSplitConfiguration and assigns it to the SplitConfiguration field.
func (o *Store) SetSplitConfiguration(v StoreSplitConfiguration) {
	o.SplitConfiguration = &v
}

// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Store) 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 *Store) 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 *Store) 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 *Store) SetStatus(v string) {
	o.Status = &v
}

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

func (o Store) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Links) {
		toSerialize["_links"] = o.Links
	}
	if !common.IsNil(o.Address) {
		toSerialize["address"] = o.Address
	}
	if !common.IsNil(o.BusinessLineIds) {
		toSerialize["businessLineIds"] = o.BusinessLineIds
	}
	if !common.IsNil(o.Description) {
		toSerialize["description"] = o.Description
	}
	if !common.IsNil(o.ExternalReferenceId) {
		toSerialize["externalReferenceId"] = o.ExternalReferenceId
	}
	if !common.IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !common.IsNil(o.MerchantId) {
		toSerialize["merchantId"] = o.MerchantId
	}
	if !common.IsNil(o.PhoneNumber) {
		toSerialize["phoneNumber"] = o.PhoneNumber
	}
	if !common.IsNil(o.Reference) {
		toSerialize["reference"] = o.Reference
	}
	if !common.IsNil(o.ShopperStatement) {
		toSerialize["shopperStatement"] = o.ShopperStatement
	}
	if !common.IsNil(o.SplitConfiguration) {
		toSerialize["splitConfiguration"] = o.SplitConfiguration
	}
	if !common.IsNil(o.Status) {
		toSerialize["status"] = o.Status
	}
	return toSerialize, nil
}

type NullableStore struct {
	value *Store
	isSet bool
}

func (v NullableStore) Get() *Store {
	return v.value
}

func (v *NullableStore) Set(val *Store) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableStore(val *Store) *NullableStore {
	return &NullableStore{value: val, isSet: true}
}

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

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

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