/* * Subset of Influx API covered by Influx CLI * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * API version: 2.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package api import ( "encoding/json" ) // DurationLiteral Represents the elapsed time between two instants as an int64 nanosecond count with syntax of golang's time.Duration type DurationLiteral struct { // Type of AST node Type *string `json:"type,omitempty"` // Duration values Values *[]DurationLiteralValues `json:"values,omitempty"` } // NewDurationLiteral instantiates a new DurationLiteral 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 NewDurationLiteral() *DurationLiteral { this := DurationLiteral{} return &this } // NewDurationLiteralWithDefaults instantiates a new DurationLiteral 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 NewDurationLiteralWithDefaults() *DurationLiteral { this := DurationLiteral{} return &this } // GetType returns the Type field value if set, zero value otherwise. func (o *DurationLiteral) GetType() string { if o == nil || o.Type == nil { var ret string return ret } return *o.Type } // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DurationLiteral) GetTypeOk() (*string, bool) { if o == nil || o.Type == nil { return nil, false } return o.Type, true } // HasType returns a boolean if a field has been set. func (o *DurationLiteral) HasType() bool { if o != nil && o.Type != nil { return true } return false } // SetType gets a reference to the given string and assigns it to the Type field. func (o *DurationLiteral) SetType(v string) { o.Type = &v } // GetValues returns the Values field value if set, zero value otherwise. func (o *DurationLiteral) GetValues() []DurationLiteralValues { if o == nil || o.Values == nil { var ret []DurationLiteralValues return ret } return *o.Values } // GetValuesOk returns a tuple with the Values field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DurationLiteral) GetValuesOk() (*[]DurationLiteralValues, bool) { if o == nil || o.Values == nil { return nil, false } return o.Values, true } // HasValues returns a boolean if a field has been set. func (o *DurationLiteral) HasValues() bool { if o != nil && o.Values != nil { return true } return false } // SetValues gets a reference to the given []DurationLiteralValues and assigns it to the Values field. func (o *DurationLiteral) SetValues(v []DurationLiteralValues) { o.Values = &v } func (o DurationLiteral) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Type != nil { toSerialize["type"] = o.Type } if o.Values != nil { toSerialize["values"] = o.Values } return json.Marshal(toSerialize) } type NullableDurationLiteral struct { value *DurationLiteral isSet bool } func (v NullableDurationLiteral) Get() *DurationLiteral { return v.value } func (v *NullableDurationLiteral) Set(val *DurationLiteral) { v.value = val v.isSet = true } func (v NullableDurationLiteral) IsSet() bool { return v.isSet } func (v *NullableDurationLiteral) Unset() { v.value = nil v.isSet = false } func NewNullableDurationLiteral(val *DurationLiteral) *NullableDurationLiteral { return &NullableDurationLiteral{value: val, isSet: true} } func (v NullableDurationLiteral) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableDurationLiteral) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }