Files
sdk/model_reference_reference_version.go

307 lines
8.3 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 ReferenceReferenceVersion type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ReferenceReferenceVersion{}
// ReferenceReferenceVersion struct for ReferenceReferenceVersion
type ReferenceReferenceVersion struct {
// AsOf is when the oldest of them was current, RFC 3339.
AsOf *string `json:"asOf,omitempty"`
// Refusal is why it could not be consulted, when it could not.
Refusal *string `json:"refusal,omitempty"`
// Set is the name the consulted set is addressed by.
Set *string `json:"set,omitempty"`
// Stale is whether it is past its freshness bound.
Stale *bool `json:"stale,omitempty"`
// Version is every contributing publisher and its content digest.
Version *string `json:"version,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ReferenceReferenceVersion ReferenceReferenceVersion
// NewReferenceReferenceVersion instantiates a new ReferenceReferenceVersion 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 NewReferenceReferenceVersion() *ReferenceReferenceVersion {
this := ReferenceReferenceVersion{}
return &this
}
// NewReferenceReferenceVersionWithDefaults instantiates a new ReferenceReferenceVersion 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 NewReferenceReferenceVersionWithDefaults() *ReferenceReferenceVersion {
this := ReferenceReferenceVersion{}
return &this
}
// GetAsOf returns the AsOf field value if set, zero value otherwise.
func (o *ReferenceReferenceVersion) GetAsOf() string {
if o == nil || IsNil(o.AsOf) {
var ret string
return ret
}
return *o.AsOf
}
// GetAsOfOk returns a tuple with the AsOf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceVersion) GetAsOfOk() (*string, bool) {
if o == nil || IsNil(o.AsOf) {
return nil, false
}
return o.AsOf, true
}
// HasAsOf returns a boolean if a field has been set.
func (o *ReferenceReferenceVersion) HasAsOf() bool {
if o != nil && !IsNil(o.AsOf) {
return true
}
return false
}
// SetAsOf gets a reference to the given string and assigns it to the AsOf field.
func (o *ReferenceReferenceVersion) SetAsOf(v string) {
o.AsOf = &v
}
// GetRefusal returns the Refusal field value if set, zero value otherwise.
func (o *ReferenceReferenceVersion) GetRefusal() string {
if o == nil || IsNil(o.Refusal) {
var ret string
return ret
}
return *o.Refusal
}
// GetRefusalOk returns a tuple with the Refusal field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceVersion) GetRefusalOk() (*string, bool) {
if o == nil || IsNil(o.Refusal) {
return nil, false
}
return o.Refusal, true
}
// HasRefusal returns a boolean if a field has been set.
func (o *ReferenceReferenceVersion) HasRefusal() bool {
if o != nil && !IsNil(o.Refusal) {
return true
}
return false
}
// SetRefusal gets a reference to the given string and assigns it to the Refusal field.
func (o *ReferenceReferenceVersion) SetRefusal(v string) {
o.Refusal = &v
}
// GetSet returns the Set field value if set, zero value otherwise.
func (o *ReferenceReferenceVersion) GetSet() string {
if o == nil || IsNil(o.Set) {
var ret string
return ret
}
return *o.Set
}
// GetSetOk returns a tuple with the Set field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceVersion) GetSetOk() (*string, bool) {
if o == nil || IsNil(o.Set) {
return nil, false
}
return o.Set, true
}
// HasSet returns a boolean if a field has been set.
func (o *ReferenceReferenceVersion) HasSet() bool {
if o != nil && !IsNil(o.Set) {
return true
}
return false
}
// SetSet gets a reference to the given string and assigns it to the Set field.
func (o *ReferenceReferenceVersion) SetSet(v string) {
o.Set = &v
}
// GetStale returns the Stale field value if set, zero value otherwise.
func (o *ReferenceReferenceVersion) GetStale() bool {
if o == nil || IsNil(o.Stale) {
var ret bool
return ret
}
return *o.Stale
}
// GetStaleOk returns a tuple with the Stale field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ReferenceReferenceVersion) GetStaleOk() (*bool, bool) {
if o == nil || IsNil(o.Stale) {
return nil, false
}
return o.Stale, true
}
// HasStale returns a boolean if a field has been set.
func (o *ReferenceReferenceVersion) HasStale() bool {
if o != nil && !IsNil(o.Stale) {
return true
}
return false
}
// SetStale gets a reference to the given bool and assigns it to the Stale field.
func (o *ReferenceReferenceVersion) SetStale(v bool) {
o.Stale = &v
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *ReferenceReferenceVersion) GetVersion() string {
if o == nil || IsNil(o.Version) {
var ret string
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 *ReferenceReferenceVersion) GetVersionOk() (*string, 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 *ReferenceReferenceVersion) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *ReferenceReferenceVersion) SetVersion(v string) {
o.Version = &v
}
func (o ReferenceReferenceVersion) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ReferenceReferenceVersion) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AsOf) {
toSerialize["asOf"] = o.AsOf
}
if !IsNil(o.Refusal) {
toSerialize["refusal"] = o.Refusal
}
if !IsNil(o.Set) {
toSerialize["set"] = o.Set
}
if !IsNil(o.Stale) {
toSerialize["stale"] = o.Stale
}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ReferenceReferenceVersion) UnmarshalJSON(data []byte) (err error) {
varReferenceReferenceVersion := _ReferenceReferenceVersion{}
err = json.Unmarshal(data, &varReferenceReferenceVersion)
if err != nil {
return err
}
*o = ReferenceReferenceVersion(varReferenceReferenceVersion)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "asOf")
delete(additionalProperties, "refusal")
delete(additionalProperties, "set")
delete(additionalProperties, "stale")
delete(additionalProperties, "version")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableReferenceReferenceVersion struct {
value *ReferenceReferenceVersion
isSet bool
}
func (v NullableReferenceReferenceVersion) Get() *ReferenceReferenceVersion {
return v.value
}
func (v *NullableReferenceReferenceVersion) Set(val *ReferenceReferenceVersion) {
v.value = val
v.isSet = true
}
func (v NullableReferenceReferenceVersion) IsSet() bool {
return v.isSet
}
func (v *NullableReferenceReferenceVersion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReferenceReferenceVersion(val *ReferenceReferenceVersion) *NullableReferenceReferenceVersion {
return &NullableReferenceReferenceVersion{value: val, isSet: true}
}
func (v NullableReferenceReferenceVersion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReferenceReferenceVersion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}