mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.9 KiB
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 SpaceDriveList type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &SpaceDriveList{}
|
|
|
|
// SpaceDriveList struct for SpaceDriveList
|
|
type SpaceDriveList struct {
|
|
// Drives are the drives at the space's root.
|
|
Drives []SpaceDriveItem `json:"drives,omitempty"`
|
|
// Space is the space that was listed.
|
|
Space *string `json:"space,omitempty"`
|
|
// Total is how many drives came back. The listing is BOUNDED, so it is what came back and not a count of what the space holds.
|
|
Total *int64 `json:"total,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _SpaceDriveList SpaceDriveList
|
|
|
|
// NewSpaceDriveList instantiates a new SpaceDriveList 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 NewSpaceDriveList() *SpaceDriveList {
|
|
this := SpaceDriveList{}
|
|
return &this
|
|
}
|
|
|
|
// NewSpaceDriveListWithDefaults instantiates a new SpaceDriveList 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 NewSpaceDriveListWithDefaults() *SpaceDriveList {
|
|
this := SpaceDriveList{}
|
|
return &this
|
|
}
|
|
|
|
// GetDrives returns the Drives field value if set, zero value otherwise.
|
|
func (o *SpaceDriveList) GetDrives() []SpaceDriveItem {
|
|
if o == nil || IsNil(o.Drives) {
|
|
var ret []SpaceDriveItem
|
|
return ret
|
|
}
|
|
return o.Drives
|
|
}
|
|
|
|
// GetDrivesOk returns a tuple with the Drives field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SpaceDriveList) GetDrivesOk() ([]SpaceDriveItem, bool) {
|
|
if o == nil || IsNil(o.Drives) {
|
|
return nil, false
|
|
}
|
|
return o.Drives, true
|
|
}
|
|
|
|
// HasDrives returns a boolean if a field has been set.
|
|
func (o *SpaceDriveList) HasDrives() bool {
|
|
if o != nil && !IsNil(o.Drives) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDrives gets a reference to the given []SpaceDriveItem and assigns it to the Drives field.
|
|
func (o *SpaceDriveList) SetDrives(v []SpaceDriveItem) {
|
|
o.Drives = v
|
|
}
|
|
|
|
// GetSpace returns the Space field value if set, zero value otherwise.
|
|
func (o *SpaceDriveList) GetSpace() string {
|
|
if o == nil || IsNil(o.Space) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Space
|
|
}
|
|
|
|
// GetSpaceOk returns a tuple with the Space field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *SpaceDriveList) GetSpaceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Space) {
|
|
return nil, false
|
|
}
|
|
return o.Space, true
|
|
}
|
|
|
|
// HasSpace returns a boolean if a field has been set.
|
|
func (o *SpaceDriveList) HasSpace() bool {
|
|
if o != nil && !IsNil(o.Space) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSpace gets a reference to the given string and assigns it to the Space field.
|
|
func (o *SpaceDriveList) SetSpace(v string) {
|
|
o.Space = &v
|
|
}
|
|
|
|
// GetTotal returns the Total field value if set, zero value otherwise.
|
|
func (o *SpaceDriveList) 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 *SpaceDriveList) 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 *SpaceDriveList) 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 *SpaceDriveList) SetTotal(v int64) {
|
|
o.Total = &v
|
|
}
|
|
|
|
func (o SpaceDriveList) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o SpaceDriveList) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Drives) {
|
|
toSerialize["drives"] = o.Drives
|
|
}
|
|
if !IsNil(o.Space) {
|
|
toSerialize["space"] = o.Space
|
|
}
|
|
if !IsNil(o.Total) {
|
|
toSerialize["total"] = o.Total
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *SpaceDriveList) UnmarshalJSON(data []byte) (err error) {
|
|
varSpaceDriveList := _SpaceDriveList{}
|
|
|
|
err = json.Unmarshal(data, &varSpaceDriveList)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = SpaceDriveList(varSpaceDriveList)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "drives")
|
|
delete(additionalProperties, "space")
|
|
delete(additionalProperties, "total")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableSpaceDriveList struct {
|
|
value *SpaceDriveList
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSpaceDriveList) Get() *SpaceDriveList {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSpaceDriveList) Set(val *SpaceDriveList) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSpaceDriveList) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSpaceDriveList) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSpaceDriveList(val *SpaceDriveList) *NullableSpaceDriveList {
|
|
return &NullableSpaceDriveList{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSpaceDriveList) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSpaceDriveList) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|