mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
228 lines
5.7 KiB
Go
228 lines
5.7 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 TrafficGlobe type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TrafficGlobe{}
|
|
|
|
// TrafficGlobe struct for TrafficGlobe
|
|
type TrafficGlobe struct {
|
|
Points []TrafficPoint `json:"points,omitempty"`
|
|
Totals *TrafficTotals `json:"totals,omitempty"`
|
|
Window *TrafficWindow `json:"window,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TrafficGlobe TrafficGlobe
|
|
|
|
// NewTrafficGlobe instantiates a new TrafficGlobe 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 NewTrafficGlobe() *TrafficGlobe {
|
|
this := TrafficGlobe{}
|
|
return &this
|
|
}
|
|
|
|
// NewTrafficGlobeWithDefaults instantiates a new TrafficGlobe 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 NewTrafficGlobeWithDefaults() *TrafficGlobe {
|
|
this := TrafficGlobe{}
|
|
return &this
|
|
}
|
|
|
|
// GetPoints returns the Points field value if set, zero value otherwise.
|
|
func (o *TrafficGlobe) GetPoints() []TrafficPoint {
|
|
if o == nil || IsNil(o.Points) {
|
|
var ret []TrafficPoint
|
|
return ret
|
|
}
|
|
return o.Points
|
|
}
|
|
|
|
// GetPointsOk returns a tuple with the Points field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrafficGlobe) GetPointsOk() ([]TrafficPoint, bool) {
|
|
if o == nil || IsNil(o.Points) {
|
|
return nil, false
|
|
}
|
|
return o.Points, true
|
|
}
|
|
|
|
// HasPoints returns a boolean if a field has been set.
|
|
func (o *TrafficGlobe) HasPoints() bool {
|
|
if o != nil && !IsNil(o.Points) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPoints gets a reference to the given []TrafficPoint and assigns it to the Points field.
|
|
func (o *TrafficGlobe) SetPoints(v []TrafficPoint) {
|
|
o.Points = v
|
|
}
|
|
|
|
// GetTotals returns the Totals field value if set, zero value otherwise.
|
|
func (o *TrafficGlobe) GetTotals() TrafficTotals {
|
|
if o == nil || IsNil(o.Totals) {
|
|
var ret TrafficTotals
|
|
return ret
|
|
}
|
|
return *o.Totals
|
|
}
|
|
|
|
// GetTotalsOk returns a tuple with the Totals field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrafficGlobe) GetTotalsOk() (*TrafficTotals, bool) {
|
|
if o == nil || IsNil(o.Totals) {
|
|
return nil, false
|
|
}
|
|
return o.Totals, true
|
|
}
|
|
|
|
// HasTotals returns a boolean if a field has been set.
|
|
func (o *TrafficGlobe) HasTotals() bool {
|
|
if o != nil && !IsNil(o.Totals) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTotals gets a reference to the given TrafficTotals and assigns it to the Totals field.
|
|
func (o *TrafficGlobe) SetTotals(v TrafficTotals) {
|
|
o.Totals = &v
|
|
}
|
|
|
|
// GetWindow returns the Window field value if set, zero value otherwise.
|
|
func (o *TrafficGlobe) GetWindow() TrafficWindow {
|
|
if o == nil || IsNil(o.Window) {
|
|
var ret TrafficWindow
|
|
return ret
|
|
}
|
|
return *o.Window
|
|
}
|
|
|
|
// GetWindowOk returns a tuple with the Window field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TrafficGlobe) GetWindowOk() (*TrafficWindow, bool) {
|
|
if o == nil || IsNil(o.Window) {
|
|
return nil, false
|
|
}
|
|
return o.Window, true
|
|
}
|
|
|
|
// HasWindow returns a boolean if a field has been set.
|
|
func (o *TrafficGlobe) HasWindow() bool {
|
|
if o != nil && !IsNil(o.Window) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWindow gets a reference to the given TrafficWindow and assigns it to the Window field.
|
|
func (o *TrafficGlobe) SetWindow(v TrafficWindow) {
|
|
o.Window = &v
|
|
}
|
|
|
|
func (o TrafficGlobe) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TrafficGlobe) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Points) {
|
|
toSerialize["points"] = o.Points
|
|
}
|
|
if !IsNil(o.Totals) {
|
|
toSerialize["totals"] = o.Totals
|
|
}
|
|
if !IsNil(o.Window) {
|
|
toSerialize["window"] = o.Window
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TrafficGlobe) UnmarshalJSON(data []byte) (err error) {
|
|
varTrafficGlobe := _TrafficGlobe{}
|
|
|
|
err = json.Unmarshal(data, &varTrafficGlobe)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TrafficGlobe(varTrafficGlobe)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "points")
|
|
delete(additionalProperties, "totals")
|
|
delete(additionalProperties, "window")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTrafficGlobe struct {
|
|
value *TrafficGlobe
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTrafficGlobe) Get() *TrafficGlobe {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTrafficGlobe) Set(val *TrafficGlobe) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTrafficGlobe) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTrafficGlobe) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTrafficGlobe(val *TrafficGlobe) *NullableTrafficGlobe {
|
|
return &NullableTrafficGlobe{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTrafficGlobe) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTrafficGlobe) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|