/*
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"
)

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

// UpdateSandboxNetworkSettings struct for UpdateSandboxNetworkSettings
type UpdateSandboxNetworkSettings struct {
	// Whether to block all network access for the sandbox
	NetworkBlockAll *bool `json:"networkBlockAll,omitempty"`
	// Comma-separated list of allowed CIDR network addresses for the sandbox
	NetworkAllowList *string `json:"networkAllowList,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _UpdateSandboxNetworkSettings UpdateSandboxNetworkSettings

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

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

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

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

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

	return false
}

// SetNetworkBlockAll gets a reference to the given bool and assigns it to the NetworkBlockAll field.
func (o *UpdateSandboxNetworkSettings) SetNetworkBlockAll(v bool) {
	o.NetworkBlockAll = &v
}

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

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

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

	return false
}

// SetNetworkAllowList gets a reference to the given string and assigns it to the NetworkAllowList field.
func (o *UpdateSandboxNetworkSettings) SetNetworkAllowList(v string) {
	o.NetworkAllowList = &v
}

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

func (o UpdateSandboxNetworkSettings) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.NetworkBlockAll) {
		toSerialize["networkBlockAll"] = o.NetworkBlockAll
	}
	if !IsNil(o.NetworkAllowList) {
		toSerialize["networkAllowList"] = o.NetworkAllowList
	}

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

	return toSerialize, nil
}

func (o *UpdateSandboxNetworkSettings) UnmarshalJSON(data []byte) (err error) {
	varUpdateSandboxNetworkSettings := _UpdateSandboxNetworkSettings{}

	err = json.Unmarshal(data, &varUpdateSandboxNetworkSettings)

	if err != nil {
		return err
	}

	*o = UpdateSandboxNetworkSettings(varUpdateSandboxNetworkSettings)

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

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

	return err
}

type NullableUpdateSandboxNetworkSettings struct {
	value *UpdateSandboxNetworkSettings
	isSet bool
}

func (v NullableUpdateSandboxNetworkSettings) Get() *UpdateSandboxNetworkSettings {
	return v.value
}

func (v *NullableUpdateSandboxNetworkSettings) Set(val *UpdateSandboxNetworkSettings) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUpdateSandboxNetworkSettings(val *UpdateSandboxNetworkSettings) *NullableUpdateSandboxNetworkSettings {
	return &NullableUpdateSandboxNetworkSettings{value: val, isSet: true}
}

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

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


