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

// RulesEngineBehaviorInteger struct for RulesEngineBehaviorInteger
type RulesEngineBehaviorInteger struct {
	Name string `json:"name"`
	Target int64 `json:"target"`
}

type _RulesEngineBehaviorInteger RulesEngineBehaviorInteger

// NewRulesEngineBehaviorInteger instantiates a new RulesEngineBehaviorInteger 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 NewRulesEngineBehaviorInteger(name string, target int64) *RulesEngineBehaviorInteger {
	this := RulesEngineBehaviorInteger{}
	this.Name = name
	this.Target = target
	return &this
}

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

// GetName returns the Name field value
func (o *RulesEngineBehaviorInteger) 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 *RulesEngineBehaviorInteger) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Name, true
}

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

// GetTarget returns the Target field value
func (o *RulesEngineBehaviorInteger) GetTarget() int64 {
	if o == nil {
		var ret int64
		return ret
	}

	return o.Target
}

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

// SetTarget sets field value
func (o *RulesEngineBehaviorInteger) SetTarget(v int64) {
	o.Target = v
}

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

func (o RulesEngineBehaviorInteger) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["name"] = o.Name
	toSerialize["target"] = o.Target
	return toSerialize, nil
}

func (o *RulesEngineBehaviorInteger) 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{
		"name",
		"target",
	}

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

	varRulesEngineBehaviorInteger := _RulesEngineBehaviorInteger{}

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

	if err != nil {
		return err
	}

	*o = RulesEngineBehaviorInteger(varRulesEngineBehaviorInteger)

	return err
}

type NullableRulesEngineBehaviorInteger struct {
	value *RulesEngineBehaviorInteger
	isSet bool
}

func (v NullableRulesEngineBehaviorInteger) Get() *RulesEngineBehaviorInteger {
	return v.value
}

func (v *NullableRulesEngineBehaviorInteger) Set(val *RulesEngineBehaviorInteger) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRulesEngineBehaviorInteger(val *RulesEngineBehaviorInteger) *NullableRulesEngineBehaviorInteger {
	return &NullableRulesEngineBehaviorInteger{value: val, isSet: true}
}

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

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


