/*
Authentication webhooks

API version: 1
*/

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

package acswebhook

import (
	"encoding/json"

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

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

// RelayedAuthenticationRequest struct for RelayedAuthenticationRequest
type RelayedAuthenticationRequest struct {
	// The unique identifier of the challenge.
	Id string `json:"id"`
	// The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_) used for the purchase.
	PaymentInstrumentId string   `json:"paymentInstrumentId"`
	Purchase            Purchase `json:"purchase"`
}

// NewRelayedAuthenticationRequest instantiates a new RelayedAuthenticationRequest 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 NewRelayedAuthenticationRequest(id string, paymentInstrumentId string, purchase Purchase) *RelayedAuthenticationRequest {
	this := RelayedAuthenticationRequest{}
	this.Id = id
	this.PaymentInstrumentId = paymentInstrumentId
	this.Purchase = purchase
	return &this
}

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

// GetId returns the Id field value
func (o *RelayedAuthenticationRequest) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

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

// SetId sets field value
func (o *RelayedAuthenticationRequest) SetId(v string) {
	o.Id = v
}

// GetPaymentInstrumentId returns the PaymentInstrumentId field value
func (o *RelayedAuthenticationRequest) GetPaymentInstrumentId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.PaymentInstrumentId
}

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

// SetPaymentInstrumentId sets field value
func (o *RelayedAuthenticationRequest) SetPaymentInstrumentId(v string) {
	o.PaymentInstrumentId = v
}

// GetPurchase returns the Purchase field value
func (o *RelayedAuthenticationRequest) GetPurchase() Purchase {
	if o == nil {
		var ret Purchase
		return ret
	}

	return o.Purchase
}

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

// SetPurchase sets field value
func (o *RelayedAuthenticationRequest) SetPurchase(v Purchase) {
	o.Purchase = v
}

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

func (o RelayedAuthenticationRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["paymentInstrumentId"] = o.PaymentInstrumentId
	toSerialize["purchase"] = o.Purchase
	return toSerialize, nil
}

type NullableRelayedAuthenticationRequest struct {
	value *RelayedAuthenticationRequest
	isSet bool
}

func (v NullableRelayedAuthenticationRequest) Get() *RelayedAuthenticationRequest {
	return v.value
}

func (v *NullableRelayedAuthenticationRequest) Set(val *RelayedAuthenticationRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRelayedAuthenticationRequest(val *RelayedAuthenticationRequest) *NullableRelayedAuthenticationRequest {
	return &NullableRelayedAuthenticationRequest{value: val, isSet: true}
}

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

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