Files
sdk/model_o11y_point.go

193 lines
4.4 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 O11yPoint type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &O11yPoint{}
// O11yPoint struct for O11yPoint
type O11yPoint struct {
// T is the bucket start, RFC3339 in UTC.
T *string `json:"t,omitempty"`
// V is the bucket's value.
V *float64 `json:"v,omitempty"`
AdditionalProperties map[string]interface{}
}
type _O11yPoint O11yPoint
// NewO11yPoint instantiates a new O11yPoint 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 NewO11yPoint() *O11yPoint {
this := O11yPoint{}
return &this
}
// NewO11yPointWithDefaults instantiates a new O11yPoint 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 NewO11yPointWithDefaults() *O11yPoint {
this := O11yPoint{}
return &this
}
// GetT returns the T field value if set, zero value otherwise.
func (o *O11yPoint) GetT() string {
if o == nil || IsNil(o.T) {
var ret string
return ret
}
return *o.T
}
// GetTOk returns a tuple with the T field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yPoint) GetTOk() (*string, bool) {
if o == nil || IsNil(o.T) {
return nil, false
}
return o.T, true
}
// HasT returns a boolean if a field has been set.
func (o *O11yPoint) HasT() bool {
if o != nil && !IsNil(o.T) {
return true
}
return false
}
// SetT gets a reference to the given string and assigns it to the T field.
func (o *O11yPoint) SetT(v string) {
o.T = &v
}
// GetV returns the V field value if set, zero value otherwise.
func (o *O11yPoint) GetV() float64 {
if o == nil || IsNil(o.V) {
var ret float64
return ret
}
return *o.V
}
// GetVOk returns a tuple with the V field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *O11yPoint) GetVOk() (*float64, bool) {
if o == nil || IsNil(o.V) {
return nil, false
}
return o.V, true
}
// HasV returns a boolean if a field has been set.
func (o *O11yPoint) HasV() bool {
if o != nil && !IsNil(o.V) {
return true
}
return false
}
// SetV gets a reference to the given float64 and assigns it to the V field.
func (o *O11yPoint) SetV(v float64) {
o.V = &v
}
func (o O11yPoint) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o O11yPoint) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.T) {
toSerialize["t"] = o.T
}
if !IsNil(o.V) {
toSerialize["v"] = o.V
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *O11yPoint) UnmarshalJSON(data []byte) (err error) {
varO11yPoint := _O11yPoint{}
err = json.Unmarshal(data, &varO11yPoint)
if err != nil {
return err
}
*o = O11yPoint(varO11yPoint)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "t")
delete(additionalProperties, "v")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableO11yPoint struct {
value *O11yPoint
isSet bool
}
func (v NullableO11yPoint) Get() *O11yPoint {
return v.value
}
func (v *NullableO11yPoint) Set(val *O11yPoint) {
v.value = val
v.isSet = true
}
func (v NullableO11yPoint) IsSet() bool {
return v.isSet
}
func (v *NullableO11yPoint) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableO11yPoint(val *O11yPoint) *NullableO11yPoint {
return &NullableO11yPoint{value: val, isSet: true}
}
func (v NullableO11yPoint) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableO11yPoint) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}