/*
Daytona

Daytona AI platform API Docs

API version: 1.0
Contact: support@daytona.com
*/

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package apiclient

import (
	"encoding/json"
	"fmt"
)

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

// OrganizationSandboxDefaultLimitedNetworkEgress struct for OrganizationSandboxDefaultLimitedNetworkEgress
type OrganizationSandboxDefaultLimitedNetworkEgress struct {
	// Sandbox default limited network egress
	SandboxDefaultLimitedNetworkEgress bool `json:"sandboxDefaultLimitedNetworkEgress"`
	AdditionalProperties map[string]interface{}
}

type _OrganizationSandboxDefaultLimitedNetworkEgress OrganizationSandboxDefaultLimitedNetworkEgress

// NewOrganizationSandboxDefaultLimitedNetworkEgress instantiates a new OrganizationSandboxDefaultLimitedNetworkEgress 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 NewOrganizationSandboxDefaultLimitedNetworkEgress(sandboxDefaultLimitedNetworkEgress bool) *OrganizationSandboxDefaultLimitedNetworkEgress {
	this := OrganizationSandboxDefaultLimitedNetworkEgress{}
	this.SandboxDefaultLimitedNetworkEgress = sandboxDefaultLimitedNetworkEgress
	return &this
}

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

// GetSandboxDefaultLimitedNetworkEgress returns the SandboxDefaultLimitedNetworkEgress field value
func (o *OrganizationSandboxDefaultLimitedNetworkEgress) GetSandboxDefaultLimitedNetworkEgress() bool {
	if o == nil {
		var ret bool
		return ret
	}

	return o.SandboxDefaultLimitedNetworkEgress
}

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

// SetSandboxDefaultLimitedNetworkEgress sets field value
func (o *OrganizationSandboxDefaultLimitedNetworkEgress) SetSandboxDefaultLimitedNetworkEgress(v bool) {
	o.SandboxDefaultLimitedNetworkEgress = v
}

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

func (o OrganizationSandboxDefaultLimitedNetworkEgress) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["sandboxDefaultLimitedNetworkEgress"] = o.SandboxDefaultLimitedNetworkEgress

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *OrganizationSandboxDefaultLimitedNetworkEgress) 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{
		"sandboxDefaultLimitedNetworkEgress",
	}

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

	varOrganizationSandboxDefaultLimitedNetworkEgress := _OrganizationSandboxDefaultLimitedNetworkEgress{}

	err = json.Unmarshal(data, &varOrganizationSandboxDefaultLimitedNetworkEgress)

	if err != nil {
		return err
	}

	*o = OrganizationSandboxDefaultLimitedNetworkEgress(varOrganizationSandboxDefaultLimitedNetworkEgress)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "sandboxDefaultLimitedNetworkEgress")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableOrganizationSandboxDefaultLimitedNetworkEgress struct {
	value *OrganizationSandboxDefaultLimitedNetworkEgress
	isSet bool
}

func (v NullableOrganizationSandboxDefaultLimitedNetworkEgress) Get() *OrganizationSandboxDefaultLimitedNetworkEgress {
	return v.value
}

func (v *NullableOrganizationSandboxDefaultLimitedNetworkEgress) Set(val *OrganizationSandboxDefaultLimitedNetworkEgress) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableOrganizationSandboxDefaultLimitedNetworkEgress(val *OrganizationSandboxDefaultLimitedNetworkEgress) *NullableOrganizationSandboxDefaultLimitedNetworkEgress {
	return &NullableOrganizationSandboxDefaultLimitedNetworkEgress{value: val, isSet: true}
}

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

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


