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

// UpdateOrganizationQuota struct for UpdateOrganizationQuota
type UpdateOrganizationQuota struct {
	MaxCpuPerSandbox NullableFloat32 `json:"maxCpuPerSandbox"`
	MaxMemoryPerSandbox NullableFloat32 `json:"maxMemoryPerSandbox"`
	MaxDiskPerSandbox NullableFloat32 `json:"maxDiskPerSandbox"`
	SnapshotQuota NullableFloat32 `json:"snapshotQuota"`
	MaxSnapshotSize NullableFloat32 `json:"maxSnapshotSize"`
	VolumeQuota NullableFloat32 `json:"volumeQuota"`
	AuthenticatedRateLimit NullableFloat32 `json:"authenticatedRateLimit"`
	SandboxCreateRateLimit NullableFloat32 `json:"sandboxCreateRateLimit"`
	SandboxLifecycleRateLimit NullableFloat32 `json:"sandboxLifecycleRateLimit"`
	AuthenticatedRateLimitTtlSeconds NullableFloat32 `json:"authenticatedRateLimitTtlSeconds"`
	SandboxCreateRateLimitTtlSeconds NullableFloat32 `json:"sandboxCreateRateLimitTtlSeconds"`
	SandboxLifecycleRateLimitTtlSeconds NullableFloat32 `json:"sandboxLifecycleRateLimitTtlSeconds"`
	// Time in minutes before an unused snapshot is deactivated
	SnapshotDeactivationTimeoutMinutes NullableFloat32 `json:"snapshotDeactivationTimeoutMinutes"`
	AdditionalProperties map[string]interface{}
}

type _UpdateOrganizationQuota UpdateOrganizationQuota

// NewUpdateOrganizationQuota instantiates a new UpdateOrganizationQuota 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 NewUpdateOrganizationQuota(maxCpuPerSandbox NullableFloat32, maxMemoryPerSandbox NullableFloat32, maxDiskPerSandbox NullableFloat32, snapshotQuota NullableFloat32, maxSnapshotSize NullableFloat32, volumeQuota NullableFloat32, authenticatedRateLimit NullableFloat32, sandboxCreateRateLimit NullableFloat32, sandboxLifecycleRateLimit NullableFloat32, authenticatedRateLimitTtlSeconds NullableFloat32, sandboxCreateRateLimitTtlSeconds NullableFloat32, sandboxLifecycleRateLimitTtlSeconds NullableFloat32, snapshotDeactivationTimeoutMinutes NullableFloat32) *UpdateOrganizationQuota {
	this := UpdateOrganizationQuota{}
	this.MaxCpuPerSandbox = maxCpuPerSandbox
	this.MaxMemoryPerSandbox = maxMemoryPerSandbox
	this.MaxDiskPerSandbox = maxDiskPerSandbox
	this.SnapshotQuota = snapshotQuota
	this.MaxSnapshotSize = maxSnapshotSize
	this.VolumeQuota = volumeQuota
	this.AuthenticatedRateLimit = authenticatedRateLimit
	this.SandboxCreateRateLimit = sandboxCreateRateLimit
	this.SandboxLifecycleRateLimit = sandboxLifecycleRateLimit
	this.AuthenticatedRateLimitTtlSeconds = authenticatedRateLimitTtlSeconds
	this.SandboxCreateRateLimitTtlSeconds = sandboxCreateRateLimitTtlSeconds
	this.SandboxLifecycleRateLimitTtlSeconds = sandboxLifecycleRateLimitTtlSeconds
	this.SnapshotDeactivationTimeoutMinutes = snapshotDeactivationTimeoutMinutes
	return &this
}

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

// GetMaxCpuPerSandbox returns the MaxCpuPerSandbox field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetMaxCpuPerSandbox() float32 {
	if o == nil || o.MaxCpuPerSandbox.Get() == nil {
		var ret float32
		return ret
	}

	return *o.MaxCpuPerSandbox.Get()
}

// GetMaxCpuPerSandboxOk returns a tuple with the MaxCpuPerSandbox 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 *UpdateOrganizationQuota) GetMaxCpuPerSandboxOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.MaxCpuPerSandbox.Get(), o.MaxCpuPerSandbox.IsSet()
}

// SetMaxCpuPerSandbox sets field value
func (o *UpdateOrganizationQuota) SetMaxCpuPerSandbox(v float32) {
	o.MaxCpuPerSandbox.Set(&v)
}

// GetMaxMemoryPerSandbox returns the MaxMemoryPerSandbox field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetMaxMemoryPerSandbox() float32 {
	if o == nil || o.MaxMemoryPerSandbox.Get() == nil {
		var ret float32
		return ret
	}

	return *o.MaxMemoryPerSandbox.Get()
}

// GetMaxMemoryPerSandboxOk returns a tuple with the MaxMemoryPerSandbox 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 *UpdateOrganizationQuota) GetMaxMemoryPerSandboxOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.MaxMemoryPerSandbox.Get(), o.MaxMemoryPerSandbox.IsSet()
}

// SetMaxMemoryPerSandbox sets field value
func (o *UpdateOrganizationQuota) SetMaxMemoryPerSandbox(v float32) {
	o.MaxMemoryPerSandbox.Set(&v)
}

// GetMaxDiskPerSandbox returns the MaxDiskPerSandbox field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetMaxDiskPerSandbox() float32 {
	if o == nil || o.MaxDiskPerSandbox.Get() == nil {
		var ret float32
		return ret
	}

	return *o.MaxDiskPerSandbox.Get()
}

// GetMaxDiskPerSandboxOk returns a tuple with the MaxDiskPerSandbox 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 *UpdateOrganizationQuota) GetMaxDiskPerSandboxOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.MaxDiskPerSandbox.Get(), o.MaxDiskPerSandbox.IsSet()
}

// SetMaxDiskPerSandbox sets field value
func (o *UpdateOrganizationQuota) SetMaxDiskPerSandbox(v float32) {
	o.MaxDiskPerSandbox.Set(&v)
}

// GetSnapshotQuota returns the SnapshotQuota field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetSnapshotQuota() float32 {
	if o == nil || o.SnapshotQuota.Get() == nil {
		var ret float32
		return ret
	}

	return *o.SnapshotQuota.Get()
}

// GetSnapshotQuotaOk returns a tuple with the SnapshotQuota 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 *UpdateOrganizationQuota) GetSnapshotQuotaOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.SnapshotQuota.Get(), o.SnapshotQuota.IsSet()
}

// SetSnapshotQuota sets field value
func (o *UpdateOrganizationQuota) SetSnapshotQuota(v float32) {
	o.SnapshotQuota.Set(&v)
}

// GetMaxSnapshotSize returns the MaxSnapshotSize field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetMaxSnapshotSize() float32 {
	if o == nil || o.MaxSnapshotSize.Get() == nil {
		var ret float32
		return ret
	}

	return *o.MaxSnapshotSize.Get()
}

// GetMaxSnapshotSizeOk returns a tuple with the MaxSnapshotSize 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 *UpdateOrganizationQuota) GetMaxSnapshotSizeOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.MaxSnapshotSize.Get(), o.MaxSnapshotSize.IsSet()
}

// SetMaxSnapshotSize sets field value
func (o *UpdateOrganizationQuota) SetMaxSnapshotSize(v float32) {
	o.MaxSnapshotSize.Set(&v)
}

// GetVolumeQuota returns the VolumeQuota field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetVolumeQuota() float32 {
	if o == nil || o.VolumeQuota.Get() == nil {
		var ret float32
		return ret
	}

	return *o.VolumeQuota.Get()
}

// GetVolumeQuotaOk returns a tuple with the VolumeQuota 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 *UpdateOrganizationQuota) GetVolumeQuotaOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.VolumeQuota.Get(), o.VolumeQuota.IsSet()
}

// SetVolumeQuota sets field value
func (o *UpdateOrganizationQuota) SetVolumeQuota(v float32) {
	o.VolumeQuota.Set(&v)
}

// GetAuthenticatedRateLimit returns the AuthenticatedRateLimit field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetAuthenticatedRateLimit() float32 {
	if o == nil || o.AuthenticatedRateLimit.Get() == nil {
		var ret float32
		return ret
	}

	return *o.AuthenticatedRateLimit.Get()
}

// GetAuthenticatedRateLimitOk returns a tuple with the AuthenticatedRateLimit 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 *UpdateOrganizationQuota) GetAuthenticatedRateLimitOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.AuthenticatedRateLimit.Get(), o.AuthenticatedRateLimit.IsSet()
}

// SetAuthenticatedRateLimit sets field value
func (o *UpdateOrganizationQuota) SetAuthenticatedRateLimit(v float32) {
	o.AuthenticatedRateLimit.Set(&v)
}

// GetSandboxCreateRateLimit returns the SandboxCreateRateLimit field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetSandboxCreateRateLimit() float32 {
	if o == nil || o.SandboxCreateRateLimit.Get() == nil {
		var ret float32
		return ret
	}

	return *o.SandboxCreateRateLimit.Get()
}

// GetSandboxCreateRateLimitOk returns a tuple with the SandboxCreateRateLimit 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 *UpdateOrganizationQuota) GetSandboxCreateRateLimitOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.SandboxCreateRateLimit.Get(), o.SandboxCreateRateLimit.IsSet()
}

// SetSandboxCreateRateLimit sets field value
func (o *UpdateOrganizationQuota) SetSandboxCreateRateLimit(v float32) {
	o.SandboxCreateRateLimit.Set(&v)
}

// GetSandboxLifecycleRateLimit returns the SandboxLifecycleRateLimit field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetSandboxLifecycleRateLimit() float32 {
	if o == nil || o.SandboxLifecycleRateLimit.Get() == nil {
		var ret float32
		return ret
	}

	return *o.SandboxLifecycleRateLimit.Get()
}

// GetSandboxLifecycleRateLimitOk returns a tuple with the SandboxLifecycleRateLimit 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 *UpdateOrganizationQuota) GetSandboxLifecycleRateLimitOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.SandboxLifecycleRateLimit.Get(), o.SandboxLifecycleRateLimit.IsSet()
}

// SetSandboxLifecycleRateLimit sets field value
func (o *UpdateOrganizationQuota) SetSandboxLifecycleRateLimit(v float32) {
	o.SandboxLifecycleRateLimit.Set(&v)
}

// GetAuthenticatedRateLimitTtlSeconds returns the AuthenticatedRateLimitTtlSeconds field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetAuthenticatedRateLimitTtlSeconds() float32 {
	if o == nil || o.AuthenticatedRateLimitTtlSeconds.Get() == nil {
		var ret float32
		return ret
	}

	return *o.AuthenticatedRateLimitTtlSeconds.Get()
}

// GetAuthenticatedRateLimitTtlSecondsOk returns a tuple with the AuthenticatedRateLimitTtlSeconds 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 *UpdateOrganizationQuota) GetAuthenticatedRateLimitTtlSecondsOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.AuthenticatedRateLimitTtlSeconds.Get(), o.AuthenticatedRateLimitTtlSeconds.IsSet()
}

// SetAuthenticatedRateLimitTtlSeconds sets field value
func (o *UpdateOrganizationQuota) SetAuthenticatedRateLimitTtlSeconds(v float32) {
	o.AuthenticatedRateLimitTtlSeconds.Set(&v)
}

// GetSandboxCreateRateLimitTtlSeconds returns the SandboxCreateRateLimitTtlSeconds field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetSandboxCreateRateLimitTtlSeconds() float32 {
	if o == nil || o.SandboxCreateRateLimitTtlSeconds.Get() == nil {
		var ret float32
		return ret
	}

	return *o.SandboxCreateRateLimitTtlSeconds.Get()
}

// GetSandboxCreateRateLimitTtlSecondsOk returns a tuple with the SandboxCreateRateLimitTtlSeconds 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 *UpdateOrganizationQuota) GetSandboxCreateRateLimitTtlSecondsOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.SandboxCreateRateLimitTtlSeconds.Get(), o.SandboxCreateRateLimitTtlSeconds.IsSet()
}

// SetSandboxCreateRateLimitTtlSeconds sets field value
func (o *UpdateOrganizationQuota) SetSandboxCreateRateLimitTtlSeconds(v float32) {
	o.SandboxCreateRateLimitTtlSeconds.Set(&v)
}

// GetSandboxLifecycleRateLimitTtlSeconds returns the SandboxLifecycleRateLimitTtlSeconds field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetSandboxLifecycleRateLimitTtlSeconds() float32 {
	if o == nil || o.SandboxLifecycleRateLimitTtlSeconds.Get() == nil {
		var ret float32
		return ret
	}

	return *o.SandboxLifecycleRateLimitTtlSeconds.Get()
}

// GetSandboxLifecycleRateLimitTtlSecondsOk returns a tuple with the SandboxLifecycleRateLimitTtlSeconds 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 *UpdateOrganizationQuota) GetSandboxLifecycleRateLimitTtlSecondsOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.SandboxLifecycleRateLimitTtlSeconds.Get(), o.SandboxLifecycleRateLimitTtlSeconds.IsSet()
}

// SetSandboxLifecycleRateLimitTtlSeconds sets field value
func (o *UpdateOrganizationQuota) SetSandboxLifecycleRateLimitTtlSeconds(v float32) {
	o.SandboxLifecycleRateLimitTtlSeconds.Set(&v)
}

// GetSnapshotDeactivationTimeoutMinutes returns the SnapshotDeactivationTimeoutMinutes field value
// If the value is explicit nil, the zero value for float32 will be returned
func (o *UpdateOrganizationQuota) GetSnapshotDeactivationTimeoutMinutes() float32 {
	if o == nil || o.SnapshotDeactivationTimeoutMinutes.Get() == nil {
		var ret float32
		return ret
	}

	return *o.SnapshotDeactivationTimeoutMinutes.Get()
}

// GetSnapshotDeactivationTimeoutMinutesOk returns a tuple with the SnapshotDeactivationTimeoutMinutes 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 *UpdateOrganizationQuota) GetSnapshotDeactivationTimeoutMinutesOk() (*float32, bool) {
	if o == nil {
		return nil, false
	}
	return o.SnapshotDeactivationTimeoutMinutes.Get(), o.SnapshotDeactivationTimeoutMinutes.IsSet()
}

// SetSnapshotDeactivationTimeoutMinutes sets field value
func (o *UpdateOrganizationQuota) SetSnapshotDeactivationTimeoutMinutes(v float32) {
	o.SnapshotDeactivationTimeoutMinutes.Set(&v)
}

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

func (o UpdateOrganizationQuota) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["maxCpuPerSandbox"] = o.MaxCpuPerSandbox.Get()
	toSerialize["maxMemoryPerSandbox"] = o.MaxMemoryPerSandbox.Get()
	toSerialize["maxDiskPerSandbox"] = o.MaxDiskPerSandbox.Get()
	toSerialize["snapshotQuota"] = o.SnapshotQuota.Get()
	toSerialize["maxSnapshotSize"] = o.MaxSnapshotSize.Get()
	toSerialize["volumeQuota"] = o.VolumeQuota.Get()
	toSerialize["authenticatedRateLimit"] = o.AuthenticatedRateLimit.Get()
	toSerialize["sandboxCreateRateLimit"] = o.SandboxCreateRateLimit.Get()
	toSerialize["sandboxLifecycleRateLimit"] = o.SandboxLifecycleRateLimit.Get()
	toSerialize["authenticatedRateLimitTtlSeconds"] = o.AuthenticatedRateLimitTtlSeconds.Get()
	toSerialize["sandboxCreateRateLimitTtlSeconds"] = o.SandboxCreateRateLimitTtlSeconds.Get()
	toSerialize["sandboxLifecycleRateLimitTtlSeconds"] = o.SandboxLifecycleRateLimitTtlSeconds.Get()
	toSerialize["snapshotDeactivationTimeoutMinutes"] = o.SnapshotDeactivationTimeoutMinutes.Get()

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

	return toSerialize, nil
}

func (o *UpdateOrganizationQuota) 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{
		"maxCpuPerSandbox",
		"maxMemoryPerSandbox",
		"maxDiskPerSandbox",
		"snapshotQuota",
		"maxSnapshotSize",
		"volumeQuota",
		"authenticatedRateLimit",
		"sandboxCreateRateLimit",
		"sandboxLifecycleRateLimit",
		"authenticatedRateLimitTtlSeconds",
		"sandboxCreateRateLimitTtlSeconds",
		"sandboxLifecycleRateLimitTtlSeconds",
		"snapshotDeactivationTimeoutMinutes",
	}

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

	varUpdateOrganizationQuota := _UpdateOrganizationQuota{}

	err = json.Unmarshal(data, &varUpdateOrganizationQuota)

	if err != nil {
		return err
	}

	*o = UpdateOrganizationQuota(varUpdateOrganizationQuota)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "maxCpuPerSandbox")
		delete(additionalProperties, "maxMemoryPerSandbox")
		delete(additionalProperties, "maxDiskPerSandbox")
		delete(additionalProperties, "snapshotQuota")
		delete(additionalProperties, "maxSnapshotSize")
		delete(additionalProperties, "volumeQuota")
		delete(additionalProperties, "authenticatedRateLimit")
		delete(additionalProperties, "sandboxCreateRateLimit")
		delete(additionalProperties, "sandboxLifecycleRateLimit")
		delete(additionalProperties, "authenticatedRateLimitTtlSeconds")
		delete(additionalProperties, "sandboxCreateRateLimitTtlSeconds")
		delete(additionalProperties, "sandboxLifecycleRateLimitTtlSeconds")
		delete(additionalProperties, "snapshotDeactivationTimeoutMinutes")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableUpdateOrganizationQuota struct {
	value *UpdateOrganizationQuota
	isSet bool
}

func (v NullableUpdateOrganizationQuota) Get() *UpdateOrganizationQuota {
	return v.value
}

func (v *NullableUpdateOrganizationQuota) Set(val *UpdateOrganizationQuota) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUpdateOrganizationQuota(val *UpdateOrganizationQuota) *NullableUpdateOrganizationQuota {
	return &NullableUpdateOrganizationQuota{value: val, isSet: true}
}

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

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


