/*
Transfer webhooks

API version: 4
*/

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

package transferwebhook

import (
	"encoding/json"

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

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

// CardIdentification struct for CardIdentification
type CardIdentification struct {
	// The expiry month of the card.  Format: two digits. Add a leading zero for single-digit months. For example: * 03 = March * 11 = November
	ExpiryMonth *string `json:"expiryMonth,omitempty"`
	// The expiry year of the card.  Format: four digits. For example: 2020
	ExpiryYear *string `json:"expiryYear,omitempty"`
	// The issue number of the card. Applies only to some UK debit cards.
	IssueNumber *string `json:"issueNumber,omitempty"`
	// The card number without any separators.  For security, the response only includes the last four digits of the card number.
	Number *string `json:"number,omitempty"`
	// The month when the card was issued. Applies only to some UK debit cards.  Format: two digits. Add a leading zero for single-digit months. For example: * 03 = March * 11 = November
	StartMonth *string `json:"startMonth,omitempty"`
	// The year when the card was issued. Applies only to some UK debit cards.  Format: four digits. For example: 2020
	StartYear *string `json:"startYear,omitempty"`
	// The unique [token](/payouts/payout-service/pay-out-to-cards/manage-card-information#save-card-details) created to identify the counterparty.
	StoredPaymentMethodId *string `json:"storedPaymentMethodId,omitempty"`
}

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

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

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

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

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

	return false
}

// SetExpiryMonth gets a reference to the given string and assigns it to the ExpiryMonth field.
func (o *CardIdentification) SetExpiryMonth(v string) {
	o.ExpiryMonth = &v
}

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

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

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

	return false
}

// SetExpiryYear gets a reference to the given string and assigns it to the ExpiryYear field.
func (o *CardIdentification) SetExpiryYear(v string) {
	o.ExpiryYear = &v
}

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

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

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

	return false
}

// SetIssueNumber gets a reference to the given string and assigns it to the IssueNumber field.
func (o *CardIdentification) SetIssueNumber(v string) {
	o.IssueNumber = &v
}

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

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

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

	return false
}

// SetNumber gets a reference to the given string and assigns it to the Number field.
func (o *CardIdentification) SetNumber(v string) {
	o.Number = &v
}

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

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

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

	return false
}

// SetStartMonth gets a reference to the given string and assigns it to the StartMonth field.
func (o *CardIdentification) SetStartMonth(v string) {
	o.StartMonth = &v
}

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

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

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

	return false
}

// SetStartYear gets a reference to the given string and assigns it to the StartYear field.
func (o *CardIdentification) SetStartYear(v string) {
	o.StartYear = &v
}

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

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

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

	return false
}

// SetStoredPaymentMethodId gets a reference to the given string and assigns it to the StoredPaymentMethodId field.
func (o *CardIdentification) SetStoredPaymentMethodId(v string) {
	o.StoredPaymentMethodId = &v
}

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

func (o CardIdentification) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.ExpiryMonth) {
		toSerialize["expiryMonth"] = o.ExpiryMonth
	}
	if !common.IsNil(o.ExpiryYear) {
		toSerialize["expiryYear"] = o.ExpiryYear
	}
	if !common.IsNil(o.IssueNumber) {
		toSerialize["issueNumber"] = o.IssueNumber
	}
	if !common.IsNil(o.Number) {
		toSerialize["number"] = o.Number
	}
	if !common.IsNil(o.StartMonth) {
		toSerialize["startMonth"] = o.StartMonth
	}
	if !common.IsNil(o.StartYear) {
		toSerialize["startYear"] = o.StartYear
	}
	if !common.IsNil(o.StoredPaymentMethodId) {
		toSerialize["storedPaymentMethodId"] = o.StoredPaymentMethodId
	}
	return toSerialize, nil
}

type NullableCardIdentification struct {
	value *CardIdentification
	isSet bool
}

func (v NullableCardIdentification) Get() *CardIdentification {
	return v.value
}

func (v *NullableCardIdentification) Set(val *CardIdentification) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCardIdentification(val *CardIdentification) *NullableCardIdentification {
	return &NullableCardIdentification{value: val, isSet: true}
}

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

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