Files
sdk/model_space_file_item.go

307 lines
8.2 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 SpaceFileItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SpaceFileItem{}
// SpaceFileItem struct for SpaceFileItem
type SpaceFileItem struct {
// ETag is the store's entity tag for the bytes currently at this name, with the quotes the store wraps it in stripped. It is an opaque VERSION and not a checksum to verify against: a single-part upload's tag happens to be the MD5 of the content and a multipart upload's is not, and nothing here says which this was. Compare two reads of one file to learn whether it changed; absent for a folder, and for a file the store reports none for.
Etag *string `json:"etag,omitempty"`
// Folder is true for a folder entry, which is emergent from \"/\" in the names beneath it rather than a thing that was created.
IsFolder *bool `json:"isFolder,omitempty"`
// ModifiedAt is when the file was last written, in unix seconds, and 0 for a folder.
ModifiedAt *int64 `json:"modifiedAt,omitempty"`
// Name is the entry's name RELATIVE to the folder that was listed.
Name *string `json:"name,omitempty"`
// Size is the file's size in bytes, and 0 for a folder.
Size *int64 `json:"size,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SpaceFileItem SpaceFileItem
// NewSpaceFileItem instantiates a new SpaceFileItem 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 NewSpaceFileItem() *SpaceFileItem {
this := SpaceFileItem{}
return &this
}
// NewSpaceFileItemWithDefaults instantiates a new SpaceFileItem 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 NewSpaceFileItemWithDefaults() *SpaceFileItem {
this := SpaceFileItem{}
return &this
}
// GetEtag returns the Etag field value if set, zero value otherwise.
func (o *SpaceFileItem) GetEtag() string {
if o == nil || IsNil(o.Etag) {
var ret string
return ret
}
return *o.Etag
}
// GetEtagOk returns a tuple with the Etag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileItem) GetEtagOk() (*string, bool) {
if o == nil || IsNil(o.Etag) {
return nil, false
}
return o.Etag, true
}
// HasEtag returns a boolean if a field has been set.
func (o *SpaceFileItem) HasEtag() bool {
if o != nil && !IsNil(o.Etag) {
return true
}
return false
}
// SetEtag gets a reference to the given string and assigns it to the Etag field.
func (o *SpaceFileItem) SetEtag(v string) {
o.Etag = &v
}
// GetIsFolder returns the IsFolder field value if set, zero value otherwise.
func (o *SpaceFileItem) GetIsFolder() bool {
if o == nil || IsNil(o.IsFolder) {
var ret bool
return ret
}
return *o.IsFolder
}
// GetIsFolderOk returns a tuple with the IsFolder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileItem) GetIsFolderOk() (*bool, bool) {
if o == nil || IsNil(o.IsFolder) {
return nil, false
}
return o.IsFolder, true
}
// HasIsFolder returns a boolean if a field has been set.
func (o *SpaceFileItem) HasIsFolder() bool {
if o != nil && !IsNil(o.IsFolder) {
return true
}
return false
}
// SetIsFolder gets a reference to the given bool and assigns it to the IsFolder field.
func (o *SpaceFileItem) SetIsFolder(v bool) {
o.IsFolder = &v
}
// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise.
func (o *SpaceFileItem) GetModifiedAt() int64 {
if o == nil || IsNil(o.ModifiedAt) {
var ret int64
return ret
}
return *o.ModifiedAt
}
// GetModifiedAtOk returns a tuple with the ModifiedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileItem) GetModifiedAtOk() (*int64, bool) {
if o == nil || IsNil(o.ModifiedAt) {
return nil, false
}
return o.ModifiedAt, true
}
// HasModifiedAt returns a boolean if a field has been set.
func (o *SpaceFileItem) HasModifiedAt() bool {
if o != nil && !IsNil(o.ModifiedAt) {
return true
}
return false
}
// SetModifiedAt gets a reference to the given int64 and assigns it to the ModifiedAt field.
func (o *SpaceFileItem) SetModifiedAt(v int64) {
o.ModifiedAt = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *SpaceFileItem) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileItem) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *SpaceFileItem) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *SpaceFileItem) SetName(v string) {
o.Name = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *SpaceFileItem) GetSize() int64 {
if o == nil || IsNil(o.Size) {
var ret int64
return ret
}
return *o.Size
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpaceFileItem) GetSizeOk() (*int64, bool) {
if o == nil || IsNil(o.Size) {
return nil, false
}
return o.Size, true
}
// HasSize returns a boolean if a field has been set.
func (o *SpaceFileItem) HasSize() bool {
if o != nil && !IsNil(o.Size) {
return true
}
return false
}
// SetSize gets a reference to the given int64 and assigns it to the Size field.
func (o *SpaceFileItem) SetSize(v int64) {
o.Size = &v
}
func (o SpaceFileItem) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SpaceFileItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Etag) {
toSerialize["etag"] = o.Etag
}
if !IsNil(o.IsFolder) {
toSerialize["isFolder"] = o.IsFolder
}
if !IsNil(o.ModifiedAt) {
toSerialize["modifiedAt"] = o.ModifiedAt
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SpaceFileItem) UnmarshalJSON(data []byte) (err error) {
varSpaceFileItem := _SpaceFileItem{}
err = json.Unmarshal(data, &varSpaceFileItem)
if err != nil {
return err
}
*o = SpaceFileItem(varSpaceFileItem)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "etag")
delete(additionalProperties, "isFolder")
delete(additionalProperties, "modifiedAt")
delete(additionalProperties, "name")
delete(additionalProperties, "size")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSpaceFileItem struct {
value *SpaceFileItem
isSet bool
}
func (v NullableSpaceFileItem) Get() *SpaceFileItem {
return v.value
}
func (v *NullableSpaceFileItem) Set(val *SpaceFileItem) {
v.value = val
v.isSet = true
}
func (v NullableSpaceFileItem) IsSet() bool {
return v.isSet
}
func (v *NullableSpaceFileItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSpaceFileItem(val *SpaceFileItem) *NullableSpaceFileItem {
return &NullableSpaceFileItem{value: val, isSet: true}
}
func (v NullableSpaceFileItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSpaceFileItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}