/*
1Backend

AI-native microservices platform.

API version: 0.8.2
Contact: sales@singulatron.com
*/

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

package openapi

import (
	"encoding/json"
)

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

// RegistrySvcUsage struct for RegistrySvcUsage
type RegistrySvcUsage struct {
	// Usage percentage.
	Percent *float32 `json:"percent,omitempty"`
	// Total available amount (in bytes).
	Total *int64 `json:"total,omitempty"`
	// Used amount (in bytes).
	Used *int64 `json:"used,omitempty"`
}

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

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

// GetPercent returns the Percent field value if set, zero value otherwise.
func (o *RegistrySvcUsage) GetPercent() float32 {
	if o == nil || IsNil(o.Percent) {
		var ret float32
		return ret
	}
	return *o.Percent
}

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

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

	return false
}

// SetPercent gets a reference to the given float32 and assigns it to the Percent field.
func (o *RegistrySvcUsage) SetPercent(v float32) {
	o.Percent = &v
}

// GetTotal returns the Total field value if set, zero value otherwise.
func (o *RegistrySvcUsage) GetTotal() int64 {
	if o == nil || IsNil(o.Total) {
		var ret int64
		return ret
	}
	return *o.Total
}

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

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

	return false
}

// SetTotal gets a reference to the given int64 and assigns it to the Total field.
func (o *RegistrySvcUsage) SetTotal(v int64) {
	o.Total = &v
}

// GetUsed returns the Used field value if set, zero value otherwise.
func (o *RegistrySvcUsage) GetUsed() int64 {
	if o == nil || IsNil(o.Used) {
		var ret int64
		return ret
	}
	return *o.Used
}

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

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

	return false
}

// SetUsed gets a reference to the given int64 and assigns it to the Used field.
func (o *RegistrySvcUsage) SetUsed(v int64) {
	o.Used = &v
}

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

func (o RegistrySvcUsage) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Percent) {
		toSerialize["percent"] = o.Percent
	}
	if !IsNil(o.Total) {
		toSerialize["total"] = o.Total
	}
	if !IsNil(o.Used) {
		toSerialize["used"] = o.Used
	}
	return toSerialize, nil
}

type NullableRegistrySvcUsage struct {
	value *RegistrySvcUsage
	isSet bool
}

func (v NullableRegistrySvcUsage) Get() *RegistrySvcUsage {
	return v.value
}

func (v *NullableRegistrySvcUsage) Set(val *RegistrySvcUsage) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRegistrySvcUsage(val *RegistrySvcUsage) *NullableRegistrySvcUsage {
	return &NullableRegistrySvcUsage{value: val, isSet: true}
}

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

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


