/*
Hindsight HTTP API

HTTP API for Hindsight

API version: 0.4.17
*/

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

package hindsight

import (
	"encoding/json"
	"bytes"
	"fmt"
)

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

// UpdateDispositionRequest Request model for updating disposition traits.
type UpdateDispositionRequest struct {
	Disposition DispositionTraits `json:"disposition"`
}

type _UpdateDispositionRequest UpdateDispositionRequest

// NewUpdateDispositionRequest instantiates a new UpdateDispositionRequest 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 NewUpdateDispositionRequest(disposition DispositionTraits) *UpdateDispositionRequest {
	this := UpdateDispositionRequest{}
	this.Disposition = disposition
	return &this
}

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

// GetDisposition returns the Disposition field value
func (o *UpdateDispositionRequest) GetDisposition() DispositionTraits {
	if o == nil {
		var ret DispositionTraits
		return ret
	}

	return o.Disposition
}

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

// SetDisposition sets field value
func (o *UpdateDispositionRequest) SetDisposition(v DispositionTraits) {
	o.Disposition = v
}

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

func (o UpdateDispositionRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["disposition"] = o.Disposition
	return toSerialize, nil
}

func (o *UpdateDispositionRequest) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"disposition",
	}

	allProperties := make(map[string]interface{})

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varUpdateDispositionRequest := _UpdateDispositionRequest{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varUpdateDispositionRequest)

	if err != nil {
		return err
	}

	*o = UpdateDispositionRequest(varUpdateDispositionRequest)

	return err
}

type NullableUpdateDispositionRequest struct {
	value *UpdateDispositionRequest
	isSet bool
}

func (v NullableUpdateDispositionRequest) Get() *UpdateDispositionRequest {
	return v.value
}

func (v *NullableUpdateDispositionRequest) Set(val *UpdateDispositionRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUpdateDispositionRequest(val *UpdateDispositionRequest) *NullableUpdateDispositionRequest {
	return &NullableUpdateDispositionRequest{value: val, isSet: true}
}

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

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


