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

// Billing20201105Unit Unit is an enum with all possible measurement units
// the system accepts.
//
//   - HOUR: Valid for static products.
//
// swagger:model billing_20201105Unit
type Billing20201105Unit string

func NewBilling20201105Unit(value Billing20201105Unit) *Billing20201105Unit {
	return &value
}

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

const (

	// Billing20201105UnitNOUNIT captures enum value "NO_UNIT"
	Billing20201105UnitNOUNIT Billing20201105Unit = "NO_UNIT"

	// Billing20201105UnitHOUR captures enum value "HOUR"
	Billing20201105UnitHOUR Billing20201105Unit = "HOUR"

	// Billing20201105UnitMINUTE captures enum value "MINUTE"
	Billing20201105UnitMINUTE Billing20201105Unit = "MINUTE"

	// Billing20201105UnitUNIT captures enum value "UNIT"
	Billing20201105UnitUNIT Billing20201105Unit = "UNIT"

	// Billing20201105UnitMONTH captures enum value "MONTH"
	Billing20201105UnitMONTH Billing20201105Unit = "MONTH"
)

// for schema
var billing20201105UnitEnum []interface{}

func init() {
	var res []Billing20201105Unit
	if err := json.Unmarshal([]byte(`["NO_UNIT","HOUR","MINUTE","UNIT","MONTH"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		billing20201105UnitEnum = append(billing20201105UnitEnum, v)
	}
}

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

// Validate validates this billing 20201105 unit
func (m Billing20201105Unit) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this billing 20201105 unit based on context it is used
func (m Billing20201105Unit) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
