/*
Hindsight HTTP API

HTTP API for Hindsight

API version: 0.5.3
*/

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

package hindsight

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

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

// TagGroupOrInput Compound OR group: at least one child filter must match.
type TagGroupOrInput struct {
	Or []MentalModelTriggerInputTagGroupsInner `json:"or"`
}

type _TagGroupOrInput TagGroupOrInput

// NewTagGroupOrInput instantiates a new TagGroupOrInput 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 NewTagGroupOrInput(or []MentalModelTriggerInputTagGroupsInner) *TagGroupOrInput {
	this := TagGroupOrInput{}
	this.Or = or
	return &this
}

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

// GetOr returns the Or field value
func (o *TagGroupOrInput) GetOr() []MentalModelTriggerInputTagGroupsInner {
	if o == nil {
		var ret []MentalModelTriggerInputTagGroupsInner
		return ret
	}

	return o.Or
}

// GetOrOk returns a tuple with the Or field value
// and a boolean to check if the value has been set.
func (o *TagGroupOrInput) GetOrOk() ([]MentalModelTriggerInputTagGroupsInner, bool) {
	if o == nil {
		return nil, false
	}
	return o.Or, true
}

// SetOr sets field value
func (o *TagGroupOrInput) SetOr(v []MentalModelTriggerInputTagGroupsInner) {
	o.Or = v
}

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

func (o TagGroupOrInput) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["or"] = o.Or
	return toSerialize, nil
}

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

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

	varTagGroupOrInput := _TagGroupOrInput{}

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

	if err != nil {
		return err
	}

	*o = TagGroupOrInput(varTagGroupOrInput)

	return err
}

type NullableTagGroupOrInput struct {
	value *TagGroupOrInput
	isSet bool
}

func (v NullableTagGroupOrInput) Get() *TagGroupOrInput {
	return v.value
}

func (v *NullableTagGroupOrInput) Set(val *TagGroupOrInput) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTagGroupOrInput(val *TagGroupOrInput) *NullableTagGroupOrInput {
	return &NullableTagGroupOrInput{value: val, isSet: true}
}

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

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


