Files
sdk/model_compute_sample_list.go

155 lines
4.1 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 ComputeSampleList type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComputeSampleList{}
// ComputeSampleList struct for ComputeSampleList
type ComputeSampleList struct {
// Samples are the readings, OLDEST first — the order a chart plots.
Samples []ComputeSampleView `json:"samples,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComputeSampleList ComputeSampleList
// NewComputeSampleList instantiates a new ComputeSampleList 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 NewComputeSampleList() *ComputeSampleList {
this := ComputeSampleList{}
return &this
}
// NewComputeSampleListWithDefaults instantiates a new ComputeSampleList 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 NewComputeSampleListWithDefaults() *ComputeSampleList {
this := ComputeSampleList{}
return &this
}
// GetSamples returns the Samples field value if set, zero value otherwise.
func (o *ComputeSampleList) GetSamples() []ComputeSampleView {
if o == nil || IsNil(o.Samples) {
var ret []ComputeSampleView
return ret
}
return o.Samples
}
// GetSamplesOk returns a tuple with the Samples field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComputeSampleList) GetSamplesOk() ([]ComputeSampleView, bool) {
if o == nil || IsNil(o.Samples) {
return nil, false
}
return o.Samples, true
}
// HasSamples returns a boolean if a field has been set.
func (o *ComputeSampleList) HasSamples() bool {
if o != nil && !IsNil(o.Samples) {
return true
}
return false
}
// SetSamples gets a reference to the given []ComputeSampleView and assigns it to the Samples field.
func (o *ComputeSampleList) SetSamples(v []ComputeSampleView) {
o.Samples = v
}
func (o ComputeSampleList) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComputeSampleList) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Samples) {
toSerialize["samples"] = o.Samples
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComputeSampleList) UnmarshalJSON(data []byte) (err error) {
varComputeSampleList := _ComputeSampleList{}
err = json.Unmarshal(data, &varComputeSampleList)
if err != nil {
return err
}
*o = ComputeSampleList(varComputeSampleList)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "samples")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComputeSampleList struct {
value *ComputeSampleList
isSet bool
}
func (v NullableComputeSampleList) Get() *ComputeSampleList {
return v.value
}
func (v *NullableComputeSampleList) Set(val *ComputeSampleList) {
v.value = val
v.isSet = true
}
func (v NullableComputeSampleList) IsSet() bool {
return v.isSet
}
func (v *NullableComputeSampleList) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComputeSampleList(val *ComputeSampleList) *NullableComputeSampleList {
return &NullableComputeSampleList{value: val, isSet: true}
}
func (v NullableComputeSampleList) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComputeSampleList) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}