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

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

type _RulesEngineBehaviorString RulesEngineBehaviorString

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

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

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

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

// GetTarget returns the Target field value
func (o *RulesEngineBehaviorString) GetTarget() string {
	if o == nil {
		var ret string
		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 *RulesEngineBehaviorString) GetTargetOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Target, true
}

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

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

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

func (o *RulesEngineBehaviorString) 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)
		}
	}

	varRulesEngineBehaviorString := _RulesEngineBehaviorString{}

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

	if err != nil {
		return err
	}

	*o = RulesEngineBehaviorString(varRulesEngineBehaviorString)

	return err
}

type NullableRulesEngineBehaviorString struct {
	value *RulesEngineBehaviorString
	isSet bool
}

func (v NullableRulesEngineBehaviorString) Get() *RulesEngineBehaviorString {
	return v.value
}

func (v *NullableRulesEngineBehaviorString) Set(val *RulesEngineBehaviorString) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRulesEngineBehaviorString(val *RulesEngineBehaviorString) *NullableRulesEngineBehaviorString {
	return &NullableRulesEngineBehaviorString{value: val, isSet: true}
}

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

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


