/*
Edge Function 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 edgefunctions

import (
	"encoding/json"
)

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

// PatchEdgeFunctionRequest struct for PatchEdgeFunctionRequest
type PatchEdgeFunctionRequest struct {
	Name *string `json:"name,omitempty"`
	Code *string `json:"code,omitempty"`
	JsonArgs interface{} `json:"json_args,omitempty"`
	Active *bool `json:"active,omitempty"`
	IsProprietaryCode *bool `json:"is_proprietary_code,omitempty"`
}

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

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

// GetName returns the Name field value if set, zero value otherwise.
func (o *PatchEdgeFunctionRequest) GetName() string {
	if o == nil || IsNil(o.Name) {
		var ret string
		return ret
	}
	return *o.Name
}

// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PatchEdgeFunctionRequest) GetNameOk() (*string, bool) {
	if o == nil || IsNil(o.Name) {
		return nil, false
	}
	return o.Name, true
}

// HasName returns a boolean if a field has been set.
func (o *PatchEdgeFunctionRequest) HasName() bool {
	if o != nil && !IsNil(o.Name) {
		return true
	}

	return false
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *PatchEdgeFunctionRequest) SetName(v string) {
	o.Name = &v
}

// GetCode returns the Code field value if set, zero value otherwise.
func (o *PatchEdgeFunctionRequest) GetCode() string {
	if o == nil || IsNil(o.Code) {
		var ret string
		return ret
	}
	return *o.Code
}

// GetCodeOk returns a tuple with the Code field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PatchEdgeFunctionRequest) GetCodeOk() (*string, bool) {
	if o == nil || IsNil(o.Code) {
		return nil, false
	}
	return o.Code, true
}

// HasCode returns a boolean if a field has been set.
func (o *PatchEdgeFunctionRequest) HasCode() bool {
	if o != nil && !IsNil(o.Code) {
		return true
	}

	return false
}

// SetCode gets a reference to the given string and assigns it to the Code field.
func (o *PatchEdgeFunctionRequest) SetCode(v string) {
	o.Code = &v
}

// GetJsonArgs returns the JsonArgs field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PatchEdgeFunctionRequest) GetJsonArgs() interface{} {
	if o == nil {
		var ret interface{}
		return ret
	}
	return o.JsonArgs
}

// GetJsonArgsOk returns a tuple with the JsonArgs field value if set, nil otherwise
// 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 *PatchEdgeFunctionRequest) GetJsonArgsOk() (*interface{}, bool) {
	if o == nil || IsNil(o.JsonArgs) {
		return nil, false
	}
	return &o.JsonArgs, true
}

// HasJsonArgs returns a boolean if a field has been set.
func (o *PatchEdgeFunctionRequest) HasJsonArgs() bool {
	if o != nil && !IsNil(o.JsonArgs) {
		return true
	}

	return false
}

// SetJsonArgs gets a reference to the given interface{} and assigns it to the JsonArgs field.
func (o *PatchEdgeFunctionRequest) SetJsonArgs(v interface{}) {
	o.JsonArgs = v
}

// GetActive returns the Active field value if set, zero value otherwise.
func (o *PatchEdgeFunctionRequest) GetActive() bool {
	if o == nil || IsNil(o.Active) {
		var ret bool
		return ret
	}
	return *o.Active
}

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

// HasActive returns a boolean if a field has been set.
func (o *PatchEdgeFunctionRequest) HasActive() bool {
	if o != nil && !IsNil(o.Active) {
		return true
	}

	return false
}

// SetActive gets a reference to the given bool and assigns it to the Active field.
func (o *PatchEdgeFunctionRequest) SetActive(v bool) {
	o.Active = &v
}

// GetIsProprietaryCode returns the IsProprietaryCode field value if set, zero value otherwise.
func (o *PatchEdgeFunctionRequest) GetIsProprietaryCode() bool {
	if o == nil || IsNil(o.IsProprietaryCode) {
		var ret bool
		return ret
	}
	return *o.IsProprietaryCode
}

// GetIsProprietaryCodeOk returns a tuple with the IsProprietaryCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PatchEdgeFunctionRequest) GetIsProprietaryCodeOk() (*bool, bool) {
	if o == nil || IsNil(o.IsProprietaryCode) {
		return nil, false
	}
	return o.IsProprietaryCode, true
}

// HasIsProprietaryCode returns a boolean if a field has been set.
func (o *PatchEdgeFunctionRequest) HasIsProprietaryCode() bool {
	if o != nil && !IsNil(o.IsProprietaryCode) {
		return true
	}

	return false
}

// SetIsProprietaryCode gets a reference to the given bool and assigns it to the IsProprietaryCode field.
func (o *PatchEdgeFunctionRequest) SetIsProprietaryCode(v bool) {
	o.IsProprietaryCode = &v
}

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

func (o PatchEdgeFunctionRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Name) {
		toSerialize["name"] = o.Name
	}
	if !IsNil(o.Code) {
		toSerialize["code"] = o.Code
	}
	if o.JsonArgs != nil {
		toSerialize["json_args"] = o.JsonArgs
	}
	if !IsNil(o.Active) {
		toSerialize["active"] = o.Active
	}
	if !IsNil(o.IsProprietaryCode) {
		toSerialize["is_proprietary_code"] = o.IsProprietaryCode
	}
	return toSerialize, nil
}

type NullablePatchEdgeFunctionRequest struct {
	value *PatchEdgeFunctionRequest
	isSet bool
}

func (v NullablePatchEdgeFunctionRequest) Get() *PatchEdgeFunctionRequest {
	return v.value
}

func (v *NullablePatchEdgeFunctionRequest) Set(val *PatchEdgeFunctionRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePatchEdgeFunctionRequest(val *PatchEdgeFunctionRequest) *NullablePatchEdgeFunctionRequest {
	return &NullablePatchEdgeFunctionRequest{value: val, isSet: true}
}

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

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


