Files
sdk/model_flag_def_row.go

307 lines
8.2 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 FlagDefRow type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FlagDefRow{}
// FlagDefRow struct for FlagDefRow
type FlagDefRow struct {
Definition interface{} `json:"definition,omitempty"`
// Key is the flag's primary key in the caller's (org, project) store, and the name evaluation looks it up by. On a write it is taken from the URL, never from the body: the stored document's own \"key\" is forced to match.
Key *string `json:"key,omitempty"`
// UpdatedAt is when the definition was last written, RFC 3339 UTC.
UpdatedAt *string `json:"updated_at,omitempty"`
// UpdatedBy is the email of the principal who last wrote it. Empty when the write came from an in-process composer (an experiment registering its own assignment flag) rather than from a signed-in person.
UpdatedBy *string `json:"updated_by,omitempty"`
// Version is 1 when the key was created and rises by one on every overwrite. It counts writes, not content changes: re-storing an identical document bumps it.
Version *int64 `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FlagDefRow FlagDefRow
// NewFlagDefRow instantiates a new FlagDefRow 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 NewFlagDefRow() *FlagDefRow {
this := FlagDefRow{}
return &this
}
// NewFlagDefRowWithDefaults instantiates a new FlagDefRow 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 NewFlagDefRowWithDefaults() *FlagDefRow {
this := FlagDefRow{}
return &this
}
// GetDefinition returns the Definition field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *FlagDefRow) GetDefinition() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Definition
}
// GetDefinitionOk returns a tuple with the Definition field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *FlagDefRow) GetDefinitionOk() (*interface{}, bool) {
if o == nil || IsNil(o.Definition) {
return nil, false
}
return &o.Definition, true
}
// HasDefinition returns a boolean if a field has been set.
func (o *FlagDefRow) HasDefinition() bool {
if o != nil && !IsNil(o.Definition) {
return true
}
return false
}
// SetDefinition gets a reference to the given interface{} and assigns it to the Definition field.
func (o *FlagDefRow) SetDefinition(v interface{}) {
o.Definition = v
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *FlagDefRow) 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 *FlagDefRow) 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 *FlagDefRow) 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 *FlagDefRow) SetKey(v string) {
o.Key = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *FlagDefRow) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt) {
var ret string
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagDefRow) GetUpdatedAtOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *FlagDefRow) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *FlagDefRow) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
// GetUpdatedBy returns the UpdatedBy field value if set, zero value otherwise.
func (o *FlagDefRow) GetUpdatedBy() string {
if o == nil || IsNil(o.UpdatedBy) {
var ret string
return ret
}
return *o.UpdatedBy
}
// GetUpdatedByOk returns a tuple with the UpdatedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagDefRow) GetUpdatedByOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedBy) {
return nil, false
}
return o.UpdatedBy, true
}
// HasUpdatedBy returns a boolean if a field has been set.
func (o *FlagDefRow) HasUpdatedBy() bool {
if o != nil && !IsNil(o.UpdatedBy) {
return true
}
return false
}
// SetUpdatedBy gets a reference to the given string and assigns it to the UpdatedBy field.
func (o *FlagDefRow) SetUpdatedBy(v string) {
o.UpdatedBy = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *FlagDefRow) GetVersion() int64 {
if o == nil || IsNil(o.Version) {
var ret int64
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FlagDefRow) GetVersionOk() (*int64, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *FlagDefRow) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given int64 and assigns it to the Version field.
func (o *FlagDefRow) SetVersion(v int64) {
o.Version = &v
}
func (o FlagDefRow) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FlagDefRow) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Definition != nil {
toSerialize["definition"] = o.Definition
}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.UpdatedAt) {
toSerialize["updated_at"] = o.UpdatedAt
}
if !IsNil(o.UpdatedBy) {
toSerialize["updated_by"] = o.UpdatedBy
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FlagDefRow) UnmarshalJSON(data []byte) (err error) {
varFlagDefRow := _FlagDefRow{}
err = json.Unmarshal(data, &varFlagDefRow)
if err != nil {
return err
}
*o = FlagDefRow(varFlagDefRow)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "definition")
delete(additionalProperties, "key")
delete(additionalProperties, "updated_at")
delete(additionalProperties, "updated_by")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFlagDefRow struct {
value *FlagDefRow
isSet bool
}
func (v NullableFlagDefRow) Get() *FlagDefRow {
return v.value
}
func (v *NullableFlagDefRow) Set(val *FlagDefRow) {
v.value = val
v.isSet = true
}
func (v NullableFlagDefRow) IsSet() bool {
return v.isSet
}
func (v *NullableFlagDefRow) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFlagDefRow(val *FlagDefRow) *NullableFlagDefRow {
return &NullableFlagDefRow{value: val, isSet: true}
}
func (v NullableFlagDefRow) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFlagDefRow) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}