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

package run_model

// 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"
)

// RunMetricFormat  - UNSPECIFIED: Default value if not present.
//   - RAW: Display value as its raw format.
//   - PERCENTAGE: Display value in percentage format.
//
// swagger:model RunMetricFormat
type RunMetricFormat string

func NewRunMetricFormat(value RunMetricFormat) *RunMetricFormat {
	return &value
}

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

const (

	// RunMetricFormatUNSPECIFIED captures enum value "UNSPECIFIED"
	RunMetricFormatUNSPECIFIED RunMetricFormat = "UNSPECIFIED"

	// RunMetricFormatRAW captures enum value "RAW"
	RunMetricFormatRAW RunMetricFormat = "RAW"

	// RunMetricFormatPERCENTAGE captures enum value "PERCENTAGE"
	RunMetricFormatPERCENTAGE RunMetricFormat = "PERCENTAGE"
)

// for schema
var runMetricFormatEnum []interface{}

func init() {
	var res []RunMetricFormat
	if err := json.Unmarshal([]byte(`["UNSPECIFIED","RAW","PERCENTAGE"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		runMetricFormatEnum = append(runMetricFormatEnum, v)
	}
}

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

// Validate validates this run metric format
func (m RunMetricFormat) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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