/*
Transfers API

API version: 4
*/

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

package transfers

import (
	"encoding/json"

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

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

// IssuingTransactionData struct for IssuingTransactionData
type IssuingTransactionData struct {
	// captureCycleId associated with transfer event.
	CaptureCycleId *string `json:"captureCycleId,omitempty"`
	// The type of events data.   Possible values:    - **issuingTransactionData**: issuing transaction data
	Type string `json:"type"`
}

// NewIssuingTransactionData instantiates a new IssuingTransactionData 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 NewIssuingTransactionData(type_ string) *IssuingTransactionData {
	this := IssuingTransactionData{}
	this.Type = type_
	return &this
}

// NewIssuingTransactionDataWithDefaults instantiates a new IssuingTransactionData 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 NewIssuingTransactionDataWithDefaults() *IssuingTransactionData {
	this := IssuingTransactionData{}
	var type_ string = "issuingTransactionData"
	this.Type = type_
	return &this
}

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

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

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

	return false
}

// SetCaptureCycleId gets a reference to the given string and assigns it to the CaptureCycleId field.
func (o *IssuingTransactionData) SetCaptureCycleId(v string) {
	o.CaptureCycleId = &v
}

// GetType returns the Type field value
func (o *IssuingTransactionData) GetType() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Type
}

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

// SetType sets field value
func (o *IssuingTransactionData) SetType(v string) {
	o.Type = v
}

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

func (o IssuingTransactionData) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.CaptureCycleId) {
		toSerialize["captureCycleId"] = o.CaptureCycleId
	}
	toSerialize["type"] = o.Type
	return toSerialize, nil
}

type NullableIssuingTransactionData struct {
	value *IssuingTransactionData
	isSet bool
}

func (v NullableIssuingTransactionData) Get() *IssuingTransactionData {
	return v.value
}

func (v *NullableIssuingTransactionData) Set(val *IssuingTransactionData) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableIssuingTransactionData(val *IssuingTransactionData) *NullableIssuingTransactionData {
	return &NullableIssuingTransactionData{value: val, isSet: true}
}

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

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

func (o *IssuingTransactionData) isValidType() bool {
	var allowedEnumValues = []string{"issuingTransactionData"}
	for _, allowed := range allowedEnumValues {
		if o.GetType() == allowed {
			return true
		}
	}
	return false
}
