Files
sdk/model_traffic_point.go

376 lines
9.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 TrafficPoint type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TrafficPoint{}
// TrafficPoint struct for TrafficPoint
type TrafficPoint struct {
ByService map[string]int32 `json:"byService,omitempty"`
ByTask map[string]int32 `json:"byTask,omitempty"`
Count *int32 `json:"count,omitempty"`
Country *string `json:"country,omitempty"`
Lat *float32 `json:"lat,omitempty"`
Lon *float32 `json:"lon,omitempty"`
Region *string `json:"region,omitempty"`
AdditionalProperties map[string]interface{}
}
type _TrafficPoint TrafficPoint
// NewTrafficPoint instantiates a new TrafficPoint 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 NewTrafficPoint() *TrafficPoint {
this := TrafficPoint{}
return &this
}
// NewTrafficPointWithDefaults instantiates a new TrafficPoint 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 NewTrafficPointWithDefaults() *TrafficPoint {
this := TrafficPoint{}
return &this
}
// GetByService returns the ByService field value if set, zero value otherwise.
func (o *TrafficPoint) GetByService() map[string]int32 {
if o == nil || IsNil(o.ByService) {
var ret map[string]int32
return ret
}
return o.ByService
}
// GetByServiceOk returns a tuple with the ByService field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrafficPoint) GetByServiceOk() (map[string]int32, bool) {
if o == nil || IsNil(o.ByService) {
return map[string]int32{}, false
}
return o.ByService, true
}
// HasByService returns a boolean if a field has been set.
func (o *TrafficPoint) HasByService() bool {
if o != nil && !IsNil(o.ByService) {
return true
}
return false
}
// SetByService gets a reference to the given map[string]int32 and assigns it to the ByService field.
func (o *TrafficPoint) SetByService(v map[string]int32) {
o.ByService = v
}
// GetByTask returns the ByTask field value if set, zero value otherwise.
func (o *TrafficPoint) GetByTask() map[string]int32 {
if o == nil || IsNil(o.ByTask) {
var ret map[string]int32
return ret
}
return o.ByTask
}
// GetByTaskOk returns a tuple with the ByTask field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrafficPoint) GetByTaskOk() (map[string]int32, bool) {
if o == nil || IsNil(o.ByTask) {
return map[string]int32{}, false
}
return o.ByTask, true
}
// HasByTask returns a boolean if a field has been set.
func (o *TrafficPoint) HasByTask() bool {
if o != nil && !IsNil(o.ByTask) {
return true
}
return false
}
// SetByTask gets a reference to the given map[string]int32 and assigns it to the ByTask field.
func (o *TrafficPoint) SetByTask(v map[string]int32) {
o.ByTask = v
}
// GetCount returns the Count field value if set, zero value otherwise.
func (o *TrafficPoint) GetCount() int32 {
if o == nil || IsNil(o.Count) {
var ret int32
return ret
}
return *o.Count
}
// GetCountOk returns a tuple with the Count field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrafficPoint) GetCountOk() (*int32, bool) {
if o == nil || IsNil(o.Count) {
return nil, false
}
return o.Count, true
}
// HasCount returns a boolean if a field has been set.
func (o *TrafficPoint) HasCount() bool {
if o != nil && !IsNil(o.Count) {
return true
}
return false
}
// SetCount gets a reference to the given int32 and assigns it to the Count field.
func (o *TrafficPoint) SetCount(v int32) {
o.Count = &v
}
// GetCountry returns the Country field value if set, zero value otherwise.
func (o *TrafficPoint) GetCountry() string {
if o == nil || IsNil(o.Country) {
var ret string
return ret
}
return *o.Country
}
// GetCountryOk returns a tuple with the Country field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrafficPoint) GetCountryOk() (*string, bool) {
if o == nil || IsNil(o.Country) {
return nil, false
}
return o.Country, true
}
// HasCountry returns a boolean if a field has been set.
func (o *TrafficPoint) HasCountry() bool {
if o != nil && !IsNil(o.Country) {
return true
}
return false
}
// SetCountry gets a reference to the given string and assigns it to the Country field.
func (o *TrafficPoint) SetCountry(v string) {
o.Country = &v
}
// GetLat returns the Lat field value if set, zero value otherwise.
func (o *TrafficPoint) GetLat() float32 {
if o == nil || IsNil(o.Lat) {
var ret float32
return ret
}
return *o.Lat
}
// GetLatOk returns a tuple with the Lat field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrafficPoint) GetLatOk() (*float32, bool) {
if o == nil || IsNil(o.Lat) {
return nil, false
}
return o.Lat, true
}
// HasLat returns a boolean if a field has been set.
func (o *TrafficPoint) HasLat() bool {
if o != nil && !IsNil(o.Lat) {
return true
}
return false
}
// SetLat gets a reference to the given float32 and assigns it to the Lat field.
func (o *TrafficPoint) SetLat(v float32) {
o.Lat = &v
}
// GetLon returns the Lon field value if set, zero value otherwise.
func (o *TrafficPoint) GetLon() float32 {
if o == nil || IsNil(o.Lon) {
var ret float32
return ret
}
return *o.Lon
}
// GetLonOk returns a tuple with the Lon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrafficPoint) GetLonOk() (*float32, bool) {
if o == nil || IsNil(o.Lon) {
return nil, false
}
return o.Lon, true
}
// HasLon returns a boolean if a field has been set.
func (o *TrafficPoint) HasLon() bool {
if o != nil && !IsNil(o.Lon) {
return true
}
return false
}
// SetLon gets a reference to the given float32 and assigns it to the Lon field.
func (o *TrafficPoint) SetLon(v float32) {
o.Lon = &v
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *TrafficPoint) GetRegion() string {
if o == nil || IsNil(o.Region) {
var ret string
return ret
}
return *o.Region
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrafficPoint) GetRegionOk() (*string, bool) {
if o == nil || IsNil(o.Region) {
return nil, false
}
return o.Region, true
}
// HasRegion returns a boolean if a field has been set.
func (o *TrafficPoint) HasRegion() bool {
if o != nil && !IsNil(o.Region) {
return true
}
return false
}
// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *TrafficPoint) SetRegion(v string) {
o.Region = &v
}
func (o TrafficPoint) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TrafficPoint) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ByService) {
toSerialize["byService"] = o.ByService
}
if !IsNil(o.ByTask) {
toSerialize["byTask"] = o.ByTask
}
if !IsNil(o.Count) {
toSerialize["count"] = o.Count
}
if !IsNil(o.Country) {
toSerialize["country"] = o.Country
}
if !IsNil(o.Lat) {
toSerialize["lat"] = o.Lat
}
if !IsNil(o.Lon) {
toSerialize["lon"] = o.Lon
}
if !IsNil(o.Region) {
toSerialize["region"] = o.Region
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *TrafficPoint) UnmarshalJSON(data []byte) (err error) {
varTrafficPoint := _TrafficPoint{}
err = json.Unmarshal(data, &varTrafficPoint)
if err != nil {
return err
}
*o = TrafficPoint(varTrafficPoint)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "byService")
delete(additionalProperties, "byTask")
delete(additionalProperties, "count")
delete(additionalProperties, "country")
delete(additionalProperties, "lat")
delete(additionalProperties, "lon")
delete(additionalProperties, "region")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableTrafficPoint struct {
value *TrafficPoint
isSet bool
}
func (v NullableTrafficPoint) Get() *TrafficPoint {
return v.value
}
func (v *NullableTrafficPoint) Set(val *TrafficPoint) {
v.value = val
v.isSet = true
}
func (v NullableTrafficPoint) IsSet() bool {
return v.isSet
}
func (v *NullableTrafficPoint) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrafficPoint(val *TrafficPoint) *NullableTrafficPoint {
return &NullableTrafficPoint{value: val, isSet: true}
}
func (v NullableTrafficPoint) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrafficPoint) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}