/*
Adyen Recurring API

API version: 68
*/

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

package recurring

import (
	"encoding/json"

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

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

// DisableRequest struct for DisableRequest
type DisableRequest struct {
	// Specify the contract if you only want to disable a specific use.  This field can be set to one of the following values, or to their combination (comma-separated): * ONECLICK * RECURRING * PAYOUT
	Contract *string `json:"contract,omitempty"`
	// The merchant account identifier with which you want to process the transaction.
	MerchantAccount string `json:"merchantAccount"`
	// The ID that uniquely identifies the recurring detail reference.  If it is not provided, the whole recurring contract of the `shopperReference` will be disabled, which includes all recurring details.
	RecurringDetailReference *string `json:"recurringDetailReference,omitempty"`
	// The ID that uniquely identifies the shopper.  This `shopperReference` must be the same as the `shopperReference` used in the initial payment.
	ShopperReference string `json:"shopperReference"`
}

// NewDisableRequest instantiates a new DisableRequest 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 NewDisableRequest(merchantAccount string, shopperReference string) *DisableRequest {
	this := DisableRequest{}
	this.MerchantAccount = merchantAccount
	this.ShopperReference = shopperReference
	return &this
}

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

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

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

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

	return false
}

// SetContract gets a reference to the given string and assigns it to the Contract field.
func (o *DisableRequest) SetContract(v string) {
	o.Contract = &v
}

// GetMerchantAccount returns the MerchantAccount field value
func (o *DisableRequest) GetMerchantAccount() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.MerchantAccount
}

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

// SetMerchantAccount sets field value
func (o *DisableRequest) SetMerchantAccount(v string) {
	o.MerchantAccount = v
}

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

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

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

	return false
}

// SetRecurringDetailReference gets a reference to the given string and assigns it to the RecurringDetailReference field.
func (o *DisableRequest) SetRecurringDetailReference(v string) {
	o.RecurringDetailReference = &v
}

// GetShopperReference returns the ShopperReference field value
func (o *DisableRequest) GetShopperReference() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.ShopperReference
}

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

// SetShopperReference sets field value
func (o *DisableRequest) SetShopperReference(v string) {
	o.ShopperReference = v
}

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

func (o DisableRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.Contract) {
		toSerialize["contract"] = o.Contract
	}
	toSerialize["merchantAccount"] = o.MerchantAccount
	if !common.IsNil(o.RecurringDetailReference) {
		toSerialize["recurringDetailReference"] = o.RecurringDetailReference
	}
	toSerialize["shopperReference"] = o.ShopperReference
	return toSerialize, nil
}

type NullableDisableRequest struct {
	value *DisableRequest
	isSet bool
}

func (v NullableDisableRequest) Get() *DisableRequest {
	return v.value
}

func (v *NullableDisableRequest) Set(val *DisableRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDisableRequest(val *DisableRequest) *NullableDisableRequest {
	return &NullableDisableRequest{value: val, isSet: true}
}

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

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