Files
sdk/model_kv_bucket_write.go

269 lines
6.8 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
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 KvBucketWrite type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KvBucketWrite{}
// KvBucketWrite struct for KvBucketWrite
type KvBucketWrite struct {
// Bucket is the bucket's name within the org, from the path: 1–64 of [A-Za-z0-9_], no dash.
Bucket *string `json:"bucket,omitempty"`
// History is how many revisions each key keeps, 1–64. 0 means 1.
History *int64 `json:"history,omitempty"`
// MaxValue caps one value's size in bytes. 0 or less means the server's ceiling.
MaxValue *int64 `json:"maxValue,omitempty"`
// TTL expires entries after this many SECONDS. 0 means no expiry.
Ttl *int64 `json:"ttl,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KvBucketWrite KvBucketWrite
// NewKvBucketWrite instantiates a new KvBucketWrite 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 NewKvBucketWrite() *KvBucketWrite {
this := KvBucketWrite{}
return &this
}
// NewKvBucketWriteWithDefaults instantiates a new KvBucketWrite 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 NewKvBucketWriteWithDefaults() *KvBucketWrite {
this := KvBucketWrite{}
return &this
}
// GetBucket returns the Bucket field value if set, zero value otherwise.
func (o *KvBucketWrite) 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 *KvBucketWrite) 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 *KvBucketWrite) 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 *KvBucketWrite) SetBucket(v string) {
o.Bucket = &v
}
// GetHistory returns the History field value if set, zero value otherwise.
func (o *KvBucketWrite) GetHistory() int64 {
if o == nil || IsNil(o.History) {
var ret int64
return ret
}
return *o.History
}
// GetHistoryOk returns a tuple with the History field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KvBucketWrite) GetHistoryOk() (*int64, bool) {
if o == nil || IsNil(o.History) {
return nil, false
}
return o.History, true
}
// HasHistory returns a boolean if a field has been set.
func (o *KvBucketWrite) HasHistory() bool {
if o != nil && !IsNil(o.History) {
return true
}
return false
}
// SetHistory gets a reference to the given int64 and assigns it to the History field.
func (o *KvBucketWrite) SetHistory(v int64) {
o.History = &v
}
// GetMaxValue returns the MaxValue field value if set, zero value otherwise.
func (o *KvBucketWrite) GetMaxValue() int64 {
if o == nil || IsNil(o.MaxValue) {
var ret int64
return ret
}
return *o.MaxValue
}
// GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KvBucketWrite) GetMaxValueOk() (*int64, bool) {
if o == nil || IsNil(o.MaxValue) {
return nil, false
}
return o.MaxValue, true
}
// HasMaxValue returns a boolean if a field has been set.
func (o *KvBucketWrite) HasMaxValue() bool {
if o != nil && !IsNil(o.MaxValue) {
return true
}
return false
}
// SetMaxValue gets a reference to the given int64 and assigns it to the MaxValue field.
func (o *KvBucketWrite) SetMaxValue(v int64) {
o.MaxValue = &v
}
// GetTtl returns the Ttl field value if set, zero value otherwise.
func (o *KvBucketWrite) GetTtl() int64 {
if o == nil || IsNil(o.Ttl) {
var ret int64
return ret
}
return *o.Ttl
}
// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KvBucketWrite) GetTtlOk() (*int64, bool) {
if o == nil || IsNil(o.Ttl) {
return nil, false
}
return o.Ttl, true
}
// HasTtl returns a boolean if a field has been set.
func (o *KvBucketWrite) HasTtl() bool {
if o != nil && !IsNil(o.Ttl) {
return true
}
return false
}
// SetTtl gets a reference to the given int64 and assigns it to the Ttl field.
func (o *KvBucketWrite) SetTtl(v int64) {
o.Ttl = &v
}
func (o KvBucketWrite) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KvBucketWrite) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Bucket) {
toSerialize["bucket"] = o.Bucket
}
if !IsNil(o.History) {
toSerialize["history"] = o.History
}
if !IsNil(o.MaxValue) {
toSerialize["maxValue"] = o.MaxValue
}
if !IsNil(o.Ttl) {
toSerialize["ttl"] = o.Ttl
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KvBucketWrite) UnmarshalJSON(data []byte) (err error) {
varKvBucketWrite := _KvBucketWrite{}
err = json.Unmarshal(data, &varKvBucketWrite)
if err != nil {
return err
}
*o = KvBucketWrite(varKvBucketWrite)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "bucket")
delete(additionalProperties, "history")
delete(additionalProperties, "maxValue")
delete(additionalProperties, "ttl")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKvBucketWrite struct {
value *KvBucketWrite
isSet bool
}
func (v NullableKvBucketWrite) Get() *KvBucketWrite {
return v.value
}
func (v *NullableKvBucketWrite) Set(val *KvBucketWrite) {
v.value = val
v.isSet = true
}
func (v NullableKvBucketWrite) IsSet() bool {
return v.isSet
}
func (v *NullableKvBucketWrite) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKvBucketWrite(val *KvBucketWrite) *NullableKvBucketWrite {
return &NullableKvBucketWrite{value: val, isSet: true}
}
func (v NullableKvBucketWrite) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKvBucketWrite) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}