Files
sdk/model_base_base_view.go

231 lines
5.9 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the BaseBaseView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &BaseBaseView{}
// BaseBaseView struct for BaseBaseView
type BaseBaseView struct {
// Bytes is the store's size on disk, present only once it exists. It is what this Base occupies, not a quota.
Bytes *int64 `json:"bytes,omitempty"`
// Exists reports whether this Base's store has been provisioned. False is an org nobody has stored anything for yet, which is a state to name rather than an error: the store is created the first time anything writes.
Exists *bool `json:"exists,omitempty"`
// Org is the org this Base belongs to. It is the address every other Base call is scoped by, and a Base has no name of its own.
Org *string `json:"org,omitempty"`
AdditionalProperties map[string]interface{}
}
type _BaseBaseView BaseBaseView
// NewBaseBaseView instantiates a new BaseBaseView 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 NewBaseBaseView() *BaseBaseView {
this := BaseBaseView{}
return &this
}
// NewBaseBaseViewWithDefaults instantiates a new BaseBaseView 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 NewBaseBaseViewWithDefaults() *BaseBaseView {
this := BaseBaseView{}
return &this
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *BaseBaseView) GetBytes() int64 {
if o == nil || IsNil(o.Bytes) {
var ret int64
return ret
}
return *o.Bytes
}
// GetBytesOk returns a tuple with the Bytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseBaseView) GetBytesOk() (*int64, bool) {
if o == nil || IsNil(o.Bytes) {
return nil, false
}
return o.Bytes, true
}
// HasBytes returns a boolean if a field has been set.
func (o *BaseBaseView) HasBytes() bool {
if o != nil && !IsNil(o.Bytes) {
return true
}
return false
}
// SetBytes gets a reference to the given int64 and assigns it to the Bytes field.
func (o *BaseBaseView) SetBytes(v int64) {
o.Bytes = &v
}
// GetExists returns the Exists field value if set, zero value otherwise.
func (o *BaseBaseView) GetExists() bool {
if o == nil || IsNil(o.Exists) {
var ret bool
return ret
}
return *o.Exists
}
// GetExistsOk returns a tuple with the Exists field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseBaseView) GetExistsOk() (*bool, bool) {
if o == nil || IsNil(o.Exists) {
return nil, false
}
return o.Exists, true
}
// HasExists returns a boolean if a field has been set.
func (o *BaseBaseView) HasExists() bool {
if o != nil && !IsNil(o.Exists) {
return true
}
return false
}
// SetExists gets a reference to the given bool and assigns it to the Exists field.
func (o *BaseBaseView) SetExists(v bool) {
o.Exists = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *BaseBaseView) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BaseBaseView) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *BaseBaseView) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *BaseBaseView) SetOrg(v string) {
o.Org = &v
}
func (o BaseBaseView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o BaseBaseView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bytes) {
toSerialize["bytes"] = o.Bytes
}
if !IsNil(o.Exists) {
toSerialize["exists"] = o.Exists
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *BaseBaseView) UnmarshalJSON(data []byte) (err error) {
varBaseBaseView := _BaseBaseView{}
err = json.Unmarshal(data, &varBaseBaseView)
if err != nil {
return err
}
*o = BaseBaseView(varBaseBaseView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bytes")
delete(additionalProperties, "exists")
delete(additionalProperties, "org")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBaseBaseView struct {
value *BaseBaseView
isSet bool
}
func (v NullableBaseBaseView) Get() *BaseBaseView {
return v.value
}
func (v *NullableBaseBaseView) Set(val *BaseBaseView) {
v.value = val
v.isSet = true
}
func (v NullableBaseBaseView) IsSet() bool {
return v.isSet
}
func (v *NullableBaseBaseView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBaseBaseView(val *BaseBaseView) *NullableBaseBaseView {
return &NullableBaseBaseView{value: val, isSet: true}
}
func (v NullableBaseBaseView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBaseBaseView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}