/*
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 ClearMemoryObservationsResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ClearMemoryObservationsResponse{}

// ClearMemoryObservationsResponse Response model for clearing observations for a specific memory.
type ClearMemoryObservationsResponse struct {
	DeletedCount int32 `json:"deleted_count"`
}

type _ClearMemoryObservationsResponse ClearMemoryObservationsResponse

// NewClearMemoryObservationsResponse instantiates a new ClearMemoryObservationsResponse 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 NewClearMemoryObservationsResponse(deletedCount int32) *ClearMemoryObservationsResponse {
	this := ClearMemoryObservationsResponse{}
	this.DeletedCount = deletedCount
	return &this
}

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

// GetDeletedCount returns the DeletedCount field value
func (o *ClearMemoryObservationsResponse) GetDeletedCount() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.DeletedCount
}

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

// SetDeletedCount sets field value
func (o *ClearMemoryObservationsResponse) SetDeletedCount(v int32) {
	o.DeletedCount = v
}

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

func (o ClearMemoryObservationsResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["deleted_count"] = o.DeletedCount
	return toSerialize, nil
}

func (o *ClearMemoryObservationsResponse) 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{
		"deleted_count",
	}

	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)
		}
	}

	varClearMemoryObservationsResponse := _ClearMemoryObservationsResponse{}

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

	if err != nil {
		return err
	}

	*o = ClearMemoryObservationsResponse(varClearMemoryObservationsResponse)

	return err
}

type NullableClearMemoryObservationsResponse struct {
	value *ClearMemoryObservationsResponse
	isSet bool
}

func (v NullableClearMemoryObservationsResponse) Get() *ClearMemoryObservationsResponse {
	return v.value
}

func (v *NullableClearMemoryObservationsResponse) Set(val *ClearMemoryObservationsResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableClearMemoryObservationsResponse(val *ClearMemoryObservationsResponse) *NullableClearMemoryObservationsResponse {
	return &NullableClearMemoryObservationsResponse{value: val, isSet: true}
}

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

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


