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

// ReflectDirective A directive applied during reflect.
type ReflectDirective struct {
	// Directive ID
	Id string `json:"id"`
	// Directive name
	Name string `json:"name"`
	// Directive content
	Content string `json:"content"`
}

type _ReflectDirective ReflectDirective

// NewReflectDirective instantiates a new ReflectDirective 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 NewReflectDirective(id string, name string, content string) *ReflectDirective {
	this := ReflectDirective{}
	this.Id = id
	this.Name = name
	this.Content = content
	return &this
}

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

// GetId returns the Id field value
func (o *ReflectDirective) 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 *ReflectDirective) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

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

// GetName returns the Name field value
func (o *ReflectDirective) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

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

// SetName sets field value
func (o *ReflectDirective) SetName(v string) {
	o.Name = v
}

// GetContent returns the Content field value
func (o *ReflectDirective) GetContent() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Content
}

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

// SetContent sets field value
func (o *ReflectDirective) SetContent(v string) {
	o.Content = v
}

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

func (o ReflectDirective) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["name"] = o.Name
	toSerialize["content"] = o.Content
	return toSerialize, nil
}

func (o *ReflectDirective) 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{
		"id",
		"name",
		"content",
	}

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

	varReflectDirective := _ReflectDirective{}

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

	if err != nil {
		return err
	}

	*o = ReflectDirective(varReflectDirective)

	return err
}

type NullableReflectDirective struct {
	value *ReflectDirective
	isSet bool
}

func (v NullableReflectDirective) Get() *ReflectDirective {
	return v.value
}

func (v *NullableReflectDirective) Set(val *ReflectDirective) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableReflectDirective(val *ReflectDirective) *NullableReflectDirective {
	return &NullableReflectDirective{value: val, isSet: true}
}

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

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


