Files
sdk/model_s3_upload_done.go

269 lines
6.5 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 S3UploadDone type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &S3UploadDone{}
// S3UploadDone struct for S3UploadDone
type S3UploadDone struct {
// ETag is the assembled object's tag, quotes stripped.
Etag *string `json:"etag,omitempty"`
// Key is the object's key.
Key *string `json:"key,omitempty"`
// Parts is how many parts it was assembled from.
Parts *int64 `json:"parts,omitempty"`
// Size is the object's length in bytes: the sum of its parts.
Size *int64 `json:"size,omitempty"`
AdditionalProperties map[string]interface{}
}
type _S3UploadDone S3UploadDone
// NewS3UploadDone instantiates a new S3UploadDone 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 NewS3UploadDone() *S3UploadDone {
this := S3UploadDone{}
return &this
}
// NewS3UploadDoneWithDefaults instantiates a new S3UploadDone 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 NewS3UploadDoneWithDefaults() *S3UploadDone {
this := S3UploadDone{}
return &this
}
// GetEtag returns the Etag field value if set, zero value otherwise.
func (o *S3UploadDone) 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 *S3UploadDone) 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 *S3UploadDone) 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 *S3UploadDone) SetEtag(v string) {
o.Etag = &v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *S3UploadDone) 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 *S3UploadDone) 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 *S3UploadDone) 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 *S3UploadDone) SetKey(v string) {
o.Key = &v
}
// GetParts returns the Parts field value if set, zero value otherwise.
func (o *S3UploadDone) GetParts() int64 {
if o == nil || IsNil(o.Parts) {
var ret int64
return ret
}
return *o.Parts
}
// GetPartsOk returns a tuple with the Parts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *S3UploadDone) GetPartsOk() (*int64, bool) {
if o == nil || IsNil(o.Parts) {
return nil, false
}
return o.Parts, true
}
// HasParts returns a boolean if a field has been set.
func (o *S3UploadDone) HasParts() bool {
if o != nil && !IsNil(o.Parts) {
return true
}
return false
}
// SetParts gets a reference to the given int64 and assigns it to the Parts field.
func (o *S3UploadDone) SetParts(v int64) {
o.Parts = &v
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *S3UploadDone) 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 *S3UploadDone) 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 *S3UploadDone) 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 *S3UploadDone) SetSize(v int64) {
o.Size = &v
}
func (o S3UploadDone) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o S3UploadDone) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Etag) {
toSerialize["etag"] = o.Etag
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Parts) {
toSerialize["parts"] = o.Parts
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *S3UploadDone) UnmarshalJSON(data []byte) (err error) {
varS3UploadDone := _S3UploadDone{}
err = json.Unmarshal(data, &varS3UploadDone)
if err != nil {
return err
}
*o = S3UploadDone(varS3UploadDone)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "etag")
delete(additionalProperties, "key")
delete(additionalProperties, "parts")
delete(additionalProperties, "size")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableS3UploadDone struct {
value *S3UploadDone
isSet bool
}
func (v NullableS3UploadDone) Get() *S3UploadDone {
return v.value
}
func (v *NullableS3UploadDone) Set(val *S3UploadDone) {
v.value = val
v.isSet = true
}
func (v NullableS3UploadDone) IsSet() bool {
return v.isSet
}
func (v *NullableS3UploadDone) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableS3UploadDone(val *S3UploadDone) *NullableS3UploadDone {
return &NullableS3UploadDone{value: val, isSet: true}
}
func (v NullableS3UploadDone) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableS3UploadDone) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}