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

// ApplicationsResults struct for ApplicationsResults
type ApplicationsResults struct {
	Id int64 `json:"id"`
	Name string `json:"name"`
	DebugRules bool `json:"debug_rules"`
	LastEditor string `json:"last_editor"`
	LastModified string `json:"last_modified"`
	Active bool `json:"active"`
	Origins []ApplicationOrigins `json:"origins"`
}

type _ApplicationsResults ApplicationsResults

// NewApplicationsResults instantiates a new ApplicationsResults 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 NewApplicationsResults(id int64, name string, debugRules bool, lastEditor string, lastModified string, active bool, origins []ApplicationOrigins) *ApplicationsResults {
	this := ApplicationsResults{}
	this.Id = id
	this.Name = name
	this.DebugRules = debugRules
	this.LastEditor = lastEditor
	this.LastModified = lastModified
	this.Active = active
	this.Origins = origins
	return &this
}

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

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

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

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

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

// GetDebugRules returns the DebugRules field value
func (o *ApplicationsResults) GetDebugRules() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.DebugRules
}

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

// SetDebugRules sets field value
func (o *ApplicationsResults) SetDebugRules(v bool) {
	o.DebugRules = v
}

// GetLastEditor returns the LastEditor field value
func (o *ApplicationsResults) GetLastEditor() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.LastEditor
}

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

// SetLastEditor sets field value
func (o *ApplicationsResults) SetLastEditor(v string) {
	o.LastEditor = v
}

// GetLastModified returns the LastModified field value
func (o *ApplicationsResults) GetLastModified() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.LastModified
}

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

// SetLastModified sets field value
func (o *ApplicationsResults) SetLastModified(v string) {
	o.LastModified = v
}

// GetActive returns the Active field value
func (o *ApplicationsResults) GetActive() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.Active
}

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

// SetActive sets field value
func (o *ApplicationsResults) SetActive(v bool) {
	o.Active = v
}

// GetOrigins returns the Origins field value
func (o *ApplicationsResults) GetOrigins() []ApplicationOrigins {
	if o == nil {
		var ret []ApplicationOrigins
		return ret
	}

	return o.Origins
}

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

// SetOrigins sets field value
func (o *ApplicationsResults) SetOrigins(v []ApplicationOrigins) {
	o.Origins = v
}

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

func (o ApplicationsResults) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	toSerialize["name"] = o.Name
	toSerialize["debug_rules"] = o.DebugRules
	toSerialize["last_editor"] = o.LastEditor
	toSerialize["last_modified"] = o.LastModified
	toSerialize["active"] = o.Active
	toSerialize["origins"] = o.Origins
	return toSerialize, nil
}

func (o *ApplicationsResults) 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",
		"name",
		"debug_rules",
		"last_editor",
		"last_modified",
		"active",
		"origins",
	}

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

	varApplicationsResults := _ApplicationsResults{}

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

	if err != nil {
		return err
	}

	*o = ApplicationsResults(varApplicationsResults)

	return err
}

type NullableApplicationsResults struct {
	value *ApplicationsResults
	isSet bool
}

func (v NullableApplicationsResults) Get() *ApplicationsResults {
	return v.value
}

func (v *NullableApplicationsResults) Set(val *ApplicationsResults) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableApplicationsResults(val *ApplicationsResults) *NullableApplicationsResults {
	return &NullableApplicationsResults{value: val, isSet: true}
}

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

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


