Files
influx-cli/internal/api/model_duration_literal_values.gen.go
2021-05-05 11:01:24 -04:00

187 lines
5.0 KiB
Go

/*
* 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"
)
// DurationLiteralValues A pair consisting of length of time and the unit of time measured. It is the atomic unit from which all duration literals are composed.
type DurationLiteralValues struct {
// Type of AST node
Type *string `json:"type,omitempty"`
Magnitude *int32 `json:"magnitude,omitempty"`
Unit *string `json:"unit,omitempty"`
}
// NewDurationLiteralValues instantiates a new DurationLiteralValues 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 NewDurationLiteralValues() *DurationLiteralValues {
this := DurationLiteralValues{}
return &this
}
// NewDurationLiteralValuesWithDefaults instantiates a new DurationLiteralValues 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 NewDurationLiteralValuesWithDefaults() *DurationLiteralValues {
this := DurationLiteralValues{}
return &this
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *DurationLiteralValues) 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 *DurationLiteralValues) 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 *DurationLiteralValues) 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 *DurationLiteralValues) SetType(v string) {
o.Type = &v
}
// GetMagnitude returns the Magnitude field value if set, zero value otherwise.
func (o *DurationLiteralValues) GetMagnitude() int32 {
if o == nil || o.Magnitude == nil {
var ret int32
return ret
}
return *o.Magnitude
}
// GetMagnitudeOk returns a tuple with the Magnitude field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DurationLiteralValues) GetMagnitudeOk() (*int32, bool) {
if o == nil || o.Magnitude == nil {
return nil, false
}
return o.Magnitude, true
}
// HasMagnitude returns a boolean if a field has been set.
func (o *DurationLiteralValues) HasMagnitude() bool {
if o != nil && o.Magnitude != nil {
return true
}
return false
}
// SetMagnitude gets a reference to the given int32 and assigns it to the Magnitude field.
func (o *DurationLiteralValues) SetMagnitude(v int32) {
o.Magnitude = &v
}
// GetUnit returns the Unit field value if set, zero value otherwise.
func (o *DurationLiteralValues) GetUnit() string {
if o == nil || o.Unit == nil {
var ret string
return ret
}
return *o.Unit
}
// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DurationLiteralValues) GetUnitOk() (*string, bool) {
if o == nil || o.Unit == nil {
return nil, false
}
return o.Unit, true
}
// HasUnit returns a boolean if a field has been set.
func (o *DurationLiteralValues) HasUnit() bool {
if o != nil && o.Unit != nil {
return true
}
return false
}
// SetUnit gets a reference to the given string and assigns it to the Unit field.
func (o *DurationLiteralValues) SetUnit(v string) {
o.Unit = &v
}
func (o DurationLiteralValues) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Type != nil {
toSerialize["type"] = o.Type
}
if o.Magnitude != nil {
toSerialize["magnitude"] = o.Magnitude
}
if o.Unit != nil {
toSerialize["unit"] = o.Unit
}
return json.Marshal(toSerialize)
}
type NullableDurationLiteralValues struct {
value *DurationLiteralValues
isSet bool
}
func (v NullableDurationLiteralValues) Get() *DurationLiteralValues {
return v.value
}
func (v *NullableDurationLiteralValues) Set(val *DurationLiteralValues) {
v.value = val
v.isSet = true
}
func (v NullableDurationLiteralValues) IsSet() bool {
return v.isSet
}
func (v *NullableDurationLiteralValues) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDurationLiteralValues(val *DurationLiteralValues) *NullableDurationLiteralValues {
return &NullableDurationLiteralValues{value: val, isSet: true}
}
func (v NullableDurationLiteralValues) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDurationLiteralValues) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}