// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"encoding/json"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/validate"
)

// CommonMetricKind  - COUNTER: Incrementing counters that never decrease (these are not reset on each
// reading).
//   - ABSOLUTE: Counters that do get reset upon reading.
//   - GAUGE: E.g. a temperature value.
//
// swagger:model commonMetricKind
type CommonMetricKind string

func NewCommonMetricKind(value CommonMetricKind) *CommonMetricKind {
	return &value
}

// Pointer returns a pointer to a freshly-allocated CommonMetricKind.
func (m CommonMetricKind) Pointer() *CommonMetricKind {
	return &m
}

const (

	// CommonMetricKindCOUNTER captures enum value "COUNTER"
	CommonMetricKindCOUNTER CommonMetricKind = "COUNTER"

	// CommonMetricKindABSOLUTE captures enum value "ABSOLUTE"
	CommonMetricKindABSOLUTE CommonMetricKind = "ABSOLUTE"

	// CommonMetricKindGAUGE captures enum value "GAUGE"
	CommonMetricKindGAUGE CommonMetricKind = "GAUGE"
)

// for schema
var commonMetricKindEnum []interface{}

func init() {
	var res []CommonMetricKind
	if err := json.Unmarshal([]byte(`["COUNTER","ABSOLUTE","GAUGE"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		commonMetricKindEnum = append(commonMetricKindEnum, v)
	}
}

func (m CommonMetricKind) validateCommonMetricKindEnum(path, location string, value CommonMetricKind) error {
	if err := validate.EnumCase(path, location, value, commonMetricKindEnum, true); err != nil {
		return err
	}
	return nil
}

// Validate validates this common metric kind
func (m CommonMetricKind) Validate(formats strfmt.Registry) error {
	var res []error

	// value enum
	if err := m.validateCommonMetricKindEnum("", "body", m); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

// ContextValidate validates this common metric kind based on context it is used
func (m CommonMetricKind) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
