mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
307 lines
7.9 KiB
Go
307 lines
7.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 S3ObjectItem type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &S3ObjectItem{}
|
|
|
|
// S3ObjectItem struct for S3ObjectItem
|
|
type S3ObjectItem struct {
|
|
// ETag is the store's entity tag for the bytes currently at this key, 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 key to learn whether the object changed; absent for a folder entry, and for an object the store reports none for.
|
|
Etag *string `json:"etag,omitempty"`
|
|
// true for a folder (common prefix)
|
|
IsDir *bool `json:"isDir,omitempty"`
|
|
// key RELATIVE to the requested prefix
|
|
Key *string `json:"key,omitempty"`
|
|
// unix seconds (0 for a folder)
|
|
LastModified *int64 `json:"lastModified,omitempty"`
|
|
// bytes (0 for a folder)
|
|
Size *int64 `json:"size,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _S3ObjectItem S3ObjectItem
|
|
|
|
// NewS3ObjectItem instantiates a new S3ObjectItem 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 NewS3ObjectItem() *S3ObjectItem {
|
|
this := S3ObjectItem{}
|
|
return &this
|
|
}
|
|
|
|
// NewS3ObjectItemWithDefaults instantiates a new S3ObjectItem 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 NewS3ObjectItemWithDefaults() *S3ObjectItem {
|
|
this := S3ObjectItem{}
|
|
return &this
|
|
}
|
|
|
|
// GetEtag returns the Etag field value if set, zero value otherwise.
|
|
func (o *S3ObjectItem) 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 *S3ObjectItem) 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 *S3ObjectItem) 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 *S3ObjectItem) SetEtag(v string) {
|
|
o.Etag = &v
|
|
}
|
|
|
|
// GetIsDir returns the IsDir field value if set, zero value otherwise.
|
|
func (o *S3ObjectItem) GetIsDir() bool {
|
|
if o == nil || IsNil(o.IsDir) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.IsDir
|
|
}
|
|
|
|
// GetIsDirOk returns a tuple with the IsDir field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *S3ObjectItem) GetIsDirOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.IsDir) {
|
|
return nil, false
|
|
}
|
|
return o.IsDir, true
|
|
}
|
|
|
|
// HasIsDir returns a boolean if a field has been set.
|
|
func (o *S3ObjectItem) HasIsDir() bool {
|
|
if o != nil && !IsNil(o.IsDir) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetIsDir gets a reference to the given bool and assigns it to the IsDir field.
|
|
func (o *S3ObjectItem) SetIsDir(v bool) {
|
|
o.IsDir = &v
|
|
}
|
|
|
|
// GetKey returns the Key field value if set, zero value otherwise.
|
|
func (o *S3ObjectItem) GetKey() string {
|
|
if o == nil || IsNil(o.Key) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Key
|
|
}
|
|
|
|
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *S3ObjectItem) GetKeyOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Key) {
|
|
return nil, false
|
|
}
|
|
return o.Key, true
|
|
}
|
|
|
|
// HasKey returns a boolean if a field has been set.
|
|
func (o *S3ObjectItem) HasKey() bool {
|
|
if o != nil && !IsNil(o.Key) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetKey gets a reference to the given string and assigns it to the Key field.
|
|
func (o *S3ObjectItem) SetKey(v string) {
|
|
o.Key = &v
|
|
}
|
|
|
|
// GetLastModified returns the LastModified field value if set, zero value otherwise.
|
|
func (o *S3ObjectItem) GetLastModified() int64 {
|
|
if o == nil || IsNil(o.LastModified) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.LastModified
|
|
}
|
|
|
|
// GetLastModifiedOk returns a tuple with the LastModified field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *S3ObjectItem) GetLastModifiedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.LastModified) {
|
|
return nil, false
|
|
}
|
|
return o.LastModified, true
|
|
}
|
|
|
|
// HasLastModified returns a boolean if a field has been set.
|
|
func (o *S3ObjectItem) HasLastModified() bool {
|
|
if o != nil && !IsNil(o.LastModified) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLastModified gets a reference to the given int64 and assigns it to the LastModified field.
|
|
func (o *S3ObjectItem) SetLastModified(v int64) {
|
|
o.LastModified = &v
|
|
}
|
|
|
|
// GetSize returns the Size field value if set, zero value otherwise.
|
|
func (o *S3ObjectItem) 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 *S3ObjectItem) 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 *S3ObjectItem) 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 *S3ObjectItem) SetSize(v int64) {
|
|
o.Size = &v
|
|
}
|
|
|
|
func (o S3ObjectItem) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o S3ObjectItem) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Etag) {
|
|
toSerialize["etag"] = o.Etag
|
|
}
|
|
if !IsNil(o.IsDir) {
|
|
toSerialize["isDir"] = o.IsDir
|
|
}
|
|
if !IsNil(o.Key) {
|
|
toSerialize["key"] = o.Key
|
|
}
|
|
if !IsNil(o.LastModified) {
|
|
toSerialize["lastModified"] = o.LastModified
|
|
}
|
|
if !IsNil(o.Size) {
|
|
toSerialize["size"] = o.Size
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *S3ObjectItem) UnmarshalJSON(data []byte) (err error) {
|
|
varS3ObjectItem := _S3ObjectItem{}
|
|
|
|
err = json.Unmarshal(data, &varS3ObjectItem)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = S3ObjectItem(varS3ObjectItem)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "etag")
|
|
delete(additionalProperties, "isDir")
|
|
delete(additionalProperties, "key")
|
|
delete(additionalProperties, "lastModified")
|
|
delete(additionalProperties, "size")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableS3ObjectItem struct {
|
|
value *S3ObjectItem
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableS3ObjectItem) Get() *S3ObjectItem {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableS3ObjectItem) Set(val *S3ObjectItem) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableS3ObjectItem) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableS3ObjectItem) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableS3ObjectItem(val *S3ObjectItem) *NullableS3ObjectItem {
|
|
return &NullableS3ObjectItem{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableS3ObjectItem) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableS3ObjectItem) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|