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

// SubMerchantInfo struct for SubMerchantInfo
type SubMerchantInfo struct {
	Address *BillingAddress `json:"address,omitempty"`
	Amount  *Amount         `json:"amount,omitempty"`
	// Required for transactions performed by registered payment facilitators. The email associated with the sub-merchant's account.
	Email *string `json:"email,omitempty"`
	// Required for transactions performed by registered payment facilitators. A unique identifier that you create for the sub-merchant, used by schemes to identify the sub-merchant.  * Format: Alphanumeric * Maximum length: 15 characters
	Id *string `json:"id,omitempty"`
	// Required for transactions performed by registered payment facilitators. The sub-merchant's 4-digit Merchant Category Code (MCC).  * Format: Numeric * Fixed length: 4 digits
	Mcc *string `json:"mcc,omitempty"`
	// Required for transactions performed by registered payment facilitators. The name of the sub-merchant. Based on scheme specifications, this value will overwrite the shopper statement that will appear in the card statement. * Format: Alphanumeric * Maximum length: 22 characters
	Name *string `json:"name,omitempty"`
	// Required for transactions performed by registered payment facilitators. The phone number associated with the sub-merchant's account.
	PhoneNumber     *string `json:"phoneNumber,omitempty"`
	RegisteredSince *string `json:"registeredSince,omitempty"`
	// Required for transactions performed by registered payment facilitators. The tax ID of the sub-merchant. * Format: Numeric * Fixed length: 11 digits for the CPF or 14 digits for the CNPJ
	TaxId *string `json:"taxId,omitempty"`
	// Required for transactions performed by registered payment facilitators. The sub-merchant's URL on the platform, i.e. the sub-merchant's shop.
	Url *string `json:"url,omitempty"`
}

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

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

// GetAddress returns the Address field value if set, zero value otherwise.
func (o *SubMerchantInfo) GetAddress() BillingAddress {
	if o == nil || common.IsNil(o.Address) {
		var ret BillingAddress
		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 *SubMerchantInfo) GetAddressOk() (*BillingAddress, 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 *SubMerchantInfo) HasAddress() bool {
	if o != nil && !common.IsNil(o.Address) {
		return true
	}

	return false
}

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

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

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

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

	return false
}

// SetAmount gets a reference to the given Amount and assigns it to the Amount field.
func (o *SubMerchantInfo) SetAmount(v Amount) {
	o.Amount = &v
}

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

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

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

	return false
}

// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *SubMerchantInfo) SetEmail(v string) {
	o.Email = &v
}

// GetId returns the Id field value if set, zero value otherwise.
func (o *SubMerchantInfo) 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 *SubMerchantInfo) 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 *SubMerchantInfo) 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 *SubMerchantInfo) SetId(v string) {
	o.Id = &v
}

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

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

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

	return false
}

// SetMcc gets a reference to the given string and assigns it to the Mcc field.
func (o *SubMerchantInfo) SetMcc(v string) {
	o.Mcc = &v
}

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

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

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

	return false
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *SubMerchantInfo) SetName(v string) {
	o.Name = &v
}

// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise.
func (o *SubMerchantInfo) 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 *SubMerchantInfo) 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 *SubMerchantInfo) 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 *SubMerchantInfo) SetPhoneNumber(v string) {
	o.PhoneNumber = &v
}

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

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

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

	return false
}

// SetRegisteredSince gets a reference to the given string and assigns it to the RegisteredSince field.
func (o *SubMerchantInfo) SetRegisteredSince(v string) {
	o.RegisteredSince = &v
}

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

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

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

	return false
}

// SetTaxId gets a reference to the given string and assigns it to the TaxId field.
func (o *SubMerchantInfo) SetTaxId(v string) {
	o.TaxId = &v
}

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

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

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

	return false
}

// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *SubMerchantInfo) SetUrl(v string) {
	o.Url = &v
}

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

func (o SubMerchantInfo) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Address) {
		toSerialize["address"] = o.Address
	}
	if !common.IsNil(o.Amount) {
		toSerialize["amount"] = o.Amount
	}
	if !common.IsNil(o.Email) {
		toSerialize["email"] = o.Email
	}
	if !common.IsNil(o.Id) {
		toSerialize["id"] = o.Id
	}
	if !common.IsNil(o.Mcc) {
		toSerialize["mcc"] = o.Mcc
	}
	if !common.IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if !common.IsNil(o.PhoneNumber) {
		toSerialize["phoneNumber"] = o.PhoneNumber
	}
	if !common.IsNil(o.RegisteredSince) {
		toSerialize["registeredSince"] = o.RegisteredSince
	}
	if !common.IsNil(o.TaxId) {
		toSerialize["taxId"] = o.TaxId
	}
	if !common.IsNil(o.Url) {
		toSerialize["url"] = o.Url
	}
	return toSerialize, nil
}

type NullableSubMerchantInfo struct {
	value *SubMerchantInfo
	isSet bool
}

func (v NullableSubMerchantInfo) Get() *SubMerchantInfo {
	return v.value
}

func (v *NullableSubMerchantInfo) Set(val *SubMerchantInfo) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSubMerchantInfo(val *SubMerchantInfo) *NullableSubMerchantInfo {
	return &NullableSubMerchantInfo{value: val, isSet: true}
}

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

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