Files
sdk/model_kv_kv_entry.go

307 lines
7.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 KvKvEntry type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &KvKvEntry{}
// KvKvEntry struct for KvKvEntry
type KvKvEntry struct {
// Created is when this revision was written, RFC3339.
Created *string `json:"created,omitempty"`
// Key is the entry's key.
Key *string `json:"key,omitempty"`
// Operation is what wrote the revision: put, del or purge.
Operation *string `json:"operation,omitempty"`
// Revision is the entry's revision in the bucket.
Revision *int32 `json:"revision,omitempty"`
// Value is the value as UTF-8 text; empty for delete and purge markers.
Value *string `json:"value,omitempty"`
AdditionalProperties map[string]interface{}
}
type _KvKvEntry KvKvEntry
// NewKvKvEntry instantiates a new KvKvEntry 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 NewKvKvEntry() *KvKvEntry {
this := KvKvEntry{}
return &this
}
// NewKvKvEntryWithDefaults instantiates a new KvKvEntry 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 NewKvKvEntryWithDefaults() *KvKvEntry {
this := KvKvEntry{}
return &this
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *KvKvEntry) GetCreated() string {
if o == nil || IsNil(o.Created) {
var ret string
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KvKvEntry) GetCreatedOk() (*string, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *KvKvEntry) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given string and assigns it to the Created field.
func (o *KvKvEntry) SetCreated(v string) {
o.Created = &v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *KvKvEntry) 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 *KvKvEntry) 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 *KvKvEntry) 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 *KvKvEntry) SetKey(v string) {
o.Key = &v
}
// GetOperation returns the Operation field value if set, zero value otherwise.
func (o *KvKvEntry) GetOperation() string {
if o == nil || IsNil(o.Operation) {
var ret string
return ret
}
return *o.Operation
}
// GetOperationOk returns a tuple with the Operation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KvKvEntry) GetOperationOk() (*string, bool) {
if o == nil || IsNil(o.Operation) {
return nil, false
}
return o.Operation, true
}
// HasOperation returns a boolean if a field has been set.
func (o *KvKvEntry) HasOperation() bool {
if o != nil && !IsNil(o.Operation) {
return true
}
return false
}
// SetOperation gets a reference to the given string and assigns it to the Operation field.
func (o *KvKvEntry) SetOperation(v string) {
o.Operation = &v
}
// GetRevision returns the Revision field value if set, zero value otherwise.
func (o *KvKvEntry) GetRevision() int32 {
if o == nil || IsNil(o.Revision) {
var ret int32
return ret
}
return *o.Revision
}
// GetRevisionOk returns a tuple with the Revision field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KvKvEntry) GetRevisionOk() (*int32, bool) {
if o == nil || IsNil(o.Revision) {
return nil, false
}
return o.Revision, true
}
// HasRevision returns a boolean if a field has been set.
func (o *KvKvEntry) HasRevision() bool {
if o != nil && !IsNil(o.Revision) {
return true
}
return false
}
// SetRevision gets a reference to the given int32 and assigns it to the Revision field.
func (o *KvKvEntry) SetRevision(v int32) {
o.Revision = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *KvKvEntry) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KvKvEntry) GetValueOk() (*string, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *KvKvEntry) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *KvKvEntry) SetValue(v string) {
o.Value = &v
}
func (o KvKvEntry) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o KvKvEntry) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Operation) {
toSerialize["operation"] = o.Operation
}
if !IsNil(o.Revision) {
toSerialize["revision"] = o.Revision
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *KvKvEntry) UnmarshalJSON(data []byte) (err error) {
varKvKvEntry := _KvKvEntry{}
err = json.Unmarshal(data, &varKvKvEntry)
if err != nil {
return err
}
*o = KvKvEntry(varKvKvEntry)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created")
delete(additionalProperties, "key")
delete(additionalProperties, "operation")
delete(additionalProperties, "revision")
delete(additionalProperties, "value")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableKvKvEntry struct {
value *KvKvEntry
isSet bool
}
func (v NullableKvKvEntry) Get() *KvKvEntry {
return v.value
}
func (v *NullableKvKvEntry) Set(val *KvKvEntry) {
v.value = val
v.isSet = true
}
func (v NullableKvKvEntry) IsSet() bool {
return v.isSet
}
func (v *NullableKvKvEntry) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKvKvEntry(val *KvKvEntry) *NullableKvKvEntry {
return &NullableKvKvEntry{value: val, isSet: true}
}
func (v NullableKvKvEntry) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKvKvEntry) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}