/*
Edge Application API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 2.0.0
*/

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

package edgeapplications

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

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

// RulesEngineIdResponse struct for RulesEngineIdResponse
type RulesEngineIdResponse struct {
	Results RulesEngineResultResponse `json:"results"`
	SchemaVersion int64 `json:"schema_version"`
}

type _RulesEngineIdResponse RulesEngineIdResponse

// NewRulesEngineIdResponse instantiates a new RulesEngineIdResponse 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 NewRulesEngineIdResponse(results RulesEngineResultResponse, schemaVersion int64) *RulesEngineIdResponse {
	this := RulesEngineIdResponse{}
	this.Results = results
	this.SchemaVersion = schemaVersion
	return &this
}

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

// GetResults returns the Results field value
func (o *RulesEngineIdResponse) GetResults() RulesEngineResultResponse {
	if o == nil {
		var ret RulesEngineResultResponse
		return ret
	}

	return o.Results
}

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

// SetResults sets field value
func (o *RulesEngineIdResponse) SetResults(v RulesEngineResultResponse) {
	o.Results = v
}

// GetSchemaVersion returns the SchemaVersion field value
func (o *RulesEngineIdResponse) GetSchemaVersion() int64 {
	if o == nil {
		var ret int64
		return ret
	}

	return o.SchemaVersion
}

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

// SetSchemaVersion sets field value
func (o *RulesEngineIdResponse) SetSchemaVersion(v int64) {
	o.SchemaVersion = v
}

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

func (o RulesEngineIdResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["results"] = o.Results
	toSerialize["schema_version"] = o.SchemaVersion
	return toSerialize, nil
}

func (o *RulesEngineIdResponse) 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{
		"results",
		"schema_version",
	}

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

	varRulesEngineIdResponse := _RulesEngineIdResponse{}

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

	if err != nil {
		return err
	}

	*o = RulesEngineIdResponse(varRulesEngineIdResponse)

	return err
}

type NullableRulesEngineIdResponse struct {
	value *RulesEngineIdResponse
	isSet bool
}

func (v NullableRulesEngineIdResponse) Get() *RulesEngineIdResponse {
	return v.value
}

func (v *NullableRulesEngineIdResponse) Set(val *RulesEngineIdResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRulesEngineIdResponse(val *RulesEngineIdResponse) *NullableRulesEngineIdResponse {
	return &NullableRulesEngineIdResponse{value: val, isSet: true}
}

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

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


