/*
Configuration API

API version: 2
*/

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

package balanceplatform

import (
	"encoding/json"

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

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

// AssociationFinaliseResponse struct for AssociationFinaliseResponse
type AssociationFinaliseResponse struct {
	// The unique identifier of the SCA device you associated with a resource.
	DeviceId *string `json:"deviceId,omitempty"`
	// The list of unique identifiers of the resources that you associated with the SCA device.
	Ids []string `json:"ids,omitempty"`
	// The type of resource that you associated with the SCA device.
	Type string `json:"type"`
}

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

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

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

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

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

	return false
}

// SetDeviceId gets a reference to the given string and assigns it to the DeviceId field.
func (o *AssociationFinaliseResponse) SetDeviceId(v string) {
	o.DeviceId = &v
}

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

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

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

	return false
}

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

// GetType returns the Type field value
func (o *AssociationFinaliseResponse) 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 *AssociationFinaliseResponse) GetTypeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Type, true
}

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

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

func (o AssociationFinaliseResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.DeviceId) {
		toSerialize["deviceId"] = o.DeviceId
	}
	if !common.IsNil(o.Ids) {
		toSerialize["ids"] = o.Ids
	}
	toSerialize["type"] = o.Type
	return toSerialize, nil
}

type NullableAssociationFinaliseResponse struct {
	value *AssociationFinaliseResponse
	isSet bool
}

func (v NullableAssociationFinaliseResponse) Get() *AssociationFinaliseResponse {
	return v.value
}

func (v *NullableAssociationFinaliseResponse) Set(val *AssociationFinaliseResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableAssociationFinaliseResponse(val *AssociationFinaliseResponse) *NullableAssociationFinaliseResponse {
	return &NullableAssociationFinaliseResponse{value: val, isSet: true}
}

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

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

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