mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
9.8 KiB
Go
383 lines
9.8 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 EventTimeseries type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &EventTimeseries{}
|
|
|
|
// EventTimeseries struct for EventTimeseries
|
|
type EventTimeseries struct {
|
|
// End is the window's exclusive upper bound, RFC3339 UTC.
|
|
End *string `json:"end,omitempty"`
|
|
// Interval is the bucket width: hour or day.
|
|
Interval *string `json:"interval,omitempty"`
|
|
// Range is the window that was actually applied: 24h, 7d, 30d or custom.
|
|
Range *string `json:"range,omitempty"`
|
|
// Scope names the tenant these numbers belong to.
|
|
Scope *EventScope `json:"scope,omitempty"`
|
|
// Series is one point per bucket, oldest first, with empty buckets zero-filled.
|
|
Series []EventUsagePoint `json:"series,omitempty"`
|
|
// Source is the warehouse table the series read.
|
|
Source *string `json:"source,omitempty"`
|
|
// Start is the window's inclusive lower bound, RFC3339 UTC.
|
|
Start *string `json:"start,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _EventTimeseries EventTimeseries
|
|
|
|
// NewEventTimeseries instantiates a new EventTimeseries 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 NewEventTimeseries() *EventTimeseries {
|
|
this := EventTimeseries{}
|
|
return &this
|
|
}
|
|
|
|
// NewEventTimeseriesWithDefaults instantiates a new EventTimeseries 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 NewEventTimeseriesWithDefaults() *EventTimeseries {
|
|
this := EventTimeseries{}
|
|
return &this
|
|
}
|
|
|
|
// GetEnd returns the End field value if set, zero value otherwise.
|
|
func (o *EventTimeseries) GetEnd() string {
|
|
if o == nil || IsNil(o.End) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.End
|
|
}
|
|
|
|
// GetEndOk returns a tuple with the End field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTimeseries) GetEndOk() (*string, bool) {
|
|
if o == nil || IsNil(o.End) {
|
|
return nil, false
|
|
}
|
|
return o.End, true
|
|
}
|
|
|
|
// HasEnd returns a boolean if a field has been set.
|
|
func (o *EventTimeseries) HasEnd() bool {
|
|
if o != nil && !IsNil(o.End) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEnd gets a reference to the given string and assigns it to the End field.
|
|
func (o *EventTimeseries) SetEnd(v string) {
|
|
o.End = &v
|
|
}
|
|
|
|
// GetInterval returns the Interval field value if set, zero value otherwise.
|
|
func (o *EventTimeseries) GetInterval() string {
|
|
if o == nil || IsNil(o.Interval) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Interval
|
|
}
|
|
|
|
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTimeseries) GetIntervalOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Interval) {
|
|
return nil, false
|
|
}
|
|
return o.Interval, true
|
|
}
|
|
|
|
// HasInterval returns a boolean if a field has been set.
|
|
func (o *EventTimeseries) HasInterval() bool {
|
|
if o != nil && !IsNil(o.Interval) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetInterval gets a reference to the given string and assigns it to the Interval field.
|
|
func (o *EventTimeseries) SetInterval(v string) {
|
|
o.Interval = &v
|
|
}
|
|
|
|
// GetRange returns the Range field value if set, zero value otherwise.
|
|
func (o *EventTimeseries) GetRange() string {
|
|
if o == nil || IsNil(o.Range) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Range
|
|
}
|
|
|
|
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTimeseries) GetRangeOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Range) {
|
|
return nil, false
|
|
}
|
|
return o.Range, true
|
|
}
|
|
|
|
// HasRange returns a boolean if a field has been set.
|
|
func (o *EventTimeseries) HasRange() bool {
|
|
if o != nil && !IsNil(o.Range) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRange gets a reference to the given string and assigns it to the Range field.
|
|
func (o *EventTimeseries) SetRange(v string) {
|
|
o.Range = &v
|
|
}
|
|
|
|
// GetScope returns the Scope field value if set, zero value otherwise.
|
|
func (o *EventTimeseries) GetScope() EventScope {
|
|
if o == nil || IsNil(o.Scope) {
|
|
var ret EventScope
|
|
return ret
|
|
}
|
|
return *o.Scope
|
|
}
|
|
|
|
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTimeseries) GetScopeOk() (*EventScope, bool) {
|
|
if o == nil || IsNil(o.Scope) {
|
|
return nil, false
|
|
}
|
|
return o.Scope, true
|
|
}
|
|
|
|
// HasScope returns a boolean if a field has been set.
|
|
func (o *EventTimeseries) HasScope() bool {
|
|
if o != nil && !IsNil(o.Scope) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetScope gets a reference to the given EventScope and assigns it to the Scope field.
|
|
func (o *EventTimeseries) SetScope(v EventScope) {
|
|
o.Scope = &v
|
|
}
|
|
|
|
// GetSeries returns the Series field value if set, zero value otherwise.
|
|
func (o *EventTimeseries) GetSeries() []EventUsagePoint {
|
|
if o == nil || IsNil(o.Series) {
|
|
var ret []EventUsagePoint
|
|
return ret
|
|
}
|
|
return o.Series
|
|
}
|
|
|
|
// GetSeriesOk returns a tuple with the Series field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTimeseries) GetSeriesOk() ([]EventUsagePoint, bool) {
|
|
if o == nil || IsNil(o.Series) {
|
|
return nil, false
|
|
}
|
|
return o.Series, true
|
|
}
|
|
|
|
// HasSeries returns a boolean if a field has been set.
|
|
func (o *EventTimeseries) HasSeries() bool {
|
|
if o != nil && !IsNil(o.Series) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeries gets a reference to the given []EventUsagePoint and assigns it to the Series field.
|
|
func (o *EventTimeseries) SetSeries(v []EventUsagePoint) {
|
|
o.Series = v
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *EventTimeseries) GetSource() string {
|
|
if o == nil || IsNil(o.Source) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Source
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTimeseries) GetSourceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Source) {
|
|
return nil, false
|
|
}
|
|
return o.Source, true
|
|
}
|
|
|
|
// HasSource returns a boolean if a field has been set.
|
|
func (o *EventTimeseries) HasSource() bool {
|
|
if o != nil && !IsNil(o.Source) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSource gets a reference to the given string and assigns it to the Source field.
|
|
func (o *EventTimeseries) SetSource(v string) {
|
|
o.Source = &v
|
|
}
|
|
|
|
// GetStart returns the Start field value if set, zero value otherwise.
|
|
func (o *EventTimeseries) GetStart() string {
|
|
if o == nil || IsNil(o.Start) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Start
|
|
}
|
|
|
|
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *EventTimeseries) GetStartOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Start) {
|
|
return nil, false
|
|
}
|
|
return o.Start, true
|
|
}
|
|
|
|
// HasStart returns a boolean if a field has been set.
|
|
func (o *EventTimeseries) HasStart() bool {
|
|
if o != nil && !IsNil(o.Start) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStart gets a reference to the given string and assigns it to the Start field.
|
|
func (o *EventTimeseries) SetStart(v string) {
|
|
o.Start = &v
|
|
}
|
|
|
|
func (o EventTimeseries) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o EventTimeseries) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.End) {
|
|
toSerialize["end"] = o.End
|
|
}
|
|
if !IsNil(o.Interval) {
|
|
toSerialize["interval"] = o.Interval
|
|
}
|
|
if !IsNil(o.Range) {
|
|
toSerialize["range"] = o.Range
|
|
}
|
|
if !IsNil(o.Scope) {
|
|
toSerialize["scope"] = o.Scope
|
|
}
|
|
if !IsNil(o.Series) {
|
|
toSerialize["series"] = o.Series
|
|
}
|
|
if !IsNil(o.Source) {
|
|
toSerialize["source"] = o.Source
|
|
}
|
|
if !IsNil(o.Start) {
|
|
toSerialize["start"] = o.Start
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *EventTimeseries) UnmarshalJSON(data []byte) (err error) {
|
|
varEventTimeseries := _EventTimeseries{}
|
|
|
|
err = json.Unmarshal(data, &varEventTimeseries)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = EventTimeseries(varEventTimeseries)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "end")
|
|
delete(additionalProperties, "interval")
|
|
delete(additionalProperties, "range")
|
|
delete(additionalProperties, "scope")
|
|
delete(additionalProperties, "series")
|
|
delete(additionalProperties, "source")
|
|
delete(additionalProperties, "start")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableEventTimeseries struct {
|
|
value *EventTimeseries
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableEventTimeseries) Get() *EventTimeseries {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableEventTimeseries) Set(val *EventTimeseries) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableEventTimeseries) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableEventTimeseries) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableEventTimeseries(val *EventTimeseries) *NullableEventTimeseries {
|
|
return &NullableEventTimeseries{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableEventTimeseries) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableEventTimeseries) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|