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

// ApplicationInstancesResults struct for ApplicationInstancesResults
type ApplicationInstancesResults struct {
	Id int64 `json:"id"`
	EdgeFunctionId int64 `json:"edge_function_id"`
	Name string `json:"name"`
	Args interface{} `json:"args"`
}

type _ApplicationInstancesResults ApplicationInstancesResults

// NewApplicationInstancesResults instantiates a new ApplicationInstancesResults 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 NewApplicationInstancesResults(id int64, edgeFunctionId int64, name string, args interface{}) *ApplicationInstancesResults {
	this := ApplicationInstancesResults{}
	this.Id = id
	this.EdgeFunctionId = edgeFunctionId
	this.Name = name
	this.Args = args
	return &this
}

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

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

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

// GetEdgeFunctionId returns the EdgeFunctionId field value
func (o *ApplicationInstancesResults) GetEdgeFunctionId() int64 {
	if o == nil {
		var ret int64
		return ret
	}

	return o.EdgeFunctionId
}

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

// SetEdgeFunctionId sets field value
func (o *ApplicationInstancesResults) SetEdgeFunctionId(v int64) {
	o.EdgeFunctionId = v
}

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

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

// GetArgs returns the Args field value
// If the value is explicit nil, the zero value for interface{} will be returned
func (o *ApplicationInstancesResults) GetArgs() interface{} {
	if o == nil {
		var ret interface{}
		return ret
	}

	return o.Args
}

// GetArgsOk returns a tuple with the Args field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ApplicationInstancesResults) GetArgsOk() (*interface{}, bool) {
	if o == nil || IsNil(o.Args) {
		return nil, false
	}
	return &o.Args, true
}

// SetArgs sets field value
func (o *ApplicationInstancesResults) SetArgs(v interface{}) {
	o.Args = v
}

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

func (o ApplicationInstancesResults) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["edge_function_id"] = o.EdgeFunctionId
	toSerialize["name"] = o.Name
	if o.Args != nil {
		toSerialize["args"] = o.Args
	}
	return toSerialize, nil
}

func (o *ApplicationInstancesResults) 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",
		"edge_function_id",
		"name",
		"args",
	}

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

	varApplicationInstancesResults := _ApplicationInstancesResults{}

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

	if err != nil {
		return err
	}

	*o = ApplicationInstancesResults(varApplicationInstancesResults)

	return err
}

type NullableApplicationInstancesResults struct {
	value *ApplicationInstancesResults
	isSet bool
}

func (v NullableApplicationInstancesResults) Get() *ApplicationInstancesResults {
	return v.value
}

func (v *NullableApplicationInstancesResults) Set(val *ApplicationInstancesResults) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableApplicationInstancesResults(val *ApplicationInstancesResults) *NullableApplicationInstancesResults {
	return &NullableApplicationInstancesResults{value: val, isSet: true}
}

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

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


