Files
sdk/model_s3_object_list.go

269 lines
6.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 S3ObjectList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &S3ObjectList{}
// S3ObjectList struct for S3ObjectList
type S3ObjectList struct {
// Bucket is the bucket that was listed, friendly name.
Bucket *string `json:"bucket,omitempty"`
// Objects are the entries at this level, keys RELATIVE to Prefix.
Objects []S3ObjectItem `json:"objects,omitempty"`
// Prefix is the sub-folder the listing was scoped to, cleaned. Empty for the bucket root.
Prefix *string `json:"prefix,omitempty"`
// Total is how many entries came back. The listing is BOUNDED, so a bucket with more keys than the cap answers the cap and this says so — it is not a count of what the bucket holds.
Total *int64 `json:"total,omitempty"`
AdditionalProperties map[string]interface{}
}
type _S3ObjectList S3ObjectList
// NewS3ObjectList instantiates a new S3ObjectList 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 NewS3ObjectList() *S3ObjectList {
this := S3ObjectList{}
return &this
}
// NewS3ObjectListWithDefaults instantiates a new S3ObjectList 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 NewS3ObjectListWithDefaults() *S3ObjectList {
this := S3ObjectList{}
return &this
}
// GetBucket returns the Bucket field value if set, zero value otherwise.
func (o *S3ObjectList) GetBucket() string {
if o == nil || IsNil(o.Bucket) {
var ret string
return ret
}
return *o.Bucket
}
// GetBucketOk returns a tuple with the Bucket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *S3ObjectList) GetBucketOk() (*string, bool) {
if o == nil || IsNil(o.Bucket) {
return nil, false
}
return o.Bucket, true
}
// HasBucket returns a boolean if a field has been set.
func (o *S3ObjectList) HasBucket() bool {
if o != nil && !IsNil(o.Bucket) {
return true
}
return false
}
// SetBucket gets a reference to the given string and assigns it to the Bucket field.
func (o *S3ObjectList) SetBucket(v string) {
o.Bucket = &v
}
// GetObjects returns the Objects field value if set, zero value otherwise.
func (o *S3ObjectList) GetObjects() []S3ObjectItem {
if o == nil || IsNil(o.Objects) {
var ret []S3ObjectItem
return ret
}
return o.Objects
}
// GetObjectsOk returns a tuple with the Objects field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *S3ObjectList) GetObjectsOk() ([]S3ObjectItem, bool) {
if o == nil || IsNil(o.Objects) {
return nil, false
}
return o.Objects, true
}
// HasObjects returns a boolean if a field has been set.
func (o *S3ObjectList) HasObjects() bool {
if o != nil && !IsNil(o.Objects) {
return true
}
return false
}
// SetObjects gets a reference to the given []S3ObjectItem and assigns it to the Objects field.
func (o *S3ObjectList) SetObjects(v []S3ObjectItem) {
o.Objects = v
}
// GetPrefix returns the Prefix field value if set, zero value otherwise.
func (o *S3ObjectList) GetPrefix() string {
if o == nil || IsNil(o.Prefix) {
var ret string
return ret
}
return *o.Prefix
}
// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *S3ObjectList) GetPrefixOk() (*string, bool) {
if o == nil || IsNil(o.Prefix) {
return nil, false
}
return o.Prefix, true
}
// HasPrefix returns a boolean if a field has been set.
func (o *S3ObjectList) HasPrefix() bool {
if o != nil && !IsNil(o.Prefix) {
return true
}
return false
}
// SetPrefix gets a reference to the given string and assigns it to the Prefix field.
func (o *S3ObjectList) SetPrefix(v string) {
o.Prefix = &v
}
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *S3ObjectList) 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 *S3ObjectList) 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 *S3ObjectList) 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 *S3ObjectList) SetTotal(v int64) {
o.Total = &v
}
func (o S3ObjectList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o S3ObjectList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bucket) {
toSerialize["bucket"] = o.Bucket
}
if !IsNil(o.Objects) {
toSerialize["objects"] = o.Objects
}
if !IsNil(o.Prefix) {
toSerialize["prefix"] = o.Prefix
}
if !IsNil(o.Total) {
toSerialize["total"] = o.Total
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *S3ObjectList) UnmarshalJSON(data []byte) (err error) {
varS3ObjectList := _S3ObjectList{}
err = json.Unmarshal(data, &varS3ObjectList)
if err != nil {
return err
}
*o = S3ObjectList(varS3ObjectList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bucket")
delete(additionalProperties, "objects")
delete(additionalProperties, "prefix")
delete(additionalProperties, "total")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableS3ObjectList struct {
value *S3ObjectList
isSet bool
}
func (v NullableS3ObjectList) Get() *S3ObjectList {
return v.value
}
func (v *NullableS3ObjectList) Set(val *S3ObjectList) {
v.value = val
v.isSet = true
}
func (v NullableS3ObjectList) IsSet() bool {
return v.isSet
}
func (v *NullableS3ObjectList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableS3ObjectList(val *S3ObjectList) *NullableS3ObjectList {
return &NullableS3ObjectList{value: val, isSet: true}
}
func (v NullableS3ObjectList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableS3ObjectList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}