/*
Legal Entity Management API

API version: 3
*/

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

package legalentity

import (
	"encoding/json"

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

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

// CalculateTermsOfServiceStatusResponse struct for CalculateTermsOfServiceStatusResponse
type CalculateTermsOfServiceStatusResponse struct {
	// The type of Terms of Service that the legal entity needs to accept. If empty, no Terms of Service needs to be accepted.
	TermsOfServiceTypes []string `json:"termsOfServiceTypes,omitempty"`
}

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

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

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

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

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

	return false
}

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

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

func (o CalculateTermsOfServiceStatusResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.TermsOfServiceTypes) {
		toSerialize["termsOfServiceTypes"] = o.TermsOfServiceTypes
	}
	return toSerialize, nil
}

type NullableCalculateTermsOfServiceStatusResponse struct {
	value *CalculateTermsOfServiceStatusResponse
	isSet bool
}

func (v NullableCalculateTermsOfServiceStatusResponse) Get() *CalculateTermsOfServiceStatusResponse {
	return v.value
}

func (v *NullableCalculateTermsOfServiceStatusResponse) Set(val *CalculateTermsOfServiceStatusResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCalculateTermsOfServiceStatusResponse(val *CalculateTermsOfServiceStatusResponse) *NullableCalculateTermsOfServiceStatusResponse {
	return &NullableCalculateTermsOfServiceStatusResponse{value: val, isSet: true}
}

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

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