/*
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 StoreCreationRequest type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &StoreCreationRequest{}

// StoreCreationRequest struct for StoreCreationRequest
type StoreCreationRequest struct {
	Address StoreLocation `json:"address"`
	// The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/legalentity/latest/post/businessLines#responses-200-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"`
	// Your description of the store.
	Description string `json:"description"`
	// 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 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"`
	// Your 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 (_).  If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id).
	Reference *string `json:"reference,omitempty"`
	// The store name to be shown on the shopper's bank or credit card statement and on the shopper receipt. Maximum length: 22 characters; can't be all numbers.
	ShopperStatement   string                   `json:"shopperStatement"`
	SplitConfiguration *StoreSplitConfiguration `json:"splitConfiguration,omitempty"`
}

// NewStoreCreationRequest instantiates a new StoreCreationRequest 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 NewStoreCreationRequest(address StoreLocation, description string, phoneNumber string, shopperStatement string) *StoreCreationRequest {
	this := StoreCreationRequest{}
	this.Address = address
	this.Description = description
	this.PhoneNumber = phoneNumber
	this.ShopperStatement = shopperStatement
	return &this
}

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

// GetAddress returns the Address field value
func (o *StoreCreationRequest) GetAddress() StoreLocation {
	if o == nil {
		var ret StoreLocation
		return ret
	}

	return o.Address
}

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

// SetAddress sets field value
func (o *StoreCreationRequest) SetAddress(v StoreLocation) {
	o.Address = v
}

// GetBusinessLineIds returns the BusinessLineIds field value if set, zero value otherwise.
func (o *StoreCreationRequest) 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 *StoreCreationRequest) 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 *StoreCreationRequest) 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 *StoreCreationRequest) SetBusinessLineIds(v []string) {
	o.BusinessLineIds = v
}

// GetDescription returns the Description field value
func (o *StoreCreationRequest) GetDescription() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Description
}

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

// SetDescription sets field value
func (o *StoreCreationRequest) SetDescription(v string) {
	o.Description = v
}

// GetExternalReferenceId returns the ExternalReferenceId field value if set, zero value otherwise.
func (o *StoreCreationRequest) 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 *StoreCreationRequest) 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 *StoreCreationRequest) 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 *StoreCreationRequest) SetExternalReferenceId(v string) {
	o.ExternalReferenceId = &v
}

// GetPhoneNumber returns the PhoneNumber field value
func (o *StoreCreationRequest) GetPhoneNumber() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.PhoneNumber
}

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

// SetPhoneNumber sets field value
func (o *StoreCreationRequest) SetPhoneNumber(v string) {
	o.PhoneNumber = v
}

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

// GetShopperStatement returns the ShopperStatement field value
func (o *StoreCreationRequest) GetShopperStatement() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ShopperStatement
}

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

// SetShopperStatement sets field value
func (o *StoreCreationRequest) SetShopperStatement(v string) {
	o.ShopperStatement = v
}

// GetSplitConfiguration returns the SplitConfiguration field value if set, zero value otherwise.
func (o *StoreCreationRequest) 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 *StoreCreationRequest) 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 *StoreCreationRequest) 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 *StoreCreationRequest) SetSplitConfiguration(v StoreSplitConfiguration) {
	o.SplitConfiguration = &v
}

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

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

type NullableStoreCreationRequest struct {
	value *StoreCreationRequest
	isSet bool
}

func (v NullableStoreCreationRequest) Get() *StoreCreationRequest {
	return v.value
}

func (v *NullableStoreCreationRequest) Set(val *StoreCreationRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableStoreCreationRequest(val *StoreCreationRequest) *NullableStoreCreationRequest {
	return &NullableStoreCreationRequest{value: val, isSet: true}
}

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

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