model_timeseries_specifier_metric.go•3.6 kB
/*
Metoro Alerts API
API for managing alerts in the Metoro observability platform.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package model
import (
"encoding/json"
)
// checks if the TimeseriesSpecifierMetric type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TimeseriesSpecifierMetric{}
// TimeseriesSpecifierMetric Configuration for a metric timeseries
type TimeseriesSpecifierMetric struct {
// Name of the metric
MetricName *string `json:"metricName,omitempty"`
}
// NewTimeseriesSpecifierMetric instantiates a new TimeseriesSpecifierMetric 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 NewTimeseriesSpecifierMetric() *TimeseriesSpecifierMetric {
this := TimeseriesSpecifierMetric{}
return &this
}
// NewTimeseriesSpecifierMetricWithDefaults instantiates a new TimeseriesSpecifierMetric 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 NewTimeseriesSpecifierMetricWithDefaults() *TimeseriesSpecifierMetric {
this := TimeseriesSpecifierMetric{}
return &this
}
// GetMetricName returns the MetricName field value if set, zero value otherwise.
func (o *TimeseriesSpecifierMetric) GetMetricName() string {
if o == nil || IsNil(o.MetricName) {
var ret string
return ret
}
return *o.MetricName
}
// GetMetricNameOk returns a tuple with the MetricName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TimeseriesSpecifierMetric) GetMetricNameOk() (*string, bool) {
if o == nil || IsNil(o.MetricName) {
return nil, false
}
return o.MetricName, true
}
// HasMetricName returns a boolean if a field has been set.
func (o *TimeseriesSpecifierMetric) HasMetricName() bool {
if o != nil && !IsNil(o.MetricName) {
return true
}
return false
}
// SetMetricName gets a reference to the given string and assigns it to the MetricName field.
func (o *TimeseriesSpecifierMetric) SetMetricName(v string) {
o.MetricName = &v
}
func (o TimeseriesSpecifierMetric) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TimeseriesSpecifierMetric) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.MetricName) {
toSerialize["metricName"] = o.MetricName
}
return toSerialize, nil
}
type NullableTimeseriesSpecifierMetric struct {
value *TimeseriesSpecifierMetric
isSet bool
}
func (v NullableTimeseriesSpecifierMetric) Get() *TimeseriesSpecifierMetric {
return v.value
}
func (v *NullableTimeseriesSpecifierMetric) Set(val *TimeseriesSpecifierMetric) {
v.value = val
v.isSet = true
}
func (v NullableTimeseriesSpecifierMetric) IsSet() bool {
return v.isSet
}
func (v *NullableTimeseriesSpecifierMetric) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTimeseriesSpecifierMetric(val *TimeseriesSpecifierMetric) *NullableTimeseriesSpecifierMetric {
return &NullableTimeseriesSpecifierMetric{value: val, isSet: true}
}
func (v NullableTimeseriesSpecifierMetric) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTimeseriesSpecifierMetric) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}